@tailor-platform/sdk 1.60.1 → 1.60.3

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.
@@ -2,8 +2,8 @@
2
2
 
3
3
  import { J as PATScope, O as CustomDomainStatus, P as FunctionExecution_Type, V as AuthInvokerSchema, _ as userAgent, a as fetchAll, c as fetchPlatformMachineUserToken, d as initOAuth2Client, f as initOperatorClient, l as fetchUserInfo, r as closeConnectionPool, s as fetchPaged } from "../client-W5P4NYYX.mjs";
4
4
  import { n as logger, r as styles } from "../logger-DpJyJvNz.mjs";
5
- import { $ as listCommand$10, An as toPageDirection, At as startCommand, B as logBetaWarning, C as listCommand$13, Cn as commonArgs, Dn as isVerbose, Dt as jobsCommand, E as resumeCommand, En as deploymentArgs, F as writeDbTypesFile, Gt as parseMigrationLabelNumber, H as removeCommand$1, Ht as executeScript, I as getConfiguredEditorCommand, K as treeCommand, L as openInConfiguredEditor, Lt as functionExecutionStatusToString, Mt as getCommand$6, N as generateCommand$1, O as listCommand$12, On as pagedLogArgs, P as generateMigrationScript, Pt as executionsCommand, Rt as formatKeyValueTable, Sn as defineAppCommand, St as triggerCommand, T as healthCommand, Tn as confirmationArgs, U as updateCommand$3, Vt as deploy, Y as getCommand$5, Yt as INITIAL_SCHEMA_NUMBER, Z as updateCommand$2, _n as generateUserTypes, at as createCommand$3, b as createCommand$4, c as listCommand$14, cn as reconstructSnapshotFromMigrations, f as restoreCommand, ft as tokenCommand, g as getCommand$7, gn as PluginManager, gt as listCommand$7, hn as sdkNameLabelKey, ht as generate, i as updateCommand$4, in as getMigrationFiles, j as truncateCommand, jn as workspaceArgs, kn as paginationArgs, ln as formatMigrationNumber, lt as getCommand$3, m as listCommand$15, mn as resourceTrn, o as removeCommand, on as isValidMigrationNumber, pn as getNamespacesWithMigrations, pt as listCommand$8, q as listCommand$11, r as queryCommand, rn as getMigrationFilePath, rt as deleteCommand$3, sn as loadDiff, st as listCommand$9, t as isNativeTypeScriptRuntime, tt as getCommand$4, u as inviteCommand, v as deleteCommand$4, vn as prompt, vt as getCommand$2, wn as configArg, wt as listCommand$6, xn as assertWritable, xt as webhookCommand, yn as apiCommand, z as showCommand, zt as getCommand$1 } from "../runtime-BvKGwZeF.mjs";
6
- import { A as readPlatformConfig, D as loadAccessToken, E as fetchLatestToken, M as saveUserTokens, N as writePlatformConfig, S as hashContent, T as deleteUserTokens, _ as composeFunctionTreeshakeOptions, a as WorkflowJobSchema, g as platformBundleDefinePlugin, i as resolveInlineSourcemap, j as resolveTokens, k as loadWorkspaceId, l as ExecutorSchema, o as ResolverSchema, t as defineApplication, u as INVOKER_EXPR, v as createLogLevelTreeshakeOptions, w as loadConfig, x as getDistDir, y as resolveBundleLogLevel } from "../application-FnWOxBk7.mjs";
5
+ import { $ as listCommand$10, An as toPageDirection, At as startCommand, B as logBetaWarning, C as listCommand$13, Cn as commonArgs, Dn as isVerbose, Dt as jobsCommand, E as resumeCommand, En as deploymentArgs, F as writeDbTypesFile, Gt as parseMigrationLabelNumber, H as removeCommand$1, Ht as executeScript, I as getConfiguredEditorCommand, K as treeCommand, L as openInConfiguredEditor, Lt as functionExecutionStatusToString, Mt as getCommand$6, N as generateCommand$1, O as listCommand$12, On as pagedLogArgs, P as generateMigrationScript, Pt as executionsCommand, Rt as formatKeyValueTable, Sn as defineAppCommand, St as triggerCommand, T as healthCommand, Tn as confirmationArgs, U as updateCommand$3, Vt as deploy, Y as getCommand$5, Yt as INITIAL_SCHEMA_NUMBER, Z as updateCommand$2, _n as generateUserTypes, at as createCommand$3, b as createCommand$4, c as listCommand$14, cn as reconstructSnapshotFromMigrations, f as restoreCommand, ft as tokenCommand, g as getCommand$7, gn as PluginManager, gt as listCommand$7, hn as sdkNameLabelKey, ht as generate, i as updateCommand$4, in as getMigrationFiles, j as truncateCommand, jn as workspaceArgs, kn as paginationArgs, ln as formatMigrationNumber, lt as getCommand$3, m as listCommand$15, mn as resourceTrn, o as removeCommand, on as isValidMigrationNumber, pn as getNamespacesWithMigrations, pt as listCommand$8, q as listCommand$11, r as queryCommand, rn as getMigrationFilePath, rt as deleteCommand$3, sn as loadDiff, st as listCommand$9, t as isNativeTypeScriptRuntime, tt as getCommand$4, u as inviteCommand, v as deleteCommand$4, vn as prompt, vt as getCommand$2, wn as configArg, wt as listCommand$6, xn as assertWritable, xt as webhookCommand, yn as apiCommand, z as showCommand, zt as getCommand$1 } from "../runtime-C0_FZWdE.mjs";
6
+ import { C as getDistDir, D as deleteUserTokens, E as loadConfig, F as writePlatformConfig, M as readPlatformConfig, N as resolveTokens, O as fetchLatestToken, P as saveUserTokens, a as WorkflowJobSchema, b as createLogLevelTreeshakeOptions, i as resolveInlineSourcemap, j as loadWorkspaceId, k as loadAccessToken, l as ExecutorSchema, o as ResolverSchema, t as defineApplication, u as INVOKER_EXPR, v as platformBundleDefinePlugin, w as hashContent, x as resolveBundleLogLevel, y as composeFunctionTreeshakeOptions } from "../application-pusdxz35.mjs";
7
7
  import { t as multiline } from "../multiline-Cf9ODpr1.mjs";
8
8
  import { r as isPluginGeneratedType } from "../seed-C0fE2sJB.mjs";
9
9
  import { t as readPackageJson } from "../package-json-DcQApfPQ.mjs";
package/dist/cli/lib.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  import { f as initOperatorClient } from "../client-W5P4NYYX.mjs";
3
- import { $t as compareSnapshots, A as truncate, Bt as getExecutor, Ct as triggerExecutor, D as resumeWorkflow, Et as getExecutorJob, Ft as getWorkflowExecution, G as organizationTree, Ht as executeScript, It as listWorkflowExecutions, J as listOrganizations, Jt as DIFF_FILE_NAME, Kt as bundleMigrationScript, M as generate$1, Nt as getWorkflow, Ot as listExecutorJobs, Q as updateFolder, Qt as compareLocalTypesWithSnapshot, R as show, S as listApps, Tt as listExecutors, Ut as waitForExecution, V as remove, Vt as deploy, W as updateOrganization, Wt as MIGRATION_LABEL_KEY, X as getOrganization, Xt as MIGRATE_FILE_NAME, Yt as INITIAL_SCHEMA_NUMBER, Zt as SCHEMA_FILE_NAME, _ as getWorkspace, _n as generateUserTypes, _t as listFunctionRegistries, a as updateUser, an as getNextMigrationNumber, bn as apiCall, bt as listWebhookExecutors, cn as reconstructSnapshotFromMigrations, ct as listOAuth2Clients, d as inviteUser, dn as formatMigrationDiff, dt as getMachineUserToken, en as createSnapshotFromLocalTypes, et as listFolders, fn as hasChanges, h as listWorkspaces, ht as generate, in as getMigrationFiles, it as deleteFolder, jt as startWorkflow, k as listWorkflows, kt as watchExecutorJob, l as listUsers, mt as listMachineUsers, n as query, nn as getMigrationDirPath, nt as getFolder, ot as createFolder, p as restoreWorkspace, pn as getNamespacesWithMigrations, qt as DB_TYPES_FILE_NAME, rn as getMigrationFilePath, s as removeUser, t as isNativeTypeScriptRuntime, tn as getLatestMigrationNumber, un as formatDiffSummary, ut as getOAuth2Client, w as getAppHealth, x as createWorkspace, y as deleteWorkspace, yt as getFunctionRegistry } from "../runtime-BvKGwZeF.mjs";
4
- import { D as loadAccessToken, g as platformBundleDefinePlugin, k as loadWorkspaceId, w as loadConfig, x as getDistDir } from "../application-FnWOxBk7.mjs";
3
+ import { $t as compareSnapshots, A as truncate, Bt as getExecutor, Ct as triggerExecutor, D as resumeWorkflow, Et as getExecutorJob, Ft as getWorkflowExecution, G as organizationTree, Ht as executeScript, It as listWorkflowExecutions, J as listOrganizations, Jt as DIFF_FILE_NAME, Kt as bundleMigrationScript, M as generate$1, Nt as getWorkflow, Ot as listExecutorJobs, Q as updateFolder, Qt as compareLocalTypesWithSnapshot, R as show, S as listApps, Tt as listExecutors, Ut as waitForExecution, V as remove, Vt as deploy, W as updateOrganization, Wt as MIGRATION_LABEL_KEY, X as getOrganization, Xt as MIGRATE_FILE_NAME, Yt as INITIAL_SCHEMA_NUMBER, Zt as SCHEMA_FILE_NAME, _ as getWorkspace, _n as generateUserTypes, _t as listFunctionRegistries, a as updateUser, an as getNextMigrationNumber, bn as apiCall, bt as listWebhookExecutors, cn as reconstructSnapshotFromMigrations, ct as listOAuth2Clients, d as inviteUser, dn as formatMigrationDiff, dt as getMachineUserToken, en as createSnapshotFromLocalTypes, et as listFolders, fn as hasChanges, h as listWorkspaces, ht as generate, in as getMigrationFiles, it as deleteFolder, jt as startWorkflow, k as listWorkflows, kt as watchExecutorJob, l as listUsers, mt as listMachineUsers, n as query, nn as getMigrationDirPath, nt as getFolder, ot as createFolder, p as restoreWorkspace, pn as getNamespacesWithMigrations, qt as DB_TYPES_FILE_NAME, rn as getMigrationFilePath, s as removeUser, t as isNativeTypeScriptRuntime, tn as getLatestMigrationNumber, un as formatDiffSummary, ut as getOAuth2Client, w as getAppHealth, x as createWorkspace, y as deleteWorkspace, yt as getFunctionRegistry } from "../runtime-C0_FZWdE.mjs";
4
+ import { C as getDistDir, E as loadConfig, j as loadWorkspaceId, k as loadAccessToken, v as platformBundleDefinePlugin } from "../application-pusdxz35.mjs";
5
5
  import { n as enumConstantsPlugin } from "../enum-constants-C7DaWeQo.mjs";
6
6
  import { t as multiline } from "../multiline-Cf9ODpr1.mjs";
7
7
  import { n as fileUtilsPlugin } from "../file-utils-BHPxPXmn.mjs";
@@ -2,7 +2,7 @@
2
2
  import { t as db } from "./schema-DYKNTu-n.mjs";
3
3
  import { $ as Subgraph_ServiceType, A as IdPLang, B as AuthIDPConfig_AuthType, C as TailorDBGQLPermission_Operator, D as TailorDBType_PermitAction, E as TailorDBType_Permission_Permit, F as ExecutorJobStatus, G as AuthSCIMAttribute_Type, H as AuthOAuth2Client_ClientType, I as ExecutorTargetType, K as AuthSCIMAttribute_Uniqueness, L as ExecutorTriggerType, M as IdPPermissionPermit, N as FunctionExecution_Status, Q as ApplicationSchemaUpdateAttemptStatus, R as AuthConnection_Type, S as TailorDBGQLPermission_Action, T as TailorDBType_Permission_Operator, U as AuthOAuth2Client_GrantType, V as AuthInvokerSchema, W as AuthSCIMAttribute_Mutability, X as UserProfileProviderConfig_UserProfileProviderType, Y as TenantProviderConfig_TenantProviderType, Z as GetApplicationSchemaHealthResponse_ApplicationSchemaHealthStatus, _ as userAgent, a as fetchAll, b as WorkflowExecution_Status, et as ConditionSchema, f as initOperatorClient, h as resolveStaticWebsiteUrls, j as IdPPermissionOperator, k as PipelineResolver_OperationType, m as platformBaseUrl, nt as FilterSchema, o as fetchMachineUserToken, q as AuthSCIMConfig_AuthorizationType, rt as PageDirection, s as fetchPaged, tt as Condition_Operator, v as OperatorService, w as TailorDBGQLPermission_Permit, x as WorkflowJobExecution_Status, y as WorkspacePlatformUserRole, z as AuthHookPoint } from "./client-W5P4NYYX.mjs";
4
4
  import { a as parseBoolean, i as symbols, n as logger, r as styles, t as CIPromptError } from "./logger-DpJyJvNz.mjs";
5
- import { A as readPlatformConfig, C as hashFile, D as loadAccessToken, N as writePlatformConfig, O as loadConfigPath, b as createBundleCache, c as createExecutorService, d as buildExecutorArgsExpr, f as buildResolverOperationHookExpr, g as platformBundleDefinePlugin, h as loadFilesWithIgnores, k as loadWorkspaceId, m as stringifyFunction, n as generatePluginFilesIfNeeded, p as TailorDBTypeSchema, r as loadApplication, s as HTTP_METHODS, t as defineApplication, w as loadConfig, x as getDistDir } from "./application-FnWOxBk7.mjs";
5
+ import { A as loadConfigPath, C as getDistDir, E as loadConfig, F as writePlatformConfig, M as readPlatformConfig, S as createBundleCache, T as hashFile, _ as loadFilesWithIgnores, c as createExecutorService, d as buildExecutorArgsExpr, f as buildResolverOperationHookExpr, g as stringifyFunction, h as TailorDBTypeSchema, j as loadWorkspaceId, k as loadAccessToken, m as assertUniqueTailorDBTypeNamesWithExternal, n as generatePluginFilesIfNeeded, p as assertUniqueLocalTailorDBTypeNames, r as loadApplication, s as HTTP_METHODS, t as defineApplication, v as platformBundleDefinePlugin } from "./application-pusdxz35.mjs";
6
6
  import { t as multiline } from "./multiline-Cf9ODpr1.mjs";
7
7
  import { t as readPackageJson } from "./package-json-DcQApfPQ.mjs";
8
8
  import { n as isCLIError, t as createCLIError } from "./errors-EsY4XO6O.mjs";
@@ -9475,10 +9475,59 @@ async function applyWorkflow(client, result, phase = "create-update") {
9475
9475
  });
9476
9476
  await client.setMetadata(update.metaRequest);
9477
9477
  })]);
9478
- } else if (phase === "delete") await Promise.all(changeSet.deletes.map((del) => client.deleteWorkflow({
9479
- workspaceId: del.workspaceId,
9480
- workflowId: del.workflowId
9481
- })));
9478
+ } else if (phase === "delete") {
9479
+ await deleteAllSettled(changeSet.deletes.map((del) => ({
9480
+ resourceType: "workflow",
9481
+ resourceName: del.name,
9482
+ run: () => client.deleteWorkflow({
9483
+ workspaceId: del.workspaceId,
9484
+ workflowId: del.workflowId
9485
+ })
9486
+ })));
9487
+ await deleteAllSettled((result.jobFunctionDeletes ?? collectDeletableJobFunctions(changeSet.deletes)).map((del) => ({
9488
+ resourceType: "workflow job function",
9489
+ resourceName: del.jobFunctionName,
9490
+ run: () => client.deleteWorkflowJobFunction({
9491
+ workspaceId: del.workspaceId,
9492
+ jobFunctionName: del.jobFunctionName
9493
+ })
9494
+ })));
9495
+ }
9496
+ }
9497
+ async function deleteAllSettled(operations) {
9498
+ const results = await Promise.allSettled(operations.map((operation) => operation.run()));
9499
+ const errors = [];
9500
+ results.forEach((result, index) => {
9501
+ if (result.status === "fulfilled") return;
9502
+ const operation = operations[index];
9503
+ const error = result.reason;
9504
+ if (!operation) {
9505
+ errors.push(error);
9506
+ return;
9507
+ }
9508
+ if (error instanceof ConnectError && error.code === Code.NotFound) return;
9509
+ if (error instanceof ConnectError && error.code === Code.FailedPrecondition) {
9510
+ logger.warn(`Skipped deleting ${operation.resourceType} "${operation.resourceName}" because it is still referenced.`);
9511
+ return;
9512
+ }
9513
+ errors.push(error);
9514
+ });
9515
+ const firstError = errors[0];
9516
+ if (firstError) throw firstError;
9517
+ }
9518
+ function collectDeletableJobFunctions(deletes) {
9519
+ const seen = /* @__PURE__ */ new Set();
9520
+ const jobFunctions = [];
9521
+ for (const del of deletes) for (const jobFunctionName of del.deletableJobNames) {
9522
+ const key = `${del.workspaceId}\0${jobFunctionName}`;
9523
+ if (seen.has(key)) continue;
9524
+ seen.add(key);
9525
+ jobFunctions.push({
9526
+ workspaceId: del.workspaceId,
9527
+ jobFunctionName
9528
+ });
9529
+ }
9530
+ return jobFunctions;
9482
9531
  }
9483
9532
  /**
9484
9533
  * Filter job function versions to only include those used by a workflow
@@ -9495,7 +9544,7 @@ function filterJobFunctionVersions(allVersions, usedJobNames) {
9495
9544
  * Register job functions used by any workflow.
9496
9545
  * Only registers jobs that are actually used (based on usedJobNames in changeSet).
9497
9546
  * Uses create for new jobs and update for existing jobs.
9498
- * Sets metadata on used JobFunctions and removes metadata from unused ones.
9547
+ * Sets metadata on used JobFunctions.
9499
9548
  * @param client - Operator client instance
9500
9549
  * @param changeSet - Workflow change set
9501
9550
  * @param appName - Application name
@@ -9543,14 +9592,6 @@ async function registerJobFunctions(client, changeSet, appName, appId, unchanged
9543
9592
  }));
9544
9593
  for (const { jobName, version } of results) if (version) jobFunctionVersions[jobName] = version;
9545
9594
  }
9546
- const unusedJobFunctions = existingJobFunctions.filter((jobName) => !allUsedJobNames.has(jobName));
9547
- await Promise.all(unusedJobFunctions.map(async (jobName) => {
9548
- const { metadata } = await client.getMetadata({ trn: resourceTrn(workspaceId, "workflow_job_function", jobName) });
9549
- if (isOwnedByApp(metadata?.labels, appName, appId)) await client.setMetadata({
9550
- trn: resourceTrn(workspaceId, "workflow_job_function", jobName),
9551
- labels: { [sdkNameLabelKey]: "" }
9552
- });
9553
- }));
9554
9595
  return jobFunctionVersions;
9555
9596
  }
9556
9597
  function parseDurationToProto(duration) {
@@ -9590,6 +9631,7 @@ async function planWorkflow(client, workspaceId, appName, appId, workflows, main
9590
9631
  const unmanaged = [];
9591
9632
  const resourceOwners = /* @__PURE__ */ new Set();
9592
9633
  const unchangedWorkflowJobNames = /* @__PURE__ */ new Set();
9634
+ const retainedWorkflowJobNames = /* @__PURE__ */ new Set();
9593
9635
  const existingWorkflows = await fetchExistingResourcesWithLabels({
9594
9636
  client,
9595
9637
  workspaceId,
@@ -9613,6 +9655,7 @@ async function planWorkflow(client, workspaceId, appName, appId, workflows, main
9613
9655
  });
9614
9656
  const usedJobNames = mainJobDeps[workflow.mainJob.name];
9615
9657
  if (!usedJobNames) throw new Error(`Job "${workflow.mainJob.name}" (mainJob of workflow "${workflow.name}") was not found.\n\nPossible causes:\n - The job is not exported as a named export\n - The file containing the job is not included in workflow.files glob pattern\n\nSolution:\n export const ${workflow.mainJob.name} = createWorkflowJob({ name: "${workflow.mainJob.name}", ... })`);
9658
+ usedJobNames.forEach((jobName) => retainedWorkflowJobNames.add(jobName));
9616
9659
  if (existing) {
9617
9660
  if (trackDesiredResourceOwnership({
9618
9661
  labels: existing.allLabels,
@@ -9642,20 +9685,37 @@ async function planWorkflow(client, workspaceId, appName, appId, workflows, main
9642
9685
  metaRequest
9643
9686
  });
9644
9687
  }
9688
+ const deleteWorkflows = [];
9645
9689
  Object.values(existingWorkflows).forEach((existing) => {
9646
9690
  if (!existing) return;
9647
- if (trackRemainingResourceOwner({
9691
+ const owned = trackRemainingResourceOwner({
9648
9692
  labels: existing.allLabels,
9649
9693
  ownerLabel: existing.label,
9650
9694
  appName,
9651
9695
  appId,
9652
9696
  resourceOwners
9653
- })) changeSet.deletes.push({
9697
+ });
9698
+ const usedJobNames = getExistingWorkflowJobNames(existing.resource);
9699
+ if (owned) deleteWorkflows.push({
9654
9700
  name: existing.resource.name,
9655
9701
  workspaceId,
9656
9702
  workflowId: existing.resource.id,
9657
- usedJobNames: getExistingWorkflowJobNames(existing.resource)
9703
+ usedJobNames,
9704
+ deletableJobNames: []
9658
9705
  });
9706
+ else usedJobNames.forEach((jobName) => retainedWorkflowJobNames.add(jobName));
9707
+ });
9708
+ const jobFunctionDeletes = await planWorkflowJobFunctionDeletes({
9709
+ client,
9710
+ workspaceId,
9711
+ appName,
9712
+ appId,
9713
+ retainedWorkflowJobNames
9714
+ });
9715
+ const deletableJobNames = new Set(jobFunctionDeletes.map((del) => del.jobFunctionName));
9716
+ for (const del of deleteWorkflows) changeSet.deletes.push({
9717
+ ...del,
9718
+ deletableJobNames: del.usedJobNames.filter((jobName) => !retainedWorkflowJobNames.has(jobName) && deletableJobNames.has(jobName))
9659
9719
  });
9660
9720
  return {
9661
9721
  changeSet,
@@ -9664,9 +9724,29 @@ async function planWorkflow(client, workspaceId, appName, appId, workflows, main
9664
9724
  resourceOwners,
9665
9725
  appName,
9666
9726
  appId,
9667
- unchangedWorkflowJobNames
9727
+ unchangedWorkflowJobNames,
9728
+ jobFunctionDeletes
9668
9729
  };
9669
9730
  }
9731
+ async function planWorkflowJobFunctionDeletes(params) {
9732
+ const { client, workspaceId, appName, appId, retainedWorkflowJobNames } = params;
9733
+ const existingJobFunctions = await fetchAll(async (pageToken, maxPageSize) => {
9734
+ const response = await client.listWorkflowJobFunctions({
9735
+ workspaceId,
9736
+ pageToken,
9737
+ pageSize: maxPageSize
9738
+ });
9739
+ return [response.jobFunctions.map((jobFunction) => jobFunction.name), response.nextPageToken];
9740
+ });
9741
+ const candidates = [...new Set(existingJobFunctions)].filter((jobName) => !retainedWorkflowJobNames.has(jobName));
9742
+ return (await Promise.all(candidates.map(async (jobFunctionName) => {
9743
+ const { metadata } = await client.getMetadata({ trn: resourceTrn(workspaceId, "workflow_job_function", jobFunctionName) });
9744
+ return isOwnedByApp(metadata?.labels, appName, appId) ? {
9745
+ workspaceId,
9746
+ jobFunctionName
9747
+ } : void 0;
9748
+ }))).filter((item) => item !== void 0);
9749
+ }
9670
9750
  /**
9671
9751
  * Format workflow changes for grouped dry-run display.
9672
9752
  * @param changeSet - Workflow changes
@@ -9986,6 +10066,12 @@ async function deploy(options) {
9986
10066
  });
9987
10067
  rootSpan.setAttribute("app.name", application.name);
9988
10068
  rootSpan.setAttribute("workspace.id", workspaceId);
10069
+ await withSpan("plan.validateTailorDBTypeNames", () => assertUniqueTailorDBTypeNamesWithExternal({
10070
+ client,
10071
+ workspaceId,
10072
+ tailorDBServices: application.tailorDBServices,
10073
+ externalTailorDBNamespaces: application.externalTailorDBNamespaces
10074
+ }));
9989
10075
  const workflowService = application.workflowService;
9990
10076
  const functionEntries = collectFunctionEntries(application, filterBundledWorkflowJobs(workflowService?.jobs ?? [], workflowBuildResult?.usedJobNames ?? []), bundledScripts);
9991
10077
  const dryRun = options?.dryRun ?? false;
@@ -12807,6 +12893,13 @@ function createGenerationManager(params) {
12807
12893
  }
12808
12894
  });
12809
12895
  }
12896
+ try {
12897
+ assertUniqueLocalTailorDBTypeNames({ tailorDBServices: app.tailorDBServices });
12898
+ } catch (error) {
12899
+ logger.error("Error validating TailorDB type names");
12900
+ logger.error(String(error));
12901
+ if (!watch) throw error;
12902
+ }
12810
12903
  });
12811
12904
  const { pluginExecutorFiles, executorService } = await withSpan("generate.pluginFiles", async () => {
12812
12905
  const pluginExecutorFiles = generatePluginFilesIfNeeded(pluginManager, app.tailorDBServices, config.path);
@@ -14468,7 +14561,7 @@ async function generate(options) {
14468
14561
  if (options.init) await handleInitOption(namespacesWithMigrations, options.yes);
14469
14562
  let pluginManager;
14470
14563
  if (plugins.length > 0) pluginManager = new PluginManager(plugins);
14471
- const { defineApplication } = await import("./application-VOdgMtOD.mjs");
14564
+ const { defineApplication } = await import("./application-D4tRNn90.mjs");
14472
14565
  const application = defineApplication({
14473
14566
  config,
14474
14567
  pluginManager
@@ -16662,4 +16755,4 @@ function isDeno() {
16662
16755
 
16663
16756
  //#endregion
16664
16757
  export { listCommand$5 as $, compareSnapshots as $t, truncate as A, toPageDirection as An, startCommand as At, logBetaWarning as B, getExecutor as Bt, listCommand$2 as C, commonArgs as Cn, triggerExecutor as Ct, resumeWorkflow as D, isVerbose as Dn, jobsCommand as Dt, resumeCommand as E, deploymentArgs as En, getExecutorJob as Et, writeDbTypesFile as F, getWorkflowExecution as Ft, organizationTree as G, parseMigrationLabelNumber as Gt, removeCommand$1 as H, executeScript as Ht, getConfiguredEditorCommand as I, listWorkflowExecutions as It, listOrganizations as J, DIFF_FILE_NAME as Jt, treeCommand as K, bundleMigrationScript as Kt, openInConfiguredEditor as L, functionExecutionStatusToString as Lt, generate as M, getCommand$5 as Mt, generateCommand as N, getWorkflow as Nt, listCommand$3 as O, pagedLogArgs as On, listExecutorJobs as Ot, generateMigrationScript as P, executionsCommand as Pt, updateFolder as Q, compareLocalTypesWithSnapshot as Qt, show as R, formatKeyValueTable as Rt, listApps as S, defineAppCommand as Sn, triggerCommand as St, healthCommand as T, confirmationArgs as Tn, listExecutors as Tt, updateCommand$1 as U, waitForExecution$1 as Ut, remove as V, deploy as Vt, updateOrganization as W, MIGRATION_LABEL_KEY as Wt, getOrganization as X, MIGRATE_FILE_NAME as Xt, getCommand$1 as Y, INITIAL_SCHEMA_NUMBER as Yt, updateCommand$2 as Z, SCHEMA_FILE_NAME as Zt, getWorkspace as _, generateUserTypes as _n, listFunctionRegistries as _t, updateUser as a, getNextMigrationNumber as an, createCommand$1 as at, createCommand as b, apiCall as bn, listWebhookExecutors as bt, listCommand as c, reconstructSnapshotFromMigrations as cn, listOAuth2Clients as ct, inviteUser as d, formatMigrationDiff as dn, getMachineUserToken as dt, createSnapshotFromLocalTypes as en, listFolders as et, restoreCommand as f, hasChanges as fn, tokenCommand as ft, getCommand as g, PluginManager as gn, listCommand$8 as gt, listWorkspaces as h, sdkNameLabelKey as hn, generate$1 as ht, updateCommand as i, getMigrationFiles as in, deleteFolder as it, truncateCommand as j, workspaceArgs as jn, startWorkflow as jt, listWorkflows as k, paginationArgs as kn, watchExecutorJob as kt, listUsers as l, formatMigrationNumber as ln, getCommand$3 as lt, listCommand$1 as m, resourceTrn as mn, listMachineUsers as mt, query as n, getMigrationDirPath as nn, getFolder as nt, removeCommand as o, isValidMigrationNumber as on, createFolder as ot, restoreWorkspace as p, getNamespacesWithMigrations as pn, listCommand$7 as pt, listCommand$4 as q, DB_TYPES_FILE_NAME as qt, queryCommand as r, getMigrationFilePath as rn, deleteCommand$1 as rt, removeUser as s, loadDiff as sn, listCommand$6 as st, isNativeTypeScriptRuntime as t, getLatestMigrationNumber as tn, getCommand$2 as tt, inviteCommand as u, formatDiffSummary as un, getOAuth2Client as ut, deleteCommand as v, prompt as vn, getCommand$4 as vt, getAppHealth as w, configArg as wn, listCommand$9 as wt, createWorkspace as x, assertWritable as xn, webhookCommand as xt, deleteWorkspace as y, apiCommand as yn, getFunctionRegistry as yt, showCommand as z, getCommand$6 as zt };
16665
- //# sourceMappingURL=runtime-BvKGwZeF.mjs.map
16758
+ //# sourceMappingURL=runtime-C0_FZWdE.mjs.map