@tailor-platform/sdk 1.37.0 → 1.38.0

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.
Files changed (55) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/dist/application-C1ipG5Q6.mjs +4 -0
  3. package/dist/{application-qRGMV8Tr.mjs → application-DhQrXEld.mjs} +13 -5
  4. package/dist/{application-qRGMV8Tr.mjs.map → application-DhQrXEld.mjs.map} +1 -1
  5. package/dist/cli/index.mjs +364 -123
  6. package/dist/cli/index.mjs.map +1 -1
  7. package/dist/cli/lib.d.mts +6 -6
  8. package/dist/cli/lib.mjs +3 -3
  9. package/dist/{client-424n_3T9.mjs → client-BWAbbA1C.mjs} +1 -1
  10. package/dist/{client-DllDLYmZ.mjs → client-xzPXtc_e.mjs} +9 -3
  11. package/dist/{client-DllDLYmZ.mjs.map → client-xzPXtc_e.mjs.map} +1 -1
  12. package/dist/configure/index.d.mts +4 -5
  13. package/dist/configure/index.mjs +4 -1
  14. package/dist/configure/index.mjs.map +1 -1
  15. package/dist/{crash-report-aHnky_xH.mjs → crash-report-BEAiCSCl.mjs} +1 -1
  16. package/dist/{crash-report-CDQ2JvgR.mjs → crash-report-DXhPL8Ue.mjs} +3 -3
  17. package/dist/{crash-report-CDQ2JvgR.mjs.map → crash-report-DXhPL8Ue.mjs.map} +1 -1
  18. package/dist/errors-D9f2UJpT.mjs +43 -0
  19. package/dist/errors-D9f2UJpT.mjs.map +1 -0
  20. package/dist/{index-CeS4FA9o.d.mts → index-CHo73Aat.d.mts} +2 -2
  21. package/dist/{index-DnIg_LfT.d.mts → index-CIIXsk3E.d.mts} +2 -2
  22. package/dist/{index-BUT18Kak.d.mts → index-Cln_TTZn.d.mts} +2 -2
  23. package/dist/{index-BVJQLjyN.d.mts → index-Cs3fwmLu.d.mts} +22 -17
  24. package/dist/{index-C3kcXHXJ.d.mts → index-D_W9-Lvk.d.mts} +2 -2
  25. package/dist/{interceptor-dSNiQq71.mjs → interceptor-CzaH2Ur6.mjs} +1 -1
  26. package/dist/{interceptor-dSNiQq71.mjs.map → interceptor-CzaH2Ur6.mjs.map} +1 -1
  27. package/dist/{logger-C8qBDCKO.mjs → logger-5_JMzHmw.mjs} +42 -3
  28. package/dist/logger-5_JMzHmw.mjs.map +1 -0
  29. package/dist/plugin/builtin/enum-constants/index.d.mts +1 -1
  30. package/dist/plugin/builtin/file-utils/index.d.mts +1 -1
  31. package/dist/plugin/builtin/kysely-type/index.d.mts +1 -1
  32. package/dist/plugin/builtin/seed/index.d.mts +1 -1
  33. package/dist/plugin/index.d.mts +1 -2
  34. package/dist/{plugin-D6P4g_2L.d.mts → plugin-D84blivd.d.mts} +54 -3
  35. package/dist/{runtime-D9ejnCm6.mjs → runtime-ChpwtPut.mjs} +26 -54
  36. package/dist/runtime-ChpwtPut.mjs.map +1 -0
  37. package/dist/service-Bcp6JB3w.mjs +132 -0
  38. package/dist/service-Bcp6JB3w.mjs.map +1 -0
  39. package/dist/utils/test/index.d.mts +2 -2
  40. package/dist/utils/test/index.mjs +6 -2
  41. package/dist/utils/test/index.mjs.map +1 -1
  42. package/dist/{workflow.generated-Bj_DVqGh.d.mts → workflow.generated-BRdcCWfC.d.mts} +2 -2
  43. package/docs/cli/function.md +42 -16
  44. package/docs/cli/upgrade.md +51 -0
  45. package/docs/cli/user.md +1 -1
  46. package/docs/cli/workflow.md +10 -10
  47. package/docs/cli-reference.md +23 -14
  48. package/docs/configuration.md +9 -7
  49. package/docs/services/executor.md +39 -0
  50. package/docs/services/tailordb.md +20 -0
  51. package/package.json +7 -7
  52. package/dist/application-ILhZq_oW.mjs +0 -4
  53. package/dist/env-04IQXqsl.d.mts +0 -30
  54. package/dist/logger-C8qBDCKO.mjs.map +0 -1
  55. package/dist/runtime-D9ejnCm6.mjs.map +0 -1
@@ -0,0 +1,43 @@
1
+
2
+ import chalk from "chalk";
3
+
4
+ //#region src/cli/shared/errors.ts
5
+ /**
6
+ * Format CLI error for output
7
+ * @param error - CLIError instance to format
8
+ * @returns Formatted error message
9
+ */
10
+ function formatError(error) {
11
+ const parts = [chalk.red(`Error${error.code ? ` [${error.code}]` : ""}: ${error.message}`)];
12
+ if (error.details) parts.push(`\n ${chalk.gray("Details:")} ${error.details}`);
13
+ if (error.suggestion) parts.push(`\n ${chalk.cyan("Suggestion:")} ${error.suggestion}`);
14
+ if (error.command) parts.push(`\n ${chalk.gray("Help:")} Run \`tailor-sdk ${error.command} --help\` for usage information.`);
15
+ return parts.join("");
16
+ }
17
+ /**
18
+ * Create a CLI error with formatted output
19
+ * @param options - Options to construct a CLIError
20
+ * @returns Constructed CLIError instance
21
+ */
22
+ function createCLIError(options) {
23
+ const error = new Error(options.message);
24
+ error.name = "CLIError";
25
+ error.code = options.code;
26
+ error.details = options.details;
27
+ error.suggestion = options.suggestion;
28
+ error.command = options.command;
29
+ error.format = () => formatError(error);
30
+ return error;
31
+ }
32
+ /**
33
+ * Type guard to check if an error is a CLIError
34
+ * @param error - Error to check
35
+ * @returns True if the error is a CLIError
36
+ */
37
+ function isCLIError(error) {
38
+ return error instanceof Error && error.name === "CLIError";
39
+ }
40
+
41
+ //#endregion
42
+ export { isCLIError as n, createCLIError as t };
43
+ //# sourceMappingURL=errors-D9f2UJpT.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors-D9f2UJpT.mjs","names":[],"sources":["../src/cli/shared/errors.ts"],"sourcesContent":["import chalk from \"chalk\";\n\n/**\n * Options for creating a CLI error\n */\nexport interface CLIErrorOptions {\n message: string;\n details?: string;\n suggestion?: string;\n command?: string;\n code?: string;\n}\n\n/**\n * CLI error interface with formatted output\n */\nexport interface CLIError extends Error {\n readonly code?: string;\n readonly details?: string;\n readonly suggestion?: string;\n readonly command?: string;\n format(): string;\n}\n\ntype CLIErrorInternal = Error & {\n code?: string;\n details?: string;\n suggestion?: string;\n command?: string;\n format(): string;\n};\n\n/**\n * Format CLI error for output\n * @param error - CLIError instance to format\n * @returns Formatted error message\n */\nfunction formatError(error: CLIError): string {\n const parts: string[] = [\n chalk.red(`Error${error.code ? ` [${error.code}]` : \"\"}: ${error.message}`),\n ];\n\n if (error.details) {\n parts.push(`\\n ${chalk.gray(\"Details:\")} ${error.details}`);\n }\n\n if (error.suggestion) {\n parts.push(`\\n ${chalk.cyan(\"Suggestion:\")} ${error.suggestion}`);\n }\n\n if (error.command) {\n parts.push(\n `\\n ${chalk.gray(\"Help:\")} Run \\`tailor-sdk ${error.command} --help\\` for usage information.`,\n );\n }\n\n return parts.join(\"\");\n}\n\n/**\n * Create a CLI error with formatted output\n * @param options - Options to construct a CLIError\n * @returns Constructed CLIError instance\n */\nfunction createCLIError(options: CLIErrorOptions): CLIError {\n const error = new Error(options.message) as CLIErrorInternal;\n error.name = \"CLIError\";\n error.code = options.code;\n error.details = options.details;\n error.suggestion = options.suggestion;\n error.command = options.command;\n error.format = () => formatError(error);\n return error;\n}\n\n/**\n * Type guard to check if an error is a CLIError\n * @param error - Error to check\n * @returns True if the error is a CLIError\n */\nexport function isCLIError(error: unknown): error is CLIError {\n return error instanceof Error && error.name === \"CLIError\";\n}\n\n// Re-export createCLIError as CLIError for backward compatibility\nexport { createCLIError as CLIError };\n"],"mappings":";;;;;;;;;AAqCA,SAAS,YAAY,OAAyB;CAC5C,MAAM,QAAkB,CACtB,MAAM,IAAI,QAAQ,MAAM,OAAO,KAAK,MAAM,KAAK,KAAK,GAAG,IAAI,MAAM,UAAU,CAC5E;AAED,KAAI,MAAM,QACR,OAAM,KAAK,OAAO,MAAM,KAAK,WAAW,CAAC,GAAG,MAAM,UAAU;AAG9D,KAAI,MAAM,WACR,OAAM,KAAK,OAAO,MAAM,KAAK,cAAc,CAAC,GAAG,MAAM,aAAa;AAGpE,KAAI,MAAM,QACR,OAAM,KACJ,OAAO,MAAM,KAAK,QAAQ,CAAC,oBAAoB,MAAM,QAAQ,kCAC9D;AAGH,QAAO,MAAM,KAAK,GAAG;;;;;;;AAQvB,SAAS,eAAe,SAAoC;CAC1D,MAAM,QAAQ,IAAI,MAAM,QAAQ,QAAQ;AACxC,OAAM,OAAO;AACb,OAAM,OAAO,QAAQ;AACrB,OAAM,UAAU,QAAQ;AACxB,OAAM,aAAa,QAAQ;AAC3B,OAAM,UAAU,QAAQ;AACxB,OAAM,eAAe,YAAY,MAAM;AACvC,QAAO;;;;;;;AAQT,SAAgB,WAAW,OAAmC;AAC5D,QAAO,iBAAiB,SAAS,MAAM,SAAS"}
@@ -1,5 +1,5 @@
1
1
  /// <reference types="@tailor-platform/function-types" />
2
- import { n as Plugin } from "./plugin-D6P4g_2L.mjs";
2
+ import { n as Plugin } from "./plugin-D84blivd.mjs";
3
3
 
4
4
  //#region src/plugin/builtin/enum-constants/index.d.ts
5
5
  /** Unique identifier for the enum constants generator plugin. */
@@ -16,4 +16,4 @@ type EnumConstantsPluginOptions = {
16
16
  declare function enumConstantsPlugin(options: EnumConstantsPluginOptions): Plugin<unknown, EnumConstantsPluginOptions>;
17
17
  //#endregion
18
18
  export { enumConstantsPlugin as n, EnumConstantsGeneratorID as t };
19
- //# sourceMappingURL=index-CeS4FA9o.d.mts.map
19
+ //# sourceMappingURL=index-CHo73Aat.d.mts.map
@@ -1,5 +1,5 @@
1
1
  /// <reference types="@tailor-platform/function-types" />
2
- import { n as Plugin } from "./plugin-D6P4g_2L.mjs";
2
+ import { n as Plugin } from "./plugin-D84blivd.mjs";
3
3
 
4
4
  //#region src/plugin/builtin/seed/index.d.ts
5
5
  /** Unique identifier for the seed generator plugin. */
@@ -18,4 +18,4 @@ type SeedPluginOptions = {
18
18
  declare function seedPlugin(options: SeedPluginOptions): Plugin<unknown, SeedPluginOptions>;
19
19
  //#endregion
20
20
  export { seedPlugin as n, SeedGeneratorID as t };
21
- //# sourceMappingURL=index-DnIg_LfT.d.mts.map
21
+ //# sourceMappingURL=index-CIIXsk3E.d.mts.map
@@ -1,5 +1,5 @@
1
1
  /// <reference types="@tailor-platform/function-types" />
2
- import { n as Plugin } from "./plugin-D6P4g_2L.mjs";
2
+ import { n as Plugin } from "./plugin-D84blivd.mjs";
3
3
 
4
4
  //#region src/plugin/builtin/kysely-type/index.d.ts
5
5
  /** Unique identifier for the Kysely type generator plugin. */
@@ -16,4 +16,4 @@ type KyselyTypePluginOptions = {
16
16
  declare function kyselyTypePlugin(options: KyselyTypePluginOptions): Plugin<unknown, KyselyTypePluginOptions>;
17
17
  //#endregion
18
18
  export { kyselyTypePlugin as n, KyselyGeneratorID as t };
19
- //# sourceMappingURL=index-BUT18Kak.d.mts.map
19
+ //# sourceMappingURL=index-Cln_TTZn.d.mts.map
@@ -1,24 +1,12 @@
1
1
  /// <reference types="@tailor-platform/function-types" />
2
- import { $ as FieldOptions, At as WebhookOperation$1, Ct as FunctionOperation$1, Dt as ResolverExecutedTrigger$1, Et as IncomingWebhookTrigger$1, F as UserAttributeListKey, H as TailorDBInstance, I as UserAttributeMap, Mt as AuthInvoker$1, Ot as ScheduleTriggerInput, Q as FieldMetadata, St as ExecutorInput, Tt as IdpUserTrigger$1, U as TailorDBType, X as ArrayFieldOutput, Z as DefinedFieldMetadata, _t as Resolver, at as JsonCompatible, bt as AuthAccessTokenTrigger$1, dt as TailorUser, et as FieldOutput, it as InferFieldsOutput, j as DefinedAuth, jt as WorkflowOperation$1, k as AuthServiceInput, kt as TailorDBTrigger$1, mt as AllowedValuesOutput, n as Plugin, nt as TailorAnyField, ot as output$1, pt as AllowedValues, rt as TailorField, tt as TailorFieldType, ut as InferredAttributeMap, vt as ResolverInput, wt as GqlOperation$1, yt as GeneratorConfig } from "./plugin-D6P4g_2L.mjs";
3
- import { n as TailorEnv, r as TailorActor } from "./env-04IQXqsl.mjs";
4
- import { _ as IdpDefinitionBrand, g as IdPUserField, n as AppConfig, t as RetryPolicy, x as IdPInput } from "./workflow.generated-Bj_DVqGh.mjs";
2
+ import { $ as FieldOptions, At as IdpUserTrigger$1, Ct as ResolverInput, Dt as ExecutorInput, F as UserAttributeListKey, Ft as WebhookOperation$1, H as TailorDBInstance, I as UserAttributeMap, It as WorkflowOperation$1, Lt as AuthInvoker$1, Mt as ResolverExecutedTrigger$1, Nt as ScheduleTriggerInput, Ot as FunctionOperation$1, Pt as TailorDBTrigger$1, Q as FieldMetadata, St as Resolver, Tt as AuthAccessTokenTrigger$1, U as TailorDBType, X as ArrayFieldOutput, Z as DefinedFieldMetadata, at as JsonCompatible, ct as MachineUserName, dt as TailorEnv, et as FieldOutput, ft as TailorActor, gt as TailorUser, ht as InferredAttributeMap, it as InferFieldsOutput, j as DefinedAuth, jt as IncomingWebhookTrigger$1, k as AuthServiceInput, kt as GqlOperation$1, n as Plugin, nt as TailorAnyField, ot as JsonValue, rt as TailorField, st as output$1, tt as TailorFieldType, vt as AllowedValues, wt as GeneratorConfig, yt as AllowedValuesOutput } from "./plugin-D84blivd.mjs";
3
+ import { _ as IdpDefinitionBrand, g as IdPUserField, n as AppConfig, t as RetryPolicy, x as IdPInput } from "./workflow.generated-BRdcCWfC.mjs";
5
4
  import * as _$zod from "zod";
6
5
  import { JsonPrimitive, Jsonifiable, Jsonify } from "type-fest";
7
6
  import { Client } from "@urql/core";
8
7
  import { StandardCRON } from "ts-cron-validator";
9
8
  import * as _$zod_v4_core0 from "zod/v4/core";
10
9
 
11
- //#region src/configure/types/machine-user.d.ts
12
- interface MachineUserNameRegistry {}
13
- /**
14
- * Machine user name.
15
- *
16
- * When `tailor.d.ts` is generated (via `tailor-sdk apply`/`generate`), this is narrowed
17
- * to the union of defined machine user names. When no machine users are registered yet,
18
- * falls back to `string` to avoid blocking editing before the first generate run.
19
- */
20
- type MachineUserName = keyof MachineUserNameRegistry extends never ? string : keyof MachineUserNameRegistry & string;
21
- //#endregion
22
10
  //#region src/configure/services/auth/index.d.ts
23
11
  type MachineUserAttributeFields = Record<string, TailorField<DefinedFieldMetadata, unknown, FieldMetadata, TailorFieldType>>;
24
12
  type PlaceholderUser = TailorDBInstance<Record<string, never>, Record<string, never>>;
@@ -626,15 +614,32 @@ interface IncomingWebhookRequest {
626
614
  body: Record<string, unknown>;
627
615
  headers: Record<string, string>;
628
616
  }
617
+ interface IncomingWebhookResponseConfig<Args> {
618
+ /**
619
+ * Expression that returns the webhook HTTP response body.
620
+ * Receives the same args as the executor operation.
621
+ */
622
+ body?: (args: Args) => JsonValue;
623
+ /**
624
+ * HTTP status code for the response.
625
+ * If omitted and `body` is set, the platform uses 200.
626
+ */
627
+ statusCode?: number;
628
+ }
629
+ type IncomingWebhookResponse<Args> = ((args: Args) => JsonValue) | IncomingWebhookResponseConfig<Args>;
630
+ interface IncomingWebhookTriggerOptions<Args> {
631
+ response?: IncomingWebhookResponse<Args>;
632
+ }
629
633
  type IncomingWebhookTrigger<Args> = IncomingWebhookTrigger$1 & {
630
634
  __args: Args;
631
635
  };
632
636
  /**
633
637
  * Create a trigger for incoming webhook requests.
634
638
  * @template T
639
+ * @param options - Optional trigger options including response configuration
635
640
  * @returns Incoming webhook trigger
636
641
  */
637
- declare function incomingWebhookTrigger<T extends IncomingWebhookRequest>(): IncomingWebhookTrigger<IncomingWebhookArgs<T>>;
642
+ declare function incomingWebhookTrigger<T extends IncomingWebhookRequest>(options?: IncomingWebhookTriggerOptions<IncomingWebhookArgs<T>>): IncomingWebhookTrigger<IncomingWebhookArgs<T>>;
638
643
  //#endregion
639
644
  //#region src/configure/services/executor/trigger/index.d.ts
640
645
  type Trigger<Args> = TailorDBTrigger<Args> | ResolverExecutedTrigger<Args> | ScheduleTrigger<Args> | IncomingWebhookTrigger<Args> | IdpUserTrigger<Args> | AuthAccessTokenTrigger<Args>;
@@ -955,5 +960,5 @@ declare namespace t {
955
960
  type infer<T> = TailorOutput<T>;
956
961
  }
957
962
  //#endregion
958
- export { WorkflowOperation as $, RecordCreatedArgs as A, idpUserCreatedTrigger as B, AuthAccessTokenRevokedArgs as C, IdpUserDeletedArgs as D, IdpUserCreatedArgs as E, TailorDBTrigger as F, recordDeletedTrigger as G, idpUserTrigger as H, authAccessTokenIssuedTrigger as I, resolverExecutedTrigger as J, recordTrigger as K, authAccessTokenRefreshedTrigger as L, RecordUpdatedArgs as M, ResolverExecutedArgs as N, IdpUserTrigger as O, ResolverExecutedTrigger as P, WebhookOperation as Q, authAccessTokenRevokedTrigger as R, AuthAccessTokenRefreshedArgs as S, IdpUserArgs as T, idpUserUpdatedTrigger as U, idpUserDeletedTrigger as V, recordCreatedTrigger as W, GqlOperation as X, FunctionOperation as Y, Operation as Z, ScheduleArgs as _, defineGenerators as a, WorkflowJobContext as at, AuthAccessTokenArgs as b, IdPPermission as c, createWorkflowJob as ct, createExecutor as d, AuthInvoker as dt, Workflow as et, Trigger as f, defineAuth as ft, incomingWebhookTrigger as g, IncomingWebhookTrigger as h, defineConfig as i, WorkflowJob as it, RecordDeletedArgs as j, IdpUserUpdatedArgs as k, IdPPermissionCondition as l, QueryType as lt, IncomingWebhookRequest as m, MachineUserNameRegistry as mt, output as n, createWorkflow as nt, definePlugins as o, WorkflowJobInput as ot, IncomingWebhookArgs as p, MachineUserName as pt, recordUpdatedTrigger as q, t as r, WORKFLOW_TEST_ENV_KEY as rt, defineIdp as s, WorkflowJobOutput as st, infer as t, WorkflowConfig as tt, unsafeAllowAllIdPPermission as u, createResolver as ut, ScheduleTrigger as v, AuthAccessTokenTrigger as w, AuthAccessTokenIssuedArgs as x, scheduleTrigger as y, authAccessTokenTrigger as z };
959
- //# sourceMappingURL=index-BVJQLjyN.d.mts.map
963
+ export { GqlOperation as $, IdpUserDeletedArgs as A, authAccessTokenRefreshedTrigger as B, AuthAccessTokenArgs as C, AuthAccessTokenTrigger as D, AuthAccessTokenRevokedArgs as E, RecordUpdatedArgs as F, idpUserTrigger as G, authAccessTokenTrigger as H, ResolverExecutedArgs as I, recordDeletedTrigger as J, idpUserUpdatedTrigger as K, ResolverExecutedTrigger as L, IdpUserUpdatedArgs as M, RecordCreatedArgs as N, IdpUserArgs as O, RecordDeletedArgs as P, FunctionOperation as Q, TailorDBTrigger as R, scheduleTrigger as S, AuthAccessTokenRefreshedArgs as T, idpUserCreatedTrigger as U, authAccessTokenRevokedTrigger as V, idpUserDeletedTrigger as W, recordUpdatedTrigger as X, recordTrigger as Y, resolverExecutedTrigger as Z, IncomingWebhookTrigger as _, defineGenerators as a, createWorkflow as at, ScheduleArgs as b, IdPPermission as c, WorkflowJobContext as ct, createExecutor as d, createWorkflowJob as dt, Operation as et, Trigger as f, QueryType as ft, IncomingWebhookResponseConfig as g, IncomingWebhookResponse as h, defineAuth as ht, defineConfig as i, WorkflowConfig as it, IdpUserTrigger as j, IdpUserCreatedArgs as k, IdPPermissionCondition as l, WorkflowJobInput as lt, IncomingWebhookRequest as m, AuthInvoker as mt, output as n, WorkflowOperation as nt, definePlugins as o, WORKFLOW_TEST_ENV_KEY as ot, IncomingWebhookArgs as p, createResolver as pt, recordCreatedTrigger as q, t as r, Workflow as rt, defineIdp as s, WorkflowJob as st, infer as t, WebhookOperation as tt, unsafeAllowAllIdPPermission as u, WorkflowJobOutput as ut, IncomingWebhookTriggerOptions as v, AuthAccessTokenIssuedArgs as w, ScheduleTrigger as x, incomingWebhookTrigger as y, authAccessTokenIssuedTrigger as z };
964
+ //# sourceMappingURL=index-Cs3fwmLu.d.mts.map
@@ -1,5 +1,5 @@
1
1
  /// <reference types="@tailor-platform/function-types" />
2
- import { n as Plugin } from "./plugin-D6P4g_2L.mjs";
2
+ import { n as Plugin } from "./plugin-D84blivd.mjs";
3
3
 
4
4
  //#region src/plugin/builtin/file-utils/index.d.ts
5
5
  /** Unique identifier for the file utilities generator plugin. */
@@ -16,4 +16,4 @@ type FileUtilsPluginOptions = {
16
16
  declare function fileUtilsPlugin(options: FileUtilsPluginOptions): Plugin<unknown, FileUtilsPluginOptions>;
17
17
  //#endregion
18
18
  export { fileUtilsPlugin as n, FileUtilsGeneratorID as t };
19
- //# sourceMappingURL=index-C3kcXHXJ.d.mts.map
19
+ //# sourceMappingURL=index-D_W9-Lvk.d.mts.map
@@ -31,4 +31,4 @@ function createTracingInterceptor() {
31
31
 
32
32
  //#endregion
33
33
  export { createTracingInterceptor };
34
- //# sourceMappingURL=interceptor-dSNiQq71.mjs.map
34
+ //# sourceMappingURL=interceptor-CzaH2Ur6.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"interceptor-dSNiQq71.mjs","names":[],"sources":["../src/cli/telemetry/interceptor.ts"],"sourcesContent":["import { trace, SpanStatusCode } from \"@opentelemetry/api\";\nimport type { Interceptor } from \"@connectrpc/connect\";\n\n/**\n * Create a Connect-RPC interceptor that records OTLP spans for each RPC call.\n * When no TracerProvider is registered, the OTel API automatically provides\n * noop spans with zero overhead.\n * @returns Tracing interceptor\n */\nexport function createTracingInterceptor(): Interceptor {\n return (next) => async (req) => {\n const tracer = trace.getTracer(\"tailor-sdk\");\n\n return tracer.startActiveSpan(`rpc.${req.method.name}`, async (span) => {\n span.setAttribute(\"rpc.method\", req.method.name);\n span.setAttribute(\"rpc.service\", \"OperatorService\");\n span.setAttribute(\"rpc.system\", \"connect-rpc\");\n\n try {\n const response = await next(req);\n span.setStatus({ code: SpanStatusCode.OK });\n return response;\n } catch (error) {\n span.setStatus({ code: SpanStatusCode.ERROR });\n if (error instanceof Error) {\n span.recordException(error);\n }\n throw error;\n } finally {\n span.end();\n }\n });\n };\n}\n"],"mappings":";;;;;;;;;;AASA,SAAgB,2BAAwC;AACtD,SAAQ,SAAS,OAAO,QAAQ;AAG9B,SAFe,MAAM,UAAU,aAAa,CAE9B,gBAAgB,OAAO,IAAI,OAAO,QAAQ,OAAO,SAAS;AACtE,QAAK,aAAa,cAAc,IAAI,OAAO,KAAK;AAChD,QAAK,aAAa,eAAe,kBAAkB;AACnD,QAAK,aAAa,cAAc,cAAc;AAE9C,OAAI;IACF,MAAM,WAAW,MAAM,KAAK,IAAI;AAChC,SAAK,UAAU,EAAE,MAAM,eAAe,IAAI,CAAC;AAC3C,WAAO;YACA,OAAO;AACd,SAAK,UAAU,EAAE,MAAM,eAAe,OAAO,CAAC;AAC9C,QAAI,iBAAiB,MACnB,MAAK,gBAAgB,MAAM;AAE7B,UAAM;aACE;AACR,SAAK,KAAK;;IAEZ"}
1
+ {"version":3,"file":"interceptor-CzaH2Ur6.mjs","names":[],"sources":["../src/cli/telemetry/interceptor.ts"],"sourcesContent":["import { trace, SpanStatusCode } from \"@opentelemetry/api\";\nimport type { Interceptor } from \"@connectrpc/connect\";\n\n/**\n * Create a Connect-RPC interceptor that records OTLP spans for each RPC call.\n * When no TracerProvider is registered, the OTel API automatically provides\n * noop spans with zero overhead.\n * @returns Tracing interceptor\n */\nexport function createTracingInterceptor(): Interceptor {\n return (next) => async (req) => {\n const tracer = trace.getTracer(\"tailor-sdk\");\n\n return tracer.startActiveSpan(`rpc.${req.method.name}`, async (span) => {\n span.setAttribute(\"rpc.method\", req.method.name);\n span.setAttribute(\"rpc.service\", \"OperatorService\");\n span.setAttribute(\"rpc.system\", \"connect-rpc\");\n\n try {\n const response = await next(req);\n span.setStatus({ code: SpanStatusCode.OK });\n return response;\n } catch (error) {\n span.setStatus({ code: SpanStatusCode.ERROR });\n if (error instanceof Error) {\n span.recordException(error);\n }\n throw error;\n } finally {\n span.end();\n }\n });\n };\n}\n"],"mappings":";;;;;;;;;;AASA,SAAgB,2BAAwC;AACtD,SAAQ,SAAS,OAAO,QAAQ;AAG9B,SAFe,MAAM,UAAU,aAAa,CAE9B,gBAAgB,OAAO,IAAI,OAAO,QAAQ,OAAO,SAAS;AACtE,QAAK,aAAa,cAAc,IAAI,OAAO,KAAK;AAChD,QAAK,aAAa,eAAe,kBAAkB;AACnD,QAAK,aAAa,cAAc,cAAc;AAE9C,OAAI;IACF,MAAM,WAAW,MAAM,KAAK,IAAI;AAChC,SAAK,UAAU,EAAE,MAAM,eAAe,IAAI,CAAC;AAC3C,WAAO;YACA,OAAO;AACd,SAAK,UAAU,EAAE,MAAM,eAAe,OAAO,CAAC;AAC9C,QAAI,iBAAiB,MACnB,MAAK,gBAAgB,MAAM;AAE7B,UAAM;aACE;AACR,SAAK,KAAK;;IAEZ"}
@@ -4,6 +4,45 @@ import chalk from "chalk";
4
4
  import { formatDistanceToNowStrict } from "date-fns";
5
5
  import { getBorderCharacters, table } from "table";
6
6
 
7
+ //#region src/cli/shared/parse-boolean.ts
8
+ const TRUTHY_VALUES = new Set([
9
+ "true",
10
+ "t",
11
+ "yes",
12
+ "y",
13
+ "on",
14
+ "1"
15
+ ]);
16
+ const FALSY_VALUES = new Set([
17
+ "false",
18
+ "f",
19
+ "no",
20
+ "n",
21
+ "off",
22
+ "0"
23
+ ]);
24
+ /**
25
+ * Parse a string value as a boolean.
26
+ *
27
+ * Recognized values (case-insensitive, trimmed) follow Python's
28
+ * `distutils.util.strtobool` convention:
29
+ * - truthy: `true, t, yes, y, on, 1`
30
+ * - falsy: `false, f, no, n, off, 0`
31
+ *
32
+ * Undefined, empty strings, and unrecognized values return `undefined` so
33
+ * that callers can fall back to their own defaults.
34
+ * @param value - The input string (e.g. an environment variable or CLI flag value)
35
+ * @returns `true`, `false`, or `undefined` when the value is unset or unrecognized
36
+ */
37
+ function parseBoolean(value) {
38
+ if (value === void 0) return void 0;
39
+ const normalized = value.trim().toLowerCase();
40
+ if (normalized === "") return void 0;
41
+ if (TRUTHY_VALUES.has(normalized)) return true;
42
+ if (FALSY_VALUES.has(normalized)) return false;
43
+ }
44
+
45
+ //#endregion
7
46
  //#region src/cli/shared/logger.ts
8
47
  /**
9
48
  * Error thrown when a prompt is attempted in a CI environment
@@ -128,7 +167,7 @@ const logger = {
128
167
  process.stderr.write("\n");
129
168
  },
130
169
  debug(message) {
131
- if (process.env.DEBUG === "true") writeLog("log", styles.dim(message), { mode: "plain" });
170
+ if (parseBoolean(process.env.DEBUG) === true) writeLog("log", styles.dim(message), { mode: "plain" });
132
171
  },
133
172
  out(data, options) {
134
173
  if (typeof data === "string") {
@@ -178,5 +217,5 @@ const logger = {
178
217
  };
179
218
 
180
219
  //#endregion
181
- export { symbols as i, logger as n, styles as r, CIPromptError as t };
182
- //# sourceMappingURL=logger-C8qBDCKO.mjs.map
220
+ export { parseBoolean as a, symbols as i, logger as n, styles as r, CIPromptError as t };
221
+ //# sourceMappingURL=logger-5_JMzHmw.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger-5_JMzHmw.mjs","names":[],"sources":["../src/cli/shared/parse-boolean.ts","../src/cli/shared/logger.ts"],"sourcesContent":["const TRUTHY_VALUES = new Set([\"true\", \"t\", \"yes\", \"y\", \"on\", \"1\"]);\nconst FALSY_VALUES = new Set([\"false\", \"f\", \"no\", \"n\", \"off\", \"0\"]);\n\n/**\n * Parse a string value as a boolean.\n *\n * Recognized values (case-insensitive, trimmed) follow Python's\n * `distutils.util.strtobool` convention:\n * - truthy: `true, t, yes, y, on, 1`\n * - falsy: `false, f, no, n, off, 0`\n *\n * Undefined, empty strings, and unrecognized values return `undefined` so\n * that callers can fall back to their own defaults.\n * @param value - The input string (e.g. an environment variable or CLI flag value)\n * @returns `true`, `false`, or `undefined` when the value is unset or unrecognized\n */\nexport function parseBoolean(value: string | undefined): boolean | undefined {\n if (value === undefined) return undefined;\n const normalized = value.trim().toLowerCase();\n if (normalized === \"\") return undefined;\n if (TRUTHY_VALUES.has(normalized)) return true;\n if (FALSY_VALUES.has(normalized)) return false;\n return undefined;\n}\n","import { formatWithOptions, type InspectOptions } from \"node:util\";\nimport chalk from \"chalk\";\nimport { formatDistanceToNowStrict } from \"date-fns\";\nimport { getBorderCharacters, table } from \"table\";\nimport { parseBoolean } from \"./parse-boolean\";\n\n/**\n * Error thrown when a prompt is attempted in a CI environment\n */\nexport class CIPromptError extends Error {\n constructor(message?: string) {\n super(\n message ??\n \"Interactive prompts are not available in CI environments. Use --yes flag to skip confirmation prompts.\",\n );\n this.name = \"CIPromptError\";\n }\n}\n\n/**\n * Semantic style functions for inline text styling\n */\nexport const styles = {\n // Status colors\n success: chalk.green,\n error: chalk.red,\n warning: chalk.yellow,\n info: chalk.cyan,\n\n // Action colors (for change sets)\n create: chalk.green,\n update: chalk.yellow,\n delete: chalk.red,\n unchanged: chalk.gray,\n\n // Emphasis\n bold: chalk.bold,\n dim: chalk.gray,\n highlight: chalk.cyanBright,\n successBright: chalk.greenBright,\n errorBright: chalk.redBright,\n\n // Resource types\n resourceType: chalk.bold,\n resourceName: chalk.cyan,\n\n // File paths\n path: chalk.cyan,\n\n // Values\n value: chalk.white,\n placeholder: chalk.gray.italic,\n};\n\n/**\n * Standardized symbols for CLI output\n */\nexport const symbols = {\n success: chalk.green(\"\\u2713\"),\n error: chalk.red(\"\\u2716\"),\n warning: chalk.yellow(\"\\u26a0\"),\n info: chalk.cyan(\"i\"),\n create: chalk.green(\"+\"),\n update: chalk.yellow(\"~\"),\n delete: chalk.red(\"-\"),\n replace: chalk.magenta(\"\\u00b1\"),\n bullet: chalk.gray(\"\\u2022\"),\n arrow: chalk.gray(\"\\u2192\"),\n};\n\n/**\n * Log output modes\n */\nexport type LogMode = \"default\" | \"stream\" | \"plain\";\n\nexport interface LogOptions {\n /** Output mode (default: \"default\") */\n mode?: LogMode;\n /** Number of spaces to indent the entire line (default: 0) */\n indent?: number;\n}\n\n/** Field transformer function. null excludes the field from table output. */\nexport type FieldTransformer = ((value: unknown, item: object) => string) | null;\n\nexport interface OutOptions {\n /** Table display field transform/exclude settings. Only applied in table mode (not JSON). */\n display?: Record<string, FieldTransformer>;\n\n /** Show null values in table output (default: false) */\n showNull?: boolean;\n}\n\n// In JSON mode, all logs go to stderr to keep stdout clean for JSON data\nlet _jsonMode = false;\n\n// Type icons for log output\nconst TYPE_ICONS: Record<string, string> = {\n info: \"ℹ\",\n success: \"✔\",\n warn: \"⚠\",\n error: \"✖\",\n debug: \"⚙\",\n trace: \"→\",\n log: \"\",\n};\n\n// Color functions for icon and message text\nconst TYPE_COLORS: Record<string, (text: string) => string> = {\n info: chalk.cyan,\n success: chalk.green,\n warn: chalk.yellow,\n error: chalk.red,\n debug: chalk.gray,\n trace: chalk.gray,\n log: (text) => text,\n};\n\ninterface FormatLogLineOptions {\n mode: string;\n indent: number;\n type: string;\n message: string;\n timestamp?: string;\n}\n\n/**\n * Formats a log line with the appropriate prefix and indentation\n * @param opts - Formatting options\n * @returns Formatted log line\n */\nexport function formatLogLine(opts: FormatLogLineOptions): string {\n const { mode, indent, type, message, timestamp } = opts;\n const indentPrefix = indent > 0 ? \" \".repeat(indent) : \"\";\n const colorFn = TYPE_COLORS[type] || ((text: string) => text);\n\n // Plain mode: color only, no icon, no timestamp\n if (mode === \"plain\") {\n return `${indentPrefix}${colorFn(message)}\\n`;\n }\n\n // Default/Stream mode: with icon and color\n const icon = TYPE_ICONS[type] || \"\";\n const prefix = icon ? `${icon} ` : \"\";\n const coloredOutput = colorFn(`${prefix}${message}`);\n const timestampPrefix = timestamp ?? \"\";\n\n return `${indentPrefix}${timestampPrefix}${coloredOutput}\\n`;\n}\n\n/**\n * Writes a formatted log line to stderr.\n * @param type - Log type (info, success, warn, error, log)\n * @param message - Log message\n * @param opts - Log options (mode and indent)\n */\nfunction writeLog(type: string, message: string, opts?: LogOptions): void {\n const mode = opts?.mode ?? \"default\";\n const indent = opts?.indent ?? 0;\n const inspectOpts: InspectOptions = {\n breakLength: process.stdout.columns || 80,\n };\n const formattedMessage = formatWithOptions(inspectOpts, message);\n const timestamp = mode === \"stream\" ? `${new Date().toLocaleTimeString()} ` : \"\";\n const output = formatLogLine({ mode, indent, type, message: formattedMessage, timestamp });\n process.stderr.write(output);\n}\n\nexport const logger = {\n get jsonMode(): boolean {\n return _jsonMode;\n },\n set jsonMode(value: boolean) {\n _jsonMode = value;\n },\n\n info(message: string, opts?: LogOptions): void {\n writeLog(\"info\", message, opts);\n },\n\n success(message: string, opts?: LogOptions): void {\n writeLog(\"success\", message, opts);\n },\n\n warn(message: string, opts?: LogOptions): void {\n writeLog(\"warn\", message, opts);\n },\n\n error(message: string, opts?: LogOptions): void {\n writeLog(\"error\", message, opts);\n },\n\n log(message: string): void {\n writeLog(\"log\", message, { mode: \"plain\" });\n },\n\n newline(): void {\n process.stderr.write(\"\\n\");\n },\n\n debug(message: string): void {\n if (parseBoolean(process.env.DEBUG) === true) {\n writeLog(\"log\", styles.dim(message), { mode: \"plain\" });\n }\n },\n\n out(data: string | object | object[], options?: OutOptions): void {\n if (typeof data === \"string\") {\n process.stdout.write(data.endsWith(\"\\n\") ? data : data + \"\\n\");\n return;\n }\n\n if (this.jsonMode) {\n // eslint-disable-next-line no-restricted-syntax\n console.log(JSON.stringify(data));\n return;\n }\n\n const display = options?.display;\n\n // Helper to format a value for table display\n const formatValue = (value: unknown, pretty = false): string => {\n if (options?.showNull && value === null) return \"NULL\";\n if (value === null || value === undefined) return \"N/A\";\n if (value instanceof Date) {\n return formatDistanceToNowStrict(value, { addSuffix: true });\n }\n if (typeof value === \"object\") {\n return pretty ? JSON.stringify(value, null, 2) : JSON.stringify(value);\n }\n return String(value);\n };\n\n // Helper to check if field should be excluded\n const isExcluded = (key: string): boolean => {\n return display !== undefined && key in display && display[key] === null;\n };\n\n // Helper to apply transformer or default formatting\n const transformValue = (key: string, value: unknown, item: object, pretty = false): string => {\n if (display && key in display) {\n const transformer = display[key];\n if (transformer) {\n return transformer(value, item);\n }\n }\n return formatValue(value, pretty);\n };\n\n if (!Array.isArray(data)) {\n const entries = Object.entries(data).filter(([key]) => !isExcluded(key));\n const formattedEntries = entries.map(([key, value]) => [\n key,\n transformValue(key, value, data, true),\n ]);\n const t = table(formattedEntries, {\n singleLine: false,\n border: getBorderCharacters(\"norc\"),\n });\n process.stdout.write(t);\n return;\n }\n\n if (data.length === 0) {\n return;\n }\n\n const allHeaders = Array.from(new Set(data.flatMap((item) => Object.keys(item))));\n const headers = allHeaders.filter((h) => !isExcluded(h));\n const rows = data.map((item) =>\n headers.map((header) =>\n transformValue(header, (item as Record<string, unknown>)[header], item),\n ),\n );\n\n const t = table([headers, ...rows], {\n border: getBorderCharacters(\"norc\"),\n drawHorizontalLine: (lineIndex, rowCount) => {\n return lineIndex === 0 || lineIndex === 1 || lineIndex === rowCount;\n },\n });\n process.stdout.write(t);\n },\n};\n"],"mappings":"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"}
@@ -1,3 +1,3 @@
1
1
  /// <reference types="@tailor-platform/function-types" />
2
- import { n as enumConstantsPlugin, t as EnumConstantsGeneratorID } from "../../../index-CeS4FA9o.mjs";
2
+ import { n as enumConstantsPlugin, t as EnumConstantsGeneratorID } from "../../../index-CHo73Aat.mjs";
3
3
  export { EnumConstantsGeneratorID, enumConstantsPlugin };
@@ -1,3 +1,3 @@
1
1
  /// <reference types="@tailor-platform/function-types" />
2
- import { n as fileUtilsPlugin, t as FileUtilsGeneratorID } from "../../../index-C3kcXHXJ.mjs";
2
+ import { n as fileUtilsPlugin, t as FileUtilsGeneratorID } from "../../../index-D_W9-Lvk.mjs";
3
3
  export { FileUtilsGeneratorID, fileUtilsPlugin };
@@ -1,3 +1,3 @@
1
1
  /// <reference types="@tailor-platform/function-types" />
2
- import { n as kyselyTypePlugin, t as KyselyGeneratorID } from "../../../index-BUT18Kak.mjs";
2
+ import { n as kyselyTypePlugin, t as KyselyGeneratorID } from "../../../index-Cln_TTZn.mjs";
3
3
  export { KyselyGeneratorID, kyselyTypePlugin };
@@ -1,3 +1,3 @@
1
1
  /// <reference types="@tailor-platform/function-types" />
2
- import { n as seedPlugin, t as SeedGeneratorID } from "../../../index-DnIg_LfT.mjs";
2
+ import { n as seedPlugin, t as SeedGeneratorID } from "../../../index-CIIXsk3E.mjs";
3
3
  export { SeedGeneratorID, seedPlugin };
@@ -1,6 +1,5 @@
1
1
  /// <reference types="@tailor-platform/function-types" />
2
- import { B as TailorAnyDBType } from "../plugin-D6P4g_2L.mjs";
3
- import { n as TailorEnv, r as TailorActor } from "../env-04IQXqsl.mjs";
2
+ import { B as TailorAnyDBType, dt as TailorEnv, ft as TailorActor } from "../plugin-D84blivd.mjs";
4
3
 
5
4
  //#region src/plugin/with-context.d.ts
6
5
  /**
@@ -196,7 +196,11 @@ type ScheduleTriggerInput = {
196
196
  timezone?: string | undefined;
197
197
  };
198
198
  type IncomingWebhookTrigger = {
199
- kind: "incomingWebhook";
199
+ kind: "incomingWebhook"; /** Response configuration */
200
+ response?: {
201
+ body?: Function | undefined;
202
+ statusCode?: number | undefined;
203
+ } | undefined;
200
204
  };
201
205
  type IdpUserTrigger = {
202
206
  /** IdP user event trigger */kind: "idpUser"; /** IdP user event types to trigger on */
@@ -263,6 +267,10 @@ type ExecutorInput = {
263
267
  timezone?: string | undefined;
264
268
  } | {
265
269
  kind: "incomingWebhook";
270
+ response?: {
271
+ body?: Function | undefined;
272
+ statusCode?: number | undefined;
273
+ } | undefined;
266
274
  } | {
267
275
  kind: "idpUser";
268
276
  events: ("idp.user.created" | "idp.user.updated" | "idp.user.deleted")[];
@@ -292,6 +300,10 @@ type Executor = {
292
300
  timezone: string;
293
301
  } | {
294
302
  kind: "incomingWebhook";
303
+ response?: {
304
+ body?: Function | undefined;
305
+ statusCode?: number | undefined;
306
+ } | undefined;
295
307
  } | {
296
308
  kind: "idpUser";
297
309
  events: ("idp.user.created" | "idp.user.updated" | "idp.user.deleted")[];
@@ -439,6 +451,42 @@ type TailorUser = {
439
451
  /** Represents an unauthenticated user in the Tailor platform. */
440
452
  declare const unauthenticatedTailorUser: TailorUser;
441
453
  //#endregion
454
+ //#region src/configure/types/actor.d.ts
455
+ /** User type enum values from the Tailor Platform server. */
456
+ type TailorActorType = "USER_TYPE_USER" | "USER_TYPE_MACHINE_USER" | "USER_TYPE_UNSPECIFIED";
457
+ /** Represents an actor in event triggers. */
458
+ type TailorActor = {
459
+ /** The ID of the workspace the user belongs to. */workspaceId: string; /** The ID of the user. */
460
+ userId: string;
461
+ /**
462
+ * A map of the user's attributes.
463
+ * Maps from server's `attributeMap` field.
464
+ */
465
+ attributes: InferredAttributeMap | null;
466
+ /**
467
+ * A list of the user's attributes.
468
+ * Maps from server's `attributes` field.
469
+ */
470
+ attributeList: InferredAttributeList; /** The type of the user. */
471
+ userType: TailorActorType;
472
+ };
473
+ //#endregion
474
+ //#region src/configure/types/env.d.ts
475
+ interface Env {}
476
+ /** Represents environment variables in the Tailor platform. */
477
+ type TailorEnv = keyof Env extends never ? Record<string, string> : Env;
478
+ //#endregion
479
+ //#region src/configure/types/machine-user.d.ts
480
+ interface MachineUserNameRegistry {}
481
+ /**
482
+ * Machine user name.
483
+ *
484
+ * When `tailor.d.ts` is generated (via `tailor-sdk apply`/`generate`), this is narrowed
485
+ * to the union of defined machine user names. When no machine users are registered yet,
486
+ * falls back to `string` to avoid blocking editing before the first generate run.
487
+ */
488
+ type MachineUserName = keyof MachineUserNameRegistry extends never ? string : keyof MachineUserNameRegistry & string;
489
+ //#endregion
442
490
  //#region src/configure/types/helpers.d.ts
443
491
  type Prettify<T> = { [K in keyof T as string extends K ? never : K]: T[K] } & {};
444
492
  type DeepWritable<T> = T extends Date | RegExp | Function ? T : T extends object ? { -readonly [P in keyof T]: DeepWritable<T[P]> } & {} : T;
@@ -450,6 +498,9 @@ type InferFieldsOutput<F extends Record<string, {
450
498
  _output: any;
451
499
  [key: string]: any;
452
500
  }>> = DeepWritable<Prettify<NullableToOptional<{ [K in keyof F]: output<F[K]> }>>>;
501
+ type JsonValue = string | number | boolean | null | JsonValue[] | {
502
+ [key: string]: JsonValue;
503
+ };
453
504
  /**
454
505
  * A looser version of JsonValue that accepts interfaces.
455
506
  * TypeScript interfaces don't have index signatures by default,
@@ -2074,5 +2125,5 @@ interface Plugin<TypeConfig = unknown, PluginConfig = unknown> {
2074
2125
  onExecutorReady?(context: ExecutorReadyContext<PluginConfig>): GeneratorResult | Promise<GeneratorResult>;
2075
2126
  }
2076
2127
  //#endregion
2077
- export { FieldOptions as $, BeforeLoginHookArgs as A, WebhookOperation as At, TailorAnyDBType as B, SCIMAttributeMapping as Bt, TailorDBType as C, FunctionOperation as Ct, AuthExternalConfig as D, ResolverExecutedTrigger as Dt, AuthConnectionTokenResult as E, IncomingWebhookTrigger as Et, UserAttributeListKey as F, IdProvider as Ft, PermissionCondition as G, TailorDBInstance as H, SCIMConfig as Ht, UserAttributeMap as I, OAuth2ClientInput as It, unsafeAllowAllGqlPermission as J, TailorTypeGqlPermission as K, UsernameFieldKey as L, OIDC as Lt, OAuth2ClientGrantType as M, AuthInvoker as Mt, SCIMAttributeType as N, BuiltinIdP as Nt, AuthOwnConfig as O, ScheduleTriggerInput as Ot, UserAttributeKey as P, IDToken as Pt, FieldMetadata as Q, ValueOperand as R, SAML as Rt, TailorDBServiceInput as S, ExecutorInput as St, AuthConfig as T, IdpUserTrigger as Tt, TailorDBType$1 as U, SCIMResource as Ut, TailorDBField as V, SCIMAuthorization as Vt, db as W, TenantProvider as Wt, ArrayFieldOutput as X, unsafeAllowAllTypePermission as Y, DefinedFieldMetadata as Z, GeneratorResult as _, Resolver as _t, PluginExecutorContext as a, JsonCompatible as at, TailorDBNamespaceData as b, AuthAccessTokenTrigger as bt, PluginGeneratedExecutorWithFile as c, AttributeMap as ct, PluginNamespaceProcessContext as d, TailorUser as dt, FieldOutput$1 as et, PluginOutput as f, unauthenticatedTailorUser as ft, ExecutorReadyContext as g, AuthConnectionOAuth2Config as gt, TypePluginOutput as h, AuthConnectionConfig as ht, PluginConfigs as i, InferFieldsOutput as it, DefinedAuth as j, WorkflowOperation as jt, AuthServiceInput as k, TailorDBTrigger as kt, PluginGeneratedResolver as l, InferredAttributeList as lt, TailorDBTypeForPlugin as m, AllowedValuesOutput as mt, Plugin as n, TailorAnyField as nt, PluginExecutorContextBase as o, output as ot, PluginProcessContext as p, AllowedValues as pt, TailorTypePermission as q, PluginAttachment as r, TailorField as rt, PluginGeneratedExecutor as s, AttributeList as st, NamespacePluginOutput as t, TailorFieldType as tt, PluginGeneratedType as u, InferredAttributeMap as ut, ResolverNamespaceData as v, ResolverInput as vt, TypeSourceInfoEntry as w, GqlOperation as wt, TailorDBReadyContext as x, Executor as xt, ResolverReadyContext as y, GeneratorConfig as yt, TailorAnyDBField as z, SCIMAttribute as zt };
2078
- //# sourceMappingURL=plugin-D6P4g_2L.d.mts.map
2128
+ export { FieldOptions as $, BeforeLoginHookArgs as A, IdpUserTrigger as At, TailorAnyDBType as B, IdProvider as Bt, TailorDBType as C, ResolverInput as Ct, AuthExternalConfig as D, ExecutorInput as Dt, AuthConnectionTokenResult as E, Executor as Et, UserAttributeListKey as F, WebhookOperation as Ft, PermissionCondition as G, SCIMAttributeMapping as Gt, TailorDBInstance as H, OIDC as Ht, UserAttributeMap as I, WorkflowOperation as It, unsafeAllowAllGqlPermission as J, SCIMResource as Jt, TailorTypeGqlPermission as K, SCIMAuthorization as Kt, UsernameFieldKey as L, AuthInvoker as Lt, OAuth2ClientGrantType as M, ResolverExecutedTrigger as Mt, SCIMAttributeType as N, ScheduleTriggerInput as Nt, AuthOwnConfig as O, FunctionOperation as Ot, UserAttributeKey as P, TailorDBTrigger as Pt, FieldMetadata as Q, ValueOperand as R, BuiltinIdP as Rt, TailorDBServiceInput as S, Resolver as St, AuthConfig as T, AuthAccessTokenTrigger as Tt, TailorDBType$1 as U, SAML as Ut, TailorDBField as V, OAuth2ClientInput as Vt, db as W, SCIMAttribute as Wt, ArrayFieldOutput as X, unsafeAllowAllTypePermission as Y, TenantProvider as Yt, DefinedFieldMetadata as Z, GeneratorResult as _, unauthenticatedTailorUser as _t, PluginExecutorContext as a, JsonCompatible as at, TailorDBNamespaceData as b, AuthConnectionConfig as bt, PluginGeneratedExecutorWithFile as c, MachineUserName as ct, PluginNamespaceProcessContext as d, TailorEnv as dt, FieldOutput$1 as et, PluginOutput as f, TailorActor as ft, ExecutorReadyContext as g, TailorUser as gt, TypePluginOutput as h, InferredAttributeMap as ht, PluginConfigs as i, InferFieldsOutput as it, DefinedAuth as j, IncomingWebhookTrigger as jt, AuthServiceInput as k, GqlOperation as kt, PluginGeneratedResolver as l, MachineUserNameRegistry as lt, TailorDBTypeForPlugin as m, AttributeMap as mt, Plugin as n, TailorAnyField as nt, PluginExecutorContextBase as o, JsonValue as ot, PluginProcessContext as p, AttributeList as pt, TailorTypePermission as q, SCIMConfig as qt, PluginAttachment as r, TailorField as rt, PluginGeneratedExecutor as s, output as st, NamespacePluginOutput as t, TailorFieldType as tt, PluginGeneratedType as u, Env as ut, ResolverNamespaceData as v, AllowedValues as vt, TypeSourceInfoEntry as w, GeneratorConfig as wt, TailorDBReadyContext as x, AuthConnectionOAuth2Config as xt, ResolverReadyContext as y, AllowedValuesOutput as yt, TailorAnyDBField as z, IDToken as zt };
2129
+ //# sourceMappingURL=plugin-D84blivd.d.mts.map
@@ -1,17 +1,17 @@
1
1
 
2
- import { A as ExecutorJobStatus, B as AuthSCIMAttribute_Type, C as TailorDBType_PermitAction, D as IdPPermissionPermit, E as IdPPermissionOperator, F as AuthIDPConfig_AuthType, G as UserProfileProviderConfig_UserProfileProviderType, H as AuthSCIMConfig_AuthorizationType, I as AuthInvokerSchema, J as Condition_Operator, K as GetApplicationSchemaHealthResponse_ApplicationSchemaHealthStatus, L as AuthOAuth2Client_ClientType, M as ExecutorTriggerType, N as AuthConnection_Type, O as FunctionExecution_Status, P as AuthHookPoint, Q as Subgraph_ServiceType, R as AuthOAuth2Client_GrantType, S as TailorDBType_Permission_Permit, T as IdPLang, V as AuthSCIMAttribute_Uniqueness, W as TenantProviderConfig_TenantProviderType, X as PageDirection, Y as FilterSchema, Z as ApplicationSchemaUpdateAttemptStatus, _ as WorkflowJobExecution_Status, a as fetchMachineUserToken, b as TailorDBGQLPermission_Permit, f as platformBaseUrl, g as WorkflowExecution_Status, h as WorkspacePlatformUserRole, i as fetchAll, j as ExecutorTargetType, m as userAgent, p as resolveStaticWebsiteUrls, q as ConditionSchema, u as initOperatorClient, v as TailorDBGQLPermission_Action, w as PipelineResolver_OperationType, x as TailorDBType_Permission_Operator, y as TailorDBGQLPermission_Operator, z as AuthSCIMAttribute_Mutability } from "./client-DllDLYmZ.mjs";
2
+ import { A as ExecutorJobStatus, B as AuthSCIMAttribute_Type, C as TailorDBType_PermitAction, D as IdPPermissionPermit, E as IdPPermissionOperator, F as AuthIDPConfig_AuthType, G as UserProfileProviderConfig_UserProfileProviderType, H as AuthSCIMConfig_AuthorizationType, I as AuthInvokerSchema, J as Condition_Operator, K as GetApplicationSchemaHealthResponse_ApplicationSchemaHealthStatus, L as AuthOAuth2Client_ClientType, M as ExecutorTriggerType, N as AuthConnection_Type, O as FunctionExecution_Status, P as AuthHookPoint, Q as Subgraph_ServiceType, R as AuthOAuth2Client_GrantType, S as TailorDBType_Permission_Permit, T as IdPLang, V as AuthSCIMAttribute_Uniqueness, W as TenantProviderConfig_TenantProviderType, X as PageDirection, Y as FilterSchema, Z as ApplicationSchemaUpdateAttemptStatus, _ as WorkflowJobExecution_Status, a as fetchMachineUserToken, b as TailorDBGQLPermission_Permit, f as platformBaseUrl, g as WorkflowExecution_Status, h as WorkspacePlatformUserRole, i as fetchAll, j as ExecutorTargetType, m as userAgent, p as resolveStaticWebsiteUrls, q as ConditionSchema, u as initOperatorClient, v as TailorDBGQLPermission_Action, w as PipelineResolver_OperationType, x as TailorDBType_Permission_Operator, y as TailorDBGQLPermission_Operator, z as AuthSCIMAttribute_Mutability } from "./client-xzPXtc_e.mjs";
3
3
  import { t as db } from "./schema-CnwUqPyM.mjs";
4
- import { i as symbols, n as logger, r as styles, t as CIPromptError } from "./logger-C8qBDCKO.mjs";
4
+ import { a as parseBoolean, i as symbols, n as logger, r as styles, t as CIPromptError } from "./logger-5_JMzHmw.mjs";
5
5
  import { t as readPackageJson } from "./package-json-BHViVisJ.mjs";
6
- import { S as readPlatformConfig, T as writePlatformConfig, _ as hashFile, a as loadConfig, b as loadAccessToken, c as createExecutorService, d as TailorDBTypeSchema, f as stringifyFunction, g as getDistDir, h as createBundleCache, m as loadFilesWithIgnores, n as generatePluginFilesIfNeeded, p as tailorUserMap, r as loadApplication, t as defineApplication, u as OAuth2ClientSchema, x as loadWorkspaceId } from "./application-qRGMV8Tr.mjs";
6
+ import { S as readPlatformConfig, T as writePlatformConfig, _ as hashFile, a as loadConfig, b as loadAccessToken, c as createExecutorService, d as TailorDBTypeSchema, f as stringifyFunction, g as getDistDir, h as createBundleCache, m as loadFilesWithIgnores, n as generatePluginFilesIfNeeded, p as tailorUserMap, r as loadApplication, t as defineApplication, u as OAuth2ClientSchema, x as loadWorkspaceId } from "./application-DhQrXEld.mjs";
7
7
  import { r as withSpan } from "./telemetry-DwHuiNiR.mjs";
8
+ import { n as isCLIError, t as createCLIError } from "./errors-D9f2UJpT.mjs";
8
9
  import { arg, createDefineCommand, defineCommand, runCommand } from "politty";
9
10
  import { z } from "zod";
10
11
  import * as fs$1 from "node:fs";
11
12
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
12
13
  import { parseEnv } from "node:util";
13
14
  import * as path from "pathe";
14
- import chalk from "chalk";
15
15
  import { formatDistanceToNowStrict } from "date-fns";
16
16
  import { getBorderCharacters, table } from "table";
17
17
  import { ValueSchema, timestampDate } from "@bufbuild/protobuf/wkt";
@@ -4055,7 +4055,10 @@ function normalizeComparableExecutor(executor) {
4055
4055
  ...normalized.triggerConfig,
4056
4056
  config: {
4057
4057
  ...normalized.triggerConfig.config,
4058
- value: {}
4058
+ value: {
4059
+ ...normalized.triggerConfig.config.value,
4060
+ secret: void 0
4061
+ }
4059
4062
  }
4060
4063
  } : normalized.triggerConfig?.config?.case === "event" ? {
4061
4064
  ...normalized.triggerConfig,
@@ -4167,7 +4170,10 @@ function protoExecutor(application, executor) {
4167
4170
  triggerType = ExecutorTriggerType.INCOMING_WEBHOOK;
4168
4171
  triggerConfig = { config: {
4169
4172
  case: "incomingWebhook",
4170
- value: {}
4173
+ value: { ...trigger.response ? { response: {
4174
+ ...trigger.response.body ? { body: { expr: `(${stringifyFunction(trigger.response.body)})(${argsExpr})` } } : {},
4175
+ ...trigger.response.statusCode != null ? { statusCode: trigger.response.statusCode } : {}
4176
+ } } : {} }
4171
4177
  } };
4172
4178
  break;
4173
4179
  case "idpUser":
@@ -8313,7 +8319,7 @@ async function apply(options) {
8313
8319
  const { config, application, workflowBuildResult, bundledScripts, buildOnly } = await withSpan("build", async () => {
8314
8320
  const { config, plugins } = await withSpan("build.loadConfig", () => loadConfig(options?.configPath));
8315
8321
  const dryRun = options?.dryRun ?? false;
8316
- const buildOnly = options?.buildOnly ?? process.env.TAILOR_PLATFORM_SDK_BUILD_ONLY === "true";
8322
+ const buildOnly = options?.buildOnly ?? parseBoolean(process.env.TAILOR_PLATFORM_SDK_BUILD_ONLY) === true;
8317
8323
  const noCache = options?.noCache ?? false;
8318
8324
  const packageJson = await readPackageJson();
8319
8325
  const cacheDir = path.resolve(getDistDir(), "cache");
@@ -9490,9 +9496,11 @@ const startCommand = defineAppCommand({
9490
9496
  args: z.object({
9491
9497
  ...deploymentArgs,
9492
9498
  ...nameArgs,
9493
- machineuser: arg(z.string(), {
9499
+ "machine-user": arg(z.string(), {
9494
9500
  alias: "m",
9495
- description: "Machine user name"
9501
+ hiddenAlias: "machineuser",
9502
+ description: "Machine user name",
9503
+ env: "TAILOR_PLATFORM_MACHINE_USER_NAME"
9496
9504
  }),
9497
9505
  arg: arg(z.string().optional(), {
9498
9506
  alias: "a",
@@ -9503,7 +9511,7 @@ const startCommand = defineAppCommand({
9503
9511
  run: async (args) => {
9504
9512
  const { executionId, wait } = await startWorkflowByName({
9505
9513
  name: args.name,
9506
- machineUser: args.machineuser,
9514
+ machineUser: args["machine-user"],
9507
9515
  arg: args.arg,
9508
9516
  workspaceId: args["workspace-id"],
9509
9517
  profile: args.profile,
@@ -12604,7 +12612,7 @@ async function generate(options) {
12604
12612
  if (options.init) await handleInitOption(namespacesWithMigrations, options.yes);
12605
12613
  let pluginManager;
12606
12614
  if (plugins.length > 0) pluginManager = new PluginManager(plugins);
12607
- const { defineApplication } = await import("./application-ILhZq_oW.mjs");
12615
+ const { defineApplication } = await import("./application-C1ipG5Q6.mjs");
12608
12616
  const application = defineApplication({
12609
12617
  config,
12610
12618
  pluginManager
@@ -13918,44 +13926,6 @@ async function bundleQueryScript(engine) {
13918
13926
  })).output[0].code;
13919
13927
  }
13920
13928
 
13921
- //#endregion
13922
- //#region src/cli/shared/errors.ts
13923
- /**
13924
- * Format CLI error for output
13925
- * @param error - CLIError instance to format
13926
- * @returns Formatted error message
13927
- */
13928
- function formatError(error) {
13929
- const parts = [chalk.red(`Error${error.code ? ` [${error.code}]` : ""}: ${error.message}`)];
13930
- if (error.details) parts.push(`\n ${chalk.gray("Details:")} ${error.details}`);
13931
- if (error.suggestion) parts.push(`\n ${chalk.cyan("Suggestion:")} ${error.suggestion}`);
13932
- if (error.command) parts.push(`\n ${chalk.gray("Help:")} Run \`tailor-sdk ${error.command} --help\` for usage information.`);
13933
- return parts.join("");
13934
- }
13935
- /**
13936
- * Create a CLI error with formatted output
13937
- * @param options - Options to construct a CLIError
13938
- * @returns Constructed CLIError instance
13939
- */
13940
- function createCLIError(options) {
13941
- const error = new Error(options.message);
13942
- error.name = "CLIError";
13943
- error.code = options.code;
13944
- error.details = options.details;
13945
- error.suggestion = options.suggestion;
13946
- error.command = options.command;
13947
- error.format = () => formatError(error);
13948
- return error;
13949
- }
13950
- /**
13951
- * Type guard to check if an error is a CLIError
13952
- * @param error - Error to check
13953
- * @returns True if the error is a CLIError
13954
- */
13955
- function isCLIError(error) {
13956
- return error instanceof Error && error.name === "CLIError";
13957
- }
13958
-
13959
13929
  //#endregion
13960
13930
  //#region src/cli/query/errors.ts
13961
13931
  function toErrorMessage(error) {
@@ -14644,9 +14614,11 @@ const queryCommand = defineAppCommand({
14644
14614
  description: "Read query string from file; omit to start REPL mode"
14645
14615
  }),
14646
14616
  edit: arg(z.boolean().default(false), { description: "Open a temporary file in your editor; omit to start REPL mode" }),
14647
- machineuser: arg(z.string(), {
14617
+ "machine-user": arg(z.string(), {
14648
14618
  alias: "m",
14649
- description: "Machine user name for query execution"
14619
+ hiddenAlias: "machineuser",
14620
+ description: "Machine user name for query execution",
14621
+ env: "TAILOR_PLATFORM_MACHINE_USER_NAME"
14650
14622
  })
14651
14623
  }).superRefine((args, ctx) => {
14652
14624
  if (args.query != null && args.file != null) ctx.addIssue({
@@ -14677,7 +14649,7 @@ const queryCommand = defineAppCommand({
14677
14649
  profile: args.profile,
14678
14650
  configPath: args.config,
14679
14651
  engine: args.engine,
14680
- machineUser: args.machineuser
14652
+ machineUser: args["machine-user"]
14681
14653
  };
14682
14654
  if (mode.mode === "abort") {
14683
14655
  logger.info("Editor closed without a query. Nothing was executed.");
@@ -14806,5 +14778,5 @@ function isDeno() {
14806
14778
  }
14807
14779
 
14808
14780
  //#endregion
14809
- export { getFolder as $, getNextMigrationNumber as $t, listWorkflows as A, functionExecutionStatusToString as At, updateCommand$1 as B, DB_TYPES_FILE_NAME as Bt, listApps as C, startCommand as Ct, resumeCommand as D, executionsCommand as Dt, healthCommand as E, getWorkflow as Et, show as F, executeScript as Ft, listOrganizations as G, compareLocalTypesWithSnapshot as Gt, organizationTree as H, INITIAL_SCHEMA_NUMBER as Ht, showCommand as I, waitForExecution$1 as It, updateCommand$2 as J, formatMigrationNumber as Jt, getCommand$1 as K, compareSnapshots as Kt, logBetaWarning as L, MIGRATION_LABEL_KEY as Lt, truncateCommand as M, getCommand$5 as Mt, generate as N, getExecutor as Nt, resumeWorkflow as O, getWorkflowExecution as Ot, generateCommand as P, apply as Pt, getCommand$2 as Q, getMigrationFiles as Qt, remove as R, parseMigrationLabelNumber as Rt, createWorkspace as S, watchExecutorJob as St, getAppHealth as T, getCommand$4 as Tt, treeCommand as U, MIGRATE_FILE_NAME as Ut, updateOrganization as V, DIFF_FILE_NAME as Vt, listCommand$4 as W, SCHEMA_FILE_NAME as Wt, listCommand$5 as X, getMigrationDirPath as Xt, updateFolder as Y, getLatestMigrationNumber as Yt, listFolders as Z, getMigrationFilePath as Zt, getCommand as _, isVerbose as _n, listCommand$8 as _t, updateCommand as a, hasChanges as an, listOAuth2Clients as at, deleteWorkspace as b, jobsCommand as bt, removeUser as c, sdkNameLabelKey as cn, getMachineUserToken as ct, inviteCommand as d, apiCall as dn, listMachineUsers as dt, isValidMigrationNumber as en, deleteCommand$1 as et, inviteUser as f, apiCommand as fn, generate$1 as ft, listWorkspaces as g, deploymentArgs as gn, triggerExecutor as gt, listCommand$1 as h, confirmationArgs as hn, triggerCommand as ht, isCLIError as i, formatMigrationDiff as in, listCommand$6 as it, truncate as j, formatKeyValueTable as jt, listCommand$3 as k, listWorkflowExecutions as kt, listCommand as l, trnPrefix as ln, tokenCommand as lt, restoreWorkspace as m, commonArgs as mn, webhookCommand as mt, query as n, reconstructSnapshotFromMigrations as nn, createCommand$1 as nt, updateUser as o, getNamespacesWithMigrations as on, getCommand$3 as ot, restoreCommand as p, defineAppCommand as pn, listWebhookExecutors as pt, getOrganization as q, createSnapshotFromLocalTypes as qt, queryCommand as r, formatDiffSummary as rn, createFolder as rt, removeCommand as s, prompt as sn, getOAuth2Client as st, isNativeTypeScriptRuntime as t, loadDiff as tn, deleteFolder as tt, listUsers as u, generateUserTypes as un, listCommand$7 as ut, getWorkspace as v, workspaceArgs as vn, listExecutors as vt, listCommand$2 as w, startWorkflow as wt, createCommand as x, listExecutorJobs as xt, deleteCommand as y, getExecutorJob as yt, removeCommand$1 as z, bundleMigrationScript as zt };
14810
- //# sourceMappingURL=runtime-D9ejnCm6.mjs.map
14781
+ export { deleteCommand$1 as $, isValidMigrationNumber as $t, truncate as A, formatKeyValueTable as At, updateOrganization as B, DIFF_FILE_NAME as Bt, listCommand$2 as C, startWorkflow as Ct, resumeWorkflow as D, getWorkflowExecution as Dt, resumeCommand as E, executionsCommand as Et, showCommand as F, waitForExecution$1 as Ft, getCommand$1 as G, compareSnapshots as Gt, treeCommand as H, MIGRATE_FILE_NAME as Ht, logBetaWarning as I, MIGRATION_LABEL_KEY as It, updateFolder as J, getLatestMigrationNumber as Jt, getOrganization as K, createSnapshotFromLocalTypes as Kt, remove as L, parseMigrationLabelNumber as Lt, generate as M, getExecutor as Mt, generateCommand as N, apply as Nt, listCommand$3 as O, listWorkflowExecutions as Ot, show as P, executeScript as Pt, getFolder as Q, getNextMigrationNumber as Qt, removeCommand$1 as R, bundleMigrationScript as Rt, listApps as S, startCommand as St, healthCommand as T, getWorkflow as Tt, listCommand$4 as U, SCHEMA_FILE_NAME as Ut, organizationTree as V, INITIAL_SCHEMA_NUMBER as Vt, listOrganizations as W, compareLocalTypesWithSnapshot as Wt, listFolders as X, getMigrationFilePath as Xt, listCommand$5 as Y, getMigrationDirPath as Yt, getCommand$2 as Z, getMigrationFiles as Zt, getWorkspace as _, workspaceArgs as _n, listExecutors as _t, updateUser as a, getNamespacesWithMigrations as an, getCommand$3 as at, createCommand as b, listExecutorJobs as bt, listCommand as c, trnPrefix as cn, tokenCommand as ct, inviteUser as d, apiCommand as dn, generate$1 as dt, loadDiff as en, deleteFolder as et, restoreCommand as f, defineAppCommand as fn, listWebhookExecutors as ft, getCommand as g, isVerbose as gn, listCommand$8 as gt, listWorkspaces as h, deploymentArgs as hn, triggerExecutor as ht, updateCommand as i, hasChanges as in, listOAuth2Clients as it, truncateCommand as j, getCommand$5 as jt, listWorkflows as k, functionExecutionStatusToString as kt, listUsers as l, generateUserTypes as ln, listCommand$7 as lt, listCommand$1 as m, confirmationArgs as mn, triggerCommand as mt, query as n, formatDiffSummary as nn, createFolder as nt, removeCommand as o, prompt as on, getOAuth2Client as ot, restoreWorkspace as p, commonArgs as pn, webhookCommand as pt, updateCommand$2 as q, formatMigrationNumber as qt, queryCommand as r, formatMigrationDiff as rn, listCommand$6 as rt, removeUser as s, sdkNameLabelKey as sn, getMachineUserToken as st, isNativeTypeScriptRuntime as t, reconstructSnapshotFromMigrations as tn, createCommand$1 as tt, inviteCommand as u, apiCall as un, listMachineUsers as ut, deleteCommand as v, getExecutorJob as vt, getAppHealth as w, getCommand$4 as wt, createWorkspace as x, watchExecutorJob as xt, deleteWorkspace as y, jobsCommand as yt, updateCommand$1 as z, DB_TYPES_FILE_NAME as zt };
14782
+ //# sourceMappingURL=runtime-ChpwtPut.mjs.map