@tailor-platform/sdk 1.5.0 → 1.6.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 (33) hide show
  1. package/CHANGELOG.md +70 -0
  2. package/dist/application-D5kzHyuG.mjs +5 -0
  3. package/dist/{list-Dr8070QZ.mjs → application-D9mwb5eH.mjs} +198 -9510
  4. package/dist/application-D9mwb5eH.mjs.map +1 -0
  5. package/dist/{auth-CZPUwA1p.mjs → auth-0Zh4xp4z.mjs} +2 -31
  6. package/dist/auth-0Zh4xp4z.mjs.map +1 -0
  7. package/dist/cli/index.mjs +247 -27
  8. package/dist/cli/index.mjs.map +1 -1
  9. package/dist/cli/lib.d.mts +287 -14
  10. package/dist/cli/lib.mjs +4 -4
  11. package/dist/cli/lib.mjs.map +1 -1
  12. package/dist/configure/index.d.mts +3 -3
  13. package/dist/configure/index.mjs +15 -4
  14. package/dist/configure/index.mjs.map +1 -1
  15. package/dist/{index-bRPODqag.d.mts → index-C_yeYBC8.d.mts} +3 -10
  16. package/dist/{index-D40SiXpf.d.mts → index-k5hWCs5L.d.mts} +22 -30
  17. package/dist/{jiti-BUw4tcVQ.mjs → jiti-SMSW3TA0.mjs} +1 -1
  18. package/dist/{jiti-BUw4tcVQ.mjs.map → jiti-SMSW3TA0.mjs.map} +1 -1
  19. package/dist/{job-CX4l7Myn.mjs → job-8XfvLyxH.mjs} +2 -9
  20. package/dist/job-8XfvLyxH.mjs.map +1 -0
  21. package/dist/list-C_lrs5OC.mjs +11935 -0
  22. package/dist/list-C_lrs5OC.mjs.map +1 -0
  23. package/dist/{src-Bu0051gO.mjs → src-qLXX6nub.mjs} +1 -1
  24. package/dist/{src-Bu0051gO.mjs.map → src-qLXX6nub.mjs.map} +1 -1
  25. package/dist/utils/test/index.d.mts +2 -2
  26. package/dist/utils/test/index.mjs +1 -1
  27. package/docs/cli/application.md +23 -187
  28. package/docs/cli/tailordb.md +621 -0
  29. package/docs/cli-reference.md +31 -15
  30. package/package.json +11 -1
  31. package/dist/auth-CZPUwA1p.mjs.map +0 -1
  32. package/dist/job-CX4l7Myn.mjs.map +0 -1
  33. package/dist/list-Dr8070QZ.mjs.map +0 -1
@@ -1,5 +1,5 @@
1
1
  /// <reference path="./user-defined.d.ts" />
2
- import { C as WorkflowOperation$1, Ct as output$1, O as AuthInvoker, S as WebhookOperation$1, St as JsonCompatible, Tt as AllowedValuesOutput, _ as GqlOperation$1, _t as TailorField, b as ResolverExecutedTrigger$1, bt as ResolverInput, ct as FieldMetadata, dt as TailorFieldType, et as TailorDBType, g as FunctionOperation$1, gt as TailorAnyField, h as ExecutorInput, lt as FieldOptions, mt as TailorUser, n as GeneratorConfig, r as AppConfig, st as ArrayFieldOutput, ut as FieldOutput, v as IncomingWebhookTrigger$1, wt as AllowedValues, x as ScheduleTriggerInput, xt as InferFieldsOutput, y as RecordTrigger$1 } from "./index-D40SiXpf.mjs";
2
+ import { C as WorkflowOperation$1, Ct as output$1, O as AuthInvoker, S as WebhookOperation$1, St as JsonCompatible, Tt as AllowedValuesOutput, _ as GqlOperation$1, _t as TailorField, b as ResolverExecutedTrigger$1, bt as ResolverInput, ct as FieldMetadata, dt as TailorFieldType, et as TailorDBType, g as FunctionOperation$1, gt as TailorAnyField, h as ExecutorInput, lt as FieldOptions, mt as TailorUser, n as GeneratorConfig, r as AppConfig, st as ArrayFieldOutput, ut as FieldOutput, v as IncomingWebhookTrigger$1, wt as AllowedValues, x as ScheduleTriggerInput, xt as InferFieldsOutput, y as RecordTrigger$1 } from "./index-k5hWCs5L.mjs";
3
3
  import * as zod0 from "zod";
4
4
  import { JsonPrimitive, Jsonifiable, Jsonify } from "type-fest";
5
5
  import * as zod_v4_core0 from "zod/v4/core";
@@ -47,12 +47,6 @@ declare function createResolver<Input extends Record<string, TailorAnyField> | u
47
47
  type ResolverConfig = ReturnType<typeof createResolver<any, any>>;
48
48
  //#endregion
49
49
  //#region src/configure/services/workflow/job.d.ts
50
- /**
51
- * Symbol used to brand WorkflowJob objects created by createWorkflowJob.
52
- * This enables reliable runtime detection of workflow jobs regardless of
53
- * how they were imported or assigned (variable reassignment, destructuring, etc.)
54
- */
55
- declare const WORKFLOW_JOB_BRAND: unique symbol;
56
50
  /**
57
51
  * Context object passed as the second argument to workflow job body functions.
58
52
  */
@@ -87,7 +81,6 @@ type WorkflowJobInput = undefined | JsonCompatible<unknown>;
87
81
  * - Trigger returns Jsonify<Output> (Date becomes string after JSON.stringify)
88
82
  */
89
83
  interface WorkflowJob<Name extends string = string, Input = undefined, Output = undefined> {
90
- readonly [WORKFLOW_JOB_BRAND]?: true;
91
84
  name: Name;
92
85
  /**
93
86
  * Trigger this job with the given input.
@@ -472,5 +465,5 @@ declare namespace t {
472
465
  type infer<T> = TailorOutput<T>;
473
466
  }
474
467
  //#endregion
475
- export { Workflow as A, createResolver as B, recordUpdatedTrigger as C, Operation as D, GqlOperation as E, WorkflowJob as F, WorkflowJobContext as I, WorkflowJobInput as L, createWorkflow as M, WORKFLOW_JOB_BRAND as N, WebhookOperation as O, WORKFLOW_TEST_ENV_KEY as P, WorkflowJobOutput as R, recordDeletedTrigger as S, FunctionOperation as T, Env as V, RecordTrigger as _, defineGenerators as a, ResolverExecutedTrigger as b, IncomingWebhookArgs as c, incomingWebhookTrigger as d, ScheduleArgs as f, RecordDeletedArgs as g, RecordCreatedArgs as h, defineConfig as i, WorkflowConfig as j, WorkflowOperation as k, IncomingWebhookRequest as l, scheduleTrigger as m, output as n, createExecutor as o, ScheduleTrigger as p, t as r, Trigger as s, infer as t, IncomingWebhookTrigger as u, RecordUpdatedArgs as v, resolverExecutedTrigger as w, recordCreatedTrigger as x, ResolverExecutedArgs as y, createWorkflowJob as z };
476
- //# sourceMappingURL=index-bRPODqag.d.mts.map
468
+ export { Workflow as A, Env as B, recordUpdatedTrigger as C, Operation as D, GqlOperation as E, WorkflowJobContext as F, WorkflowJobInput as I, WorkflowJobOutput as L, createWorkflow as M, WORKFLOW_TEST_ENV_KEY as N, WebhookOperation as O, WorkflowJob as P, createWorkflowJob as R, recordDeletedTrigger as S, FunctionOperation as T, RecordTrigger as _, defineGenerators as a, ResolverExecutedTrigger as b, IncomingWebhookArgs as c, incomingWebhookTrigger as d, ScheduleArgs as f, RecordDeletedArgs as g, RecordCreatedArgs as h, defineConfig as i, WorkflowConfig as j, WorkflowOperation as k, IncomingWebhookRequest as l, scheduleTrigger as m, output as n, createExecutor as o, ScheduleTrigger as p, t as r, Trigger as s, infer as t, IncomingWebhookTrigger as u, RecordUpdatedArgs as v, resolverExecutedTrigger as w, recordCreatedTrigger as x, ResolverExecutedArgs as y, createResolver as z };
469
+ //# sourceMappingURL=index-C_yeYBC8.d.mts.map
@@ -21,19 +21,6 @@ type AllowedValuesOutput<V extends AllowedValues> = V[number] extends infer T ?
21
21
  value: infer K;
22
22
  } ? K : never : never;
23
23
  //#endregion
24
- //#region src/configure/types/brand.d.ts
25
- /**
26
- * Symbol brands for type identification.
27
- * These symbols are used to reliably identify SDK objects
28
- * without relying on instanceof checks or property shape detection.
29
- */
30
- /** Brand symbol for TailorField instances */
31
- declare const TAILOR_FIELD_BRAND: unique symbol;
32
- /** Brand symbol for TailorDBField instances */
33
- declare const TAILOR_DB_FIELD_BRAND: unique symbol;
34
- /** Brand symbol for TailorDBType instances */
35
- declare const TAILOR_DB_TYPE_BRAND: unique symbol;
36
- //#endregion
37
24
  //#region src/configure/types/helpers.d.ts
38
25
  type Prettify<T> = { [K in keyof T as string extends K ? never : K]: T[K] } & {};
39
26
  type DeepWritable<T> = T extends Date | RegExp | Function ? T : T extends object ? { -readonly [P in keyof T]: DeepWritable<T[P]> } & {} : T;
@@ -176,8 +163,6 @@ type FieldParseInternalArgs = {
176
163
  * Using interface to allow self-referencing in the fields property.
177
164
  */
178
165
  interface TailorField<Defined extends DefinedFieldMetadata = DefinedFieldMetadata, Output = any, M extends FieldMetadata = FieldMetadata, T extends TailorFieldType = TailorFieldType> extends TailorFieldInput {
179
- /** Brand symbol for type identification */
180
- readonly [TAILOR_FIELD_BRAND]: true;
181
166
  readonly type: T;
182
167
  readonly fields: Record<string, TailorAnyField>;
183
168
  readonly _defined: Defined;
@@ -494,10 +479,21 @@ type Hooks<F extends Record<string, TailorAnyDBField>, TData = { [K in keyof F]:
494
479
  } ? never : F[K]["_defined"] extends {
495
480
  type: "nested";
496
481
  } ? never : K]?: Hook<TData, output<F[K]>> }>;
482
+ /**
483
+ * Migration configuration for TailorDB
484
+ */
485
+ type TailorDBMigrationConfig = {
486
+ /** Directory path for migration files */
487
+ directory: string;
488
+ /** Machine user name for executing migration scripts (must be defined in auth.machineUsers) */
489
+ machineUser?: string;
490
+ };
497
491
  type TailorDBServiceConfig = {
498
492
  files: string[];
499
493
  ignores?: string[];
500
494
  erdSite?: string;
495
+ /** Migration configuration */
496
+ migration?: TailorDBMigrationConfig;
501
497
  };
502
498
  type TailorDBExternalConfig = {
503
499
  external: true;
@@ -543,8 +539,6 @@ type TailorAnyDBField = TailorDBField<any, any>;
543
539
  * Extends TailorField with database-specific features like relations, indexes, and hooks.
544
540
  */
545
541
  interface TailorDBField<Defined extends DefinedDBFieldMetadata, Output> extends Omit<TailorField<Defined, Output, DBFieldMetadata, Defined["type"]>, "description" | "validate"> {
546
- /** Brand symbol for type identification */
547
- readonly [TAILOR_DB_FIELD_BRAND]: true;
548
542
  /** Returns a shallow copy of the raw relation config if set */
549
543
  readonly rawRelation: Readonly<RawRelationConfig> | undefined;
550
544
  /**
@@ -732,8 +726,6 @@ type TailorAnyDBType = TailorDBType<any, any>;
732
726
  * TailorDBType interface representing a database type definition with fields, permissions, and settings.
733
727
  */
734
728
  interface TailorDBType<Fields extends Record<string, TailorAnyDBField> = any, User extends object = InferredAttributeMap> {
735
- /** Brand symbol for type identification */
736
- readonly [TAILOR_DB_TYPE_BRAND]: true;
737
729
  readonly name: string;
738
730
  readonly fields: Fields;
739
731
  readonly _output: InferFieldsOutput<Fields>;
@@ -1474,15 +1466,6 @@ type ResolverServiceInput = {
1474
1466
  [namespace: string]: ResolverServiceConfig | ResolverExternalConfig;
1475
1467
  };
1476
1468
  //#endregion
1477
- //#region src/configure/services/workflow/types.d.ts
1478
- type WorkflowServiceConfig = {
1479
- files: string[];
1480
- job_files?: string[];
1481
- ignores?: string[];
1482
- job_ignores?: string[];
1483
- };
1484
- type WorkflowServiceInput = WorkflowServiceConfig;
1485
- //#endregion
1486
1469
  //#region src/parser/service/idp/schema.d.ts
1487
1470
  declare const IdPSchema: z.core.$ZodBranded<z.ZodObject<{
1488
1471
  name: z.ZodString;
@@ -1602,6 +1585,15 @@ declare function defineStaticWebSite(name: string, config: Omit<StaticWebsiteInp
1602
1585
  } & StaticWebsiteDefinitionBrand;
1603
1586
  type StaticWebsiteConfig = Omit<ReturnType<typeof defineStaticWebSite>, "url">;
1604
1587
  //#endregion
1588
+ //#region src/parser/service/workflow/types.d.ts
1589
+ type WorkflowServiceConfig = {
1590
+ files: string[];
1591
+ job_files?: string[];
1592
+ ignores?: string[];
1593
+ job_ignores?: string[];
1594
+ };
1595
+ type WorkflowServiceInput = WorkflowServiceConfig;
1596
+ //#endregion
1605
1597
  //#region src/parser/app-config/types.d.ts
1606
1598
  interface AppConfig<Auth extends AuthConfig = AuthConfig, Idp extends IdPConfig[] = IdPConfig[], StaticWebsites extends StaticWebsiteConfig[] = StaticWebsiteConfig[], Env extends Record<string, string | number | boolean> = Record<string, string | number | boolean>> {
1607
1599
  name: string;
@@ -1721,5 +1713,5 @@ declare function createGeneratorConfigSchema(builtinGenerators: Map<string, (opt
1721
1713
  type GeneratorConfigSchemaType = ReturnType<typeof createGeneratorConfigSchema>;
1722
1714
  type Generator = z.output<GeneratorConfigSchemaType>;
1723
1715
  //#endregion
1724
- export { TailorDBInstance as $, defineAuth as A, SCIMAttribute as B, WorkflowOperation as C, output as Ct, AuthExternalConfig as D, AuthConfig as E, IdProviderConfig as F, SCIMResource as G, SCIMAttributeType as H, OAuth2ClientGrantType as I, UserAttributeListKey as J, TenantProviderConfig as K, OAuth2ClientInput as L, AuthServiceInput as M, BuiltinIdP as N, AuthInvoker as O, IDToken as P, TailorDBField as Q, OIDC as R, WebhookOperation as S, JsonCompatible as St, ExecutorServiceInput as T, AllowedValuesOutput as Tt, SCIMAuthorization as U, SCIMAttributeMapping as V, SCIMConfig as W, UsernameFieldKey as X, UserAttributeMap as Y, ValueOperand as Z, GqlOperation as _, TailorField as _t, defineStaticWebSite as a, unsafeAllowAllGqlPermission as at, ResolverExecutedTrigger as b, ResolverInput as bt, defineIdp as c, FieldMetadata as ct, ResolverExternalConfig as d, TailorFieldType as dt, TailorDBType as et, ResolverServiceConfig as f, AttributeList as ft, FunctionOperation as g, TailorAnyField as gt, ExecutorInput as h, unauthenticatedTailorUser as ht, StaticWebsiteConfig as i, TailorTypePermission as it, ParsedTailorDBType as j, AuthOwnConfig as k, WorkflowServiceConfig as l, FieldOptions as lt, Executor as m, TailorUser as mt, GeneratorConfig as n, PermissionCondition as nt, IdPConfig as o, unsafeAllowAllTypePermission as ot, ResolverServiceInput as p, AttributeMap as pt, UserAttributeKey as q, AppConfig as r, TailorTypeGqlPermission as rt, IdPExternalConfig as s, ArrayFieldOutput as st, Generator as t, db as tt, WorkflowServiceInput as u, FieldOutput$1 as ut, IncomingWebhookTrigger as v, QueryType as vt, ExecutorServiceConfig as w, AllowedValues as wt, ScheduleTriggerInput as x, InferFieldsOutput as xt, RecordTrigger as y, Resolver as yt, SAML as z };
1725
- //# sourceMappingURL=index-D40SiXpf.d.mts.map
1716
+ export { TailorDBInstance as $, defineAuth as A, SCIMAttribute as B, WorkflowOperation as C, output as Ct, AuthExternalConfig as D, AuthConfig as E, IdProviderConfig as F, SCIMResource as G, SCIMAttributeType as H, OAuth2ClientGrantType as I, UserAttributeListKey as J, TenantProviderConfig as K, OAuth2ClientInput as L, AuthServiceInput as M, BuiltinIdP as N, AuthInvoker as O, IDToken as P, TailorDBField as Q, OIDC as R, WebhookOperation as S, JsonCompatible as St, ExecutorServiceInput as T, AllowedValuesOutput as Tt, SCIMAuthorization as U, SCIMAttributeMapping as V, SCIMConfig as W, UsernameFieldKey as X, UserAttributeMap as Y, ValueOperand as Z, GqlOperation as _, TailorField as _t, WorkflowServiceInput as a, unsafeAllowAllGqlPermission as at, ResolverExecutedTrigger as b, ResolverInput as bt, IdPConfig as c, FieldMetadata as ct, ResolverExternalConfig as d, TailorFieldType as dt, TailorDBType as et, ResolverServiceConfig as f, AttributeList as ft, FunctionOperation as g, TailorAnyField as gt, ExecutorInput as h, unauthenticatedTailorUser as ht, WorkflowServiceConfig as i, TailorTypePermission as it, ParsedTailorDBType as j, AuthOwnConfig as k, IdPExternalConfig as l, FieldOptions as lt, Executor as m, TailorUser as mt, GeneratorConfig as n, PermissionCondition as nt, StaticWebsiteConfig as o, unsafeAllowAllTypePermission as ot, ResolverServiceInput as p, AttributeMap as pt, UserAttributeKey as q, AppConfig as r, TailorTypeGqlPermission as rt, defineStaticWebSite as s, ArrayFieldOutput as st, Generator as t, db as tt, defineIdp as u, FieldOutput$1 as ut, IncomingWebhookTrigger as v, QueryType as vt, ExecutorServiceConfig as w, AllowedValues as wt, ScheduleTriggerInput as x, InferFieldsOutput as xt, RecordTrigger as y, Resolver as yt, SAML as z };
1717
+ //# sourceMappingURL=index-k5hWCs5L.d.mts.map
@@ -4479,4 +4479,4 @@ var init_jiti = __esmMin((() => {
4479
4479
  //#endregion
4480
4480
  init_jiti();
4481
4481
  export { createJiti };
4482
- //# sourceMappingURL=jiti-BUw4tcVQ.mjs.map
4482
+ //# sourceMappingURL=jiti-SMSW3TA0.mjs.map