@tailor-platform/sdk 1.25.2 → 1.25.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.
package/dist/cli/lib.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import "../chunk-Cz-A8uMR.mjs";
2
2
  import "../schema-BePzTFBV.mjs";
3
3
  import "../brand-GZnI4eYb.mjs";
4
- import { D as initOperatorClient, a as loadConfig, b as loadWorkspaceId, dt as logger, g as getDistDir, y as loadAccessToken } from "../application-BGO3TtXi.mjs";
5
- import { $ as listExecutors, A as truncate, At as getLatestMigrationNumber, B as listOAuth2Clients, Bt as hasChanges, Ct as INITIAL_SCHEMA_NUMBER, D as resumeWorkflow, Dt as compareSnapshots, Et as compareLocalTypesWithSnapshot, F as show, H as getOAuth2Client, J as listWebhookExecutors, K as listMachineUsers, L as remove, Lt as reconstructSnapshotFromMigrations, M as generate$1, Mt as getMigrationFilePath, Nt as getMigrationFiles, Ot as createSnapshotFromLocalTypes, Pt as getNextMigrationNumber, Rt as formatDiffSummary, S as listApps, St as DIFF_FILE_NAME, Tt as SCHEMA_FILE_NAME, U as getMachineUserToken, Ut as generateUserTypes, Vt as getNamespacesWithMigrations, Wt as apiCall, Z as triggerExecutor, _ as getWorkspace, _t as waitForExecution, a as updateUser, at as startWorkflow, bt as bundleMigrationScript, d as inviteUser, et as getExecutorJob, gt as executeScript, h as listWorkspaces, ht as apply, jt as getMigrationDirPath, k as listWorkflows, l as listUsers, lt as getWorkflowExecution, mt as getExecutor, nt as listExecutorJobs, p as restoreWorkspace, q as generate, rt as watchExecutorJob, s as removeUser, st as getWorkflow, t as query, ut as listWorkflowExecutions, vt as MIGRATION_LABEL_KEY, w as getAppHealth, wt as MIGRATE_FILE_NAME, x as createWorkspace, xt as DB_TYPES_FILE_NAME, y as deleteWorkspace, zt as formatMigrationDiff } from "../query-CRSZGUmD.mjs";
4
+ import { D as initOperatorClient, a as loadConfig, b as loadWorkspaceId, ft as logger, g as getDistDir, y as loadAccessToken } from "../application-91Th6tm6.mjs";
5
+ import { $ as listExecutors, A as truncate, At as getLatestMigrationNumber, B as listOAuth2Clients, Bt as hasChanges, Ct as INITIAL_SCHEMA_NUMBER, D as resumeWorkflow, Dt as compareSnapshots, Et as compareLocalTypesWithSnapshot, F as show, Gt as apiCall, H as getOAuth2Client, J as listWebhookExecutors, K as listMachineUsers, L as remove, Lt as reconstructSnapshotFromMigrations, M as generate$1, Mt as getMigrationFilePath, Nt as getMigrationFiles, Ot as createSnapshotFromLocalTypes, Pt as getNextMigrationNumber, Rt as formatDiffSummary, S as listApps, St as DIFF_FILE_NAME, Tt as SCHEMA_FILE_NAME, U as getMachineUserToken, Vt as getNamespacesWithMigrations, Wt as generateUserTypes, Z as triggerExecutor, _ as getWorkspace, _t as waitForExecution, a as updateUser, at as startWorkflow, bt as bundleMigrationScript, d as inviteUser, et as getExecutorJob, gt as executeScript, h as listWorkspaces, ht as apply, jt as getMigrationDirPath, k as listWorkflows, l as listUsers, lt as getWorkflowExecution, mt as getExecutor, nt as listExecutorJobs, p as restoreWorkspace, q as generate, rt as watchExecutorJob, s as removeUser, st as getWorkflow, t as query, ut as listWorkflowExecutions, vt as MIGRATION_LABEL_KEY, w as getAppHealth, wt as MIGRATE_FILE_NAME, x as createWorkspace, xt as DB_TYPES_FILE_NAME, y as deleteWorkspace, zt as formatMigrationDiff } from "../query-BpppEOzu.mjs";
6
6
  import "../package-json-CVUv8Y9T.mjs";
7
7
  import { n as seedPlugin } from "../seed-CCVRLibh.mjs";
8
8
  import { n as enumConstantsPlugin } from "../enum-constants-6uK0VI_s.mjs";
@@ -1,5 +1,5 @@
1
1
  import { A as OAuth2ClientGrantType, At as IDToken, B as TailorDBInstance, Bt as TenantProvider, D as AuthOwnConfig, E as AuthExternalConfig, F as UsernameFieldKey, Ft as SCIMAttribute, G as TailorTypePermission, H as db, I as ValueOperand, It as SCIMAttributeMapping, K as unsafeAllowAllGqlPermission, L as TailorAnyDBField, Lt as SCIMAuthorization, M as UserAttributeKey, Mt as OAuth2ClientInput, N as UserAttributeListKey, Nt as OIDC, O as AuthServiceInput, P as UserAttributeMap, Pt as SAML, R as TailorAnyDBType, Rt as SCIMConfig, T as AuthConfig, U as PermissionCondition, V as TailorDBType, W as TailorTypeGqlPermission, _ as GeneratorResult, a as PluginExecutorContext, at as AttributeList, b as TailorDBNamespaceData, c as PluginGeneratedExecutorWithFile, d as PluginNamespaceProcessContext, f as PluginOutput, g as ExecutorReadyContext, h as TypePluginOutput, i as PluginConfigs, j as SCIMAttributeType, jt as IdProvider, k as DefinedAuth, kt as BuiltinIdP, l as PluginGeneratedResolver, lt as TailorUser, m as TailorDBTypeForPlugin, n as Plugin, o as PluginExecutorContextBase, ot as AttributeMap, p as PluginProcessContext, pt as Resolver, q as unsafeAllowAllTypePermission, r as PluginAttachment, s as PluginGeneratedExecutor, t as NamespacePluginOutput, tt as TailorField, u as PluginGeneratedType, ut as unauthenticatedTailorUser, v as ResolverNamespaceData, x as TailorDBReadyContext, y as ResolverReadyContext, z as TailorDBField, zt as SCIMResource } from "../plugin-zY5wvV82.mjs";
2
2
  import { t as Env } from "../env-uBeVwE9B.mjs";
3
3
  import { _ as IdPGqlOperations, a as ResolverExternalConfig, c as WorkflowServiceConfig, d as defineStaticWebSite, f as SecretsConfig, h as IdPExternalConfig, i as ExecutorServiceInput, l as WorkflowServiceInput, m as IdPConfig, o as ResolverServiceConfig, p as defineSecretManager, r as ExecutorServiceConfig, s as ResolverServiceInput, t as RetryPolicy, u as StaticWebsiteConfig, v as IdPGqlOperationsInput } from "../workflow.generated-v1LXRuB6.mjs";
4
- import { $ as AuthInvoker, A as idpUserCreatedTrigger, B as WebhookOperation, C as RecordTrigger, D as authAccessTokenIssuedTrigger, E as ResolverExecutedTrigger, F as recordUpdatedTrigger, G as WORKFLOW_TEST_ENV_KEY, H as Workflow, I as resolverExecutedTrigger, J as WorkflowJobInput, K as WorkflowJob, L as FunctionOperation, M as idpUserUpdatedTrigger, N as recordCreatedTrigger, O as authAccessTokenRefreshedTrigger, P as recordDeletedTrigger, Q as createResolver, R as GqlOperation, S as RecordDeletedArgs, T as ResolverExecutedArgs, U as WorkflowConfig, V as WorkflowOperation, W as createWorkflow, X as createWorkflowJob, Y as WorkflowJobOutput, Z as QueryType, _ as AuthAccessTokenArgs, a as defineGenerators, b as IdpUserTrigger, c as createExecutor, d as IncomingWebhookRequest, et as defineAuth, f as IncomingWebhookTrigger, g as scheduleTrigger, h as ScheduleTrigger, i as defineConfig, j as idpUserDeletedTrigger, k as authAccessTokenRevokedTrigger, l as Trigger, m as ScheduleArgs, n as output, o as definePlugins, p as incomingWebhookTrigger, q as WorkflowJobContext, r as t, s as defineIdp, t as __Infer, u as IncomingWebhookArgs, v as AuthAccessTokenTrigger, w as RecordUpdatedArgs, x as RecordCreatedArgs, y as IdpUserArgs, z as Operation } from "../index-DuZRAsc3.mjs";
4
+ import { $ as AuthInvoker, A as idpUserCreatedTrigger, B as WebhookOperation, C as RecordTrigger, D as authAccessTokenIssuedTrigger, E as ResolverExecutedTrigger, F as recordUpdatedTrigger, G as WORKFLOW_TEST_ENV_KEY, H as Workflow, I as resolverExecutedTrigger, J as WorkflowJobInput, K as WorkflowJob, L as FunctionOperation, M as idpUserUpdatedTrigger, N as recordCreatedTrigger, O as authAccessTokenRefreshedTrigger, P as recordDeletedTrigger, Q as createResolver, R as GqlOperation, S as RecordDeletedArgs, T as ResolverExecutedArgs, U as WorkflowConfig, V as WorkflowOperation, W as createWorkflow, X as createWorkflowJob, Y as WorkflowJobOutput, Z as QueryType, _ as AuthAccessTokenArgs, a as defineGenerators, b as IdpUserTrigger, c as createExecutor, d as IncomingWebhookRequest, et as defineAuth, f as IncomingWebhookTrigger, g as scheduleTrigger, h as ScheduleTrigger, i as defineConfig, j as idpUserDeletedTrigger, k as authAccessTokenRevokedTrigger, l as Trigger, m as ScheduleArgs, n as output, o as definePlugins, p as incomingWebhookTrigger, q as WorkflowJobContext, r as t, s as defineIdp, t as __Infer, u as IncomingWebhookArgs, v as AuthAccessTokenTrigger, w as RecordUpdatedArgs, x as RecordCreatedArgs, y as IdpUserArgs, z as Operation } from "../index-Bu12qy3m.mjs";
5
5
  export { AttributeList, AttributeMap, AuthAccessTokenArgs, AuthAccessTokenTrigger, AuthConfig, AuthExternalConfig, AuthInvoker, AuthOwnConfig, AuthServiceInput, BuiltinIdP, DefinedAuth, Env, ExecutorReadyContext, ExecutorServiceConfig, ExecutorServiceInput, FunctionOperation, GeneratorResult, GqlOperation, IDToken, IdPConfig, IdPExternalConfig, IdPGqlOperations, IdPGqlOperationsInput as IdPGqlOperationsConfig, IdProvider as IdProviderConfig, IdpUserArgs, IdpUserTrigger, IncomingWebhookArgs, IncomingWebhookRequest, IncomingWebhookTrigger, NamespacePluginOutput, OAuth2ClientInput as OAuth2Client, OAuth2ClientGrantType, OIDC, Operation, PermissionCondition, Plugin, PluginAttachment, PluginConfigs, PluginExecutorContext, PluginExecutorContextBase, PluginGeneratedExecutor, PluginGeneratedExecutorWithFile, PluginGeneratedResolver, PluginGeneratedType, PluginNamespaceProcessContext, PluginOutput, PluginProcessContext, QueryType, RecordCreatedArgs, RecordDeletedArgs, RecordTrigger, RecordUpdatedArgs, Resolver, ResolverExecutedArgs, ResolverExecutedTrigger, ResolverExternalConfig, ResolverNamespaceData, ResolverReadyContext, ResolverServiceConfig, ResolverServiceInput, RetryPolicy, SAML, SCIMAttribute, SCIMAttributeMapping, SCIMAttributeType, SCIMAuthorization, SCIMConfig, SCIMResource, ScheduleArgs, ScheduleTrigger, SecretsConfig, StaticWebsiteConfig, TailorAnyDBField, TailorAnyDBType, TailorDBField, TailorDBInstance, TailorDBNamespaceData, TailorDBReadyContext, TailorDBType, TailorDBTypeForPlugin, TailorField, TailorTypeGqlPermission, TailorTypePermission, TailorUser, TenantProvider as TenantProviderConfig, Trigger, TypePluginOutput, UserAttributeKey, UserAttributeListKey, UserAttributeMap, UsernameFieldKey, ValueOperand, WORKFLOW_TEST_ENV_KEY, WebhookOperation, Workflow, WorkflowConfig, WorkflowJob, WorkflowJobContext, WorkflowJobInput, WorkflowJobOutput, WorkflowOperation, WorkflowServiceConfig, WorkflowServiceInput, authAccessTokenIssuedTrigger, authAccessTokenRefreshedTrigger, authAccessTokenRevokedTrigger, createExecutor, createResolver, createWorkflow, createWorkflowJob, db, defineAuth, defineConfig, defineGenerators, defineIdp, definePlugins, defineSecretManager, defineStaticWebSite, idpUserCreatedTrigger, idpUserDeletedTrigger, idpUserUpdatedTrigger, incomingWebhookTrigger, infer, output, recordCreatedTrigger, recordDeletedTrigger, recordUpdatedTrigger, resolverExecutedTrigger, scheduleTrigger, t, unauthenticatedTailorUser, unsafeAllowAllGqlPermission, unsafeAllowAllTypePermission };
@@ -650,16 +650,7 @@ declare function defineConfig<const Config extends AppConfig & Record<Exclude<ke
650
650
  * @param configs - Generator configurations
651
651
  * @returns Generator configurations as given
652
652
  */
653
- declare function defineGenerators(...configs: GeneratorConfig[]): (["@tailor-platform/kysely-type", {
654
- distPath: string;
655
- }] | ["@tailor-platform/seed", {
656
- distPath: string;
657
- machineUserName?: string | undefined;
658
- }] | ["@tailor-platform/enum-constants", {
659
- distPath: string;
660
- }] | ["@tailor-platform/file-utils", {
661
- distPath: string;
662
- }] | {
653
+ declare function defineGenerators(...configs: GeneratorConfig[]): ({
663
654
  id: string;
664
655
  description: string;
665
656
  dependencies: ("executor" | "tailordb" | "resolver")[];
@@ -669,7 +660,16 @@ declare function defineGenerators(...configs: GeneratorConfig[]): (["@tailor-pla
669
660
  processExecutor?: zod_v4_core0.$InferInnerFunctionType<zod_v4_core0.$ZodFunctionArgs, zod_v4_core0.$ZodFunctionOut> | undefined;
670
661
  processTailorDBNamespace?: zod_v4_core0.$InferInnerFunctionType<zod_v4_core0.$ZodFunctionArgs, zod_v4_core0.$ZodFunctionOut> | undefined;
671
662
  processResolverNamespace?: zod_v4_core0.$InferInnerFunctionType<zod_v4_core0.$ZodFunctionArgs, zod_v4_core0.$ZodFunctionOut> | undefined;
672
- })[];
663
+ } | ["@tailor-platform/kysely-type", {
664
+ distPath: string;
665
+ }] | ["@tailor-platform/seed", {
666
+ distPath: string;
667
+ machineUserName?: string | undefined;
668
+ }] | ["@tailor-platform/enum-constants", {
669
+ distPath: string;
670
+ }] | ["@tailor-platform/file-utils", {
671
+ distPath: string;
672
+ }])[];
673
673
  /**
674
674
  * Define plugins to be used with the Tailor SDK.
675
675
  * Plugins can generate additional types, resolvers, and executors
@@ -757,4 +757,4 @@ declare namespace t {
757
757
  }
758
758
  //#endregion
759
759
  export { AuthInvoker as $, idpUserCreatedTrigger as A, WebhookOperation as B, RecordTrigger as C, authAccessTokenIssuedTrigger as D, ResolverExecutedTrigger as E, recordUpdatedTrigger as F, WORKFLOW_TEST_ENV_KEY as G, Workflow as H, resolverExecutedTrigger as I, WorkflowJobInput as J, WorkflowJob as K, FunctionOperation as L, idpUserUpdatedTrigger as M, recordCreatedTrigger as N, authAccessTokenRefreshedTrigger as O, recordDeletedTrigger as P, createResolver as Q, GqlOperation as R, RecordDeletedArgs as S, ResolverExecutedArgs as T, WorkflowConfig as U, WorkflowOperation as V, createWorkflow as W, createWorkflowJob as X, WorkflowJobOutput as Y, QueryType as Z, AuthAccessTokenArgs as _, defineGenerators as a, IdpUserTrigger as b, createExecutor as c, IncomingWebhookRequest as d, defineAuth as et, IncomingWebhookTrigger as f, scheduleTrigger as g, ScheduleTrigger as h, defineConfig as i, idpUserDeletedTrigger as j, authAccessTokenRevokedTrigger as k, Trigger as l, ScheduleArgs as m, output as n, definePlugins as o, incomingWebhookTrigger as p, WorkflowJobContext as q, t as r, defineIdp as s, infer as t, IncomingWebhookArgs as u, AuthAccessTokenTrigger as v, RecordUpdatedArgs as w, RecordCreatedArgs as x, IdpUserArgs as y, Operation as z };
760
- //# sourceMappingURL=index-DuZRAsc3.d.mts.map
760
+ //# sourceMappingURL=index-Bu12qy3m.d.mts.map
@@ -1,5 +1,5 @@
1
1
  import { t as db } from "./schema-BePzTFBV.mjs";
2
- import { $ as AuthSCIMAttribute_Uniqueness, A as userAgent, B as PipelineResolver_OperationType, C as fetchAll, D as initOperatorClient, F as TailorDBGQLPermission_Operator, G as ExecutorTargetType, H as FunctionExecution_Status, I as TailorDBGQLPermission_Permit, J as AuthInvokerSchema, K as ExecutorTriggerType, L as TailorDBType_Permission_Operator, M as WorkflowExecution_Status, N as WorkflowJobExecution_Status, O as platformBaseUrl, P as TailorDBGQLPermission_Action, Q as AuthSCIMAttribute_Type, R as TailorDBType_Permission_Permit, S as writePlatformConfig, V as IdPLang, W as ExecutorJobStatus, X as AuthOAuth2Client_GrantType, Y as AuthOAuth2Client_ClientType, Z as AuthSCIMAttribute_Mutability, _ as hashFile, a as loadConfig, at as ConditionSchema, b as loadWorkspaceId, ct as PageDirection, d as TailorDBTypeSchema, dt as logger, et as AuthSCIMConfig_AuthorizationType, f as stringifyFunction, ft as styles, g as getDistDir, h as createBundleCache, it as GetApplicationSchemaHealthResponse_ApplicationSchemaHealthStatus, j as WorkspacePlatformUserRole, k as resolveStaticWebsiteUrls, l as OAuth2ClientSchema, lt as ApplicationSchemaUpdateAttemptStatus, m as loadFilesWithIgnores, n as generatePluginFilesIfNeeded, nt as TenantProviderConfig_TenantProviderType, ot as Condition_Operator, p as tailorUserMap, pt as symbols, q as AuthIDPConfig_AuthType, r as loadApplication, rt as UserProfileProviderConfig_UserProfileProviderType, s as createExecutorService, st as FilterSchema, t as defineApplication, ut as Subgraph_ServiceType, w as fetchMachineUserToken, x as readPlatformConfig, y as loadAccessToken, z as TailorDBType_PermitAction } from "./application-BGO3TtXi.mjs";
2
+ import { $ as AuthSCIMAttribute_Uniqueness, A as userAgent, B as PipelineResolver_OperationType, C as fetchAll, D as initOperatorClient, F as TailorDBGQLPermission_Operator, G as ExecutorTargetType, H as FunctionExecution_Status, I as TailorDBGQLPermission_Permit, J as AuthInvokerSchema, K as ExecutorTriggerType, L as TailorDBType_Permission_Operator, M as WorkflowExecution_Status, N as WorkflowJobExecution_Status, O as platformBaseUrl, P as TailorDBGQLPermission_Action, Q as AuthSCIMAttribute_Type, R as TailorDBType_Permission_Permit, S as writePlatformConfig, V as IdPLang, W as ExecutorJobStatus, X as AuthOAuth2Client_GrantType, Y as AuthOAuth2Client_ClientType, Z as AuthSCIMAttribute_Mutability, _ as hashFile, a as loadConfig, at as ConditionSchema, b as loadWorkspaceId, ct as PageDirection, d as TailorDBTypeSchema, dt as CIPromptError, et as AuthSCIMConfig_AuthorizationType, f as stringifyFunction, ft as logger, g as getDistDir, h as createBundleCache, it as GetApplicationSchemaHealthResponse_ApplicationSchemaHealthStatus, j as WorkspacePlatformUserRole, k as resolveStaticWebsiteUrls, l as OAuth2ClientSchema, lt as ApplicationSchemaUpdateAttemptStatus, m as loadFilesWithIgnores, mt as symbols, n as generatePluginFilesIfNeeded, nt as TenantProviderConfig_TenantProviderType, ot as Condition_Operator, p as tailorUserMap, pt as styles, q as AuthIDPConfig_AuthType, r as loadApplication, rt as UserProfileProviderConfig_UserProfileProviderType, s as createExecutorService, st as FilterSchema, t as defineApplication, ut as Subgraph_ServiceType, w as fetchMachineUserToken, x as readPlatformConfig, y as loadAccessToken, z as TailorDBType_PermitAction } from "./application-91Th6tm6.mjs";
3
3
  import { t as readPackageJson } from "./package-json-CVUv8Y9T.mjs";
4
4
  import { r as withSpan } from "./telemetry-0w8OupuQ.mjs";
5
5
  import { arg, createDefineCommand, defineCommand, runCommand } from "politty";
@@ -25,6 +25,9 @@ import * as rolldown from "rolldown";
25
25
  import * as fs from "node:fs/promises";
26
26
  import { glob } from "node:fs/promises";
27
27
  import { create, fromJson, toJson } from "@bufbuild/protobuf";
28
+ import { ExitPromptError } from "@inquirer/core";
29
+ import { confirm, input } from "@inquirer/prompts";
30
+ import { isCI } from "std-env";
28
31
  import ora from "ora";
29
32
  import { setTimeout as setTimeout$1 } from "timers/promises";
30
33
  import { spawn } from "node:child_process";
@@ -2259,6 +2262,29 @@ function protoSCIMAttribute(attr) {
2259
2262
  };
2260
2263
  }
2261
2264
 
2265
+ //#endregion
2266
+ //#region src/cli/shared/prompt.ts
2267
+ /**
2268
+ * Wraps a prompt function with CI guard and cancellation handling.
2269
+ * @param fn - A prompt function from `@inquirer/prompts`
2270
+ * @returns A wrapped function that throws in CI and exits on cancel
2271
+ */
2272
+ function withGuard(fn) {
2273
+ return async (...args) => {
2274
+ if (isCI) throw new CIPromptError();
2275
+ try {
2276
+ return await fn(...args);
2277
+ } catch (error) {
2278
+ if (error instanceof ExitPromptError) process.exit(130);
2279
+ throw error;
2280
+ }
2281
+ };
2282
+ }
2283
+ const prompt = {
2284
+ confirm: withGuard(confirm),
2285
+ text: withGuard(input)
2286
+ };
2287
+
2262
2288
  //#endregion
2263
2289
  //#region src/cli/commands/apply/confirm.ts
2264
2290
  /**
@@ -2282,9 +2308,9 @@ async function confirmOwnerConflict(conflicts, appName, yes) {
2282
2308
  return;
2283
2309
  }
2284
2310
  const promptMessage = currentOwners.length === 1 ? `Update these resources to be managed by "${appName}"?\n${styles.dim("(Common when renaming your application)")}` : `Update these resources to be managed by "${appName}"?`;
2285
- if (!await logger.prompt(promptMessage, {
2286
- type: "confirm",
2287
- initial: false
2311
+ if (!await prompt.confirm({
2312
+ message: promptMessage,
2313
+ default: false
2288
2314
  })) throw new Error(ml`
2289
2315
  Apply cancelled. Resources remain managed by their current applications.
2290
2316
  To override, run again and confirm, or use --yes flag.
@@ -2310,9 +2336,9 @@ async function confirmUnmanagedResources(resources, appName, yes) {
2310
2336
  logger.success(`Adding to "${appName}" (--yes flag specified)...`, { mode: "plain" });
2311
2337
  return;
2312
2338
  }
2313
- if (!await logger.prompt(`Allow tailor-sdk to manage these resources for "${appName}"?`, {
2314
- type: "confirm",
2315
- initial: false
2339
+ if (!await prompt.confirm({
2340
+ message: `Allow tailor-sdk to manage these resources for "${appName}"?`,
2341
+ default: false
2316
2342
  })) throw new Error(ml`
2317
2343
  Apply cancelled. Resources remain unmanaged.
2318
2344
  To override, run again and confirm, or use --yes flag.
@@ -2335,9 +2361,9 @@ async function confirmImportantResourceDeletion(resources, yes) {
2335
2361
  logger.success("Deleting resources (--yes flag specified)...", { mode: "plain" });
2336
2362
  return;
2337
2363
  }
2338
- if (!await logger.prompt("Are you sure you want to delete these resources?", {
2339
- type: "confirm",
2340
- initial: false
2364
+ if (!await prompt.confirm({
2365
+ message: "Are you sure you want to delete these resources?",
2366
+ default: false
2341
2367
  })) throw new Error(ml`
2342
2368
  Apply cancelled. Resources will not be deleted.
2343
2369
  To override, run again and confirm, or use --yes flag.
@@ -9646,9 +9672,9 @@ const removeCommand$1 = defineAppCommand({
9646
9672
  logger.newline();
9647
9673
  await execRemove(client, workspaceId, application, config, async () => {
9648
9674
  if (!args.yes) {
9649
- if (!await logger.prompt("Are you sure you want to remove all resources?", {
9650
- type: "confirm",
9651
- initial: false
9675
+ if (!await prompt.confirm({
9676
+ message: "Are you sure you want to remove all resources?",
9677
+ default: false
9652
9678
  })) throw new Error(ml`
9653
9679
  Remove cancelled. No resources were deleted.
9654
9680
  To override, run again and confirm, or use --yes flag.
@@ -10260,9 +10286,9 @@ async function handleInitOption(namespaces, skipConfirmation) {
10260
10286
  for (const { namespace, migrationsDir } of existingDirs) logger.log(` - ${namespace}: ${migrationsDir}`);
10261
10287
  logger.newline();
10262
10288
  if (!skipConfirmation) {
10263
- if (!await logger.prompt("Are you sure you want to delete these directories and start fresh?", {
10264
- type: "confirm",
10265
- initial: false
10289
+ if (!await prompt.confirm({
10290
+ message: "Are you sure you want to delete these directories and start fresh?",
10291
+ default: false
10266
10292
  })) {
10267
10293
  logger.info("Operation cancelled.");
10268
10294
  process.exit(0);
@@ -10300,7 +10326,7 @@ async function generate(options) {
10300
10326
  if (options.init) await handleInitOption(namespacesWithMigrations, options.yes);
10301
10327
  let pluginManager;
10302
10328
  if (plugins.length > 0) pluginManager = new PluginManager(plugins);
10303
- const { defineApplication } = await import("./application-C0lXqKBr.mjs");
10329
+ const { defineApplication } = await import("./application-DegTCDd8.mjs");
10304
10330
  const application = defineApplication({
10305
10331
  config,
10306
10332
  pluginManager
@@ -10379,11 +10405,10 @@ async function generateDiffFromSnapshot(previousSnapshot, currentSnapshot, migra
10379
10405
  logger.newline();
10380
10406
  logger.warn(formatBreakingChanges(diff.breakingChanges));
10381
10407
  if (!options.yes) {
10382
- if (await logger.prompt("Continue generating migration?", {
10383
- type: "confirm",
10384
- initial: true,
10385
- cancel: "symbol"
10386
- }) !== true) {
10408
+ if (!await prompt.confirm({
10409
+ message: "Continue generating migration?",
10410
+ default: true
10411
+ })) {
10387
10412
  logger.info("Migration generation cancelled.");
10388
10413
  return;
10389
10414
  }
@@ -10553,9 +10578,9 @@ async function $truncate(options) {
10553
10578
  }
10554
10579
  if (!options?.yes) {
10555
10580
  const namespaceList = namespaces.join(", ");
10556
- if (!await logger.prompt(`This will truncate ALL tables in the following namespaces: ${namespaceList}. Continue? (yes/no)`, {
10557
- type: "confirm",
10558
- initial: false
10581
+ if (!await prompt.confirm({
10582
+ message: `This will truncate ALL tables in the following namespaces: ${namespaceList}. Continue?`,
10583
+ default: false
10559
10584
  })) {
10560
10585
  logger.info("Truncate cancelled.");
10561
10586
  return;
@@ -10569,9 +10594,9 @@ async function $truncate(options) {
10569
10594
  const namespace = options.namespace;
10570
10595
  if (!namespaces.includes(namespace)) throw new Error(`Namespace "${namespace}" not found in config. Available namespaces: ${namespaces.join(", ")}`);
10571
10596
  if (!options.yes) {
10572
- if (!await logger.prompt(`This will truncate ALL tables in namespace "${namespace}". Continue? (yes/no)`, {
10573
- type: "confirm",
10574
- initial: false
10597
+ if (!await prompt.confirm({
10598
+ message: `This will truncate ALL tables in namespace "${namespace}". Continue?`,
10599
+ default: false
10575
10600
  })) {
10576
10601
  logger.info("Truncate cancelled.");
10577
10602
  return;
@@ -10592,9 +10617,9 @@ async function $truncate(options) {
10592
10617
  if (notFoundTypes.length > 0) throw new Error(`The following types were not found in any namespace: ${notFoundTypes.join(", ")}`);
10593
10618
  if (!options.yes) {
10594
10619
  const typeList = typeNames.join(", ");
10595
- if (!await logger.prompt(`This will truncate the following types: ${typeList}. Continue? (yes/no)`, {
10596
- type: "confirm",
10597
- initial: false
10620
+ if (!await prompt.confirm({
10621
+ message: `This will truncate the following types: ${typeList}. Continue?`,
10622
+ default: false
10598
10623
  })) {
10599
10624
  logger.info("Truncate cancelled.");
10600
10625
  return;
@@ -11094,7 +11119,7 @@ const deleteCommand = defineAppCommand({
11094
11119
  throw new Error(`Workspace "${workspaceId}" not found.`);
11095
11120
  }
11096
11121
  if (!args.yes) {
11097
- if (await logger.prompt(`Enter the workspace name to confirm deletion (${workspace.workspace?.name}):`, { type: "text" }) !== workspace.workspace?.name) {
11122
+ if (await prompt.text({ message: `Enter the workspace name to confirm deletion (${workspace.workspace?.name}):` }) !== workspace.workspace?.name) {
11098
11123
  logger.info("Workspace deletion cancelled.");
11099
11124
  return;
11100
11125
  }
@@ -11232,7 +11257,7 @@ const restoreCommand = defineAppCommand({
11232
11257
  run: async (args) => {
11233
11258
  const { client, workspaceId } = await loadOptions$5({ workspaceId: args["workspace-id"] });
11234
11259
  if (!args.yes) {
11235
- if (await logger.prompt(`Are you sure you want to restore workspace "${workspaceId}"? (yes/no):`, { type: "text" }) !== "yes") {
11260
+ if (await prompt.text({ message: `Are you sure you want to restore workspace "${workspaceId}"? (yes/no):` }) !== "yes") {
11236
11261
  logger.info("Workspace restoration cancelled.");
11237
11262
  return;
11238
11263
  }
@@ -11436,7 +11461,7 @@ const removeCommand = defineAppCommand({
11436
11461
  }).strict(),
11437
11462
  run: async (args) => {
11438
11463
  if (!args.yes) {
11439
- if (await logger.prompt(`Are you sure you want to remove user "${args.email}" from the workspace? (yes/no):`, { type: "text" }) !== "yes") {
11464
+ if (await prompt.text({ message: `Are you sure you want to remove user "${args.email}" from the workspace? (yes/no):` }) !== "yes") {
11440
11465
  logger.info("User removal cancelled.");
11441
11466
  return;
11442
11467
  }
@@ -12480,5 +12505,5 @@ function printGqlResult(result, options = {}) {
12480
12505
  }
12481
12506
 
12482
12507
  //#endregion
12483
- export { listExecutors as $, truncate as A, getLatestMigrationNumber as At, listOAuth2Clients as B, hasChanges as Bt, listCommand$2 as C, INITIAL_SCHEMA_NUMBER as Ct, resumeWorkflow as D, compareSnapshots as Dt, resumeCommand as E, compareLocalTypesWithSnapshot as Et, show as F, isValidMigrationNumber as Ft, listCommand$5 as G, apiCommand as Gt, getOAuth2Client as H, trnPrefix as Ht, showCommand as I, loadDiff as It, listWebhookExecutors as J, confirmationArgs as Jt, listMachineUsers as K, defineAppCommand as Kt, remove as L, reconstructSnapshotFromMigrations as Lt, generate as M, getMigrationFilePath as Mt, generateCommand as N, getMigrationFiles as Nt, listCommand$3 as O, createSnapshotFromLocalTypes as Ot, logBetaWarning as P, getNextMigrationNumber as Pt, listCommand$6 as Q, removeCommand$1 as R, formatDiffSummary as Rt, listApps as S, DIFF_FILE_NAME as St, healthCommand as T, SCHEMA_FILE_NAME as Tt, getMachineUserToken as U, generateUserTypes as Ut, getCommand$1 as V, getNamespacesWithMigrations as Vt, tokenCommand as W, apiCall as Wt, triggerCommand as X, isVerbose as Xt, webhookCommand as Y, deploymentArgs as Yt, triggerExecutor as Z, workspaceArgs as Zt, getWorkspace as _, waitForExecution$1 as _t, updateUser as a, startWorkflow as at, createCommand as b, bundleMigrationScript as bt, listCommand as c, executionsCommand as ct, inviteUser as d, functionExecutionStatusToString as dt, getExecutorJob as et, restoreCommand as f, formatKeyValueTable as ft, getCommand as g, executeScript as gt, listWorkspaces as h, apply as ht, updateCommand as i, startCommand as it, truncateCommand as j, getMigrationDirPath as jt, listWorkflows as k, formatMigrationNumber as kt, listUsers as l, getWorkflowExecution as lt, listCommand$1 as m, getExecutor as mt, queryCommand as n, listExecutorJobs as nt, removeCommand as o, getCommand$2 as ot, restoreWorkspace as p, getCommand$3 as pt, generate$1 as q, commonArgs as qt, isCLIError as r, watchExecutorJob as rt, removeUser as s, getWorkflow as st, query as t, jobsCommand as tt, inviteCommand as u, listWorkflowExecutions as ut, deleteCommand as v, MIGRATION_LABEL_KEY as vt, getAppHealth as w, MIGRATE_FILE_NAME as wt, createWorkspace as x, DB_TYPES_FILE_NAME as xt, deleteWorkspace as y, parseMigrationLabelNumber as yt, listCommand$4 as z, formatMigrationDiff as zt };
12484
- //# sourceMappingURL=query-CRSZGUmD.mjs.map
12508
+ export { listExecutors as $, truncate as A, getLatestMigrationNumber as At, listOAuth2Clients as B, hasChanges as Bt, listCommand$2 as C, INITIAL_SCHEMA_NUMBER as Ct, resumeWorkflow as D, compareSnapshots as Dt, resumeCommand as E, compareLocalTypesWithSnapshot as Et, show as F, isValidMigrationNumber as Ft, listCommand$5 as G, apiCall as Gt, getOAuth2Client as H, prompt as Ht, showCommand as I, loadDiff as It, listWebhookExecutors as J, commonArgs as Jt, listMachineUsers as K, apiCommand as Kt, remove as L, reconstructSnapshotFromMigrations as Lt, generate as M, getMigrationFilePath as Mt, generateCommand as N, getMigrationFiles as Nt, listCommand$3 as O, createSnapshotFromLocalTypes as Ot, logBetaWarning as P, getNextMigrationNumber as Pt, listCommand$6 as Q, workspaceArgs as Qt, removeCommand$1 as R, formatDiffSummary as Rt, listApps as S, DIFF_FILE_NAME as St, healthCommand as T, SCHEMA_FILE_NAME as Tt, getMachineUserToken as U, trnPrefix as Ut, getCommand$1 as V, getNamespacesWithMigrations as Vt, tokenCommand as W, generateUserTypes as Wt, triggerCommand as X, deploymentArgs as Xt, webhookCommand as Y, confirmationArgs as Yt, triggerExecutor as Z, isVerbose as Zt, getWorkspace as _, waitForExecution$1 as _t, updateUser as a, startWorkflow as at, createCommand as b, bundleMigrationScript as bt, listCommand as c, executionsCommand as ct, inviteUser as d, functionExecutionStatusToString as dt, getExecutorJob as et, restoreCommand as f, formatKeyValueTable as ft, getCommand as g, executeScript as gt, listWorkspaces as h, apply as ht, updateCommand as i, startCommand as it, truncateCommand as j, getMigrationDirPath as jt, listWorkflows as k, formatMigrationNumber as kt, listUsers as l, getWorkflowExecution as lt, listCommand$1 as m, getExecutor as mt, queryCommand as n, listExecutorJobs as nt, removeCommand as o, getCommand$2 as ot, restoreWorkspace as p, getCommand$3 as pt, generate$1 as q, defineAppCommand as qt, isCLIError as r, watchExecutorJob as rt, removeUser as s, getWorkflow as st, query as t, jobsCommand as tt, inviteCommand as u, listWorkflowExecutions as ut, deleteCommand as v, MIGRATION_LABEL_KEY as vt, getAppHealth as w, MIGRATE_FILE_NAME as wt, createWorkspace as x, DB_TYPES_FILE_NAME as xt, deleteWorkspace as y, parseMigrationLabelNumber as yt, listCommand$4 as z, formatMigrationDiff as zt };
12509
+ //# sourceMappingURL=query-BpppEOzu.mjs.map