kintone-migrator 0.24.5 → 0.24.6

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/dist/index.mjs CHANGED
@@ -333,7 +333,8 @@ const SystemErrorCode = {
333
333
  NetworkError: "NETWORK_ERROR",
334
334
  StorageError: "STORAGE_ERROR",
335
335
  DocumentGenerationError: "DOCUMENT_GENERATION_ERROR",
336
- ExternalApiError: "EXTERNAL_API_ERROR"
336
+ ExternalApiError: "EXTERNAL_API_ERROR",
337
+ ExecutionError: "EXECUTION_ERROR"
337
338
  };
338
339
  var SystemError = class extends ApplicationError {
339
340
  name = "SystemError";
@@ -1017,7 +1018,7 @@ function hasControlChars(s) {
1017
1018
  return false;
1018
1019
  }
1019
1020
  /** Replaces control characters (0x00–0x1f, 0x7f) with escaped `\\xNN` representation for safe display. */
1020
- function sanitizeForDisplay(s) {
1021
+ function sanitizeForDisplay$1(s) {
1021
1022
  let result = "";
1022
1023
  for (let i = 0; i < s.length; i++) {
1023
1024
  const ch = s.charCodeAt(i);
@@ -1039,7 +1040,7 @@ function hasInvalidFieldCodeChars(code) {
1039
1040
  }
1040
1041
  const FieldCode = { create: (code) => {
1041
1042
  if (code.length === 0) throw new BusinessRuleError(FormSchemaErrorCode.FsEmptyFieldCode, "Field code cannot be empty");
1042
- if (hasInvalidFieldCodeChars(code)) throw new BusinessRuleError(FormSchemaErrorCode.FsInvalidFieldCode, `Field code "${sanitizeForDisplay(code)}" contains invalid characters`);
1043
+ if (hasInvalidFieldCodeChars(code)) throw new BusinessRuleError(FormSchemaErrorCode.FsInvalidFieldCode, `Field code "${sanitizeForDisplay$1(code)}" contains invalid characters`);
1043
1044
  return code;
1044
1045
  } };
1045
1046
 
@@ -1885,7 +1886,7 @@ function hasInvalidAppNameChars(name) {
1885
1886
  }
1886
1887
  const AppName = { create: (name) => {
1887
1888
  if (name.length === 0) throw new BusinessRuleError(ProjectConfigErrorCode.PcEmptyAppName, "App name cannot be empty");
1888
- if (hasInvalidAppNameChars(name)) throw new BusinessRuleError(ProjectConfigErrorCode.PcInvalidAppName, `App name "${sanitizeForDisplay(name)}" contains invalid characters (path separators or control characters are not allowed)`);
1889
+ if (hasInvalidAppNameChars(name)) throw new BusinessRuleError(ProjectConfigErrorCode.PcInvalidAppName, `App name "${sanitizeForDisplay$1(name)}" contains invalid characters (path separators or control characters are not allowed)`);
1889
1890
  if (name === "." || name === "..") throw new BusinessRuleError(ProjectConfigErrorCode.PcInvalidAppName, `App name "${name}" is not allowed (reserved path component)`);
1890
1891
  return name;
1891
1892
  } };
@@ -2091,14 +2092,17 @@ function buildAppFilePaths(appName, baseDir) {
2091
2092
  };
2092
2093
  }
2093
2094
 
2094
- //#endregion
2095
- //#region src/core/application/formSchema/deployApp.ts
2096
- async function deployApp({ container }) {
2097
- await container.appDeployer.deploy();
2098
- }
2099
-
2100
2095
  //#endregion
2101
2096
  //#region src/cli/handleError.ts
2097
+ /**
2098
+ * Log error details without terminating the process.
2099
+ * Use this in contexts where multiple errors may be reported (e.g. multi-app results).
2100
+ *
2101
+ * Note: This function intentionally does NOT show the "Set VERBOSE=1 ..." hint.
2102
+ * The hint is only shown by `handleCliError`, which is the top-level CLI handler.
2103
+ * `logError` is used for per-app error reporting within multi-app runs where the
2104
+ * hint would be noisy if repeated for each failure.
2105
+ */
2102
2106
  function logError(error) {
2103
2107
  if (isBusinessRuleError(error)) {
2104
2108
  p.log.error(`[BusinessRuleError] ${error.code}: ${error.message}`);
@@ -2107,11 +2111,14 @@ function logError(error) {
2107
2111
  }
2108
2112
  if (isValidationError(error)) {
2109
2113
  p.log.error(`[ValidationError] ${error.code}: ${error.message}`);
2114
+ p.log.warn("Hint: Please check your input values and configuration.");
2110
2115
  logErrorDetails(error);
2111
2116
  return;
2112
2117
  }
2113
2118
  if (isSystemError(error)) {
2114
2119
  p.log.error(`[SystemError] ${error.code}: ${error.message}`);
2120
+ const hint = systemErrorHints[error.code];
2121
+ if (hint) p.log.warn(`Hint: ${hint}`);
2115
2122
  logErrorDetails(error);
2116
2123
  return;
2117
2124
  }
@@ -2151,42 +2158,83 @@ function logError(error) {
2151
2158
  }
2152
2159
  p.log.error(`[Error] Unexpected error occurred: ${String(error)}`);
2153
2160
  }
2161
+ /**
2162
+ * Log error details and terminate the process with exit code 1.
2163
+ * Use this as the top-level error handler in CLI command `run` functions.
2164
+ */
2154
2165
  function handleCliError(error) {
2155
2166
  logError(error);
2167
+ if (!isVerbose()) p.log.info("Set VERBOSE=1 for full stack traces.");
2156
2168
  p.outro("Failed.");
2157
2169
  process.exit(1);
2158
2170
  }
2159
2171
  function formatErrorForDisplay(error) {
2160
- if (error instanceof Error) return error.message;
2161
- if (typeof error === "object" && error !== null) return JSON.stringify(error, null, 2);
2162
- return String(error);
2172
+ if (error instanceof Error) return sanitizeString(error.message);
2173
+ if (typeof error === "object" && error !== null) return JSON.stringify(sanitizeForDisplay(error), null, 2);
2174
+ return sanitizeString(String(error));
2175
+ }
2176
+ const systemErrorHints = {
2177
+ NETWORK_ERROR: "Please check your network connection and kintone domain.",
2178
+ EXTERNAL_API_ERROR: "The kintone API returned an unexpected error. Please retry or check the API status.",
2179
+ STORAGE_ERROR: "Failed to read/write a local file. Please check file permissions.",
2180
+ EXECUTION_ERROR: "One or more apps failed during execution. Check the individual errors above."
2181
+ };
2182
+ const SENSITIVE_KEYS = /^(authorization|apitoken|api-token|api_token|apikey|api-key|api_key|password|secret|credentials|x-cybozu-authorization)$/i;
2183
+ const SENSITIVE_VALUE_PATTERNS = /(?<=(?:password|apiToken|api[_-]?token|api[_-]?key|secret|credentials)[=:]\s*)\S+/gi;
2184
+ const AUTHORIZATION_VALUE_PATTERN = /(?<=authorization[=:]\s*)\S+(?:\s+\S+)?/gi;
2185
+ function sanitizeString(value) {
2186
+ return value.replace(AUTHORIZATION_VALUE_PATTERN, "[REDACTED]").replace(SENSITIVE_VALUE_PATTERNS, "[REDACTED]");
2187
+ }
2188
+ function sanitizeForDisplay(obj, seen = /* @__PURE__ */ new WeakSet()) {
2189
+ if (typeof obj !== "object" || obj === null) return obj;
2190
+ if (seen.has(obj)) return "[Circular]";
2191
+ seen.add(obj);
2192
+ if (Array.isArray(obj)) return obj.map((item) => sanitizeForDisplay(item, seen));
2193
+ const result = {};
2194
+ if (obj instanceof Error) {
2195
+ result.message = sanitizeString(obj.message);
2196
+ if (obj.stack) result.stack = sanitizeString(obj.stack);
2197
+ }
2198
+ for (const [key, value] of Object.entries(obj)) if (SENSITIVE_KEYS.test(key)) result[key] = "[REDACTED]";
2199
+ else if (typeof value === "object" && value !== null) result[key] = sanitizeForDisplay(value, seen);
2200
+ else if (typeof value === "string") result[key] = sanitizeString(value);
2201
+ else result[key] = value;
2202
+ return result;
2203
+ }
2204
+ function isVerbose() {
2205
+ return process.env.VERBOSE === "1" || process.env.VERBOSE === "true" || process.env.VERBOSE === "yes";
2163
2206
  }
2164
2207
  function logErrorDetails(error) {
2165
2208
  if (error.cause) {
2209
+ const seen = /* @__PURE__ */ new WeakSet();
2210
+ seen.add(error);
2166
2211
  p.log.warn(`Cause: ${formatErrorForDisplay(error.cause)}`);
2167
- logNestedErrorProperties(error.cause);
2212
+ logNestedErrorProperties(error.cause, seen);
2168
2213
  }
2169
- if (error.stack) p.log.warn(`Stack: ${error.stack}`);
2214
+ if (isVerbose() && error.stack) p.log.warn(`Stack: ${error.stack}`);
2170
2215
  }
2171
- function logNestedErrorProperties(target) {
2216
+ function logNestedErrorProperties(target, seen = /* @__PURE__ */ new WeakSet()) {
2172
2217
  if (typeof target !== "object" || target === null) return;
2218
+ if (seen.has(target)) return;
2219
+ seen.add(target);
2173
2220
  const record = target;
2174
2221
  if (record.error instanceof Error) {
2175
- p.log.warn(` Error: ${record.error.message}`);
2176
- const innerRecord = record.error;
2177
- if (innerRecord.errors && typeof innerRecord.errors === "object") p.log.warn(` Details: ${JSON.stringify(innerRecord.errors, null, 2)}`);
2222
+ p.log.warn(` Error: ${sanitizeString(record.error.message)}`);
2223
+ if (hasObjectProperty(record.error, "errors")) p.log.warn(` Details: ${JSON.stringify(sanitizeForDisplay(record.error.errors), null, 2)}`);
2178
2224
  }
2179
2225
  if (Array.isArray(record.errors)) for (const e of record.errors) if (e instanceof Error) {
2180
- p.log.warn(` - ${e.message}`);
2181
- const inner = e;
2182
- if (inner.errors && typeof inner.errors === "object") p.log.warn(` ${JSON.stringify(inner.errors, null, 2)}`);
2183
- } else p.log.warn(` - ${JSON.stringify(e, null, 2)}`);
2184
- else if (record.errors && typeof record.errors === "object" && !("error" in record)) p.log.warn(`Details: ${JSON.stringify(record.errors, null, 2)}`);
2226
+ p.log.warn(` - ${sanitizeString(e.message)}`);
2227
+ if (hasObjectProperty(e, "errors")) p.log.warn(` ${JSON.stringify(sanitizeForDisplay(e.errors), null, 2)}`);
2228
+ } else p.log.warn(` - ${JSON.stringify(sanitizeForDisplay(e), null, 2)}`);
2229
+ else if (record.errors && typeof record.errors === "object" && !(record.error instanceof Error)) p.log.warn(`Details: ${JSON.stringify(sanitizeForDisplay(record.errors), null, 2)}`);
2185
2230
  if (target instanceof Error && target.cause) {
2186
2231
  p.log.warn(` Caused by: ${formatErrorForDisplay(target.cause)}`);
2187
- logNestedErrorProperties(target.cause);
2232
+ logNestedErrorProperties(target.cause, seen);
2188
2233
  }
2189
2234
  }
2235
+ function hasObjectProperty(obj, key) {
2236
+ return key in obj && typeof obj[key] === "object" && obj[key] !== null;
2237
+ }
2190
2238
  function isApplicationError(error) {
2191
2239
  return error instanceof ApplicationError;
2192
2240
  }
@@ -2299,40 +2347,30 @@ async function confirmAndDeploy(containers, skipConfirm, successMessage = "Deplo
2299
2347
  if (!skipConfirm) {
2300
2348
  const shouldDeploy = await p.confirm({ message: "Deploy to production?" });
2301
2349
  if (p.isCancel(shouldDeploy) || !shouldDeploy) {
2302
- p.log.warn("Applied to preview, but not deployed to production.");
2350
+ const appNames = containers.map((c) => c.appName).filter((n) => n != null);
2351
+ if (appNames.length > 0) p.log.warn(`Applied to preview, but not deployed to production: ${appNames.join(", ")}`);
2352
+ else p.log.warn("Applied to preview, but not deployed to production.");
2303
2353
  return;
2304
2354
  }
2305
2355
  }
2306
2356
  const ds = p.spinner();
2307
2357
  ds.start("Deploying to production...");
2358
+ const deployedNames = [];
2308
2359
  try {
2309
- for (const container of containers) await container.appDeployer.deploy();
2360
+ for (const container of containers) {
2361
+ await container.appDeployer.deploy();
2362
+ if (container.appName) deployedNames.push(container.appName);
2363
+ }
2310
2364
  ds.stop("Deployed to production.");
2311
2365
  } catch (error) {
2312
2366
  ds.stop("Deployment failed.");
2367
+ if (deployedNames.length > 0) p.log.warn(`${deployedNames.length}/${containers.length} app(s) were deployed before the failure: ${deployedNames.join(", ")}`);
2368
+ const notDeployed = containers.map((c) => c.appName).filter((n) => n != null).filter((n) => !deployedNames.includes(n));
2369
+ if (notDeployed.length > 0) p.log.warn(`Not deployed: ${notDeployed.join(", ")}`);
2313
2370
  throw error;
2314
2371
  }
2315
2372
  p.log.success(successMessage);
2316
2373
  }
2317
- async function promptDeploy(container, skipConfirm) {
2318
- if (!skipConfirm) {
2319
- const shouldDeploy = await p.confirm({ message: "Deploy to production?" });
2320
- if (p.isCancel(shouldDeploy) || !shouldDeploy) {
2321
- p.log.warn("Applied to preview, but not deployed to production.");
2322
- return;
2323
- }
2324
- }
2325
- const ds = p.spinner();
2326
- ds.start("Deploying to production...");
2327
- try {
2328
- await deployApp({ container });
2329
- ds.stop("Deployment complete.");
2330
- } catch (error) {
2331
- ds.stop("Deployment failed.");
2332
- throw error;
2333
- }
2334
- p.log.success("Deployed to production.");
2335
- }
2336
2374
 
2337
2375
  //#endregion
2338
2376
  //#region src/cli/projectConfig.ts
@@ -2438,10 +2476,30 @@ async function routeMultiApp(values, handlers) {
2438
2476
  }
2439
2477
  await handlers.multiApp(target.plan, target.config);
2440
2478
  }
2479
+ /**
2480
+ * High-level multi-app executor that prints app headers before each executor call.
2481
+ * Use this when the executor does not print its own headers (most apply commands).
2482
+ * Delegates to `runMultiAppWithFailCheck` for execution and failure handling.
2483
+ */
2484
+ async function runMultiAppWithHeaders(plan, executor, successMessage) {
2485
+ await runMultiAppWithFailCheck(plan, async (app) => {
2486
+ printAppHeader(app.name, app.appId);
2487
+ await executor(app);
2488
+ }, successMessage);
2489
+ }
2490
+ /**
2491
+ * Low-level multi-app executor that runs apps, prints results, and throws on failure.
2492
+ * Use this directly when the executor needs full control over output (e.g. schema migrate
2493
+ * prints its own headers and performs per-app deploy inside the executor callback).
2494
+ */
2441
2495
  async function runMultiAppWithFailCheck(plan, executor, successMessage) {
2442
2496
  const multiResult = await executeMultiApp(plan, executor);
2443
2497
  printMultiAppResult(multiResult);
2444
- if (multiResult.hasFailure) throw new SystemError(SystemErrorCode.ExternalApiError, "Execution stopped due to failure.");
2498
+ if (multiResult.hasFailure) {
2499
+ const succeededCount = multiResult.results.filter((r) => r.status === "succeeded").length;
2500
+ if (succeededCount > 0) p.log.warn(`${succeededCount} app(s) were applied to preview but may not have been deployed. Check their status in kintone.`);
2501
+ throw new SystemError(SystemErrorCode.ExecutionError, "Execution stopped due to failure.");
2502
+ }
2445
2503
  if (successMessage) p.log.success(successMessage);
2446
2504
  }
2447
2505
  async function configFileExists(configPath) {
@@ -2568,12 +2626,13 @@ var apply_default$12 = define({
2568
2626
  },
2569
2627
  multiApp: async (plan, projectConfig) => {
2570
2628
  const containers = [];
2571
- await runMultiAppWithFailCheck(plan, async (app) => {
2572
- const config = resolveActionAppContainerConfig(app, projectConfig, values);
2573
- printAppHeader(app.name, app.appId);
2574
- const container = await runAction(config);
2575
- containers.push(container);
2576
- }, void 0);
2629
+ await runMultiAppWithHeaders(plan, async (app) => {
2630
+ const container = await runAction(resolveActionAppContainerConfig(app, projectConfig, values));
2631
+ containers.push({
2632
+ appDeployer: container.appDeployer,
2633
+ appName: app.name
2634
+ });
2635
+ });
2577
2636
  await confirmAndDeploy(containers, skipConfirm);
2578
2637
  }
2579
2638
  });
@@ -3110,12 +3169,13 @@ var apply_default$11 = define({
3110
3169
  },
3111
3170
  multiApp: async (plan, projectConfig) => {
3112
3171
  const containers = [];
3113
- await runMultiAppWithFailCheck(plan, async (app) => {
3114
- const config = resolveAdminNotesAppContainerConfig(app, projectConfig, values);
3115
- printAppHeader(app.name, app.appId);
3116
- const container = await runAdminNotes(config);
3117
- containers.push(container);
3118
- }, void 0);
3172
+ await runMultiAppWithHeaders(plan, async (app) => {
3173
+ const container = await runAdminNotes(resolveAdminNotesAppContainerConfig(app, projectConfig, values));
3174
+ containers.push({
3175
+ appDeployer: container.appDeployer,
3176
+ appName: app.name
3177
+ });
3178
+ });
3119
3179
  await confirmAndDeploy(containers, skipConfirm);
3120
3180
  }
3121
3181
  });
@@ -3472,12 +3532,13 @@ var apply_default$10 = define({
3472
3532
  },
3473
3533
  multiApp: async (plan, projectConfig) => {
3474
3534
  const containers = [];
3475
- await runMultiAppWithFailCheck(plan, async (app) => {
3476
- const config = resolveAppAclAppContainerConfig(app, projectConfig, values);
3477
- printAppHeader(app.name, app.appId);
3478
- const container = await runAppAcl(config);
3479
- containers.push(container);
3480
- }, void 0);
3535
+ await runMultiAppWithHeaders(plan, async (app) => {
3536
+ const container = await runAppAcl(resolveAppAclAppContainerConfig(app, projectConfig, values));
3537
+ containers.push({
3538
+ appDeployer: container.appDeployer,
3539
+ appName: app.name
3540
+ });
3541
+ });
3481
3542
  await confirmAndDeploy(containers, skipConfirm);
3482
3543
  }
3483
3544
  });
@@ -4099,12 +4160,13 @@ var apply_default$9 = define({
4099
4160
  },
4100
4161
  multiApp: async (plan, projectConfig) => {
4101
4162
  const containers = [];
4102
- await runMultiAppWithFailCheck(plan, async (app) => {
4103
- const config = resolveCustomizeAppConfig(app, projectConfig, values);
4104
- printAppHeader(app.name, app.appId);
4105
- const container = await applyCustomizationForApp(config);
4106
- containers.push(container);
4107
- }, void 0);
4163
+ await runMultiAppWithHeaders(plan, async (app) => {
4164
+ const container = await applyCustomizationForApp(resolveCustomizeAppConfig(app, projectConfig, values));
4165
+ containers.push({
4166
+ appDeployer: container.appDeployer,
4167
+ appName: app.name
4168
+ });
4169
+ });
4108
4170
  await confirmAndDeploy(containers, skipConfirm, "Customization applied and deployed successfully.");
4109
4171
  }
4110
4172
  });
@@ -4458,12 +4520,13 @@ var apply_default$8 = define({
4458
4520
  },
4459
4521
  multiApp: async (plan, projectConfig) => {
4460
4522
  const containers = [];
4461
- await runMultiAppWithFailCheck(plan, async (app) => {
4462
- const config = resolveFieldAclAppContainerConfig(app, projectConfig, values);
4463
- printAppHeader(app.name, app.appId);
4464
- const container = await runFieldAcl(config);
4465
- containers.push(container);
4466
- }, void 0);
4523
+ await runMultiAppWithHeaders(plan, async (app) => {
4524
+ const container = await runFieldAcl(resolveFieldAclAppContainerConfig(app, projectConfig, values));
4525
+ containers.push({
4526
+ appDeployer: container.appDeployer,
4527
+ appName: app.name
4528
+ });
4529
+ });
4467
4530
  await confirmAndDeploy(containers, skipConfirm);
4468
4531
  }
4469
4532
  });
@@ -6676,7 +6739,7 @@ var init_default = define({
6676
6739
  try {
6677
6740
  const values = ctx.values;
6678
6741
  const spaceId = values["space-id"];
6679
- if (!/^\d+$/.test(spaceId)) throw new ValidationError(ValidationErrorCode.InvalidInput, `Invalid space ID: "${spaceId}" (must be a numeric value)`);
6742
+ if (!/^[1-9]\d*$/.test(spaceId)) throw new ValidationError(ValidationErrorCode.InvalidInput, `Invalid space ID: "${spaceId}" (must be a positive integer, e.g. 1, 42, 100)`);
6680
6743
  const kintoneDomain = values.domain ?? process.env.KINTONE_DOMAIN;
6681
6744
  if (!kintoneDomain) throw new ValidationError(ValidationErrorCode.InvalidInput, "Missing required configuration:\n KINTONE_DOMAIN is required");
6682
6745
  const apiToken = values["api-token"] ?? process.env.KINTONE_API_TOKEN;
@@ -6979,12 +7042,13 @@ var apply_default$7 = define({
6979
7042
  },
6980
7043
  multiApp: async (plan, projectConfig) => {
6981
7044
  const containers = [];
6982
- await runMultiAppWithFailCheck(plan, async (app) => {
6983
- const config = resolveNotificationAppContainerConfig(app, projectConfig, values);
6984
- printAppHeader(app.name, app.appId);
6985
- const container = await runNotification(config);
6986
- containers.push(container);
6987
- }, void 0);
7045
+ await runMultiAppWithHeaders(plan, async (app) => {
7046
+ const container = await runNotification(resolveNotificationAppContainerConfig(app, projectConfig, values));
7047
+ containers.push({
7048
+ appDeployer: container.appDeployer,
7049
+ appName: app.name
7050
+ });
7051
+ });
6988
7052
  await confirmAndDeploy(containers, skipConfirm);
6989
7053
  }
6990
7054
  });
@@ -7398,12 +7462,13 @@ var apply_default$6 = define({
7398
7462
  },
7399
7463
  multiApp: async (plan, projectConfig) => {
7400
7464
  const containers = [];
7401
- await runMultiAppWithFailCheck(plan, async (app) => {
7402
- const config = resolvePluginAppContainerConfig(app, projectConfig, values);
7403
- printAppHeader(app.name, app.appId);
7404
- const container = await runPlugin(config);
7405
- containers.push(container);
7406
- }, void 0);
7465
+ await runMultiAppWithHeaders(plan, async (app) => {
7466
+ const container = await runPlugin(resolvePluginAppContainerConfig(app, projectConfig, values));
7467
+ containers.push({
7468
+ appDeployer: container.appDeployer,
7469
+ appName: app.name
7470
+ });
7471
+ });
7407
7472
  await confirmAndDeploy(containers, skipConfirm);
7408
7473
  }
7409
7474
  });
@@ -7706,12 +7771,13 @@ var apply_default$5 = define({
7706
7771
  },
7707
7772
  multiApp: async (plan, projectConfig) => {
7708
7773
  const containers = [];
7709
- await runMultiAppWithFailCheck(plan, async (app) => {
7710
- const config = resolveProcessAppContainerConfig(app, projectConfig, values);
7711
- printAppHeader(app.name, app.appId);
7712
- const container = await runProcessApply(config);
7713
- containers.push(container);
7714
- }, void 0);
7774
+ await runMultiAppWithHeaders(plan, async (app) => {
7775
+ const container = await runProcessApply(resolveProcessAppContainerConfig(app, projectConfig, values));
7776
+ containers.push({
7777
+ appDeployer: container.appDeployer,
7778
+ appName: app.name
7779
+ });
7780
+ });
7715
7781
  await confirmAndDeploy(containers, skipConfirm);
7716
7782
  }
7717
7783
  });
@@ -8029,12 +8095,13 @@ var apply_default$4 = define({
8029
8095
  },
8030
8096
  multiApp: async (plan, projectConfig) => {
8031
8097
  const containers = [];
8032
- await runMultiAppWithFailCheck(plan, async (app) => {
8033
- const config = resolveRecordAclAppContainerConfig(app, projectConfig, values);
8034
- printAppHeader(app.name, app.appId);
8035
- const container = await runRecordAcl(config);
8036
- containers.push(container);
8037
- }, void 0);
8098
+ await runMultiAppWithHeaders(plan, async (app) => {
8099
+ const container = await runRecordAcl(resolveRecordAclAppContainerConfig(app, projectConfig, values));
8100
+ containers.push({
8101
+ appDeployer: container.appDeployer,
8102
+ appName: app.name
8103
+ });
8104
+ });
8038
8105
  await confirmAndDeploy(containers, skipConfirm);
8039
8106
  }
8040
8107
  });
@@ -8415,12 +8482,13 @@ var apply_default$3 = define({
8415
8482
  },
8416
8483
  multiApp: async (plan, projectConfig) => {
8417
8484
  const containers = [];
8418
- await runMultiAppWithFailCheck(plan, async (app) => {
8419
- const config = resolveReportAppContainerConfig(app, projectConfig, values);
8420
- printAppHeader(app.name, app.appId);
8421
- const container = await runReport(config);
8422
- containers.push(container);
8423
- }, void 0);
8485
+ await runMultiAppWithHeaders(plan, async (app) => {
8486
+ const container = await runReport(resolveReportAppContainerConfig(app, projectConfig, values));
8487
+ containers.push({
8488
+ appDeployer: container.appDeployer,
8489
+ appName: app.name
8490
+ });
8491
+ });
8424
8492
  await confirmAndDeploy(containers, skipConfirm);
8425
8493
  }
8426
8494
  });
@@ -9205,7 +9273,7 @@ async function detectDiff({ container }) {
9205
9273
  //#region src/cli/commands/schema/diff.ts
9206
9274
  async function runDiff(container) {
9207
9275
  const s = p.spinner();
9208
- s.start("Fetching form schema...");
9276
+ s.start("Comparing schema...");
9209
9277
  let result;
9210
9278
  try {
9211
9279
  result = await detectDiff({ container });
@@ -9213,7 +9281,7 @@ async function runDiff(container) {
9213
9281
  s.stop("Comparison failed.");
9214
9282
  throw error;
9215
9283
  }
9216
- s.stop("Form schema fetched.");
9284
+ s.stop("Comparison complete.");
9217
9285
  printDiffResult(result);
9218
9286
  }
9219
9287
  var diff_default$2 = define({
@@ -9379,6 +9447,12 @@ var dump_default = define({
9379
9447
  }
9380
9448
  });
9381
9449
 
9450
+ //#endregion
9451
+ //#region src/core/application/formSchema/deployApp.ts
9452
+ async function deployApp({ container }) {
9453
+ await container.appDeployer.deploy();
9454
+ }
9455
+
9382
9456
  //#endregion
9383
9457
  //#region src/core/domain/formSchema/services/subtableFieldSplitter.ts
9384
9458
  function splitSubtableInnerFields(desired, current) {
@@ -9618,7 +9692,7 @@ async function runSingleMigrate(container, skipConfirm) {
9618
9692
  await executeMigration({ container });
9619
9693
  ms.stop("Migration applied.");
9620
9694
  p.log.success("Migration completed successfully.");
9621
- await promptDeploy(container, skipConfirm);
9695
+ await confirmAndDeploy([container], skipConfirm);
9622
9696
  }
9623
9697
  var migrate_default = define({
9624
9698
  name: "migrate",
@@ -9667,7 +9741,7 @@ var migrate_default = define({
9667
9741
  }
9668
9742
  await runMultiAppWithFailCheck(plan, async (app) => {
9669
9743
  const entry = appContainers.find((a) => a.app.name === app.name);
9670
- if (!entry) return;
9744
+ if (!entry) throw new SystemError(SystemErrorCode.InternalServerError, `App container not found for "${app.name}"`);
9671
9745
  const { container, hasChanges } = entry;
9672
9746
  printAppHeader(app.name, app.appId);
9673
9747
  if (!hasChanges) {
@@ -9776,7 +9850,7 @@ async function runSingleOverride(container, skipConfirm) {
9776
9850
  await forceOverrideForm({ container });
9777
9851
  s.stop("Force override applied.");
9778
9852
  p.log.success("Force override completed successfully.");
9779
- await promptDeploy(container, skipConfirm);
9853
+ await confirmAndDeploy([container], skipConfirm);
9780
9854
  }
9781
9855
  async function runSingleReset(container, skipConfirm) {
9782
9856
  p.log.warn(`${pc.bold(pc.red("WARNING:"))} This will delete ALL custom fields, resetting the form to empty.`);
@@ -9792,7 +9866,7 @@ async function runSingleReset(container, skipConfirm) {
9792
9866
  await resetForm({ container });
9793
9867
  s.stop("Form reset applied.");
9794
9868
  p.log.success("Reset completed successfully.");
9795
- await promptDeploy(container, skipConfirm);
9869
+ await confirmAndDeploy([container], skipConfirm);
9796
9870
  }
9797
9871
  var override_default = define({
9798
9872
  name: "override",
@@ -10505,12 +10579,13 @@ var apply_default$1 = define({
10505
10579
  },
10506
10580
  multiApp: async (plan, projectConfig) => {
10507
10581
  const containers = [];
10508
- await runMultiAppWithFailCheck(plan, async (app) => {
10509
- const config = resolveSettingsAppContainerConfig(app, projectConfig, values);
10510
- printAppHeader(app.name, app.appId);
10511
- const container = await runSettings(config);
10512
- containers.push(container);
10513
- }, "All general settings applied successfully.");
10582
+ await runMultiAppWithHeaders(plan, async (app) => {
10583
+ const container = await runSettings(resolveSettingsAppContainerConfig(app, projectConfig, values));
10584
+ containers.push({
10585
+ appDeployer: container.appDeployer,
10586
+ appName: app.name
10587
+ });
10588
+ });
10514
10589
  await confirmAndDeploy(containers, skipConfirm);
10515
10590
  }
10516
10591
  });
@@ -10792,12 +10867,13 @@ var apply_default = define({
10792
10867
  },
10793
10868
  multiApp: async (plan, projectConfig) => {
10794
10869
  const containers = [];
10795
- await runMultiAppWithFailCheck(plan, async (app) => {
10796
- const config = resolveViewAppContainerConfig(app, projectConfig, values);
10797
- printAppHeader(app.name, app.appId);
10798
- const container = await runView(config);
10799
- containers.push(container);
10800
- }, void 0);
10870
+ await runMultiAppWithHeaders(plan, async (app) => {
10871
+ const container = await runView(resolveViewAppContainerConfig(app, projectConfig, values));
10872
+ containers.push({
10873
+ appDeployer: container.appDeployer,
10874
+ appName: app.name
10875
+ });
10876
+ });
10801
10877
  await confirmAndDeploy(containers, skipConfirm);
10802
10878
  }
10803
10879
  });