@cloudbase/framework-plugin-low-code 1.7.45 → 1.7.47

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/lib/index.d.ts CHANGED
@@ -106,8 +106,9 @@ declare class LowCodePlugin extends Plugin {
106
106
  constructor(name: string, api: PluginServiceApi, inputs: IFrameworkPluginLowCodeInputs);
107
107
  _initDir(): void;
108
108
  _subPluginConstructor(resolveInputs: ResolvedInputs): Promise<void>;
109
- _getWebRootPath({ appId, deployOptions }: {
109
+ _getWebRootPath({ appId, name, deployOptions }: {
110
110
  appId: any;
111
+ name?: string | undefined;
111
112
  deployOptions: any;
112
113
  }): string;
113
114
  _time(label: any): void;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAOA,OAAW,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAExC,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAIrE,OAAO,EAEL,SAAS,EAET,cAAc,EACd,WAAW,EACX,OAAO,EAMR,MAAM,4BAA4B,CAAC;AAIpC,OAAO,GAAG,MAAM,mBAAmB,CAAC;AAMpC,eAAO,MAAM,SAAS,WAAW,CAAC;AAgBlC,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;CAoBnB,CAAC;AAEF,MAAM,WAAW,6BAA6B;IAM5C,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAMhB,OAAO,CAAC,EAAE,OAAO,CAAC;IAIlB,KAAK,EAAE,MAAM,CAAC;IAId,oBAAoB,EAAE,GAAG,CAAC;IAI1B,uBAAuB,CAAC,EAAE,GAAG,EAAE,CAAC;IAIhC,YAAY,CAAC,EAAsB,GAAG,EAAE,CAAC;IAKzC,aAAa,CAAC,EAAE,SAAS,EAAE,CAAC;IAK5B,cAAc,CAAC,EAAE,cAAc,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GAAG;IAKH,MAAM;IAKN,OAAO;IAKP,KAAK;IA+ML,OAAO;IA0CP,MAAM;IAgFN,mBAAmB,CAAC,KAAK,KAAA,EAAE,KAAK,UAAQ;IAgBxC,eAAe,CAAC,KAAK,KAAA,EAAE,KAAK,UAAQ;IAqBpC,iBAAiB,CAAC,KAAK,KAAA;IAsEvB,iBAAiB,CACrB,KAAK,KAAA,EACL,KAAK,KAAA,GACJ,OAAO,CAAC,SAAS,GAAG;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IA+E5F,eAAe,CAAC,OAAO,KAAA;IAIjB,2BAA2B;IA6C3B,UAAU;IAiGV,OAAO,CAAC,GAAG,KAAA,EAAE,IAAI,KAAA;IAevB,QAAQ;CAoBT;AA4BD,eAAO,MAAM,MAAM,sBAAgB,CAAC"}
package/lib/index.js CHANGED
@@ -92,7 +92,7 @@ class LowCodePlugin extends framework_core_1.Plugin {
92
92
  this.inputs = inputs;
93
93
  this._timeMap = {};
94
94
  this._domain = [];
95
- this._enablePrivatelink = false;
95
+ this._enablePrivatelink = true;
96
96
  let inputJSONPath = path_1.default.resolve(this.api.projectPath, inputs._inputFile || DEFAULT_INPUTS._inputFile);
97
97
  let params = fs_extra_1.default.existsSync(inputJSONPath) ? fs_extra_1.default.readJsonSync(inputJSONPath) : {};
98
98
  this._originInputsStr = JSON.stringify(resolveInputs(inputs, params));
@@ -107,23 +107,9 @@ class LowCodePlugin extends framework_core_1.Plugin {
107
107
  baseKey: `lca/${this._resolvedInputs.appId}${process.env.CLOUDBASE_CIID ? `/${process.env.CLOUDBASE_CIID}` : ''}`,
108
108
  }
109
109
  : undefined;
110
- let { envId } = this.api;
111
110
  if (!this._resolvedInputs.mainAppSerializeData) {
112
111
  throw new Error('缺少必须参数: mainAppSerializeData');
113
112
  }
114
- this._resolvedInputs = (0, lowcode_builder_1.normalizeInputs)(this._resolvedInputs, {
115
- envId,
116
- getWebRootPath: ({ appId, deployOptions }) => {
117
- return this._getWebRootPath({ appId, deployOptions });
118
- },
119
- });
120
- if (!(0, lowcode_builder_1.buildAsWebByBuildType)(this._resolvedInputs.buildTypeList)) {
121
- const { mpDeployPrivateKey, deployOptions } = this._resolvedInputs;
122
- if (deployOptions.mpDeployPrivateKey === undefined) {
123
- deployOptions.mpDeployPrivateKey = mpDeployPrivateKey;
124
- }
125
- }
126
- this._initDir();
127
113
  this.api.logger.debug(`low-code plugin construct at ${Date.now()}`);
128
114
  this._time("low code lifetime");
129
115
  }
@@ -132,7 +118,7 @@ class LowCodePlugin extends framework_core_1.Plugin {
132
118
  fs_extra_1.default.removeSync(path_1.default.resolve(this.api.projectPath, DEBUG_PATH));
133
119
  }
134
120
  _subPluginConstructor(resolveInputs) {
135
- var _a, _b;
121
+ var _a, _b, _c;
136
122
  return __awaiter(this, void 0, void 0, function* () {
137
123
  if (resolveInputs.runtime === lowcode_builder_1.RUNTIME.CLI) {
138
124
  return;
@@ -172,7 +158,11 @@ class LowCodePlugin extends framework_core_1.Plugin {
172
158
  privateKeyPath: `./private.${deployOptions.mpAppId}.key`,
173
159
  localPath: exports.DIST_PATH,
174
160
  ignores: ['node_modules/**/*', LOG_FILE].concat(cloudfunctionRoot ? [path_1.default.join(cloudfunctionRoot, '**/*')] : []),
175
- deployMode: deployOptions.mpAppId === deployOptions.targetMpAppId ? deployOptions.mode : lowcode_builder_1.DEPLOY_MODE.UPLOAD,
161
+ deployMode: deployOptions.mpAppId === deployOptions.targetMpAppId
162
+ ? deployOptions.mode === lowcode_builder_1.DEPLOY_MODE.DYNAMIC
163
+ ? lowcode_builder_1.DEPLOY_MODE.PREVIEW
164
+ : deployOptions.mode
165
+ : lowcode_builder_1.DEPLOY_MODE.UPLOAD,
176
166
  uploadOptions: {
177
167
  version: (deployOptions === null || deployOptions === void 0 ? void 0 : deployOptions.version) || '1.0.0',
178
168
  desc: (deployOptions === null || deployOptions === void 0 ? void 0 : deployOptions.description) || '',
@@ -206,7 +196,11 @@ class LowCodePlugin extends framework_core_1.Plugin {
206
196
  credential,
207
197
  ignores: ['.git', '.github', 'node_modules', 'cloudbaserc.js', LOG_FILE, DEFAULT_CLOUDFUNCTION_ROOT_NAME],
208
198
  webOptions: {
209
- cloudPath: this._getWebRootPath(this._resolvedInputs),
199
+ cloudPath: this._getWebRootPath({
200
+ appId: this._resolvedInputs.appId,
201
+ name: (_c = this._resolvedInputs.mainAppSerializeData) === null || _c === void 0 ? void 0 : _c.name,
202
+ deployOptions: this._resolvedInputs.deployOptions,
203
+ }),
210
204
  buildTypeList: this._resolvedInputs.buildTypeList,
211
205
  credential,
212
206
  gatewayConfig: this._gatewayConfig
@@ -221,8 +215,9 @@ class LowCodePlugin extends framework_core_1.Plugin {
221
215
  }
222
216
  });
223
217
  }
224
- _getWebRootPath({ appId, deployOptions }) {
225
- return (deployOptions === null || deployOptions === void 0 ? void 0 : deployOptions.mode) === lowcode_builder_1.DEPLOY_MODE.PREVIEW ? `/${appId}/preview/` : `/${appId}/production/`;
218
+ _getWebRootPath({ appId, name = '', deployOptions }) {
219
+ const key = name || appId;
220
+ return (deployOptions === null || deployOptions === void 0 ? void 0 : deployOptions.mode) === lowcode_builder_1.DEPLOY_MODE.UPLOAD ? `/${key}/production/` : `/${key}/preview/`;
226
221
  }
227
222
  _time(label) {
228
223
  if (!this._timeMap[label]) {
@@ -237,7 +232,47 @@ class LowCodePlugin extends framework_core_1.Plugin {
237
232
  }
238
233
  }
239
234
  init() {
240
- return __awaiter(this, void 0, void 0, function* () { });
235
+ var _a;
236
+ return __awaiter(this, void 0, void 0, function* () {
237
+ const { envId } = this.api;
238
+ const { appId, mainAppSerializeData } = this._resolvedInputs;
239
+ let name = ((_a = process === null || process === void 0 ? void 0 : process.env) === null || _a === void 0 ? void 0 : _a.WEDA_APP_NAME) || '';
240
+ if (appId && false) {
241
+ try {
242
+ const { Weapps = [] } = yield this.api.cloudbaseManager.commonService('lowcode', '2021-01-08').call({
243
+ Action: 'DescribeApps',
244
+ Param: {
245
+ EnvId: this.api.envId,
246
+ AppIds: [appId],
247
+ Offset: 0,
248
+ Limit: 1,
249
+ },
250
+ });
251
+ const item = Weapps.find((item) => item.Id === appId);
252
+ if (!item) {
253
+ throw new Error(`Resource ${appId} not found'`);
254
+ }
255
+ name = item.Name;
256
+ }
257
+ catch (e) {
258
+ this.api.logger.error('get app name error', e);
259
+ }
260
+ }
261
+ mainAppSerializeData.name = name;
262
+ this._resolvedInputs = (0, lowcode_builder_1.normalizeInputs)(this._resolvedInputs, {
263
+ envId,
264
+ getWebRootPath: ({ appId, name, deployOptions }) => {
265
+ return this._getWebRootPath({ appId, name, deployOptions });
266
+ },
267
+ });
268
+ if (!(0, lowcode_builder_1.buildAsWebByBuildType)(this._resolvedInputs.buildTypeList)) {
269
+ const { mpDeployPrivateKey, deployOptions } = this._resolvedInputs;
270
+ if (deployOptions.mpDeployPrivateKey === undefined) {
271
+ deployOptions.mpDeployPrivateKey = mpDeployPrivateKey;
272
+ }
273
+ }
274
+ this._initDir();
275
+ });
241
276
  }
242
277
  run() {
243
278
  return __awaiter(this, void 0, void 0, function* () { });
@@ -307,7 +342,11 @@ class LowCodePlugin extends framework_core_1.Plugin {
307
342
  this.api.logger.debug('DescribeAppCustomUrls:', Data === null || Data === void 0 ? void 0 : Data.Items, this._gatewayConfig);
308
343
  if (this._gatewayConfig) {
309
344
  const path = this._gatewayConfig.Path;
310
- window.publicPath = `https://${domain}${this._getWebRootPath(this._resolvedInputs)}`;
345
+ window.publicPath = `https://${domain}${this._getWebRootPath({
346
+ appId: this._resolvedInputs.appId,
347
+ name: this._resolvedInputs.mainAppSerializeData.name,
348
+ deployOptions: this._resolvedInputs.deployOptions,
349
+ })}`;
311
350
  if (!(0, lowcode_builder_1.buildAsAdminPortalByBuildType)(buildTypeList)) {
312
351
  window.basename = path;
313
352
  window._indexPage = true;
@@ -452,32 +491,33 @@ class LowCodePlugin extends framework_core_1.Plugin {
452
491
  var _a, _b;
453
492
  return __awaiter(this, void 0, void 0, function* () {
454
493
  try {
494
+ const isAdminPortal = (0, lowcode_builder_1.buildAsAdminPortalByBuildType)(this._resolvedInputs.buildTypeList);
455
495
  this._time("DEPLOY");
456
496
  if (this._miniprogramePlugin) {
457
497
  yield this._miniprogramePlugin.deploy();
458
498
  }
459
499
  if (this._enablePrivatelink) {
460
500
  if (this._privatelinkGatewayMeta) {
461
- try {
462
- const res = yield this.api.cloudbaseManager.commonService('lowcode', '2021-01-08').call({
463
- Action: 'BindGatewayAppDomain',
464
- Param: {
465
- GatewayEnvId: this._privatelinkGatewayMeta.gatewayEnvId,
466
- GatewayId: this._privatelinkGatewayMeta.gatewayId,
467
- Domain: this._privatelinkGatewayMeta.domain,
468
- EnvId: this.api.envId,
469
- Target: 'domain_app',
470
- WeAppId: (0, lowcode_builder_1.buildAsAdminPortalByBuildType)(this._resolvedInputs.buildTypeList)
471
- ? 'app_enterprise'
472
- : this._resolvedInputs.appId,
473
- PubPlatform: (0, lowcode_builder_1.buildAsWebByBuildType)(this._resolvedInputs.buildTypeList) ? 'web' : 'minapp',
474
- PubEnvType: ((_a = this._resolvedInputs.deployOptions) === null || _a === void 0 ? void 0 : _a.mode) === lowcode_builder_1.DEPLOY_MODE.UPLOAD ? 'prod' : 'pre',
475
- },
476
- });
477
- this.api.logger.info('BindGatewayAppDomain:', res);
478
- }
479
- catch (e) {
480
- this.api.logger.error('BindGatewayAppDomain:', e);
501
+ if (!isAdminPortal) {
502
+ try {
503
+ const res = yield this.api.cloudbaseManager.commonService('lowcode', '2021-01-08').call({
504
+ Action: 'BindGatewayAppDomain',
505
+ Param: {
506
+ GatewayEnvId: this._privatelinkGatewayMeta.gatewayEnvId,
507
+ GatewayId: this._privatelinkGatewayMeta.gatewayId,
508
+ Domain: this._privatelinkGatewayMeta.domain,
509
+ EnvId: this.api.envId,
510
+ Target: 'domain_app',
511
+ WeAppId: isAdminPortal ? 'app_enterprise' : this._resolvedInputs.appId,
512
+ PubPlatform: (0, lowcode_builder_1.buildAsWebByBuildType)(this._resolvedInputs.buildTypeList) ? 'web' : 'minapp',
513
+ PubEnvType: ((_a = this._resolvedInputs.deployOptions) === null || _a === void 0 ? void 0 : _a.mode) === lowcode_builder_1.DEPLOY_MODE.UPLOAD ? 'prod' : 'pre',
514
+ },
515
+ });
516
+ this.api.logger.info('BindGatewayAppDomain:', res);
517
+ }
518
+ catch (e) {
519
+ this.api.logger.error('BindGatewayAppDomain:', e);
520
+ }
481
521
  }
482
522
  }
483
523
  else {
@@ -486,9 +526,7 @@ class LowCodePlugin extends framework_core_1.Plugin {
486
526
  Action: 'UpdateAppDomainInvalid',
487
527
  Param: {
488
528
  EnvId: this.api.envId,
489
- WeAppId: (0, lowcode_builder_1.buildAsAdminPortalByBuildType)(this._resolvedInputs.buildTypeList)
490
- ? 'app_enterprise'
491
- : this._resolvedInputs.appId,
529
+ WeAppId: isAdminPortal ? 'app_enterprise' : this._resolvedInputs.appId,
492
530
  PubPlatform: (0, lowcode_builder_1.buildAsWebByBuildType)(this._resolvedInputs.buildTypeList) ? 'web' : 'minapp',
493
531
  PubEnvType: ((_b = this._resolvedInputs.deployOptions) === null || _b === void 0 ? void 0 : _b.mode) === lowcode_builder_1.DEPLOY_MODE.UPLOAD ? 'prod' : 'pre',
494
532
  },
@@ -649,18 +687,21 @@ class LowCodePlugin extends framework_core_1.Plugin {
649
687
  if (!this._enablePrivatelink) {
650
688
  return undefined;
651
689
  }
690
+ const isAdminPortal = (0, lowcode_builder_1.buildAsAdminPortalByBuildType)(this._resolvedInputs.buildTypeList);
652
691
  const gatewayMeta = yield this.api.cloudbaseManager
653
692
  .commonService('lowcode', '2021-01-08')
654
693
  .call({
655
694
  Action: 'GetGatewayDomainAppDetails',
656
695
  Param: {
657
696
  EnvId: envId,
658
- WeAppId: (0, lowcode_builder_1.buildAsAdminPortalByBuildType)(this._resolvedInputs.buildTypeList) ? 'app_enterprise' : appId,
697
+ WeAppId: isAdminPortal ? 'app_enterprise' : appId,
659
698
  },
660
699
  })
661
700
  .then((res) => {
662
- const { Domain, GatewayId, GatewayEnvId } = res;
663
- if (Domain && GatewayId) {
701
+ this.api.logger.info(`GetGatewayDomainAppDetails success:${res.RequestId}`);
702
+ const { Domain, GatewayId, GatewayEnvId, BindDomainAppList = [] } = res;
703
+ const item = BindDomainAppList.find((item) => item.WeAppId === appId || (isAdminPortal ? item.WeAppId === 'app_enterprise' : false));
704
+ if (Domain && GatewayId && (item === null || item === void 0 ? void 0 : item.IsBindDomain)) {
664
705
  return {
665
706
  gatewayId: GatewayId,
666
707
  gatewayEnvId: GatewayEnvId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/framework-plugin-low-code",
3
- "version": "1.7.45",
3
+ "version": "1.7.47",
4
4
  "description": "云开发 Tencent CloudBase Framework Low Code Plugin,将低码配置生成完整项目并一键部署云开发资源。",
5
5
  "author": "yhsunshining@gmail.com",
6
6
  "homepage": "https://github.com/TencentCloudBase/cloudbase-framework#readme",
@@ -34,12 +34,12 @@
34
34
  "url": "https://github.com/TencentCloudBase/cloudbase-framework/issues"
35
35
  },
36
36
  "dependencies": {
37
- "@cloudbase/cals": "^1.0.81",
37
+ "@cloudbase/cals": "^1.1.4",
38
38
  "@cloudbase/framework-core": "1.9.7",
39
39
  "@cloudbase/framework-plugin-auth": "1.9.7",
40
40
  "@cloudbase/framework-plugin-website": "1.9.7",
41
- "@cloudbase/lowcode-builder": "^1.8.101",
42
- "@cloudbase/lowcode-deployer": "^1.3.9",
41
+ "@cloudbase/lowcode-builder": "^1.8.105",
42
+ "@cloudbase/lowcode-deployer": "^1.3.11",
43
43
  "archiver": "^4.0.1",
44
44
  "compressing": "^1.4.0",
45
45
  "cos-nodejs-sdk-v5": "^2.8.2",