@geek-fun/serverlessinsight 0.9.2 → 0.9.4
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/.serverlessinsight/state-cdn-flow-app-cdn-flow-service.json.backup +1 -1
- package/.serverlessinsight/state-iam-test-app-iam-test-service.json.backup +2 -2
- package/.serverlessinsight/state-insight-poc-app-insight-poc-tencent.json.backup +4 -8
- package/.serverlessinsight/state-insight-poc-app-log-insight-poc-tencent-log.json.backup +3 -8
- package/.serverlessinsight/state-insight-poc-deploy-app-insight-poc-deploy.json.backup +4 -4
- package/.serverlessinsight/state-insight-poc-destroy-app-insight-poc-destroy.json.backup +1 -1
- package/.serverlessinsight/state-insight-poc-timer-app-insight-poc-timer.json.backup +28 -5
- package/.serverlessinsight/state-insight-volc-app-insight-volc.json.backup +2 -2
- package/.serverlessinsight/state-insight-volc-nested-app-insight-volc-nested.json.backup +3 -3
- package/.serverlessinsight/state-nested-drift-app-nested-drift-service.json.backup +20 -5
- package/.serverlessinsight/state-role-reconcile-test-app-role-reconcile-test-service.json.backup +3 -3
- package/AGENTS.md +10 -0
- package/CHANGELOG.md +62 -0
- package/README.md +256 -175
- package/README.zh-CN.md +249 -159
- package/dist/package.json +22 -19
- package/dist/src/commands/index.js +21 -52
- package/dist/src/commands/local.js +16 -3
- package/dist/src/commands/plan.js +35 -4
- package/dist/src/common/aliyunClient/apigwOperations.js +48 -9
- package/dist/src/common/aliyunClient/fc3Operations.js +7 -1
- package/dist/src/common/aliyunClient/ossOperations.js +214 -221
- package/dist/src/common/bucketPolicy.js +63 -0
- package/dist/src/common/domainUtils.js +4 -1
- package/dist/src/common/functionDefinition.js +25 -0
- package/dist/src/common/index.js +4 -0
- package/dist/src/common/jsonOutput.js +6 -1
- package/dist/src/common/nameBuilder.js +3 -1
- package/dist/src/common/planCapabilities.js +119 -0
- package/dist/src/common/planCompare.js +119 -66
- package/dist/src/common/planFormatter.js +22 -14
- package/dist/src/common/planRedaction.js +26 -0
- package/dist/src/common/refreshPlanner.js +66 -21
- package/dist/src/common/tencentClient/cosOperations.js +326 -322
- package/dist/src/common/tencentClient/scfOperations.js +9 -2
- package/dist/src/common/tencentClient/tdsqlcOperations.js +6 -11
- package/dist/src/common/triggerMapper.js +16 -1
- package/dist/src/common/volcengineClient/apigwOperations.js +82 -0
- package/dist/src/common/volcengineClient/iamOperations.js +27 -3
- package/dist/src/common/volcengineClient/tosOperations.js +62 -56
- package/dist/src/lang/en.js +33 -8
- package/dist/src/lang/index.js +28 -14
- package/dist/src/lang/zh-CN.js +33 -8
- package/dist/src/parser/eventParser.js +1 -0
- package/dist/src/parser/functionParser.js +1 -1
- package/dist/src/stack/aliyunStack/apigwDomainPlan.js +82 -0
- package/dist/src/stack/aliyunStack/apigwExecutor.js +4 -1
- package/dist/src/stack/aliyunStack/apigwPlanner.js +165 -25
- package/dist/src/stack/aliyunStack/apigwResource.js +172 -126
- package/dist/src/stack/aliyunStack/apigwTypes.js +3 -7
- package/dist/src/stack/aliyunStack/deployer.js +2 -0
- package/dist/src/stack/aliyunStack/esServerlessTypes.js +8 -4
- package/dist/src/stack/aliyunStack/fc3Executor.js +7 -3
- package/dist/src/stack/aliyunStack/fc3Planner.js +124 -155
- package/dist/src/stack/aliyunStack/fc3Resource.js +48 -52
- package/dist/src/stack/aliyunStack/fc3Types.js +30 -16
- package/dist/src/stack/aliyunStack/ossPlanner.js +15 -1
- package/dist/src/stack/aliyunStack/ossResource.js +113 -102
- package/dist/src/stack/aliyunStack/ossTypes.js +20 -20
- package/dist/src/stack/localStack/aliyunFc.js +1 -6
- package/dist/src/stack/localStack/event.js +31 -60
- package/dist/src/stack/localStack/function.js +24 -65
- package/dist/src/stack/localStack/functionRunner.js +10 -2
- package/dist/src/stack/localStack/httpAdapter.js +54 -0
- package/dist/src/stack/localStack/httpError.js +5 -0
- package/dist/src/stack/localStack/legacyLambda.js +26 -0
- package/dist/src/stack/localStack/localContext.js +29 -0
- package/dist/src/stack/localStack/localRoute.js +12 -0
- package/dist/src/stack/localStack/localRuntimes.js +22 -0
- package/dist/src/stack/localStack/localServer.js +8 -3
- package/dist/src/stack/localStack/requestBody.js +24 -0
- package/dist/src/stack/localStack/requestId.js +18 -0
- package/dist/src/stack/localStack/tencent.js +147 -0
- package/dist/src/stack/localStack/timer.js +23 -2
- package/dist/src/stack/localStack/volcengine.js +68 -0
- package/dist/src/stack/scfStack/cosPlanner.js +9 -14
- package/dist/src/stack/scfStack/cosResource.js +42 -50
- package/dist/src/stack/scfStack/cosTypes.js +19 -14
- package/dist/src/stack/scfStack/deployer.js +2 -0
- package/dist/src/stack/scfStack/scfExecutor.js +7 -3
- package/dist/src/stack/scfStack/scfHttpTrigger.js +106 -0
- package/dist/src/stack/scfStack/scfPlanner.js +67 -16
- package/dist/src/stack/scfStack/scfResource.js +170 -321
- package/dist/src/stack/scfStack/scfTypes.js +4 -3
- package/dist/src/stack/scfStack/tdsqlcPlanner.js +10 -13
- package/dist/src/stack/volcengineStack/apigwDomains.js +64 -0
- package/dist/src/stack/volcengineStack/apigwPlanner.js +71 -15
- package/dist/src/stack/volcengineStack/apigwResource.js +60 -24
- package/dist/src/stack/volcengineStack/apigwTypes.js +5 -1
- package/dist/src/stack/volcengineStack/deployer.js +6 -0
- package/dist/src/stack/volcengineStack/tosPlanner.js +8 -13
- package/dist/src/stack/volcengineStack/tosResource.js +22 -35
- package/dist/src/stack/volcengineStack/tosTypes.js +5 -8
- package/dist/src/stack/volcengineStack/vefaasPlanner.js +142 -49
- package/dist/src/stack/volcengineStack/vefaasResource.js +17 -12
- package/dist/src/stack/volcengineStack/vefaasTypes.js +6 -3
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +22 -19
- package/release-notes.md +53 -0
- package/samples/README_TENCENT_COS.md +3 -3
- package/samples/README_TENCENT_SCF.md +3 -3
- package/samples/tencent-local/index.js +13 -0
- package/samples/tencent-local/serverlessinsight.yml +23 -0
- package/samples/volcengine-local/index.js +13 -0
- package/samples/volcengine-local/serverlessinsight.yml +28 -0
|
@@ -153,40 +153,9 @@ program
|
|
|
153
153
|
process.exitCode = 1;
|
|
154
154
|
}
|
|
155
155
|
}));
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
.option('-f, --file <path>', lang_1.lang.__('OPT_FILE'))
|
|
160
|
-
.option('-s, --stage <stage>', lang_1.lang.__('OPT_STAGE'))
|
|
161
|
-
.option('-r, --region <region>', lang_1.lang.__('OPT_REGION'))
|
|
162
|
-
.option('-v, --provider <provider>', lang_1.lang.__('OPT_PROVIDER'))
|
|
163
|
-
.option('-k, --accessKeyId <accessKeyId>', lang_1.lang.__('OPT_ACCESS_KEY_ID'))
|
|
164
|
-
.option('-x, --accessKeySecret <accessKeySecret>', lang_1.lang.__('OPT_ACCESS_KEY_SECRET'))
|
|
165
|
-
.option('-n, --securityToken <securityToken>', lang_1.lang.__('OPT_SECURITY_TOKEN'))
|
|
166
|
-
.option('--no-refresh', lang_1.lang.__('OPT_NO_REFRESH'))
|
|
167
|
-
.option('--json', lang_1.lang.__('OPT_JSON'))
|
|
168
|
-
.option('--no-color', lang_1.lang.__('OPT_NO_COLOR'))
|
|
169
|
-
.action(actionWrapper('plan', async ({ stage, file, region, provider, accessKeyId, accessKeySecret, securityToken, refresh, json, color, }) => {
|
|
170
|
-
const result = await (0, plan_1.plan)({
|
|
171
|
-
stage,
|
|
172
|
-
location: file,
|
|
173
|
-
region,
|
|
174
|
-
provider,
|
|
175
|
-
accessKeyId,
|
|
176
|
-
accessKeySecret,
|
|
177
|
-
securityToken,
|
|
178
|
-
refresh,
|
|
179
|
-
json: !!json,
|
|
180
|
-
noColor: color === false,
|
|
181
|
-
});
|
|
182
|
-
// Issue #250 exit-code convention (terraform-compatible):
|
|
183
|
-
// 0 = no changes, 2 = changes present, 1 = execution error (handler).
|
|
184
|
-
if (result.hasChanges) {
|
|
185
|
-
process.exitCode = 2;
|
|
186
|
-
}
|
|
187
|
-
}));
|
|
188
|
-
// Issue #246: `diff` is the primary verb users say — it runs the same plan
|
|
189
|
-
// flow; `plan` stays for compatibility.
|
|
156
|
+
// Issue #246/#271: `diff` is the sole verb for previewing deployment changes;
|
|
157
|
+
// the legacy `plan` verb is removed. Options and the action handler are
|
|
158
|
+
// defined exactly once.
|
|
190
159
|
program
|
|
191
160
|
.command('diff')
|
|
192
161
|
.description(lang_1.lang.__('CMD_DIFF_DESC'))
|
|
@@ -200,23 +169,11 @@ program
|
|
|
200
169
|
.option('--no-refresh', lang_1.lang.__('OPT_NO_REFRESH'))
|
|
201
170
|
.option('--json', lang_1.lang.__('OPT_JSON'))
|
|
202
171
|
.option('--no-color', lang_1.lang.__('OPT_NO_COLOR'))
|
|
203
|
-
.
|
|
204
|
-
const
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
provider,
|
|
209
|
-
accessKeyId,
|
|
210
|
-
accessKeySecret,
|
|
211
|
-
securityToken,
|
|
212
|
-
refresh,
|
|
213
|
-
json: !!json,
|
|
214
|
-
noColor: color === false,
|
|
215
|
-
});
|
|
216
|
-
if (result.hasChanges) {
|
|
217
|
-
process.exitCode = 2;
|
|
218
|
-
}
|
|
219
|
-
}));
|
|
172
|
+
.option('-p, --parameter <key=value>', lang_1.lang.__('OPT_PARAMETER'), (value, previous) => {
|
|
173
|
+
const [key, val] = value.split('=');
|
|
174
|
+
return { ...previous, [key]: val };
|
|
175
|
+
}, {})
|
|
176
|
+
.action(actionWrapper('diff', plan_1.runDiffCommand));
|
|
220
177
|
program
|
|
221
178
|
.command('deploy')
|
|
222
179
|
.description(lang_1.lang.__('CMD_DEPLOY_DESC'))
|
|
@@ -311,14 +268,18 @@ program
|
|
|
311
268
|
.description(lang_1.lang.__('CMD_LOCAL_DESC'))
|
|
312
269
|
.option('-f, --file <path>', lang_1.lang.__('OPT_FILE'))
|
|
313
270
|
.option('-s, --stage <stage>', lang_1.lang.__('OPT_STAGE'), 'default')
|
|
271
|
+
.option('-r, --region <region>', lang_1.lang.__('OPT_REGION'))
|
|
272
|
+
.option('-v, --provider <provider>', lang_1.lang.__('OPT_PROVIDER'))
|
|
314
273
|
.option('-d, --debug', lang_1.lang.__('OPT_DEBUG'))
|
|
315
274
|
.option('-w, --watch', lang_1.lang.__('OPT_WATCH'), true)
|
|
316
|
-
.action(actionWrapper('local', async ({ stage, debug, watch, file }) => {
|
|
275
|
+
.action(actionWrapper('local', async ({ stage, debug, watch, file, provider, region }) => {
|
|
317
276
|
await (0, local_1.runLocal)({
|
|
318
277
|
stage,
|
|
319
278
|
debug: !!debug,
|
|
320
279
|
watch: typeof watch === 'boolean' ? watch : true,
|
|
321
280
|
location: file,
|
|
281
|
+
provider,
|
|
282
|
+
region,
|
|
322
283
|
});
|
|
323
284
|
}));
|
|
324
285
|
program
|
|
@@ -342,4 +303,12 @@ program
|
|
|
342
303
|
securityToken,
|
|
343
304
|
});
|
|
344
305
|
}));
|
|
306
|
+
// Issue #271: `si plan` was removed in favor of `si diff` — the legacy verb is
|
|
307
|
+
// rejected with a localized migration hint before anything runs (no cloud or
|
|
308
|
+
// state mutations). The check runs before commander parses argv so the hint
|
|
309
|
+
// also wins over generic unknown-command handling, while every other unknown
|
|
310
|
+
// verb keeps commander's default error, including did-you-mean suggestions.
|
|
311
|
+
if (process.argv[2] === 'plan') {
|
|
312
|
+
program.error(`error: ${lang_1.lang.__('CMD_PLAN_REMOVED')}`);
|
|
313
|
+
}
|
|
345
314
|
program.parse();
|
|
@@ -6,12 +6,25 @@ const localStack_1 = require("../stack/localStack");
|
|
|
6
6
|
const parser_1 = require("../parser");
|
|
7
7
|
const lang_1 = require("../lang");
|
|
8
8
|
const runLocal = async (opts) => {
|
|
9
|
-
const { stage, debug, watch, location } = opts;
|
|
9
|
+
const { stage, debug, watch, location, provider, region } = opts;
|
|
10
10
|
const iacLocation = (0, common_1.getIacLocation)(location);
|
|
11
11
|
const rawIac = (0, parser_1.parseYaml)(iacLocation);
|
|
12
|
-
await (0, common_1.setContext)({
|
|
12
|
+
await (0, common_1.setContext)({
|
|
13
|
+
stage,
|
|
14
|
+
app: rawIac.app,
|
|
15
|
+
service: rawIac.service,
|
|
16
|
+
location,
|
|
17
|
+
provider,
|
|
18
|
+
region,
|
|
19
|
+
iacProvider: rawIac.provider,
|
|
20
|
+
stages: rawIac.stages,
|
|
21
|
+
});
|
|
13
22
|
const ctx = (0, common_1.getContext)();
|
|
14
|
-
const
|
|
23
|
+
const evaluatedIac = (0, parser_1.revalYaml)(iacLocation, ctx);
|
|
24
|
+
const iac = {
|
|
25
|
+
...evaluatedIac,
|
|
26
|
+
provider: { ...evaluatedIac.provider, name: ctx.provider, region: ctx.region },
|
|
27
|
+
};
|
|
15
28
|
// Store IAC in context for access by all functions
|
|
16
29
|
(0, common_1.setIac)(iac);
|
|
17
30
|
common_1.logger.info(lang_1.lang.__('RUN_LOCAL_STARTING', {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.plan = void 0;
|
|
3
|
+
exports.runDiffCommand = exports.plan = void 0;
|
|
4
4
|
const common_1 = require("../common");
|
|
5
5
|
const stateBackend_1 = require("../common/stateBackend");
|
|
6
6
|
const jsonOutput_1 = require("../common/jsonOutput");
|
|
@@ -8,6 +8,7 @@ const noColor_1 = require("../common/noColor");
|
|
|
8
8
|
const parser_1 = require("../parser");
|
|
9
9
|
const scfStack_1 = require("../stack/scfStack");
|
|
10
10
|
const aliyunStack_1 = require("../stack/aliyunStack");
|
|
11
|
+
const volcengineStack_1 = require("../stack/volcengineStack");
|
|
11
12
|
const lang_1 = require("../lang");
|
|
12
13
|
const plan = async (options) => {
|
|
13
14
|
common_1.logger.info(lang_1.lang.__('VALIDATING_YAML'));
|
|
@@ -26,9 +27,12 @@ const plan = async (options) => {
|
|
|
26
27
|
const iac = (0, parser_1.revalYaml)(iacLocation, context);
|
|
27
28
|
// Store IAC in context for access by all functions
|
|
28
29
|
(0, common_1.setIac)(iac);
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
: lang_1.lang.__('PROVIDER_TENCENT')
|
|
30
|
+
const providerDisplayNames = {
|
|
31
|
+
[common_1.ProviderEnum.ALIYUN]: lang_1.lang.__('PROVIDER_ALIYUN'),
|
|
32
|
+
[common_1.ProviderEnum.TENCENT]: lang_1.lang.__('PROVIDER_TENCENT'),
|
|
33
|
+
[common_1.ProviderEnum.VOLCENGINE]: lang_1.lang.__('PROVIDER_VOLCENGINE'),
|
|
34
|
+
};
|
|
35
|
+
const providerDisplayName = providerDisplayNames[iac.provider.name] ?? iac.provider.name;
|
|
32
36
|
common_1.logger.info(lang_1.lang.__('GENERATING_PLAN_FOR_PROVIDER', { provider: providerDisplayName }));
|
|
33
37
|
// Read-only command: a migrated state only warns here (window-period
|
|
34
38
|
// reconciliation still needs plan against the legacy copy).
|
|
@@ -44,6 +48,9 @@ const plan = async (options) => {
|
|
|
44
48
|
else if (iac.provider.name === common_1.ProviderEnum.ALIYUN) {
|
|
45
49
|
planResult = await (0, aliyunStack_1.generateAliyunPlan)(iac, backend);
|
|
46
50
|
}
|
|
51
|
+
else if (iac.provider.name === common_1.ProviderEnum.VOLCENGINE) {
|
|
52
|
+
planResult = await (0, volcengineStack_1.generateVolcenginePlan)(iac, backend);
|
|
53
|
+
}
|
|
47
54
|
else {
|
|
48
55
|
common_1.logger.error(lang_1.lang.__('PLAN_COMMAND_NOT_SUPPORTED'));
|
|
49
56
|
throw new Error(lang_1.lang.__('PLAN_COMMAND_NOT_SUPPORTED'));
|
|
@@ -69,3 +76,27 @@ const plan = async (options) => {
|
|
|
69
76
|
return { hasChanges: changeCount > 0 };
|
|
70
77
|
};
|
|
71
78
|
exports.plan = plan;
|
|
79
|
+
// Single action implementation behind `si diff`, the sole command for
|
|
80
|
+
// previewing deployment changes (issue #271).
|
|
81
|
+
const runDiffCommand = async (options) => {
|
|
82
|
+
(0, jsonOutput_1.setJsonMode)(!!options.json);
|
|
83
|
+
const result = await (0, exports.plan)({
|
|
84
|
+
stage: options.stage,
|
|
85
|
+
parameters: options.parameter,
|
|
86
|
+
location: options.file,
|
|
87
|
+
region: options.region,
|
|
88
|
+
provider: options.provider,
|
|
89
|
+
accessKeyId: options.accessKeyId,
|
|
90
|
+
accessKeySecret: options.accessKeySecret,
|
|
91
|
+
securityToken: options.securityToken,
|
|
92
|
+
refresh: options.refresh,
|
|
93
|
+
json: !!options.json,
|
|
94
|
+
noColor: options.color === false,
|
|
95
|
+
});
|
|
96
|
+
// Issue #250 exit-code convention (terraform-compatible):
|
|
97
|
+
// 0 = no changes, 2 = changes present, 1 = execution error (handler).
|
|
98
|
+
if (result.hasChanges) {
|
|
99
|
+
process.exitCode = 2;
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
exports.runDiffCommand = runDiffCommand;
|
|
@@ -358,6 +358,36 @@ const createApigwOperations = (apigwClient, dnsClient, _context) => {
|
|
|
358
358
|
logger_1.logger.error(`\n${separator}\n${lang_1.lang.__('APIGW_VERIFICATION_NEXT_STEPS')}\n${lang_1.lang.__('APIGW_VERIFICATION_STEP1')}\n${lang_1.lang.__('APIGW_VERIFICATION_STEP2')}\n${separator}\n`);
|
|
359
359
|
};
|
|
360
360
|
const operations = {
|
|
361
|
+
deleteDomainCertificate: async (groupId, domainName) => {
|
|
362
|
+
try {
|
|
363
|
+
const response = await apigwClient.describeDomain(new cloudapi.DescribeDomainRequest({ groupId, domainName }));
|
|
364
|
+
if (!response.body?.domainName ||
|
|
365
|
+
(!response.body.certificateId && response.body.certificateBody)) {
|
|
366
|
+
throw new Error(lang_1.lang.__('APIGW_DOMAIN_READ_INVALID', { domainId: domainName }));
|
|
367
|
+
}
|
|
368
|
+
if (!response.body.certificateId)
|
|
369
|
+
return;
|
|
370
|
+
await apigwClient.deleteDomainCertificate(new cloudapi.DeleteDomainCertificateRequest({
|
|
371
|
+
groupId,
|
|
372
|
+
domainName,
|
|
373
|
+
certificateId: response.body.certificateId,
|
|
374
|
+
}));
|
|
375
|
+
}
|
|
376
|
+
catch (error) {
|
|
377
|
+
if (!(0, exports.isApigwNotFoundError)(error))
|
|
378
|
+
throw error;
|
|
379
|
+
}
|
|
380
|
+
},
|
|
381
|
+
setDomainCertificate: async (config) => {
|
|
382
|
+
await apigwClient.setDomainCertificate(new cloudapi.SetDomainCertificateRequest({
|
|
383
|
+
groupId: config.groupId,
|
|
384
|
+
domainName: config.domainName,
|
|
385
|
+
certificateName: config.certificateName,
|
|
386
|
+
certificateBody: config.certificateBody,
|
|
387
|
+
certificatePrivateKey: config.certificatePrivateKey,
|
|
388
|
+
}));
|
|
389
|
+
logger_1.logger.info(lang_1.lang.__('APIGW_DOMAIN_CERTIFICATE_UPDATED', { domain: config.domainName }));
|
|
390
|
+
},
|
|
361
391
|
/**
|
|
362
392
|
* Create an API Gateway group
|
|
363
393
|
*/
|
|
@@ -378,6 +408,22 @@ const createApigwOperations = (apigwClient, dnsClient, _context) => {
|
|
|
378
408
|
/**
|
|
379
409
|
* Get API Gateway group by group ID
|
|
380
410
|
*/
|
|
411
|
+
getDomain: async (groupId, domainName) => {
|
|
412
|
+
try {
|
|
413
|
+
const response = await apigwClient.describeDomain(new cloudapi.DescribeDomainRequest({ groupId, domainName }));
|
|
414
|
+
if (!response.body?.domainName)
|
|
415
|
+
throw new Error(lang_1.lang.__('APIGW_DOMAIN_READ_INVALID', { domainId: domainName }));
|
|
416
|
+
return {
|
|
417
|
+
domainName: response.body.domainName,
|
|
418
|
+
certificateBody: response.body.certificateBody || (response.body.certificateId ? undefined : null),
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
catch (error) {
|
|
422
|
+
if ((0, exports.isApigwNotFoundError)(error))
|
|
423
|
+
return null;
|
|
424
|
+
throw error;
|
|
425
|
+
}
|
|
426
|
+
},
|
|
381
427
|
getApiGroup: async (groupId) => {
|
|
382
428
|
try {
|
|
383
429
|
const request = new cloudapi.DescribeApiGroupRequest({
|
|
@@ -424,7 +470,7 @@ const createApigwOperations = (apigwClient, dnsClient, _context) => {
|
|
|
424
470
|
sslOcspEnable: d.sslOcspEnable,
|
|
425
471
|
sslVerifyDepth: d.sslVerifyDepth,
|
|
426
472
|
wildcardDomainPatterns: d.wildcardDomainPatterns,
|
|
427
|
-
})),
|
|
473
|
+
})) ?? [],
|
|
428
474
|
stageItems: body.stageItems?.stageInfo?.map((s) => ({
|
|
429
475
|
description: s.description,
|
|
430
476
|
stageId: s.stageId,
|
|
@@ -992,14 +1038,7 @@ const createApigwOperations = (apigwClient, dnsClient, _context) => {
|
|
|
992
1038
|
});
|
|
993
1039
|
const setCertificate = async () => {
|
|
994
1040
|
if (config.certificateName && config.certificateBody && config.certificatePrivateKey) {
|
|
995
|
-
|
|
996
|
-
groupId: config.groupId,
|
|
997
|
-
domainName: config.domainName,
|
|
998
|
-
certificateName: config.certificateName,
|
|
999
|
-
certificateBody: config.certificateBody,
|
|
1000
|
-
certificatePrivateKey: config.certificatePrivateKey,
|
|
1001
|
-
});
|
|
1002
|
-
await apigwClient.setDomainCertificate(certRequest);
|
|
1041
|
+
await operations.setDomainCertificate(config);
|
|
1003
1042
|
}
|
|
1004
1043
|
};
|
|
1005
1044
|
try {
|
|
@@ -586,7 +586,13 @@ const buildCodeLocation = (codePath, ossCode) => {
|
|
|
586
586
|
}
|
|
587
587
|
},
|
|
588
588
|
deleteCustomDomain: async (domainName) => {
|
|
589
|
-
|
|
589
|
+
try {
|
|
590
|
+
await fc3Client.deleteCustomDomain(domainName);
|
|
591
|
+
}
|
|
592
|
+
catch (error) {
|
|
593
|
+
if (error?.code !== 'CustomDomainNotFound')
|
|
594
|
+
throw error;
|
|
595
|
+
}
|
|
590
596
|
},
|
|
591
597
|
};
|
|
592
598
|
return operations;
|