@tailor-platform/sdk 0.16.3 → 0.18.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 (39) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +75 -8
  3. package/dist/cli/api.d.mts +35 -31
  4. package/dist/cli/api.mjs +2 -2
  5. package/dist/cli/api.mjs.map +1 -1
  6. package/dist/cli/index.mjs +51 -75
  7. package/dist/cli/index.mjs.map +1 -1
  8. package/dist/configure/index.d.mts +3 -3
  9. package/dist/{index-Bin7-j3v.d.mts → index-BWqIQ4iC.d.mts} +2 -2
  10. package/dist/job-CL8myeqs.mjs.map +1 -1
  11. package/dist/{resume-kyHIaNvK.mjs → resume-ChDChtAZ.mjs} +200 -137
  12. package/dist/{resume-kyHIaNvK.mjs.map → resume-ChDChtAZ.mjs.map} +1 -1
  13. package/dist/{types-Da_WnvA0.d.mts → types-DgaCdTug.d.mts} +21 -13
  14. package/dist/utils/test/index.d.mts +9 -3
  15. package/dist/utils/test/index.mjs +8 -6
  16. package/dist/utils/test/index.mjs.map +1 -1
  17. package/docs/cli/application.md +136 -0
  18. package/docs/cli/auth.md +110 -0
  19. package/docs/cli/secret.md +125 -0
  20. package/docs/cli/user.md +183 -0
  21. package/docs/cli/workflow.md +144 -0
  22. package/docs/cli/workspace.md +122 -0
  23. package/docs/cli-reference.md +80 -801
  24. package/docs/configuration.md +62 -32
  25. package/docs/generator/builtin.md +194 -0
  26. package/docs/generator/custom.md +150 -0
  27. package/docs/generator/index.md +56 -0
  28. package/docs/quickstart.md +9 -4
  29. package/docs/services/auth.md +244 -0
  30. package/docs/services/executor.md +304 -0
  31. package/docs/services/idp.md +106 -0
  32. package/docs/services/resolver.md +213 -0
  33. package/docs/services/secret.md +116 -0
  34. package/docs/services/staticwebsite.md +132 -0
  35. package/docs/services/tailordb.md +325 -0
  36. package/docs/services/workflow.md +176 -0
  37. package/docs/testing.md +3 -1
  38. package/package.json +9 -8
  39. package/docs/core-concepts.md +0 -609
@@ -1,11 +1,11 @@
1
1
  /// <reference path="./user-defined.d.ts" />
2
2
 
3
- import * as zod34 from "zod";
3
+ import * as zod0 from "zod";
4
4
  import { z } from "zod";
5
5
  import { StandardSchemaV1 } from "@standard-schema/spec";
6
6
  import * as type_fest0 from "type-fest";
7
7
  import { IsAny, NonEmptyObject } from "type-fest";
8
- import * as zod_v4_core50 from "zod/v4/core";
8
+ import * as zod_v4_core0 from "zod/v4/core";
9
9
 
10
10
  //#region src/configure/types/helpers.d.ts
11
11
  type Prettify<T> = { [K in keyof T as string extends K ? never : K]: T[K] } & {};
@@ -439,6 +439,14 @@ declare const OAuth2ClientSchema: z.ZodObject<{
439
439
  grantTypes: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"authorization_code">, z.ZodLiteral<"refresh_token">]>>>;
440
440
  redirectURIs: z.ZodArray<z.ZodUnion<readonly [z.ZodTemplateLiteral<`https://${string}`>, z.ZodTemplateLiteral<`http://${string}`>, z.ZodTemplateLiteral<`${string}:url`>, z.ZodTemplateLiteral<`${string}:url/${string}`>]>>;
441
441
  clientType: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"confidential">, z.ZodLiteral<"public">, z.ZodLiteral<"browser">]>>;
442
+ accessTokenLifetimeSeconds: z.ZodPipe<z.ZodOptional<z.ZodNumber>, z.ZodTransform<{
443
+ seconds: bigint;
444
+ nanos: number;
445
+ } | undefined, number | undefined>>;
446
+ refreshTokenLifetimeSeconds: z.ZodPipe<z.ZodOptional<z.ZodNumber>, z.ZodTransform<{
447
+ seconds: bigint;
448
+ nanos: number;
449
+ } | undefined, number | undefined>>;
442
450
  }, z.core.$strip>;
443
451
  declare const SCIMAuthorizationSchema: z.ZodObject<{
444
452
  type: z.ZodUnion<readonly [z.ZodLiteral<"oauth2">, z.ZodLiteral<"bearer">]>;
@@ -533,7 +541,7 @@ type IDToken = z.output<typeof IDTokenSchema>;
533
541
  type BuiltinIdP = z.output<typeof BuiltinIdPSchema>;
534
542
  type IdProviderConfig = z.output<typeof IdProviderSchema>;
535
543
  type OAuth2ClientGrantType = z.output<typeof OAuth2ClientGrantTypeSchema>;
536
- type OAuth2Client = z.output<typeof OAuth2ClientSchema>;
544
+ type OAuth2ClientInput = z.input<typeof OAuth2ClientSchema>;
537
545
  type SCIMAuthorization = z.output<typeof SCIMAuthorizationSchema>;
538
546
  type SCIMAttributeType = z.output<typeof SCIMAttributeTypeSchema>;
539
547
  type SCIMAttribute = z.output<typeof SCIMAttributeSchema>;
@@ -588,7 +596,7 @@ type MachineUser<User extends TailorDBInstance, AttributeMap extends UserAttribu
588
596
  type AuthServiceInput<User extends TailorDBInstance, AttributeMap extends UserAttributeMap<User>, AttributeList extends UserAttributeListKey<User>[], MachineUserNames extends string> = {
589
597
  userProfile?: UserProfile<User, AttributeMap, AttributeList>;
590
598
  machineUsers?: Record<MachineUserNames, MachineUser<User, AttributeMap, AttributeList>>;
591
- oauth2Clients?: Record<string, OAuth2Client>;
599
+ oauth2Clients?: Record<string, OAuth2ClientInput>;
592
600
  idProvider?: IdProviderConfig;
593
601
  scim?: SCIMConfig;
594
602
  tenantProvider?: TenantProviderConfig;
@@ -631,7 +639,7 @@ declare function defineAuth<const Name extends string, const User extends Tailor
631
639
  } : {
632
640
  attributeList: { [Index in keyof AttributeList]: AttributeList[Index] extends UserAttributeListKey<User> ? AttributeList[Index] extends infer T ? T extends AttributeList[Index] ? T extends keyof output<User> ? output<User>[T] : never : never : never : never };
633
641
  })> | undefined;
634
- readonly oauth2Clients?: Record<string, OAuth2Client>;
642
+ readonly oauth2Clients?: Record<string, OAuth2ClientInput>;
635
643
  readonly idProvider?: IdProviderConfig;
636
644
  readonly scim?: SCIMConfig;
637
645
  readonly tenantProvider?: TenantProviderConfig;
@@ -1349,12 +1357,12 @@ declare function defineGenerators(...configs: GeneratorConfig[]): (["@tailor-pla
1349
1357
  }] | {
1350
1358
  id: string;
1351
1359
  description: string;
1352
- processType: zod_v4_core50.$InferInnerFunctionType<zod_v4_core50.$ZodFunctionArgs, zod_v4_core50.$ZodFunctionOut>;
1353
- processResolver: zod_v4_core50.$InferInnerFunctionType<zod_v4_core50.$ZodFunctionArgs, zod_v4_core50.$ZodFunctionOut>;
1354
- processExecutor: zod_v4_core50.$InferInnerFunctionType<zod_v4_core50.$ZodFunctionArgs, zod_v4_core50.$ZodFunctionOut>;
1355
- aggregate: zod_v4_core50.$InferInnerFunctionType<zod_v4_core50.$ZodFunctionArgs, zod34.ZodAny>;
1356
- processTailorDBNamespace?: zod_v4_core50.$InferInnerFunctionType<zod_v4_core50.$ZodFunctionArgs, zod_v4_core50.$ZodFunctionOut> | undefined;
1357
- processResolverNamespace?: zod_v4_core50.$InferInnerFunctionType<zod_v4_core50.$ZodFunctionArgs, zod_v4_core50.$ZodFunctionOut> | undefined;
1360
+ processType: zod_v4_core0.$InferInnerFunctionType<zod_v4_core0.$ZodFunctionArgs, zod_v4_core0.$ZodFunctionOut>;
1361
+ processResolver: zod_v4_core0.$InferInnerFunctionType<zod_v4_core0.$ZodFunctionArgs, zod_v4_core0.$ZodFunctionOut>;
1362
+ processExecutor: zod_v4_core0.$InferInnerFunctionType<zod_v4_core0.$ZodFunctionArgs, zod_v4_core0.$ZodFunctionOut>;
1363
+ aggregate: zod_v4_core0.$InferInnerFunctionType<zod_v4_core0.$ZodFunctionArgs, zod0.ZodAny>;
1364
+ processTailorDBNamespace?: zod_v4_core0.$InferInnerFunctionType<zod_v4_core0.$ZodFunctionArgs, zod_v4_core0.$ZodFunctionOut> | undefined;
1365
+ processResolverNamespace?: zod_v4_core0.$InferInnerFunctionType<zod_v4_core0.$ZodFunctionArgs, zod_v4_core0.$ZodFunctionOut> | undefined;
1358
1366
  })[];
1359
1367
  //#endregion
1360
1368
  //#region src/parser/service/executor/schema.d.ts
@@ -1492,5 +1500,5 @@ type WorkflowOperation = z.infer<typeof WorkflowOperationSchema>;
1492
1500
  type Executor = z.infer<typeof ExecutorSchema>;
1493
1501
  type ExecutorInput = z.input<typeof ExecutorSchema>;
1494
1502
  //#endregion
1495
- export { AllowedValues, AllowedValuesOutput, AppConfig, ArrayFieldOutput, AttributeList$1 as AttributeList, AttributeMap$1 as AttributeMap, AuthConfig, AuthExternalConfig, AuthInvoker$1 as AuthInvoker, AuthOwnConfig, type AuthServiceInput, type BuiltinIdP, CodeGeneratorBase, Executor, ExecutorInput, ExecutorServiceConfig, ExecutorServiceInput, FieldMetadata, FieldOptions, FieldOutput, FunctionOperation, Generator, GqlOperation, type IDToken, IdPConfig, IdPExternalConfig, type IdProviderConfig, IncomingWebhookTrigger, InferFieldsOutput, JsonCompatible, type OAuth2Client, type OAuth2ClientGrantType, type OIDC, PermissionCondition, QueryType, RecordTrigger, Resolver, ResolverExecutedTrigger, ResolverExternalConfig, ResolverInput, ResolverServiceConfig, ResolverServiceInput, type SAML, type SCIMAttribute, type SCIMAttributeMapping, type SCIMAttributeType, type SCIMAuthorization, type SCIMConfig, type SCIMResource, ScheduleTriggerInput, StaticWebsiteConfig, TailorDBField, TailorDBInstance, TailorDBType, TailorDBTypeConfig, TailorField, TailorTypeGqlPermission, TailorTypePermission, TailorUser, type TenantProviderConfig, type UserAttributeKey, type UserAttributeListKey, type UserAttributeMap, type UsernameFieldKey, type ValueOperand, WebhookOperation, WorkflowOperation, WorkflowServiceConfig, WorkflowServiceInput, db, defineAuth, defineConfig, defineGenerators, defineIdp, defineStaticWebSite, output, unauthenticatedTailorUser, unsafeAllowAllGqlPermission, unsafeAllowAllTypePermission };
1496
- //# sourceMappingURL=types-Da_WnvA0.d.mts.map
1503
+ export { AllowedValues, AllowedValuesOutput, AppConfig, ArrayFieldOutput, AttributeList$1 as AttributeList, AttributeMap$1 as AttributeMap, AuthConfig, AuthExternalConfig, AuthInvoker$1 as AuthInvoker, AuthOwnConfig, type AuthServiceInput, type BuiltinIdP, CodeGeneratorBase, Executor, ExecutorInput, ExecutorServiceConfig, ExecutorServiceInput, FieldMetadata, FieldOptions, FieldOutput, FunctionOperation, Generator, GqlOperation, type IDToken, IdPConfig, IdPExternalConfig, type IdProviderConfig, IncomingWebhookTrigger, InferFieldsOutput, JsonCompatible, type OAuth2ClientGrantType, OAuth2ClientInput, type OIDC, PermissionCondition, QueryType, RecordTrigger, Resolver, ResolverExecutedTrigger, ResolverExternalConfig, ResolverInput, ResolverServiceConfig, ResolverServiceInput, type SAML, type SCIMAttribute, type SCIMAttributeMapping, type SCIMAttributeType, type SCIMAuthorization, type SCIMConfig, type SCIMResource, ScheduleTriggerInput, StaticWebsiteConfig, TailorDBField, TailorDBInstance, TailorDBType, TailorDBTypeConfig, TailorField, TailorTypeGqlPermission, TailorTypePermission, TailorUser, type TenantProviderConfig, type UserAttributeKey, type UserAttributeListKey, type UserAttributeMap, type UsernameFieldKey, type ValueOperand, WebhookOperation, WorkflowOperation, WorkflowServiceConfig, WorkflowServiceInput, db, defineAuth, defineConfig, defineGenerators, defineIdp, defineStaticWebSite, output, unauthenticatedTailorUser, unsafeAllowAllGqlPermission, unsafeAllowAllTypePermission };
1504
+ //# sourceMappingURL=types-DgaCdTug.d.mts.map
@@ -1,12 +1,18 @@
1
1
  /// <reference path="./../../user-defined.d.ts" />
2
2
 
3
- import { TailorDBType, TailorField, TailorUser } from "../../types-Da_WnvA0.mjs";
4
- import { output } from "../../index-Bin7-j3v.mjs";
3
+ import { TailorDBType, TailorField } from "../../types-DgaCdTug.mjs";
4
+ import { output } from "../../index-BWqIQ4iC.mjs";
5
5
  import { StandardSchemaV1 } from "@standard-schema/spec";
6
6
 
7
7
  //#region src/utils/test/index.d.ts
8
8
  /** Represents an unauthenticated user in the Tailor platform. */
9
- declare const unauthenticatedTailorUser: TailorUser;
9
+ declare const unauthenticatedTailorUser: {
10
+ readonly id: "00000000-0000-0000-0000-000000000000";
11
+ readonly type: "";
12
+ readonly workspaceId: "00000000-0000-0000-0000-000000000000";
13
+ readonly attributes: null;
14
+ readonly attributeList: [];
15
+ };
10
16
  /**
11
17
  * Creates a hook function that processes TailorDB type fields
12
18
  * - Uses existing id from data if provided, otherwise generates UUID for id fields
@@ -23,12 +23,14 @@ function createTailorDBHook(type) {
23
23
  const field = value;
24
24
  if (key === "id") hooked[key] = (data && typeof data === "object" ? data[key] : void 0) ?? crypto.randomUUID();
25
25
  else if (field.type === "nested") hooked[key] = createTailorDBHook({ fields: field.fields })(data[key]);
26
- else if (field.metadata.hooks?.create) hooked[key] = field.metadata.hooks.create({
27
- value: data[key],
28
- data,
29
- user: unauthenticatedTailorUser
30
- });
31
- else if (data && typeof data === "object") hooked[key] = data[key];
26
+ else if (field.metadata.hooks?.create) {
27
+ hooked[key] = field.metadata.hooks.create({
28
+ value: data[key],
29
+ data,
30
+ user: unauthenticatedTailorUser
31
+ });
32
+ if (hooked[key] instanceof Date) hooked[key] = hooked[key].toISOString();
33
+ } else if (data && typeof data === "object") hooked[key] = data[key];
32
34
  return hooked;
33
35
  }, {});
34
36
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["unauthenticatedTailorUser: TailorUser"],"sources":["../../../src/utils/test/index.ts"],"sourcesContent":["import type { output, TailorUser } from \"@/configure\";\nimport type { TailorDBType } from \"@/configure/services/tailordb/schema\";\nimport type { TailorField } from \"@/configure/types/type\";\nimport type { StandardSchemaV1 } from \"@standard-schema/spec\";\n\n/** Represents an unauthenticated user in the Tailor platform. */\nexport const unauthenticatedTailorUser: TailorUser = {\n id: \"00000000-0000-0000-0000-000000000000\",\n type: \"\",\n workspaceId: \"00000000-0000-0000-0000-000000000000\",\n attributes: null,\n attributeList: [],\n} as const;\n\n/**\n * Creates a hook function that processes TailorDB type fields\n * - Uses existing id from data if provided, otherwise generates UUID for id fields\n * - Recursively processes nested types\n * - Executes hooks.create for fields with create hooks\n *\n * @template T - The output type of the hook function\n * @param type - TailorDB type definition\n * @returns A function that transforms input data according to field hooks\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function createTailorDBHook<T extends TailorDBType<any, any>>(type: T) {\n return (data: unknown) => {\n return Object.entries(type.fields).reduce(\n (hooked, [key, value]) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const field = value as TailorField<any, any, any>;\n if (key === \"id\") {\n // Use existing id from data if provided, otherwise generate new UUID\n const existingId =\n data && typeof data === \"object\"\n ? (data as Record<string, unknown>)[key]\n : undefined;\n hooked[key] = existingId ?? crypto.randomUUID();\n } else if (field.type === \"nested\") {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n hooked[key] = createTailorDBHook({ fields: field.fields } as any)(\n (data as Record<string, unknown>)[key],\n );\n } else if (field.metadata.hooks?.create) {\n hooked[key] = field.metadata.hooks.create({\n value: (data as Record<string, unknown>)[key],\n data: data,\n user: unauthenticatedTailorUser,\n });\n } else if (data && typeof data === \"object\") {\n hooked[key] = (data as Record<string, unknown>)[key];\n }\n return hooked;\n },\n {} as Record<string, unknown>,\n ) as Partial<output<T>>;\n };\n}\n\n/**\n * Creates the standard schema definition for lines-db\n * This returns the first argument for defineSchema with the ~standard section\n *\n * @template T - The output type after validation\n * @param schemaType - TailorDB field schema for validation\n * @param hook - Hook function to transform data before validation\n * @returns Schema object with ~standard section for defineSchema\n */\nexport function createStandardSchema<T = Record<string, unknown>>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n schemaType: TailorField<any, T>,\n hook: (data: unknown) => Partial<T>,\n) {\n return {\n \"~standard\": {\n version: 1,\n vendor: \"@tailor-platform/sdk\",\n validate: (value: unknown) => {\n const hooked = hook(value);\n const result = schemaType.parse({\n value: hooked,\n data: hooked,\n user: unauthenticatedTailorUser,\n });\n if (result.issues) {\n return result;\n }\n return { value: hooked as T };\n },\n },\n } as const satisfies StandardSchemaV1<T>;\n}\n"],"mappings":";;AAMA,MAAaA,4BAAwC;CACnD,IAAI;CACJ,MAAM;CACN,aAAa;CACb,YAAY;CACZ,eAAe,EAAE;CAClB;;;;;;;;;;;AAaD,SAAgB,mBAAqD,MAAS;AAC5E,SAAQ,SAAkB;AACxB,SAAO,OAAO,QAAQ,KAAK,OAAO,CAAC,QAChC,QAAQ,CAAC,KAAK,WAAW;GAExB,MAAM,QAAQ;AACd,OAAI,QAAQ,KAMV,QAAO,QAHL,QAAQ,OAAO,SAAS,WACnB,KAAiC,OAClC,WACsB,OAAO,YAAY;YACtC,MAAM,SAAS,SAExB,QAAO,OAAO,mBAAmB,EAAE,QAAQ,MAAM,QAAQ,CAAQ,CAC9D,KAAiC,KACnC;YACQ,MAAM,SAAS,OAAO,OAC/B,QAAO,OAAO,MAAM,SAAS,MAAM,OAAO;IACxC,OAAQ,KAAiC;IACnC;IACN,MAAM;IACP,CAAC;YACO,QAAQ,OAAO,SAAS,SACjC,QAAO,OAAQ,KAAiC;AAElD,UAAO;KAET,EAAE,CACH;;;;;;;;;;;;AAaL,SAAgB,qBAEd,YACA,MACA;AACA,QAAO,EACL,aAAa;EACX,SAAS;EACT,QAAQ;EACR,WAAW,UAAmB;GAC5B,MAAM,SAAS,KAAK,MAAM;GAC1B,MAAM,SAAS,WAAW,MAAM;IAC9B,OAAO;IACP,MAAM;IACN,MAAM;IACP,CAAC;AACF,OAAI,OAAO,OACT,QAAO;AAET,UAAO,EAAE,OAAO,QAAa;;EAEhC,EACF"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../src/utils/test/index.ts"],"sourcesContent":["import type { output, TailorUser } from \"@/configure\";\nimport type { TailorDBType } from \"@/configure/services/tailordb/schema\";\nimport type { TailorField } from \"@/configure/types/type\";\nimport type { StandardSchemaV1 } from \"@standard-schema/spec\";\n\n/** Represents an unauthenticated user in the Tailor platform. */\nexport const unauthenticatedTailorUser = {\n id: \"00000000-0000-0000-0000-000000000000\",\n type: \"\",\n workspaceId: \"00000000-0000-0000-0000-000000000000\",\n attributes: null,\n attributeList: [],\n} as const satisfies TailorUser;\n\n/**\n * Creates a hook function that processes TailorDB type fields\n * - Uses existing id from data if provided, otherwise generates UUID for id fields\n * - Recursively processes nested types\n * - Executes hooks.create for fields with create hooks\n *\n * @template T - The output type of the hook function\n * @param type - TailorDB type definition\n * @returns A function that transforms input data according to field hooks\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function createTailorDBHook<T extends TailorDBType<any, any>>(type: T) {\n return (data: unknown) => {\n return Object.entries(type.fields).reduce(\n (hooked, [key, value]) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const field = value as TailorField<any, any, any>;\n if (key === \"id\") {\n // Use existing id from data if provided, otherwise generate new UUID\n const existingId =\n data && typeof data === \"object\"\n ? (data as Record<string, unknown>)[key]\n : undefined;\n hooked[key] = existingId ?? crypto.randomUUID();\n } else if (field.type === \"nested\") {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n hooked[key] = createTailorDBHook({ fields: field.fields } as any)(\n (data as Record<string, unknown>)[key],\n );\n } else if (field.metadata.hooks?.create) {\n hooked[key] = field.metadata.hooks.create({\n value: (data as Record<string, unknown>)[key],\n data: data,\n user: unauthenticatedTailorUser,\n });\n if (hooked[key] instanceof Date) {\n hooked[key] = hooked[key].toISOString();\n }\n } else if (data && typeof data === \"object\") {\n hooked[key] = (data as Record<string, unknown>)[key];\n }\n return hooked;\n },\n {} as Record<string, unknown>,\n ) as Partial<output<T>>;\n };\n}\n\n/**\n * Creates the standard schema definition for lines-db\n * This returns the first argument for defineSchema with the ~standard section\n *\n * @template T - The output type after validation\n * @param schemaType - TailorDB field schema for validation\n * @param hook - Hook function to transform data before validation\n * @returns Schema object with ~standard section for defineSchema\n */\nexport function createStandardSchema<T = Record<string, unknown>>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n schemaType: TailorField<any, T>,\n hook: (data: unknown) => Partial<T>,\n) {\n return {\n \"~standard\": {\n version: 1,\n vendor: \"@tailor-platform/sdk\",\n validate: (value: unknown) => {\n const hooked = hook(value);\n const result = schemaType.parse({\n value: hooked,\n data: hooked,\n user: unauthenticatedTailorUser,\n });\n if (result.issues) {\n return result;\n }\n return { value: hooked as T };\n },\n },\n } as const satisfies StandardSchemaV1<T>;\n}\n"],"mappings":";;AAMA,MAAa,4BAA4B;CACvC,IAAI;CACJ,MAAM;CACN,aAAa;CACb,YAAY;CACZ,eAAe,EAAE;CAClB;;;;;;;;;;;AAaD,SAAgB,mBAAqD,MAAS;AAC5E,SAAQ,SAAkB;AACxB,SAAO,OAAO,QAAQ,KAAK,OAAO,CAAC,QAChC,QAAQ,CAAC,KAAK,WAAW;GAExB,MAAM,QAAQ;AACd,OAAI,QAAQ,KAMV,QAAO,QAHL,QAAQ,OAAO,SAAS,WACnB,KAAiC,OAClC,WACsB,OAAO,YAAY;YACtC,MAAM,SAAS,SAExB,QAAO,OAAO,mBAAmB,EAAE,QAAQ,MAAM,QAAQ,CAAQ,CAC9D,KAAiC,KACnC;YACQ,MAAM,SAAS,OAAO,QAAQ;AACvC,WAAO,OAAO,MAAM,SAAS,MAAM,OAAO;KACxC,OAAQ,KAAiC;KACnC;KACN,MAAM;KACP,CAAC;AACF,QAAI,OAAO,gBAAgB,KACzB,QAAO,OAAO,OAAO,KAAK,aAAa;cAEhC,QAAQ,OAAO,SAAS,SACjC,QAAO,OAAQ,KAAiC;AAElD,UAAO;KAET,EAAE,CACH;;;;;;;;;;;;AAaL,SAAgB,qBAEd,YACA,MACA;AACA,QAAO,EACL,aAAa;EACX,SAAS;EACT,QAAQ;EACR,WAAW,UAAmB;GAC5B,MAAM,SAAS,KAAK,MAAM;GAC1B,MAAM,SAAS,WAAW,MAAM;IAC9B,OAAO;IACP,MAAM;IACN,MAAM;IACP,CAAC;AACF,OAAI,OAAO,OACT,QAAO;AAET,UAAO,EAAE,OAAO,QAAa;;EAEhC,EACF"}
@@ -0,0 +1,136 @@
1
+ # Application Commands
2
+
3
+ Commands for managing Tailor Platform applications. These commands work with `tailor.config.ts`.
4
+
5
+ ## init
6
+
7
+ Initialize a new project using create-sdk.
8
+
9
+ ```bash
10
+ tailor-sdk init [name] [options]
11
+ ```
12
+
13
+ **Arguments:**
14
+
15
+ - `name` - Project name
16
+
17
+ **Options:**
18
+
19
+ - `-t, --template` - Template name
20
+
21
+ ## generate
22
+
23
+ Generate files using Tailor configuration.
24
+
25
+ ```bash
26
+ tailor-sdk generate [options]
27
+ ```
28
+
29
+ **Options:**
30
+
31
+ - `-c, --config` - Path to the SDK config file (default: `tailor.config.ts`)
32
+ - `-w, --watch` - Watch for type/resolver changes and regenerate
33
+
34
+ ## apply
35
+
36
+ Apply Tailor configuration to deploy your application.
37
+
38
+ ```bash
39
+ tailor-sdk apply [options]
40
+ ```
41
+
42
+ **Options:**
43
+
44
+ - `-w, --workspace-id` - ID of the workspace to apply the configuration to
45
+ - `-p, --profile` - Workspace profile to use
46
+ - `-c, --config` - Path to the SDK config file (default: `tailor.config.ts`)
47
+ - `-d, --dryRun` - Run the command without making any changes
48
+ - `-y, --yes` - Skip confirmation prompt
49
+
50
+ ## remove
51
+
52
+ Remove all resources managed by the application from the workspace.
53
+
54
+ ```bash
55
+ tailor-sdk remove [options]
56
+ ```
57
+
58
+ **Options:**
59
+
60
+ - `-w, --workspace-id` - ID of the workspace to remove resources from
61
+ - `-p, --profile` - Workspace profile to use
62
+ - `-c, --config` - Path to the SDK config file (default: `tailor.config.ts`)
63
+ - `-y, --yes` - Skip confirmation prompt
64
+
65
+ ## show
66
+
67
+ Show information about the deployed application.
68
+
69
+ ```bash
70
+ tailor-sdk show [options]
71
+ ```
72
+
73
+ **Options:**
74
+
75
+ - `-w, --workspace-id` - ID of the workspace to show the application from
76
+ - `-p, --profile` - Workspace profile to use
77
+ - `-c, --config` - Path to the SDK config file (default: `tailor.config.ts`)
78
+ - `--json` - Output as JSON
79
+
80
+ ## tailordb
81
+
82
+ Manage TailorDB tables and data.
83
+
84
+ ```bash
85
+ tailor-sdk tailordb <subcommand> [options]
86
+ ```
87
+
88
+ ### tailordb truncate
89
+
90
+ Truncate (delete all records from) TailorDB tables.
91
+
92
+ ```bash
93
+ tailor-sdk tailordb truncate [types...] [options]
94
+ ```
95
+
96
+ **Arguments:**
97
+
98
+ - `types...` - Space-separated list of type names to truncate (optional)
99
+
100
+ **Options:**
101
+
102
+ - `-a, --all` - Truncate all tables in all namespaces
103
+ - `-n, --namespace` - Truncate all tables in the specified namespace
104
+ - `-y, --yes` - Skip confirmation prompt
105
+ - `-w, --workspace-id` - ID of the workspace
106
+ - `-p, --profile` - Workspace profile to use
107
+ - `-c, --config` - Path to the SDK config file (default: `tailor.config.ts`)
108
+
109
+ **Usage Examples:**
110
+
111
+ ```bash
112
+ # Truncate all tables in all namespaces (requires confirmation)
113
+ tailor-sdk tailordb truncate --all
114
+
115
+ # Truncate all tables in all namespaces (skip confirmation)
116
+ tailor-sdk tailordb truncate --all --yes
117
+
118
+ # Truncate all tables in a specific namespace
119
+ tailor-sdk tailordb truncate --namespace myNamespace
120
+
121
+ # Truncate specific types (namespace is auto-detected)
122
+ tailor-sdk tailordb truncate User Post Comment
123
+
124
+ # Truncate specific types with confirmation skipped
125
+ tailor-sdk tailordb truncate User Post --yes
126
+ ```
127
+
128
+ **Notes:**
129
+
130
+ - You must specify exactly one of: `--all`, `--namespace`, or type names
131
+ - When truncating specific types, the namespace is automatically detected from your config
132
+ - Confirmation prompts vary based on the operation:
133
+ - `--all`: requires typing `truncate all`
134
+ - `--namespace`: requires typing `truncate <namespace-name>`
135
+ - Specific types: requires typing `yes`
136
+ - Use `--yes` flag to skip confirmation prompts (useful for scripts and CI/CD)
@@ -0,0 +1,110 @@
1
+ # Auth Resource Commands
2
+
3
+ Commands for managing Auth service resources (machine users and OAuth2 clients).
4
+
5
+ ## machineuser
6
+
7
+ Manage machine users in your Tailor Platform application.
8
+
9
+ ```bash
10
+ tailor-sdk machineuser <subcommand> [options]
11
+ ```
12
+
13
+ ### machineuser list
14
+
15
+ List all machine users in the application.
16
+
17
+ ```bash
18
+ tailor-sdk machineuser list [options]
19
+ ```
20
+
21
+ **Options:**
22
+
23
+ - `-w, --workspace-id` - ID of the workspace
24
+ - `-p, --profile` - Workspace profile to use
25
+ - `-c, --config` - Path to the SDK config file (default: `tailor.config.ts`)
26
+ - `--json` - Output as JSON
27
+
28
+ ### machineuser token
29
+
30
+ Get an access token for a machine user.
31
+
32
+ ```bash
33
+ tailor-sdk machineuser token <name> [options]
34
+ ```
35
+
36
+ **Arguments:**
37
+
38
+ - `name` - Machine user name (required)
39
+
40
+ **Options:**
41
+
42
+ - `-w, --workspace-id` - ID of the workspace
43
+ - `-p, --profile` - Workspace profile to use
44
+ - `-c, --config` - Path to the SDK config file (default: `tailor.config.ts`)
45
+ - `--json` - Output as JSON
46
+
47
+ ## oauth2client
48
+
49
+ Manage OAuth2 clients in your Tailor Platform application.
50
+
51
+ ```bash
52
+ tailor-sdk oauth2client <subcommand> [options]
53
+ ```
54
+
55
+ ### oauth2client list
56
+
57
+ List all OAuth2 clients in the application.
58
+
59
+ ```bash
60
+ tailor-sdk oauth2client list [options]
61
+ ```
62
+
63
+ **Options:**
64
+
65
+ - `-w, --workspace-id` - ID of the workspace
66
+ - `-p, --profile` - Workspace profile to use
67
+ - `-c, --config` - Path to the SDK config file (default: `tailor.config.ts`)
68
+ - `--json` - Output as JSON
69
+
70
+ **Output:**
71
+
72
+ Returns a list of OAuth2 clients with the following fields:
73
+
74
+ - `name` - Client name
75
+ - `description` - Client description
76
+ - `clientId` - OAuth2 client ID
77
+ - `grantTypes` - Supported grant types (e.g., `authorization_code`, `refresh_token`)
78
+ - `redirectUris` - Registered redirect URIs
79
+ - `createdAt` - Creation timestamp
80
+
81
+ ### oauth2client get
82
+
83
+ Get OAuth2 client credentials (including client secret).
84
+
85
+ ```bash
86
+ tailor-sdk oauth2client get <name> [options]
87
+ ```
88
+
89
+ **Arguments:**
90
+
91
+ - `name` - OAuth2 client name (required)
92
+
93
+ **Options:**
94
+
95
+ - `-w, --workspace-id` - ID of the workspace
96
+ - `-p, --profile` - Workspace profile to use
97
+ - `-c, --config` - Path to the SDK config file (default: `tailor.config.ts`)
98
+ - `--json` - Output as JSON
99
+
100
+ **Output:**
101
+
102
+ Returns the OAuth2 client credentials with the following fields:
103
+
104
+ - `name` - Client name
105
+ - `description` - Client description
106
+ - `clientId` - OAuth2 client ID
107
+ - `clientSecret` - OAuth2 client secret
108
+ - `grantTypes` - Supported grant types
109
+ - `redirectUris` - Registered redirect URIs
110
+ - `createdAt` - Creation timestamp
@@ -0,0 +1,125 @@
1
+ # Secret Commands
2
+
3
+ Commands for managing Secret Manager vaults and secrets.
4
+
5
+ ## secret
6
+
7
+ Manage Secret Manager vaults and secrets.
8
+
9
+ ```bash
10
+ tailor-sdk secret <subcommand> [options]
11
+ ```
12
+
13
+ ### secret vault
14
+
15
+ Manage Secret Manager vaults.
16
+
17
+ ```bash
18
+ tailor-sdk secret vault <subcommand> [options]
19
+ ```
20
+
21
+ #### secret vault create
22
+
23
+ Create a new Secret Manager vault.
24
+
25
+ ```bash
26
+ tailor-sdk secret vault create [options]
27
+ ```
28
+
29
+ **Options:**
30
+
31
+ - `--name` - Vault name (required)
32
+ - `-w, --workspace-id` - ID of the workspace
33
+ - `-p, --profile` - Workspace profile to use
34
+
35
+ #### secret vault delete
36
+
37
+ Delete a Secret Manager vault.
38
+
39
+ ```bash
40
+ tailor-sdk secret vault delete [options]
41
+ ```
42
+
43
+ **Options:**
44
+
45
+ - `--name` - Vault name (required)
46
+ - `-w, --workspace-id` - ID of the workspace
47
+ - `-p, --profile` - Workspace profile to use
48
+ - `-y, --yes` - Skip confirmation prompt
49
+
50
+ #### secret vault list
51
+
52
+ List all Secret Manager vaults in the workspace.
53
+
54
+ ```bash
55
+ tailor-sdk secret vault list [options]
56
+ ```
57
+
58
+ **Options:**
59
+
60
+ - `-w, --workspace-id` - ID of the workspace
61
+ - `-p, --profile` - Workspace profile to use
62
+ - `--json` - Output as JSON
63
+
64
+ ### secret create
65
+
66
+ Create a secret in a vault.
67
+
68
+ ```bash
69
+ tailor-sdk secret create [options]
70
+ ```
71
+
72
+ **Options:**
73
+
74
+ - `--vault-name` - Vault name (required)
75
+ - `--name` - Secret name (required)
76
+ - `--value` - Secret value (required)
77
+ - `-w, --workspace-id` - ID of the workspace
78
+ - `-p, --profile` - Workspace profile to use
79
+
80
+ ### secret update
81
+
82
+ Update a secret in a vault.
83
+
84
+ ```bash
85
+ tailor-sdk secret update [options]
86
+ ```
87
+
88
+ **Options:**
89
+
90
+ - `--vault-name` - Vault name (required)
91
+ - `--name` - Secret name (required)
92
+ - `--value` - New secret value (required)
93
+ - `-w, --workspace-id` - ID of the workspace
94
+ - `-p, --profile` - Workspace profile to use
95
+
96
+ ### secret list
97
+
98
+ List all secrets in a vault.
99
+
100
+ ```bash
101
+ tailor-sdk secret list [options]
102
+ ```
103
+
104
+ **Options:**
105
+
106
+ - `--vault-name` - Vault name (required)
107
+ - `-w, --workspace-id` - ID of the workspace
108
+ - `-p, --profile` - Workspace profile to use
109
+ - `--json` - Output as JSON
110
+
111
+ ### secret delete
112
+
113
+ Delete a secret in a vault.
114
+
115
+ ```bash
116
+ tailor-sdk secret delete [options]
117
+ ```
118
+
119
+ **Options:**
120
+
121
+ - `--vault-name` - Vault name (required)
122
+ - `--name` - Secret name (required)
123
+ - `-w, --workspace-id` - ID of the workspace
124
+ - `-p, --profile` - Workspace profile to use
125
+ - `-y, --yes` - Skip confirmation prompt