@intra-mart/accel 0.4.0-dev.202607210732 → 0.4.0-dev.202607270235
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/README.md +11 -1
- package/dist/commands/deploy.d.ts +16 -1
- package/dist/commands/deploy.js +190 -15
- package/dist/core/types.d.ts +19 -0
- package/dist/deploy/api-client.d.ts +3 -1
- package/dist/deploy/api-client.js +18 -0
- package/dist/i18n/en.js +12 -0
- package/dist/i18n/ja.js +12 -0
- package/dist/i18n/zh_CN.js +12 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -234,6 +234,14 @@ accel deploy
|
|
|
234
234
|
4. 実行結果を一覧表示
|
|
235
235
|
- **注意**: セットアップの実行はステージング分離されず、実テナントのデータベースに反映されます
|
|
236
236
|
- セットアップの成否はデプロイの終了コードに影響しません(デプロイ成功 = 正常終了)
|
|
237
|
+
- テナント環境セットアップに続けて、iAP からサンプルデータセットアップ設定が返ってきた場合は、対話的にサンプルデータセットアップの実行を提案します:
|
|
238
|
+
- 流れはテナント環境セットアップと同様です(設定の情報表示 → 実行確認 → 一括実行 or 複数選択して順次実行 → 結果一覧表示)
|
|
239
|
+
- **テナント環境セットアップの実行有無・成否に関わらず提案します**(サンプルデータセットアップのみを実行したいケースに対応するため)
|
|
240
|
+
- サーバー側の仕様として、**前処理の失敗のみ致命的**(以降の実行を中断)として扱われます。中断が発生した場合はその旨を警告表示します
|
|
241
|
+
- テナント環境セットアップと同様、実行はステージング分離されず実テナントのデータベースに反映されます。成否はデプロイの終了コードに影響しません
|
|
242
|
+
- `--tenant-setup` / `--sample-setup` フラグを指定すると、対象のセットアップ(テナント環境セットアップ/サンプルデータセットアップ)を**確認プロンプトなしで一括実行**します(対話・非対話共通):
|
|
243
|
+
- フラグ指定により実行したセットアップが失敗した場合は、デプロイ自体は成功している旨を表示した上で**非0終了**します(CI での失敗検知を想定)
|
|
244
|
+
- フラグを指定したがセットアップ設定が資材に存在しない場合は、警告を表示して正常終了します
|
|
237
245
|
|
|
238
246
|
#### 非対話モード
|
|
239
247
|
|
|
@@ -257,7 +265,7 @@ ACCEL_API_KEY=*** accel deploy \
|
|
|
257
265
|
- `--file` 未指定の場合は対話モードと同じ自動特定(`<artifactId>-<projectVersion>.zip` 完全一致)を試みます。**自動特定できない場合**(settings 無し/完全一致無し/複数候補)は `--file` 指定が必要な旨を表示してエラー終了します。`./target/` に zip が 1 件も無い場合は、ビルド未実行の旨(`mvn package` 等の実行を促す)を表示してエラー終了します。
|
|
258
266
|
- `--additional-file` は任意です。指定した場合は各パスの存在・拡張子(`.imm` / `.zip`)・重複を検証し、違反があればエラー終了します。デプロイ順は「`--additional-file` の指定順 → ビルド成果物(最後)」で固定です(順番確認プロンプトは出しません)。
|
|
259
267
|
- `--description` は任意です。最終確認プロンプトは出さず、即デプロイします。
|
|
260
|
-
-
|
|
268
|
+
- **フラグ未指定時、テナント環境セットアップ/サンプルデータセットアップは実行しません**(対話が必要なため)。`--tenant-setup` / `--sample-setup` を指定した場合のみ、デプロイ成功後に対象のセットアップを一括実行します(両指定時はテナント環境セットアップ → サンプルデータセットアップの順。テナント側が失敗してもサンプル側は実行します)。セットアップが失敗した場合は、デプロイ自体は成功している旨を表示した上で非0終了します。自動ログイン付きURLはデプロイ結果に含めて表示します。
|
|
261
269
|
- フラグ/環境変数で渡した接続情報は **`.accel/credentials.json` に保存しません**(CIランナーにシークレット情報を残さないため)。
|
|
262
270
|
|
|
263
271
|
#### オプション一覧
|
|
@@ -270,6 +278,8 @@ ACCEL_API_KEY=*** accel deploy \
|
|
|
270
278
|
| `--file` | string | デプロイする zip のパス(`./target/` 配下に限定しない) | 自動特定 / 対話で選択 |
|
|
271
279
|
| `--additional-file` | string(複数指定可) | 追加でデプロイするアーカイブファイルのパス(`.imm` / `.zip`。指定順にビルド成果物より先に展開) | なし |
|
|
272
280
|
| `--description` | string | デプロイメントの説明 | `""` |
|
|
281
|
+
| `--tenant-setup` | boolean | テナント環境セットアップを確認なしで一括実行(失敗時は非0終了) | `false` |
|
|
282
|
+
| `--sample-setup` | boolean | サンプルデータセットアップを確認なしで一括実行(失敗時は非0終了) | `false` |
|
|
273
283
|
| `--non-interactive` | boolean | 非対話モード(プロンプトを出さず、失敗時は非0終了) | `false` |
|
|
274
284
|
|
|
275
285
|
#### 接続情報ファイル `.accel/credentials.json`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AccelCredentials, SetupConfigResponse, StagingResponse } from "../core/types.js";
|
|
1
|
+
import type { AccelCredentials, SampleSetupConfigResponse, SetupConfigResponse, StagingResponse } from "../core/types.js";
|
|
2
2
|
import { type ApiClient } from "../deploy/api-client.js";
|
|
3
3
|
import { type DeployFile } from "../deploy/deploy-files.js";
|
|
4
4
|
export type ConfirmInfo = {
|
|
@@ -16,6 +16,9 @@ export type DeployPrompts = {
|
|
|
16
16
|
confirmSetup: (configs: SetupConfigResponse[], locale: string) => Promise<boolean>;
|
|
17
17
|
confirmSetupAll: (locale: string) => Promise<boolean>;
|
|
18
18
|
selectSetupConfigs: (configs: SetupConfigResponse[], locale: string) => Promise<SetupConfigResponse[]>;
|
|
19
|
+
confirmSampleSetup: (configs: SampleSetupConfigResponse[], locale: string) => Promise<boolean>;
|
|
20
|
+
confirmSampleSetupAll: (locale: string) => Promise<boolean>;
|
|
21
|
+
selectSampleSetupConfigs: (configs: SampleSetupConfigResponse[], locale: string) => Promise<SampleSetupConfigResponse[]>;
|
|
19
22
|
};
|
|
20
23
|
export type RunDeployDeps = {
|
|
21
24
|
projectDir: string;
|
|
@@ -27,6 +30,8 @@ export type RunDeployDeps = {
|
|
|
27
30
|
file?: string;
|
|
28
31
|
additionalFiles?: string[];
|
|
29
32
|
description?: string;
|
|
33
|
+
tenantSetup?: boolean;
|
|
34
|
+
sampleSetup?: boolean;
|
|
30
35
|
env?: Record<string, string | undefined>;
|
|
31
36
|
ensureCredentials?: (projectDir: string, locale: string, seed?: Partial<AccelCredentials>) => Promise<AccelCredentials>;
|
|
32
37
|
repromptCredentials?: (current: AccelCredentials, locale: string) => Promise<AccelCredentials>;
|
|
@@ -62,6 +67,16 @@ export declare const deployCommand: import("citty").CommandDef<{
|
|
|
62
67
|
type: "string";
|
|
63
68
|
description: string;
|
|
64
69
|
};
|
|
70
|
+
"tenant-setup": {
|
|
71
|
+
type: "boolean";
|
|
72
|
+
description: string;
|
|
73
|
+
default: false;
|
|
74
|
+
};
|
|
75
|
+
"sample-setup": {
|
|
76
|
+
type: "boolean";
|
|
77
|
+
description: string;
|
|
78
|
+
default: false;
|
|
79
|
+
};
|
|
65
80
|
"non-interactive": {
|
|
66
81
|
type: "boolean";
|
|
67
82
|
description: string;
|
package/dist/commands/deploy.js
CHANGED
|
@@ -21,6 +21,8 @@ const ADDITIONAL_FILE_ERROR_KEY = {
|
|
|
21
21
|
duplicate: "deploy.error.additionalFileDuplicate",
|
|
22
22
|
};
|
|
23
23
|
const setupConfigKey = (c) => `${c.moduleId}\u0000${c.configNumber}`;
|
|
24
|
+
const setupConfigLabel = (c) => `#${c.configNumber} ${c.moduleId} [${c.sections.join(", ")}]`;
|
|
25
|
+
const sampleSetupConfigLabel = (c) => `${c.moduleId} [${c.sections.join(", ")}]`;
|
|
24
26
|
const defaultPrompts = {
|
|
25
27
|
selectStaging: async (stagings, locale) => {
|
|
26
28
|
const res = await p.select({
|
|
@@ -93,9 +95,7 @@ const defaultPrompts = {
|
|
|
93
95
|
return res;
|
|
94
96
|
},
|
|
95
97
|
confirmSetup: async (configs, locale) => {
|
|
96
|
-
p.note(configs
|
|
97
|
-
.map((c) => `#${c.configNumber} ${c.moduleId} [${c.sections.join(", ")}]`)
|
|
98
|
-
.join("\n"), getMessage("deploy.setup.heading", locale));
|
|
98
|
+
p.note(configs.map(setupConfigLabel).join("\n"), getMessage("deploy.setup.heading", locale));
|
|
99
99
|
const res = await p.confirm({
|
|
100
100
|
message: getMessage("deploy.setup.confirm", locale),
|
|
101
101
|
initialValue: true,
|
|
@@ -118,7 +118,7 @@ const defaultPrompts = {
|
|
|
118
118
|
message: getMessage("deploy.setup.selectConfigs", locale),
|
|
119
119
|
options: configs.map((c) => ({
|
|
120
120
|
value: setupConfigKey(c),
|
|
121
|
-
label:
|
|
121
|
+
label: setupConfigLabel(c),
|
|
122
122
|
})),
|
|
123
123
|
required: true,
|
|
124
124
|
});
|
|
@@ -127,6 +127,39 @@ const defaultPrompts = {
|
|
|
127
127
|
const selected = new Set(res);
|
|
128
128
|
return configs.filter((c) => selected.has(setupConfigKey(c)));
|
|
129
129
|
},
|
|
130
|
+
confirmSampleSetup: async (configs, locale) => {
|
|
131
|
+
p.note(configs.map(sampleSetupConfigLabel).join("\n"), getMessage("deploy.sampleSetup.heading", locale));
|
|
132
|
+
const res = await p.confirm({
|
|
133
|
+
message: getMessage("deploy.sampleSetup.confirm", locale),
|
|
134
|
+
initialValue: true,
|
|
135
|
+
});
|
|
136
|
+
if (p.isCancel(res))
|
|
137
|
+
process.exit(0);
|
|
138
|
+
return res;
|
|
139
|
+
},
|
|
140
|
+
confirmSampleSetupAll: async (locale) => {
|
|
141
|
+
const res = await p.confirm({
|
|
142
|
+
message: getMessage("deploy.sampleSetup.confirmAll", locale),
|
|
143
|
+
initialValue: true,
|
|
144
|
+
});
|
|
145
|
+
if (p.isCancel(res))
|
|
146
|
+
process.exit(0);
|
|
147
|
+
return res;
|
|
148
|
+
},
|
|
149
|
+
selectSampleSetupConfigs: async (configs, locale) => {
|
|
150
|
+
const res = await p.multiselect({
|
|
151
|
+
message: getMessage("deploy.sampleSetup.selectConfigs", locale),
|
|
152
|
+
options: configs.map((c) => ({
|
|
153
|
+
value: c.moduleId,
|
|
154
|
+
label: sampleSetupConfigLabel(c),
|
|
155
|
+
})),
|
|
156
|
+
required: true,
|
|
157
|
+
});
|
|
158
|
+
if (p.isCancel(res))
|
|
159
|
+
process.exit(0);
|
|
160
|
+
const selected = new Set(res);
|
|
161
|
+
return configs.filter((c) => selected.has(c.moduleId));
|
|
162
|
+
},
|
|
130
163
|
};
|
|
131
164
|
const resolveLocale = async (projectDir) => {
|
|
132
165
|
try {
|
|
@@ -165,6 +198,11 @@ const formatDeployError = (err, locale) => {
|
|
|
165
198
|
});
|
|
166
199
|
}
|
|
167
200
|
};
|
|
201
|
+
const describeError = (err, locale) => isDeployError(err)
|
|
202
|
+
? formatDeployError(err, locale)
|
|
203
|
+
: err instanceof Error
|
|
204
|
+
? err.message
|
|
205
|
+
: String(err);
|
|
168
206
|
const resolveZipPath = async (opts) => {
|
|
169
207
|
const { projectDir, locale, nonInteractive, fileArg, scan, selectZip } = opts;
|
|
170
208
|
if (fileArg && fileArg.length > 0) {
|
|
@@ -307,22 +345,62 @@ export const runDeploy = async (deps) => {
|
|
|
307
345
|
`${getMessage("deploy.result.createDate", locale)}: ${formatEpochMillis(result.createDate, locale)}`,
|
|
308
346
|
];
|
|
309
347
|
p.note(resultLines.join("\n"));
|
|
310
|
-
|
|
348
|
+
let flagSetupFailed = false;
|
|
349
|
+
if (deps.tenantSetup) {
|
|
350
|
+
const ok = await runBulkSetupForFlag({
|
|
351
|
+
configs: result.setupConfigs,
|
|
352
|
+
configLines: () => (result.setupConfigs ?? []).map(setupConfigLabel),
|
|
353
|
+
keyPrefix: "deploy.setup",
|
|
354
|
+
execute: () => api.executeSetup(stagingId),
|
|
355
|
+
locale,
|
|
356
|
+
spin,
|
|
357
|
+
});
|
|
358
|
+
if (!ok)
|
|
359
|
+
flagSetupFailed = true;
|
|
360
|
+
}
|
|
361
|
+
else if (!nonInteractive &&
|
|
362
|
+
result.setupConfigs &&
|
|
363
|
+
result.setupConfigs.length > 0) {
|
|
311
364
|
try {
|
|
312
365
|
await runSetup(api, stagingId, result.setupConfigs, locale, prompts, spin);
|
|
313
366
|
}
|
|
314
367
|
catch (err) {
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
368
|
+
p.log.error(getMessage("deploy.setup.error", locale, {
|
|
369
|
+
message: describeError(err, locale),
|
|
370
|
+
}));
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
if (deps.sampleSetup) {
|
|
374
|
+
const ok = await runBulkSetupForFlag({
|
|
375
|
+
configs: result.sampleSetupConfigs,
|
|
376
|
+
configLines: () => (result.sampleSetupConfigs ?? []).map(sampleSetupConfigLabel),
|
|
377
|
+
keyPrefix: "deploy.sampleSetup",
|
|
378
|
+
execute: () => api.executeSampleSetup(stagingId),
|
|
379
|
+
locale,
|
|
380
|
+
spin,
|
|
381
|
+
});
|
|
382
|
+
if (!ok)
|
|
383
|
+
flagSetupFailed = true;
|
|
384
|
+
}
|
|
385
|
+
else if (!nonInteractive &&
|
|
386
|
+
result.sampleSetupConfigs &&
|
|
387
|
+
result.sampleSetupConfigs.length > 0) {
|
|
388
|
+
try {
|
|
389
|
+
await runSampleSetup(api, stagingId, result.sampleSetupConfigs, locale, prompts, spin);
|
|
390
|
+
}
|
|
391
|
+
catch (err) {
|
|
392
|
+
p.log.error(getMessage("deploy.sampleSetup.error", locale, {
|
|
393
|
+
message: describeError(err, locale),
|
|
394
|
+
}));
|
|
321
395
|
}
|
|
322
396
|
}
|
|
323
397
|
if (result.shortcutUrl) {
|
|
324
398
|
p.log.info(`${getMessage("deploy.result.shortcutUrl", locale)}: ${result.shortcutUrl}`);
|
|
325
399
|
}
|
|
400
|
+
if (flagSetupFailed) {
|
|
401
|
+
p.log.error(getMessage("deploy.setup.failedButDeployed", locale));
|
|
402
|
+
throw new Error("setup failed");
|
|
403
|
+
}
|
|
326
404
|
p.outro(getMessage("deploy.success", locale));
|
|
327
405
|
};
|
|
328
406
|
const reorderFiles = async (files, prompts, locale) => {
|
|
@@ -376,9 +454,94 @@ const runSetup = async (api, stagingId, configs, locale, prompts, spin) => {
|
|
|
376
454
|
results: allResults,
|
|
377
455
|
};
|
|
378
456
|
}
|
|
379
|
-
showSetupResults(setupResult, locale);
|
|
457
|
+
showSetupResults(setupResult, locale, "deploy.setup");
|
|
458
|
+
};
|
|
459
|
+
const runSampleSetup = async (api, stagingId, configs, locale, prompts, spin) => {
|
|
460
|
+
const doSetup = await prompts.confirmSampleSetup(configs, locale);
|
|
461
|
+
if (!doSetup)
|
|
462
|
+
return;
|
|
463
|
+
const doAll = await prompts.confirmSampleSetupAll(locale);
|
|
464
|
+
let setupResult;
|
|
465
|
+
if (doAll) {
|
|
466
|
+
const progress = getMessage("deploy.sampleSetup.executing", locale, {
|
|
467
|
+
config: "all",
|
|
468
|
+
});
|
|
469
|
+
spin.start(progress);
|
|
470
|
+
try {
|
|
471
|
+
setupResult = await api.executeSampleSetup(stagingId);
|
|
472
|
+
}
|
|
473
|
+
finally {
|
|
474
|
+
spin.stop(progress);
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
else {
|
|
478
|
+
const selected = await prompts.selectSampleSetupConfigs(configs, locale);
|
|
479
|
+
const selectedIds = new Set(selected.map((c) => c.moduleId));
|
|
480
|
+
const ordered = configs.filter((c) => selectedIds.has(c.moduleId));
|
|
481
|
+
const allResults = [];
|
|
482
|
+
let allSuccess = true;
|
|
483
|
+
let anyAborted = false;
|
|
484
|
+
for (const config of ordered) {
|
|
485
|
+
const progress = getMessage("deploy.sampleSetup.executing", locale, {
|
|
486
|
+
config: config.moduleId,
|
|
487
|
+
});
|
|
488
|
+
spin.start(progress);
|
|
489
|
+
let partial;
|
|
490
|
+
try {
|
|
491
|
+
partial = await api.executeSampleSetupConfig(stagingId, config.moduleId);
|
|
492
|
+
}
|
|
493
|
+
finally {
|
|
494
|
+
spin.stop(progress);
|
|
495
|
+
}
|
|
496
|
+
allResults.push(...partial.results);
|
|
497
|
+
if (!partial.success)
|
|
498
|
+
allSuccess = false;
|
|
499
|
+
if (partial.aborted)
|
|
500
|
+
anyAborted = true;
|
|
501
|
+
}
|
|
502
|
+
setupResult = {
|
|
503
|
+
success: allSuccess,
|
|
504
|
+
aborted: anyAborted,
|
|
505
|
+
totalCount: allResults.length,
|
|
506
|
+
results: allResults,
|
|
507
|
+
};
|
|
508
|
+
}
|
|
509
|
+
showSetupResults(setupResult, locale, "deploy.sampleSetup");
|
|
510
|
+
if (setupResult.aborted) {
|
|
511
|
+
p.log.warn(getMessage("deploy.sampleSetup.aborted", locale));
|
|
512
|
+
}
|
|
513
|
+
};
|
|
514
|
+
const runBulkSetupForFlag = async (opts) => {
|
|
515
|
+
const { configs, keyPrefix, locale, spin } = opts;
|
|
516
|
+
if (!configs || configs.length === 0) {
|
|
517
|
+
p.log.warn(getMessage(`${keyPrefix}.noneFound`, locale));
|
|
518
|
+
return true;
|
|
519
|
+
}
|
|
520
|
+
p.note(opts.configLines().join("\n"), getMessage(`${keyPrefix}.heading`, locale));
|
|
521
|
+
const progress = getMessage(`${keyPrefix}.executing`, locale, {
|
|
522
|
+
config: "all",
|
|
523
|
+
});
|
|
524
|
+
spin.start(progress);
|
|
525
|
+
let result;
|
|
526
|
+
try {
|
|
527
|
+
result = await opts.execute();
|
|
528
|
+
}
|
|
529
|
+
catch (err) {
|
|
530
|
+
p.log.error(getMessage(`${keyPrefix}.error`, locale, {
|
|
531
|
+
message: describeError(err, locale),
|
|
532
|
+
}));
|
|
533
|
+
return false;
|
|
534
|
+
}
|
|
535
|
+
finally {
|
|
536
|
+
spin.stop(progress);
|
|
537
|
+
}
|
|
538
|
+
showSetupResults(result, locale, keyPrefix);
|
|
539
|
+
if (result.aborted) {
|
|
540
|
+
p.log.warn(getMessage("deploy.sampleSetup.aborted", locale));
|
|
541
|
+
}
|
|
542
|
+
return result.success && !result.aborted;
|
|
380
543
|
};
|
|
381
|
-
const showSetupResults = (result, locale) => {
|
|
544
|
+
const showSetupResults = (result, locale, keyPrefix) => {
|
|
382
545
|
if (result.results.length === 0)
|
|
383
546
|
return;
|
|
384
547
|
const sectionHeader = getMessage("deploy.setup.resultHeader.section", locale);
|
|
@@ -405,10 +568,10 @@ const showSetupResults = (result, locale) => {
|
|
|
405
568
|
const lines = rows.map((r) => formatRow(r));
|
|
406
569
|
p.note([header, separator, ...lines].join("\n"));
|
|
407
570
|
if (result.success) {
|
|
408
|
-
p.log.success(getMessage(
|
|
571
|
+
p.log.success(getMessage(`${keyPrefix}.resultSuccess`, locale));
|
|
409
572
|
}
|
|
410
573
|
else {
|
|
411
|
-
p.log.warn(getMessage(
|
|
574
|
+
p.log.warn(getMessage(`${keyPrefix}.resultPartialFailure`, locale));
|
|
412
575
|
}
|
|
413
576
|
};
|
|
414
577
|
const logAndRethrow = (err, locale) => {
|
|
@@ -450,6 +613,16 @@ export const deployCommand = defineCommand({
|
|
|
450
613
|
type: "string",
|
|
451
614
|
description: "Deployment description",
|
|
452
615
|
},
|
|
616
|
+
"tenant-setup": {
|
|
617
|
+
type: "boolean",
|
|
618
|
+
description: "Bulk-run tenant environment setup after deploy without confirmation (non-zero exit on failure)",
|
|
619
|
+
default: false,
|
|
620
|
+
},
|
|
621
|
+
"sample-setup": {
|
|
622
|
+
type: "boolean",
|
|
623
|
+
description: "Bulk-run sample data setup after deploy without confirmation (non-zero exit on failure)",
|
|
624
|
+
default: false,
|
|
625
|
+
},
|
|
453
626
|
"non-interactive": {
|
|
454
627
|
type: "boolean",
|
|
455
628
|
description: "Non-interactive mode (no prompts; exits non-zero on failure)",
|
|
@@ -467,6 +640,8 @@ export const deployCommand = defineCommand({
|
|
|
467
640
|
file: lastFlagValue(args.file),
|
|
468
641
|
additionalFiles: allFlagValues(args["additional-file"]),
|
|
469
642
|
description: lastFlagValue(args.description),
|
|
643
|
+
tenantSetup: args["tenant-setup"],
|
|
644
|
+
sampleSetup: args["sample-setup"],
|
|
470
645
|
});
|
|
471
646
|
}
|
|
472
647
|
catch {
|
package/dist/core/types.d.ts
CHANGED
|
@@ -181,9 +181,14 @@ export type SetupConfigResponse = {
|
|
|
181
181
|
configNumber: number;
|
|
182
182
|
sections: string[];
|
|
183
183
|
};
|
|
184
|
+
export type SampleSetupConfigResponse = {
|
|
185
|
+
moduleId: string;
|
|
186
|
+
sections: string[];
|
|
187
|
+
};
|
|
184
188
|
export type DeploymentCreateResponse = DeploymentResponse & {
|
|
185
189
|
shortcutUrl?: string | null;
|
|
186
190
|
setupConfigs?: SetupConfigResponse[] | null;
|
|
191
|
+
sampleSetupConfigs?: SampleSetupConfigResponse[] | null;
|
|
187
192
|
};
|
|
188
193
|
export type SetupExecuteResultResponse = {
|
|
189
194
|
configNumber: number;
|
|
@@ -198,6 +203,20 @@ export type SetupExecuteResponse = {
|
|
|
198
203
|
totalCount: number;
|
|
199
204
|
results: SetupExecuteResultResponse[];
|
|
200
205
|
};
|
|
206
|
+
export type SampleSetupExecuteResultResponse = {
|
|
207
|
+
moduleId: string;
|
|
208
|
+
section: string;
|
|
209
|
+
label: string;
|
|
210
|
+
target: string;
|
|
211
|
+
success: boolean;
|
|
212
|
+
message?: string | null;
|
|
213
|
+
};
|
|
214
|
+
export type SampleSetupExecuteResponse = {
|
|
215
|
+
success: boolean;
|
|
216
|
+
aborted: boolean;
|
|
217
|
+
totalCount: number;
|
|
218
|
+
results: SampleSetupExecuteResultResponse[];
|
|
219
|
+
};
|
|
201
220
|
export type ApiSuccess<T> = {
|
|
202
221
|
error: false;
|
|
203
222
|
data: T;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { StagingResponse, DeploymentCreateResponse, DeployError, SetupExecuteResponse } from "../core/types.js";
|
|
1
|
+
import type { StagingResponse, DeploymentCreateResponse, DeployError, SetupExecuteResponse, SampleSetupExecuteResponse } from "../core/types.js";
|
|
2
2
|
type FetchFn = typeof globalThis.fetch;
|
|
3
3
|
export declare const makeDeployError: (kind: DeployError["kind"], extra?: {
|
|
4
4
|
status?: number;
|
|
@@ -15,6 +15,8 @@ export type ApiClient = {
|
|
|
15
15
|
createDeployment: (stagingId: string, archives: DeployArchive[], description?: string) => Promise<DeploymentCreateResponse>;
|
|
16
16
|
executeSetup: (stagingId: string) => Promise<SetupExecuteResponse>;
|
|
17
17
|
executeSetupConfig: (stagingId: string, moduleId: string, configNumber: number) => Promise<SetupExecuteResponse>;
|
|
18
|
+
executeSampleSetup: (stagingId: string) => Promise<SampleSetupExecuteResponse>;
|
|
19
|
+
executeSampleSetupConfig: (stagingId: string, moduleId: string) => Promise<SampleSetupExecuteResponse>;
|
|
18
20
|
};
|
|
19
21
|
export declare const createApiClient: (endpoint: string, apiKey: string, deps?: {
|
|
20
22
|
fetch?: FetchFn;
|
|
@@ -121,11 +121,29 @@ export const createApiClient = (endpoint, apiKey, deps = {}) => {
|
|
|
121
121
|
body: JSON.stringify({}),
|
|
122
122
|
});
|
|
123
123
|
};
|
|
124
|
+
const executeSampleSetup = async (stagingId) => {
|
|
125
|
+
const url = `${endpoint}${STAGING_PATH}/${encodeURIComponent(stagingId)}/sample/setup/execute`;
|
|
126
|
+
return request(url, {
|
|
127
|
+
method: "POST",
|
|
128
|
+
headers: { ...baseHeaders, "Content-Type": "application/json" },
|
|
129
|
+
body: JSON.stringify({}),
|
|
130
|
+
});
|
|
131
|
+
};
|
|
132
|
+
const executeSampleSetupConfig = async (stagingId, moduleId) => {
|
|
133
|
+
const url = `${endpoint}${STAGING_PATH}/${encodeURIComponent(stagingId)}/sample/setup/configs/${encodeURIComponent(moduleId)}/execute`;
|
|
134
|
+
return request(url, {
|
|
135
|
+
method: "POST",
|
|
136
|
+
headers: { ...baseHeaders, "Content-Type": "application/json" },
|
|
137
|
+
body: JSON.stringify({}),
|
|
138
|
+
});
|
|
139
|
+
};
|
|
124
140
|
return {
|
|
125
141
|
verifyToken,
|
|
126
142
|
listStagings,
|
|
127
143
|
createDeployment,
|
|
128
144
|
executeSetup,
|
|
129
145
|
executeSetupConfig,
|
|
146
|
+
executeSampleSetup,
|
|
147
|
+
executeSampleSetupConfig,
|
|
130
148
|
};
|
|
131
149
|
};
|
package/dist/i18n/en.js
CHANGED
|
@@ -199,4 +199,16 @@ export const messages = {
|
|
|
199
199
|
"deploy.setup.resultHeader.section": "Section",
|
|
200
200
|
"deploy.setup.resultHeader.target": "Target",
|
|
201
201
|
"deploy.setup.resultHeader.result": "Result",
|
|
202
|
+
"deploy.setup.noneFound": "No tenant environment setup configs were found in the deployed archives. Skipping execution.",
|
|
203
|
+
"deploy.setup.failedButDeployed": "Setup failed (the deployment itself succeeded).",
|
|
204
|
+
"deploy.sampleSetup.heading": "Sample Data Setup Configs",
|
|
205
|
+
"deploy.sampleSetup.confirm": "Run sample data setup?",
|
|
206
|
+
"deploy.sampleSetup.confirmAll": "Execute all?",
|
|
207
|
+
"deploy.sampleSetup.selectConfigs": "Select the configs to execute",
|
|
208
|
+
"deploy.sampleSetup.executing": "Running sample data setup... ({config})",
|
|
209
|
+
"deploy.sampleSetup.resultSuccess": "Sample data setup completed.",
|
|
210
|
+
"deploy.sampleSetup.resultPartialFailure": "Sample data setup partially failed.",
|
|
211
|
+
"deploy.sampleSetup.aborted": "The remaining setup steps were aborted due to a preprocessing failure.",
|
|
212
|
+
"deploy.sampleSetup.error": "An error occurred during sample data setup: {message}",
|
|
213
|
+
"deploy.sampleSetup.noneFound": "No sample data setup configs were found in the deployed archives. Skipping execution.",
|
|
202
214
|
};
|
package/dist/i18n/ja.js
CHANGED
|
@@ -199,4 +199,16 @@ export const messages = {
|
|
|
199
199
|
"deploy.setup.resultHeader.section": "セクション",
|
|
200
200
|
"deploy.setup.resultHeader.target": "対象",
|
|
201
201
|
"deploy.setup.resultHeader.result": "結果",
|
|
202
|
+
"deploy.setup.noneFound": "テナント環境セットアップ設定が資材内に見つかりませんでした。実行をスキップします。",
|
|
203
|
+
"deploy.setup.failedButDeployed": "セットアップに失敗しました(デプロイ自体は成功しています)。",
|
|
204
|
+
"deploy.sampleSetup.heading": "サンプルデータセットアップ設定",
|
|
205
|
+
"deploy.sampleSetup.confirm": "サンプルデータセットアップを実行しますか?",
|
|
206
|
+
"deploy.sampleSetup.confirmAll": "全て実行しますか?",
|
|
207
|
+
"deploy.sampleSetup.selectConfigs": "実行する設定を選択してください",
|
|
208
|
+
"deploy.sampleSetup.executing": "サンプルデータセットアップを実行しています... ({config})",
|
|
209
|
+
"deploy.sampleSetup.resultSuccess": "サンプルデータセットアップが完了しました。",
|
|
210
|
+
"deploy.sampleSetup.resultPartialFailure": "サンプルデータセットアップが一部失敗しました。",
|
|
211
|
+
"deploy.sampleSetup.aborted": "前処理の失敗により、以降のセットアップ処理は中断されました。",
|
|
212
|
+
"deploy.sampleSetup.error": "サンプルデータセットアップの実行中にエラーが発生しました: {message}",
|
|
213
|
+
"deploy.sampleSetup.noneFound": "サンプルデータセットアップ設定が資材内に見つかりませんでした。実行をスキップします。",
|
|
202
214
|
};
|
package/dist/i18n/zh_CN.js
CHANGED
|
@@ -199,4 +199,16 @@ export const messages = {
|
|
|
199
199
|
"deploy.setup.resultHeader.section": "部分",
|
|
200
200
|
"deploy.setup.resultHeader.target": "对象",
|
|
201
201
|
"deploy.setup.resultHeader.result": "结果",
|
|
202
|
+
"deploy.setup.noneFound": "在部署的资材中未找到租户环境配置。跳过执行。",
|
|
203
|
+
"deploy.setup.failedButDeployed": "配置执行失败(部署本身已成功)。",
|
|
204
|
+
"deploy.sampleSetup.heading": "示例数据配置设置",
|
|
205
|
+
"deploy.sampleSetup.confirm": "是否执行示例数据配置?",
|
|
206
|
+
"deploy.sampleSetup.confirmAll": "是否全部执行?",
|
|
207
|
+
"deploy.sampleSetup.selectConfigs": "请选择要执行的配置",
|
|
208
|
+
"deploy.sampleSetup.executing": "正在执行示例数据配置... ({config})",
|
|
209
|
+
"deploy.sampleSetup.resultSuccess": "示例数据配置已完成。",
|
|
210
|
+
"deploy.sampleSetup.resultPartialFailure": "示例数据配置部分失败。",
|
|
211
|
+
"deploy.sampleSetup.aborted": "由于预处理失败,后续配置处理已中断。",
|
|
212
|
+
"deploy.sampleSetup.error": "执行示例数据配置时发生错误: {message}",
|
|
213
|
+
"deploy.sampleSetup.noneFound": "在部署的资材中未找到示例数据配置。跳过执行。",
|
|
202
214
|
};
|