@tailor-platform/sdk 1.25.3 → 1.26.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.
- package/CHANGELOG.md +56 -0
- package/dist/{application-DegTCDd8.mjs → application-CxH6Yp54.mjs} +1 -1
- package/dist/{application-91Th6tm6.mjs → application-D9xahQRQ.mjs} +2066 -1968
- package/dist/application-D9xahQRQ.mjs.map +1 -0
- package/dist/cli/index.mjs +152 -3
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/lib.d.mts +350 -8
- package/dist/cli/lib.mjs +4 -24
- package/dist/cli/lib.mjs.map +1 -1
- package/dist/configure/index.d.mts +5 -5
- package/dist/configure/index.mjs.map +1 -1
- package/dist/{env-uBeVwE9B.d.mts → env-CSsVESbH.d.mts} +2 -2
- package/dist/{index-Bu12qy3m.d.mts → index-BJg0DTbR.d.mts} +4 -4
- package/dist/{index-CT53egux.d.mts → index-BKy-OC5C.d.mts} +2 -2
- package/dist/{index-cZilKprY.d.mts → index-BtYPY8ya.d.mts} +2 -2
- package/dist/{index-BD-K97-C.d.mts → index-DgRShBpu.d.mts} +2 -2
- package/dist/{index-D1J5SfyK.d.mts → index-DkJbItB-.d.mts} +2 -2
- package/dist/plugin/builtin/enum-constants/index.d.mts +1 -1
- package/dist/plugin/builtin/file-utils/index.d.mts +1 -1
- package/dist/plugin/builtin/kysely-type/index.d.mts +1 -1
- package/dist/plugin/builtin/seed/index.d.mts +1 -1
- package/dist/plugin/index.d.mts +2 -2
- package/dist/{plugin-zY5wvV82.d.mts → plugin-B1hNwcCC.d.mts} +15 -3
- package/dist/{query-BpppEOzu.mjs → query-B8ml6ClT.mjs} +455 -360
- package/dist/query-B8ml6ClT.mjs.map +1 -0
- package/dist/utils/test/index.d.mts +2 -2
- package/dist/{workflow.generated-v1LXRuB6.d.mts → workflow.generated-Bm4b8hEk.d.mts} +2 -2
- package/docs/cli/setup.md +82 -0
- package/docs/cli-reference.md +8 -0
- package/docs/services/auth.md +33 -0
- package/package.json +10 -10
- package/postinstall.mjs +14 -39
- package/dist/application-91Th6tm6.mjs.map +0 -1
- package/dist/query-BpppEOzu.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["t","_t"],"sources":["../../src/configure/types/user.ts","../../src/configure/services/auth/index.ts","../../src/configure/services/resolver/resolver.ts","../../src/configure/services/executor/executor.ts","../../src/configure/services/executor/trigger/event.ts","../../src/configure/services/executor/trigger/schedule.ts","../../src/configure/services/executor/trigger/webhook.ts","../../src/configure/services/workflow/workflow.ts","../../src/configure/services/staticwebsite/index.ts","../../src/configure/services/idp/index.ts","../../src/configure/services/secrets/index.ts","../../src/configure/config.ts","../../src/configure/index.ts"],"sourcesContent":["// Interfaces for module augmentation\n// Users can extend these via: declare module \"@tailor-platform/sdk\" { interface AttributeMap { ... } }\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface AttributeMap {}\nexport interface AttributeList {\n __tuple?: []; // Marker for tuple type\n}\n\nexport type InferredAttributeMap = keyof AttributeMap extends never\n ? Record<string, string | string[] | boolean | boolean[] | undefined>\n : AttributeMap;\n\nexport type InferredAttributeList = AttributeList[\"__tuple\"] extends []\n ? string[]\n : AttributeList[\"__tuple\"];\n\n/** Represents a user in the Tailor platform. */\nexport type TailorUser = {\n /**\n * The ID of the user.\n * For unauthenticated users, this will be a nil UUID.\n */\n id: string;\n /**\n * The type of the user.\n * For unauthenticated users, this will be an empty string.\n */\n type: \"user\" | \"machine_user\" | \"\";\n /** The ID of the workspace the user belongs to. */\n workspaceId: string;\n /**\n * A map of the user's attributes.\n * For unauthenticated users, this will be null.\n */\n attributes: InferredAttributeMap | null;\n /**\n * A list of the user's attributes.\n * For unauthenticated users, this will be an empty array.\n */\n attributeList: InferredAttributeList;\n};\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};\n","import { type TailorDBInstance } from \"../tailordb/schema\";\nimport type { TailorField } from \"@/configure/types/type\";\nimport type { DefinedFieldMetadata, FieldMetadata, TailorFieldType } from \"@/configure/types/types\";\nimport type {\n AuthDefinitionBrand,\n AuthServiceInput,\n DefinedAuth,\n UserAttributeListKey,\n UserAttributeMap,\n} from \"@/types/auth\";\nimport type { AuthInvoker as ParserAuthInvoker } from \"@/types/auth.generated\";\n\ntype MachineUserAttributeFields = Record<\n string,\n TailorField<DefinedFieldMetadata, unknown, FieldMetadata, TailorFieldType>\n>;\n\ntype PlaceholderUser = TailorDBInstance<Record<string, never>, Record<string, never>>;\ntype PlaceholderAttributeMap = UserAttributeMap<PlaceholderUser>;\ntype PlaceholderAttributeList = UserAttributeListKey<PlaceholderUser>[];\n\ntype UserProfileAuthInput<\n User extends TailorDBInstance,\n AttributeMap extends UserAttributeMap<User>,\n AttributeList extends UserAttributeListKey<User>[],\n MachineUserNames extends string,\n> = Omit<\n AuthServiceInput<User, AttributeMap, AttributeList, MachineUserNames, undefined>,\n \"userProfile\" | \"machineUserAttributes\"\n> & {\n userProfile: NonNullable<\n AuthServiceInput<User, AttributeMap, AttributeList, MachineUserNames, undefined>[\"userProfile\"]\n >;\n machineUserAttributes?: never;\n};\n\ntype MachineUserOnlyAuthInput<\n MachineUserNames extends string,\n MachineUserAttributes extends MachineUserAttributeFields,\n> = Omit<\n AuthServiceInput<\n PlaceholderUser,\n PlaceholderAttributeMap,\n PlaceholderAttributeList,\n MachineUserNames,\n MachineUserAttributes\n >,\n \"userProfile\" | \"machineUserAttributes\"\n> & {\n userProfile?: never;\n machineUserAttributes: MachineUserAttributes;\n};\n\nexport type {\n OIDC,\n SAML,\n IDToken,\n BuiltinIdP,\n IdProvider as IdProviderConfig,\n OAuth2ClientInput as OAuth2Client,\n SCIMAuthorization,\n SCIMAttribute,\n SCIMAttributeMapping,\n SCIMResource,\n SCIMConfig,\n TenantProvider as TenantProviderConfig,\n} from \"@/types/auth.generated\";\nexport type { OAuth2ClientGrantType, SCIMAttributeType } from \"@/types/auth\";\nexport type {\n ValueOperand,\n UsernameFieldKey,\n UserAttributeKey,\n UserAttributeListKey,\n UserAttributeMap,\n AuthServiceInput,\n AuthConfig,\n AuthExternalConfig,\n AuthOwnConfig,\n DefinedAuth,\n} from \"@/types/auth\";\n\n/**\n * Invoker type compatible with tailor.v1.AuthInvoker\n * - namespace: auth service name\n * - machineUserName: machine user name\n */\nexport type AuthInvoker<M extends string> = Omit<ParserAuthInvoker, \"machineUserName\"> & {\n machineUserName: M;\n};\n\n/**\n * Define an auth service for the Tailor SDK.\n * @template Name\n * @template User\n * @template AttributeMap\n * @template AttributeList\n * @template MachineUserNames\n * @template M\n * @param name - Auth service name\n * @param config - Auth service configuration\n * @returns Defined auth service\n */\nexport function defineAuth<\n const Name extends string,\n const User extends TailorDBInstance,\n const AttributeMap extends UserAttributeMap<User>,\n const AttributeList extends UserAttributeListKey<User>[],\n const MachineUserNames extends string,\n>(\n name: Name,\n config: UserProfileAuthInput<User, AttributeMap, AttributeList, MachineUserNames>,\n): DefinedAuth<\n Name,\n UserProfileAuthInput<User, AttributeMap, AttributeList, MachineUserNames>,\n MachineUserNames\n>;\nexport function defineAuth<\n const Name extends string,\n const MachineUserAttributes extends MachineUserAttributeFields,\n const MachineUserNames extends string,\n>(\n name: Name,\n config: MachineUserOnlyAuthInput<MachineUserNames, MachineUserAttributes>,\n): DefinedAuth<\n Name,\n MachineUserOnlyAuthInput<MachineUserNames, MachineUserAttributes>,\n MachineUserNames\n>;\nexport function defineAuth<\n const Name extends string,\n const User extends TailorDBInstance,\n const AttributeMap extends UserAttributeMap<User>,\n const AttributeList extends UserAttributeListKey<User>[],\n const MachineUserAttributes extends MachineUserAttributeFields,\n const MachineUserNames extends string,\n>(\n name: Name,\n config:\n | UserProfileAuthInput<User, AttributeMap, AttributeList, MachineUserNames>\n | MachineUserOnlyAuthInput<MachineUserNames, MachineUserAttributes>,\n) {\n const result = {\n ...config,\n name,\n invoker<M extends MachineUserNames>(machineUser: M) {\n return { namespace: name, machineUserName: machineUser } as const;\n },\n } as const satisfies (\n | UserProfileAuthInput<User, AttributeMap, AttributeList, MachineUserNames>\n | MachineUserOnlyAuthInput<MachineUserNames, MachineUserAttributes>\n ) & {\n name: string;\n invoker<M extends MachineUserNames>(machineUser: M): AuthInvoker<M>;\n };\n\n validateAuthConfig(result);\n\n return result as typeof result & AuthDefinitionBrand;\n}\n\nfunction validateAuthConfig(config: {\n userProfile?: unknown;\n machineUserAttributes?: unknown;\n}): void {\n const hasUserProfile = config.userProfile !== undefined;\n const hasMachineUserAttributes = config.machineUserAttributes !== undefined;\n\n if (hasUserProfile && hasMachineUserAttributes) {\n throw new Error(\"Provide either userProfile or machineUserAttributes, not both.\");\n }\n}\n","import { t } from \"@/configure/types/type\";\nimport { brandValue } from \"@/utils/brand\";\nimport type { TailorAnyField, TailorUser } from \"@/configure/types\";\nimport type { TailorEnv } from \"@/configure/types/env\";\nimport type { InferFieldsOutput, output } from \"@/configure/types/helpers\";\nimport type { TailorField } from \"@/configure/types/type\";\nimport type { ResolverInput } from \"@/types/resolver.generated\";\n\ntype Context<Input extends Record<string, TailorAnyField> | undefined> = {\n input: Input extends Record<string, TailorAnyField> ? InferFieldsOutput<Input> : never;\n user: TailorUser;\n env: TailorEnv;\n};\n\ntype OutputType<O> = O extends TailorAnyField\n ? output<O>\n : O extends Record<string, TailorAnyField>\n ? InferFieldsOutput<O>\n : never;\n\n/**\n * Normalized output type that preserves generic type information.\n * - If Output is already a TailorField, use it as-is\n * - If Output is a Record of fields, wrap it as a nested TailorField\n */\ntype NormalizedOutput<Output extends TailorAnyField | Record<string, TailorAnyField>> =\n Output extends TailorAnyField\n ? Output\n : TailorField<\n { type: \"nested\"; array: false },\n InferFieldsOutput<Extract<Output, Record<string, TailorAnyField>>>\n >;\n\ntype ResolverReturn<\n Input extends Record<string, TailorAnyField> | undefined,\n Output extends TailorAnyField | Record<string, TailorAnyField>,\n> = Omit<ResolverInput, \"input\" | \"output\" | \"body\"> &\n Readonly<{\n input?: Input;\n output: NormalizedOutput<Output>;\n body: (context: Context<Input>) => OutputType<Output> | Promise<OutputType<Output>>;\n }>;\n\n/**\n * Create a resolver definition for the Tailor SDK.\n *\n * The `body` function receives a context with `input` (typed from `config.input`),\n * `user` (TailorUser with id, type, workspaceId, attributes, attributeList), and `env` (TailorEnv).\n * The return value of `body` must match the `output` type.\n *\n * `output` accepts either a single TailorField (e.g. `t.string()`) or a\n * Record of fields (e.g. `{ name: t.string(), age: t.int() }`).\n *\n * `publishEvents` enables publishing execution events for this resolver.\n * If not specified, this is automatically set to true when an executor uses this resolver\n * with `resolverExecutedTrigger`. If explicitly set to false while an executor uses this\n * resolver, an error will be thrown during apply.\n * @template Input\n * @template Output\n * @param config - Resolver configuration\n * @returns Normalized resolver configuration\n * @example\n * import { createResolver, t } from \"@tailor-platform/sdk\";\n *\n * export default createResolver({\n * name: \"getUser\",\n * operation: \"query\",\n * input: {\n * id: t.string(),\n * },\n * body: async ({ input, user }) => {\n * const db = getDB(\"tailordb\");\n * const result = await db.selectFrom(\"User\").selectAll().where(\"id\", \"=\", input.id).executeTakeFirst();\n * return { name: result?.name ?? \"\", email: result?.email ?? \"\" };\n * },\n * output: t.object({\n * name: t.string(),\n * email: t.string(),\n * }),\n * });\n */\nexport function createResolver<\n Input extends Record<string, TailorAnyField> | undefined = undefined,\n Output extends TailorAnyField | Record<string, TailorAnyField> = TailorAnyField,\n>(\n config: Omit<ResolverInput, \"input\" | \"output\" | \"body\"> &\n Readonly<{\n input?: Input;\n output: Output;\n body: (context: Context<Input>) => OutputType<Output> | Promise<OutputType<Output>>;\n }>,\n): ResolverReturn<Input, Output> {\n // Check if output is already a TailorField using duck typing.\n // TailorField has `type: string` (e.g., \"uuid\", \"string\"), while\n // Record<string, TailorField> either lacks `type` or has TailorField as value.\n const isTailorField = (obj: unknown): obj is TailorAnyField =>\n typeof obj === \"object\" &&\n obj !== null &&\n \"type\" in obj &&\n typeof (obj as { type: unknown }).type === \"string\";\n\n const normalizedOutput = isTailorField(config.output) ? config.output : t.object(config.output);\n\n return brandValue(\n {\n ...config,\n output: normalizedOutput,\n } as ResolverReturn<Input, Output>,\n \"resolver\",\n );\n}\n\n// A loose config alias for userland use-cases\n// oxlint-disable-next-line no-explicit-any\nexport type ResolverConfig = ReturnType<typeof createResolver<any, any>>;\n","import { brandValue } from \"@/utils/brand\";\nimport type { Operation } from \"./operation\";\nimport type { Trigger } from \"./trigger\";\nimport type { AuthInvoker } from \"@/configure/services/auth\";\nimport type { Workflow } from \"@/configure/services/workflow/workflow\";\nimport type { ExecutorInput } from \"@/types/executor.generated\";\n\n/**\n * Extract mainJob's Input type from Workflow.\n */\ntype WorkflowInput<W extends Workflow> = Parameters<W[\"trigger\"]>[0];\n\ntype TriggerArgs<T extends Trigger<unknown>> = T extends { __args: infer Args } ? Args : never;\n\ntype ExecutorBase<T extends Trigger<unknown>> = Omit<ExecutorInput, \"trigger\" | \"operation\"> & {\n trigger: T;\n};\n\n/**\n * Executor type with conditional inference for workflow operations.\n * When operation.kind is \"workflow\", infers W from the workflow property\n * to ensure args type matches the workflow's mainJob input type.\n */\ntype Executor<T extends Trigger<unknown>, O> = O extends {\n kind: \"workflow\";\n workflow: infer W extends Workflow;\n}\n ? ExecutorBase<T> & {\n operation: {\n kind: \"workflow\";\n workflow: W;\n args?: WorkflowInput<W> | ((args: TriggerArgs<T>) => WorkflowInput<W>);\n authInvoker?: AuthInvoker<string>;\n };\n }\n : ExecutorBase<T> & {\n operation: O;\n };\n\n/**\n * Create an executor configuration for the Tailor SDK.\n *\n * Executors are event-driven handlers that respond to record changes,\n * resolver executions, or other events.\n *\n * Operation kinds: \"function\", \"graphql\", \"webhook\", \"workflow\".\n * @template T\n * @template O\n * @param config - Executor configuration\n * @returns The same executor configuration\n * @example\n * import { createExecutor, recordCreatedTrigger } from \"@tailor-platform/sdk\";\n * import { order } from \"../tailordb/order\";\n *\n * export default createExecutor({\n * name: \"order-created\",\n * description: \"Handles new order creation\",\n * trigger: recordCreatedTrigger({ type: order }),\n * operation: {\n * kind: \"function\",\n * body: async ({ newRecord }) => {\n * console.log(\"New order:\", newRecord.id);\n * },\n * },\n * });\n */\nexport function createExecutor<\n T extends Trigger<unknown>,\n O extends Operation<TriggerArgs<T>> | { kind: \"workflow\"; workflow: Workflow },\n>(config: Executor<T, O>): Executor<T, O>;\n\n/**\n * Create an executor configuration for the Tailor SDK.\n * This overload preserves source compatibility for legacy explicit generic calls,\n * where the first generic argument represents trigger args.\n * @template Args\n * @template O\n * @param config - Executor configuration\n * @returns The same executor configuration\n */\nexport function createExecutor<\n Args,\n O extends Operation<Args> | { kind: \"workflow\"; workflow: Workflow },\n>(config: Executor<Trigger<Args>, O>): Executor<Trigger<Args>, O>;\n\nexport function createExecutor<\n T extends Trigger<unknown>,\n O extends Operation<TriggerArgs<T>> | { kind: \"workflow\"; workflow: Workflow },\n>(config: Executor<T, O>) {\n return brandValue(config, \"executor\");\n}\n","import type { ResolverConfig } from \"@/configure/services/resolver/resolver\";\nimport type { TailorDBType } from \"@/configure/services/tailordb/schema\";\nimport type { TailorActor } from \"@/configure/types/actor\";\nimport type { TailorEnv } from \"@/configure/types/env\";\nimport type { output } from \"@/configure/types/helpers\";\nimport type {\n RecordTrigger as ParserRecordTrigger,\n ResolverExecutedTrigger as ParserResolverExecutedTrigger,\n IdpUserTrigger as ParserIdpUserTrigger,\n AuthAccessTokenTrigger as ParserAuthAccessTokenTrigger,\n} from \"@/types/executor.generated\";\n\ninterface EventArgs {\n workspaceId: string;\n appNamespace: string;\n env: TailorEnv;\n actor: TailorActor | null;\n}\n\ninterface RecordArgs extends EventArgs {\n typeName: string;\n}\n\nexport interface RecordCreatedArgs<T extends TailorDBType> extends RecordArgs {\n newRecord: output<T>;\n}\n\nexport interface RecordUpdatedArgs<T extends TailorDBType> extends RecordArgs {\n newRecord: output<T>;\n oldRecord: output<T>;\n}\n\nexport interface RecordDeletedArgs<T extends TailorDBType> extends RecordArgs {\n oldRecord: output<T>;\n}\n\n/**\n * Args for resolverExecutedTrigger. This is a discriminated union on `success`.\n *\n * When `success` is true, `result` contains the resolver output and `error` is never.\n * When `success` is false, `error` contains the error message and `result` is never.\n *\n * Narrow on `success` to safely access either `result` or `error`.\n * @example\n * body: async (args) => {\n * if (args.success) {\n * console.log(args.result);\n * } else {\n * console.error(args.error);\n * }\n * }\n */\nexport type ResolverExecutedArgs<R extends ResolverConfig> = EventArgs & {\n resolverName: string;\n} & (\n | {\n success: true;\n result: output<R[\"output\"]>;\n error?: never;\n }\n | {\n success: false;\n result?: never;\n error: string;\n }\n );\n\nexport type RecordTrigger<Args> = ParserRecordTrigger & {\n __args: Args;\n};\n\ntype RecordTriggerOptions<T extends TailorDBType, Args> = {\n type: T;\n condition?: (args: Args) => boolean;\n};\n\n/**\n * Create a trigger that fires when a TailorDB record is created.\n * @template T\n * @param options - Trigger options\n * @returns Record created trigger\n */\nexport function recordCreatedTrigger<T extends TailorDBType>(\n options: RecordTriggerOptions<T, RecordCreatedArgs<T>>,\n): RecordTrigger<RecordCreatedArgs<T>> {\n const { type, condition } = options;\n return {\n kind: \"recordCreated\",\n typeName: type.name,\n condition,\n __args: {} as RecordCreatedArgs<T>,\n };\n}\n\n/**\n * Create a trigger that fires when a TailorDB record is updated.\n * @template T\n * @param options - Trigger options\n * @returns Record updated trigger\n */\nexport function recordUpdatedTrigger<T extends TailorDBType>(\n options: RecordTriggerOptions<T, RecordUpdatedArgs<T>>,\n): RecordTrigger<RecordUpdatedArgs<T>> {\n const { type, condition } = options;\n return {\n kind: \"recordUpdated\",\n typeName: type.name,\n condition,\n __args: {} as RecordUpdatedArgs<T>,\n };\n}\n\n/**\n * Create a trigger that fires when a TailorDB record is deleted.\n * @template T\n * @param options - Trigger options\n * @returns Record deleted trigger\n */\nexport function recordDeletedTrigger<T extends TailorDBType>(\n options: RecordTriggerOptions<T, RecordDeletedArgs<T>>,\n): RecordTrigger<RecordDeletedArgs<T>> {\n const { type, condition } = options;\n return {\n kind: \"recordDeleted\",\n typeName: type.name,\n condition,\n __args: {} as RecordDeletedArgs<T>,\n };\n}\n\nexport type ResolverExecutedTrigger<Args> = ParserResolverExecutedTrigger & {\n __args: Args;\n};\n\ntype ResolverExecutedTriggerOptions<R extends ResolverConfig> = {\n resolver: R;\n condition?: (args: ResolverExecutedArgs<R>) => boolean;\n};\n\n/**\n * Create a trigger that fires when a resolver is executed.\n * @template R\n * @param options - Trigger options\n * @returns Resolver executed trigger\n */\nexport function resolverExecutedTrigger<R extends ResolverConfig>(\n options: ResolverExecutedTriggerOptions<R>,\n): ResolverExecutedTrigger<ResolverExecutedArgs<R>> {\n const { resolver, condition } = options;\n return {\n kind: \"resolverExecuted\",\n resolverName: resolver.name,\n condition,\n __args: {} as ResolverExecutedArgs<R>,\n };\n}\n\n// IdP User Event Triggers\nexport interface IdpUserArgs extends EventArgs {\n namespaceName: string;\n userId: string;\n}\n\nexport type IdpUserTrigger<Args> = ParserIdpUserTrigger & {\n __args: Args;\n};\n\n/**\n * Create a trigger that fires when an IdP user is created.\n * @returns IdP user created trigger\n */\nexport function idpUserCreatedTrigger(): IdpUserTrigger<IdpUserArgs> {\n return {\n kind: \"idpUserCreated\",\n __args: {} as IdpUserArgs,\n };\n}\n\n/**\n * Create a trigger that fires when an IdP user is updated.\n * @returns IdP user updated trigger\n */\nexport function idpUserUpdatedTrigger(): IdpUserTrigger<IdpUserArgs> {\n return {\n kind: \"idpUserUpdated\",\n __args: {} as IdpUserArgs,\n };\n}\n\n/**\n * Create a trigger that fires when an IdP user is deleted.\n * @returns IdP user deleted trigger\n */\nexport function idpUserDeletedTrigger(): IdpUserTrigger<IdpUserArgs> {\n return {\n kind: \"idpUserDeleted\",\n __args: {} as IdpUserArgs,\n };\n}\n\n// Auth Access Token Event Triggers\nexport interface AuthAccessTokenArgs extends EventArgs {\n namespaceName: string;\n userId: string;\n}\n\nexport type AuthAccessTokenTrigger<Args> = ParserAuthAccessTokenTrigger & {\n __args: Args;\n};\n\n/**\n * Create a trigger that fires when an access token is issued.\n * @returns Auth access token issued trigger\n */\nexport function authAccessTokenIssuedTrigger(): AuthAccessTokenTrigger<AuthAccessTokenArgs> {\n return {\n kind: \"authAccessTokenIssued\",\n __args: {} as AuthAccessTokenArgs,\n };\n}\n\n/**\n * Create a trigger that fires when an access token is refreshed.\n * @returns Auth access token refreshed trigger\n */\nexport function authAccessTokenRefreshedTrigger(): AuthAccessTokenTrigger<AuthAccessTokenArgs> {\n return {\n kind: \"authAccessTokenRefreshed\",\n __args: {} as AuthAccessTokenArgs,\n };\n}\n\n/**\n * Create a trigger that fires when an access token is revoked.\n * @returns Auth access token revoked trigger\n */\nexport function authAccessTokenRevokedTrigger(): AuthAccessTokenTrigger<AuthAccessTokenArgs> {\n return {\n kind: \"authAccessTokenRevoked\",\n __args: {} as AuthAccessTokenArgs,\n };\n}\n","import type { TailorEnv } from \"@/configure/types/env\";\nimport type { ScheduleTriggerInput as ParserScheduleTriggerInput } from \"@/types/executor.generated\";\nimport type { StandardCRON } from \"ts-cron-validator\";\n\ntype Timezone =\n | \"UTC\"\n | \"Pacific/Midway\"\n | \"Pacific/Niue\"\n | \"Pacific/Pago_Pago\"\n | \"America/Adak\"\n | \"Pacific/Honolulu\"\n | \"Pacific/Rarotonga\"\n | \"Pacific/Tahiti\"\n | \"Pacific/Marquesas\"\n | \"America/Anchorage\"\n | \"America/Juneau\"\n | \"America/Metlakatla\"\n | \"America/Nome\"\n | \"America/Sitka\"\n | \"America/Yakutat\"\n | \"Pacific/Gambier\"\n | \"America/Los_Angeles\"\n | \"America/Tijuana\"\n | \"America/Vancouver\"\n | \"Pacific/Pitcairn\"\n | \"America/Boise\"\n | \"America/Cambridge_Bay\"\n | \"America/Chihuahua\"\n | \"America/Creston\"\n | \"America/Dawson\"\n | \"America/Dawson_Creek\"\n | \"America/Denver\"\n | \"America/Edmonton\"\n | \"America/Fort_Nelson\"\n | \"America/Hermosillo\"\n | \"America/Inuvik\"\n | \"America/Mazatlan\"\n | \"America/Ojinaga\"\n | \"America/Phoenix\"\n | \"America/Whitehorse\"\n | \"America/Yellowknife\"\n | \"America/Bahia_Banderas\"\n | \"America/Belize\"\n | \"America/Chicago\"\n | \"America/Costa_Rica\"\n | \"America/El_Salvador\"\n | \"America/Guatemala\"\n | \"America/Indiana/Knox\"\n | \"America/Indiana/Tell_City\"\n | \"America/Managua\"\n | \"America/Matamoros\"\n | \"America/Menominee\"\n | \"America/Merida\"\n | \"America/Mexico_City\"\n | \"America/Monterrey\"\n | \"America/North_Dakota/Beulah\"\n | \"America/North_Dakota/Center\"\n | \"America/North_Dakota/New_Salem\"\n | \"America/Rainy_River\"\n | \"America/Rankin_Inlet\"\n | \"America/Regina\"\n | \"America/Resolute\"\n | \"America/Swift_Current\"\n | \"America/Tegucigalpa\"\n | \"America/Winnipeg\"\n | \"Pacific/Easter\"\n | \"Pacific/Galapagos\"\n | \"America/Atikokan\"\n | \"America/Bogota\"\n | \"America/Cancun\"\n | \"America/Cayman\"\n | \"America/Detroit\"\n | \"America/Eirunepe\"\n | \"America/Grand_Turk\"\n | \"America/Guayaquil\"\n | \"America/Havana\"\n | \"America/Indiana/Indianapolis\"\n | \"America/Indiana/Marengo\"\n | \"America/Indiana/Petersburg\"\n | \"America/Indiana/Vevay\"\n | \"America/Indiana/Vincennes\"\n | \"America/Indiana/Winamac\"\n | \"America/Iqaluit\"\n | \"America/Jamaica\"\n | \"America/Kentucky/Louisville\"\n | \"America/Kentucky/Monticello\"\n | \"America/Lima\"\n | \"America/Nassau\"\n | \"America/New_York\"\n | \"America/Nipigon\"\n | \"America/Panama\"\n | \"America/Pangnirtung\"\n | \"America/Port-au-Prince\"\n | \"America/Rio_Branco\"\n | \"America/Thunder_Bay\"\n | \"America/Toronto\"\n | \"America/Anguilla\"\n | \"America/Antigua\"\n | \"America/Aruba\"\n | \"America/Asuncion\"\n | \"America/Barbados\"\n | \"America/Blanc-Sablon\"\n | \"America/Boa_Vista\"\n | \"America/Campo_Grande\"\n | \"America/Caracas\"\n | \"America/Cuiaba\"\n | \"America/Curacao\"\n | \"America/Dominica\"\n | \"America/Glace_Bay\"\n | \"America/Goose_Bay\"\n | \"America/Grenada\"\n | \"America/Guadeloupe\"\n | \"America/Guyana\"\n | \"America/Halifax\"\n | \"America/Kralendijk\"\n | \"America/La_Paz\"\n | \"America/Lower_Princes\"\n | \"America/Manaus\"\n | \"America/Marigot\"\n | \"America/Martinique\"\n | \"America/Moncton\"\n | \"America/Montserrat\"\n | \"America/Porto_Velho\"\n | \"America/Port_of_Spain\"\n | \"America/Puerto_Rico\"\n | \"America/Santiago\"\n | \"America/Santo_Domingo\"\n | \"America/St_Barthelemy\"\n | \"America/St_Kitts\"\n | \"America/St_Lucia\"\n | \"America/St_Thomas\"\n | \"America/St_Vincent\"\n | \"America/Thule\"\n | \"America/Tortola\"\n | \"Atlantic/Bermuda\"\n | \"America/St_Johns\"\n | \"America/Araguaina\"\n | \"America/Argentina/Buenos_Aires\"\n | \"America/Argentina/Catamarca\"\n | \"America/Argentina/Cordoba\"\n | \"America/Argentina/Jujuy\"\n | \"America/Argentina/La_Rioja\"\n | \"America/Argentina/Mendoza\"\n | \"America/Argentina/Rio_Gallegos\"\n | \"America/Argentina/Salta\"\n | \"America/Argentina/San_Juan\"\n | \"America/Argentina/San_Luis\"\n | \"America/Argentina/Tucuman\"\n | \"America/Argentina/Ushuaia\"\n | \"America/Bahia\"\n | \"America/Belem\"\n | \"America/Cayenne\"\n | \"America/Fortaleza\"\n | \"America/Godthab\"\n | \"America/Maceio\"\n | \"America/Miquelon\"\n | \"America/Montevideo\"\n | \"America/Paramaribo\"\n | \"America/Punta_Arenas\"\n | \"America/Recife\"\n | \"America/Santarem\"\n | \"America/Sao_Paulo\"\n | \"Antarctica/Palmer\"\n | \"Antarctica/Rothera\"\n | \"Atlantic/Stanley\"\n | \"America/Noronha\"\n | \"Atlantic/South_Georgia\"\n | \"America/Scoresbysund\"\n | \"Atlantic/Azores\"\n | \"Atlantic/Cape_Verde\"\n | \"Africa/Abidjan\"\n | \"Africa/Accra\"\n | \"Africa/Bamako\"\n | \"Africa/Banjul\"\n | \"Africa/Bissau\"\n | \"Africa/Casablanca\"\n | \"Africa/Conakry\"\n | \"Africa/Dakar\"\n | \"Africa/El_Aaiun\"\n | \"Africa/Freetown\"\n | \"Africa/Lome\"\n | \"Africa/Monrovia\"\n | \"Africa/Nouakchott\"\n | \"Africa/Ouagadougou\"\n | \"Africa/Sao_Tome\"\n | \"America/Danmarkshavn\"\n | \"Antarctica/Troll\"\n | \"Atlantic/Canary\"\n | \"Atlantic/Faroe\"\n | \"Atlantic/Madeira\"\n | \"Atlantic/Reykjavik\"\n | \"Atlantic/St_Helena\"\n | \"Europe/Dublin\"\n | \"Europe/Guernsey\"\n | \"Europe/Isle_of_Man\"\n | \"Europe/Jersey\"\n | \"Europe/Lisbon\"\n | \"Europe/London\"\n | \"Africa/Algiers\"\n | \"Africa/Bangui\"\n | \"Africa/Brazzaville\"\n | \"Africa/Ceuta\"\n | \"Africa/Douala\"\n | \"Africa/Kinshasa\"\n | \"Africa/Lagos\"\n | \"Africa/Libreville\"\n | \"Africa/Luanda\"\n | \"Africa/Malabo\"\n | \"Africa/Ndjamena\"\n | \"Africa/Niamey\"\n | \"Africa/Porto-Novo\"\n | \"Africa/Tunis\"\n | \"Africa/Windhoek\"\n | \"Arctic/Longyearbyen\"\n | \"Europe/Amsterdam\"\n | \"Europe/Andorra\"\n | \"Europe/Belgrade\"\n | \"Europe/Berlin\"\n | \"Europe/Bratislava\"\n | \"Europe/Brussels\"\n | \"Europe/Budapest\"\n | \"Europe/Copenhagen\"\n | \"Europe/Gibraltar\"\n | \"Europe/Ljubljana\"\n | \"Europe/Luxembourg\"\n | \"Europe/Madrid\"\n | \"Europe/Malta\"\n | \"Europe/Monaco\"\n | \"Europe/Oslo\"\n | \"Europe/Paris\"\n | \"Europe/Podgorica\"\n | \"Europe/Prague\"\n | \"Europe/Rome\"\n | \"Europe/San_Marino\"\n | \"Europe/Sarajevo\"\n | \"Europe/Skopje\"\n | \"Europe/Stockholm\"\n | \"Europe/Tirane\"\n | \"Europe/Vaduz\"\n | \"Europe/Vatican\"\n | \"Europe/Vienna\"\n | \"Europe/Warsaw\"\n | \"Europe/Zagreb\"\n | \"Europe/Zurich\"\n | \"Africa/Blantyre\"\n | \"Africa/Bujumbura\"\n | \"Africa/Cairo\"\n | \"Africa/Gaborone\"\n | \"Africa/Harare\"\n | \"Africa/Johannesburg\"\n | \"Africa/Juba\"\n | \"Africa/Khartoum\"\n | \"Africa/Kigali\"\n | \"Africa/Lubumbashi\"\n | \"Africa/Lusaka\"\n | \"Africa/Maputo\"\n | \"Africa/Maseru\"\n | \"Africa/Mbabane\"\n | \"Africa/Tripoli\"\n | \"Asia/Amman\"\n | \"Asia/Beirut\"\n | \"Asia/Damascus\"\n | \"Asia/Famagusta\"\n | \"Asia/Gaza\"\n | \"Asia/Hebron\"\n | \"Asia/Jerusalem\"\n | \"Asia/Nicosia\"\n | \"Europe/Athens\"\n | \"Europe/Bucharest\"\n | \"Europe/Chisinau\"\n | \"Europe/Helsinki\"\n | \"Europe/Kaliningrad\"\n | \"Europe/Kyiv\"\n | \"Europe/Mariehamn\"\n | \"Europe/Riga\"\n | \"Europe/Sofia\"\n | \"Europe/Tallinn\"\n | \"Europe/Uzhgorod\"\n | \"Europe/Vilnius\"\n | \"Europe/Zaporizhzhia\"\n | \"Africa/Addis_Ababa\"\n | \"Africa/Asmara\"\n | \"Africa/Dar_es_Salaam\"\n | \"Africa/Djibouti\"\n | \"Africa/Kampala\"\n | \"Africa/Mogadishu\"\n | \"Africa/Nairobi\"\n | \"Antarctica/Syowa\"\n | \"Asia/Aden\"\n | \"Asia/Baghdad\"\n | \"Asia/Bahrain\"\n | \"Asia/Kuwait\"\n | \"Asia/Qatar\"\n | \"Asia/Riyadh\"\n | \"Europe/Istanbul\"\n | \"Europe/Kirov\"\n | \"Europe/Minsk\"\n | \"Europe/Moscow\"\n | \"Europe/Simferopol\"\n | \"Europe/Volgograd\"\n | \"Indian/Antananarivo\"\n | \"Indian/Comoro\"\n | \"Indian/Mayotte\"\n | \"Asia/Tehran\"\n | \"Asia/Baku\"\n | \"Asia/Dubai\"\n | \"Asia/Muscat\"\n | \"Asia/Tbilisi\"\n | \"Asia/Yerevan\"\n | \"Europe/Astrakhan\"\n | \"Europe/Samara\"\n | \"Europe/Saratov\"\n | \"Europe/Ulyanovsk\"\n | \"Indian/Mahe\"\n | \"Indian/Mauritius\"\n | \"Indian/Reunion\"\n | \"Asia/Kabul\"\n | \"Antarctica/Mawson\"\n | \"Asia/Aqtau\"\n | \"Asia/Aqtobe\"\n | \"Asia/Ashgabat\"\n | \"Asia/Atyrau\"\n | \"Asia/Dushanbe\"\n | \"Asia/Karachi\"\n | \"Asia/Oral\"\n | \"Asia/Qyzylorda\"\n | \"Asia/Samarkand\"\n | \"Asia/Tashkent\"\n | \"Asia/Yekaterinburg\"\n | \"Indian/Kerguelen\"\n | \"Indian/Maldives\"\n | \"Asia/Colombo\"\n | \"Asia/Kolkata\"\n | \"Asia/Kathmandu\"\n | \"Antarctica/Vostok\"\n | \"Asia/Almaty\"\n | \"Asia/Bishkek\"\n | \"Asia/Dhaka\"\n | \"Asia/Omsk\"\n | \"Asia/Qostanay\"\n | \"Asia/Thimphu\"\n | \"Asia/Urumqi\"\n | \"Indian/Chagos\"\n | \"Asia/Yangon\"\n | \"Indian/Cocos\"\n | \"Antarctica/Davis\"\n | \"Asia/Bangkok\"\n | \"Asia/Barnaul\"\n | \"Asia/Hovd\"\n | \"Asia/Ho_Chi_Minh\"\n | \"Asia/Jakarta\"\n | \"Asia/Krasnoyarsk\"\n | \"Asia/Novokuznetsk\"\n | \"Asia/Novosibirsk\"\n | \"Asia/Phnom_Penh\"\n | \"Asia/Pontianak\"\n | \"Asia/Tomsk\"\n | \"Asia/Vientiane\"\n | \"Indian/Christmas\"\n | \"Asia/Brunei\"\n | \"Asia/Choibalsan\"\n | \"Asia/Hong_Kong\"\n | \"Asia/Irkutsk\"\n | \"Asia/Kuala_Lumpur\"\n | \"Asia/Kuching\"\n | \"Asia/Macau\"\n | \"Asia/Makassar\"\n | \"Asia/Manila\"\n | \"Asia/Shanghai\"\n | \"Asia/Singapore\"\n | \"Asia/Taipei\"\n | \"Asia/Ulaanbaatar\"\n | \"Australia/Perth\"\n | \"Australia/Eucla\"\n | \"Asia/Chita\"\n | \"Asia/Dili\"\n | \"Asia/Jayapura\"\n | \"Asia/Khandyga\"\n | \"Asia/Pyongyang\"\n | \"Asia/Seoul\"\n | \"Asia/Tokyo\"\n | \"Asia/Yakutsk\"\n | \"Pacific/Palau\"\n | \"Australia/Adelaide\"\n | \"Australia/Broken_Hill\"\n | \"Australia/Darwin\"\n | \"Antarctica/DumontDUrville\"\n | \"Antarctica/Macquarie\"\n | \"Asia/Ust-Nera\"\n | \"Asia/Vladivostok\"\n | \"Australia/Brisbane\"\n | \"Australia/Currie\"\n | \"Australia/Hobart\"\n | \"Australia/Lindeman\"\n | \"Australia/Melbourne\"\n | \"Australia/Sydney\"\n | \"Pacific/Chuuk\"\n | \"Pacific/Guam\"\n | \"Pacific/Port_Moresby\"\n | \"Pacific/Saipan\"\n | \"Australia/Lord_Howe\"\n | \"Antarctica/Casey\"\n | \"Asia/Magadan\"\n | \"Asia/Sakhalin\"\n | \"Asia/Srednekolymsk\"\n | \"Pacific/Bougainville\"\n | \"Pacific/Efate\"\n | \"Pacific/Guadalcanal\"\n | \"Pacific/Kosrae\"\n | \"Pacific/Norfolk\"\n | \"Pacific/Noumea\"\n | \"Pacific/Pohnpei\"\n | \"Antarctica/McMurdo\"\n | \"Asia/Anadyr\"\n | \"Asia/Kamchatka\"\n | \"Pacific/Auckland\"\n | \"Pacific/Fiji\"\n | \"Pacific/Funafuti\"\n | \"Pacific/Kwajalein\"\n | \"Pacific/Majuro\"\n | \"Pacific/Nauru\"\n | \"Pacific/Tarawa\"\n | \"Pacific/Wake\"\n | \"Pacific/Wallis\"\n | \"Pacific/Chatham\"\n | \"Pacific/Apia\"\n | \"Pacific/Enderbury\"\n | \"Pacific/Fakaofo\"\n | \"Pacific/Tongatapu\"\n | \"Pacific/Kiritimati\";\n\nexport type ScheduleTrigger<Args> = ParserScheduleTriggerInput & {\n __args: Args;\n};\n\nexport interface ScheduleArgs {\n env: TailorEnv;\n}\n\ninterface ScheduleTriggerOptions<T extends string> {\n cron: StandardCRON<T> extends never ? never : T;\n timezone?: Timezone;\n}\n\n/**\n * Create a schedule-based trigger using a CRON expression and optional timezone.\n * @template T\n * @param options - Schedule options\n * @returns Schedule trigger\n */\nexport function scheduleTrigger<T extends string>(\n options: ScheduleTriggerOptions<T>,\n): ScheduleTrigger<ScheduleArgs> {\n const { cron, timezone } = options;\n return {\n kind: \"schedule\",\n cron,\n timezone,\n __args: {} as ScheduleArgs,\n };\n}\n","import type { TailorEnv } from \"@/configure/types/env\";\nimport type { IncomingWebhookTrigger as ParserIncomingWebhookTrigger } from \"@/types/executor.generated\";\n\nexport interface IncomingWebhookArgs<T extends IncomingWebhookRequest> {\n body: T[\"body\"];\n headers: T[\"headers\"];\n method: \"POST\" | \"GET\" | \"PUT\" | \"DELETE\";\n rawBody: string;\n env: TailorEnv;\n}\n\nexport interface IncomingWebhookRequest {\n body: Record<string, unknown>;\n headers: Record<string, string>;\n}\n\nexport type IncomingWebhookTrigger<Args> = ParserIncomingWebhookTrigger & {\n __args: Args;\n};\n\n/**\n * Create a trigger for incoming webhook requests.\n * @template T\n * @returns Incoming webhook trigger\n */\nexport function incomingWebhookTrigger<T extends IncomingWebhookRequest>(): IncomingWebhookTrigger<\n IncomingWebhookArgs<T>\n> {\n return {\n kind: \"incomingWebhook\",\n __args: {} as IncomingWebhookArgs<T>,\n };\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { brandValue } from \"@/utils/brand\";\nimport type { WorkflowJob } from \"./job\";\nimport type { AuthInvoker } from \"../auth\";\nimport type { RetryPolicy } from \"@/types/workflow.generated\";\n\nexport type { RetryPolicy };\n\nexport interface WorkflowConfig<\n Job extends WorkflowJob<any, any, any> = WorkflowJob<any, any, any>,\n> {\n name: string;\n mainJob: Job;\n retryPolicy?: RetryPolicy;\n}\n\nexport interface Workflow<Job extends WorkflowJob<any, any, any> = WorkflowJob<any, any, any>> {\n name: string;\n mainJob: Job;\n retryPolicy?: RetryPolicy;\n trigger: (\n args: Parameters<Job[\"trigger\"]>[0],\n options?: { authInvoker: AuthInvoker<string> },\n ) => Promise<string>;\n}\n\ninterface WorkflowDefinition<Job extends WorkflowJob<any, any, any>> {\n name: string;\n mainJob: Job;\n retryPolicy?: RetryPolicy;\n}\n\n/**\n * Create a workflow definition that can be triggered via the Tailor SDK.\n * In production, bundler transforms .trigger() calls to tailor.workflow.triggerWorkflow().\n *\n * The workflow MUST be the default export of the file.\n * All jobs referenced by the workflow MUST be named exports.\n * @template Job\n * @param config - Workflow configuration\n * @returns Defined workflow\n * @example\n * export const fetchData = createWorkflowJob({ name: \"fetch-data\", body: async (input: { id: string }) => ({ id: input.id }) });\n * export const processData = createWorkflowJob({\n * name: \"process-data\",\n * body: async (input: { id: string }) => {\n * const data = await fetchData.trigger({ id: input.id }); // await is optional — stripped by bundler\n * return { data };\n * },\n * });\n *\n * // Workflow must be default export; mainJob is the entry point\n * export default createWorkflow({\n * name: \"data-processing\",\n * mainJob: processData,\n * });\n */\nexport function createWorkflow<Job extends WorkflowJob<any, any, any>>(\n config: WorkflowDefinition<Job>,\n): Workflow<Job> {\n return brandValue(\n {\n ...config,\n // For local execution, directly call mainJob.trigger()\n // In production, bundler transforms this to tailor.workflow.triggerWorkflow()\n trigger: async (args) => {\n await config.mainJob.trigger(...([args] as unknown as []));\n return \"00000000-0000-0000-0000-000000000000\";\n },\n },\n \"workflow\",\n );\n}\n","import type { StaticWebsiteInput } from \"@/types/staticwebsite.generated\";\n\ndeclare const staticWebsiteDefinitionBrand: unique symbol;\ntype StaticWebsiteDefinitionBrand = {\n readonly [staticWebsiteDefinitionBrand]: true;\n};\n\n/**\n * Define a static website configuration for the Tailor SDK.\n * @param name - Static website name\n * @param config - Static website configuration\n * @returns Defined static website\n */\nexport function defineStaticWebSite(name: string, config: Omit<StaticWebsiteInput, \"name\">) {\n const result = {\n ...config,\n name,\n get url() {\n return `${name}:url` as const;\n },\n } as const satisfies StaticWebsiteInput & { readonly url: string };\n\n return result as typeof result & StaticWebsiteDefinitionBrand;\n}\n\nexport type StaticWebsiteConfig = Omit<ReturnType<typeof defineStaticWebSite>, \"url\">;\n","import type { BuiltinIdP } from \"@/types/auth.generated\";\nimport type { IdpDefinitionBrand } from \"@/types/idp\";\nimport type { IdPInput } from \"@/types/idp.generated\";\n\nexport type {\n IdPGqlOperations,\n IdPGqlOperationsInput as IdPGqlOperationsConfig,\n} from \"@/types/idp.generated\";\n\n/**\n * Define an IdP service configuration for the Tailor SDK.\n * @template TClients\n * @param name - IdP service name\n * @param config - IdP configuration\n * @returns Defined IdP service\n */\nexport function defineIdp<const TClients extends string[]>(\n name: string,\n config: Omit<IdPInput, \"name\" | \"clients\"> & { clients: TClients },\n) {\n const result = {\n ...config,\n name,\n provider(providerName: string, clientName: TClients[number]) {\n return {\n name: providerName,\n kind: \"BuiltInIdP\",\n namespace: name,\n clientName,\n } as const satisfies BuiltinIdP;\n },\n } as const satisfies IdPInput & {\n provider: (providerName: string, clientName: TClients[number]) => BuiltinIdP;\n };\n\n return result as typeof result & IdpDefinitionBrand;\n}\n\nexport type { IdPConfig, IdPExternalConfig } from \"@/types/idp\";\n","declare const secretsDefinitionBrand: unique symbol;\ntype SecretsDefinitionBrand = { readonly [secretsDefinitionBrand]: true };\n\ntype SecretsVaultInput = Record<string, string>;\ntype SecretsInput = Record<string, SecretsVaultInput>;\n\ntype DefinedSecrets<T extends SecretsInput> = {\n get<V extends Extract<keyof T, string>, S extends Extract<keyof T[V], string>>(\n vault: V,\n secret: S,\n ): Promise<string | undefined>;\n getAll<V extends Extract<keyof T, string>, S extends Extract<keyof T[V], string>>(\n vault: V,\n secrets: readonly S[],\n ): Promise<(string | undefined)[]>;\n} & SecretsDefinitionBrand;\n\n/** Type accepted by `AppConfig.secrets`. Only values returned by `defineSecretManager()` satisfy this. */\nexport type SecretsConfig = Omit<ReturnType<typeof defineSecretManager>, \"get\" | \"getAll\">;\n\n/**\n * Define secrets configuration for the Tailor SDK.\n * Each key is a vault name, and its value is a record of secret name to secret value.\n * @param config - Secrets configuration mapping vault names to their secrets\n * @returns Defined secrets with typed runtime access methods\n */\nexport function defineSecretManager<const T extends SecretsInput>(config: T): DefinedSecrets<T> {\n const result = { ...config };\n\n // Non-enumerable so Zod's z.record validation ignores them\n Object.defineProperty(result, \"get\", {\n value: async (vault: string, secret: string) => {\n return tailor.secretmanager.getSecret(vault, secret);\n },\n enumerable: false,\n });\n Object.defineProperty(result, \"getAll\", {\n value: async (vault: string, secrets: readonly string[]) => {\n const record = await tailor.secretmanager.getSecrets(vault, secrets);\n return secrets.map((s) => record[s]);\n },\n enumerable: false,\n });\n\n return result as T & DefinedSecrets<T>;\n}\n","import type { AppConfig } from \"@/types/app-config\";\nimport type { GeneratorConfig } from \"@/types/generator-config\";\nimport type { Plugin } from \"@/types/plugin\";\n\n/**\n * Define a Tailor SDK application configuration with shallow exactness.\n * @template Config\n * @param config - Application configuration\n * @returns The same configuration object\n */\n/* @__NO_SIDE_EFFECTS__ */\n// eslint-disable-next-line jsdoc/require-jsdoc\nexport function defineConfig<\n const Config extends AppConfig &\n // type-fest's Exact works recursively and causes type errors, so we use a shallow version here.\n Record<Exclude<keyof Config, keyof AppConfig>, never>,\n>(config: Config) {\n return config;\n}\n\n/**\n * Define generators to be used with the Tailor SDK.\n * @deprecated Use definePlugins() with generation hooks (onTypeLoaded, generate, etc.) instead.\n * @param configs - Generator configurations\n * @returns Generator configurations as given\n */\n/* @__NO_SIDE_EFFECTS__ */\n// eslint-disable-next-line jsdoc/require-jsdoc\nexport function defineGenerators(...configs: GeneratorConfig[]) {\n return configs;\n}\n\n/**\n * Define plugins to be used with the Tailor SDK.\n * Plugins can generate additional types, resolvers, and executors\n * based on existing TailorDB types.\n * @param configs - Plugin configurations\n * @returns Plugin configurations as given\n */\n/* @__NO_SIDE_EFFECTS__ */\n// eslint-disable-next-line jsdoc/require-jsdoc, @typescript-eslint/no-explicit-any\nexport function definePlugins(...configs: Plugin<any, any>[]) {\n return configs;\n}\n","import { t as _t } from \"@/configure/types\";\nimport type * as helperTypes from \"@/configure/types/helpers\";\n\ntype TailorOutput<T> = helperTypes.output<T>;\n\nexport type infer<T> = TailorOutput<T>;\nexport type output<T> = TailorOutput<T>;\n\n// eslint-disable-next-line import/export\nexport const t = { ..._t };\n// eslint-disable-next-line @typescript-eslint/no-namespace, import/export\nexport namespace t {\n export type output<T> = TailorOutput<T>;\n export type infer<T> = TailorOutput<T>;\n}\n\nexport {\n type TailorField,\n type TailorUser,\n unauthenticatedTailorUser,\n type AttributeMap,\n type AttributeList,\n type Env,\n} from \"@/configure/types\";\n\nexport * from \"@/configure/services\";\n\nexport { defineConfig, defineGenerators, definePlugins } from \"@/configure/config\";\n\n// Plugin types for custom plugin development\nexport type {\n Plugin,\n PluginConfigs,\n PluginOutput,\n TypePluginOutput,\n NamespacePluginOutput,\n PluginProcessContext,\n PluginNamespaceProcessContext,\n PluginAttachment,\n PluginGeneratedType,\n PluginGeneratedResolver,\n PluginGeneratedExecutor,\n PluginGeneratedExecutorWithFile,\n PluginExecutorContext,\n PluginExecutorContextBase,\n TailorDBTypeForPlugin,\n} from \"@/types/plugin\";\n\n// Generation-time hook context types for plugin development\nexport type {\n TailorDBReadyContext,\n ResolverReadyContext,\n ExecutorReadyContext,\n TailorDBNamespaceData,\n ResolverNamespaceData,\n GeneratorResult,\n} from \"@/types/plugin-generation\";\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["t","_t"],"sources":["../../src/configure/types/user.ts","../../src/configure/services/auth/index.ts","../../src/configure/services/resolver/resolver.ts","../../src/configure/services/executor/executor.ts","../../src/configure/services/executor/trigger/event.ts","../../src/configure/services/executor/trigger/schedule.ts","../../src/configure/services/executor/trigger/webhook.ts","../../src/configure/services/workflow/workflow.ts","../../src/configure/services/staticwebsite/index.ts","../../src/configure/services/idp/index.ts","../../src/configure/services/secrets/index.ts","../../src/configure/config.ts","../../src/configure/index.ts"],"sourcesContent":["// Interfaces for module augmentation\n// Users can extend these via: declare module \"@tailor-platform/sdk\" { interface AttributeMap { ... } }\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface AttributeMap {}\nexport interface AttributeList {\n __tuple?: []; // Marker for tuple type\n}\n\nexport type InferredAttributeMap = keyof AttributeMap extends never\n ? Record<string, string | string[] | boolean | boolean[] | undefined>\n : AttributeMap;\n\nexport type InferredAttributeList = AttributeList[\"__tuple\"] extends []\n ? string[]\n : AttributeList[\"__tuple\"];\n\n/** Represents a user in the Tailor platform. */\nexport type TailorUser = {\n /**\n * The ID of the user.\n * For unauthenticated users, this will be a nil UUID.\n */\n id: string;\n /**\n * The type of the user.\n * For unauthenticated users, this will be an empty string.\n */\n type: \"user\" | \"machine_user\" | \"\";\n /** The ID of the workspace the user belongs to. */\n workspaceId: string;\n /**\n * A map of the user's attributes.\n * For unauthenticated users, this will be null.\n */\n attributes: InferredAttributeMap | null;\n /**\n * A list of the user's attributes.\n * For unauthenticated users, this will be an empty array.\n */\n attributeList: InferredAttributeList;\n};\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};\n","import { type TailorDBInstance } from \"../tailordb/schema\";\nimport type { TailorField } from \"@/configure/types/type\";\nimport type { DefinedFieldMetadata, FieldMetadata, TailorFieldType } from \"@/configure/types/types\";\nimport type {\n AuthDefinitionBrand,\n AuthServiceInput,\n DefinedAuth,\n UserAttributeListKey,\n UserAttributeMap,\n} from \"@/types/auth\";\nimport type { AuthInvoker as ParserAuthInvoker } from \"@/types/auth.generated\";\n\ntype MachineUserAttributeFields = Record<\n string,\n TailorField<DefinedFieldMetadata, unknown, FieldMetadata, TailorFieldType>\n>;\n\ntype PlaceholderUser = TailorDBInstance<Record<string, never>, Record<string, never>>;\ntype PlaceholderAttributeMap = UserAttributeMap<PlaceholderUser>;\ntype PlaceholderAttributeList = UserAttributeListKey<PlaceholderUser>[];\n\ntype UserProfileAuthInput<\n User extends TailorDBInstance,\n AttributeMap extends UserAttributeMap<User>,\n AttributeList extends UserAttributeListKey<User>[],\n MachineUserNames extends string,\n> = Omit<\n AuthServiceInput<User, AttributeMap, AttributeList, MachineUserNames, undefined>,\n \"userProfile\" | \"machineUserAttributes\"\n> & {\n userProfile: NonNullable<\n AuthServiceInput<User, AttributeMap, AttributeList, MachineUserNames, undefined>[\"userProfile\"]\n >;\n machineUserAttributes?: never;\n};\n\ntype MachineUserOnlyAuthInput<\n MachineUserNames extends string,\n MachineUserAttributes extends MachineUserAttributeFields,\n> = Omit<\n AuthServiceInput<\n PlaceholderUser,\n PlaceholderAttributeMap,\n PlaceholderAttributeList,\n MachineUserNames,\n MachineUserAttributes\n >,\n \"userProfile\" | \"machineUserAttributes\"\n> & {\n userProfile?: never;\n machineUserAttributes: MachineUserAttributes;\n};\n\nexport type {\n OIDC,\n SAML,\n IDToken,\n BuiltinIdP,\n IdProvider as IdProviderConfig,\n OAuth2ClientInput as OAuth2Client,\n SCIMAuthorization,\n SCIMAttribute,\n SCIMAttributeMapping,\n SCIMResource,\n SCIMConfig,\n TenantProvider as TenantProviderConfig,\n} from \"@/types/auth.generated\";\nexport type { OAuth2ClientGrantType, SCIMAttributeType, BeforeLoginHookArgs } from \"@/types/auth\";\nexport type {\n ValueOperand,\n UsernameFieldKey,\n UserAttributeKey,\n UserAttributeListKey,\n UserAttributeMap,\n AuthServiceInput,\n AuthConfig,\n AuthExternalConfig,\n AuthOwnConfig,\n DefinedAuth,\n} from \"@/types/auth\";\n\n/**\n * Invoker type compatible with tailor.v1.AuthInvoker\n * - namespace: auth service name\n * - machineUserName: machine user name\n */\nexport type AuthInvoker<M extends string> = Omit<ParserAuthInvoker, \"machineUserName\"> & {\n machineUserName: M;\n};\n\n/**\n * Define an auth service for the Tailor SDK.\n * @template Name\n * @template User\n * @template AttributeMap\n * @template AttributeList\n * @template MachineUserNames\n * @template M\n * @param name - Auth service name\n * @param config - Auth service configuration\n * @returns Defined auth service\n */\nexport function defineAuth<\n const Name extends string,\n const User extends TailorDBInstance,\n const AttributeMap extends UserAttributeMap<User>,\n const AttributeList extends UserAttributeListKey<User>[],\n const MachineUserNames extends string,\n>(\n name: Name,\n config: UserProfileAuthInput<User, AttributeMap, AttributeList, MachineUserNames>,\n): DefinedAuth<\n Name,\n UserProfileAuthInput<User, AttributeMap, AttributeList, MachineUserNames>,\n MachineUserNames\n>;\nexport function defineAuth<\n const Name extends string,\n const MachineUserAttributes extends MachineUserAttributeFields,\n const MachineUserNames extends string,\n>(\n name: Name,\n config: MachineUserOnlyAuthInput<MachineUserNames, MachineUserAttributes>,\n): DefinedAuth<\n Name,\n MachineUserOnlyAuthInput<MachineUserNames, MachineUserAttributes>,\n MachineUserNames\n>;\nexport function defineAuth<\n const Name extends string,\n const User extends TailorDBInstance,\n const AttributeMap extends UserAttributeMap<User>,\n const AttributeList extends UserAttributeListKey<User>[],\n const MachineUserAttributes extends MachineUserAttributeFields,\n const MachineUserNames extends string,\n>(\n name: Name,\n config:\n | UserProfileAuthInput<User, AttributeMap, AttributeList, MachineUserNames>\n | MachineUserOnlyAuthInput<MachineUserNames, MachineUserAttributes>,\n) {\n const result = {\n ...config,\n name,\n invoker<M extends MachineUserNames>(machineUser: M) {\n return { namespace: name, machineUserName: machineUser } as const;\n },\n } as const satisfies (\n | UserProfileAuthInput<User, AttributeMap, AttributeList, MachineUserNames>\n | MachineUserOnlyAuthInput<MachineUserNames, MachineUserAttributes>\n ) & {\n name: string;\n invoker<M extends MachineUserNames>(machineUser: M): AuthInvoker<M>;\n };\n\n validateAuthConfig(result);\n\n return result as typeof result & AuthDefinitionBrand;\n}\n\nfunction validateAuthConfig(config: {\n userProfile?: unknown;\n machineUserAttributes?: unknown;\n}): void {\n const hasUserProfile = config.userProfile !== undefined;\n const hasMachineUserAttributes = config.machineUserAttributes !== undefined;\n\n if (hasUserProfile && hasMachineUserAttributes) {\n throw new Error(\"Provide either userProfile or machineUserAttributes, not both.\");\n }\n}\n","import { t } from \"@/configure/types/type\";\nimport { brandValue } from \"@/utils/brand\";\nimport type { TailorAnyField, TailorUser } from \"@/configure/types\";\nimport type { TailorEnv } from \"@/configure/types/env\";\nimport type { InferFieldsOutput, output } from \"@/configure/types/helpers\";\nimport type { TailorField } from \"@/configure/types/type\";\nimport type { ResolverInput } from \"@/types/resolver.generated\";\n\ntype Context<Input extends Record<string, TailorAnyField> | undefined> = {\n input: Input extends Record<string, TailorAnyField> ? InferFieldsOutput<Input> : never;\n user: TailorUser;\n env: TailorEnv;\n};\n\ntype OutputType<O> = O extends TailorAnyField\n ? output<O>\n : O extends Record<string, TailorAnyField>\n ? InferFieldsOutput<O>\n : never;\n\n/**\n * Normalized output type that preserves generic type information.\n * - If Output is already a TailorField, use it as-is\n * - If Output is a Record of fields, wrap it as a nested TailorField\n */\ntype NormalizedOutput<Output extends TailorAnyField | Record<string, TailorAnyField>> =\n Output extends TailorAnyField\n ? Output\n : TailorField<\n { type: \"nested\"; array: false },\n InferFieldsOutput<Extract<Output, Record<string, TailorAnyField>>>\n >;\n\ntype ResolverReturn<\n Input extends Record<string, TailorAnyField> | undefined,\n Output extends TailorAnyField | Record<string, TailorAnyField>,\n> = Omit<ResolverInput, \"input\" | \"output\" | \"body\"> &\n Readonly<{\n input?: Input;\n output: NormalizedOutput<Output>;\n body: (context: Context<Input>) => OutputType<Output> | Promise<OutputType<Output>>;\n }>;\n\n/**\n * Create a resolver definition for the Tailor SDK.\n *\n * The `body` function receives a context with `input` (typed from `config.input`),\n * `user` (TailorUser with id, type, workspaceId, attributes, attributeList), and `env` (TailorEnv).\n * The return value of `body` must match the `output` type.\n *\n * `output` accepts either a single TailorField (e.g. `t.string()`) or a\n * Record of fields (e.g. `{ name: t.string(), age: t.int() }`).\n *\n * `publishEvents` enables publishing execution events for this resolver.\n * If not specified, this is automatically set to true when an executor uses this resolver\n * with `resolverExecutedTrigger`. If explicitly set to false while an executor uses this\n * resolver, an error will be thrown during apply.\n * @template Input\n * @template Output\n * @param config - Resolver configuration\n * @returns Normalized resolver configuration\n * @example\n * import { createResolver, t } from \"@tailor-platform/sdk\";\n *\n * export default createResolver({\n * name: \"getUser\",\n * operation: \"query\",\n * input: {\n * id: t.string(),\n * },\n * body: async ({ input, user }) => {\n * const db = getDB(\"tailordb\");\n * const result = await db.selectFrom(\"User\").selectAll().where(\"id\", \"=\", input.id).executeTakeFirst();\n * return { name: result?.name ?? \"\", email: result?.email ?? \"\" };\n * },\n * output: t.object({\n * name: t.string(),\n * email: t.string(),\n * }),\n * });\n */\nexport function createResolver<\n Input extends Record<string, TailorAnyField> | undefined = undefined,\n Output extends TailorAnyField | Record<string, TailorAnyField> = TailorAnyField,\n>(\n config: Omit<ResolverInput, \"input\" | \"output\" | \"body\"> &\n Readonly<{\n input?: Input;\n output: Output;\n body: (context: Context<Input>) => OutputType<Output> | Promise<OutputType<Output>>;\n }>,\n): ResolverReturn<Input, Output> {\n // Check if output is already a TailorField using duck typing.\n // TailorField has `type: string` (e.g., \"uuid\", \"string\"), while\n // Record<string, TailorField> either lacks `type` or has TailorField as value.\n const isTailorField = (obj: unknown): obj is TailorAnyField =>\n typeof obj === \"object\" &&\n obj !== null &&\n \"type\" in obj &&\n typeof (obj as { type: unknown }).type === \"string\";\n\n const normalizedOutput = isTailorField(config.output) ? config.output : t.object(config.output);\n\n return brandValue(\n {\n ...config,\n output: normalizedOutput,\n } as ResolverReturn<Input, Output>,\n \"resolver\",\n );\n}\n\n// A loose config alias for userland use-cases\n// oxlint-disable-next-line no-explicit-any\nexport type ResolverConfig = ReturnType<typeof createResolver<any, any>>;\n","import { brandValue } from \"@/utils/brand\";\nimport type { Operation } from \"./operation\";\nimport type { Trigger } from \"./trigger\";\nimport type { AuthInvoker } from \"@/configure/services/auth\";\nimport type { Workflow } from \"@/configure/services/workflow/workflow\";\nimport type { ExecutorInput } from \"@/types/executor.generated\";\n\n/**\n * Extract mainJob's Input type from Workflow.\n */\ntype WorkflowInput<W extends Workflow> = Parameters<W[\"trigger\"]>[0];\n\ntype TriggerArgs<T extends Trigger<unknown>> = T extends { __args: infer Args } ? Args : never;\n\ntype ExecutorBase<T extends Trigger<unknown>> = Omit<ExecutorInput, \"trigger\" | \"operation\"> & {\n trigger: T;\n};\n\n/**\n * Executor type with conditional inference for workflow operations.\n * When operation.kind is \"workflow\", infers W from the workflow property\n * to ensure args type matches the workflow's mainJob input type.\n */\ntype Executor<T extends Trigger<unknown>, O> = O extends {\n kind: \"workflow\";\n workflow: infer W extends Workflow;\n}\n ? ExecutorBase<T> & {\n operation: {\n kind: \"workflow\";\n workflow: W;\n args?: WorkflowInput<W> | ((args: TriggerArgs<T>) => WorkflowInput<W>);\n authInvoker?: AuthInvoker<string>;\n };\n }\n : ExecutorBase<T> & {\n operation: O;\n };\n\n/**\n * Create an executor configuration for the Tailor SDK.\n *\n * Executors are event-driven handlers that respond to record changes,\n * resolver executions, or other events.\n *\n * Operation kinds: \"function\", \"graphql\", \"webhook\", \"workflow\".\n * @template T\n * @template O\n * @param config - Executor configuration\n * @returns The same executor configuration\n * @example\n * import { createExecutor, recordCreatedTrigger } from \"@tailor-platform/sdk\";\n * import { order } from \"../tailordb/order\";\n *\n * export default createExecutor({\n * name: \"order-created\",\n * description: \"Handles new order creation\",\n * trigger: recordCreatedTrigger({ type: order }),\n * operation: {\n * kind: \"function\",\n * body: async ({ newRecord }) => {\n * console.log(\"New order:\", newRecord.id);\n * },\n * },\n * });\n */\nexport function createExecutor<\n T extends Trigger<unknown>,\n O extends Operation<TriggerArgs<T>> | { kind: \"workflow\"; workflow: Workflow },\n>(config: Executor<T, O>): Executor<T, O>;\n\n/**\n * Create an executor configuration for the Tailor SDK.\n * This overload preserves source compatibility for legacy explicit generic calls,\n * where the first generic argument represents trigger args.\n * @template Args\n * @template O\n * @param config - Executor configuration\n * @returns The same executor configuration\n */\nexport function createExecutor<\n Args,\n O extends Operation<Args> | { kind: \"workflow\"; workflow: Workflow },\n>(config: Executor<Trigger<Args>, O>): Executor<Trigger<Args>, O>;\n\nexport function createExecutor<\n T extends Trigger<unknown>,\n O extends Operation<TriggerArgs<T>> | { kind: \"workflow\"; workflow: Workflow },\n>(config: Executor<T, O>) {\n return brandValue(config, \"executor\");\n}\n","import type { ResolverConfig } from \"@/configure/services/resolver/resolver\";\nimport type { TailorDBType } from \"@/configure/services/tailordb/schema\";\nimport type { TailorActor } from \"@/configure/types/actor\";\nimport type { TailorEnv } from \"@/configure/types/env\";\nimport type { output } from \"@/configure/types/helpers\";\nimport type {\n RecordTrigger as ParserRecordTrigger,\n ResolverExecutedTrigger as ParserResolverExecutedTrigger,\n IdpUserTrigger as ParserIdpUserTrigger,\n AuthAccessTokenTrigger as ParserAuthAccessTokenTrigger,\n} from \"@/types/executor.generated\";\n\ninterface EventArgs {\n workspaceId: string;\n appNamespace: string;\n env: TailorEnv;\n actor: TailorActor | null;\n}\n\ninterface RecordArgs extends EventArgs {\n typeName: string;\n}\n\nexport interface RecordCreatedArgs<T extends TailorDBType> extends RecordArgs {\n newRecord: output<T>;\n}\n\nexport interface RecordUpdatedArgs<T extends TailorDBType> extends RecordArgs {\n newRecord: output<T>;\n oldRecord: output<T>;\n}\n\nexport interface RecordDeletedArgs<T extends TailorDBType> extends RecordArgs {\n oldRecord: output<T>;\n}\n\n/**\n * Args for resolverExecutedTrigger. This is a discriminated union on `success`.\n *\n * When `success` is true, `result` contains the resolver output and `error` is never.\n * When `success` is false, `error` contains the error message and `result` is never.\n *\n * Narrow on `success` to safely access either `result` or `error`.\n * @example\n * body: async (args) => {\n * if (args.success) {\n * console.log(args.result);\n * } else {\n * console.error(args.error);\n * }\n * }\n */\nexport type ResolverExecutedArgs<R extends ResolverConfig> = EventArgs & {\n resolverName: string;\n} & (\n | {\n success: true;\n result: output<R[\"output\"]>;\n error?: never;\n }\n | {\n success: false;\n result?: never;\n error: string;\n }\n );\n\nexport type RecordTrigger<Args> = ParserRecordTrigger & {\n __args: Args;\n};\n\ntype RecordTriggerOptions<T extends TailorDBType, Args> = {\n type: T;\n condition?: (args: Args) => boolean;\n};\n\n/**\n * Create a trigger that fires when a TailorDB record is created.\n * @template T\n * @param options - Trigger options\n * @returns Record created trigger\n */\nexport function recordCreatedTrigger<T extends TailorDBType>(\n options: RecordTriggerOptions<T, RecordCreatedArgs<T>>,\n): RecordTrigger<RecordCreatedArgs<T>> {\n const { type, condition } = options;\n return {\n kind: \"recordCreated\",\n typeName: type.name,\n condition,\n __args: {} as RecordCreatedArgs<T>,\n };\n}\n\n/**\n * Create a trigger that fires when a TailorDB record is updated.\n * @template T\n * @param options - Trigger options\n * @returns Record updated trigger\n */\nexport function recordUpdatedTrigger<T extends TailorDBType>(\n options: RecordTriggerOptions<T, RecordUpdatedArgs<T>>,\n): RecordTrigger<RecordUpdatedArgs<T>> {\n const { type, condition } = options;\n return {\n kind: \"recordUpdated\",\n typeName: type.name,\n condition,\n __args: {} as RecordUpdatedArgs<T>,\n };\n}\n\n/**\n * Create a trigger that fires when a TailorDB record is deleted.\n * @template T\n * @param options - Trigger options\n * @returns Record deleted trigger\n */\nexport function recordDeletedTrigger<T extends TailorDBType>(\n options: RecordTriggerOptions<T, RecordDeletedArgs<T>>,\n): RecordTrigger<RecordDeletedArgs<T>> {\n const { type, condition } = options;\n return {\n kind: \"recordDeleted\",\n typeName: type.name,\n condition,\n __args: {} as RecordDeletedArgs<T>,\n };\n}\n\nexport type ResolverExecutedTrigger<Args> = ParserResolverExecutedTrigger & {\n __args: Args;\n};\n\ntype ResolverExecutedTriggerOptions<R extends ResolverConfig> = {\n resolver: R;\n condition?: (args: ResolverExecutedArgs<R>) => boolean;\n};\n\n/**\n * Create a trigger that fires when a resolver is executed.\n * @template R\n * @param options - Trigger options\n * @returns Resolver executed trigger\n */\nexport function resolverExecutedTrigger<R extends ResolverConfig>(\n options: ResolverExecutedTriggerOptions<R>,\n): ResolverExecutedTrigger<ResolverExecutedArgs<R>> {\n const { resolver, condition } = options;\n return {\n kind: \"resolverExecuted\",\n resolverName: resolver.name,\n condition,\n __args: {} as ResolverExecutedArgs<R>,\n };\n}\n\n// IdP User Event Triggers\nexport interface IdpUserArgs extends EventArgs {\n namespaceName: string;\n userId: string;\n}\n\nexport type IdpUserTrigger<Args> = ParserIdpUserTrigger & {\n __args: Args;\n};\n\n/**\n * Create a trigger that fires when an IdP user is created.\n * @returns IdP user created trigger\n */\nexport function idpUserCreatedTrigger(): IdpUserTrigger<IdpUserArgs> {\n return {\n kind: \"idpUserCreated\",\n __args: {} as IdpUserArgs,\n };\n}\n\n/**\n * Create a trigger that fires when an IdP user is updated.\n * @returns IdP user updated trigger\n */\nexport function idpUserUpdatedTrigger(): IdpUserTrigger<IdpUserArgs> {\n return {\n kind: \"idpUserUpdated\",\n __args: {} as IdpUserArgs,\n };\n}\n\n/**\n * Create a trigger that fires when an IdP user is deleted.\n * @returns IdP user deleted trigger\n */\nexport function idpUserDeletedTrigger(): IdpUserTrigger<IdpUserArgs> {\n return {\n kind: \"idpUserDeleted\",\n __args: {} as IdpUserArgs,\n };\n}\n\n// Auth Access Token Event Triggers\nexport interface AuthAccessTokenArgs extends EventArgs {\n namespaceName: string;\n userId: string;\n}\n\nexport type AuthAccessTokenTrigger<Args> = ParserAuthAccessTokenTrigger & {\n __args: Args;\n};\n\n/**\n * Create a trigger that fires when an access token is issued.\n * @returns Auth access token issued trigger\n */\nexport function authAccessTokenIssuedTrigger(): AuthAccessTokenTrigger<AuthAccessTokenArgs> {\n return {\n kind: \"authAccessTokenIssued\",\n __args: {} as AuthAccessTokenArgs,\n };\n}\n\n/**\n * Create a trigger that fires when an access token is refreshed.\n * @returns Auth access token refreshed trigger\n */\nexport function authAccessTokenRefreshedTrigger(): AuthAccessTokenTrigger<AuthAccessTokenArgs> {\n return {\n kind: \"authAccessTokenRefreshed\",\n __args: {} as AuthAccessTokenArgs,\n };\n}\n\n/**\n * Create a trigger that fires when an access token is revoked.\n * @returns Auth access token revoked trigger\n */\nexport function authAccessTokenRevokedTrigger(): AuthAccessTokenTrigger<AuthAccessTokenArgs> {\n return {\n kind: \"authAccessTokenRevoked\",\n __args: {} as AuthAccessTokenArgs,\n };\n}\n","import type { TailorEnv } from \"@/configure/types/env\";\nimport type { ScheduleTriggerInput as ParserScheduleTriggerInput } from \"@/types/executor.generated\";\nimport type { StandardCRON } from \"ts-cron-validator\";\n\ntype Timezone =\n | \"UTC\"\n | \"Pacific/Midway\"\n | \"Pacific/Niue\"\n | \"Pacific/Pago_Pago\"\n | \"America/Adak\"\n | \"Pacific/Honolulu\"\n | \"Pacific/Rarotonga\"\n | \"Pacific/Tahiti\"\n | \"Pacific/Marquesas\"\n | \"America/Anchorage\"\n | \"America/Juneau\"\n | \"America/Metlakatla\"\n | \"America/Nome\"\n | \"America/Sitka\"\n | \"America/Yakutat\"\n | \"Pacific/Gambier\"\n | \"America/Los_Angeles\"\n | \"America/Tijuana\"\n | \"America/Vancouver\"\n | \"Pacific/Pitcairn\"\n | \"America/Boise\"\n | \"America/Cambridge_Bay\"\n | \"America/Chihuahua\"\n | \"America/Creston\"\n | \"America/Dawson\"\n | \"America/Dawson_Creek\"\n | \"America/Denver\"\n | \"America/Edmonton\"\n | \"America/Fort_Nelson\"\n | \"America/Hermosillo\"\n | \"America/Inuvik\"\n | \"America/Mazatlan\"\n | \"America/Ojinaga\"\n | \"America/Phoenix\"\n | \"America/Whitehorse\"\n | \"America/Yellowknife\"\n | \"America/Bahia_Banderas\"\n | \"America/Belize\"\n | \"America/Chicago\"\n | \"America/Costa_Rica\"\n | \"America/El_Salvador\"\n | \"America/Guatemala\"\n | \"America/Indiana/Knox\"\n | \"America/Indiana/Tell_City\"\n | \"America/Managua\"\n | \"America/Matamoros\"\n | \"America/Menominee\"\n | \"America/Merida\"\n | \"America/Mexico_City\"\n | \"America/Monterrey\"\n | \"America/North_Dakota/Beulah\"\n | \"America/North_Dakota/Center\"\n | \"America/North_Dakota/New_Salem\"\n | \"America/Rainy_River\"\n | \"America/Rankin_Inlet\"\n | \"America/Regina\"\n | \"America/Resolute\"\n | \"America/Swift_Current\"\n | \"America/Tegucigalpa\"\n | \"America/Winnipeg\"\n | \"Pacific/Easter\"\n | \"Pacific/Galapagos\"\n | \"America/Atikokan\"\n | \"America/Bogota\"\n | \"America/Cancun\"\n | \"America/Cayman\"\n | \"America/Detroit\"\n | \"America/Eirunepe\"\n | \"America/Grand_Turk\"\n | \"America/Guayaquil\"\n | \"America/Havana\"\n | \"America/Indiana/Indianapolis\"\n | \"America/Indiana/Marengo\"\n | \"America/Indiana/Petersburg\"\n | \"America/Indiana/Vevay\"\n | \"America/Indiana/Vincennes\"\n | \"America/Indiana/Winamac\"\n | \"America/Iqaluit\"\n | \"America/Jamaica\"\n | \"America/Kentucky/Louisville\"\n | \"America/Kentucky/Monticello\"\n | \"America/Lima\"\n | \"America/Nassau\"\n | \"America/New_York\"\n | \"America/Nipigon\"\n | \"America/Panama\"\n | \"America/Pangnirtung\"\n | \"America/Port-au-Prince\"\n | \"America/Rio_Branco\"\n | \"America/Thunder_Bay\"\n | \"America/Toronto\"\n | \"America/Anguilla\"\n | \"America/Antigua\"\n | \"America/Aruba\"\n | \"America/Asuncion\"\n | \"America/Barbados\"\n | \"America/Blanc-Sablon\"\n | \"America/Boa_Vista\"\n | \"America/Campo_Grande\"\n | \"America/Caracas\"\n | \"America/Cuiaba\"\n | \"America/Curacao\"\n | \"America/Dominica\"\n | \"America/Glace_Bay\"\n | \"America/Goose_Bay\"\n | \"America/Grenada\"\n | \"America/Guadeloupe\"\n | \"America/Guyana\"\n | \"America/Halifax\"\n | \"America/Kralendijk\"\n | \"America/La_Paz\"\n | \"America/Lower_Princes\"\n | \"America/Manaus\"\n | \"America/Marigot\"\n | \"America/Martinique\"\n | \"America/Moncton\"\n | \"America/Montserrat\"\n | \"America/Porto_Velho\"\n | \"America/Port_of_Spain\"\n | \"America/Puerto_Rico\"\n | \"America/Santiago\"\n | \"America/Santo_Domingo\"\n | \"America/St_Barthelemy\"\n | \"America/St_Kitts\"\n | \"America/St_Lucia\"\n | \"America/St_Thomas\"\n | \"America/St_Vincent\"\n | \"America/Thule\"\n | \"America/Tortola\"\n | \"Atlantic/Bermuda\"\n | \"America/St_Johns\"\n | \"America/Araguaina\"\n | \"America/Argentina/Buenos_Aires\"\n | \"America/Argentina/Catamarca\"\n | \"America/Argentina/Cordoba\"\n | \"America/Argentina/Jujuy\"\n | \"America/Argentina/La_Rioja\"\n | \"America/Argentina/Mendoza\"\n | \"America/Argentina/Rio_Gallegos\"\n | \"America/Argentina/Salta\"\n | \"America/Argentina/San_Juan\"\n | \"America/Argentina/San_Luis\"\n | \"America/Argentina/Tucuman\"\n | \"America/Argentina/Ushuaia\"\n | \"America/Bahia\"\n | \"America/Belem\"\n | \"America/Cayenne\"\n | \"America/Fortaleza\"\n | \"America/Godthab\"\n | \"America/Maceio\"\n | \"America/Miquelon\"\n | \"America/Montevideo\"\n | \"America/Paramaribo\"\n | \"America/Punta_Arenas\"\n | \"America/Recife\"\n | \"America/Santarem\"\n | \"America/Sao_Paulo\"\n | \"Antarctica/Palmer\"\n | \"Antarctica/Rothera\"\n | \"Atlantic/Stanley\"\n | \"America/Noronha\"\n | \"Atlantic/South_Georgia\"\n | \"America/Scoresbysund\"\n | \"Atlantic/Azores\"\n | \"Atlantic/Cape_Verde\"\n | \"Africa/Abidjan\"\n | \"Africa/Accra\"\n | \"Africa/Bamako\"\n | \"Africa/Banjul\"\n | \"Africa/Bissau\"\n | \"Africa/Casablanca\"\n | \"Africa/Conakry\"\n | \"Africa/Dakar\"\n | \"Africa/El_Aaiun\"\n | \"Africa/Freetown\"\n | \"Africa/Lome\"\n | \"Africa/Monrovia\"\n | \"Africa/Nouakchott\"\n | \"Africa/Ouagadougou\"\n | \"Africa/Sao_Tome\"\n | \"America/Danmarkshavn\"\n | \"Antarctica/Troll\"\n | \"Atlantic/Canary\"\n | \"Atlantic/Faroe\"\n | \"Atlantic/Madeira\"\n | \"Atlantic/Reykjavik\"\n | \"Atlantic/St_Helena\"\n | \"Europe/Dublin\"\n | \"Europe/Guernsey\"\n | \"Europe/Isle_of_Man\"\n | \"Europe/Jersey\"\n | \"Europe/Lisbon\"\n | \"Europe/London\"\n | \"Africa/Algiers\"\n | \"Africa/Bangui\"\n | \"Africa/Brazzaville\"\n | \"Africa/Ceuta\"\n | \"Africa/Douala\"\n | \"Africa/Kinshasa\"\n | \"Africa/Lagos\"\n | \"Africa/Libreville\"\n | \"Africa/Luanda\"\n | \"Africa/Malabo\"\n | \"Africa/Ndjamena\"\n | \"Africa/Niamey\"\n | \"Africa/Porto-Novo\"\n | \"Africa/Tunis\"\n | \"Africa/Windhoek\"\n | \"Arctic/Longyearbyen\"\n | \"Europe/Amsterdam\"\n | \"Europe/Andorra\"\n | \"Europe/Belgrade\"\n | \"Europe/Berlin\"\n | \"Europe/Bratislava\"\n | \"Europe/Brussels\"\n | \"Europe/Budapest\"\n | \"Europe/Copenhagen\"\n | \"Europe/Gibraltar\"\n | \"Europe/Ljubljana\"\n | \"Europe/Luxembourg\"\n | \"Europe/Madrid\"\n | \"Europe/Malta\"\n | \"Europe/Monaco\"\n | \"Europe/Oslo\"\n | \"Europe/Paris\"\n | \"Europe/Podgorica\"\n | \"Europe/Prague\"\n | \"Europe/Rome\"\n | \"Europe/San_Marino\"\n | \"Europe/Sarajevo\"\n | \"Europe/Skopje\"\n | \"Europe/Stockholm\"\n | \"Europe/Tirane\"\n | \"Europe/Vaduz\"\n | \"Europe/Vatican\"\n | \"Europe/Vienna\"\n | \"Europe/Warsaw\"\n | \"Europe/Zagreb\"\n | \"Europe/Zurich\"\n | \"Africa/Blantyre\"\n | \"Africa/Bujumbura\"\n | \"Africa/Cairo\"\n | \"Africa/Gaborone\"\n | \"Africa/Harare\"\n | \"Africa/Johannesburg\"\n | \"Africa/Juba\"\n | \"Africa/Khartoum\"\n | \"Africa/Kigali\"\n | \"Africa/Lubumbashi\"\n | \"Africa/Lusaka\"\n | \"Africa/Maputo\"\n | \"Africa/Maseru\"\n | \"Africa/Mbabane\"\n | \"Africa/Tripoli\"\n | \"Asia/Amman\"\n | \"Asia/Beirut\"\n | \"Asia/Damascus\"\n | \"Asia/Famagusta\"\n | \"Asia/Gaza\"\n | \"Asia/Hebron\"\n | \"Asia/Jerusalem\"\n | \"Asia/Nicosia\"\n | \"Europe/Athens\"\n | \"Europe/Bucharest\"\n | \"Europe/Chisinau\"\n | \"Europe/Helsinki\"\n | \"Europe/Kaliningrad\"\n | \"Europe/Kyiv\"\n | \"Europe/Mariehamn\"\n | \"Europe/Riga\"\n | \"Europe/Sofia\"\n | \"Europe/Tallinn\"\n | \"Europe/Uzhgorod\"\n | \"Europe/Vilnius\"\n | \"Europe/Zaporizhzhia\"\n | \"Africa/Addis_Ababa\"\n | \"Africa/Asmara\"\n | \"Africa/Dar_es_Salaam\"\n | \"Africa/Djibouti\"\n | \"Africa/Kampala\"\n | \"Africa/Mogadishu\"\n | \"Africa/Nairobi\"\n | \"Antarctica/Syowa\"\n | \"Asia/Aden\"\n | \"Asia/Baghdad\"\n | \"Asia/Bahrain\"\n | \"Asia/Kuwait\"\n | \"Asia/Qatar\"\n | \"Asia/Riyadh\"\n | \"Europe/Istanbul\"\n | \"Europe/Kirov\"\n | \"Europe/Minsk\"\n | \"Europe/Moscow\"\n | \"Europe/Simferopol\"\n | \"Europe/Volgograd\"\n | \"Indian/Antananarivo\"\n | \"Indian/Comoro\"\n | \"Indian/Mayotte\"\n | \"Asia/Tehran\"\n | \"Asia/Baku\"\n | \"Asia/Dubai\"\n | \"Asia/Muscat\"\n | \"Asia/Tbilisi\"\n | \"Asia/Yerevan\"\n | \"Europe/Astrakhan\"\n | \"Europe/Samara\"\n | \"Europe/Saratov\"\n | \"Europe/Ulyanovsk\"\n | \"Indian/Mahe\"\n | \"Indian/Mauritius\"\n | \"Indian/Reunion\"\n | \"Asia/Kabul\"\n | \"Antarctica/Mawson\"\n | \"Asia/Aqtau\"\n | \"Asia/Aqtobe\"\n | \"Asia/Ashgabat\"\n | \"Asia/Atyrau\"\n | \"Asia/Dushanbe\"\n | \"Asia/Karachi\"\n | \"Asia/Oral\"\n | \"Asia/Qyzylorda\"\n | \"Asia/Samarkand\"\n | \"Asia/Tashkent\"\n | \"Asia/Yekaterinburg\"\n | \"Indian/Kerguelen\"\n | \"Indian/Maldives\"\n | \"Asia/Colombo\"\n | \"Asia/Kolkata\"\n | \"Asia/Kathmandu\"\n | \"Antarctica/Vostok\"\n | \"Asia/Almaty\"\n | \"Asia/Bishkek\"\n | \"Asia/Dhaka\"\n | \"Asia/Omsk\"\n | \"Asia/Qostanay\"\n | \"Asia/Thimphu\"\n | \"Asia/Urumqi\"\n | \"Indian/Chagos\"\n | \"Asia/Yangon\"\n | \"Indian/Cocos\"\n | \"Antarctica/Davis\"\n | \"Asia/Bangkok\"\n | \"Asia/Barnaul\"\n | \"Asia/Hovd\"\n | \"Asia/Ho_Chi_Minh\"\n | \"Asia/Jakarta\"\n | \"Asia/Krasnoyarsk\"\n | \"Asia/Novokuznetsk\"\n | \"Asia/Novosibirsk\"\n | \"Asia/Phnom_Penh\"\n | \"Asia/Pontianak\"\n | \"Asia/Tomsk\"\n | \"Asia/Vientiane\"\n | \"Indian/Christmas\"\n | \"Asia/Brunei\"\n | \"Asia/Choibalsan\"\n | \"Asia/Hong_Kong\"\n | \"Asia/Irkutsk\"\n | \"Asia/Kuala_Lumpur\"\n | \"Asia/Kuching\"\n | \"Asia/Macau\"\n | \"Asia/Makassar\"\n | \"Asia/Manila\"\n | \"Asia/Shanghai\"\n | \"Asia/Singapore\"\n | \"Asia/Taipei\"\n | \"Asia/Ulaanbaatar\"\n | \"Australia/Perth\"\n | \"Australia/Eucla\"\n | \"Asia/Chita\"\n | \"Asia/Dili\"\n | \"Asia/Jayapura\"\n | \"Asia/Khandyga\"\n | \"Asia/Pyongyang\"\n | \"Asia/Seoul\"\n | \"Asia/Tokyo\"\n | \"Asia/Yakutsk\"\n | \"Pacific/Palau\"\n | \"Australia/Adelaide\"\n | \"Australia/Broken_Hill\"\n | \"Australia/Darwin\"\n | \"Antarctica/DumontDUrville\"\n | \"Antarctica/Macquarie\"\n | \"Asia/Ust-Nera\"\n | \"Asia/Vladivostok\"\n | \"Australia/Brisbane\"\n | \"Australia/Currie\"\n | \"Australia/Hobart\"\n | \"Australia/Lindeman\"\n | \"Australia/Melbourne\"\n | \"Australia/Sydney\"\n | \"Pacific/Chuuk\"\n | \"Pacific/Guam\"\n | \"Pacific/Port_Moresby\"\n | \"Pacific/Saipan\"\n | \"Australia/Lord_Howe\"\n | \"Antarctica/Casey\"\n | \"Asia/Magadan\"\n | \"Asia/Sakhalin\"\n | \"Asia/Srednekolymsk\"\n | \"Pacific/Bougainville\"\n | \"Pacific/Efate\"\n | \"Pacific/Guadalcanal\"\n | \"Pacific/Kosrae\"\n | \"Pacific/Norfolk\"\n | \"Pacific/Noumea\"\n | \"Pacific/Pohnpei\"\n | \"Antarctica/McMurdo\"\n | \"Asia/Anadyr\"\n | \"Asia/Kamchatka\"\n | \"Pacific/Auckland\"\n | \"Pacific/Fiji\"\n | \"Pacific/Funafuti\"\n | \"Pacific/Kwajalein\"\n | \"Pacific/Majuro\"\n | \"Pacific/Nauru\"\n | \"Pacific/Tarawa\"\n | \"Pacific/Wake\"\n | \"Pacific/Wallis\"\n | \"Pacific/Chatham\"\n | \"Pacific/Apia\"\n | \"Pacific/Enderbury\"\n | \"Pacific/Fakaofo\"\n | \"Pacific/Tongatapu\"\n | \"Pacific/Kiritimati\";\n\nexport type ScheduleTrigger<Args> = ParserScheduleTriggerInput & {\n __args: Args;\n};\n\nexport interface ScheduleArgs {\n env: TailorEnv;\n}\n\ninterface ScheduleTriggerOptions<T extends string> {\n cron: StandardCRON<T> extends never ? never : T;\n timezone?: Timezone;\n}\n\n/**\n * Create a schedule-based trigger using a CRON expression and optional timezone.\n * @template T\n * @param options - Schedule options\n * @returns Schedule trigger\n */\nexport function scheduleTrigger<T extends string>(\n options: ScheduleTriggerOptions<T>,\n): ScheduleTrigger<ScheduleArgs> {\n const { cron, timezone } = options;\n return {\n kind: \"schedule\",\n cron,\n timezone,\n __args: {} as ScheduleArgs,\n };\n}\n","import type { TailorEnv } from \"@/configure/types/env\";\nimport type { IncomingWebhookTrigger as ParserIncomingWebhookTrigger } from \"@/types/executor.generated\";\n\nexport interface IncomingWebhookArgs<T extends IncomingWebhookRequest> {\n body: T[\"body\"];\n headers: T[\"headers\"];\n method: \"POST\" | \"GET\" | \"PUT\" | \"DELETE\";\n rawBody: string;\n env: TailorEnv;\n}\n\nexport interface IncomingWebhookRequest {\n body: Record<string, unknown>;\n headers: Record<string, string>;\n}\n\nexport type IncomingWebhookTrigger<Args> = ParserIncomingWebhookTrigger & {\n __args: Args;\n};\n\n/**\n * Create a trigger for incoming webhook requests.\n * @template T\n * @returns Incoming webhook trigger\n */\nexport function incomingWebhookTrigger<T extends IncomingWebhookRequest>(): IncomingWebhookTrigger<\n IncomingWebhookArgs<T>\n> {\n return {\n kind: \"incomingWebhook\",\n __args: {} as IncomingWebhookArgs<T>,\n };\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { brandValue } from \"@/utils/brand\";\nimport type { WorkflowJob } from \"./job\";\nimport type { AuthInvoker } from \"../auth\";\nimport type { RetryPolicy } from \"@/types/workflow.generated\";\n\nexport type { RetryPolicy };\n\nexport interface WorkflowConfig<\n Job extends WorkflowJob<any, any, any> = WorkflowJob<any, any, any>,\n> {\n name: string;\n mainJob: Job;\n retryPolicy?: RetryPolicy;\n}\n\nexport interface Workflow<Job extends WorkflowJob<any, any, any> = WorkflowJob<any, any, any>> {\n name: string;\n mainJob: Job;\n retryPolicy?: RetryPolicy;\n trigger: (\n args: Parameters<Job[\"trigger\"]>[0],\n options?: { authInvoker: AuthInvoker<string> },\n ) => Promise<string>;\n}\n\ninterface WorkflowDefinition<Job extends WorkflowJob<any, any, any>> {\n name: string;\n mainJob: Job;\n retryPolicy?: RetryPolicy;\n}\n\n/**\n * Create a workflow definition that can be triggered via the Tailor SDK.\n * In production, bundler transforms .trigger() calls to tailor.workflow.triggerWorkflow().\n *\n * The workflow MUST be the default export of the file.\n * All jobs referenced by the workflow MUST be named exports.\n * @template Job\n * @param config - Workflow configuration\n * @returns Defined workflow\n * @example\n * export const fetchData = createWorkflowJob({ name: \"fetch-data\", body: async (input: { id: string }) => ({ id: input.id }) });\n * export const processData = createWorkflowJob({\n * name: \"process-data\",\n * body: async (input: { id: string }) => {\n * const data = await fetchData.trigger({ id: input.id }); // await is optional — stripped by bundler\n * return { data };\n * },\n * });\n *\n * // Workflow must be default export; mainJob is the entry point\n * export default createWorkflow({\n * name: \"data-processing\",\n * mainJob: processData,\n * });\n */\nexport function createWorkflow<Job extends WorkflowJob<any, any, any>>(\n config: WorkflowDefinition<Job>,\n): Workflow<Job> {\n return brandValue(\n {\n ...config,\n // For local execution, directly call mainJob.trigger()\n // In production, bundler transforms this to tailor.workflow.triggerWorkflow()\n trigger: async (args) => {\n await config.mainJob.trigger(...([args] as unknown as []));\n return \"00000000-0000-0000-0000-000000000000\";\n },\n },\n \"workflow\",\n );\n}\n","import type { StaticWebsiteInput } from \"@/types/staticwebsite.generated\";\n\ndeclare const staticWebsiteDefinitionBrand: unique symbol;\ntype StaticWebsiteDefinitionBrand = {\n readonly [staticWebsiteDefinitionBrand]: true;\n};\n\n/**\n * Define a static website configuration for the Tailor SDK.\n * @param name - Static website name\n * @param config - Static website configuration\n * @returns Defined static website\n */\nexport function defineStaticWebSite(name: string, config: Omit<StaticWebsiteInput, \"name\">) {\n const result = {\n ...config,\n name,\n get url() {\n return `${name}:url` as const;\n },\n } as const satisfies StaticWebsiteInput & { readonly url: string };\n\n return result as typeof result & StaticWebsiteDefinitionBrand;\n}\n\nexport type StaticWebsiteConfig = Omit<ReturnType<typeof defineStaticWebSite>, \"url\">;\n","import type { BuiltinIdP } from \"@/types/auth.generated\";\nimport type { IdpDefinitionBrand } from \"@/types/idp\";\nimport type { IdPInput } from \"@/types/idp.generated\";\n\nexport type {\n IdPGqlOperations,\n IdPGqlOperationsInput as IdPGqlOperationsConfig,\n} from \"@/types/idp.generated\";\n\n/**\n * Define an IdP service configuration for the Tailor SDK.\n * @template TClients\n * @param name - IdP service name\n * @param config - IdP configuration\n * @returns Defined IdP service\n */\nexport function defineIdp<const TClients extends string[]>(\n name: string,\n config: Omit<IdPInput, \"name\" | \"clients\"> & { clients: TClients },\n) {\n const result = {\n ...config,\n name,\n provider(providerName: string, clientName: TClients[number]) {\n return {\n name: providerName,\n kind: \"BuiltInIdP\",\n namespace: name,\n clientName,\n } as const satisfies BuiltinIdP;\n },\n } as const satisfies IdPInput & {\n provider: (providerName: string, clientName: TClients[number]) => BuiltinIdP;\n };\n\n return result as typeof result & IdpDefinitionBrand;\n}\n\nexport type { IdPConfig, IdPExternalConfig } from \"@/types/idp\";\n","declare const secretsDefinitionBrand: unique symbol;\ntype SecretsDefinitionBrand = { readonly [secretsDefinitionBrand]: true };\n\ntype SecretsVaultInput = Record<string, string>;\ntype SecretsInput = Record<string, SecretsVaultInput>;\n\ntype DefinedSecrets<T extends SecretsInput> = {\n get<V extends Extract<keyof T, string>, S extends Extract<keyof T[V], string>>(\n vault: V,\n secret: S,\n ): Promise<string | undefined>;\n getAll<V extends Extract<keyof T, string>, S extends Extract<keyof T[V], string>>(\n vault: V,\n secrets: readonly S[],\n ): Promise<(string | undefined)[]>;\n} & SecretsDefinitionBrand;\n\n/** Type accepted by `AppConfig.secrets`. Only values returned by `defineSecretManager()` satisfy this. */\nexport type SecretsConfig = Omit<ReturnType<typeof defineSecretManager>, \"get\" | \"getAll\">;\n\n/**\n * Define secrets configuration for the Tailor SDK.\n * Each key is a vault name, and its value is a record of secret name to secret value.\n * @param config - Secrets configuration mapping vault names to their secrets\n * @returns Defined secrets with typed runtime access methods\n */\nexport function defineSecretManager<const T extends SecretsInput>(config: T): DefinedSecrets<T> {\n const result = { ...config };\n\n // Non-enumerable so Zod's z.record validation ignores them\n Object.defineProperty(result, \"get\", {\n value: async (vault: string, secret: string) => {\n return tailor.secretmanager.getSecret(vault, secret);\n },\n enumerable: false,\n });\n Object.defineProperty(result, \"getAll\", {\n value: async (vault: string, secrets: readonly string[]) => {\n const record = await tailor.secretmanager.getSecrets(vault, secrets);\n return secrets.map((s) => record[s]);\n },\n enumerable: false,\n });\n\n return result as T & DefinedSecrets<T>;\n}\n","import type { AppConfig } from \"@/types/app-config\";\nimport type { GeneratorConfig } from \"@/types/generator-config\";\nimport type { Plugin } from \"@/types/plugin\";\n\n/**\n * Define a Tailor SDK application configuration with shallow exactness.\n * @template Config\n * @param config - Application configuration\n * @returns The same configuration object\n */\n/* @__NO_SIDE_EFFECTS__ */\n// eslint-disable-next-line jsdoc/require-jsdoc\nexport function defineConfig<\n const Config extends AppConfig &\n // type-fest's Exact works recursively and causes type errors, so we use a shallow version here.\n Record<Exclude<keyof Config, keyof AppConfig>, never>,\n>(config: Config) {\n return config;\n}\n\n/**\n * Define generators to be used with the Tailor SDK.\n * @deprecated Use definePlugins() with generation hooks (onTypeLoaded, generate, etc.) instead.\n * @param configs - Generator configurations\n * @returns Generator configurations as given\n */\n/* @__NO_SIDE_EFFECTS__ */\n// eslint-disable-next-line jsdoc/require-jsdoc\nexport function defineGenerators(...configs: GeneratorConfig[]) {\n return configs;\n}\n\n/**\n * Define plugins to be used with the Tailor SDK.\n * Plugins can generate additional types, resolvers, and executors\n * based on existing TailorDB types.\n * @param configs - Plugin configurations\n * @returns Plugin configurations as given\n */\n/* @__NO_SIDE_EFFECTS__ */\n// eslint-disable-next-line jsdoc/require-jsdoc, @typescript-eslint/no-explicit-any\nexport function definePlugins(...configs: Plugin<any, any>[]) {\n return configs;\n}\n","import { t as _t } from \"@/configure/types\";\nimport type * as helperTypes from \"@/configure/types/helpers\";\n\ntype TailorOutput<T> = helperTypes.output<T>;\n\nexport type infer<T> = TailorOutput<T>;\nexport type output<T> = TailorOutput<T>;\n\n// eslint-disable-next-line import/export\nexport const t = { ..._t };\n// eslint-disable-next-line @typescript-eslint/no-namespace, import/export\nexport namespace t {\n export type output<T> = TailorOutput<T>;\n export type infer<T> = TailorOutput<T>;\n}\n\nexport {\n type TailorField,\n type TailorUser,\n unauthenticatedTailorUser,\n type AttributeMap,\n type AttributeList,\n type Env,\n} from \"@/configure/types\";\n\nexport * from \"@/configure/services\";\n\nexport { defineConfig, defineGenerators, definePlugins } from \"@/configure/config\";\n\n// Plugin types for custom plugin development\nexport type {\n Plugin,\n PluginConfigs,\n PluginOutput,\n TypePluginOutput,\n NamespacePluginOutput,\n PluginProcessContext,\n PluginNamespaceProcessContext,\n PluginAttachment,\n PluginGeneratedType,\n PluginGeneratedResolver,\n PluginGeneratedExecutor,\n PluginGeneratedExecutorWithFile,\n PluginExecutorContext,\n PluginExecutorContextBase,\n TailorDBTypeForPlugin,\n} from \"@/types/plugin\";\n\n// Generation-time hook context types for plugin development\nexport type {\n TailorDBReadyContext,\n ResolverReadyContext,\n ExecutorReadyContext,\n TailorDBNamespaceData,\n ResolverNamespaceData,\n GeneratorResult,\n} from \"@/types/plugin-generation\";\n"],"mappings":"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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ct as
|
|
1
|
+
import { ct as InferredAttributeList, lt as InferredAttributeMap } from "./plugin-B1hNwcCC.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/configure/types/actor.d.ts
|
|
4
4
|
/** User type enum values from the Tailor Platform server. */
|
|
@@ -26,4 +26,4 @@ interface Env {}
|
|
|
26
26
|
type TailorEnv = keyof Env extends never ? Record<string, string> : Env;
|
|
27
27
|
//#endregion
|
|
28
28
|
export { TailorEnv as n, TailorActor as r, Env as t };
|
|
29
|
-
//# sourceMappingURL=env-
|
|
29
|
+
//# sourceMappingURL=env-CSsVESbH.d.mts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { n as TailorEnv, r as TailorActor } from "./env-
|
|
3
|
-
import { g as IdpDefinitionBrand, n as AppConfig, t as RetryPolicy, y as IdPInput } from "./workflow.generated-
|
|
1
|
+
import { $ as FieldOutput, A as DefinedAuth, Ct as IncomingWebhookTrigger$1, Dt as WebhookOperation$1, Et as ScheduleTriggerInput, F as UserAttributeMap, H as TailorDBType, O as AuthServiceInput, Ot as WorkflowOperation$1, P as UserAttributeListKey, Q as FieldOptions, St as IdpUserTrigger$1, Tt as ResolverExecutedTrigger$1, V as TailorDBInstance, X as DefinedFieldMetadata, Y as ArrayFieldOutput, Z as FieldMetadata, _t as AuthAccessTokenTrigger$1, at as output$1, bt as FunctionOperation$1, et as TailorFieldType, ft as AllowedValues, gt as GeneratorConfig, ht as ResolverInput, it as JsonCompatible, kt as AuthInvoker$1, mt as Resolver, n as Plugin, nt as TailorField, pt as AllowedValuesOutput, rt as InferFieldsOutput, tt as TailorAnyField, ut as TailorUser, wt as RecordTrigger$1, xt as GqlOperation$1, yt as ExecutorInput } from "./plugin-B1hNwcCC.mjs";
|
|
2
|
+
import { n as TailorEnv, r as TailorActor } from "./env-CSsVESbH.mjs";
|
|
3
|
+
import { g as IdpDefinitionBrand, n as AppConfig, t as RetryPolicy, y as IdPInput } from "./workflow.generated-Bm4b8hEk.mjs";
|
|
4
4
|
import * as zod from "zod";
|
|
5
5
|
import { JsonPrimitive, Jsonifiable, Jsonify } from "type-fest";
|
|
6
6
|
import { Client } from "@urql/core";
|
|
@@ -757,4 +757,4 @@ declare namespace t {
|
|
|
757
757
|
}
|
|
758
758
|
//#endregion
|
|
759
759
|
export { AuthInvoker as $, idpUserCreatedTrigger as A, WebhookOperation as B, RecordTrigger as C, authAccessTokenIssuedTrigger as D, ResolverExecutedTrigger as E, recordUpdatedTrigger as F, WORKFLOW_TEST_ENV_KEY as G, Workflow as H, resolverExecutedTrigger as I, WorkflowJobInput as J, WorkflowJob as K, FunctionOperation as L, idpUserUpdatedTrigger as M, recordCreatedTrigger as N, authAccessTokenRefreshedTrigger as O, recordDeletedTrigger as P, createResolver as Q, GqlOperation as R, RecordDeletedArgs as S, ResolverExecutedArgs as T, WorkflowConfig as U, WorkflowOperation as V, createWorkflow as W, createWorkflowJob as X, WorkflowJobOutput as Y, QueryType as Z, AuthAccessTokenArgs as _, defineGenerators as a, IdpUserTrigger as b, createExecutor as c, IncomingWebhookRequest as d, defineAuth as et, IncomingWebhookTrigger as f, scheduleTrigger as g, ScheduleTrigger as h, defineConfig as i, idpUserDeletedTrigger as j, authAccessTokenRevokedTrigger as k, Trigger as l, ScheduleArgs as m, output as n, definePlugins as o, incomingWebhookTrigger as p, WorkflowJobContext as q, t as r, defineIdp as s, infer as t, IncomingWebhookArgs as u, AuthAccessTokenTrigger as v, RecordUpdatedArgs as w, RecordCreatedArgs as x, IdpUserArgs as y, Operation as z };
|
|
760
|
-
//# sourceMappingURL=index-
|
|
760
|
+
//# sourceMappingURL=index-BJg0DTbR.d.mts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as Plugin } from "./plugin-
|
|
1
|
+
import { n as Plugin } from "./plugin-B1hNwcCC.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/plugin/builtin/seed/index.d.ts
|
|
4
4
|
declare const SeedGeneratorID = "@tailor-platform/seed";
|
|
@@ -16,4 +16,4 @@ type SeedPluginOptions = {
|
|
|
16
16
|
declare function seedPlugin(options: SeedPluginOptions): Plugin<unknown, SeedPluginOptions>;
|
|
17
17
|
//#endregion
|
|
18
18
|
export { seedPlugin as n, SeedGeneratorID as t };
|
|
19
|
-
//# sourceMappingURL=index-
|
|
19
|
+
//# sourceMappingURL=index-BKy-OC5C.d.mts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as Plugin } from "./plugin-
|
|
1
|
+
import { n as Plugin } from "./plugin-B1hNwcCC.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/plugin/builtin/enum-constants/index.d.ts
|
|
4
4
|
declare const EnumConstantsGeneratorID = "@tailor-platform/enum-constants";
|
|
@@ -14,4 +14,4 @@ type EnumConstantsPluginOptions = {
|
|
|
14
14
|
declare function enumConstantsPlugin(options: EnumConstantsPluginOptions): Plugin<unknown, EnumConstantsPluginOptions>;
|
|
15
15
|
//#endregion
|
|
16
16
|
export { enumConstantsPlugin as n, EnumConstantsGeneratorID as t };
|
|
17
|
-
//# sourceMappingURL=index-
|
|
17
|
+
//# sourceMappingURL=index-BtYPY8ya.d.mts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as Plugin } from "./plugin-
|
|
1
|
+
import { n as Plugin } from "./plugin-B1hNwcCC.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/plugin/builtin/file-utils/index.d.ts
|
|
4
4
|
declare const FileUtilsGeneratorID = "@tailor-platform/file-utils";
|
|
@@ -14,4 +14,4 @@ type FileUtilsPluginOptions = {
|
|
|
14
14
|
declare function fileUtilsPlugin(options: FileUtilsPluginOptions): Plugin<unknown, FileUtilsPluginOptions>;
|
|
15
15
|
//#endregion
|
|
16
16
|
export { fileUtilsPlugin as n, FileUtilsGeneratorID as t };
|
|
17
|
-
//# sourceMappingURL=index-
|
|
17
|
+
//# sourceMappingURL=index-DgRShBpu.d.mts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as Plugin } from "./plugin-
|
|
1
|
+
import { n as Plugin } from "./plugin-B1hNwcCC.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/plugin/builtin/kysely-type/index.d.ts
|
|
4
4
|
declare const KyselyGeneratorID = "@tailor-platform/kysely-type";
|
|
@@ -14,4 +14,4 @@ type KyselyTypePluginOptions = {
|
|
|
14
14
|
declare function kyselyTypePlugin(options: KyselyTypePluginOptions): Plugin<unknown, KyselyTypePluginOptions>;
|
|
15
15
|
//#endregion
|
|
16
16
|
export { kyselyTypePlugin as n, KyselyGeneratorID as t };
|
|
17
|
-
//# sourceMappingURL=index-
|
|
17
|
+
//# sourceMappingURL=index-DkJbItB-.d.mts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as enumConstantsPlugin, t as EnumConstantsGeneratorID } from "../../../index-
|
|
1
|
+
import { n as enumConstantsPlugin, t as EnumConstantsGeneratorID } from "../../../index-BtYPY8ya.mjs";
|
|
2
2
|
export { EnumConstantsGeneratorID, enumConstantsPlugin };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as fileUtilsPlugin, t as FileUtilsGeneratorID } from "../../../index-
|
|
1
|
+
import { n as fileUtilsPlugin, t as FileUtilsGeneratorID } from "../../../index-DgRShBpu.mjs";
|
|
2
2
|
export { FileUtilsGeneratorID, fileUtilsPlugin };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as kyselyTypePlugin, t as KyselyGeneratorID } from "../../../index-
|
|
1
|
+
import { n as kyselyTypePlugin, t as KyselyGeneratorID } from "../../../index-DkJbItB-.mjs";
|
|
2
2
|
export { KyselyGeneratorID, kyselyTypePlugin };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as seedPlugin, t as SeedGeneratorID } from "../../../index-
|
|
1
|
+
import { n as seedPlugin, t as SeedGeneratorID } from "../../../index-BKy-OC5C.mjs";
|
|
2
2
|
export { SeedGeneratorID, seedPlugin };
|
package/dist/plugin/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as TailorEnv, r as TailorActor } from "../env-
|
|
1
|
+
import { z as TailorAnyDBType } from "../plugin-B1hNwcCC.mjs";
|
|
2
|
+
import { n as TailorEnv, r as TailorActor } from "../env-CSsVESbH.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/plugin/with-context.d.ts
|
|
5
5
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
3
|
-
import { IsAny, NonEmptyObject } from "type-fest";
|
|
3
|
+
import { IsAny, JsonObject, NonEmptyObject } from "type-fest";
|
|
4
4
|
|
|
5
5
|
//#region src/parser/generator-config/index.d.ts
|
|
6
6
|
declare const BaseGeneratorConfigSchema: z.ZodUnion<readonly [z.ZodTuple<[z.ZodLiteral<"@tailor-platform/kysely-type">, z.ZodObject<{
|
|
@@ -1580,7 +1580,19 @@ type MachineUser<User extends TailorDBInstance, AttributeMap extends UserAttribu
|
|
|
1580
1580
|
} : {
|
|
1581
1581
|
attributeList: AttributeListToTuple<User, AttributeList>;
|
|
1582
1582
|
});
|
|
1583
|
+
type BeforeLoginHookArgs = {
|
|
1584
|
+
claims: JsonObject;
|
|
1585
|
+
idpConfigName: string;
|
|
1586
|
+
};
|
|
1587
|
+
type BeforeLoginHook<MachineUserNames extends string> = {
|
|
1588
|
+
handler(args: BeforeLoginHookArgs): Promise<void>;
|
|
1589
|
+
invoker: NoInfer<MachineUserNames>;
|
|
1590
|
+
};
|
|
1591
|
+
type AuthHooks<MachineUserNames extends string> = {
|
|
1592
|
+
beforeLogin?: BeforeLoginHook<MachineUserNames>;
|
|
1593
|
+
};
|
|
1583
1594
|
type AuthServiceInput<User extends TailorDBInstance, AttributeMap extends UserAttributeMap<User>, AttributeList extends UserAttributeListKey<User>[], MachineUserNames extends string, MachineUserAttributes extends MachineUserAttributeFields | undefined = MachineUserAttributeFields | undefined> = {
|
|
1595
|
+
hooks?: AuthHooks<MachineUserNames>;
|
|
1584
1596
|
userProfile?: UserProfile<User, AttributeMap, AttributeList>;
|
|
1585
1597
|
machineUserAttributes?: MachineUserAttributes;
|
|
1586
1598
|
machineUsers?: Record<MachineUserNames, MachineUser<User, AttributeMap, AttributeList, MachineUserAttributes>>;
|
|
@@ -2007,5 +2019,5 @@ interface Plugin<TypeConfig = unknown, PluginConfig = unknown> {
|
|
|
2007
2019
|
onExecutorReady?(context: ExecutorReadyContext<PluginConfig>): GeneratorResult | Promise<GeneratorResult>;
|
|
2008
2020
|
}
|
|
2009
2021
|
//#endregion
|
|
2010
|
-
export {
|
|
2011
|
-
//# sourceMappingURL=plugin-
|
|
2022
|
+
export { FieldOutput$1 as $, DefinedAuth as A, BuiltinIdP as At, TailorDBField as B, SCIMResource as Bt, TailorDBType as C, IncomingWebhookTrigger as Ct, AuthOwnConfig as D, WebhookOperation as Dt, AuthExternalConfig as E, ScheduleTriggerInput as Et, UserAttributeMap as F, SAML as Ft, TailorTypeGqlPermission as G, TailorDBType$1 as H, UsernameFieldKey as I, SCIMAttribute as It, unsafeAllowAllTypePermission as J, TailorTypePermission as K, ValueOperand as L, SCIMAttributeMapping as Lt, SCIMAttributeType as M, IdProvider as Mt, UserAttributeKey as N, OAuth2ClientInput as Nt, AuthServiceInput as O, WorkflowOperation as Ot, UserAttributeListKey as P, OIDC as Pt, FieldOptions as Q, TailorAnyDBField as R, SCIMAuthorization as Rt, TailorDBServiceInput as S, IdpUserTrigger as St, AuthConfig as T, ResolverExecutedTrigger as Tt, db as U, TailorDBInstance as V, TenantProvider as Vt, PermissionCondition as W, DefinedFieldMetadata as X, ArrayFieldOutput as Y, FieldMetadata as Z, GeneratorResult as _, AuthAccessTokenTrigger as _t, PluginExecutorContext as a, output as at, TailorDBNamespaceData as b, FunctionOperation as bt, PluginGeneratedExecutorWithFile as c, InferredAttributeList as ct, PluginNamespaceProcessContext as d, unauthenticatedTailorUser as dt, TailorFieldType as et, PluginOutput as f, AllowedValues as ft, ExecutorReadyContext as g, GeneratorConfig as gt, TypePluginOutput as h, ResolverInput as ht, PluginConfigs as i, JsonCompatible as it, OAuth2ClientGrantType as j, IDToken as jt, BeforeLoginHookArgs as k, AuthInvoker as kt, PluginGeneratedResolver as l, InferredAttributeMap as lt, TailorDBTypeForPlugin as m, Resolver as mt, Plugin as n, TailorField as nt, PluginExecutorContextBase as o, AttributeList as ot, PluginProcessContext as p, AllowedValuesOutput as pt, unsafeAllowAllGqlPermission as q, PluginAttachment as r, InferFieldsOutput as rt, PluginGeneratedExecutor as s, AttributeMap as st, NamespacePluginOutput as t, TailorAnyField as tt, PluginGeneratedType as u, TailorUser as ut, ResolverNamespaceData as v, Executor as vt, TypeSourceInfoEntry as w, RecordTrigger as wt, TailorDBReadyContext as x, GqlOperation as xt, ResolverReadyContext as y, ExecutorInput as yt, TailorAnyDBType as z, SCIMConfig as zt };
|
|
2023
|
+
//# sourceMappingURL=plugin-B1hNwcCC.d.mts.map
|