@geek-fun/serverlessinsight 0.9.0 → 0.9.1
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 +2 -2
- package/.serverlessinsight/state-insight-poc-app-log-insight-poc-tencent-log.json.backup +3 -3
- 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-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 +2 -2
- package/.serverlessinsight/state-role-reconcile-test-app-role-reconcile-test-service.json.backup +3 -3
- package/README.md +2 -2
- package/README.zh-CN.md +2 -2
- package/dist/package.json +2 -2
- package/dist/src/commands/deploy.js +9 -3
- package/dist/src/commands/destroy.js +8 -2
- package/dist/src/commands/forceUnlock.js +5 -5
- package/dist/src/commands/index.js +98 -62
- package/dist/src/commands/login.js +12 -1
- package/dist/src/commands/migrate.js +287 -0
- package/dist/src/commands/plan.js +7 -1
- package/dist/src/commands/show.js +37 -25
- package/dist/src/common/aliyunClient/apigwOperations.js +4 -4
- package/dist/src/common/aliyunClient/ecsOperations.js +22 -13
- package/dist/src/common/aliyunClient/fc3Operations.js +7 -3
- package/dist/src/common/aliyunClient/nasOperations.js +4 -3
- package/dist/src/common/aliyunClient/ossOperations.js +52 -8
- package/dist/src/common/aliyunClient/slsOperations.js +3 -2
- package/dist/src/common/aliyunClient/tablestoreOperations.js +22 -11
- package/dist/src/common/apiClient.js +22 -5
- package/dist/src/common/context.js +5 -4
- package/dist/src/common/lockManager.js +1 -1
- package/dist/src/common/migrationMarker.js +34 -0
- package/dist/src/common/runtimeMapper.js +7 -3
- package/dist/src/common/stateBackend/cosStateBackend.js +1 -1
- package/dist/src/common/stateBackend/index.js +5 -2
- package/dist/src/common/stateBackend/localStateBackend.js +8 -2
- package/dist/src/common/stateBackend/ossStateBackend.js +1 -1
- package/dist/src/common/stateBackend/remoteStateBackend.js +19 -2
- package/dist/src/common/stateBackend/saasStateBackend.js +83 -5
- package/dist/src/common/stateManager.js +56 -5
- package/dist/src/common/tencentClient/cosOperations.js +1 -1
- package/dist/src/common/tencentClient/scfOperations.js +2 -1
- package/dist/src/common/volcengineClient/apigwOperations.js +2 -2
- package/dist/src/common/volcengineClient/index.js +6 -2
- package/dist/src/common/volcengineClient/vefaasOperations.js +3 -3
- package/dist/src/lang/en.js +211 -1
- package/dist/src/lang/zh-CN.js +210 -1
- package/dist/src/parser/index.js +1 -1
- package/dist/src/stack/aliyunStack/apigwExecutor.js +2 -2
- package/dist/src/stack/aliyunStack/apigwResource.js +22 -10
- package/dist/src/stack/aliyunStack/databaseExecutor.js +5 -5
- package/dist/src/stack/aliyunStack/databasePlanner.js +2 -2
- package/dist/src/stack/aliyunStack/databaseResource.js +18 -10
- package/dist/src/stack/aliyunStack/esServerlessTypes.js +2 -1
- package/dist/src/stack/aliyunStack/fc3Executor.js +2 -2
- package/dist/src/stack/aliyunStack/fc3Resource.js +31 -11
- package/dist/src/stack/aliyunStack/ossExecutor.js +2 -2
- package/dist/src/stack/aliyunStack/ossResource.js +5 -1
- package/dist/src/stack/aliyunStack/rdsTypes.js +5 -1
- package/dist/src/stack/aliyunStack/tablestoreExecutor.js +2 -2
- package/dist/src/stack/aliyunStack/tablestoreResource.js +3 -3
- package/dist/src/stack/aliyunStack/tablestoreTypes.js +3 -2
- package/dist/src/stack/deploy.js +2 -3
- package/dist/src/stack/localStack/functionRunner.js +5 -4
- package/dist/src/stack/scfStack/cosExecutor.js +2 -2
- package/dist/src/stack/scfStack/cosResource.js +2 -2
- package/dist/src/stack/scfStack/esServerlessExecutor.js +5 -5
- package/dist/src/stack/scfStack/esServerlessResource.js +7 -3
- package/dist/src/stack/scfStack/esServerlessTypes.js +2 -1
- package/dist/src/stack/scfStack/scfExecutor.js +2 -2
- package/dist/src/stack/scfStack/scfResource.js +32 -11
- package/dist/src/stack/scfStack/tdsqlcExecutor.js +5 -5
- package/dist/src/stack/scfStack/tdsqlcResource.js +7 -3
- package/dist/src/stack/volcengineStack/apigwExecutor.js +2 -2
- package/dist/src/stack/volcengineStack/apigwResource.js +7 -4
- package/dist/src/stack/volcengineStack/tosExecutor.js +2 -2
- package/dist/src/stack/volcengineStack/tosResource.js +1 -1
- package/dist/src/stack/volcengineStack/vefaasExecutor.js +2 -2
- package/dist/src/stack/volcengineStack/vefaasResource.js +6 -2
- package/dist/src/validator/rootSchema.js +29 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.migrate = void 0;
|
|
40
|
+
const readline = __importStar(require("node:readline"));
|
|
41
|
+
const node_crypto_1 = __importDefault(require("node:crypto"));
|
|
42
|
+
const common_1 = require("../common");
|
|
43
|
+
const stateBackend_1 = require("../common/stateBackend");
|
|
44
|
+
const credentialStore_1 = require("../common/credentialStore");
|
|
45
|
+
const apiClient_1 = require("../common/apiClient");
|
|
46
|
+
const migrationMarker_1 = require("../common/migrationMarker");
|
|
47
|
+
const types_1 = require("../types");
|
|
48
|
+
const parser_1 = require("../parser");
|
|
49
|
+
const lang_1 = require("../lang");
|
|
50
|
+
const askConfirmation = async (message) => {
|
|
51
|
+
if (!process.stdin.isTTY) {
|
|
52
|
+
throw new Error(lang_1.lang.__('CONFIRMATION_STDIN_NOT_TTY'));
|
|
53
|
+
}
|
|
54
|
+
const rl = readline.createInterface({
|
|
55
|
+
input: process.stdin,
|
|
56
|
+
output: process.stdout,
|
|
57
|
+
});
|
|
58
|
+
return new Promise((resolve) => {
|
|
59
|
+
rl.question(message, (answer) => {
|
|
60
|
+
rl.close();
|
|
61
|
+
resolve(answer.toLowerCase() === 'yes' || answer.toLowerCase() === 'y');
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* `si migrate` — one-time migration of a legacy (local/bucket) state to the
|
|
67
|
+
* Console. docs/state-migration-saas.md §4.2:
|
|
68
|
+
* preflight → source lock → pull/validate → plan → confirm → upload
|
|
69
|
+
* → read-back verify → backfill console UUIDs + write marker → unlock.
|
|
70
|
+
* The marker (managedBy=saas) is a new persisted version of the source state
|
|
71
|
+
* that closes the legacy backend for mutations (decision D-4). Every step is
|
|
72
|
+
* re-runnable: uploads dedupe by contentHash and the marker is only written
|
|
73
|
+
* after verification passes.
|
|
74
|
+
*/
|
|
75
|
+
const migrate = async (options) => {
|
|
76
|
+
common_1.logger.info(lang_1.lang.__('VALIDATING_YAML'));
|
|
77
|
+
const iacLocation = (0, common_1.getIacLocation)(options.location);
|
|
78
|
+
const rawIac = (0, parser_1.parseYaml)(iacLocation);
|
|
79
|
+
common_1.logger.info(lang_1.lang.__('YAML_VALID'));
|
|
80
|
+
await (0, common_1.setContext)({
|
|
81
|
+
...options,
|
|
82
|
+
app: rawIac.app,
|
|
83
|
+
service: rawIac.service,
|
|
84
|
+
iacProvider: rawIac.provider,
|
|
85
|
+
stages: rawIac.stages,
|
|
86
|
+
},
|
|
87
|
+
// No live cloud probing: migrate only touches the state stores. This also
|
|
88
|
+
// lets --rollback and local-backend runs work without cloud credentials.
|
|
89
|
+
false);
|
|
90
|
+
const context = (0, common_1.getContext)();
|
|
91
|
+
const iac = (0, parser_1.revalYaml)(iacLocation, context);
|
|
92
|
+
(0, common_1.setIac)(iac);
|
|
93
|
+
// ① preflight — the source must be a legacy backend with actual state
|
|
94
|
+
const backendType = iac.backend?.type ?? types_1.StateBackendType.SAAS;
|
|
95
|
+
if (backendType !== types_1.StateBackendType.LOCAL && backendType !== types_1.StateBackendType.BUCKET_STORE) {
|
|
96
|
+
throw new Error(lang_1.lang.__('MIGRATE_NO_BACKEND_SOURCE'));
|
|
97
|
+
}
|
|
98
|
+
// Marker checks stay OFF on the source backend: si migrate must be able to
|
|
99
|
+
// read a marked state (idempotent re-runs, --rollback).
|
|
100
|
+
const sourceBackend = (0, stateBackend_1.createStateBackend)(iac.backend, { ...context, siApiKey: options.siApiKey });
|
|
101
|
+
// --rollback: the explicit undo — clear the marker, legacy path reopens.
|
|
102
|
+
// Purely local to the source backend, so it needs NO Console credentials.
|
|
103
|
+
if (options.rollback) {
|
|
104
|
+
await sourceBackend.withLock('migrate-rollback', async () => {
|
|
105
|
+
const state = await sourceBackend.loadState(iac.provider.name, iac.app, iac.service, options.stage ?? 'default');
|
|
106
|
+
if (!(0, migrationMarker_1.isMigratedToSaas)(state)) {
|
|
107
|
+
common_1.logger.info(lang_1.lang.__('MIGRATE_ROLLBACK_NO_MARKER'));
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
if (!sourceBackend.patchPersisted) {
|
|
111
|
+
throw new Error(lang_1.lang.__('MIGRATE_NO_BACKEND_SOURCE'));
|
|
112
|
+
}
|
|
113
|
+
await sourceBackend.patchPersisted({ managedBy: undefined });
|
|
114
|
+
common_1.logger.info(lang_1.lang.__('MIGRATE_ROLLBACK_DONE'));
|
|
115
|
+
common_1.logger.info(lang_1.lang.__('MIGRATE_ROLLBACK_DONE_HINT'));
|
|
116
|
+
});
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
const creds = (0, credentialStore_1.loadCredentials)();
|
|
120
|
+
const apiKey = options.siApiKey ?? creds?.apiKey;
|
|
121
|
+
if (!apiKey) {
|
|
122
|
+
throw new Error(lang_1.lang.__('MIGRATE_NEED_CREDENTIALS'));
|
|
123
|
+
}
|
|
124
|
+
const baseUrl = (0, credentialStore_1.getConsoleUrl)();
|
|
125
|
+
const identity = await (0, apiClient_1.validateApiKey)(apiKey, baseUrl);
|
|
126
|
+
const orgId = identity.orgId;
|
|
127
|
+
common_1.logger.info(lang_1.lang.__('MIGRATE_PREFLIGHT_OK', { orgName: identity.orgName, orgId }));
|
|
128
|
+
const client = (0, apiClient_1.createApiClient)({ apiKey, baseUrl, orgId });
|
|
129
|
+
await sourceBackend.withLock('migrate', async () => {
|
|
130
|
+
// ③ pull + normalize (loadState applies registered state migrations)
|
|
131
|
+
const hydrateStage = options.stage ?? Object.keys(iac.stages ?? {})[0] ?? 'default';
|
|
132
|
+
const state = await sourceBackend.loadState(iac.provider.name, iac.app, iac.service, hydrateStage);
|
|
133
|
+
if ((0, migrationMarker_1.isMigratedToSaas)(state)) {
|
|
134
|
+
common_1.logger.warn(lang_1.lang.__('MIGRATE_ALREADY_MARKED'));
|
|
135
|
+
}
|
|
136
|
+
if (state.provider && state.provider !== iac.provider.name) {
|
|
137
|
+
throw new Error(lang_1.lang.__('MIGRATE_PROVIDER_MISMATCH', {
|
|
138
|
+
stateProvider: state.provider,
|
|
139
|
+
ymlProvider: iac.provider.name,
|
|
140
|
+
}));
|
|
141
|
+
}
|
|
142
|
+
// ④ mapping plan — only stages holding deployed resources migrate
|
|
143
|
+
const allStageKeys = Object.keys(state.stages ?? {});
|
|
144
|
+
if (options.stage && !allStageKeys.includes(options.stage)) {
|
|
145
|
+
throw new Error(lang_1.lang.__('MIGRATE_STAGE_NOT_FOUND', { stage: options.stage }));
|
|
146
|
+
}
|
|
147
|
+
const stageKeys = (options.stage ? [options.stage] : allStageKeys).filter((stageKey) => Object.keys(state.stages?.[stageKey]?.resources ?? {}).length > 0);
|
|
148
|
+
if (stageKeys.length === 0) {
|
|
149
|
+
throw new Error(lang_1.lang.__('MIGRATE_NOTHING_TO_MIGRATE'));
|
|
150
|
+
}
|
|
151
|
+
// ④ mapping plan — resolve which Console targets already exist (mapped by
|
|
152
|
+
// name) and which would be auto-created, so the dry-run/confirm screen
|
|
153
|
+
// keeps the user in control of the destination (pre-create in Console to
|
|
154
|
+
// adopt existing apps/services/membership settings).
|
|
155
|
+
const targets = await client.get(`/api/v1/state/migrate/targets?app_name=${encodeURIComponent(iac.app)}&service_name=${encodeURIComponent(iac.service)}&stages=${encodeURIComponent(stageKeys.join(','))}`);
|
|
156
|
+
common_1.logger.info(lang_1.lang.__('MIGRATE_TARGETS_HEADER', { orgName: identity.orgName }));
|
|
157
|
+
if (targets.app.exists) {
|
|
158
|
+
common_1.logger.info(lang_1.lang.__('MIGRATE_TARGET_APP_EXISTS', {
|
|
159
|
+
app: targets.app.name,
|
|
160
|
+
appId: targets.app.id ?? '',
|
|
161
|
+
}));
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
common_1.logger.info(lang_1.lang.__('MIGRATE_TARGET_APP_CREATE', { app: targets.app.name }));
|
|
165
|
+
}
|
|
166
|
+
if (targets.service.exists) {
|
|
167
|
+
if (targets.service.provider && targets.service.provider !== iac.provider.name) {
|
|
168
|
+
throw new Error(lang_1.lang.__('MIGRATE_PROVIDER_MISMATCH_TARGET', {
|
|
169
|
+
service: iac.service,
|
|
170
|
+
existingProvider: targets.service.provider,
|
|
171
|
+
ymlProvider: iac.provider.name,
|
|
172
|
+
}));
|
|
173
|
+
}
|
|
174
|
+
common_1.logger.info(lang_1.lang.__('MIGRATE_TARGET_SERVICE_EXISTS', {
|
|
175
|
+
service: targets.service.name,
|
|
176
|
+
serviceId: targets.service.id ?? '',
|
|
177
|
+
provider: targets.service.provider ?? '',
|
|
178
|
+
}));
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
common_1.logger.info(lang_1.lang.__('MIGRATE_TARGET_SERVICE_CREATE', {
|
|
182
|
+
service: targets.service.name,
|
|
183
|
+
provider: iac.provider.name,
|
|
184
|
+
}));
|
|
185
|
+
}
|
|
186
|
+
for (const stageKey of stageKeys) {
|
|
187
|
+
const count = String(Object.keys(state.stages?.[stageKey]?.resources ?? {}).length);
|
|
188
|
+
const report = targets.stages.find((s) => s.name === stageKey);
|
|
189
|
+
if (report?.hasState) {
|
|
190
|
+
common_1.logger.info(lang_1.lang.__('MIGRATE_TARGET_STAGE_EXISTS', {
|
|
191
|
+
stage: stageKey,
|
|
192
|
+
count,
|
|
193
|
+
version: String(report.latestVersion ?? 1),
|
|
194
|
+
}));
|
|
195
|
+
}
|
|
196
|
+
else if (report?.registered) {
|
|
197
|
+
common_1.logger.info(lang_1.lang.__('MIGRATE_TARGET_STAGE_EMPTY', { stage: stageKey, count }));
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
common_1.logger.info(lang_1.lang.__('MIGRATE_TARGET_STAGE_NEW', { stage: stageKey, count }));
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
common_1.logger.info(lang_1.lang.__('MIGRATE_TARGETS_HINT'));
|
|
204
|
+
if (options.dryRun) {
|
|
205
|
+
common_1.logger.info(lang_1.lang.__('MIGRATE_DRY_RUN_NOTICE'));
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
// ⑤ confirm — the writer-upgrade question is the §4.5 runbook gate
|
|
209
|
+
if (!options.autoApprove) {
|
|
210
|
+
if (!(await askConfirmation(lang_1.lang.__('MIGRATE_WRITER_CONFIRMATION')))) {
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
if (!(await askConfirmation(lang_1.lang.__('MIGRATE_CONFIRMATION')))) {
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
// ⑥ upload — same full-persisted-state contract as the SaaS backend save.
|
|
218
|
+
// The imported version carries the owning org id immediately (D-6 identity
|
|
219
|
+
// anchor), so the first post-cutover loadState can verify it without
|
|
220
|
+
// waiting for a fresh deploy save.
|
|
221
|
+
const persisted = { ...(0, common_1.toPersistedState)(state), orgId };
|
|
222
|
+
const contentHash = node_crypto_1.default.createHash('sha256').update(JSON.stringify(persisted)).digest('hex');
|
|
223
|
+
const results = [];
|
|
224
|
+
for (const stageKey of stageKeys) {
|
|
225
|
+
common_1.logger.info(lang_1.lang.__('MIGRATE_UPLOADING', { stage: stageKey }));
|
|
226
|
+
const resourceCount = Object.keys(state.stages?.[stageKey]?.resources ?? {}).length;
|
|
227
|
+
let uploadResult;
|
|
228
|
+
try {
|
|
229
|
+
uploadResult = await client.post('/api/v1/state/migrate', {
|
|
230
|
+
appName: iac.app,
|
|
231
|
+
serviceName: iac.service,
|
|
232
|
+
provider: iac.provider.name,
|
|
233
|
+
stage: stageKey,
|
|
234
|
+
stateJson: persisted,
|
|
235
|
+
contentHash,
|
|
236
|
+
resourceCount,
|
|
237
|
+
origin: backendType === types_1.StateBackendType.LOCAL ? 'local' : 'bucket',
|
|
238
|
+
conflict: options.force ? 'overwrite' : 'reject',
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
catch (error) {
|
|
242
|
+
if (error instanceof apiClient_1.ApiError && error.status === 409) {
|
|
243
|
+
throw new Error(lang_1.lang.__('MIGRATE_CONFLICT'), { cause: error });
|
|
244
|
+
}
|
|
245
|
+
throw error;
|
|
246
|
+
}
|
|
247
|
+
// ⑦ read-back verification — the stored version must be ours. The server
|
|
248
|
+
// echoes the hash it stored, so no JSON re-serialization is involved
|
|
249
|
+
// (Postgres jsonb would reorder keys and break a naive string compare).
|
|
250
|
+
const remote = await client.get(`/api/v1/apps/${uploadResult.appId}/services/${uploadResult.serviceId}/state/current?stage=${encodeURIComponent(stageKey)}`);
|
|
251
|
+
const verified = remote.contentHash === contentHash &&
|
|
252
|
+
remote.versionNumber === uploadResult.versionNumber &&
|
|
253
|
+
(uploadResult.deduped || remote.resourceCount === resourceCount);
|
|
254
|
+
if (!verified) {
|
|
255
|
+
throw new Error(lang_1.lang.__('MIGRATE_VERIFY_FAILED', { stage: stageKey }));
|
|
256
|
+
}
|
|
257
|
+
results.push({ stage: stageKey, ...uploadResult });
|
|
258
|
+
common_1.logger.info(lang_1.lang.__('MIGRATE_UPLOADED', {
|
|
259
|
+
stage: stageKey,
|
|
260
|
+
version: String(uploadResult.versionNumber),
|
|
261
|
+
deduped: uploadResult.deduped ? lang_1.lang.__('MIGRATE_UPLOADED_DEDUPLICATED') : '',
|
|
262
|
+
appId: uploadResult.appId,
|
|
263
|
+
serviceId: uploadResult.serviceId,
|
|
264
|
+
}));
|
|
265
|
+
}
|
|
266
|
+
// ⑧⑨ backfill console UUIDs + write the migration marker as one new
|
|
267
|
+
// persisted version. Only reached when every stage verified.
|
|
268
|
+
const first = results[0];
|
|
269
|
+
if (options.noMarker) {
|
|
270
|
+
common_1.logger.warn(lang_1.lang.__('MIGRATE_MARKER_SKIPPED'));
|
|
271
|
+
}
|
|
272
|
+
else {
|
|
273
|
+
if (!sourceBackend.patchPersisted) {
|
|
274
|
+
throw new Error(lang_1.lang.__('MIGRATE_NO_BACKEND_SOURCE'));
|
|
275
|
+
}
|
|
276
|
+
await sourceBackend.patchPersisted({
|
|
277
|
+
orgId,
|
|
278
|
+
appId: first.appId,
|
|
279
|
+
serviceId: first.serviceId,
|
|
280
|
+
managedBy: 'saas',
|
|
281
|
+
});
|
|
282
|
+
common_1.logger.info(lang_1.lang.__('MIGRATE_MARKER_WRITTEN'));
|
|
283
|
+
}
|
|
284
|
+
common_1.logger.info(lang_1.lang.__('MIGRATE_CUTOVER_STEPS'));
|
|
285
|
+
});
|
|
286
|
+
};
|
|
287
|
+
exports.migrate = migrate;
|
|
@@ -28,7 +28,13 @@ const plan = async (options) => {
|
|
|
28
28
|
? lang_1.lang.__('PROVIDER_ALIYUN')
|
|
29
29
|
: lang_1.lang.__('PROVIDER_TENCENT');
|
|
30
30
|
common_1.logger.info(lang_1.lang.__('GENERATING_PLAN_FOR_PROVIDER', { provider: providerDisplayName }));
|
|
31
|
-
|
|
31
|
+
// Read-only command: a migrated state only warns here (window-period
|
|
32
|
+
// reconciliation still needs plan against the legacy copy).
|
|
33
|
+
const backend = (0, stateBackend_1.createStateBackend)(iac.backend, {
|
|
34
|
+
...context,
|
|
35
|
+
declaredOrg: iac.org,
|
|
36
|
+
migrationMarker: 'warn',
|
|
37
|
+
});
|
|
32
38
|
let planResult;
|
|
33
39
|
if (iac.provider.name === common_1.ProviderEnum.TENCENT) {
|
|
34
40
|
planResult = await (0, scfStack_1.generateTencentPlan)(iac, backend);
|
|
@@ -6,7 +6,9 @@ const backend_1 = require("../types/domains/backend");
|
|
|
6
6
|
const common_1 = require("../common");
|
|
7
7
|
const lockManager_1 = require("../common/lockManager");
|
|
8
8
|
const stateBackend_1 = require("../common/stateBackend");
|
|
9
|
+
const migrationMarker_1 = require("../common/migrationMarker");
|
|
9
10
|
const logger_1 = require("../common/logger");
|
|
11
|
+
const lang_1 = require("../lang");
|
|
10
12
|
const formatTimeAgo = (dateStr) => {
|
|
11
13
|
const date = new Date(dateStr);
|
|
12
14
|
const now = new Date();
|
|
@@ -15,12 +17,12 @@ const formatTimeAgo = (dateStr) => {
|
|
|
15
17
|
const diffHours = Math.floor(diffMs / 3600000);
|
|
16
18
|
const diffDays = Math.floor(diffMs / 86400000);
|
|
17
19
|
if (diffDays > 0)
|
|
18
|
-
return
|
|
20
|
+
return lang_1.lang.__('SHOW_TIME_DAYS_AGO', { count: String(diffDays) });
|
|
19
21
|
if (diffHours > 0)
|
|
20
|
-
return
|
|
22
|
+
return lang_1.lang.__('SHOW_TIME_HOURS_AGO', { count: String(diffHours) });
|
|
21
23
|
if (diffMins > 0)
|
|
22
|
-
return
|
|
23
|
-
return '
|
|
24
|
+
return lang_1.lang.__('SHOW_TIME_MINUTES_AGO', { count: String(diffMins) });
|
|
25
|
+
return lang_1.lang.__('SHOW_TIME_JUST_NOW');
|
|
24
26
|
};
|
|
25
27
|
const formatFunctionOutput = (logicalId, resource) => {
|
|
26
28
|
const lines = [];
|
|
@@ -173,7 +175,7 @@ const show = async (options) => {
|
|
|
173
175
|
const context = (0, common_1.getContext)();
|
|
174
176
|
const stage = options.stage ?? context.stage;
|
|
175
177
|
const baseDir = options.location ?? process.cwd();
|
|
176
|
-
logger_1.logger.info(
|
|
178
|
+
logger_1.logger.info(lang_1.lang.__('SHOW_LOADING_STATE', { app: context.app, service: context.service, stage }));
|
|
177
179
|
let state;
|
|
178
180
|
let lockInfo;
|
|
179
181
|
let stateLocation;
|
|
@@ -184,7 +186,12 @@ const show = async (options) => {
|
|
|
184
186
|
!backendType;
|
|
185
187
|
if (shouldUseRemoteBackend) {
|
|
186
188
|
try {
|
|
187
|
-
|
|
189
|
+
// Read-only command: a migrated state only warns here.
|
|
190
|
+
const backend = (0, stateBackend_1.createStateBackend)(options.iac.backend, {
|
|
191
|
+
...context,
|
|
192
|
+
declaredOrg: options.iac.org,
|
|
193
|
+
migrationMarker: 'warn',
|
|
194
|
+
});
|
|
188
195
|
state = await backend.loadState(context.provider, context.app, context.service, stage);
|
|
189
196
|
lockInfo = await backend.readLock();
|
|
190
197
|
usingRemoteBackend = true;
|
|
@@ -195,12 +202,17 @@ const show = async (options) => {
|
|
|
195
202
|
}
|
|
196
203
|
catch (error) {
|
|
197
204
|
if (backendType === backend_1.StateBackendType.SAAS || !backendType) {
|
|
198
|
-
logger_1.logger.warn(
|
|
205
|
+
logger_1.logger.warn(lang_1.lang.__('SHOW_SAAS_BACKEND_FALLBACK', { error: String(error) }));
|
|
199
206
|
}
|
|
200
207
|
else {
|
|
201
|
-
logger_1.logger.warn(
|
|
208
|
+
logger_1.logger.warn(lang_1.lang.__('SHOW_REMOTE_BACKEND_FALLBACK', { error: String(error) }));
|
|
202
209
|
}
|
|
203
210
|
state = loadLocalState(context.provider, context.app, context.service, stage, baseDir);
|
|
211
|
+
// A local copy of a MIGRATED state is stale by definition — showing it
|
|
212
|
+
// after a remote failure would mislead the user (decision D-3/D-4).
|
|
213
|
+
if ((0, migrationMarker_1.isMigratedToSaas)(state)) {
|
|
214
|
+
throw new Error(lang_1.lang.__('MIGRATION_MARKER_REFUSED'), { cause: error });
|
|
215
|
+
}
|
|
204
216
|
lockInfo = readLocalLock(context.app, context.service, baseDir);
|
|
205
217
|
stateLocation = (0, common_1.getStatePath)(context.app, context.service, baseDir);
|
|
206
218
|
}
|
|
@@ -213,19 +225,19 @@ const show = async (options) => {
|
|
|
213
225
|
const resources = state.resources;
|
|
214
226
|
const resourceCount = Object.keys(resources).length;
|
|
215
227
|
if (resourceCount === 0) {
|
|
216
|
-
logger_1.logger.info(
|
|
228
|
+
logger_1.logger.info(lang_1.lang.__('SHOW_NO_RESOURCES'));
|
|
217
229
|
logger_1.logger.info('');
|
|
218
|
-
logger_1.logger.info(
|
|
230
|
+
logger_1.logger.info(lang_1.lang.__('SHOW_STATE_LOCATION', { stateLocation }));
|
|
219
231
|
if (usingRemoteBackend) {
|
|
220
|
-
logger_1.logger.info('
|
|
232
|
+
logger_1.logger.info(lang_1.lang.__('SHOW_BACKEND_REMOTE'));
|
|
221
233
|
}
|
|
222
234
|
logger_1.logger.info('');
|
|
223
|
-
logger_1.logger.info('
|
|
235
|
+
logger_1.logger.info(lang_1.lang.__('SHOW_DEPLOY_HINT'));
|
|
224
236
|
return;
|
|
225
237
|
}
|
|
226
238
|
logger_1.logger.info('');
|
|
227
239
|
logger_1.logger.info('═'.repeat(60));
|
|
228
|
-
logger_1.logger.info('
|
|
240
|
+
logger_1.logger.info(lang_1.lang.__('SHOW_HEADER_DEPLOYED'));
|
|
229
241
|
logger_1.logger.info('═'.repeat(60));
|
|
230
242
|
const groupedResources = {};
|
|
231
243
|
for (const [logicalId, resource] of Object.entries(resources)) {
|
|
@@ -264,7 +276,7 @@ const show = async (options) => {
|
|
|
264
276
|
if (!resourcesInCategory || resourcesInCategory.length === 0)
|
|
265
277
|
continue;
|
|
266
278
|
logger_1.logger.info('');
|
|
267
|
-
logger_1.logger.info(
|
|
279
|
+
logger_1.logger.info(lang_1.lang.__('SHOW_CATEGORY_HEADER', { label: categoryLabels[category] }));
|
|
268
280
|
logger_1.logger.info('─'.repeat(40));
|
|
269
281
|
for (const [logicalId, resource] of resourcesInCategory) {
|
|
270
282
|
const lines = formatResourceOutput(logicalId, resource);
|
|
@@ -275,14 +287,14 @@ const show = async (options) => {
|
|
|
275
287
|
}
|
|
276
288
|
logger_1.logger.info('');
|
|
277
289
|
logger_1.logger.info('═'.repeat(60));
|
|
278
|
-
logger_1.logger.info('
|
|
290
|
+
logger_1.logger.info(lang_1.lang.__('SHOW_HEADER_SUMMARY'));
|
|
279
291
|
logger_1.logger.info('═'.repeat(60));
|
|
280
292
|
logger_1.logger.info('');
|
|
281
|
-
logger_1.logger.info(
|
|
282
|
-
logger_1.logger.info(
|
|
283
|
-
logger_1.logger.info(
|
|
284
|
-
logger_1.logger.info(
|
|
285
|
-
logger_1.logger.info(
|
|
293
|
+
logger_1.logger.info(lang_1.lang.__('SHOW_SUMMARY_PROVIDER', { value: state.provider }));
|
|
294
|
+
logger_1.logger.info(lang_1.lang.__('SHOW_SUMMARY_APP', { value: state.app }));
|
|
295
|
+
logger_1.logger.info(lang_1.lang.__('SHOW_SUMMARY_SERVICE', { value: state.service }));
|
|
296
|
+
logger_1.logger.info(lang_1.lang.__('SHOW_SUMMARY_STAGE', { value: stage }));
|
|
297
|
+
logger_1.logger.info(lang_1.lang.__('SHOW_SUMMARY_RESOURCES', { value: String(resourceCount) }));
|
|
286
298
|
if (Object.keys(resources).length > 0) {
|
|
287
299
|
const lastUpdated = Object.values(resources).reduce((latest, r) => {
|
|
288
300
|
if (!r.lastUpdated)
|
|
@@ -292,19 +304,19 @@ const show = async (options) => {
|
|
|
292
304
|
return r.lastUpdated > latest ? r.lastUpdated : latest;
|
|
293
305
|
}, undefined);
|
|
294
306
|
if (lastUpdated) {
|
|
295
|
-
logger_1.logger.info(
|
|
307
|
+
logger_1.logger.info(lang_1.lang.__('SHOW_SUMMARY_LAST_UPDATED', { value: formatTimeAgo(lastUpdated) }));
|
|
296
308
|
}
|
|
297
309
|
}
|
|
298
310
|
logger_1.logger.info('');
|
|
299
|
-
logger_1.logger.info(
|
|
311
|
+
logger_1.logger.info(lang_1.lang.__('SHOW_STATE_LOCATION', { stateLocation }));
|
|
300
312
|
if (usingRemoteBackend) {
|
|
301
|
-
logger_1.logger.info('
|
|
313
|
+
logger_1.logger.info(lang_1.lang.__('SHOW_BACKEND_REMOTE'));
|
|
302
314
|
}
|
|
303
315
|
if (lockInfo) {
|
|
304
|
-
logger_1.logger.info(
|
|
316
|
+
logger_1.logger.info(lang_1.lang.__('SHOW_LOCKED_BY', { user: lockInfo.user || 'unknown' }));
|
|
305
317
|
}
|
|
306
318
|
else {
|
|
307
|
-
logger_1.logger.info('
|
|
319
|
+
logger_1.logger.info(lang_1.lang.__('SHOW_UNLOCKED'));
|
|
308
320
|
}
|
|
309
321
|
};
|
|
310
322
|
exports.show = show;
|
|
@@ -103,7 +103,7 @@ const createApigwOperations = (apigwClient, dnsClient, _context) => {
|
|
|
103
103
|
}
|
|
104
104
|
};
|
|
105
105
|
if (!shouldLoop) {
|
|
106
|
-
logger_1.logger.info('
|
|
106
|
+
logger_1.logger.info(lang_1.lang.__('APIGW_CHECKING_DNS_STATUS'));
|
|
107
107
|
return await checkPropagation();
|
|
108
108
|
}
|
|
109
109
|
logger_1.logger.info(lang_1.lang.__('APIGW_DNS_PROPAGATION_WAITING'));
|
|
@@ -371,7 +371,7 @@ const createApigwOperations = (apigwClient, dnsClient, _context) => {
|
|
|
371
371
|
});
|
|
372
372
|
const response = await apigwClient.createApiGroup(request);
|
|
373
373
|
if (!response.body?.groupId) {
|
|
374
|
-
throw new Error('
|
|
374
|
+
throw new Error(lang_1.lang.__('APIGW_GROUP_CREATE_NO_ID'));
|
|
375
375
|
}
|
|
376
376
|
return response.body.groupId;
|
|
377
377
|
},
|
|
@@ -609,7 +609,7 @@ const createApigwOperations = (apigwClient, dnsClient, _context) => {
|
|
|
609
609
|
});
|
|
610
610
|
const response = await apigwClient.createApi(request);
|
|
611
611
|
if (!response.body?.apiId) {
|
|
612
|
-
throw new Error('
|
|
612
|
+
throw new Error(lang_1.lang.__('APIGW_API_CREATE_NO_ID'));
|
|
613
613
|
}
|
|
614
614
|
return response.body.apiId;
|
|
615
615
|
},
|
|
@@ -976,7 +976,7 @@ const createApigwOperations = (apigwClient, dnsClient, _context) => {
|
|
|
976
976
|
const groupSubdomain = groupInfo.body?.subDomain;
|
|
977
977
|
const groupId = groupInfo.body?.groupId || config.groupId;
|
|
978
978
|
if (!groupSubdomain) {
|
|
979
|
-
throw new Error(
|
|
979
|
+
throw new Error(lang_1.lang.__('APIGW_GROUP_NO_SUBDOMAIN', { groupName: config.groupId }));
|
|
980
980
|
}
|
|
981
981
|
if (!skipDns) {
|
|
982
982
|
logger_1.logger.info(lang_1.lang.__('APIGW_ENSURING_CNAME', { domain: config.domainName }));
|
|
@@ -36,6 +36,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.createEcsOperations = exports.parseSecurityGroupRule = exports.canonicalSecurityGroupRule = exports.securityGroupRangeMap = void 0;
|
|
37
37
|
const ecs = __importStar(require("@alicloud/ecs20140526"));
|
|
38
38
|
const logger_1 = require("../logger");
|
|
39
|
+
const lang_1 = require("../../lang");
|
|
39
40
|
exports.securityGroupRangeMap = {
|
|
40
41
|
TCP: '1/65535',
|
|
41
42
|
UDP: '1/65535',
|
|
@@ -61,13 +62,13 @@ exports.canonicalSecurityGroupRule = canonicalSecurityGroupRule;
|
|
|
61
62
|
/* istanbul ignore next */ const parseSecurityGroupRule = (rule) => {
|
|
62
63
|
const [rawProtocol, second, third, ...rest] = rule.split(':');
|
|
63
64
|
if (rest.length > 0 || !rawProtocol || !second || !third) {
|
|
64
|
-
throw new Error(
|
|
65
|
+
throw new Error(lang_1.lang.__('SG_INVALID_RULE_FORMAT', { rule }));
|
|
65
66
|
}
|
|
66
67
|
const protocol = normalizeProtocol(rawProtocol);
|
|
67
68
|
const secondTrimmed = second.trim();
|
|
68
69
|
const thirdTrimmed = third.trim();
|
|
69
70
|
if (!secondTrimmed || !thirdTrimmed) {
|
|
70
|
-
throw new Error(
|
|
71
|
+
throw new Error(lang_1.lang.__('SG_INVALID_RULE_FORMAT', { rule }));
|
|
71
72
|
}
|
|
72
73
|
return { protocol, cidr: secondTrimmed, portRange: thirdTrimmed };
|
|
73
74
|
};
|
|
@@ -98,7 +99,7 @@ const isDuplicateSecurityGroupRuleError = (error) => {
|
|
|
98
99
|
const response = await ecsClient.createSecurityGroup(createRequest);
|
|
99
100
|
const securityGroupId = response.body?.securityGroupId;
|
|
100
101
|
if (!securityGroupId) {
|
|
101
|
-
throw new Error('
|
|
102
|
+
throw new Error(lang_1.lang.__('SG_CREATE_FAILED'));
|
|
102
103
|
}
|
|
103
104
|
// Add ingress rules
|
|
104
105
|
for (const rule of ingressRules) {
|
|
@@ -107,7 +108,7 @@ const isDuplicateSecurityGroupRuleError = (error) => {
|
|
|
107
108
|
parsedRule = (0, exports.parseSecurityGroupRule)(rule);
|
|
108
109
|
}
|
|
109
110
|
catch (error) {
|
|
110
|
-
logger_1.logger.warn(
|
|
111
|
+
logger_1.logger.warn(lang_1.lang.__('SG_SKIP_INVALID_INGRESS', { rule, error: String(error) }));
|
|
111
112
|
continue;
|
|
112
113
|
}
|
|
113
114
|
const ingressRequest = new ecs.AuthorizeSecurityGroupRequest({
|
|
@@ -122,10 +123,10 @@ const isDuplicateSecurityGroupRuleError = (error) => {
|
|
|
122
123
|
}
|
|
123
124
|
catch (error) {
|
|
124
125
|
if (isDuplicateSecurityGroupRuleError(error)) {
|
|
125
|
-
logger_1.logger.debug(
|
|
126
|
+
logger_1.logger.debug(lang_1.lang.__('SG_INGRESS_ALREADY_EXISTS', { rule }));
|
|
126
127
|
continue;
|
|
127
128
|
}
|
|
128
|
-
logger_1.logger.warn(
|
|
129
|
+
logger_1.logger.warn(lang_1.lang.__('SG_ADD_INGRESS_FAILED', { rule, error: String(error) }));
|
|
129
130
|
}
|
|
130
131
|
}
|
|
131
132
|
// Add egress rules
|
|
@@ -135,7 +136,7 @@ const isDuplicateSecurityGroupRuleError = (error) => {
|
|
|
135
136
|
parsedRule = (0, exports.parseSecurityGroupRule)(rule);
|
|
136
137
|
}
|
|
137
138
|
catch (error) {
|
|
138
|
-
logger_1.logger.warn(
|
|
139
|
+
logger_1.logger.warn(lang_1.lang.__('SG_SKIP_INVALID_EGRESS', { rule, error: String(error) }));
|
|
139
140
|
continue;
|
|
140
141
|
}
|
|
141
142
|
const egressRequest = new ecs.AuthorizeSecurityGroupEgressRequest({
|
|
@@ -150,10 +151,10 @@ const isDuplicateSecurityGroupRuleError = (error) => {
|
|
|
150
151
|
}
|
|
151
152
|
catch (error) {
|
|
152
153
|
if (isDuplicateSecurityGroupRuleError(error)) {
|
|
153
|
-
logger_1.logger.debug(
|
|
154
|
+
logger_1.logger.debug(lang_1.lang.__('SG_EGRESS_ALREADY_EXISTS', { rule }));
|
|
154
155
|
continue;
|
|
155
156
|
}
|
|
156
|
-
logger_1.logger.warn(
|
|
157
|
+
logger_1.logger.warn(lang_1.lang.__('SG_ADD_EGRESS_FAILED', { rule, error: String(error) }));
|
|
157
158
|
}
|
|
158
159
|
}
|
|
159
160
|
const sg = await operations.getSecurityGroup(securityGroupId);
|
|
@@ -195,7 +196,11 @@ const isDuplicateSecurityGroupRuleError = (error) => {
|
|
|
195
196
|
if (isDuplicateSecurityGroupRuleError(error)) {
|
|
196
197
|
continue;
|
|
197
198
|
}
|
|
198
|
-
logger_1.logger.warn(
|
|
199
|
+
logger_1.logger.warn(lang_1.lang.__('SG_AUTHORIZE_RULE_FAILED', {
|
|
200
|
+
ruleType: direction,
|
|
201
|
+
target: securityGroupId,
|
|
202
|
+
error: String(error),
|
|
203
|
+
}));
|
|
199
204
|
}
|
|
200
205
|
}
|
|
201
206
|
},
|
|
@@ -224,7 +229,11 @@ const isDuplicateSecurityGroupRuleError = (error) => {
|
|
|
224
229
|
}
|
|
225
230
|
}
|
|
226
231
|
catch (error) {
|
|
227
|
-
logger_1.logger.warn(
|
|
232
|
+
logger_1.logger.warn(lang_1.lang.__('SG_REVOKE_RULE_FAILED', {
|
|
233
|
+
ruleType: direction,
|
|
234
|
+
target: securityGroupId,
|
|
235
|
+
error: String(error),
|
|
236
|
+
}));
|
|
228
237
|
}
|
|
229
238
|
}
|
|
230
239
|
},
|
|
@@ -254,7 +263,7 @@ const isDuplicateSecurityGroupRuleError = (error) => {
|
|
|
254
263
|
}
|
|
255
264
|
}
|
|
256
265
|
catch (error) {
|
|
257
|
-
logger_1.logger.debug(
|
|
266
|
+
logger_1.logger.debug(lang_1.lang.__('SG_GET_INGRESS_FAILED', { error: String(error) }));
|
|
258
267
|
}
|
|
259
268
|
try {
|
|
260
269
|
const request = new ecs.DescribeSecurityGroupAttributeRequest({
|
|
@@ -279,7 +288,7 @@ const isDuplicateSecurityGroupRuleError = (error) => {
|
|
|
279
288
|
}
|
|
280
289
|
}
|
|
281
290
|
catch (error) {
|
|
282
|
-
logger_1.logger.debug(
|
|
291
|
+
logger_1.logger.debug(lang_1.lang.__('SG_GET_EGRESS_FAILED', { error: String(error) }));
|
|
283
292
|
}
|
|
284
293
|
return { ingressRules, egressRules };
|
|
285
294
|
},
|
|
@@ -41,6 +41,7 @@ const fc = __importStar(require("@alicloud/fc20230330"));
|
|
|
41
41
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
42
42
|
const polling_1 = require("../polling");
|
|
43
43
|
const constants_1 = require("../constants");
|
|
44
|
+
const lang_1 = require("../../lang");
|
|
44
45
|
const buildCodeLocation = (codePath, ossCode) => {
|
|
45
46
|
if (ossCode) {
|
|
46
47
|
return new fc.InputCodeLocation({
|
|
@@ -66,7 +67,10 @@ const buildCodeLocation = (codePath, ossCode) => {
|
|
|
66
67
|
fetch: () => operations.getFunction(functionName),
|
|
67
68
|
isDone: (info) => {
|
|
68
69
|
if (info?.state === 'Failed') {
|
|
69
|
-
throw new Error(
|
|
70
|
+
throw new Error(lang_1.lang.__('FC3_FUNCTION_FAILED_STATE', {
|
|
71
|
+
functionName,
|
|
72
|
+
reason: info.stateReason ?? 'unknown',
|
|
73
|
+
}));
|
|
70
74
|
}
|
|
71
75
|
// Built-in runtimes (zip code) never reach Active (issue #219):
|
|
72
76
|
// they hold Pending while a create/update transition is in flight
|
|
@@ -83,7 +87,7 @@ const buildCodeLocation = (codePath, ossCode) => {
|
|
|
83
87
|
}
|
|
84
88
|
catch (e) {
|
|
85
89
|
if (e instanceof polling_1.PollingTimeoutError) {
|
|
86
|
-
throw new Error(
|
|
90
|
+
throw new Error(lang_1.lang.__('FC3_TIMEOUT_ACTIVE', { functionName }), {
|
|
87
91
|
cause: e,
|
|
88
92
|
});
|
|
89
93
|
}
|
|
@@ -102,7 +106,7 @@ const buildCodeLocation = (codePath, ossCode) => {
|
|
|
102
106
|
}
|
|
103
107
|
catch (e) {
|
|
104
108
|
if (e instanceof polling_1.PollingTimeoutError) {
|
|
105
|
-
throw new Error(
|
|
109
|
+
throw new Error(lang_1.lang.__('FC3_TIMEOUT_DELETED', { functionName }), {
|
|
106
110
|
cause: e,
|
|
107
111
|
});
|
|
108
112
|
}
|