index.js 621 B

123456789101112131415161718192021
  1. "use strict";
  2. const cloudbase_1 = require("./cloudbase");
  3. const symbol_1 = require("./const/symbol");
  4. const { version } = require('../package.json');
  5. module.exports = {
  6. init: (config) => {
  7. return new cloudbase_1.CloudBase(config);
  8. },
  9. parseContext: (context) => {
  10. // 校验context 是否正确
  11. return cloudbase_1.CloudBase.parseContext(context);
  12. },
  13. version,
  14. getCloudbaseContext: (context) => {
  15. return cloudbase_1.CloudBase.getCloudbaseContext(context);
  16. },
  17. /**
  18. * 云函数下获取当前env
  19. */
  20. SYMBOL_CURRENT_ENV: symbol_1.SYMBOL_CURRENT_ENV
  21. };