miniprogram-ci 1.5.1 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/README.md +71 -0
- package/dist/@types/ci/code-analyse.d.ts +4 -0
- package/dist/@types/ci/getLatestVersion.d.ts +7 -0
- package/dist/@types/ci/project.d.ts +4 -0
- package/dist/@types/cloud/cloudapi.d.ts +1 -1
- package/dist/@types/cloud/uploadContainer.d.ts +36 -7
- package/dist/@types/config.d.ts +3 -3
- package/dist/@types/core/js/enhance.d.ts +1 -0
- package/dist/@types/core/js/generateMap.d.ts +3 -0
- package/dist/@types/core/json/app/checkAppFields.d.ts +1 -0
- package/dist/@types/core/json/projectWithMockBuffer.d.ts +14 -0
- package/dist/@types/core/json/reactiveCache.d.ts +4 -0
- package/dist/@types/core/protect/uglifyfilenames.d.ts +2 -4
- package/dist/@types/core/worker_thread/task/minifywxml.d.ts +7 -0
- package/dist/@types/core.d.ts +1 -1
- package/dist/@types/index.d.ts +6 -0
- package/dist/@types/summer/ci.d.ts +3 -0
- package/dist/@types/summer/devtool.d.ts +9 -1
- package/dist/@types/summer/error.d.ts +14 -5
- package/dist/@types/summer/graph/appgraph.d.ts +1 -0
- package/dist/@types/summer/graph/basegraph.d.ts +4 -0
- package/dist/@types/summer/graph/plugingraph.d.ts +2 -1
- package/dist/@types/summer/initPlugin.d.ts +1 -1
- package/dist/@types/summer/module.d.ts +3 -2
- package/dist/@types/summer/plugins/base/es6module.d.ts +4 -2
- package/dist/@types/summer/plugins/base/wxss.d.ts +1 -1
- package/dist/@types/summer/plugins/enhance.d.ts +3 -1
- package/dist/@types/summer/plugins/index.d.ts +1 -16
- package/dist/@types/summer/project.d.ts +5 -3
- package/dist/@types/summer/summer.d.ts +2 -1
- package/dist/@types/summer/types.d.ts +1 -0
- package/dist/@types/types/index.d.ts +5 -0
- package/dist/@types/types/miniprogram-json/app.d.ts +2 -1
- package/dist/@types/types/miniprogram-json/page.d.ts +1 -0
- package/dist/@types/types/miniprogram-json/projectconfig.d.ts +2 -0
- package/dist/@types/utils/locales/locales.d.ts +4 -0
- package/dist/@types/utils/locales/zh.d.ts +4 -0
- package/dist/@types/utils/tools.d.ts +1 -0
- package/dist/@types/utils/url_config.d.ts +1 -0
- package/dist/@types/vendor/code-analyse/index.d.ts +4 -3
- package/dist/ci/code-analyse.js +3 -0
- package/dist/ci/cos-upload.js +3 -1
- package/dist/ci/getCompiledResult.js +3 -1
- package/dist/ci/getDevSourceMap.js +3 -1
- package/dist/ci/getLatestVersion.js +3 -0
- package/dist/ci/jsserver.js +3 -1
- package/dist/ci/preview.js +3 -1
- package/dist/ci/project.js +3 -1
- package/dist/ci/projectattr.js +3 -1
- package/dist/ci/upload.js +3 -1
- package/dist/ci/utils/pack.js +3 -1
- package/dist/ci/utils/packfile.js +3 -1
- package/dist/ci/utils/terminalQrcode.js +3 -1
- package/dist/cli.js +3 -1
- package/dist/cloud/cloudapi.js +3 -1
- package/dist/cloud/createTimeTrigger.js +3 -1
- package/dist/cloud/uploadContainer.js +3 -1
- package/dist/cloud/uploadFile.js +3 -1
- package/dist/cloud/uploadFunction.js +3 -1
- package/dist/cloud/utils.js +3 -1
- package/dist/config.js +3 -1
- package/dist/core/analyse/partial.js +3 -1
- package/dist/core/compile/common.js +3 -1
- package/dist/core/compile/game.js +3 -1
- package/dist/core/compile/game_plugin.js +3 -1
- package/dist/core/compile/handler/js.js +3 -1
- package/dist/core/compile/handler/mpjson.js +3 -1
- package/dist/core/compile/handler/wxml.js +3 -1
- package/dist/core/compile/handler/wxss.js +3 -1
- package/dist/core/compile/index.js +3 -1
- package/dist/core/compile/mini_program.js +3 -1
- package/dist/core/compile/mini_program_plugin.js +3 -1
- package/dist/core/js/enhance.js +1 -1
- package/dist/core/js/generateMap.js +1 -0
- package/dist/core/js/index.js +1 -1
- package/dist/core/js/minifyjs_after_wrap.js +1 -1
- package/dist/core/json/app/checkAppFields.js +3 -1
- package/dist/core/json/app/getAppJSON.js +3 -1
- package/dist/core/json/app/getExtJSON.js +3 -1
- package/dist/core/json/app/index.js +3 -1
- package/dist/core/json/common.js +3 -1
- package/dist/core/json/game.js +3 -1
- package/dist/core/json/page/checkPageJSON.js +3 -1
- package/dist/core/json/page/getPageJSON.js +3 -1
- package/dist/core/json/plugin/plugin.js +3 -1
- package/dist/core/json/plugin/plugin_page.js +3 -1
- package/dist/core/json/projectWithMockBuffer.js +3 -0
- package/dist/core/json/projectconfig.js +3 -1
- package/dist/core/json/reactiveCache.js +3 -1
- package/dist/core/json/signaturejson.js +3 -1
- package/dist/core/json/sitemap.js +3 -1
- package/dist/core/json/theme.js +3 -1
- package/dist/core/npm/filterdeps.js +3 -1
- package/dist/core/npm/packnpm.js +3 -1
- package/dist/core/protect/file_flatter.js +3 -1
- package/dist/core/protect/uglifyfilenames.js +3 -1
- package/dist/core/utils/env.js +3 -1
- package/dist/core/utils/logger.js +3 -1
- package/dist/core/validate/validate.js +1 -1
- package/dist/core/worker_thread/childprocess.js +1 -1
- package/dist/core/worker_thread/childprocess_manager.js +1 -1
- package/dist/core/worker_thread/fork.js +1 -1
- package/dist/core/worker_thread/index.js +1 -1
- package/dist/core/worker_thread/task/call_func.js +1 -1
- package/dist/core/worker_thread/task/compilejs.js +1 -1
- package/dist/core/worker_thread/task/compilewxss.js +1 -1
- package/dist/core/worker_thread/task/func.js +1 -1
- package/dist/core/worker_thread/task/minifywxml.js +1 -1
- package/dist/core/worker_thread/worker.js +1 -1
- package/dist/core/worker_thread/worker_manager.js +1 -1
- package/dist/core.js +3 -1
- package/dist/index.js +3 -1
- package/dist/manifest.json +3 -3
- package/dist/summer/ci.js +3 -0
- package/dist/summer/devtool.js +3 -1
- package/dist/summer/entry_process.js +1 -1
- package/dist/summer/error.js +3 -1
- package/dist/summer/graph/appconf.js +3 -1
- package/dist/summer/graph/appgraph.js +3 -1
- package/dist/summer/graph/basegraph.js +3 -1
- package/dist/summer/graph/pluginconf.js +3 -1
- package/dist/summer/graph/plugingraph.js +3 -1
- package/dist/summer/index.js +3 -1
- package/dist/summer/initPlugin.js +3 -1
- package/dist/summer/module.js +3 -1
- package/dist/summer/persist_cache.js +3 -1
- package/dist/summer/plugin_driver.js +3 -1
- package/dist/summer/plugins/base/es6module.js +1 -1
- package/dist/summer/plugins/base/javascript.js +1 -1
- package/dist/summer/plugins/base/wxss.js +1 -1
- package/dist/summer/plugins/enhance.js +1 -1
- package/dist/summer/plugins/index.js +1 -1
- package/dist/summer/plugins/less.js +1 -1
- package/dist/summer/plugins/sass.js +1 -1
- package/dist/summer/plugins/terser.js +1 -1
- package/dist/summer/plugins/typescript.js +1 -1
- package/dist/summer/project.js +3 -1
- package/dist/summer/recorder.js +3 -1
- package/dist/summer/resolver.js +3 -1
- package/dist/summer/summer.js +3 -1
- package/dist/summer/types.js +3 -1
- package/dist/summer/utils/async.js +3 -1
- package/dist/summer/utils/ensureArray.js +3 -1
- package/dist/summer/worker.js +3 -1
- package/dist/types/index.js +3 -1
- package/dist/types/miniprogram-json/app.js +3 -1
- package/dist/types/miniprogram-json/base.js +3 -1
- package/dist/types/miniprogram-json/ext.js +3 -1
- package/dist/types/miniprogram-json/game.js +3 -1
- package/dist/types/miniprogram-json/index.js +3 -1
- package/dist/types/miniprogram-json/page.js +3 -1
- package/dist/types/miniprogram-json/plugin.js +3 -1
- package/dist/types/miniprogram-json/projectconfig.js +3 -1
- package/dist/types/miniprogram-json/sitemap.js +3 -1
- package/dist/types/miniprogram-json/theme.js +3 -1
- package/dist/utils/babel_helper.js +3 -1
- package/dist/utils/babel_transform_plugin.js +3 -1
- package/dist/utils/cache.js +3 -1
- package/dist/utils/common.js +3 -1
- package/dist/utils/error.js +3 -1
- package/dist/utils/fs.js +3 -1
- package/dist/utils/fsagent.js +3 -1
- package/dist/utils/glob.js +3 -1
- package/dist/utils/interruptibletask.js +3 -1
- package/dist/utils/jsonParse.js +3 -1
- package/dist/utils/jsonlint.js +3 -1
- package/dist/utils/locales/en.js +3 -1
- package/dist/utils/locales/fomatable_string.js +3 -1
- package/dist/utils/locales/locales.js +3 -1
- package/dist/utils/locales/zh.js +3 -1
- package/dist/utils/log.js +3 -1
- package/dist/utils/report.js +3 -1
- package/dist/utils/request.js +3 -1
- package/dist/utils/sign.js +3 -1
- package/dist/utils/taskstatus.js +3 -1
- package/dist/utils/tools.js +3 -1
- package/dist/utils/url_config.js +3 -1
- package/dist/utils/white_ext_list.js +3 -1
- package/dist/utils/wxvpkgreader/wxvpkgreader.js +1 -1
- package/dist/vendor/cloud-api/src/apis/apis.js +3 -1
- package/dist/vendor/cloud-api/src/apis/cdn/cdn.apis.js +3 -1
- package/dist/vendor/cloud-api/src/apis/cdn/index.js +3 -1
- package/dist/vendor/cloud-api/src/apis/flexdb/flexdb.apis.js +3 -1
- package/dist/vendor/cloud-api/src/apis/flexdb/index.js +3 -1
- package/dist/vendor/cloud-api/src/apis/scf/index.js +3 -1
- package/dist/vendor/cloud-api/src/apis/scf/scf.apis.js +3 -1
- package/dist/vendor/cloud-api/src/apis/ssl/index.js +3 -1
- package/dist/vendor/cloud-api/src/apis/ssl/ssl.apis.js +3 -1
- package/dist/vendor/cloud-api/src/apis/tcb/general.apis.js +3 -1
- package/dist/vendor/cloud-api/src/apis/tcb/index.js +3 -1
- package/dist/vendor/cloud-api/src/apis/tcb/tcb.apis.js +3 -1
- package/dist/vendor/cloud-api/src/index.js +3 -1
- package/dist/vendor/cloud-api/src/transaction/contracts/cdn.contracts.js +3 -1
- package/dist/vendor/cloud-api/src/transaction/contracts/contracts.js +3 -1
- package/dist/vendor/cloud-api/src/transaction/contracts/factory.js +3 -1
- package/dist/vendor/cloud-api/src/transaction/contracts/flexdb.contracts.js +3 -1
- package/dist/vendor/cloud-api/src/transaction/contracts/scf.contracts.js +3 -1
- package/dist/vendor/cloud-api/src/transaction/contracts/ssl.contracts.js +3 -1
- package/dist/vendor/cloud-api/src/transaction/contracts/tcb.contracts.js +3 -1
- package/dist/vendor/cloud-api/src/transaction/transactor.js +3 -1
- package/dist/vendor/cloud-api/src/transaction/validations/cdn.validations.js +3 -1
- package/dist/vendor/cloud-api/src/transaction/validations/common.validations.js +3 -1
- package/dist/vendor/cloud-api/src/transaction/validations/flexdb.validations.js +3 -1
- package/dist/vendor/cloud-api/src/transaction/validations/scf.validations.js +3 -1
- package/dist/vendor/cloud-api/src/transaction/validations/ssl.validations.js +3 -1
- package/dist/vendor/cloud-api/src/transaction/validations/tcb.validations.js +3 -1
- package/dist/vendor/cloud-api/src/transaction/validations/validations.js +3 -1
- package/dist/vendor/cloud-api/src/utils/common.js +3 -1
- package/dist/vendor/cloud-api/src/utils/validator.js +3 -1
- package/dist/vendor/code-analyse/index.js +1 -1
- package/dist/vendor/schema/dist/app.js +26 -1
- package/dist/vendor/schema/dist/ext.js +21 -1
- package/dist/vendor/schema/dist/game.js +29 -1
- package/dist/vendor/schema/dist/page.js +18 -1
- package/dist/vendor/schema/dist/plugin.js +1 -1
- package/dist/vendor/schema/dist/pluginpage.js +1 -1
- package/dist/vendor/schema/dist/projectconfig.js +38 -1
- package/dist/vendor/schema/dist/sitemap.js +1 -1
- package/dist/vendor/schema/dist/theme.js +1 -1
- package/package.json +22 -24
- package/dist/@types/core/js/__tests__/minifyjs.spec.d.ts +0 -1
- package/dist/@types/summer/backup/appconf/index-old.d.ts +0 -0
- package/dist/@types/summer/backup/appconf/index.d.ts +0 -33
- package/dist/@types/summer/backup/detectors/es6/BasicEvaluatedExpression.d.ts +0 -51
- package/dist/@types/summer/backup/detectors/es6/ContextDependencyHelpers.d.ts +0 -4
- package/dist/@types/summer/backup/detectors/es6/Evaluator.d.ts +0 -29
- package/dist/@types/summer/backup/detectors/es6/Parser.d.ts +0 -134
- package/dist/@types/summer/backup/detectors/es6/StackedSetMap.d.ts +0 -17
- package/dist/@types/summer/backup/detectors/es6/acorn/acorn.d.ts +0 -0
- package/dist/@types/summer/backup/detectors/es6/types.d.ts +0 -37
- package/dist/@types/summer/backup/detectors/wxml/index.d.ts +0 -4
- package/dist/@types/summer/backup/detectors/wxss/index.d.ts +0 -5
- package/dist/@types/summer/backup/detectors/wxss/parse.d.ts +0 -1
- package/dist/@types/summer/backup/fslayer/fslayer.d.ts +0 -73
- package/dist/@types/summer/backup/graph.d.ts +0 -71
- package/dist/@types/summer/backup/module.d.ts +0 -34
- package/dist/@types/summer/backup/plugin_driver.d.ts +0 -41
- package/dist/@types/summer/backup/structs/app.d.ts +0 -0
- package/dist/@types/summer/backup/watcher.d.ts +0 -0
- package/dist/core/js/__tests__/minifyjs.spec.js +0 -1
- package/dist/summer/backup/appconf/index-old.js +0 -1
- package/dist/summer/backup/appconf/index.js +0 -1
- package/dist/summer/backup/detectors/es6/BasicEvaluatedExpression.js +0 -1
- package/dist/summer/backup/detectors/es6/ContextDependencyHelpers.js +0 -1
- package/dist/summer/backup/detectors/es6/Evaluator.js +0 -1
- package/dist/summer/backup/detectors/es6/Parser.js +0 -1
- package/dist/summer/backup/detectors/es6/StackedSetMap.js +0 -1
- package/dist/summer/backup/detectors/es6/acorn/acorn.js +0 -1
- package/dist/summer/backup/detectors/es6/types.js +0 -1
- package/dist/summer/backup/detectors/wxml/index.js +0 -1
- package/dist/summer/backup/detectors/wxss/index.js +0 -1
- package/dist/summer/backup/detectors/wxss/parse.js +0 -1
- package/dist/summer/backup/fslayer/fslayer.js +0 -1
- package/dist/summer/backup/graph.js +0 -1
- package/dist/summer/backup/module.js +0 -1
- package/dist/summer/backup/plugin_driver.js +0 -1
- package/dist/summer/backup/structs/app.js +0 -1
- package/dist/summer/backup/watcher.js +0 -1
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
!function(require, directRequire){
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.appendBabelHelpers=exports.getBabelOutputPath=exports.isValidBabelHelperFunc=exports.collectBabelHelpers=exports.replaceBabelHelpers=exports.searchBabelModule=exports.isIgnore=exports.getHelperContent=exports.getHelperDeps=exports.getCustomPlugins=exports.getDefaultPlugins=void 0;const tslib_1=require("tslib"),fs=(0,tslib_1.__importStar)(require("fs-extra")),path=(0,tslib_1.__importStar)(require("path")),tools_1=require("./tools"),DepMap={applyDecoratedDescriptor:[],arrayLikeToArray:[],arrayWithHoles:[],arrayWithoutHoles:["arrayLikeToArray"],assertThisInitialized:[],AsyncGenerator:["AwaitValue"],asyncGeneratorDelegate:[],asyncIterator:[],asyncToGenerator:[],awaitAsyncGenerator:["AwaitValue"],AwaitValue:[],classCallCheck:[],classNameTDZError:[],classPrivateFieldDestructureSet:[],classPrivateFieldGet:[],classPrivateFieldLooseBase:[],classPrivateFieldLooseKey:[],classPrivateFieldSet:[],classPrivateMethodGet:[],classPrivateMethodSet:[],classStaticPrivateFieldSpecGet:[],classStaticPrivateFieldSpecSet:[],classStaticPrivateMethodGet:[],classStaticPrivateMethodSet:[],construct:["setPrototypeOf","isNativeReflectConstruct"],createClass:[],createForOfIteratorHelper:["unsupportedIterableToArray"],createForOfIteratorHelperLoose:["unsupportedIterableToArray"],createSuper:["getPrototypeOf","isNativeReflectConstruct","possibleConstructorReturn"],decorate:["toArray","toPropertyKey"],defaults:[],defineEnumerableProperties:[],defineProperty:[],extends:[],get:["superPropBase"],getPrototypeOf:[],inherits:["setPrototypeOf"],inheritsLoose:[],initializerDefineProperty:[],initializerWarningHelper:[],instanceof:[],interopRequireDefault:[],interopRequireWildcard:["typeof"],isNativeFunction:[],isNativeReflectConstruct:[],iterableToArray:[],iterableToArrayLimit:[],iterableToArrayLimitLoose:[],jsx:[],maybeArrayLike:["arrayLikeToArray"],newArrowCheck:[],nonIterableRest:[],nonIterableSpread:[],objectDestructuringEmpty:[],objectSpread:["defineProperty"],objectSpread2:["defineProperty"],objectWithoutProperties:["objectWithoutPropertiesLoose"],objectWithoutPropertiesLoose:[],possibleConstructorReturn:["typeof","assertThisInitialized"],readOnlyError:[],set:["superPropBase","defineProperty"],setPrototypeOf:[],skipFirstGeneratorNext:[],slicedToArray:["arrayWithHoles","iterableToArrayLimit","unsupportedIterableToArray","nonIterableRest"],slicedToArrayLoose:["arrayWithHoles","iterableToArrayLimitLoose","unsupportedIterableToArray","nonIterableRest"],superPropBase:["getPrototypeOf"],taggedTemplateLiteral:[],taggedTemplateLiteralLoose:[],tdz:[],temporalRef:["temporalUndefined","tdz"],temporalUndefined:[],toArray:["arrayWithHoles","iterableToArray","unsupportedIterableToArray","nonIterableRest"],toConsumableArray:["arrayWithoutHoles","iterableToArray","unsupportedIterableToArray","nonIterableSpread"],toPrimitive:["typeof"],toPropertyKey:["typeof","toPrimitive"],typeof:[],unsupportedIterableToArray:["arrayLikeToArray"],wrapAsyncGenerator:["AsyncGenerator"],wrapNativeSuper:["getPrototypeOf","setPrototypeOf","isNativeFunction","construct"],wrapRegExp:["typeof","wrapNativeSuper","getPrototypeOf","possibleConstructorReturn","inherits"],regenerator:[],Objectentries:[],Objectvalues:[],Arrayincludes:[]};function getDefaultPlugins(){const e=require("@babel/plugin-proposal-class-properties").default,r=require("@babel/plugin-proposal-decorators").default,t=require("@babel/plugin-proposal-function-sent").default,a=require("@babel/plugin-proposal-throw-expressions").default,o=require("@babel/plugin-proposal-export-default-from").default,s=require("@babel/plugin-proposal-pipeline-operator").default,l=require("@babel/plugin-proposal-do-expressions").default,i=require("@babel/plugin-proposal-function-bind").default,p=require("@babel/plugin-proposal-private-methods").default;return new Map([[i,0],[o,0],[s,{proposal:"minimal"}],[l,0],[r,{legacy:!0}],[t,0],[a,0],[e,{loose:!0}],[p,{loose:!0}]])}function getCustomPlugins(e=[]){const r=getDefaultPlugins(),t=[];for(const[e,a]of r)0===a?t.push(e):t.push([e,a]);return t}function getHelperDeps(e,r){const t={};for(;e.length;){const a=e.shift()||"",o=a.substr(0,a.indexOf(r)+r.length),s=a.replace(o+"/helpers/","");s in DepMap&&DepMap[s].forEach(r=>{const a=`${o}/helpers/${r}`;t[a]||(e.push(a),t[a]=!0)}),t[a]=!0}return t}function getHelperContent(e,r){const t=e.substr(0,e.indexOf(r)+r.length),a=e.replace(t,"babel_runtime"),o=(0,tools_1.normalizePath)(path.join(__dirname,"../vendor/",a+".js"));return fs.readFile(o,"utf8")}function isIgnore(e,r){const t=e||[],a=r.split(path.sep).join("/");for(const e of t){if(r===e)return!0;if(!/^[./\\]+/.test(e)&&/.+\/\*$/.test(e)&&-1!==a.indexOf(e.substr(0,e.length-1)))return!0}return!1}function searchBabelModule(e,r){const t=[],a=new RegExp(`require\\("[\\.\\/]*(${r}[^"]+)"\\)`,"gi");return e.replace(a,(e,a)=>{const o=a.replace(r,"").match(/\/(helpers|regenerator)\/?(.+)?/);return(o&&"regenerator"===o[1]||o&&"helpers"===o[1]&&DepMap.hasOwnProperty(o[2]))&&t.push(a),e}),t}function replaceBabelHelpers(e,r={},t,a){const o=new Set,s=t.split("/").map((e,r)=>0===r?"":"../").join("");return{transformCode:e.replace(/require\("(@babel\/runtime\/[^"]+)"\)/gi,(e,t)=>{const l=t.replace(/@babel\/runtime\/(helpers\/)?/,"").replace(/\.js$/,""),i=t.replace("@babel/runtime",a),p=DepMap.hasOwnProperty(l);return!r[t]&&p?(o.add(i),`require("${s+i}")`):e}),helpers:Array.from(o)}}function collectBabelHelpers(e){const r={};return e.replace(/require\("(@babel\/runtime\/[^"]+)"\)/gi,(e,t)=>(r[t]=!0,e)),r}function isValidBabelHelperFunc(e){return DepMap.hasOwnProperty(e)}function getBabelOutputPath(e){let r=e.setting.babelSetting?e.setting.babelSetting.outputPath:"";return r?(r=(0,tools_1.normalizePath)(r),r.replace(/(^[./\\])|(\/$)/g,""),r):"@babel/runtime"}async function appendBabelHelpers(e,r,t,a){const o=getHelperDeps(Array.from(e),t),s=Object.keys(o).map(async e=>{try{const o=await getHelperContent(e,t),s=(0,tools_1.normalizePath)(path.posix.join(r,/\.js$/.test(e)?""+e:e+".js"));a[s]||(a[s]=o)}catch(e){if("EEXIST"===e.code);else if("ENOENT"!==e.code)throw e}});return Promise.all(s)}exports.getDefaultPlugins=getDefaultPlugins,exports.getCustomPlugins=getCustomPlugins,exports.getHelperDeps=getHelperDeps,exports.getHelperContent=getHelperContent,exports.isIgnore=isIgnore,exports.searchBabelModule=searchBabelModule,exports.replaceBabelHelpers=replaceBabelHelpers,exports.collectBabelHelpers=collectBabelHelpers,exports.isValidBabelHelperFunc=isValidBabelHelperFunc,exports.getBabelOutputPath=getBabelOutputPath,exports.appendBabelHelpers=appendBabelHelpers;
|
|
3
|
+
}(require("licia/lazyImport")(require), require)
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
!function(require, directRequire){
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const core_1=require("@babel/core"),{addSideEffect:addSideEffect,isModule:isModule}=require("@babel/helper-module-imports");function hasStaticMapping(e,t,r,o){try{if("Object"===e){if("entries"===t||"values"===t)return!0}else if("includes"===t){if("Identifier"===r||"ArrayExpression"===r)return!0;if("MemberExpression"===r&&"prototype"===o.property.name&&"Array"===o.object.name)return!0}return!1}catch(e){return!1}}exports.default={name:"transform-runtime-custom",pre(e){const t=new Map;this.addDefaultImport=(r,o,i)=>{const n=`${r}:${o}:${isModule(e.path)||""}`;let s=t.get(n);return s?s=core_1.types.cloneNode(s):(s=addSideEffect(e.path,r,{importedInterop:"uncompiled",nameHint:o,blockHoist:i}),t.set(n,s)),s}},visitor:{MemberExpression:{enter(e){const{node:t}=e,{object:r,property:o}=t;if(!core_1.types.isReferenced(r,t))return;let i=r.name;const n=o.name;hasStaticMapping(i,n,r.type,r)&&("Object"!==i&&(i="Array"),this.addDefaultImport(`@babel/runtime/helpers/${i}${n}`))}}}};
|
|
3
|
+
}(require("licia/lazyImport")(require), require)
|
package/dist/utils/cache.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
!function(require, directRequire){
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.cacheManager=exports.CACHE_KEY=void 0;const reactiveCache_1=require("../core/json/reactiveCache");var CACHE_KEY;!function(e){e.PROJECT_CONFIG="project.config",e.RAW_APP_JSON="raw|app.json",e.APP_JSON="app.json",e.EXT_JSON="ext.json",e.PAGE_JSON="page.json",e.COMPILED_APP_JSON="compiled.app.json",e.COMPILED_PAGE_JSON="compiled.page.json",e.GAME_JSON="game.json",e.PLUGIN_JSON="plugin.json",e.SITE_MAP_JSON="sitemap.json",e.THEME_JSON="theme.json",e.PLUGIN_THEME_JSON="plugin|theme.json",e.APP_JSON_THEME_LOCATION="app.json.themeLocation",e.APP_JSON_USING_COMPONENTS="app.json.usingComponents"}(CACHE_KEY=exports.CACHE_KEY||(exports.CACHE_KEY={}));let cache={};exports.cacheManager={get:(e,c)=>{if(cache[e.projectPath])return cache[e.projectPath][c]},set:(e,c,a)=>{cache[e.projectPath]||(cache[e.projectPath]={}),cache[e.projectPath][c]=a},clean:()=>{cache={},(0,reactiveCache_1.cleanReactiveCache)()},remove:e=>{for(const c in cache)cache[c]&&delete cache[c][e]}};
|
|
3
|
+
}(require("licia/lazyImport")(require), require)
|
package/dist/utils/common.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
!function(require, directRequire){
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getAllTargetTypeFilesWithOtherTypeFilesOfSameName=exports.checkPath=exports.ECheckPathType=exports.checkUTF8=exports.throwError=exports.getAllPagesInfo=exports.getAllPages=void 0;const tslib_1=require("tslib"),tools_1=require("./tools"),config_1=require("../config"),path_1=(0,tslib_1.__importDefault)(require("path")),locales_1=(0,tslib_1.__importDefault)(require("./locales/locales")),getAllPages=e=>{const t=[...e.pages];if(e.subPackages)for(const o of e.subPackages)for(const e of o.pages)t.push((0,tools_1.normalizePath)(path_1.default.posix.join(o.root,e)));return t};exports.getAllPages=getAllPages;const getAllPagesInfo=e=>{const t=e.pages.map(e=>({path:e,root:config_1.MINI_PROGRAM_MAIN_PACKAGE_ROOT,name:config_1.MINI_PROGRAM_MAIN_PACKAGE_ROOT}));if(e.subPackages)for(const o of e.subPackages)for(const e of o.pages)t.push({path:(0,tools_1.normalizePath)(path_1.default.posix.join(o.root,e)),root:o.root,name:o.name||""});return t};function throwError(e){const{msg:t,code:o=config_1.JSON_CONTENT_ERR,filePath:r}=e,a=new Error(`${r}: ${t}`);throw a.code=o,a.path=r,a}function checkUTF8(e,t){let o="";try{o=(0,tools_1.bufferToUtf8String)(e)}catch(e){o=""}return void 0===o&&throwError({msg:locales_1.default.config.FILE_NOT_UTF8.format(t),code:config_1.FILE_NOT_UTF8,filePath:t}),o}var ECheckPathType;function checkPath(e){const{value:t,tips:o,filePath:r="app.json",code:a=config_1.JSON_CONTENT_ERR,checkPathType:s=e.checkPathType||ECheckPathType.NORMAL}=e;"string"!==(0,tools_1.getType)(t)&&throwError({msg:locales_1.default.config.JSON_CONTENT_SHOULD_BE.format([o,"string"]),code:a,filePath:r}),""===t&&throwError({msg:locales_1.default.config.JSON_CONTENT_SHOULD_NOT_BE.format([o,"''"]),code:a,filePath:r}),t.includes("\\")&&throwError({msg:locales_1.default.config.JSON_SHOULD_NOT_CONTAIN.format([o,"\\"]),code:a,filePath:r}),s===ECheckPathType.NORMAL&&t.startsWith(".")&&throwError({msg:locales_1.default.config.JSON_SHOULD_NOT_START_WITH.format([o,"."]),code:a,filePath:r}),s===ECheckPathType.NORMAL&&t.startsWith("/")&&throwError({msg:locales_1.default.config.JSON_SHOULD_NOT_START_WITH.format([o,"/"]),code:a,filePath:r}),t.startsWith(" ")&&throwError({msg:locales_1.default.config.JSON_SHOULD_NOT_START_WITH.format([o," "]),code:a,filePath:r}),(t.includes("../")||t.endsWith("/.."))&&throwError({msg:locales_1.default.config.JSON_SHOULD_NOT_CONTAIN.format([o,"../"]),code:a,filePath:r})}function getAllTargetTypeFilesWithOtherTypeFilesOfSameName(e,t,o,r){if(!t)return[];const a=e.getFileList(r,t);if(!o||0===o.length)return a;const s=o.map(t=>new Set(e.getFileList(r,t).map(e=>e.slice(0,-t.length))));return a.map(e=>e.slice(0,-t.length)).filter(e=>s.every(t=>t.has(e))).map(e=>`${e}${t}`)}exports.getAllPagesInfo=getAllPagesInfo,exports.throwError=throwError,exports.checkUTF8=checkUTF8,function(e){e.NORMAL="NORMAL",e.TAB_BAR_ICON="TAB_BAR_ICON"}(ECheckPathType=exports.ECheckPathType||(exports.ECheckPathType={})),exports.checkPath=checkPath,exports.getAllTargetTypeFilesWithOtherTypeFilesOfSameName=getAllTargetTypeFilesWithOtherTypeFilesOfSameName;
|
|
3
|
+
}(require("licia/lazyImport")(require), require)
|
package/dist/utils/error.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
!function(require, directRequire){
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CodeError=void 0;const tslib_1=require("tslib"),log_1=(0,tslib_1.__importDefault)(require("./log"));class CodeError extends Error{constructor(r,e){super(r),log_1.default.error(e,r),this.code=e}}exports.CodeError=CodeError;
|
|
3
|
+
}(require("licia/lazyImport")(require), require)
|
package/dist/utils/fs.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
!function(require, directRequire){
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const fsagent_1=require("./fsagent");exports.default=new fsagent_1.FSAgent;
|
|
3
|
+
}(require("licia/lazyImport")(require), require)
|
package/dist/utils/fsagent.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
!function(require, directRequire){
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.FSAgent=void 0;const tslib_1=require("tslib"),fs_1=(0,tslib_1.__importDefault)(require("fs")),log_1=(0,tslib_1.__importDefault)(require("./log")),tools_1=require("./tools");class FSAgent{constructor(e){e&&(this._agent=e)}setAgent(e){this._agent=e}stat(e){var t;return e=(0,tools_1.normalizePath)(e),(null===(t=this._agent)||void 0===t?void 0:t.stat)?(log_1.default.debug("FSAgent use agent.stat for "+e),this._agent.stat(e)):new Promise((t,r)=>{log_1.default.debug("FSAgent use fs.stat for "+e),fs_1.default.stat(e,(e,i)=>{if(e)return r(e);t(i)})})}exists(e){var t;return e=(0,tools_1.normalizePath)(e),(null===(t=this._agent)||void 0===t?void 0:t.exists)?(log_1.default.debug("FSAgent use agent.exists for "+e),this._agent.exists(e)):new Promise((t,r)=>{log_1.default.debug("FSAgent use fs.exists for "+e),fs_1.default.exists(e,e=>{t(e)})})}readFile(e){var t;return e=(0,tools_1.normalizePath)(e),(null===(t=this._agent)||void 0===t?void 0:t.readFile)?(log_1.default.debug("FSAgent use agent.readFile for "+e),this._agent.readFile(e)):new Promise((t,r)=>{log_1.default.debug("FSAgent use fs.readFile for "+e),fs_1.default.readFile(e,null,(e,i)=>{if(e)return r(e);t(i)})})}writeFile(e,t,r=null){var i;return e=(0,tools_1.normalizePath)(e),(null===(i=this._agent)||void 0===i?void 0:i.writeFile)?(log_1.default.debug("FSAgent use agent.writeFile for "+e),this._agent.writeFile(e,t,r)):new Promise((i,s)=>{log_1.default.debug("FSAgent use fs.writeFile for "+e),fs_1.default.writeFile(e,t,r,e=>{if(e)return s(e);i()})})}readdir(e){var t;return e=(0,tools_1.normalizePath)(e),(null===(t=this._agent)||void 0===t?void 0:t.readdir)?(log_1.default.debug("FSAgent use agent.readdir for "+e),this._agent.readdir(e)):new Promise((t,r)=>{fs_1.default.readdir(e,(e,i)=>{if(e)return r(e);t(i)})})}}exports.FSAgent=FSAgent;
|
|
3
|
+
}(require("licia/lazyImport")(require), require)
|
package/dist/utils/glob.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
!function(require, directRequire){
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.glob=void 0;const tslib_1=require("tslib"),path_1=(0,tslib_1.__importDefault)(require("path")),minimatch_1=require("minimatch"),fs_1=(0,tslib_1.__importDefault)(require("./fs")),tools_1=require("./tools"),log_1=(0,tslib_1.__importDefault)(require("./log"));function ignoreMap(t){let e=null;if("/**"===t.slice(-3)){const r=t.replace(/(\/\*\*)+$/,"");e=new minimatch_1.Minimatch(r,{dot:!0})}return{matcher:new minimatch_1.Minimatch(t,{dot:!0}),gmatcher:e}}async function readdir(t,e){const{ignore:r,cwd:i}=e;return(await fs_1.default.readdir(path_1.default.posix.join(i,t))).filter(e=>{const i=(0,tools_1.normalizePath)(path_1.default.posix.join(t,e)),o=isIgnored(i,r);return o&&log_1.default.debug(`file '${i}' has been ignore`),!o})}function childrenIgnored(t,e){return!!e.length&&e.some(e=>{var r;return!!(null===(r=e.gmatcher)||void 0===r?void 0:r.match(t))})}function isIgnored(t,e){return!!e.length&&e.some(e=>{var r;return e.matcher.match(t)||!!(null===(r=e.gmatcher)||void 0===r?void 0:r.match(t))})}async function _glob(t,e){const{cwd:r,ignore:i,dir:o}=e,n=path_1.default.posix.join(r,t),a=await fs_1.default.stat(n);if(!a)return[];if(a.isFile())return[(0,tools_1.normalizePath)(t)];if(a.isDirectory()){if(childrenIgnored(t,i))return log_1.default.debug(`directory '${n}' has been ignore`),[];let r=[];o&&t&&r.push((0,tools_1.normalizePath)(t+"/"));const a=await readdir(t,e);for(const i of a){const o=await _glob(path_1.default.posix.join(t,i),e);r=r.concat(o)}return r}return[]}async function glob(t){const{cwd:e,ignore:r,dir:i=!1}=t;let o=[];return Array.isArray(r)&&(o=r.map(ignoreMap)),_glob("",{cwd:e,ignore:o,dir:i})}exports.glob=glob;
|
|
3
|
+
}(require("licia/lazyImport")(require), require)
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
!function(require, directRequire){
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.InterruptibleTask=exports.AbortEvent=void 0,exports.AbortEvent="abort";class InterruptibleTask{constructor(...t){this._aborted=!1,this._args=t,this._promise=this.run(...t)}then(t,r){return this._promise.then(t,r)}catch(t){return this._promise.catch(t)}abort(){this._aborted||(this._aborted=!0)}}exports.InterruptibleTask=InterruptibleTask;
|
|
3
|
+
}(require("licia/lazyImport")(require), require)
|
package/dist/utils/jsonParse.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
!function(require, directRequire){
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.jsonRespParse=exports.jsonParse=void 0;const tslib_1=require("tslib"),log_1=(0,tslib_1.__importDefault)(require("./log"));function jsonParse(e){try{return JSON.parse(e)}catch(r){throw log_1.default.info("jsonParse error, input string:"),log_1.default.info(e),r}}function jsonRespParse(e,r=""){try{return JSON.parse(e)}catch(s){throw log_1.default.info(`CGI[${r}] response parse error, response body: ${e}`),s}}exports.jsonParse=jsonParse,exports.jsonRespParse=jsonRespParse;
|
|
3
|
+
}(require("licia/lazyImport")(require), require)
|
package/dist/utils/jsonlint.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
!function(require, directRequire){
|
|
2
|
+
"use strict";const jsonlint=function(){const t={trace:function(){},yy:{},symbols_:{error:2,JSONString:3,STRING:4,JSONNumber:5,NUMBER:6,JSONNullLiteral:7,NULL:8,JSONBooleanLiteral:9,TRUE:10,FALSE:11,JSONText:12,JSONValue:13,EOF:14,JSONObject:15,JSONArray:16,"{":17,"}":18,JSONMemberList:19,JSONMember:20,":":21,",":22,"[":23,"]":24,JSONElementList:25,$accept:0,$end:1},terminals_:{2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},productions_:[0,[3,1],[5,1],[7,1],[9,1],[9,1],[12,2],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[15,2],[15,3],[20,3],[19,1],[19,3],[16,2],[16,3],[25,1],[25,3]],performAction:function(t,e,n,i,s,r,h){const l=r.length-1;switch(s){case 1:this.$=t.replace(/\\(\\|")/g,"$1").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\v/g,"\v").replace(/\\f/g,"\f").replace(/\\b/g,"\b");break;case 2:this.$=Number(t);break;case 3:this.$=null;break;case 4:this.$=!0;break;case 5:this.$=!1;break;case 6:return this.$=r[l-1];case 13:this.$={};break;case 14:this.$=r[l-1];break;case 15:this.$=[r[l-2],r[l]];break;case 16:this.$={},this.$[r[l][0]]=r[l][1];break;case 17:this.$=r[l-2],r[l-2][r[l][0]]=r[l][1];break;case 18:this.$=[];break;case 19:this.$=r[l-1];break;case 20:this.$=[r[l]];break;case 21:this.$=r[l-2],r[l-2].push(r[l])}},table:[{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],12:1,13:2,15:7,16:8,17:[1,14],23:[1,15]},{1:[3]},{14:[1,16]},{14:[2,7],18:[2,7],22:[2,7],24:[2,7]},{14:[2,8],18:[2,8],22:[2,8],24:[2,8]},{14:[2,9],18:[2,9],22:[2,9],24:[2,9]},{14:[2,10],18:[2,10],22:[2,10],24:[2,10]},{14:[2,11],18:[2,11],22:[2,11],24:[2,11]},{14:[2,12],18:[2,12],22:[2,12],24:[2,12]},{14:[2,3],18:[2,3],22:[2,3],24:[2,3]},{14:[2,4],18:[2,4],22:[2,4],24:[2,4]},{14:[2,5],18:[2,5],22:[2,5],24:[2,5]},{14:[2,1],18:[2,1],21:[2,1],22:[2,1],24:[2,1]},{14:[2,2],18:[2,2],22:[2,2],24:[2,2]},{3:20,4:[1,12],18:[1,17],19:18,20:19},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:23,15:7,16:8,17:[1,14],23:[1,15],24:[1,21],25:22},{1:[2,6]},{14:[2,13],18:[2,13],22:[2,13],24:[2,13]},{18:[1,24],22:[1,25]},{18:[2,16],22:[2,16]},{21:[1,26]},{14:[2,18],18:[2,18],22:[2,18],24:[2,18]},{22:[1,28],24:[1,27]},{22:[2,20],24:[2,20]},{14:[2,14],18:[2,14],22:[2,14],24:[2,14]},{3:20,4:[1,12],20:29},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:30,15:7,16:8,17:[1,14],23:[1,15]},{14:[2,19],18:[2,19],22:[2,19],24:[2,19]},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:31,15:7,16:8,17:[1,14],23:[1,15]},{18:[2,17],22:[2,17]},{18:[2,15],22:[2,15]},{22:[2,21],24:[2,21]}],defaultActions:{16:[2,6]},parseError:function(t,e){throw new Error(t)},parse:function(t){const e=this;let n=[0],i=[null],s=[];const r=this.table;let h="",l=0,o=0,c=0;this.lexer.setInput(t),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,void 0===this.lexer.yylloc&&(this.lexer.yylloc={});let a,u,y,p,f,g,_,m,x,b=this.lexer.yylloc;function d(){let t;return t=e.lexer.lex()||1,"number"!=typeof t&&(t=e.symbols_[t]||t),t}s.push(b),"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);const E={};for(;;){y=n[n.length-1],this.defaultActions[y]?p=this.defaultActions[y]:(null==a&&(a=d()),p=r[y]&&r[y][a]);let t="";if(void 0===p||!p.length||!p[0]){if(!c){for(g in x=[],r[y])this.terminals_[g]&&g>2&&x.push("'"+this.terminals_[g]+"'");t=this.lexer.showPosition?"Parse error on line "+(l+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+x.join(", ")+", got '"+this.terminals_[a]+"'":"Parse error on line "+(l+1)+": Unexpected "+(1===a?"end of input":"'"+(this.terminals_[a]||a)+"'"),this.parseError(t,{text:this.lexer.match,token:this.terminals_[a]||a,line:this.lexer.yylineno,loc:b,expected:x})}if(3===c){if(1===a)throw new Error(t||"Parsing halted.");o=this.lexer.yyleng,h=this.lexer.yytext,l=this.lexer.yylineno,b=this.lexer.yylloc,a=d()}for(;!(2..toString()in r[y]);){if(0===y)throw new Error(t||"Parsing halted.");S=1,n.length=n.length-2*S,i.length=i.length-S,s.length=s.length-S,y=n[n.length-1]}u=a,a=2,y=n[n.length-1],p=r[y]&&r[y][2],c=3}if(p[0]instanceof Array&&p.length>1)throw new Error("Parse Error: multiple actions possible at state: "+y+", token: "+a);switch(p[0]){case 1:n.push(a),i.push(this.lexer.yytext),s.push(this.lexer.yylloc),n.push(p[1]),a=null,u?(a=u,u=null):(o=this.lexer.yyleng,h=this.lexer.yytext,l=this.lexer.yylineno,b=this.lexer.yylloc,c>0&&c--);break;case 2:if(_=this.productions_[p[1]][1],E.$=i[i.length-_],E._$={first_line:s[s.length-(_||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(_||1)].first_column,last_column:s[s.length-1].last_column},f=this.performAction.call(E,h,o,l,this.yy,p[1],i,s),void 0!==f)return f;_&&(n=n.slice(0,-1*_*2),i=i.slice(0,-1*_),s=s.slice(0,-1*_)),n.push(this.productions_[p[1]][0]),i.push(E.$),s.push(E._$),m=r[n[n.length-2]][n[n.length-1]],n.push(m);break;case 3:return!0}}var S;return!0}},e=function(){const t={EOF:1,parseError:function(t,e){if(!this.yy.parseError)throw new Error(t);this.yy.parseError(t,e)},setInput:function(t){return this._input=t,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this},input:function(){const t=this._input[0];this.yytext+=t,this.yyleng++,this.match+=t,this.matched+=t;return t.match(/\n/)&&this.yylineno++,this._input=this._input.slice(1),t},unput:function(t){return this._input=t+this._input,this},more:function(){return this._more=!0,this},less:function(t){this._input=this.match.slice(t)+this._input},pastInput:function(){const t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){let t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){const t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},next:function(){if(this.done)return this.EOF;let t,e,n,i,s;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");const r=this._currentRules();for(let t=0;t<r.length&&(n=this._input.match(this.rules[r[t]]),!n||e&&!(n[0].length>e[0].length)||(e=n,i=t,this.options.flex));t++);return e?(s=e[0].match(/\n.*/g),s&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-1:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.yyleng=this.yytext.length,this._more=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],t=this.performAction.call(this,this.yy,this,r[i],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),t||void 0):""===this._input?this.EOF:void this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){const t=this.next();return void 0!==t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(t){this.begin(t)},options:{},performAction:function(t,e,n,i){switch(n){case 0:break;case 1:return 6;case 2:return e.yytext=e.yytext.substr(1,e.yyleng-2),4;case 3:return 17;case 4:return 18;case 5:return 23;case 6:return 24;case 7:return 22;case 8:return 21;case 9:return 10;case 10:return 11;case 11:return 8;case 12:return 14;case 13:return"INVALID"}},rules:[/^(?:\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,/^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,/^(?:\{)/,/^(?:\})/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?::)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:.)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}};return t}();return t.lexer=e,t}();jsonlint.parseError=jsonlint.lexer.parseError=function(t,e){throw e},module.exports={parser:jsonlint,parse:function(){return jsonlint.parse.apply(jsonlint,arguments)}};
|
|
3
|
+
}(require("licia/lazyImport")(require), require)
|
package/dist/utils/locales/en.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
!function(require, directRequire){
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const fomatable_string_1=require("./fomatable_string"),config={GENERATE_LOCAL_SIGNATURE_FAIL:"generate local signature fail. Usually this happens the content or encoding of private key file is incorrect. Detail: %s",PARAM_ERROR:'function: "%s" lack of parameter: "%s"',SHOULD_NOT_BE_EMPTY:"%s should not be empty",JSON_CONTENT_SHOULD_BE:"%s field needs to be %s",SHOULD_MATCH:"%s should match %s",SHOULD_EQUAL:"%s should equal to %s",SHOULD_AT_LEAST_ONE_ITEM:"%s should have at least on item",OR:"Or",CORRESPONDING_FILE_NOT_FOUND:'%s could not find the corresponding file: "%s"',JSON_SHOULD_NOT_CONTAIN:"%s should not contain %s",JSON_SHOULD_NOT_START_WITH:"%s should not begin with '%s'",NOT_FOUND:"%s not found",MINIPROGRAM_APP_JSON_NOT_FOUND:"In the directory %s specified by miniprogramRoot in project.config.json, %s is not found",PLUGIN_JSON_NOT_FOUND:"In the miniprogram local development plug-in directory %s specified by pluginRoot in project.config.json, %s is not found",CONTENT_EXIST:"%s already exists",FILE_NOT_FOUND:'"%s" file not found, or the file read failed',JSON_PARSE_ERROR:"%s File parsing error",ENTRANCE_NOT_FOUND:"No pages : %s defined in the entry page \napp.json is found",JSON_PAGE_FILE_NOT_EXISTS:'%s %s "%s" could not find the corresponding %s file',SHOULD_NOT_IN:"%s Should not exist in %s",JSON_CUSTOM_COMPILE_PATH_NOT_EXISTS_TITLE:"app.json or custom compilation condition error",JSON_CUSTOM_COMPILE_PATH_NOT_EXISTS:"The startup page %s specified in the custom compilation is not defined in app.json",JSON_ENTRY_PAGE_PATH_NOT_FOUND:"No entry page defined in %s is found in %s",JSON_TABBAR_AT_LEAST:'["tabBar"]["list"] must contain at least %s items',JSON_TABBAR_AT_MOST:'["tabBar"]["list"] cannot contain more than %s items',JSON_TABBAR_PATH_EMPTY:'["tabBar"]["list"][%s]["pagePath"] cannot be empty',JSON_TABBAR_PATH_SAME_WITH_OTHER:'["tabBar"]["list"][%s]["pagePath"] is same with ["tabBar"]["list"][%s]["pagePath"]',JSON_TABBAR_ICON_MAX_SIZE:'The size of ["tabBar"]["list"][%s]["%s"] exceeds %skb',JSON_TABBAR_ICON_EXT:'["tabBar"]["list"][%s]["%s"] Wrong file format, only %s format is supported',EXT_SHOULD_BE_ERROR:'extension name of %s should be "%s"',JSON_CONTENT_SHOULD_NOT_BE:"%s cannot be %s",APP_JSON_SHOULD_SET_LAZYCODELOADING:'You need to add "lazyCodeLoading": "requiredComponents" in app.json, because the value of "renderer" in %s is "skyline"',PAGE_JSON_SHOULD_SET_DISABLESCROLL_TRUE:'According to the configuration of the page or app.json, the value of "renderer" in %s page is "skyline", you need to add "disableScroll": true in the page configuration',PAGE_JSON_SHOULD_SET_NAVIGATIONSTYLE_CUSTOM:'According to the configuration of the page or app.json, the value of "renderer" in %s page is "skyline", you need to add "navigationStyle": custom in the page configuration',JSON_CONTENT_EXISTED:"%s already exists",JSON_CONTENT_NOT_FOUND:"%s does not exist",LACK_OF_FILE:"File %s is missing",JSON_PAGES_REPEAT:"%s is repeated in %s",JSON_CONTENT_REPEAT:"%s could not be declared both in %s",EXT_JSON_INVALID:'%s is not a 3rdMiniProgramAppid, ext.json cannot take effect;Read the documentation: "%s"',GAME_EXT_JSON_INVALID:"%s is not a 3rdMiniGameAppid, ext.json cannot take effect;",EXT_APPID_SHOULD_NOT_BE_EMPTY:"extAppid should not be empty",FILE_NOT_UTF8:"%s file is not in UTF-8 encoding",INVALID:"invalid %s",DIRECTORY:"Directory",EXCEED_LIMIT:"%s exceed limit %s",PLEASE_CHOOSE_PLUGIN_MODE:"If you are developing a plugin, choose the plugin mode",TRIPLE_NUMBER_DOT:"number.number.number",PAGE_PATH:"Page Path",PLUGINS_SAME_ALIAS:"%s and %s have same alias",SAME_ITEM:'%s and %s have same "%s"',ALREADY_EXISTS:"already exists",SAME_KEY_PAGE_PUBLICCOMPONENTS:'There can not be the same key: %s in ["pages"] and ["publicComponents"]',GAME_DEV_PLUGIN_SHOULD_NOT_USE_LOCAL_PATH:"Dev plugin: %s shall never specify a local path",GAME_PLUGIN_SIGNATURE_MD5_NOT_MATCH_CONTENT:'MD5 hash of the plugin library file "%s": "%s" not matching the value "%s" given by its signature.json, thus the compiling process has been interrupted.\nThis indicates you might have changed the content of the file.\nRestore the original content of this file may help solve the issue and remove this warning.\n\nTo learn more, you may refer to the documentation.\n',FILE:"FILE",PROCESSING:"processing: %s",DONE:"done: %s",UPLOAD:"upload",SUCCESS:"success",PROJECT_TYPE_ERROR:"appid(%s) is %s",MINI_PROGRAM:"MiniProgram",MINI_GAME:"MiniGame",NOT_ALLOWED_REQUIRE_VAR:"Require variable is not allowed",NOT_ALLOWED_REQUIRE_ASSIGN:"Assigning the require function to other variables is not allowed",NOT_FOUND_NPM_ENTRY:"Npm package entry file not found",NOT_FOUND_NODE_MODULES:"NPM packages not found. Please confirm npm packages which need to build are belong to `miniprogramRoot` directory. Or you may edit project.config.json's `packNpmManually` and `packNpmRelationList`",JSON_ENTRANCE_DECLARE_PATH_ERR:'["entranceDeclare"]["locationMessage"]["path"] "%s" should belong to pages or pages in sub packages',JSON_ENTRANCE_DECLARE_PATH_EMPTY:'["entranceDeclare"]["locationMessage"]["path"] should not be empty',COULD_NOT_USE_CODE_PROTECT:"Code protect is not available",SUMMER_COMPILING_MODULE:"Compiling %s",SUMMER_COMPILE_JSON:"Compile jSON files",SUMMER_OPTIMIZE_CODE:"Optimize code",SUMMER_PACK_FILES:"Pack resource file",SUMMER_COMPRESS_PACK:"Compress code package",SUMMER_SEAL_PACK:"Seal code package",SUMMER_APPEND_BABEL_HELPERS:"Append babel helper files",SUMMER_COMPILE_PAGE_JSON:"Compile json files of %s pages",SUMMER_COMPILE_PLUGIN_PAGE_JSON:"Compiling json files of %s plugin pages",SUMMER_COMPILE:"Compile %s",SUMMER_COMPILE_MINIPROGRAM:"Compile miniprogram",SUMMER_COMPILE_PLUGIN:"Compile plugin"},formatConfig={};for(const[e,o]of Object.entries(config))formatConfig[e]=new fomatable_string_1.FormatableString(o);exports.default=formatConfig;
|
|
3
|
+
}(require("licia/lazyImport")(require), require)
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
!function(require, directRequire){
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.FormatableString=void 0;class FormatableString extends String{format(...t){const e=t[0];let r=this;return"[object Array]"===Object.prototype.toString.call(e)?(e.forEach(t=>{r=r.replace("%s",t)}),r):(t.forEach(t=>{r=r.replace("%s",t)}),""+r)}}exports.FormatableString=FormatableString;
|
|
3
|
+
}(require("licia/lazyImport")(require), require)
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
!function(require, directRequire){
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const tslib_1=require("tslib"),en_1=(0,tslib_1.__importDefault)(require("./en")),zh_1=(0,tslib_1.__importDefault)(require("./zh")),systemLocale="$SYSTEM",supportedLocales=["zh","en"];let locale="en";const toSupportedLocale=e=>("$SYSTEM"===e&&"zh_CN"===(e=navigator.language)&&(e="zh"),supportedLocales.find(t=>e.toLowerCase().includes(t))||"zh"),setLocale=e=>{locale=toSupportedLocale(e)};exports.default={get config(){return"en"===locale?en_1.default:zh_1.default},setLocale:setLocale};
|
|
3
|
+
}(require("licia/lazyImport")(require), require)
|
package/dist/utils/locales/zh.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
!function(require, directRequire){
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const fomatable_string_1=require("./fomatable_string"),config={GENERATE_LOCAL_SIGNATURE_FAIL:"生成本地签名失败。通常是key文件编码或者内容有误。错误详情: %s",PARAM_ERROR:'方法:"%s" 缺少参数:"%s"',SHOULD_NOT_BE_EMPTY:"%s 不能为空",JSON_CONTENT_SHOULD_BE:"%s 字段需为 %s",SHOULD_AT_LEAST_ONE_ITEM:"%s 需至少存在一项",SHOULD_MATCH:"%s 需与 %s 匹配",SHOULD_EQUAL:"%s 需等于 %s",EXT_SHOULD_BE_ERROR:'%s 的拓展名需为 "%s"',OR:"或",CORRESPONDING_FILE_NOT_FOUND:"未找到 %s 对应的 %s 文件",JSON_SHOULD_NOT_START_WITH:"%s 不应该以 '%s' 开头",JSON_SHOULD_NOT_CONTAIN:"%s 不应该包含 %s",NOT_FOUND:"%s 未找到",MINIPROGRAM_APP_JSON_NOT_FOUND:"根据 project.config.json 中 miniprogramRoot 指定的小程序目录 %s,%s 未找到",PLUGIN_JSON_NOT_FOUND:"根据 project.config.json 中 pluginRoot 指定的小程序本地开发插件目录 %s,%s 未找到",FILE_NOT_FOUND:"未找到 %s 文件,或者文件读取失败",JSON_PARSE_ERROR:"%s 文件解析错误",ENTRANCE_NOT_FOUND:"未找到入口页面\napp.json 中定义的 pages : %s",JSON_PAGE_FILE_NOT_EXISTS:'未找到 %s 中的定义的 %s "%s" 对应的 %s 文件',SHOULD_NOT_IN:"%s 不应该在 %s 中",JSON_CUSTOM_COMPILE_PATH_NOT_EXISTS_TITLE:"app.json 或自定义编译条件错误",JSON_CUSTOM_COMPILE_PATH_NOT_EXISTS:"app.json 中未定义自定义编译中指定的启动页面 %s",JSON_ENTRY_PAGE_PATH_NOT_FOUND:"未在 %s 中找到 %s 定义的入口页面",JSON_TABBAR_AT_LEAST:'["tabBar"]["list"] 需至少包含 %s 项',JSON_TABBAR_AT_MOST:'["tabBar"]["list"] 不能超过 %s 项',JSON_TABBAR_PATH_EMPTY:'["tabBar"]["list"][%s]["pagePath"] 不能为空',JSON_TABBAR_PATH_SAME_WITH_OTHER:'["tabBar"]["list"][%s]["pagePath"] 和 ["tabBar"]["list"][%s]["pagePath"] 相同',JSON_TABBAR_ICON_MAX_SIZE:'["tabBar"]["list"][%s]["%s"] 大小超过 %skb',JSON_TABBAR_ICON_EXT:'["tabBar"]["list"][%s]["%s"] 文件格式错误,仅支持 %s 格式',JSON_CONTENT_SHOULD_NOT_BE:"%s 不能为 %s",APP_JSON_SHOULD_SET_LAZYCODELOADING:'%s 中 "renderer" 设置为 "skyline",需在 app.json 添加 "lazyCodeLoading": "requiredComponents"',PAGE_JSON_SHOULD_SET_DISABLESCROLL_TRUE:'根据页面或 app.json 的配置,%s 页面 "renderer" 为 "skyline",需在页面配置中添加 "disableScroll": true',PAGE_JSON_SHOULD_SET_NAVIGATIONSTYLE_CUSTOM:'根据页面或 app.json 的配置,%s 页面 "renderer" 为 "skyline",需在页面配置中添加 "navigationStyle": custom',CONTENT_EXIST:"%s 已经存在",JSON_CONTENT_EXISTED:"%s 已经存在",JSON_CONTENT_NOT_FOUND:"%s 不存在",LACK_OF_FILE:"缺少文件 %s",JSON_PAGES_REPEAT:"%s 在 %s 中重复",JSON_CONTENT_REPEAT:"%s 不能同时在 %s 中声明",EXT_JSON_INVALID:'%s 不是 3rdMiniProgramAppid, ext.json 无法生效;查看文档: "%s"',GAME_EXT_JSON_INVALID:'%s 不是 3rdMiniGameAppid, ext.json 无法生效;"%s"',EXT_APPID_SHOULD_NOT_BE_EMPTY:"extAppid 不能为空",FILE_NOT_UTF8:"%s 文件不是 UTF-8 格式",INVALID:"无效的 %s",DIRECTORY:"目录",EXCEED_LIMIT:"%s 超过限制 %s",PLEASE_CHOOSE_PLUGIN_MODE:"如果正在开发插件,请选择插件模式",TRIPLE_NUMBER_DOT:"数字.数字.数字",PAGE_PATH:"页面路径",PLUGINS_SAME_ALIAS:"%s 和 %s 的别名相同",SAME_ITEM:'%s 和 %s 的 "%s" 相同',ALREADY_EXISTS:"已存在",SAME_KEY_PAGE_PUBLICCOMPONENTS:'["pages"] 与 ["publicComponents"] 不能存在相同的 key: %s',GAME_DEV_PLUGIN_SHOULD_NOT_USE_LOCAL_PATH:"开发版插件 %s 不能使用 %s 指定本地路径",GAME_PLUGIN_SIGNATURE_MD5_NOT_MATCH_CONTENT:'插件文件 "%s" 的 MD5: "%s" 与其 signature.json 所给定的值: "%s" 不匹配, 因此编译过程已经中断。\n这表示此文件的内容可能已经被修改。\n恢复此文件的原始内容可能可以解决此问题并移除此警告。\n\n要了解更多,可以参考文档。\n',FILE:"文件",PROCESSING:"处理中: %s",DONE:"完成: %s",UPLOAD:"上传",SUCCESS:"成功",PROJECT_TYPE_ERROR:"appid(%s) 是 %s",MINI_PROGRAM:"小程序",MINI_GAME:"小游戏",NOT_ALLOWED_REQUIRE_VAR:"不允许require变量",NOT_ALLOWED_REQUIRE_ASSIGN:"不允许将require函数赋值给其他变量",NOT_FOUND_NPM_ENTRY:"未找到npm包入口文件",NOT_FOUND_NODE_MODULES:"没有找到可以构建的 NPM 包,请确认需要参与构建的 npm 都在 `miniprogramRoot` 目录内,或配置 project.config.json 的 packNpmManually 和 packNpmRelationList 进行构建",JSON_ENTRANCE_DECLARE_PATH_ERR:'["entranceDeclare"]["locationMessage"]["path"] "%s" 需在 pages 数组或分包 pages 数组中',JSON_ENTRANCE_DECLARE_PATH_EMPTY:'["entranceDeclare"]["locationMessage"]["path"] 不能为空',COULD_NOT_USE_CODE_PROTECT:"无法使用代码保护功能",SUMMER_COMPILING_MODULE:"编译 %s",SUMMER_COMPILE_JSON:"编译 JSON 文件",SUMMER_OPTIMIZE_CODE:"优化代码",SUMMER_PACK_FILES:"打包资源文件",SUMMER_COMPRESS_PACK:"压缩代码包",SUMMER_SEAL_PACK:"封装代码包",SUMMER_APPEND_BABEL_HELPERS:"追加 babel helper 文件",SUMMER_COMPILE_PAGE_JSON:"编译 %s 个页面json文件",SUMMER_COMPILE_PLUGIN_PAGE_JSON:"编译插件 %s 个页面json文件",SUMMER_COMPILE:"编译 %s",SUMMER_COMPILE_MINIPROGRAM:"编译打包小程序",SUMMER_COMPILE_PLUGIN:"编译打包插件"},formatConfig={};for(const[_,E]of Object.entries(config))formatConfig[_]=new fomatable_string_1.FormatableString(E);exports.default=formatConfig;
|
|
3
|
+
}(require("licia/lazyImport")(require), require)
|
package/dist/utils/log.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
!function(require, directRequire){
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default={info:console.info,log:console.log,warn:console.warn,error:console.error,debug:(...e)=>{}};
|
|
3
|
+
}(require("licia/lazyImport")(require), require)
|
package/dist/utils/report.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
!function(require, directRequire){
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.wrapReport=void 0;const config_1=require("../config"),os=require("os"),request_1=require("./request");async function reportMMData(e){(0,request_1.request)({url:"https://servicewechat.com/wxa-dev-logic/clientreportv2",body:JSON.stringify({report_info_list:[e]}),method:"post"})}const compileTypeMap={miniProgram:1,miniProgramPlugin:2,miniGame:3,miniGamePlugin:4},actionMap={preview:1,upload:2,npm:3,cloud:4,getDevSourceMap:5};function parseVersionToInt(e){let t=e.split(".");return parseInt(t[0]+t[1]+t[2])}function getMinifyXStatus(e,t){return"boolean"==typeof t?t?1:0:e?1:0}function reportAction(e,t,o,i,r,n={}){const a=r.appid,p=r.type,s=parseVersionToInt(config_1.CI_VERSION),c="win32"===process.platform?1:"darwin"===process.platform?2:3,l=os.cpus().length,u=Math.floor(os.totalmem()/1024/1024),f=actionMap[e];o=o.replace(/\,/g,";").slice(0,512);reportMMData({log_id:22365,version:0,user_log_list:`0,${a},${s},${c},${l},${u},${compileTypeMap[p]},${f},${t},${o},${i},0,${n.es6?1:0},${n.es7?1:0},${getMinifyXStatus(n.minify,n.minifyJS)},${getMinifyXStatus(n.minify,n.minifyWXML)},${getMinifyXStatus(n.minify,n.minifyWXSS)},${n.codeProtect?1:0},${n.autoPrefixWXSS?1:0}`})}function wrapReport(e,t){return async function(o){let i=o.project,r={};"upload"!==e&&"preview"!==e||(r=o.setting||{});let n=null,a=Date.now();try{return await t.apply(null,arguments)}catch(e){throw n=e,e}finally{try{let t=Date.now()-a,o=n?n.code?n.code:-1:0,p=n&&n.message?n.message:"";reportAction(e,o,p,t,i,r)}catch(e){console.info(e)}}}}exports.wrapReport=wrapReport;
|
|
3
|
+
}(require("licia/lazyImport")(require), require)
|
package/dist/utils/request.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
!function(require, directRequire){
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.initGlobalProxy=exports.getCiProxy=exports.setCiProxy=exports.request=void 0;const tslib_1=require("tslib"),log_1=(0,tslib_1.__importDefault)(require("./log")),interruptibletask_1=require("./interruptibletask"),req=require("request"),getGlobalProxySettings=require("get-proxy");class RequestTask extends interruptibletask_1.InterruptibleTask{constructor(e){super(e),this._alreadyRefresh=!1,this._promise.catch(e=>{log_1.default.error(`${this._opt.url} ${e}`)})}static async formateQuery(e){const t=Object.assign({},e),{needRandom:r}=t;delete t.needRandom;const s=(t.url||"").split("?"),o=s[0],i=[];return-1!==r&&i.push("_r="+Math.random()),s[1]&&i.push(s[1]),t.url=`${o}?${i.join("&")}`,t}abort(){this._aborted||(this._aborted=!0,this._realRequest&&"function"==typeof this._realRequest.abort&&this._realRequest.abort())}async request(){if(this._aborted)throw interruptibletask_1.AbortEvent;const e=await RequestTask.formateQuery(this._opt);return RequestTask.requestProxy&&(e.proxy=RequestTask.requestProxy),new Promise((t,r)=>{this._realRequest=req(e,(e,s,o)=>{e?r(e):t({resp:s,body:o})}),this._realRequest.on("abort",()=>{r(interruptibletask_1.AbortEvent)})})}async run(e){return this._opt=Object.assign({},e),await this.request()}}function request(e){return new RequestTask(e)}function setCiProxy(e){RequestTask.requestProxy=e,log_1.default.info("miniprogram-ci is using proxy: "+e)}function getCiProxy(){return RequestTask.requestProxy}function initGlobalProxy(){const e=getCiProxy(),t=`${process.env.no_proxy||""},${process.env.NO_PROXY||""}`.split(",").map(e=>e.trim());if(!e&&!t.includes("servicewechat.com")){const e=getGlobalProxySettings();e&&setCiProxy(e)}}RequestTask.requestProxy="",exports.request=request,exports.setCiProxy=setCiProxy,exports.getCiProxy=getCiProxy,exports.initGlobalProxy=initGlobalProxy;
|
|
3
|
+
}(require("licia/lazyImport")(require), require)
|
package/dist/utils/sign.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
!function(require, directRequire){
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getSignature=exports.getRandomString=void 0;const tslib_1=require("tslib"),config_1=require("../config"),crypto_1=(0,tslib_1.__importDefault)(require("crypto")),request_1=require("./request"),error_1=require("./error"),locales_1=(0,tslib_1.__importDefault)(require("./locales/locales")),url_config_1=require("./url_config"),jsonParse_1=require("./jsonParse");async function getRandomString(r){try{const{body:e}=await(0,request_1.request)({url:url_config_1.GET_RAND_STRING,method:"post",body:JSON.stringify({appid:r,clientRand:Math.floor(1e8*Math.random())}),headers:{"content-type":"application/json"}}),t=(0,jsonParse_1.jsonRespParse)(e,url_config_1.GET_RAND_STRING);if(0===t.errCode)return t.data.randomString;throw new Error(`errCode: ${t.errCode}; errMsg: ${t.errMsg}`)}catch(r){throw new error_1.CodeError(r.toString(),config_1.GET_SIGNATURE_RAND_STRING_ERR)}}async function getSignature(r,e){const t={appid:e,rand_str:await getRandomString(e)};try{return crypto_1.default.privateEncrypt({key:r,padding:crypto_1.default.constants.RSA_PKCS1_PADDING},Buffer.from(JSON.stringify(t))).toString("base64")}catch(r){throw new error_1.CodeError(locales_1.default.config.GENERATE_LOCAL_SIGNATURE_FAIL.format(r.toString()),config_1.GENERATE_LOCAL_SIGNATURE_ERR)}}exports.getRandomString=getRandomString,exports.getSignature=getSignature;
|
|
3
|
+
}(require("licia/lazyImport")(require), require)
|
package/dist/utils/taskstatus.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
!function(require, directRequire){
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.TaskStatus=void 0;const tslib_1=require("tslib"),locales_1=(0,tslib_1.__importDefault)(require("./locales/locales"));class TaskStatus{constructor(t){this._status="doing",this._msg="",this._id=`${Math.random()}${Date.now()}`,this._msg=t}get id(){return this._id}get status(){return this._status}get message(){return this._msg}done(){this._status="done"}toString(){return"doing"===this._status?locales_1.default.config.PROCESSING.format(this._msg):"done"===this._status?locales_1.default.config.DONE.format(this._msg):this._msg}}exports.TaskStatus=TaskStatus;
|
|
3
|
+
}(require("licia/lazyImport")(require), require)
|
package/dist/utils/tools.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
!function(require, directRequire){
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.formatTime=exports.formatNumber=exports.generateMD5=exports.formatSourceMap=exports.isFileIncluded=exports.isFileIgnored=exports.leading=exports.trailing=exports.escapeQuot=exports.mkdirSync=exports.rmSync=exports.isHexColor=exports.formatJSONParseErr=exports.bufferToUtf8String=exports.getType=exports.normalizePath=void 0;const tslib_1=require("tslib"),fs_1=(0,tslib_1.__importDefault)(require("fs")),path_1=(0,tslib_1.__importDefault)(require("path")),babel_code_frame_1=(0,tslib_1.__importDefault)(require("babel-code-frame")),minimatch_1=(0,tslib_1.__importDefault)(require("minimatch")),crypto_1=(0,tslib_1.__importDefault)(require("crypto")),jsonlint=require("./jsonlint");function normalizePath(e=""){const t=path_1.default.posix.normalize(e.replace(/\\/g,"/"));return!e.startsWith("//")&&!e.startsWith("\\\\")||t.startsWith("//")?t:"/"+t}function getType(e){return Object.prototype.toString.call(e).toLowerCase().split(" ")[1].replace("]","")}exports.normalizePath=normalizePath,exports.getType=getType;const bufferToUtf8String=e=>{const t=e.toString();if(0===Buffer.compare(Buffer.from(t,"utf8"),e))return t};function getErrLine(e,t,r,i){r=r>0?r:1;return`${i}\n${(0,babel_code_frame_1.default)(e,t,r)}`}exports.bufferToUtf8String=bufferToUtf8String;const formatJSONParseErr=e=>{const t=e.data||"";try{jsonlint.parser.parse(t)}catch(r){try{const i=`Expecting ${r.expected}, got ${r.token}`,n=getErrLine(t,r.line,r.loc.first_column,i);return`${e.filePath}\n${n}`}catch(e){}}return`${e.filePath}\n${e.error}`};exports.formatJSONParseErr=formatJSONParseErr;const isHexColor=e=>/^#[a-f\d]{3}$/i.test(e)||/^#[a-f\d]{4}$/i.test(e)||/^#[a-f\d]{6}$/i.test(e)||/^#[a-f\d]{8}$/i.test(e);function rmSync(e){try{if(e=path_1.default.resolve(e),!fs_1.default.existsSync(e))return;if(fs_1.default.lstatSync(e).isDirectory()){const t=fs_1.default.readdirSync(e);if(t.length>0)for(let r=0,i=t.length;r<i;r++)rmSync(path_1.default.posix.join(e,t[r]));fs_1.default.rmdirSync(e)}else fs_1.default.unlinkSync(e)}catch(e){}}function mkdirSync(e){if(e=path_1.default.resolve(e),fs_1.default.existsSync(e)){if(fs_1.default.lstatSync(e).isDirectory())return;fs_1.default.unlinkSync(e)}mkdirSync(path_1.default.dirname(e)),fs_1.default.mkdirSync(e)}function escapeQuot(e,t="`"){return e?"`"===t?e.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$/g,"\\$"):'"'===t?e.replace(/\\/g,"\\\\").replace(/\r\n/g,"\n").replace(/\n/g,"\\n").replace(/"/g,'\\"'):"'"===t?e.replace(/\\/g,"\\\\").replace(/\r\n/g,"\n").replace(/\n/g,"\\n").replace(/'/g,"\\'"):e:e}function trailing(e,t,r=!1){return r?e.endsWith(t)?e.slice(0,e.length-1):e:e.endsWith(t)?e:e+t}function leading(e,t,r=!1){return r?e.startsWith(t)?e.slice(1):e:e.startsWith(t)?e:t+e}exports.isHexColor=isHexColor,exports.rmSync=rmSync,exports.mkdirSync=mkdirSync,exports.escapeQuot=escapeQuot,exports.trailing=trailing,exports.leading=leading;const FFSPRGRulesFactory=function(e){let t=null,r=Object.create(null);return function(e,i){if(i.length<1)return!1;if(t===i){if(void 0!==r[e])return r[e]}else t=i,r=Object.create(null);const n=e.replace(/\\/g,"/").toLowerCase();if(!n)return!1;const o=n.slice(n.lastIndexOf("/")+1);let a=!1;for(const e of i){if(!e)continue;const t=e.value.toLowerCase();if("prefix"===e.type)a=o.startsWith(t);else if("suffix"===e.type)a=o.endsWith(t);else if("folder"===e.type)a=leading(n,"/").startsWith(trailing(leading(t,"/"),"/"));else if("file"===e.type)a=leading(n,"/")===leading(t,"/");else if("glob"===e.type)try{a=(0,minimatch_1.default)(n,t)||(0,minimatch_1.default)(leading(n,"/"),t)}catch(e){a=!1}else if("regexp"===e.type)try{a=new RegExp(t,"igm").test(n)||new RegExp(t,"igm").test(leading(n,"/"))}catch(e){a=!1}if(a)break}return r[e]=a,a}};function formatSourceMap(e){if(e){if("string"===getType(e))return e;try{return JSON.stringify(e)}catch(e){}}}function generateMD5(e){const t=crypto_1.default.createHash("md5");return t.update(e),t.digest("hex")}exports.isFileIgnored=FFSPRGRulesFactory(),exports.isFileIncluded=FFSPRGRulesFactory(),exports.formatSourceMap=formatSourceMap,exports.generateMD5=generateMD5;const formatNumber=e=>e>9?""+e:"0"+e;exports.formatNumber=formatNumber;const formatTime=e=>{const t=e.getFullYear(),r=e.getMonth()+1,i=e.getDate(),n=e.getHours(),o=e.getMinutes(),a=e.getSeconds();return`${[t,r,i].map(exports.formatNumber).join("/")} ${[n,o,a].map(exports.formatNumber).join(":")}`};exports.formatTime=formatTime;
|
|
3
|
+
}(require("licia/lazyImport")(require), require)
|
package/dist/utils/url_config.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
!function(require, directRequire){
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.tcbTencentCloudUrl=exports.dbTencentCloudUrl=exports.scfTencentCloudUrl=exports.cloudCosUploadURL=exports.get3rdCloudCodeSecret=exports.cloudAPIAgentURL=exports.GET_LATEST_VERSION=exports.UPLOAD_JS_SERVER=exports.GET_ASYNC_RESULT=exports.GET_UPLOAD_TOKEN=exports.GET_CLOUD_API_SIGNATURE=exports.TRANSLATE_FILENAME=exports.GET_DEV_SOURCE_MAP=exports.GET_RAND_STRING=exports.GET_ONLINE_SCHEMA=exports.GET_WHITE_EXT_LIST=exports.TEST_SOURCE_URL=exports.UPLOAD_URL=exports.GET_ATTR_URL=void 0;const Domain="https://servicewechat.com";exports.GET_ATTR_URL=Domain+"/wxa/ci/getattr",exports.UPLOAD_URL=Domain+"/wxa/ci/upload",exports.TEST_SOURCE_URL=Domain+"/wxa/ci/testSourceURL",exports.GET_WHITE_EXT_LIST=Domain+"/wxa/ci/getwhiteextlist",exports.GET_ONLINE_SCHEMA=Domain+"/wxa/ci/getonlineschema",exports.GET_RAND_STRING=Domain+"/wxa/ci/getrandstr",exports.GET_DEV_SOURCE_MAP=Domain+"/wxa/ci/get_dev_sourcemap",exports.TRANSLATE_FILENAME=Domain+"/wxa/ci/translate_filename",exports.GET_CLOUD_API_SIGNATURE=Domain+"/wxa/ci/getqcloudapisignature",exports.GET_UPLOAD_TOKEN=Domain+"/wxa/ci/getuploadtoken",exports.GET_ASYNC_RESULT=Domain+"/wxa/ci/getasyncresult",exports.UPLOAD_JS_SERVER=Domain+"/wxa/ci/uploadjsserver",exports.GET_LATEST_VERSION=Domain+"/wxa/ci/getlatestversion",exports.cloudAPIAgentURL=Domain+"/wxa/ci/cloudapihttpagent",exports.get3rdCloudCodeSecret=Domain+"/wxa/ci/getcloudcodesecret",exports.cloudCosUploadURL=Domain+"/wxa/ci/cloudcosupload",exports.scfTencentCloudUrl="https://scf.tencentcloudapi.com",exports.dbTencentCloudUrl="https://flexdb.tencentcloudapi.com",exports.tcbTencentCloudUrl="https://tcb.tencentcloudapi.com";
|
|
3
|
+
}(require("licia/lazyImport")(require), require)
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
!function(require, directRequire){
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getWhiteExtList=exports.GameWhiteList=exports.MiniProgramWhiteList=void 0;const tslib_1=require("tslib"),url_config_1=require("./url_config"),request_1=require("./request"),log_1=(0,tslib_1.__importDefault)(require("./log")),jsonParse_1=require("./jsonParse");let cacheResult;async function getWhiteExtList(){if(cacheResult)return cacheResult;try{const{body:t}=await(0,request_1.request)({url:url_config_1.GET_WHITE_EXT_LIST,method:"get"}),e=(0,jsonParse_1.jsonRespParse)(t,url_config_1.GET_WHITE_EXT_LIST);if(0===e.errCode&&e.data)return cacheResult={GameWhiteList:new Set(e.data.game||exports.GameWhiteList),MiniProgramWhiteList:new Set(e.data.miniProgram||exports.MiniProgramWhiteList)},cacheResult}catch(t){log_1.default.error("get white ext list fail "+t)}return{GameWhiteList:new Set(exports.GameWhiteList),MiniProgramWhiteList:new Set(exports.MiniProgramWhiteList)}}exports.MiniProgramWhiteList=[".wxml",".wxss",".wxs",".png",".jpg",".jpeg",".gif",".svg",".js",".json",".cer",".mp3",".aac",".m4a",".mp4",".wav",".ogg",".silk",".wasm",".br",".cur",".ico",".skel",".crt"],exports.GameWhiteList=[".png",".jpg",".jpeg",".gif",".svg",".js",".json",".cer",".obj",".dae",".fbx",".mtl",".stl",".3ds",".mp3",".pvr",".wav",".plist",".ttf",".fnt",".gz",".ccz",".m4a",".mp4",".bmp",".atlas",".swf",".ani",".part",".proto",".bin",".sk",".mipmaps",".txt",".zip",".ogg",".silk",".dbbin",".dbmv",".etc",".lmat",".lm",".ls",".lh",".lani",".lav",".lsani",".ltc",".csv",".scene",".prefab",".lml",".lmani",".ktx",".dds",".xml",".aac",".pkm",".skel",".cur",".ico",".wasm",".br",".gltf",".glb",".astc",".dat",".tt"],exports.getWhiteExtList=getWhiteExtList;
|
|
3
|
+
}(require("licia/lazyImport")(require), require)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const fs=require("fs"),Reader0=require("./wxvpkg/reader/version0"),Reader10=require("./wxvpkg/reader/version10"),utils_1=require("./wxvpkg/utils"),VERSION_BEGIN=1;class WxvpkgReader{constructor(e){this.readSync=(e,s)=>this.instance.readSync(e,s);const s=fs.openSync(e,"r");if(this.version=utils_1.getVersionByFD(s),0===this.version&&(this.instance=new Reader0(e)),10===this.version&&(this.instance=new Reader10(e)),!this.instance)throw new Error(`${e} unrecognized version: ${this.version}`);fs.close(s,()=>{})}getFile(e){return this.instance.getFile(e)}exists(e){return this.instance.exists(e)}stat(e){return this.instance.stat(e)}close(){this.instance.close()}}module.exports=WxvpkgReader;
|
|
1
|
+
"use strict";const fs=require("fs"),Reader0=require("./wxvpkg/reader/version0"),Reader10=require("./wxvpkg/reader/version10"),utils_1=require("./wxvpkg/utils"),VERSION_BEGIN=1;class WxvpkgReader{constructor(e){this.readSync=(e,s)=>this.instance.readSync(e,s);const s=fs.openSync(e,"r");if(this.version=(0,utils_1.getVersionByFD)(s),0===this.version&&(this.instance=new Reader0(e)),10===this.version&&(this.instance=new Reader10(e)),!this.instance)throw new Error(`${e} unrecognized version: ${this.version}`);fs.close(s,()=>{})}getFile(e){return this.instance.getFile(e)}exists(e){return this.instance.exists(e)}stat(e){return this.instance.stat(e)}close(){this.instance.close()}}module.exports=WxvpkgReader;
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
!function(require, directRequire){
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const tslib_1=require("tslib");(0,tslib_1.__exportStar)(require("./tcb/index"),exports),(0,tslib_1.__exportStar)(require("./flexdb/index"),exports),(0,tslib_1.__exportStar)(require("./scf/index"),exports),(0,tslib_1.__exportStar)(require("./cdn/index"),exports),(0,tslib_1.__exportStar)(require("./ssl/index"),exports);
|
|
3
|
+
}(require("licia/lazyImport")(require), require)
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
!function(require, directRequire){
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.cdnTcbCheckResource=exports.cdnTcbModifyAttribute=void 0;const tslib_1=require("tslib"),transactor_1=(0,tslib_1.__importDefault)(require("../../transaction/transactor")),cdnContracts=(0,tslib_1.__importStar)(require("../../transaction/contracts/contracts"));async function cdnTcbModifyAttribute(i){var e;const t={Action:"TcbModifyAttribute",Version:"2018-06-06",Region:i.region,Domain:i.domain,DomainId:i.domainId,DomainConfig:{Origin:i.domainConfig.origin?{Master:i.domainConfig.origin.master,Slave:i.domainConfig.origin.slave}:i.domainConfig.origin,CosPrivateAccess:i.domainConfig.cosPrivateAccess,Authentication:i.domainConfig.authentication?{Switch:i.domainConfig.authentication.switch,SecretKey:i.domainConfig.authentication.secretKey,SignParam:i.domainConfig.authentication.signParam,TimeParam:i.domainConfig.authentication.timeParam,ExpireTime:i.domainConfig.authentication.expireTime}:i.domainConfig.authentication,Cache:null===(e=i.domainConfig.cache)||void 0===e?void 0:e.map(i=>({RuleType:i.ruleType,RuleValue:i.ruleValue,CacheTtl:i.cacheTtl})),StaticWeb:i.domainConfig.staticWeb?{Switch:i.domainConfig.staticWeb.switch,Path:i.domainConfig.staticWeb.path}:i.domainConfig.staticWeb,RootAccess:i.domainConfig.rootAccess,SpeedLimit:i.domainConfig.speedLimit,Https:i.domainConfig.https?{Switch:i.domainConfig.https.switch,CertInfo:i.domainConfig.https.certInfo?{HttpsType:i.domainConfig.https.certInfo.httpsType,CertId:i.domainConfig.https.certInfo.certId}:i.domainConfig.https.certInfo}:i.domainConfig.https,RspHeader:i.domainConfig.rspHeader?{Switch:i.domainConfig.rspHeader.switch,HeaderRules:(i.domainConfig.rspHeader.headerRules||[]).map(i=>({HeaderName:i.headerName,HeaderValue:i.headerValue}))}:i.domainConfig.rspHeader,FollowRedirect:i.domainConfig.followRedirect,IpFilter:i.domainConfig.ipFilter?{Switch:i.domainConfig.ipFilter.switch,FilterType:i.domainConfig.ipFilter.filterType,Filters:i.domainConfig.ipFilter.filters||[]}:i.domainConfig.ipFilter,IpFreqLimit:i.domainConfig.ipFreqLimit?{Switch:i.domainConfig.ipFreqLimit.switch,Qps:i.domainConfig.ipFreqLimit.qps}:i.domainConfig.ipFreqLimit,ForceRedirect:i.domainConfig.forceRedirect?{Switch:i.domainConfig.forceRedirect.switch,RedirectType:i.domainConfig.forceRedirect.redirectType,RedirectStatusCode:i.domainConfig.forceRedirect.redirectStatusCode}:i.domainConfig.forceRedirect,Refer:i.domainConfig.refer?{Switch:i.domainConfig.refer.switch,RefererRules:(i.domainConfig.refer.refererRules||[]).map(i=>({RefererType:i.refererType,Referers:i.referers,AllowEmpty:i.allowEmpty}))}:i.domainConfig.refer}},o=await(0,transactor_1.default)(cdnContracts.cdnTcbModifyAttributeContract,t);return{domainId:o.DomainId,origin:{master:o.Origin.Master,slave:o.Origin.Slave},cosPrivateAccess:o.CosPrivateAccess,authentication:{switch:o.Authentication.Switch,secretKey:o.Authentication.SecretKey,signParam:o.Authentication.SignParam,timeParam:o.Authentication.TimeParam,expireTime:o.Authentication.ExpireTime},cache:o.Cache.map(i=>({ruleType:i.RuleType,ruleValue:i.RuleValue,cacheTtl:i.CacheTtl})),staticWeb:o.StaticWeb?{switch:o.StaticWeb.Switch,path:o.StaticWeb.Path}:o.StaticWeb,rootAccess:o.RootAccess}}async function cdnTcbCheckResource(i){const e={Action:"TcbCheckResource",Version:"2018-06-06",Region:i.region,Domains:i.domains},t=await(0,transactor_1.default)(cdnContracts.cdnTcbCheckResourceContract,e);return{domains:t.Domains.map(i=>{var e;return{domain:i.Domain,domainId:i.DomainId,status:i.Status,domainConfig:{origin:i.DomainConfig.Origin?{master:i.DomainConfig.Origin.Master,slave:i.DomainConfig.Origin.Slave}:i.DomainConfig.Origin,cosPrivateAccess:i.DomainConfig.CosPrivateAccess,authentication:i.DomainConfig.Authentication?{switch:i.DomainConfig.Authentication.Switch,secretKey:i.DomainConfig.Authentication.SecretKey,signParam:i.DomainConfig.Authentication.SignParam,timeParam:i.DomainConfig.Authentication.TimeParam,expireTime:i.DomainConfig.Authentication.ExpireTime}:i.DomainConfig.Authentication,cache:null===(e=i.DomainConfig.Cache)||void 0===e?void 0:e.map(i=>({ruleType:i.RuleType,ruleValue:i.RuleValue,cacheTtl:i.CacheTtl})),staticWeb:i.DomainConfig.StaticWeb?{switch:i.DomainConfig.StaticWeb.Switch,path:i.DomainConfig.StaticWeb.Path}:i.DomainConfig.StaticWeb,rootAccess:i.DomainConfig.RootAccess,speedLimit:i.DomainConfig.SpeedLimit,https:i.DomainConfig.Https?{switch:i.DomainConfig.Https.Switch,certInfo:i.DomainConfig.Https.CertInfo?{httpsType:i.DomainConfig.Https.CertInfo.HttpsType,certId:i.DomainConfig.Https.CertInfo.CertId}:i.DomainConfig.Https.CertInfo}:i.DomainConfig.Https,rspHeader:i.DomainConfig.RspHeader?{switch:i.DomainConfig.RspHeader.Switch,headerRules:(i.DomainConfig.RspHeader.HeaderRules||[]).map(i=>({headerName:i.HeaderName,headerValue:i.HeaderValue}))}:i.DomainConfig.RspHeader,followRedirect:i.DomainConfig.FollowRedirect,ipFilter:i.DomainConfig.IpFilter?{switch:i.DomainConfig.IpFilter.Switch,filterType:i.DomainConfig.IpFilter.FilterType,filters:i.DomainConfig.IpFilter.Filters||[]}:i.DomainConfig.IpFilter,ipFreqLimit:i.DomainConfig.IpFreqLimit?{switch:i.DomainConfig.IpFreqLimit.Switch,qps:i.DomainConfig.IpFreqLimit.Qps}:i.DomainConfig.IpFreqLimit,forceRedirect:i.DomainConfig.ForceRedirect?{switch:i.DomainConfig.ForceRedirect.Switch,redirectType:i.DomainConfig.ForceRedirect.RedirectType,redirectStatusCode:i.DomainConfig.ForceRedirect.RedirectStatusCode}:i.DomainConfig.ForceRedirect,refer:i.DomainConfig.Refer?{switch:i.DomainConfig.Refer.Switch,refererRules:(i.DomainConfig.Refer.RefererRules||[]).map(i=>({refererType:i.RefererType,referers:i.Referers,allowEmpty:i.AllowEmpty}))}:i.DomainConfig.Refer},cName:i.CName}}),recordCount:t.RecordCount}}exports.cdnTcbModifyAttribute=cdnTcbModifyAttribute,exports.cdnTcbCheckResource=cdnTcbCheckResource;
|
|
3
|
+
}(require("licia/lazyImport")(require), require)
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
!function(require, directRequire){
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const tslib_1=require("tslib");(0,tslib_1.__exportStar)(require("./cdn.apis"),exports);
|
|
3
|
+
}(require("licia/lazyImport")(require), require)
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
!function(require, directRequire){
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.flexdbModifyNameSpace=exports.flexdbDescribeRestoreTime=exports.flexdbRestoreTCBTables=exports.flexdbDescribeRestoreTask=exports.flexdbDescribeRestoreTables=exports.flexdbModifyTableNames=exports.flexdbRunCommands=exports.flexdbUpdateTable=exports.flexdbDescribeTable=exports.flexdbCount=exports.flexdbDeleteItem=exports.flexdbUpdateItem=exports.flexdbPutItem=exports.flexdbQuery=exports.flexdbDeleteTable=exports.flexdbCreateTable=exports.flexdbListTables=void 0;const tslib_1=require("tslib"),transactor_1=(0,tslib_1.__importDefault)(require("../../transaction/transactor")),contracts_1=require("../../transaction/contracts/contracts"),flexdbContracts=(0,tslib_1.__importStar)(require("../../transaction/contracts/contracts"));async function flexdbListTables(e){const t={Action:"ListTables",Version:"2018-11-27",Region:e.region,Tag:e.tag,MgoLimit:e.mgoLimit,MgoOffset:e.mgoOffset};try{const e=await(0,transactor_1.default)(contracts_1.flexdbListTablesContract,t);return{tables:e.Tables?e.Tables.map(e=>({tableName:e.TableName,count:e.Count,size:e.Size,indexCount:e.IndexCount,indexSize:e.IndexSize})):[],pager:{offset:e.Pager.Offset,limit:e.Pager.Limit,total:e.Pager.Total}}}catch(e){throw e}}async function flexdbCreateTable(e){const t={Action:"CreateTable",Version:"2018-11-27",Region:e.region,Tag:e.tag,TableName:e.tableName};try{return await(0,transactor_1.default)(contracts_1.flexdbCreateTableContract,t),{}}catch(e){throw e}}async function flexdbDeleteTable(e){const t={Action:"DeleteTable",Version:"2018-11-27",Region:e.region,Tag:e.tag,TableName:e.tableName};try{return await(0,transactor_1.default)(contracts_1.flexdbDeleteTableContract,t),{}}catch(e){throw e}}async function flexdbQuery(e){const t={Action:"Query",Version:"2018-11-27",Region:e.region,Tag:e.tag,TableName:e.tableName,MgoLimit:e.mgoLimit,MgoProjection:e.mgoProjection,MgoQuery:e.mgoQuery,MgoOffset:e.mgoOffset,MgoSort:e.mgoSort};try{const e=await(0,transactor_1.default)(contracts_1.flexdbQueryContract,t);return{data:e.Data?e.Data.map(e=>JSON.parse(e)):[],pager:{offset:e.Pager.Offset,limit:e.Pager.Limit,total:e.Pager.Total}}}catch(e){throw e}}async function flexdbPutItem(e){const t={Action:"PutItem",Version:"2018-11-27",Region:e.region,Tag:e.tag,TableName:e.tableName,MgoDocs:e.mgoDocs};try{return{insertedIds:(await(0,transactor_1.default)(contracts_1.flexdbPutItemContract,t)).InsertedIds}}catch(e){throw e}}async function flexdbUpdateItem(e){const t={Action:"UpdateItem",Version:"2018-11-27",Region:e.region,Tag:e.tag,TableName:e.tableName,MgoUpdate:e.mgoUpdate,MgoUpsert:e.mgoUpsert,MgoIsMulti:e.mgoIsMulti,MgoQuery:e.mgoQuery};try{const e=await(0,transactor_1.default)(contracts_1.flexdbUpdateItemContract,t);return{modifiedNum:e.ModifiedNum,matchedNum:e.MatchedNum,upsertedId:e.UpsertedId}}catch(e){throw e}}async function flexdbDeleteItem(e){const t={Action:"DeleteItem",Version:"2018-11-27",Region:e.region,Tag:e.tag,TableName:e.tableName,MgoIsMulti:e.mgoIsMulti,MgoQuery:e.mgoQuery};try{return{deleted:(await(0,transactor_1.default)(contracts_1.flexdbDeleteItemContract,t)).Deleted}}catch(e){throw e}}async function flexdbCount(e){const t={Action:"Count",Version:"2018-11-27",Region:e.region,Tag:e.tag,TableName:e.tableName,MgoQuery:e.mgoQuery};try{return{count:(await(0,transactor_1.default)(contracts_1.flexdbCountContract,t)).Count}}catch(e){throw e}}async function flexdbDescribeTable(e){const t={Action:"DescribeTable",Version:"2018-11-27",Region:e.region,Tag:e.tag,TableName:e.tableName};try{const e=await(0,transactor_1.default)(contracts_1.flexdbDescribeTableContract,t);return{indexes:e.Indexes.map(e=>({name:e.Name,size:e.Size,keys:e.Keys.map(e=>({name:e.Name,direction:e.Direction})),accesses:{ops:e.Accesses.Ops,since:e.Accesses.Since},unique:e.Unique})),indexNum:e.IndexNum}}catch(e){throw e}}async function flexdbUpdateTable(e){const t={Action:"UpdateTable",Version:"2018-11-27",Region:e.region,Tag:e.tag,TableName:e.tableName,CreateIndexes:(e.createIndexes||[]).map(e=>({IndexName:e.indexName,MgoKeySchema:{MgoIndexKeys:e.mgoKeySchema.mgoIndexKeys.map(e=>({Name:e.name,Direction:e.direction})),MgoIsUnique:e.mgoKeySchema.mgoIsUnique}})),DropIndexes:(e.dropIndexes||[]).map(e=>({IndexName:e.indexName}))};try{return await(0,transactor_1.default)(contracts_1.flexdbUpdateTableContract,t),{}}catch(e){throw e}}async function flexdbRunCommands(e){const t={Action:"RunCommands",Version:"2018-11-27",Region:e.region,Tag:e.tag,MgoCommands:e.mgoCommands.map(e=>({TableName:e.tableName,CommandType:e.commandType,Command:e.command}))};try{return{data:(await(0,transactor_1.default)(contracts_1.flexdbRunCommandsContract,t)).Data}}catch(e){throw e}}async function flexdbModifyTableNames(e){const t={Action:"ModifyTableNames",Version:"2018-11-27",Region:e.region,InstanceId:e.instanceId,ModifyTableInfo:e.modifyTableInfo.map(e=>({OldTableName:e.oldTableName,NewTableName:e.newTableName}))};try{return{flowId:(await(0,transactor_1.default)(contracts_1.flexdbModifyTableNamesContract,t)).FlowId}}catch(e){throw e}}async function flexdbDescribeRestoreTables(e){const t={Action:"DescribeRestoreTables",Version:"2018-11-27",Region:e.region,InstanceId:e.instanceId,Time:e.time};return{tables:(await(0,transactor_1.default)(contracts_1.flexdbDescribeRestoreTablesContract,t)).Tables}}async function flexdbDescribeRestoreTask(e){const t={Action:"DescribeRestoreTask",Version:"2018-11-27",Region:e.region,InstanceId:e.instanceId};return{tasks:(await(0,transactor_1.default)(contracts_1.flexdbDescribeRestoreTaskContract,t)).Tasks.map(e=>({tables:(e.Tables||[]).map(e=>({oldTableName:e.OldTableName,newTableName:e.NewTableName})),createTime:e.CreateTime,status:e.Status,endTime:e.EndTime,restoreTime:e.RestoreTime}))}}async function flexdbRestoreTCBTables(e){const t={Action:"RestoreTCBTables",Version:"2018-11-27",Region:e.region,InstanceId:e.instanceId,Time:e.time,ModifyTableNamesInfo:e.modifyTableNamesInfo.map(e=>({OldTableName:e.oldTableName,NewTableName:e.newTableName}))};return{flowId:(await(0,transactor_1.default)(flexdbContracts.flexdbRestoreTCBTablesContract,t)).FlowId}}async function flexdbDescribeRestoreTime(e){const t={Action:"DescribeRestoreTime",Version:"2018-11-27",Region:e.region,InstanceId:e.instanceId};return{restoreTimes:(await(0,transactor_1.default)(flexdbContracts.flexdbDescribeRestoreTimeContract,t)).RestoreTimes}}async function flexdbModifyNameSpace(e){const t={Action:"ModifyNameSpace",Version:"2018-11-27",Region:e.region,Tag:e.tag,ModifyTableInfo:e.modifyTableInfo.map(e=>({OldTableName:e.oldTableName,NewTableName:e.newTableName}))};return{flowId:(await(0,transactor_1.default)(flexdbContracts.flexdbModifyNameSpaceContract,t)).FlowId}}exports.flexdbListTables=flexdbListTables,exports.flexdbCreateTable=flexdbCreateTable,exports.flexdbDeleteTable=flexdbDeleteTable,exports.flexdbQuery=flexdbQuery,exports.flexdbPutItem=flexdbPutItem,exports.flexdbUpdateItem=flexdbUpdateItem,exports.flexdbDeleteItem=flexdbDeleteItem,exports.flexdbCount=flexdbCount,exports.flexdbDescribeTable=flexdbDescribeTable,exports.flexdbUpdateTable=flexdbUpdateTable,exports.flexdbRunCommands=flexdbRunCommands,exports.flexdbModifyTableNames=flexdbModifyTableNames,exports.flexdbDescribeRestoreTables=flexdbDescribeRestoreTables,exports.flexdbDescribeRestoreTask=flexdbDescribeRestoreTask,exports.flexdbRestoreTCBTables=flexdbRestoreTCBTables,exports.flexdbDescribeRestoreTime=flexdbDescribeRestoreTime,exports.flexdbModifyNameSpace=flexdbModifyNameSpace;
|
|
3
|
+
}(require("licia/lazyImport")(require), require)
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
!function(require, directRequire){
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const tslib_1=require("tslib");(0,tslib_1.__exportStar)(require("./flexdb.apis"),exports);
|
|
3
|
+
}(require("licia/lazyImport")(require), require)
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
!function(require, directRequire){
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const tslib_1=require("tslib");(0,tslib_1.__exportStar)(require("./scf.apis"),exports);
|
|
3
|
+
}(require("licia/lazyImport")(require), require)
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.scfListVersionByFunction=exports.scfPublishVersion=exports.scfGetAlias=exports.scfUpdateAlias=exports.scfGetFunctionLogs=exports.scfInvokeFunction=exports.scfGetFunctionAddress=exports.scfBatchCreateTrigger=exports.scfUpdateFunctionTestModel=exports.scfDeleteFunctionTestModel=exports.scfCreateFunctionTestModel=exports.scfGetFunctionTestModel=exports.scfListFunctionTestModels=exports.scfUpdateFunctionInfo=exports.scfGetFunctionInfo=exports.scfDeleteFunction=exports.scfUpdateFunctionIncrementalCode=exports.scfUpdateFunction=exports.scfCreateFunction=exports.scfListAllFunctions=exports.scfListFunctions=void 0;const tslib_1=require("tslib"),transactor_1=tslib_1.__importDefault(require("../../transaction/transactor")),contracts_1=require("../../transaction/contracts/contracts"),common_1=require("../../utils/common");async function scfListFunctions(e,t){const n={Action:"ListFunctions",Version:"2018-04-16",Region:e.region,Order:e.order,Orderby:e.orderBy,Offset:e.offset,Limit:e.limit,SearchKey:e.searchKey,Namespace:e.namespace,Description:e.description},o=await transactor_1.default(contracts_1.scfListFunctionsContract,n,t);return{functions:(o.Functions||[]).map(e=>({modTime:common_1.strToDate(e.ModTime),addTime:common_1.strToDate(e.AddTime),runtime:e.Runtime,functionName:e.FunctionName,functionId:e.FunctionId,namespace:e.Namespace,status:e.Status,statusDesc:e.StatusDesc,description:e.Description,tags:(e.Tags||[]).map(e=>({key:e.Key,value:e.Value}))})),totalCount:o.TotalCount}}async function scfListAllFunctions(e,t=[],n=0,o){const i=e.limit||100,{functions:s,totalCount:c}=await scfListFunctions({offset:n,limit:i,order:e.order,orderBy:e.orderBy,searchKey:e.searchKey,namespace:e.namespace,description:e.description,region:e.region},o);return c>n+i?scfListAllFunctions(e,[...t,...s],n+i):{functions:[...t,...s],totalCount:c}}async function scfCreateFunction(e,t){const n={Action:"CreateFunction",Version:"2018-04-16",Region:e.region,FunctionName:e.functionName,Code:{ZipFile:e.code.zipFile},Handler:e.handler,Description:e.description,MemorySize:e.memorySize,Timeout:e.timeout,Role:e.role,Environment:{Variables:e.environment.variables.map(e=>({Key:e.key,Value:e.value}))},Runtime:e.runtime,Namespace:e.namespace,Stamp:e.stamp,CodeSecret:e.codeSecret,ClsLogsetId:e.clsLogsetId,ClsTopicId:e.clsTopicId};e.hasOwnProperty("installDependency")&&(n.InstallDependency=e.installDependency?"TRUE":"FALSE"),await transactor_1.default(contracts_1.scfCreateFunctionContract,n,t);return{}}async function scfUpdateFunction(e,t){const n={Action:"UpdateFunctionCode",Version:"2018-04-16",Region:e.region,FunctionName:e.functionName,ZipFile:e.fileData,Handler:e.handler||"index.main",Namespace:e.namespace,InstallDependency:e.installDependency?"TRUE":"FALSE",CodeSecret:e.codeSecret};await transactor_1.default(contracts_1.scfUpdateFunctionContract,n,t);return{}}async function scfUpdateFunctionIncrementalCode(e,t){const n={Action:"UpdateFunctionIncrementalCode",Version:"2018-04-16",Region:e.region,FunctionName:e.functionName,Namespace:e.namespace,AddFiles:e.addFiles,DeleteFiles:e.deleteFiles};await transactor_1.default(contracts_1.scfUpdateFunctionIncrementalCodeContract,n,t);return{}}async function scfDeleteFunction(e,t){const n={Action:"DeleteFunction",Version:"2018-04-16",FunctionName:e.functionName,Namespace:e.namespace,Region:e.region};await transactor_1.default(contracts_1.scfDeleteFunctionContract,n,t);return{}}async function scfGetFunctionInfo(e,t){const n={Action:"GetFunction",Version:"2018-04-16",FunctionName:e.functionName,Region:e.region,Qualifier:e.qualifier,Namespace:e.namespace,CodeSecret:e.codeSecret},o=await transactor_1.default(contracts_1.scfGetFunctionInfoContract,n,t);return{environment:{variables:(o.Environment||{}).Variables.map(e=>({key:e.Key,value:e.Value}))},functionName:o.FunctionName,runtime:o.Runtime,handler:o.Handler,memorySize:o.MemorySize,timeout:o.Timeout,status:o.Status,statusDesc:o.StatusDesc,installDependency:o.InstallDependency,pubnetConfig:"ENABLE"===o.PublicNetConfig.EipConfig.EipStatus,pubnetIp:o.PublicNetConfig.EipConfig.EipAddress}}async function scfUpdateFunctionInfo(e,t){const n={Action:"UpdateFunctionConfiguration",Version:"2018-04-16",FunctionName:e.functionName,Region:e.region,Namespace:e.namespace,Runtime:e.runtime,MemorySize:e.memorySize,Environment:e.environment?{Variables:e.environment.variables.map(e=>({Key:e.key,Value:e.value}))}:void 0,Timeout:e.timeout,ClsLogsetId:e.clsLogsetId,ClsTopicId:e.clsTopicId};e.hasOwnProperty("installDependency")&&(n.InstallDependency=e.installDependency?"TRUE":"FALSE"),e.hasOwnProperty("systemEnvironment")&&(n.SystemEnvironment={Variables:e.systemEnvironment.variables.map(e=>({Key:e.key,Value:e.value}))}),await transactor_1.default(contracts_1.scfUpdateFunctionInfoContract,n,t);return{}}async function scfListFunctionTestModels(e,t){const n={Action:"ListFunctionTestModels",Version:"2018-04-16",Region:e.region,FunctionName:e.functionName,Namespace:e.namespace};return{testModels:(await transactor_1.default(contracts_1.scfListFunctionTestModelsContract,n,t)).TestModels||[]}}async function scfGetFunctionTestModel(e,t){const n={Action:"GetFunctionTestModel",Version:"2018-04-16",Region:e.region,FunctionName:e.functionName,TestModelName:e.testModelName,Namespace:e.namespace},o=await transactor_1.default(contracts_1.scfGetFunctionTestModelContract,n,t);return{testModelValue:o.TestModelValue,functionName:o.FunctionName,testModelName:o.TestModelName,createdTime:o.CreatedTime,modifiedTime:o.ModifiedTime,namespace:o.Namespace}}async function scfCreateFunctionTestModel(e,t){const n={Action:"CreateFunctionTestModel",Version:"2018-04-16",Region:e.region,FunctionName:e.functionName,TestModelName:e.testModelName,TestModelValue:e.testModelValue,Namespace:e.namespace};await transactor_1.default(contracts_1.scfCreateFunctionTestModelContract,n,t);return{}}async function scfDeleteFunctionTestModel(e,t){const n={Action:"DeleteFunctionTestModel",Version:"2018-04-16",Region:e.region,FunctionName:e.functionName,TestModelName:e.testModelName,Namespace:e.namespace};await transactor_1.default(contracts_1.scfDeleteFunctionTestModelContract,n,t);return{}}async function scfUpdateFunctionTestModel(e,t){const n={Action:"UpdateFunctionTestModel",Version:"2018-04-16",Region:e.region,FunctionName:e.functionName,TestModelName:e.testModelName,TestModelValue:e.testModelValue,Namespace:e.namespace};await transactor_1.default(contracts_1.scfUpdateFunctionTestModelContract,n,t);return{}}async function scfBatchCreateTrigger(e,t){const n={Action:"BatchCreateTrigger",Version:"2018-04-16",Region:e.region,FunctionName:e.functionName,Namespace:e.namespace,Triggers:JSON.stringify(e.triggers.map(e=>({TriggerName:e.triggerName,Type:e.type,TriggerDesc:e.triggerDesc}))),Count:e.triggers.length};await transactor_1.default(contracts_1.scfBatchCreateTriggerContract,n,t);return{}}async function scfGetFunctionAddress(e,t){const n={Action:"GetFunctionAddress",Version:"2018-04-16",Region:e.region,FunctionName:e.functionName,Namespace:e.namespace,CodeSecret:e.codeSecret},o=await transactor_1.default(contracts_1.scfGetFunctionAddressContract,n,t);return{codeSha256:o.CodeSha256,url:o.Url}}async function scfInvokeFunction(e,t){const n={Action:"Invoke",Version:"2018-04-16",Region:e.region,FunctionName:e.functionName,Namespace:e.namespace,InvocationType:e.invocationType,Qualifier:e.qualifier,ClientContext:e.clientContext};return{result:{functionRequestId:(await transactor_1.default(contracts_1.scfInvokeFunctionContract,n,t)).Result.FunctionRequestId}}}async function scfGetFunctionLogs(e,t,n){const o={Action:"GetFunctionLogs",Version:"2018-04-16",Region:e.region,FunctionName:e.functionName,Namespace:e.namespace,Offset:e.offset,Limit:e.limit,Order:e.order,OrderBy:e.orderBy,Filter:e.filter?{RetCode:e.filter.retCode}:void 0,Qualifier:e.qualifier,FunctionRequestId:e.functionRequestId,StartTime:e.startTime?common_1.dateToStr(e.startTime):void 0,EndTime:e.endTime?common_1.dateToStr(e.endTime):void 0};return{data:(await transactor_1.default(contracts_1.scfGetFunctionLogsContract,o,Object.assign(Object.assign({},n),{isPoll:t}))).Data.map(e=>({functionName:e.FunctionName,retMsg:e.RetMsg,requestId:e.RequestId,startTime:common_1.strToDate(e.StartTime),retCode:e.RetCode,invokeFinished:e.InvokeFinished,duration:e.Duration,billDuration:e.BillDuration,memUsage:e.MemUsage,log:e.Log}))}}async function scfUpdateAlias(e){var t,n;const o={Action:"UpdateAlias",Version:"2018-04-16",Region:e.region,FunctionName:e.functionName,Name:e.name,FunctionVersion:e.functionVersion,Namespace:e.namespace,RoutingConfig:e.routingConfig?{AdditionalVersionWeights:null===(t=e.routingConfig.additionalVersionWeights)||void 0===t?void 0:t.map(e=>({Version:e.version,Weight:e.weight})),AddtionVersionMatchs:null===(n=e.routingConfig.addtionVersionMatchs)||void 0===n?void 0:n.map(e=>({Version:e.version,Key:e.key,Method:e.method,Expression:e.expression}))}:e.routingConfig,Description:e.description};await transactor_1.default(contracts_1.scfUpdateAliasContract,o);return{}}async function scfGetAlias(e){var t,n;const o={Action:"GetAlias",Version:"2018-04-16",Region:e.region,FunctionName:e.functionName,Name:e.name,Namespace:e.namespace},i=await transactor_1.default(contracts_1.scfGetAliasContract,o);return{functionVersion:i.FunctionVersion,name:i.Name,routingConfig:{additionalVersionWeights:null===(t=i.RoutingConfig.AdditionalVersionWeights)||void 0===t?void 0:t.map(e=>({version:e.Version,weight:e.Weight})),addtionVersionMatchs:null===(n=i.RoutingConfig.AddtionVersionMatchs)||void 0===n?void 0:n.map(e=>({version:e.Version,key:e.Key,method:e.Method,expression:e.Expression}))},description:i.Description,addTime:i.AddTime,modTime:i.ModTime}}async function scfPublishVersion(e){const t={Action:"PublishVersion",Version:"2018-04-16",Region:e.region,FunctionName:e.functionName,Description:e.description,Namespace:e.namespace},n=await transactor_1.default(contracts_1.scfPublishVersionContract,t);return{functionVersion:n.FunctionVersion,codeSize:n.CodeSize,memorySize:n.MemorySize,description:n.Description,handler:n.Handler,timeout:n.Timeout,runtime:n.Runtime,namespace:n.Namespace}}async function scfListVersionByFunction(e){const t={Action:"ListVersionByFunction",Version:"2018-04-16",Region:e.region,FunctionName:e.functionName,Namespace:e.namespace,SearchKey:e.searchKey},n=await transactor_1.default(contracts_1.scfListVersionByFunctionContract,t);return{functionVersion:n.FunctionVersion,versions:(n.Versions||[]).map(e=>({version:e.Version,description:e.Description,addTime:e.AddTime,modTime:e.ModTime}))}}exports.scfListFunctions=scfListFunctions,exports.scfListAllFunctions=scfListAllFunctions,exports.scfCreateFunction=scfCreateFunction,exports.scfUpdateFunction=scfUpdateFunction,exports.scfUpdateFunctionIncrementalCode=scfUpdateFunctionIncrementalCode,exports.scfDeleteFunction=scfDeleteFunction,exports.scfGetFunctionInfo=scfGetFunctionInfo,exports.scfUpdateFunctionInfo=scfUpdateFunctionInfo,exports.scfListFunctionTestModels=scfListFunctionTestModels,exports.scfGetFunctionTestModel=scfGetFunctionTestModel,exports.scfCreateFunctionTestModel=scfCreateFunctionTestModel,exports.scfDeleteFunctionTestModel=scfDeleteFunctionTestModel,exports.scfUpdateFunctionTestModel=scfUpdateFunctionTestModel,exports.scfBatchCreateTrigger=scfBatchCreateTrigger,exports.scfGetFunctionAddress=scfGetFunctionAddress,exports.scfInvokeFunction=scfInvokeFunction,exports.scfGetFunctionLogs=scfGetFunctionLogs,exports.scfUpdateAlias=scfUpdateAlias,exports.scfGetAlias=scfGetAlias,exports.scfPublishVersion=scfPublishVersion,exports.scfListVersionByFunction=scfListVersionByFunction;
|
|
1
|
+
!function(require, directRequire){
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.scfListVersionByFunction=exports.scfPublishVersion=exports.scfGetAlias=exports.scfUpdateAlias=exports.scfGetFunctionLogs=exports.scfInvokeFunction=exports.scfGetFunctionAddress=exports.scfBatchCreateTrigger=exports.scfUpdateFunctionTestModel=exports.scfDeleteFunctionTestModel=exports.scfCreateFunctionTestModel=exports.scfGetFunctionTestModel=exports.scfListFunctionTestModels=exports.scfUpdateFunctionInfo=exports.scfGetFunctionInfo=exports.scfDeleteFunction=exports.scfUpdateFunctionIncrementalCode=exports.scfUpdateFunction=exports.scfCreateFunction=exports.scfListAllFunctions=exports.scfListFunctions=void 0;const tslib_1=require("tslib"),transactor_1=(0,tslib_1.__importDefault)(require("../../transaction/transactor")),contracts_1=require("../../transaction/contracts/contracts"),common_1=require("../../utils/common");async function scfListFunctions(e,t){const n={Action:"ListFunctions",Version:"2018-04-16",Region:e.region,Order:e.order,Orderby:e.orderBy,Offset:e.offset,Limit:e.limit,SearchKey:e.searchKey,Namespace:e.namespace,Description:e.description},o=await(0,transactor_1.default)(contracts_1.scfListFunctionsContract,n,t);return{functions:(o.Functions||[]).map(e=>({modTime:(0,common_1.strToDate)(e.ModTime),addTime:(0,common_1.strToDate)(e.AddTime),runtime:e.Runtime,functionName:e.FunctionName,functionId:e.FunctionId,namespace:e.Namespace,status:e.Status,statusDesc:e.StatusDesc,description:e.Description,tags:(e.Tags||[]).map(e=>({key:e.Key,value:e.Value}))})),totalCount:o.TotalCount}}async function scfListAllFunctions(e,t=[],n=0,o){const i=e.limit||100,{functions:s,totalCount:c}=await scfListFunctions({offset:n,limit:i,order:e.order,orderBy:e.orderBy,searchKey:e.searchKey,namespace:e.namespace,description:e.description,region:e.region},o);return c>n+i?scfListAllFunctions(e,[...t,...s],n+i):{functions:[...t,...s],totalCount:c}}async function scfCreateFunction(e,t){const n={Action:"CreateFunction",Version:"2018-04-16",Region:e.region,FunctionName:e.functionName,Code:{ZipFile:e.code.zipFile},Handler:e.handler,Description:e.description,MemorySize:e.memorySize,Timeout:e.timeout,Role:e.role,Environment:{Variables:e.environment.variables.map(e=>({Key:e.key,Value:e.value}))},Runtime:e.runtime,Namespace:e.namespace,Stamp:e.stamp,CodeSecret:e.codeSecret,ClsLogsetId:e.clsLogsetId,ClsTopicId:e.clsTopicId};e.hasOwnProperty("installDependency")&&(n.InstallDependency=e.installDependency?"TRUE":"FALSE"),await(0,transactor_1.default)(contracts_1.scfCreateFunctionContract,n,t);return{}}async function scfUpdateFunction(e,t){const n={Action:"UpdateFunctionCode",Version:"2018-04-16",Region:e.region,FunctionName:e.functionName,ZipFile:e.fileData,Handler:e.handler||"index.main",Namespace:e.namespace,InstallDependency:e.installDependency?"TRUE":"FALSE",CodeSecret:e.codeSecret};await(0,transactor_1.default)(contracts_1.scfUpdateFunctionContract,n,t);return{}}async function scfUpdateFunctionIncrementalCode(e,t){const n={Action:"UpdateFunctionIncrementalCode",Version:"2018-04-16",Region:e.region,FunctionName:e.functionName,Namespace:e.namespace,AddFiles:e.addFiles,DeleteFiles:e.deleteFiles};await(0,transactor_1.default)(contracts_1.scfUpdateFunctionIncrementalCodeContract,n,t);return{}}async function scfDeleteFunction(e,t){const n={Action:"DeleteFunction",Version:"2018-04-16",FunctionName:e.functionName,Namespace:e.namespace,Region:e.region};await(0,transactor_1.default)(contracts_1.scfDeleteFunctionContract,n,t);return{}}async function scfGetFunctionInfo(e,t){const n={Action:"GetFunction",Version:"2018-04-16",FunctionName:e.functionName,Region:e.region,Qualifier:e.qualifier,Namespace:e.namespace,CodeSecret:e.codeSecret},o=await(0,transactor_1.default)(contracts_1.scfGetFunctionInfoContract,n,t);return{environment:{variables:(o.Environment||{}).Variables.map(e=>({key:e.Key,value:e.Value}))},functionName:o.FunctionName,runtime:o.Runtime,handler:o.Handler,memorySize:o.MemorySize,timeout:o.Timeout,status:o.Status,statusDesc:o.StatusDesc,installDependency:o.InstallDependency,pubnetConfig:"ENABLE"===o.PublicNetConfig.EipConfig.EipStatus,pubnetIp:o.PublicNetConfig.EipConfig.EipAddress}}async function scfUpdateFunctionInfo(e,t){const n={Action:"UpdateFunctionConfiguration",Version:"2018-04-16",FunctionName:e.functionName,Region:e.region,Namespace:e.namespace,Runtime:e.runtime,MemorySize:e.memorySize,Environment:e.environment?{Variables:e.environment.variables.map(e=>({Key:e.key,Value:e.value}))}:void 0,Timeout:e.timeout,ClsLogsetId:e.clsLogsetId,ClsTopicId:e.clsTopicId};e.hasOwnProperty("installDependency")&&(n.InstallDependency=e.installDependency?"TRUE":"FALSE"),e.hasOwnProperty("systemEnvironment")&&(n.SystemEnvironment={Variables:e.systemEnvironment.variables.map(e=>({Key:e.key,Value:e.value}))}),await(0,transactor_1.default)(contracts_1.scfUpdateFunctionInfoContract,n,t);return{}}async function scfListFunctionTestModels(e,t){const n={Action:"ListFunctionTestModels",Version:"2018-04-16",Region:e.region,FunctionName:e.functionName,Namespace:e.namespace};return{testModels:(await(0,transactor_1.default)(contracts_1.scfListFunctionTestModelsContract,n,t)).TestModels||[]}}async function scfGetFunctionTestModel(e,t){const n={Action:"GetFunctionTestModel",Version:"2018-04-16",Region:e.region,FunctionName:e.functionName,TestModelName:e.testModelName,Namespace:e.namespace},o=await(0,transactor_1.default)(contracts_1.scfGetFunctionTestModelContract,n,t);return{testModelValue:o.TestModelValue,functionName:o.FunctionName,testModelName:o.TestModelName,createdTime:o.CreatedTime,modifiedTime:o.ModifiedTime,namespace:o.Namespace}}async function scfCreateFunctionTestModel(e,t){const n={Action:"CreateFunctionTestModel",Version:"2018-04-16",Region:e.region,FunctionName:e.functionName,TestModelName:e.testModelName,TestModelValue:e.testModelValue,Namespace:e.namespace};await(0,transactor_1.default)(contracts_1.scfCreateFunctionTestModelContract,n,t);return{}}async function scfDeleteFunctionTestModel(e,t){const n={Action:"DeleteFunctionTestModel",Version:"2018-04-16",Region:e.region,FunctionName:e.functionName,TestModelName:e.testModelName,Namespace:e.namespace};await(0,transactor_1.default)(contracts_1.scfDeleteFunctionTestModelContract,n,t);return{}}async function scfUpdateFunctionTestModel(e,t){const n={Action:"UpdateFunctionTestModel",Version:"2018-04-16",Region:e.region,FunctionName:e.functionName,TestModelName:e.testModelName,TestModelValue:e.testModelValue,Namespace:e.namespace};await(0,transactor_1.default)(contracts_1.scfUpdateFunctionTestModelContract,n,t);return{}}async function scfBatchCreateTrigger(e,t){const n={Action:"BatchCreateTrigger",Version:"2018-04-16",Region:e.region,FunctionName:e.functionName,Namespace:e.namespace,Triggers:JSON.stringify(e.triggers.map(e=>({TriggerName:e.triggerName,Type:e.type,TriggerDesc:e.triggerDesc}))),Count:e.triggers.length};await(0,transactor_1.default)(contracts_1.scfBatchCreateTriggerContract,n,t);return{}}async function scfGetFunctionAddress(e,t){const n={Action:"GetFunctionAddress",Version:"2018-04-16",Region:e.region,FunctionName:e.functionName,Namespace:e.namespace,CodeSecret:e.codeSecret},o=await(0,transactor_1.default)(contracts_1.scfGetFunctionAddressContract,n,t);return{codeSha256:o.CodeSha256,url:o.Url}}async function scfInvokeFunction(e,t){const n={Action:"Invoke",Version:"2018-04-16",Region:e.region,FunctionName:e.functionName,Namespace:e.namespace,InvocationType:e.invocationType,Qualifier:e.qualifier,ClientContext:e.clientContext};return{result:{functionRequestId:(await(0,transactor_1.default)(contracts_1.scfInvokeFunctionContract,n,t)).Result.FunctionRequestId}}}async function scfGetFunctionLogs(e,t,n){const o={Action:"GetFunctionLogs",Version:"2018-04-16",Region:e.region,FunctionName:e.functionName,Namespace:e.namespace,Offset:e.offset,Limit:e.limit,Order:e.order,OrderBy:e.orderBy,Filter:e.filter?{RetCode:e.filter.retCode}:void 0,Qualifier:e.qualifier,FunctionRequestId:e.functionRequestId,StartTime:e.startTime?(0,common_1.dateToStr)(e.startTime):void 0,EndTime:e.endTime?(0,common_1.dateToStr)(e.endTime):void 0};return{data:(await(0,transactor_1.default)(contracts_1.scfGetFunctionLogsContract,o,Object.assign(Object.assign({},n),{isPoll:t}))).Data.map(e=>({functionName:e.FunctionName,retMsg:e.RetMsg,requestId:e.RequestId,startTime:(0,common_1.strToDate)(e.StartTime),retCode:e.RetCode,invokeFinished:e.InvokeFinished,duration:e.Duration,billDuration:e.BillDuration,memUsage:e.MemUsage,log:e.Log}))}}async function scfUpdateAlias(e){var t,n;const o={Action:"UpdateAlias",Version:"2018-04-16",Region:e.region,FunctionName:e.functionName,Name:e.name,FunctionVersion:e.functionVersion,Namespace:e.namespace,RoutingConfig:e.routingConfig?{AdditionalVersionWeights:null===(t=e.routingConfig.additionalVersionWeights)||void 0===t?void 0:t.map(e=>({Version:e.version,Weight:e.weight})),AddtionVersionMatchs:null===(n=e.routingConfig.addtionVersionMatchs)||void 0===n?void 0:n.map(e=>({Version:e.version,Key:e.key,Method:e.method,Expression:e.expression}))}:e.routingConfig,Description:e.description};await(0,transactor_1.default)(contracts_1.scfUpdateAliasContract,o);return{}}async function scfGetAlias(e){var t,n;const o={Action:"GetAlias",Version:"2018-04-16",Region:e.region,FunctionName:e.functionName,Name:e.name,Namespace:e.namespace},i=await(0,transactor_1.default)(contracts_1.scfGetAliasContract,o);return{functionVersion:i.FunctionVersion,name:i.Name,routingConfig:{additionalVersionWeights:null===(t=i.RoutingConfig.AdditionalVersionWeights)||void 0===t?void 0:t.map(e=>({version:e.Version,weight:e.Weight})),addtionVersionMatchs:null===(n=i.RoutingConfig.AddtionVersionMatchs)||void 0===n?void 0:n.map(e=>({version:e.Version,key:e.Key,method:e.Method,expression:e.Expression}))},description:i.Description,addTime:i.AddTime,modTime:i.ModTime}}async function scfPublishVersion(e){const t={Action:"PublishVersion",Version:"2018-04-16",Region:e.region,FunctionName:e.functionName,Description:e.description,Namespace:e.namespace},n=await(0,transactor_1.default)(contracts_1.scfPublishVersionContract,t);return{functionVersion:n.FunctionVersion,codeSize:n.CodeSize,memorySize:n.MemorySize,description:n.Description,handler:n.Handler,timeout:n.Timeout,runtime:n.Runtime,namespace:n.Namespace}}async function scfListVersionByFunction(e){const t={Action:"ListVersionByFunction",Version:"2018-04-16",Region:e.region,FunctionName:e.functionName,Namespace:e.namespace,SearchKey:e.searchKey},n=await(0,transactor_1.default)(contracts_1.scfListVersionByFunctionContract,t);return{functionVersion:n.FunctionVersion,versions:(n.Versions||[]).map(e=>({version:e.Version,description:e.Description,addTime:e.AddTime,modTime:e.ModTime}))}}exports.scfListFunctions=scfListFunctions,exports.scfListAllFunctions=scfListAllFunctions,exports.scfCreateFunction=scfCreateFunction,exports.scfUpdateFunction=scfUpdateFunction,exports.scfUpdateFunctionIncrementalCode=scfUpdateFunctionIncrementalCode,exports.scfDeleteFunction=scfDeleteFunction,exports.scfGetFunctionInfo=scfGetFunctionInfo,exports.scfUpdateFunctionInfo=scfUpdateFunctionInfo,exports.scfListFunctionTestModels=scfListFunctionTestModels,exports.scfGetFunctionTestModel=scfGetFunctionTestModel,exports.scfCreateFunctionTestModel=scfCreateFunctionTestModel,exports.scfDeleteFunctionTestModel=scfDeleteFunctionTestModel,exports.scfUpdateFunctionTestModel=scfUpdateFunctionTestModel,exports.scfBatchCreateTrigger=scfBatchCreateTrigger,exports.scfGetFunctionAddress=scfGetFunctionAddress,exports.scfInvokeFunction=scfInvokeFunction,exports.scfGetFunctionLogs=scfGetFunctionLogs,exports.scfUpdateAlias=scfUpdateAlias,exports.scfGetAlias=scfGetAlias,exports.scfPublishVersion=scfPublishVersion,exports.scfListVersionByFunction=scfListVersionByFunction;
|
|
3
|
+
}(require("licia/lazyImport")(require), require)
|