@tailor-platform/sdk 1.81.0 → 1.82.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/application-CP0W2sQo.mjs +3 -0
  3. package/dist/{application-DDe0er6L.mjs → application-CVeA53ok.mjs} +24 -8
  4. package/dist/application-CVeA53ok.mjs.map +1 -0
  5. package/dist/cli/index.mjs +9 -9
  6. package/dist/cli/lib.mjs +2 -2
  7. package/dist/cli/skills.mjs +1 -1
  8. package/dist/completion/zsh-worker.zsh +1 -1
  9. package/dist/configure/config/types.d.mts +3 -1
  10. package/dist/{crashreport-BNWUM6Kf.mjs → crashreport-DMYuHnBN.mjs} +2 -2
  11. package/dist/{crashreport-BNWUM6Kf.mjs.map → crashreport-DMYuHnBN.mjs.map} +1 -1
  12. package/dist/{crashreport-BafWvjjX.mjs → crashreport-ecqnz51B.mjs} +1 -1
  13. package/dist/{logger-BwS4ppwO.mjs → logger-CXQq9YIp.mjs} +110 -13
  14. package/dist/logger-CXQq9YIp.mjs.map +1 -0
  15. package/dist/{logger-B-fqZe2W.mjs → logger-t5ASCDZm.mjs} +6 -7
  16. package/dist/{logger-B-fqZe2W.mjs.map → logger-t5ASCDZm.mjs.map} +1 -1
  17. package/dist/{register-typescript-runtime-QAWucsg0.mjs → register-typescript-runtime-O7zQNif0.mjs} +7 -11
  18. package/dist/{register-typescript-runtime-QAWucsg0.mjs.map → register-typescript-runtime-O7zQNif0.mjs.map} +1 -1
  19. package/dist/runtime/index.mjs +1 -1
  20. package/dist/runtime/logger.mjs +1 -1
  21. package/dist/{service-CDPatibu.mjs → service-B0MaodSg.mjs} +2 -2
  22. package/dist/{service-CDPatibu.mjs.map → service-B0MaodSg.mjs.map} +1 -1
  23. package/dist/{service-Cp0I7ZFe.mjs → service-CIGSGg9I.mjs} +2 -2
  24. package/dist/{service-Cp0I7ZFe.mjs.map → service-CIGSGg9I.mjs.map} +1 -1
  25. package/dist/service-KnAiVofD.mjs +3 -0
  26. package/dist/vitest/mocks/file.d.mts +1 -1
  27. package/docs/configuration.md +3 -1
  28. package/package.json +2 -2
  29. package/dist/application-B1_7Wm37.mjs +0 -3
  30. package/dist/application-DDe0er6L.mjs.map +0 -1
  31. package/dist/logger-BwS4ppwO.mjs.map +0 -1
  32. package/dist/service-Cg7Qibit.mjs +0 -3
@@ -6,6 +6,6 @@ import { l as workflow_exports } from "../workflow-CkIDJpdg.mjs";
6
6
  import { t as context_exports } from "../context-Bd266-ru.mjs";
7
7
  import { a as file_exports } from "../file-_oUZo76X.mjs";
8
8
  import { t as aigateway_exports } from "../aigateway-B3oZZE6v.mjs";
9
- import { i as logger_exports } from "../logger-B-fqZe2W.mjs";
9
+ import { i as logger_exports } from "../logger-t5ASCDZm.mjs";
10
10
 
11
11
  export { aigateway_exports as aigateway, authconnection_exports as authconnection, context_exports as context, file_exports as file, iconv_exports as iconv, idp_exports as idp, logger_exports as logger, secretmanager_exports as secretmanager, workflow_exports as workflow };
@@ -1,3 +1,3 @@
1
- import { a as setAttributes, n as error, o as warn, r as info, t as debug } from "../logger-B-fqZe2W.mjs";
1
+ import { a as setAttributes, n as error, o as warn, r as info, t as debug } from "../logger-t5ASCDZm.mjs";
2
2
 
3
3
  export { debug, error, info, setAttributes, warn };
@@ -1,5 +1,5 @@
1
1
  import { n as isSdkBranded } from "./brand-Eo4pLXPJ.mjs";
2
- import { n as logger, r as styles } from "./logger-BwS4ppwO.mjs";
2
+ import { n as logger, r as styles } from "./logger-CXQq9YIp.mjs";
3
3
  import { z } from "zod";
4
4
  import * as fs from "node:fs";
5
5
  import * as path from "pathe";
@@ -487,4 +487,4 @@ function assertUniqueExecutorNames(executors) {
487
487
 
488
488
  //#endregion
489
489
  export { TailorFieldSchema as a, AuthInvokerSchema as i, ExecutorSchema as n, loadFilesWithIgnores as o, AuthConfigSchema as r, functionSchema as s, createExecutorService as t };
490
- //# sourceMappingURL=service-CDPatibu.mjs.map
490
+ //# sourceMappingURL=service-B0MaodSg.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"service-CDPatibu.mjs","names":[],"sources":["../src/parser/service/common.ts","../src/cli/services/file-loader.ts","../src/parser/service/auth-connection/schema.ts","../src/parser/service/field/schema.ts","../src/parser/service/auth/schema.ts","../src/parser/service/executor/schema.ts","../src/cli/services/executor/service.ts"],"sourcesContent":["import { z } from \"zod\";\n\n// Use `z.custom` instead of `z.function`, since `z.function` changes `toString` representation.\n// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\nexport const functionSchema = z.custom<Function>((val) => typeof val === \"function\");\n","import * as fs from \"node:fs\";\nimport * as path from \"pathe\";\nimport { logger } from \"#/cli/shared/logger\";\n\nexport interface FileLoadConfig {\n files: string[];\n ignores?: string[];\n}\n\nconst DEFAULT_IGNORE_PATTERNS = [\"**/*.test.ts\", \"**/*.spec.ts\"];\n\n// loadFilesWithIgnores is called once per service/bundler, so a single\n// generate/apply run can call it multiple times for the same baseDir (once\n// per resolver/executor/tailordb/etc. config sharing that directory). Track\n// which (baseDir, patterns) pairs have already warned so each one only warns\n// once per run — keyed by patterns too, since different services sharing a\n// baseDir can have different `files` patterns each needing their own warning.\nconst warnedFallbacks = new Set<string>();\n\n/**\n * Load files matching the given patterns, excluding files that match ignore patterns.\n * By default, test files (*.test.ts, *.spec.ts) are excluded unless ignores is explicitly specified.\n * @param config - Configuration with files patterns and optional ignores patterns\n * @param baseDir - Directory relative patterns are resolved against\n * @returns Array of absolute file paths\n */\nexport function loadFilesWithIgnores(config: FileLoadConfig, baseDir: string): string[] {\n if (config.files.length === 0) {\n return [];\n }\n\n const resolved = resolveFiles(config, baseDir);\n const allPatternsAbsolute = config.files.every((pattern) => path.isAbsolute(pattern));\n if (resolved.matchedAnyPattern || baseDir === process.cwd() || allPatternsAbsolute) {\n return resolved.files;\n }\n\n // v1 compatibility fallback: pre-existing configs may have relative\n // patterns written against the invocation cwd rather than baseDir. Only\n // triggers when baseDir's patterns matched nothing at all (not merely\n // \"matched, but every hit got filtered out by ignores\") — otherwise this\n // fallback would reintroduce the same cross-app file bleed this baseDir\n // resolution is meant to prevent. Also skipped when every pattern is\n // already absolute, since baseDir can't change an absolute pattern's\n // resolution — re-running against cwd would just repeat the same glob.\n // Remove this fallback in v2, once such configs are expected to have\n // migrated.\n const fallbackKey = `${baseDir}\\0${config.files.join(\"\\0\")}`;\n if (!warnedFallbacks.has(fallbackKey)) {\n warnedFallbacks.add(fallbackKey);\n logger.warn(\n `No files matched \"${config.files.join(\", \")}\" relative to \"${baseDir}\"; falling back to ` +\n `process.cwd(). Update this config's file patterns to be relative to its own directory ` +\n `before v2, when this fallback will be removed.`,\n );\n }\n return resolveFiles(config, process.cwd()).files;\n}\n\ninterface ResolvedFiles {\n files: string[];\n /** Whether any `files` pattern matched anything under baseDir, before ignore filtering. */\n matchedAnyPattern: boolean;\n}\n\nfunction resolveFiles(config: FileLoadConfig, baseDir: string): ResolvedFiles {\n // Use user-provided patterns if specified, otherwise use defaults. Default\n // patterns are left unanchored (\"**/*.test.ts\") so they match a test file\n // regardless of which directory a `files` pattern's matches actually came\n // from — this matters when a pattern is absolute or otherwise escapes\n // baseDir. User-provided patterns are baseDir-relative, matching `files`.\n const isDefaultIgnores = config.ignores === undefined;\n const ignorePatterns = config.ignores ?? DEFAULT_IGNORE_PATTERNS;\n const resolvedIgnorePatterns = isDefaultIgnores\n ? ignorePatterns\n : ignorePatterns.map((ignorePattern) => path.resolve(baseDir, ignorePattern));\n\n const files: string[] = [];\n let matchedAnyPattern = false;\n for (const pattern of config.files) {\n const absolutePattern = path.resolve(baseDir, pattern);\n try {\n const matchedFiles = fs.globSync(absolutePattern);\n if (matchedFiles.length > 0) {\n matchedAnyPattern = true;\n }\n // Filter out ignored files\n const filteredFiles = matchedFiles.filter(\n (file) =>\n !resolvedIgnorePatterns.some((ignorePattern) => path.matchesGlob(file, ignorePattern)),\n );\n files.push(...filteredFiles);\n } catch (error) {\n // A glob failure means we don't know whether baseDir has matching\n // files, not that it has none — treat it as a match so it can't\n // trigger the v1 compatibility fallback below.\n matchedAnyPattern = true;\n logger.warn(`Failed to glob pattern \"${pattern}\": ${String(error)}`);\n }\n }\n\n return { files, matchedAnyPattern };\n}\n","import { z } from \"zod\";\n\nexport const AuthConnectionOAuth2ConfigSchema = z.object({\n providerUrl: z.string().describe(\"OAuth2 provider URL\"),\n issuerUrl: z.string().describe(\"OAuth2 issuer URL\"),\n clientId: z.string().describe(\"OAuth2 client ID\"),\n clientSecret: z.string().describe(\"OAuth2 client secret\"),\n authUrl: z.string().optional().describe(\"OAuth2 authorization endpoint override\"),\n tokenUrl: z.string().optional().describe(\"OAuth2 token endpoint override\"),\n});\n\nexport const AuthConnectionConfigSchema = z\n .object({\n type: z.literal(\"oauth2\").describe(\"Connection type\"),\n })\n .and(AuthConnectionOAuth2ConfigSchema);\n","import { z } from \"zod\";\nimport { functionSchema } from \"../common\";\n\nconst TailorFieldTypeSchema = z.enum([\n \"uuid\",\n \"string\",\n \"boolean\",\n \"integer\",\n \"float\",\n \"decimal\",\n \"enum\",\n \"date\",\n \"datetime\",\n \"time\",\n \"nested\",\n]);\n\nconst AllowedValueSchema = z.object({\n value: z.string().describe(\"The allowed value\"),\n description: z.string().optional().describe(\"Description of the allowed value\"),\n});\n\nconst FieldMetadataSchema = z.object({\n required: z.boolean().optional().describe(\"Whether the field is required\"),\n array: z.boolean().optional().describe(\"Whether the field is an array\"),\n description: z.string().optional().describe(\"Field description\"),\n allowedValues: z.array(AllowedValueSchema).optional().describe(\"Allowed values for enum fields\"),\n hooks: z\n .object({\n create: functionSchema.optional().describe(\"Hook function called on creation\"),\n update: functionSchema.optional().describe(\"Hook function called on update\"),\n })\n .optional()\n .describe(\"Lifecycle hooks\"),\n typeName: z.string().optional().describe(\"Type name for nested or enum fields\"),\n});\n\nexport const TailorFieldSchema = z.object({\n type: TailorFieldTypeSchema.describe(\"Field data type\"),\n metadata: FieldMetadataSchema.describe(\"Field metadata configuration\"),\n get fields() {\n return z.record(z.string(), TailorFieldSchema);\n },\n});\n","import { z } from \"zod\";\nimport { AuthConnectionConfigSchema } from \"#/parser/service/auth-connection/index\";\nimport { TailorFieldSchema } from \"#/parser/service/field/schema\";\nimport type { ValueOperand } from \"#/configure/services/auth/types\";\n\nexport const AuthInvokerObjectSchema = z.object({\n namespace: z.string().describe(\"Auth namespace\"),\n machineUserName: z.string().describe(\"Machine user name for authentication\"),\n});\n\nexport const AuthInvokerSchema = z.union([\n z.string().describe(\"Machine user name (namespace auto-resolved from auth service)\"),\n AuthInvokerObjectSchema,\n]);\n\nconst secretValueSchema = z.object({\n vaultName: z.string().describe(\"Vault name containing the secret\"),\n secretKey: z.string().describe(\"Key of the secret in the vault\"),\n});\n\nexport const OIDCSchema = z.object({\n name: z.string().describe(\"Identity provider name\"),\n kind: z.literal(\"OIDC\"),\n clientID: z.string().describe(\"OAuth2 client ID\"),\n clientSecret: secretValueSchema.describe(\"OAuth2 client secret\"),\n providerURL: z.string().describe(\"OIDC provider URL\"),\n issuerURL: z.string().optional().describe(\"OIDC issuer URL (defaults to providerURL)\"),\n usernameClaim: z.string().optional().describe(\"JWT claim to use as username\"),\n});\n\nexport const SAMLSchema = z\n .object({\n name: z.string().describe(\"Identity provider name\"),\n kind: z.literal(\"SAML\"),\n enableSignRequest: z.boolean().default(false).describe(\"Enable signing of SAML requests\"),\n metadataURL: z\n .string()\n .optional()\n .describe(\"URL to fetch SAML metadata (mutually exclusive with rawMetadata)\"),\n rawMetadata: z\n .string()\n .optional()\n .describe(\"Raw SAML metadata XML (mutually exclusive with metadataURL)\"),\n defaultRedirectURL: z\n .string()\n .optional()\n .describe(\"URL to redirect to when SAML ACS receives a response with an empty RelayState.\"),\n })\n .refine((value) => {\n const hasMetadata = value.metadataURL !== undefined;\n const hasRaw = value.rawMetadata !== undefined;\n return hasMetadata !== hasRaw;\n }, \"Provide either metadataURL or rawMetadata\");\n\nexport const IDTokenSchema = z.object({\n name: z.string().describe(\"Identity provider name\"),\n kind: z.literal(\"IDToken\"),\n providerURL: z.string().describe(\"ID token provider URL\"),\n issuerURL: z.string().optional().describe(\"ID token issuer URL\"),\n clientID: z.string().describe(\"Client ID for ID token validation\"),\n usernameClaim: z.string().optional().describe(\"JWT claim to use as username\"),\n});\n\nexport const BuiltinIdPSchema = z.object({\n name: z.string().describe(\"Identity provider name\"),\n kind: z.literal(\"BuiltInIdP\"),\n namespace: z.string().describe(\"IdP namespace\"),\n clientName: z.string().describe(\"OAuth2 client name in the IdP\"),\n});\n\nexport const IdProviderSchema = z.discriminatedUnion(\"kind\", [\n OIDCSchema,\n SAMLSchema,\n IDTokenSchema,\n BuiltinIdPSchema,\n]);\n\nexport const OAuth2ClientGrantTypeSchema = z\n .union([z.literal(\"authorization_code\"), z.literal(\"refresh_token\")])\n .describe(\"OAuth2 grant type\");\n\nexport const OAuth2ClientSchema = z\n .object({\n description: z.string().optional().describe(\"Client description\"),\n grantTypes: z\n .array(OAuth2ClientGrantTypeSchema)\n .default([\"authorization_code\", \"refresh_token\"])\n .describe(\"Allowed OAuth2 grant types\"),\n redirectURIs: z\n .array(\n z.union([\n z.templateLiteral([\"https://\", z.string()]),\n z.templateLiteral([\"http://\", z.string()]),\n z.templateLiteral([z.string(), \":url\"]),\n z.templateLiteral([z.string(), \":url/\", z.string()]),\n ]),\n )\n .describe(\"Allowed redirect URIs\"),\n clientType: z\n .union([z.literal(\"confidential\"), z.literal(\"public\"), z.literal(\"browser\")])\n .optional()\n .describe(\"OAuth2 client type\"),\n accessTokenLifetimeSeconds: z\n .number()\n .int()\n .min(60, \"Minimum access token lifetime is 60 seconds\")\n .max(86400, \"Maximum access token lifetime is 1 day (86400 seconds)\")\n .optional()\n .describe(\"Access token lifetime in seconds (60-86400)\")\n .transform((val) => (val ? { seconds: BigInt(val), nanos: 0 } : undefined)),\n refreshTokenLifetimeSeconds: z\n .number()\n .int()\n .min(60, \"Minimum refresh token lifetime is 60 seconds\")\n .max(604800, \"Maximum refresh token lifetime is 7 days (604800 seconds)\")\n .optional()\n .describe(\"Refresh token lifetime in seconds (60-604800)\")\n .transform((val) => (val ? { seconds: BigInt(val), nanos: 0 } : undefined)),\n requireDpop: z\n .boolean()\n .optional()\n .describe(\"Require DPoP (Demonstrating Proof-of-Possession) for token requests\"),\n })\n .refine((data) => !(data.clientType === \"browser\" && data.requireDpop === true), {\n message: \"requireDpop cannot be set to true for browser clients as they don't support DPoP\",\n path: [\"requireDpop\"],\n });\n\nexport const SCIMAuthorizationSchema = z.object({\n type: z.union([z.literal(\"oauth2\"), z.literal(\"bearer\")]).describe(\"SCIM authorization type\"),\n bearerSecret: secretValueSchema\n .optional()\n .describe(\"Bearer token secret (required for bearer type)\"),\n});\n\nexport const SCIMAttributeTypeSchema = z\n .union([\n z.literal(\"string\"),\n z.literal(\"number\"),\n z.literal(\"boolean\"),\n z.literal(\"datetime\"),\n z.literal(\"complex\"),\n ])\n .describe(\"SCIM attribute data type\");\n\nexport const SCIMAttributeSchema = z.object({\n type: SCIMAttributeTypeSchema.describe(\"Attribute data type\"),\n name: z.string().describe(\"Attribute name\"),\n description: z.string().optional().describe(\"Attribute description\"),\n mutability: z\n .union([z.literal(\"readOnly\"), z.literal(\"readWrite\"), z.literal(\"writeOnly\")])\n .optional()\n .describe(\"Attribute mutability\"),\n required: z.boolean().optional().describe(\"Whether the attribute is required\"),\n multiValued: z.boolean().optional().describe(\"Whether the attribute can have multiple values\"),\n uniqueness: z\n .union([z.literal(\"none\"), z.literal(\"server\"), z.literal(\"global\")])\n .optional()\n .describe(\"Uniqueness constraint\"),\n canonicalValues: z.array(z.string()).nullable().optional().describe(\"List of canonical values\"),\n get subAttributes() {\n return z.array(SCIMAttributeSchema).nullable().optional();\n },\n});\n\nconst SCIMSchemaSchema = z.object({\n name: z.string().describe(\"SCIM schema name\"),\n attributes: z.array(SCIMAttributeSchema).describe(\"Schema attributes\"),\n});\n\nexport const SCIMAttributeMappingSchema = z.object({\n tailorDBField: z.string().describe(\"TailorDB field name to map to\"),\n scimPath: z.string().describe(\"SCIM attribute path\"),\n});\n\nexport const SCIMResourceSchema = z.object({\n name: z.string().describe(\"SCIM resource name\"),\n tailorDBNamespace: z.string().describe(\"TailorDB namespace for the resource\"),\n tailorDBType: z.string().describe(\"TailorDB type name for the resource\"),\n coreSchema: SCIMSchemaSchema.describe(\"Core SCIM schema definition\"),\n attributeMapping: z.array(SCIMAttributeMappingSchema).describe(\"Attribute mapping configuration\"),\n});\n\nexport const SCIMSchema = z.object({\n machineUserName: z.string().describe(\"Machine user name for SCIM operations\"),\n authorization: SCIMAuthorizationSchema.describe(\"SCIM authorization configuration\"),\n resources: z.array(SCIMResourceSchema).describe(\"SCIM resource definitions\"),\n});\n\nexport const TenantProviderSchema = z.object({\n namespace: z.string().describe(\"TailorDB namespace for the tenant type\"),\n type: z.string().describe(\"TailorDB type name for tenants\"),\n signatureField: z.string().describe(\"Field used as the tenant signature\"),\n});\n\nconst UserProfileSchema = z.object({\n namespace: z.string().optional().describe(\"TailorDB namespace where the user type is defined\"),\n // FIXME: improve TailorDBInstance schema validation\n type: z.object({\n name: z.string(),\n fields: z.any(),\n metadata: z.any(),\n hooks: z.any(),\n validate: z.any(),\n features: z.any(),\n indexes: z.any(),\n files: z.any(),\n permission: z.any(),\n gqlPermission: z.any(),\n _output: z.any(),\n }),\n usernameField: z.string(),\n attributes: z.record(z.string(), z.literal(true)).optional(),\n attributeList: z.array(z.string()).optional(),\n});\n\nconst ValueOperandSchema: z.ZodType<ValueOperand> = z.union([\n z.string(),\n z.boolean(),\n z.array(z.string()),\n z.array(z.boolean()),\n]);\n\nconst MachineUserSchema = z.object({\n // null/undefined values mean \"attribute not set\" and are dropped so\n // downstream (deploy, drift diff) only ever sees concrete values.\n attributes: z\n .record(z.string(), ValueOperandSchema.nullish())\n .transform(\n (attributes): Record<string, ValueOperand> =>\n Object.fromEntries(\n Object.entries(attributes).filter(\n (entry): entry is [string, ValueOperand] => entry[1] != null,\n ),\n ),\n )\n .optional(),\n attributeList: z.array(z.uuid()).optional(),\n});\n\nconst BeforeLoginHookSchema = z.object({\n handler: z.function(),\n invoker: z.string(),\n});\n\nconst AuthConfigBaseSchema = z.object({\n name: z.string().describe(\"Auth service name\"),\n hooks: z\n .object({\n beforeLogin: BeforeLoginHookSchema.optional().describe(\"Before login auth hook\"),\n })\n .optional()\n .describe(\"Auth hooks\"),\n machineUsers: z\n .record(z.string(), MachineUserSchema)\n .optional()\n .describe(\"Machine user definitions\"),\n oauth2Clients: z\n .record(z.string(), OAuth2ClientSchema)\n .optional()\n .describe(\"OAuth2 client definitions\"),\n idProvider: IdProviderSchema.optional().describe(\"Identity provider configuration\"),\n scim: SCIMSchema.optional().describe(\"SCIM provisioning configuration\"),\n tenantProvider: TenantProviderSchema.optional().describe(\"Multi-tenant provider configuration\"),\n connections: z\n .record(z.string(), AuthConnectionConfigSchema)\n .optional()\n .describe(\"Auth connection definitions for external OAuth2 providers\"),\n publishSessionEvents: z.boolean().optional().describe(\"Enable publishing session events\"),\n});\n\nexport const AuthConfigSchema = z\n .xor(\n [\n AuthConfigBaseSchema.extend({\n userProfile: UserProfileSchema.optional().describe(\"User profile configuration\"),\n machineUserAttributes: z.undefined().optional(),\n }),\n AuthConfigBaseSchema.extend({\n userProfile: z.undefined().optional(),\n machineUserAttributes: z\n .record(z.string(), TailorFieldSchema)\n .describe(\"Machine user attribute fields\"),\n }),\n ],\n {\n error: (iss) => {\n // zod may report error codes not covered by its type definitions\n // oxlint-disable-next-line typescript/no-unnecessary-condition\n if (iss.code !== \"invalid_union\") return undefined;\n // zod may report error codes not covered by its type definitions\n // oxlint-disable-next-line typescript/no-unnecessary-condition\n if (iss.errors.length < 2) return undefined;\n const isOnlyMutexViolation = iss.errors.every((variantErrors) =>\n variantErrors.every(\n (e) =>\n e.path.length === 1 &&\n (e.path[0] === \"userProfile\" || e.path[0] === \"machineUserAttributes\"),\n ),\n );\n if (isOnlyMutexViolation) {\n return \"Specify either `userProfile` or `machineUserAttributes`, not both.\";\n }\n return undefined;\n },\n },\n )\n .brand(\"AuthConfig\");\n","import { z } from \"zod\";\nimport { AuthInvokerSchema } from \"../auth\";\nimport { functionSchema } from \"../common\";\n\nexport const TailorDBTriggerSchema = z.object({\n kind: z.literal(\"tailordb\").describe(\"TailorDB record event trigger\"),\n events: z\n .array(\n z.enum([\n \"tailordb.type_record.created\",\n \"tailordb.type_record.updated\",\n \"tailordb.type_record.deleted\",\n ]),\n )\n .min(1)\n .transform((arr) => [...new Set(arr)])\n .describe(\"TailorDB event types to trigger on\"),\n typeName: z.string().describe(\"TailorDB type name to watch for events\"),\n condition: functionSchema.optional().describe(\"Condition function to filter events\"),\n});\n\nexport const ResolverExecutedTriggerSchema = z.object({\n kind: z.literal(\"resolverExecuted\"),\n resolverName: z.string().describe(\"Name of the resolver to trigger on\"),\n condition: functionSchema.optional().describe(\"Condition function to filter events\"),\n});\n\nexport const ScheduleTriggerSchema = z.object({\n kind: z.literal(\"schedule\"),\n cron: z.string().describe(\"CRON expression for the schedule\"),\n timezone: z\n .string()\n .optional()\n .default(\"UTC\")\n .describe(\"Timezone for the CRON schedule (default: UTC)\"),\n});\n\nexport const IncomingWebhookTriggerResponseSchema = z.object({\n body: functionSchema.optional().describe(\"Function returning the response body\"),\n statusCode: z.number().int().optional().describe(\"HTTP status code for the response\"),\n});\n\nexport const IncomingWebhookTriggerSchema = z.object({\n kind: z.literal(\"incomingWebhook\"),\n response: IncomingWebhookTriggerResponseSchema.optional().describe(\"Response configuration\"),\n});\n\nexport const IdpUserTriggerSchema = z.object({\n kind: z.literal(\"idpUser\").describe(\"IdP user event trigger\"),\n events: z\n .array(z.enum([\"idp.user.created\", \"idp.user.updated\", \"idp.user.deleted\"]))\n .min(1)\n .transform((arr) => [...new Set(arr)])\n .describe(\"IdP user event types to trigger on\"),\n idp: z\n .string()\n .optional()\n .describe(\n \"IdP namespace name to subscribe to. If omitted, the project's only IdP is used; throws when multiple IdPs exist.\",\n ),\n});\n\nexport const AuthAccessTokenTriggerSchema = z.object({\n kind: z.literal(\"authAccessToken\").describe(\"Auth access token event trigger\"),\n events: z\n .array(\n z.enum([\n \"auth.access_token.issued\",\n \"auth.access_token.refreshed\",\n \"auth.access_token.revoked\",\n ]),\n )\n .min(1)\n .transform((arr) => [...new Set(arr)])\n .describe(\"Auth access token event types to trigger on\"),\n});\n\nexport const TriggerSchema = z.discriminatedUnion(\"kind\", [\n TailorDBTriggerSchema,\n ResolverExecutedTriggerSchema,\n ScheduleTriggerSchema,\n IncomingWebhookTriggerSchema,\n IdpUserTriggerSchema,\n AuthAccessTokenTriggerSchema,\n]);\n\nexport const FunctionOperationSchema = z.object({\n kind: z.enum([\"function\", \"jobFunction\"]),\n body: functionSchema.describe(\"Function implementation\"),\n authInvoker: AuthInvokerSchema.optional().describe(\"Auth invoker for the function execution\"),\n});\n\nexport const GqlOperationSchema = z.object({\n kind: z.literal(\"graphql\"),\n appName: z.string().optional().describe(\"Target application name for the GraphQL query\"),\n query: z.preprocess((val) => String(val), z.string().describe(\"GraphQL query string\")),\n variables: functionSchema.optional().describe(\"Function to compute GraphQL variables\"),\n authInvoker: AuthInvokerSchema.optional().describe(\"Auth invoker for the GraphQL execution\"),\n});\n\nexport const WebhookOperationSchema = z.object({\n kind: z.literal(\"webhook\"),\n url: functionSchema.describe(\"Function returning the webhook URL\"),\n requestBody: functionSchema.optional().describe(\"Function to compute the request body\"),\n headers: z\n .record(z.string(), z.union([z.string(), z.object({ vault: z.string(), key: z.string() })]))\n .optional()\n .describe(\"HTTP headers for the webhook request\"),\n});\n\nexport const WorkflowOperationSchema = z.preprocess(\n (val) => {\n if (\n val == null ||\n typeof val !== \"object\" ||\n !(\"workflow\" in val) ||\n typeof val.workflow !== \"object\" ||\n val.workflow === null\n ) {\n return val;\n }\n\n const { workflow, ...rest } = val as { workflow: { name: string } };\n return { ...rest, workflowName: workflow.name };\n },\n z.object({\n kind: z.literal(\"workflow\"),\n workflowName: z.string().describe(\"Name of the workflow to execute\"),\n args: z\n .union([z.record(z.string(), z.unknown()), functionSchema])\n .optional()\n .describe(\"Arguments to pass to the workflow\"),\n authInvoker: AuthInvokerSchema.optional().describe(\"Auth invoker for the workflow execution\"),\n }),\n);\n\nconst OperationSchema = z.union([\n FunctionOperationSchema,\n GqlOperationSchema,\n WebhookOperationSchema,\n WorkflowOperationSchema,\n]);\n\nexport const ExecutorSchema = z.object({\n name: z.string().describe(\"Executor name\"),\n description: z.string().optional().describe(\"Executor description\"),\n disabled: z.boolean().optional().default(false).describe(\"Whether the executor is disabled\"),\n trigger: TriggerSchema.describe(\"Event trigger configuration\"),\n operation: OperationSchema.describe(\"Operation to execute when triggered\"),\n});\n","import { pathToFileURL } from \"node:url\";\nimport * as path from \"pathe\";\nimport { loadFilesWithIgnores } from \"#/cli/services/file-loader\";\nimport { logger, styles } from \"#/cli/shared/logger\";\nimport { ExecutorSchema } from \"#/parser/service/executor/index\";\nimport { isSdkBranded } from \"#/utils/brand\";\nimport type { ExecutorServiceConfig } from \"#/configure/config/types\";\nimport type { Executor } from \"#/types/executor.generated\";\n\n/**\n * Information about a plugin-generated executor converted to Executor format\n */\nexport interface PluginExecutor {\n /** The executor in standard Executor format */\n executor: Executor;\n /** Plugin ID that generated this executor */\n pluginId: string;\n /** Source type name (for type-attached executors) */\n sourceTypeName?: string;\n}\n\nexport type ExecutorService = {\n readonly config: ExecutorServiceConfig;\n readonly executors: Record<string, Executor>;\n readonly pluginExecutors: ReadonlyArray<PluginExecutor>;\n loadExecutors: () => Promise<Record<string, Executor> | undefined>;\n loadPluginExecutorFiles: (filePaths: string[]) => Promise<void>;\n};\n\n/**\n * Parameters for creating an ExecutorService\n */\nexport interface CreateExecutorServiceParams {\n /** The executor service configuration */\n config: ExecutorServiceConfig;\n /** Directory the config's file patterns are resolved against */\n baseDir: string;\n}\n\n/**\n * Creates a new ExecutorService instance.\n * @param params - Parameters for creating the service\n * @returns A new ExecutorService instance\n */\nexport function createExecutorService(params: CreateExecutorServiceParams): ExecutorService {\n const { config, baseDir } = params;\n const executors: Record<string, Executor> = {};\n const pluginExecutors: PluginExecutor[] = [];\n let loadPromise: Promise<Record<string, Executor> | undefined> | undefined;\n\n const loadExecutorForFile = async (executorFile: string): Promise<Executor | undefined> => {\n try {\n const executorModule = await import(pathToFileURL(executorFile).href);\n const result = ExecutorSchema.safeParse(executorModule.default);\n if (result.success) {\n const relativePath = path.relative(process.cwd(), executorFile);\n logger.log(\n `Executor: ${styles.successBright(`\"${result.data.name}\"`)} loaded from ${styles.path(relativePath)}`,\n );\n executors[executorFile] = result.data;\n return result.data;\n }\n if (isSdkBranded(executorModule.default, \"executor\")) {\n throw result.error;\n }\n } catch (error) {\n const relativePath = path.relative(process.cwd(), executorFile);\n logger.error(`Failed to load executor from ${styles.bold(relativePath)}`);\n logger.error(String(error));\n throw error;\n }\n return undefined;\n };\n\n return {\n config,\n get executors() {\n return executors;\n },\n get pluginExecutors() {\n return pluginExecutors;\n },\n loadExecutors: async () => {\n if (!loadPromise) {\n loadPromise = (async () => {\n if (config.files.length === 0) {\n return undefined;\n }\n\n const executorFiles = loadFilesWithIgnores(config, baseDir);\n\n logger.newline();\n logger.log(`Found ${styles.highlight(executorFiles.length.toString())} executor files`);\n\n await Promise.all(executorFiles.map((executorFile) => loadExecutorForFile(executorFile)));\n assertUniqueExecutorNames(executors);\n return executors;\n })();\n }\n return loadPromise;\n },\n loadPluginExecutorFiles: async (filePaths: string[]) => {\n if (filePaths.length === 0) return;\n\n logger.newline();\n logger.log(\n `Loading ${styles.highlight(filePaths.length.toString())} plugin-generated executor files`,\n );\n\n for (const filePath of filePaths) {\n const executor = await loadExecutorForFile(filePath);\n if (executor) {\n // Track as plugin executor (plugin ID is extracted from file path)\n // File path format: .tailor-sdk/plugin/{executor-name}.ts\n pluginExecutors.push({\n executor,\n pluginId: \"plugin-generated\",\n sourceTypeName: undefined,\n });\n }\n }\n assertUniqueExecutorNames(executors);\n },\n };\n}\n\n/**\n * Assert that every loaded executor has a unique name.\n * Executors are stored by source file, so two files declaring the same\n * `name` would otherwise silently share a single bundle cache entry.\n * @param executors - Loaded executors keyed by source file\n */\nfunction assertUniqueExecutorNames(executors: Record<string, Executor>): void {\n const seenNames = new Map<string, string>();\n for (const [file, executor] of Object.entries(executors)) {\n const relativePath = path.relative(process.cwd(), file);\n const existing = seenNames.get(executor.name);\n if (existing) {\n throw new Error(\n `Duplicate executor name \"${executor.name}\" found:\\n` +\n ` - ${existing}\\n` +\n ` - ${relativePath}\\n` +\n `Each executor must have a unique name.`,\n );\n }\n seenNames.set(executor.name, relativePath);\n }\n}\n"],"mappings":";;;;;;;;AAIA,MAAa,iBAAiB,EAAE,QAAkB,QAAQ,OAAO,QAAQ,UAAU;;;;ACKnF,MAAM,0BAA0B,CAAC,gBAAgB,cAAc;AAQ/D,MAAM,kCAAkB,IAAI,IAAY;;;;;;;;AASxC,SAAgB,qBAAqB,QAAwB,SAA2B;CACtF,IAAI,OAAO,MAAM,WAAW,GAC1B,OAAO,CAAC;CAGV,MAAM,WAAW,aAAa,QAAQ,OAAO;CAC7C,MAAM,sBAAsB,OAAO,MAAM,OAAO,YAAY,KAAK,WAAW,OAAO,CAAC;CACpF,IAAI,SAAS,qBAAqB,YAAY,QAAQ,IAAI,KAAK,qBAC7D,OAAO,SAAS;CAalB,MAAM,cAAc,GAAG,QAAQ,IAAI,OAAO,MAAM,KAAK,IAAI;CACzD,IAAI,CAAC,gBAAgB,IAAI,WAAW,GAAG;EACrC,gBAAgB,IAAI,WAAW;EAC/B,OAAO,KACL,qBAAqB,OAAO,MAAM,KAAK,IAAI,EAAE,iBAAiB,QAAQ,wJAGxE;CACF;CACA,OAAO,aAAa,QAAQ,QAAQ,IAAI,CAAC,CAAC,CAAC;AAC7C;AAQA,SAAS,aAAa,QAAwB,SAAgC;CAM5E,MAAM,mBAAmB,OAAO,YAAY;CAC5C,MAAM,iBAAiB,OAAO,WAAW;CACzC,MAAM,yBAAyB,mBAC3B,iBACA,eAAe,KAAK,kBAAkB,K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AI,OAAO,MAAM,WAAW,GAC1B;IAGF,MAAM,gBAAgB,qBAAqB,QAAQ,OAAO;IAE1D,OAAO,QAAQ;IACf,OAAO,IAAI,SAAS,OAAO,UAAU,cAAc,OAAO,SAAS,CAAC,EAAE,gBAAgB;IAEtF,MAAM,QAAQ,IAAI,cAAc,KAAK,iBAAiB,oBAAoB,YAAY,CAAC,CAAC;IACxF,0BAA0B,SAAS;IACnC,OAAO;GACT,EAAC,CAAE;GAEL,OAAO;EACT;EACA,yBAAyB,OAAO,cAAwB;GACtD,IAAI,UAAU,WAAW,GAAG;GAE5B,OAAO,QAAQ;GACf,OAAO,IACL,WAAW,OAAO,UAAU,UAAU,OAAO,SAAS,CAAC,EAAE,iCAC3D;GAEA,KAAK,MAAM,YAAY,WAAW;IAChC,MAAM,WAAW,MAAM,oBAAoB,QAAQ;IACnD,IAAI,UAGF,gBAAgB,KAAK;KACnB;KACA,UAAU;KACV,gBAAgB;IAClB,CAAC;GAEL;GACA,0BAA0B,SAAS;EACrC;CACF;AACF;;;;;;;AAQA,SAAS,0BAA0B,WAA2C;CAC5E,MAAM,4BAAY,IAAI,IAAoB;CAC1C,KAAK,MAAM,CAAC,MAAM,aAAa,OAAO,QAAQ,SAAS,GAAG;EACxD,MAAM,eAAe,KAAK,SAAS,QAAQ,IAAI,GAAG,IAAI;EACtD,MAAM,WAAW,UAAU,IAAI,SAAS,IAAI;EAC5C,IAAI,UACF,MAAM,IAAI,MACR,4BAA4B,SAAS,KAAK,gBACjC,SAAS,QACT,aAAa,yCAExB;EAEF,UAAU,IAAI,SAAS,MAAM,YAAY;CAC3C;AACF"}
1
+ {"version":3,"file":"service-B0MaodSg.mjs","names":[],"sources":["../src/parser/service/common.ts","../src/cli/services/file-loader.ts","../src/parser/service/auth-connection/schema.ts","../src/parser/service/field/schema.ts","../src/parser/service/auth/schema.ts","../src/parser/service/executor/schema.ts","../src/cli/services/executor/service.ts"],"sourcesContent":["import { z } from \"zod\";\n\n// Use `z.custom` instead of `z.function`, since `z.function` changes `toString` representation.\n// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\nexport const functionSchema = z.custom<Function>((val) => typeof val === \"function\");\n","import * as fs from \"node:fs\";\nimport * as path from \"pathe\";\nimport { logger } from \"#/cli/shared/logger\";\n\nexport interface FileLoadConfig {\n files: string[];\n ignores?: string[];\n}\n\nconst DEFAULT_IGNORE_PATTERNS = [\"**/*.test.ts\", \"**/*.spec.ts\"];\n\n// loadFilesWithIgnores is called once per service/bundler, so a single\n// generate/apply run can call it multiple times for the same baseDir (once\n// per resolver/executor/tailordb/etc. config sharing that directory). Track\n// which (baseDir, patterns) pairs have already warned so each one only warns\n// once per run — keyed by patterns too, since different services sharing a\n// baseDir can have different `files` patterns each needing their own warning.\nconst warnedFallbacks = new Set<string>();\n\n/**\n * Load files matching the given patterns, excluding files that match ignore patterns.\n * By default, test files (*.test.ts, *.spec.ts) are excluded unless ignores is explicitly specified.\n * @param config - Configuration with files patterns and optional ignores patterns\n * @param baseDir - Directory relative patterns are resolved against\n * @returns Array of absolute file paths\n */\nexport function loadFilesWithIgnores(config: FileLoadConfig, baseDir: string): string[] {\n if (config.files.length === 0) {\n return [];\n }\n\n const resolved = resolveFiles(config, baseDir);\n const allPatternsAbsolute = config.files.every((pattern) => path.isAbsolute(pattern));\n if (resolved.matchedAnyPattern || baseDir === process.cwd() || allPatternsAbsolute) {\n return resolved.files;\n }\n\n // v1 compatibility fallback: pre-existing configs may have relative\n // patterns written against the invocation cwd rather than baseDir. Only\n // triggers when baseDir's patterns matched nothing at all (not merely\n // \"matched, but every hit got filtered out by ignores\") — otherwise this\n // fallback would reintroduce the same cross-app file bleed this baseDir\n // resolution is meant to prevent. Also skipped when every pattern is\n // already absolute, since baseDir can't change an absolute pattern's\n // resolution — re-running against cwd would just repeat the same glob.\n // Remove this fallback in v2, once such configs are expected to have\n // migrated.\n const fallbackKey = `${baseDir}\\0${config.files.join(\"\\0\")}`;\n if (!warnedFallbacks.has(fallbackKey)) {\n warnedFallbacks.add(fallbackKey);\n logger.warn(\n `No files matched \"${config.files.join(\", \")}\" relative to \"${baseDir}\"; falling back to ` +\n `process.cwd(). Update this config's file patterns to be relative to its own directory ` +\n `before v2, when this fallback will be removed.`,\n );\n }\n return resolveFiles(config, process.cwd()).files;\n}\n\ninterface ResolvedFiles {\n files: string[];\n /** Whether any `files` pattern matched anything under baseDir, before ignore filtering. */\n matchedAnyPattern: boolean;\n}\n\nfunction resolveFiles(config: FileLoadConfig, baseDir: string): ResolvedFiles {\n // Use user-provided patterns if specified, otherwise use defaults. Default\n // patterns are left unanchored (\"**/*.test.ts\") so they match a test file\n // regardless of which directory a `files` pattern's matches actually came\n // from — this matters when a pattern is absolute or otherwise escapes\n // baseDir. User-provided patterns are baseDir-relative, matching `files`.\n const isDefaultIgnores = config.ignores === undefined;\n const ignorePatterns = config.ignores ?? DEFAULT_IGNORE_PATTERNS;\n const resolvedIgnorePatterns = isDefaultIgnores\n ? ignorePatterns\n : ignorePatterns.map((ignorePattern) => path.resolve(baseDir, ignorePattern));\n\n const files: string[] = [];\n let matchedAnyPattern = false;\n for (const pattern of config.files) {\n const absolutePattern = path.resolve(baseDir, pattern);\n try {\n const matchedFiles = fs.globSync(absolutePattern);\n if (matchedFiles.length > 0) {\n matchedAnyPattern = true;\n }\n // Filter out ignored files\n const filteredFiles = matchedFiles.filter(\n (file) =>\n !resolvedIgnorePatterns.some((ignorePattern) => path.matchesGlob(file, ignorePattern)),\n );\n files.push(...filteredFiles);\n } catch (error) {\n // A glob failure means we don't know whether baseDir has matching\n // files, not that it has none — treat it as a match so it can't\n // trigger the v1 compatibility fallback below.\n matchedAnyPattern = true;\n logger.warn(`Failed to glob pattern \"${pattern}\": ${String(error)}`);\n }\n }\n\n return { files, matchedAnyPattern };\n}\n","import { z } from \"zod\";\n\nexport const AuthConnectionOAuth2ConfigSchema = z.object({\n providerUrl: z.string().describe(\"OAuth2 provider URL\"),\n issuerUrl: z.string().describe(\"OAuth2 issuer URL\"),\n clientId: z.string().describe(\"OAuth2 client ID\"),\n clientSecret: z.string().describe(\"OAuth2 client secret\"),\n authUrl: z.string().optional().describe(\"OAuth2 authorization endpoint override\"),\n tokenUrl: z.string().optional().describe(\"OAuth2 token endpoint override\"),\n});\n\nexport const AuthConnectionConfigSchema = z\n .object({\n type: z.literal(\"oauth2\").describe(\"Connection type\"),\n })\n .and(AuthConnectionOAuth2ConfigSchema);\n","import { z } from \"zod\";\nimport { functionSchema } from \"../common\";\n\nconst TailorFieldTypeSchema = z.enum([\n \"uuid\",\n \"string\",\n \"boolean\",\n \"integer\",\n \"float\",\n \"decimal\",\n \"enum\",\n \"date\",\n \"datetime\",\n \"time\",\n \"nested\",\n]);\n\nconst AllowedValueSchema = z.object({\n value: z.string().describe(\"The allowed value\"),\n description: z.string().optional().describe(\"Description of the allowed value\"),\n});\n\nconst FieldMetadataSchema = z.object({\n required: z.boolean().optional().describe(\"Whether the field is required\"),\n array: z.boolean().optional().describe(\"Whether the field is an array\"),\n description: z.string().optional().describe(\"Field description\"),\n allowedValues: z.array(AllowedValueSchema).optional().describe(\"Allowed values for enum fields\"),\n hooks: z\n .object({\n create: functionSchema.optional().describe(\"Hook function called on creation\"),\n update: functionSchema.optional().describe(\"Hook function called on update\"),\n })\n .optional()\n .describe(\"Lifecycle hooks\"),\n typeName: z.string().optional().describe(\"Type name for nested or enum fields\"),\n});\n\nexport const TailorFieldSchema = z.object({\n type: TailorFieldTypeSchema.describe(\"Field data type\"),\n metadata: FieldMetadataSchema.describe(\"Field metadata configuration\"),\n get fields() {\n return z.record(z.string(), TailorFieldSchema);\n },\n});\n","import { z } from \"zod\";\nimport { AuthConnectionConfigSchema } from \"#/parser/service/auth-connection/index\";\nimport { TailorFieldSchema } from \"#/parser/service/field/schema\";\nimport type { ValueOperand } from \"#/configure/services/auth/types\";\n\nexport const AuthInvokerObjectSchema = z.object({\n namespace: z.string().describe(\"Auth namespace\"),\n machineUserName: z.string().describe(\"Machine user name for authentication\"),\n});\n\nexport const AuthInvokerSchema = z.union([\n z.string().describe(\"Machine user name (namespace auto-resolved from auth service)\"),\n AuthInvokerObjectSchema,\n]);\n\nconst secretValueSchema = z.object({\n vaultName: z.string().describe(\"Vault name containing the secret\"),\n secretKey: z.string().describe(\"Key of the secret in the vault\"),\n});\n\nexport const OIDCSchema = z.object({\n name: z.string().describe(\"Identity provider name\"),\n kind: z.literal(\"OIDC\"),\n clientID: z.string().describe(\"OAuth2 client ID\"),\n clientSecret: secretValueSchema.describe(\"OAuth2 client secret\"),\n providerURL: z.string().describe(\"OIDC provider URL\"),\n issuerURL: z.string().optional().describe(\"OIDC issuer URL (defaults to providerURL)\"),\n usernameClaim: z.string().optional().describe(\"JWT claim to use as username\"),\n});\n\nexport const SAMLSchema = z\n .object({\n name: z.string().describe(\"Identity provider name\"),\n kind: z.literal(\"SAML\"),\n enableSignRequest: z.boolean().default(false).describe(\"Enable signing of SAML requests\"),\n metadataURL: z\n .string()\n .optional()\n .describe(\"URL to fetch SAML metadata (mutually exclusive with rawMetadata)\"),\n rawMetadata: z\n .string()\n .optional()\n .describe(\"Raw SAML metadata XML (mutually exclusive with metadataURL)\"),\n defaultRedirectURL: z\n .string()\n .optional()\n .describe(\"URL to redirect to when SAML ACS receives a response with an empty RelayState.\"),\n })\n .refine((value) => {\n const hasMetadata = value.metadataURL !== undefined;\n const hasRaw = value.rawMetadata !== undefined;\n return hasMetadata !== hasRaw;\n }, \"Provide either metadataURL or rawMetadata\");\n\nexport const IDTokenSchema = z.object({\n name: z.string().describe(\"Identity provider name\"),\n kind: z.literal(\"IDToken\"),\n providerURL: z.string().describe(\"ID token provider URL\"),\n issuerURL: z.string().optional().describe(\"ID token issuer URL\"),\n clientID: z.string().describe(\"Client ID for ID token validation\"),\n usernameClaim: z.string().optional().describe(\"JWT claim to use as username\"),\n});\n\nexport const BuiltinIdPSchema = z.object({\n name: z.string().describe(\"Identity provider name\"),\n kind: z.literal(\"BuiltInIdP\"),\n namespace: z.string().describe(\"IdP namespace\"),\n clientName: z.string().describe(\"OAuth2 client name in the IdP\"),\n});\n\nexport const IdProviderSchema = z.discriminatedUnion(\"kind\", [\n OIDCSchema,\n SAMLSchema,\n IDTokenSchema,\n BuiltinIdPSchema,\n]);\n\nexport const OAuth2ClientGrantTypeSchema = z\n .union([z.literal(\"authorization_code\"), z.literal(\"refresh_token\")])\n .describe(\"OAuth2 grant type\");\n\nexport const OAuth2ClientSchema = z\n .object({\n description: z.string().optional().describe(\"Client description\"),\n grantTypes: z\n .array(OAuth2ClientGrantTypeSchema)\n .default([\"authorization_code\", \"refresh_token\"])\n .describe(\"Allowed OAuth2 grant types\"),\n redirectURIs: z\n .array(\n z.union([\n z.templateLiteral([\"https://\", z.string()]),\n z.templateLiteral([\"http://\", z.string()]),\n z.templateLiteral([z.string(), \":url\"]),\n z.templateLiteral([z.string(), \":url/\", z.string()]),\n ]),\n )\n .describe(\"Allowed redirect URIs\"),\n clientType: z\n .union([z.literal(\"confidential\"), z.literal(\"public\"), z.literal(\"browser\")])\n .optional()\n .describe(\"OAuth2 client type\"),\n accessTokenLifetimeSeconds: z\n .number()\n .int()\n .min(60, \"Minimum access token lifetime is 60 seconds\")\n .max(86400, \"Maximum access token lifetime is 1 day (86400 seconds)\")\n .optional()\n .describe(\"Access token lifetime in seconds (60-86400)\")\n .transform((val) => (val ? { seconds: BigInt(val), nanos: 0 } : undefined)),\n refreshTokenLifetimeSeconds: z\n .number()\n .int()\n .min(60, \"Minimum refresh token lifetime is 60 seconds\")\n .max(604800, \"Maximum refresh token lifetime is 7 days (604800 seconds)\")\n .optional()\n .describe(\"Refresh token lifetime in seconds (60-604800)\")\n .transform((val) => (val ? { seconds: BigInt(val), nanos: 0 } : undefined)),\n requireDpop: z\n .boolean()\n .optional()\n .describe(\"Require DPoP (Demonstrating Proof-of-Possession) for token requests\"),\n })\n .refine((data) => !(data.clientType === \"browser\" && data.requireDpop === true), {\n message: \"requireDpop cannot be set to true for browser clients as they don't support DPoP\",\n path: [\"requireDpop\"],\n });\n\nexport const SCIMAuthorizationSchema = z.object({\n type: z.union([z.literal(\"oauth2\"), z.literal(\"bearer\")]).describe(\"SCIM authorization type\"),\n bearerSecret: secretValueSchema\n .optional()\n .describe(\"Bearer token secret (required for bearer type)\"),\n});\n\nexport const SCIMAttributeTypeSchema = z\n .union([\n z.literal(\"string\"),\n z.literal(\"number\"),\n z.literal(\"boolean\"),\n z.literal(\"datetime\"),\n z.literal(\"complex\"),\n ])\n .describe(\"SCIM attribute data type\");\n\nexport const SCIMAttributeSchema = z.object({\n type: SCIMAttributeTypeSchema.describe(\"Attribute data type\"),\n name: z.string().describe(\"Attribute name\"),\n description: z.string().optional().describe(\"Attribute description\"),\n mutability: z\n .union([z.literal(\"readOnly\"), z.literal(\"readWrite\"), z.literal(\"writeOnly\")])\n .optional()\n .describe(\"Attribute mutability\"),\n required: z.boolean().optional().describe(\"Whether the attribute is required\"),\n multiValued: z.boolean().optional().describe(\"Whether the attribute can have multiple values\"),\n uniqueness: z\n .union([z.literal(\"none\"), z.literal(\"server\"), z.literal(\"global\")])\n .optional()\n .describe(\"Uniqueness constraint\"),\n canonicalValues: z.array(z.string()).nullable().optional().describe(\"List of canonical values\"),\n get subAttributes() {\n return z.array(SCIMAttributeSchema).nullable().optional();\n },\n});\n\nconst SCIMSchemaSchema = z.object({\n name: z.string().describe(\"SCIM schema name\"),\n attributes: z.array(SCIMAttributeSchema).describe(\"Schema attributes\"),\n});\n\nexport const SCIMAttributeMappingSchema = z.object({\n tailorDBField: z.string().describe(\"TailorDB field name to map to\"),\n scimPath: z.string().describe(\"SCIM attribute path\"),\n});\n\nexport const SCIMResourceSchema = z.object({\n name: z.string().describe(\"SCIM resource name\"),\n tailorDBNamespace: z.string().describe(\"TailorDB namespace for the resource\"),\n tailorDBType: z.string().describe(\"TailorDB type name for the resource\"),\n coreSchema: SCIMSchemaSchema.describe(\"Core SCIM schema definition\"),\n attributeMapping: z.array(SCIMAttributeMappingSchema).describe(\"Attribute mapping configuration\"),\n});\n\nexport const SCIMSchema = z.object({\n machineUserName: z.string().describe(\"Machine user name for SCIM operations\"),\n authorization: SCIMAuthorizationSchema.describe(\"SCIM authorization configuration\"),\n resources: z.array(SCIMResourceSchema).describe(\"SCIM resource definitions\"),\n});\n\nexport const TenantProviderSchema = z.object({\n namespace: z.string().describe(\"TailorDB namespace for the tenant type\"),\n type: z.string().describe(\"TailorDB type name for tenants\"),\n signatureField: z.string().describe(\"Field used as the tenant signature\"),\n});\n\nconst UserProfileSchema = z.object({\n namespace: z.string().optional().describe(\"TailorDB namespace where the user type is defined\"),\n // FIXME: improve TailorDBInstance schema validation\n type: z.object({\n name: z.string(),\n fields: z.any(),\n metadata: z.any(),\n hooks: z.any(),\n validate: z.any(),\n features: z.any(),\n indexes: z.any(),\n files: z.any(),\n permission: z.any(),\n gqlPermission: z.any(),\n _output: z.any(),\n }),\n usernameField: z.string(),\n attributes: z.record(z.string(), z.literal(true)).optional(),\n attributeList: z.array(z.string()).optional(),\n});\n\nconst ValueOperandSchema: z.ZodType<ValueOperand> = z.union([\n z.string(),\n z.boolean(),\n z.array(z.string()),\n z.array(z.boolean()),\n]);\n\nconst MachineUserSchema = z.object({\n // null/undefined values mean \"attribute not set\" and are dropped so\n // downstream (deploy, drift diff) only ever sees concrete values.\n attributes: z\n .record(z.string(), ValueOperandSchema.nullish())\n .transform(\n (attributes): Record<string, ValueOperand> =>\n Object.fromEntries(\n Object.entries(attributes).filter(\n (entry): entry is [string, ValueOperand] => entry[1] != null,\n ),\n ),\n )\n .optional(),\n attributeList: z.array(z.uuid()).optional(),\n});\n\nconst BeforeLoginHookSchema = z.object({\n handler: z.function(),\n invoker: z.string(),\n});\n\nconst AuthConfigBaseSchema = z.object({\n name: z.string().describe(\"Auth service name\"),\n hooks: z\n .object({\n beforeLogin: BeforeLoginHookSchema.optional().describe(\"Before login auth hook\"),\n })\n .optional()\n .describe(\"Auth hooks\"),\n machineUsers: z\n .record(z.string(), MachineUserSchema)\n .optional()\n .describe(\"Machine user definitions\"),\n oauth2Clients: z\n .record(z.string(), OAuth2ClientSchema)\n .optional()\n .describe(\"OAuth2 client definitions\"),\n idProvider: IdProviderSchema.optional().describe(\"Identity provider configuration\"),\n scim: SCIMSchema.optional().describe(\"SCIM provisioning configuration\"),\n tenantProvider: TenantProviderSchema.optional().describe(\"Multi-tenant provider configuration\"),\n connections: z\n .record(z.string(), AuthConnectionConfigSchema)\n .optional()\n .describe(\"Auth connection definitions for external OAuth2 providers\"),\n publishSessionEvents: z.boolean().optional().describe(\"Enable publishing session events\"),\n});\n\nexport const AuthConfigSchema = z\n .xor(\n [\n AuthConfigBaseSchema.extend({\n userProfile: UserProfileSchema.optional().describe(\"User profile configuration\"),\n machineUserAttributes: z.undefined().optional(),\n }),\n AuthConfigBaseSchema.extend({\n userProfile: z.undefined().optional(),\n machineUserAttributes: z\n .record(z.string(), TailorFieldSchema)\n .describe(\"Machine user attribute fields\"),\n }),\n ],\n {\n error: (iss) => {\n // zod may report error codes not covered by its type definitions\n // oxlint-disable-next-line typescript/no-unnecessary-condition\n if (iss.code !== \"invalid_union\") return undefined;\n // zod may report error codes not covered by its type definitions\n // oxlint-disable-next-line typescript/no-unnecessary-condition\n if (iss.errors.length < 2) return undefined;\n const isOnlyMutexViolation = iss.errors.every((variantErrors) =>\n variantErrors.every(\n (e) =>\n e.path.length === 1 &&\n (e.path[0] === \"userProfile\" || e.path[0] === \"machineUserAttributes\"),\n ),\n );\n if (isOnlyMutexViolation) {\n return \"Specify either `userProfile` or `machineUserAttributes`, not both.\";\n }\n return undefined;\n },\n },\n )\n .brand(\"AuthConfig\");\n","import { z } from \"zod\";\nimport { AuthInvokerSchema } from \"../auth\";\nimport { functionSchema } from \"../common\";\n\nexport const TailorDBTriggerSchema = z.object({\n kind: z.literal(\"tailordb\").describe(\"TailorDB record event trigger\"),\n events: z\n .array(\n z.enum([\n \"tailordb.type_record.created\",\n \"tailordb.type_record.updated\",\n \"tailordb.type_record.deleted\",\n ]),\n )\n .min(1)\n .transform((arr) => [...new Set(arr)])\n .describe(\"TailorDB event types to trigger on\"),\n typeName: z.string().describe(\"TailorDB type name to watch for events\"),\n condition: functionSchema.optional().describe(\"Condition function to filter events\"),\n});\n\nexport const ResolverExecutedTriggerSchema = z.object({\n kind: z.literal(\"resolverExecuted\"),\n resolverName: z.string().describe(\"Name of the resolver to trigger on\"),\n condition: functionSchema.optional().describe(\"Condition function to filter events\"),\n});\n\nexport const ScheduleTriggerSchema = z.object({\n kind: z.literal(\"schedule\"),\n cron: z.string().describe(\"CRON expression for the schedule\"),\n timezone: z\n .string()\n .optional()\n .default(\"UTC\")\n .describe(\"Timezone for the CRON schedule (default: UTC)\"),\n});\n\nexport const IncomingWebhookTriggerResponseSchema = z.object({\n body: functionSchema.optional().describe(\"Function returning the response body\"),\n statusCode: z.number().int().optional().describe(\"HTTP status code for the response\"),\n});\n\nexport const IncomingWebhookTriggerSchema = z.object({\n kind: z.literal(\"incomingWebhook\"),\n response: IncomingWebhookTriggerResponseSchema.optional().describe(\"Response configuration\"),\n});\n\nexport const IdpUserTriggerSchema = z.object({\n kind: z.literal(\"idpUser\").describe(\"IdP user event trigger\"),\n events: z\n .array(z.enum([\"idp.user.created\", \"idp.user.updated\", \"idp.user.deleted\"]))\n .min(1)\n .transform((arr) => [...new Set(arr)])\n .describe(\"IdP user event types to trigger on\"),\n idp: z\n .string()\n .optional()\n .describe(\n \"IdP namespace name to subscribe to. If omitted, the project's only IdP is used; throws when multiple IdPs exist.\",\n ),\n});\n\nexport const AuthAccessTokenTriggerSchema = z.object({\n kind: z.literal(\"authAccessToken\").describe(\"Auth access token event trigger\"),\n events: z\n .array(\n z.enum([\n \"auth.access_token.issued\",\n \"auth.access_token.refreshed\",\n \"auth.access_token.revoked\",\n ]),\n )\n .min(1)\n .transform((arr) => [...new Set(arr)])\n .describe(\"Auth access token event types to trigger on\"),\n});\n\nexport const TriggerSchema = z.discriminatedUnion(\"kind\", [\n TailorDBTriggerSchema,\n ResolverExecutedTriggerSchema,\n ScheduleTriggerSchema,\n IncomingWebhookTriggerSchema,\n IdpUserTriggerSchema,\n AuthAccessTokenTriggerSchema,\n]);\n\nexport const FunctionOperationSchema = z.object({\n kind: z.enum([\"function\", \"jobFunction\"]),\n body: functionSchema.describe(\"Function implementation\"),\n authInvoker: AuthInvokerSchema.optional().describe(\"Auth invoker for the function execution\"),\n});\n\nexport const GqlOperationSchema = z.object({\n kind: z.literal(\"graphql\"),\n appName: z.string().optional().describe(\"Target application name for the GraphQL query\"),\n query: z.preprocess((val) => String(val), z.string().describe(\"GraphQL query string\")),\n variables: functionSchema.optional().describe(\"Function to compute GraphQL variables\"),\n authInvoker: AuthInvokerSchema.optional().describe(\"Auth invoker for the GraphQL execution\"),\n});\n\nexport const WebhookOperationSchema = z.object({\n kind: z.literal(\"webhook\"),\n url: functionSchema.describe(\"Function returning the webhook URL\"),\n requestBody: functionSchema.optional().describe(\"Function to compute the request body\"),\n headers: z\n .record(z.string(), z.union([z.string(), z.object({ vault: z.string(), key: z.string() })]))\n .optional()\n .describe(\"HTTP headers for the webhook request\"),\n});\n\nexport const WorkflowOperationSchema = z.preprocess(\n (val) => {\n if (\n val == null ||\n typeof val !== \"object\" ||\n !(\"workflow\" in val) ||\n typeof val.workflow !== \"object\" ||\n val.workflow === null\n ) {\n return val;\n }\n\n const { workflow, ...rest } = val as { workflow: { name: string } };\n return { ...rest, workflowName: workflow.name };\n },\n z.object({\n kind: z.literal(\"workflow\"),\n workflowName: z.string().describe(\"Name of the workflow to execute\"),\n args: z\n .union([z.record(z.string(), z.unknown()), functionSchema])\n .optional()\n .describe(\"Arguments to pass to the workflow\"),\n authInvoker: AuthInvokerSchema.optional().describe(\"Auth invoker for the workflow execution\"),\n }),\n);\n\nconst OperationSchema = z.union([\n FunctionOperationSchema,\n GqlOperationSchema,\n WebhookOperationSchema,\n WorkflowOperationSchema,\n]);\n\nexport const ExecutorSchema = z.object({\n name: z.string().describe(\"Executor name\"),\n description: z.string().optional().describe(\"Executor description\"),\n disabled: z.boolean().optional().default(false).describe(\"Whether the executor is disabled\"),\n trigger: TriggerSchema.describe(\"Event trigger configuration\"),\n operation: OperationSchema.describe(\"Operation to execute when triggered\"),\n});\n","import { pathToFileURL } from \"node:url\";\nimport * as path from \"pathe\";\nimport { loadFilesWithIgnores } from \"#/cli/services/file-loader\";\nimport { logger, styles } from \"#/cli/shared/logger\";\nimport { ExecutorSchema } from \"#/parser/service/executor/index\";\nimport { isSdkBranded } from \"#/utils/brand\";\nimport type { ExecutorServiceConfig } from \"#/configure/config/types\";\nimport type { Executor } from \"#/types/executor.generated\";\n\n/**\n * Information about a plugin-generated executor converted to Executor format\n */\nexport interface PluginExecutor {\n /** The executor in standard Executor format */\n executor: Executor;\n /** Plugin ID that generated this executor */\n pluginId: string;\n /** Source type name (for type-attached executors) */\n sourceTypeName?: string;\n}\n\nexport type ExecutorService = {\n readonly config: ExecutorServiceConfig;\n readonly executors: Record<string, Executor>;\n readonly pluginExecutors: ReadonlyArray<PluginExecutor>;\n loadExecutors: () => Promise<Record<string, Executor> | undefined>;\n loadPluginExecutorFiles: (filePaths: string[]) => Promise<void>;\n};\n\n/**\n * Parameters for creating an ExecutorService\n */\nexport interface CreateExecutorServiceParams {\n /** The executor service configuration */\n config: ExecutorServiceConfig;\n /** Directory the config's file patterns are resolved against */\n baseDir: string;\n}\n\n/**\n * Creates a new ExecutorService instance.\n * @param params - Parameters for creating the service\n * @returns A new ExecutorService instance\n */\nexport function createExecutorService(params: CreateExecutorServiceParams): ExecutorService {\n const { config, baseDir } = params;\n const executors: Record<string, Executor> = {};\n const pluginExecutors: PluginExecutor[] = [];\n let loadPromise: Promise<Record<string, Executor> | undefined> | undefined;\n\n const loadExecutorForFile = async (executorFile: string): Promise<Executor | undefined> => {\n try {\n const executorModule = await import(pathToFileURL(executorFile).href);\n const result = ExecutorSchema.safeParse(executorModule.default);\n if (result.success) {\n const relativePath = path.relative(process.cwd(), executorFile);\n logger.log(\n `Executor: ${styles.successBright(`\"${result.data.name}\"`)} loaded from ${styles.path(relativePath)}`,\n );\n executors[executorFile] = result.data;\n return result.data;\n }\n if (isSdkBranded(executorModule.default, \"executor\")) {\n throw result.error;\n }\n } catch (error) {\n const relativePath = path.relative(process.cwd(), executorFile);\n logger.error(`Failed to load executor from ${styles.bold(relativePath)}`);\n logger.error(String(error));\n throw error;\n }\n return undefined;\n };\n\n return {\n config,\n get executors() {\n return executors;\n },\n get pluginExecutors() {\n return pluginExecutors;\n },\n loadExecutors: async () => {\n if (!loadPromise) {\n loadPromise = (async () => {\n if (config.files.length === 0) {\n return undefined;\n }\n\n const executorFiles = loadFilesWithIgnores(config, baseDir);\n\n logger.newline();\n logger.log(`Found ${styles.highlight(executorFiles.length.toString())} executor files`);\n\n await Promise.all(executorFiles.map((executorFile) => loadExecutorForFile(executorFile)));\n assertUniqueExecutorNames(executors);\n return executors;\n })();\n }\n return loadPromise;\n },\n loadPluginExecutorFiles: async (filePaths: string[]) => {\n if (filePaths.length === 0) return;\n\n logger.newline();\n logger.log(\n `Loading ${styles.highlight(filePaths.length.toString())} plugin-generated executor files`,\n );\n\n for (const filePath of filePaths) {\n const executor = await loadExecutorForFile(filePath);\n if (executor) {\n // Track as plugin executor (plugin ID is extracted from file path)\n // File path format: .tailor-sdk/plugin/{executor-name}.ts\n pluginExecutors.push({\n executor,\n pluginId: \"plugin-generated\",\n sourceTypeName: undefined,\n });\n }\n }\n assertUniqueExecutorNames(executors);\n },\n };\n}\n\n/**\n * Assert that every loaded executor has a unique name.\n * Executors are stored by source file, so two files declaring the same\n * `name` would otherwise silently share a single bundle cache entry.\n * @param executors - Loaded executors keyed by source file\n */\nfunction assertUniqueExecutorNames(executors: Record<string, Executor>): void {\n const seenNames = new Map<string, string>();\n for (const [file, executor] of Object.entries(executors)) {\n const relativePath = path.relative(process.cwd(), file);\n const existing = seenNames.get(executor.name);\n if (existing) {\n throw new Error(\n `Duplicate executor name \"${executor.name}\" found:\\n` +\n ` - ${existing}\\n` +\n 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GAEL,OAAO;EACT;EACA,yBAAyB,OAAO,cAAwB;GACtD,IAAI,UAAU,WAAW,GAAG;GAE5B,OAAO,QAAQ;GACf,OAAO,IACL,WAAW,OAAO,UAAU,UAAU,OAAO,SAAS,CAAC,EAAE,iCAC3D;GAEA,KAAK,MAAM,YAAY,WAAW;IAChC,MAAM,WAAW,MAAM,oBAAoB,QAAQ;IACnD,IAAI,UAGF,gBAAgB,KAAK;KACnB;KACA,UAAU;KACV,gBAAgB;IAClB,CAAC;GAEL;GACA,0BAA0B,SAAS;EACrC;CACF;AACF;;;;;;;AAQA,SAAS,0BAA0B,WAA2C;CAC5E,MAAM,4BAAY,IAAI,IAAoB;CAC1C,KAAK,MAAM,CAAC,MAAM,aAAa,OAAO,QAAQ,SAAS,GAAG;EACxD,MAAM,eAAe,KAAK,SAAS,QAAQ,IAAI,GAAG,IAAI;EACtD,MAAM,WAAW,UAAU,IAAI,SAAS,IAAI;EAC5C,IAAI,UACF,MAAM,IAAI,MACR,4BAA4B,SAAS,KAAK,gBACjC,SAAS,QACT,aAAa,yCAExB;EAEF,UAAU,IAAI,SAAS,MAAM,YAAY;CAC3C;AACF"}
@@ -1,4 +1,4 @@
1
- import { n as logger, r as styles } from "./logger-BwS4ppwO.mjs";
1
+ import { n as logger, r as styles } from "./logger-CXQq9YIp.mjs";
2
2
  import { t as createCLIError } from "./errors-DVFS0AZk.mjs";
3
3
  import * as path from "pathe";
4
4
  import { readPackageJSON } from "pkg-types";
@@ -128,4 +128,4 @@ async function upgrade(options) {
128
128
 
129
129
  //#endregion
130
130
  export { upgrade };
131
- //# sourceMappingURL=service-Cp0I7ZFe.mjs.map
131
+ //# sourceMappingURL=service-CIGSGg9I.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"service-Cp0I7ZFe.mjs","names":["CLIError"],"sources":["../src/cli/commands/upgrade/version-detector.ts","../src/cli/commands/upgrade/service.ts"],"sourcesContent":["import * as path from \"pathe\";\nimport { readPackageJSON } from \"pkg-types\";\n\nconst SDK_PACKAGE_NAME = \"@tailor-platform/sdk\";\n\n/**\n * Detect the installed SDK version from the user's project.\n * Walks up from projectRoot to find the SDK package in node_modules,\n * matching Node's module resolution for workspace setups with hoisted deps.\n * @param projectRoot - The project root directory to search from\n * @returns The installed SDK version string, or null if not found\n */\nexport async function detectInstalledVersion(projectRoot: string): Promise<string | null> {\n let dir = path.resolve(projectRoot);\n // loop exits when a package.json is found or the root is reached\n // oxlint-disable-next-line typescript/no-unnecessary-condition\n while (true) {\n try {\n const sdkPath = path.join(dir, \"node_modules\", SDK_PACKAGE_NAME);\n const pkg = await readPackageJSON(sdkPath);\n if (pkg.version) return pkg.version;\n } catch {\n // Not found at this level, try parent\n }\n const parent = path.dirname(dir);\n if (parent === dir) break;\n dir = parent;\n }\n return null;\n}\n","import { spawnSync } from \"node:child_process\";\nimport { CLIError } from \"#/cli/shared/errors\";\nimport { logger, styles } from \"#/cli/shared/logger\";\nimport { detectInstalledVersion } from \"./version-detector\";\nimport type { RunOutput } from \"./types\";\n\ninterface UpgradeOptions {\n from: string;\n dryRun: boolean;\n path: string;\n}\n\n/**\n * Print the upgrade summary to the terminal.\n * @param output - The parsed JSON output from sdk-codemod\n * @param dryRun - Whether this was a dry-run\n */\nfunction printUpgradeSummary(output: RunOutput, dryRun: boolean): void {\n if (dryRun) {\n logger.info(`${styles.bold(\"[Dry Run]\")} No files were modified.`);\n logger.log(\"\");\n }\n\n const total = output.codemodsApplied + output.codemodsSkipped + output.errors.length;\n logger.info(\n `Upgrade complete: ${styles.success(`${output.codemodsApplied} applied`)}, ${styles.dim(`${output.codemodsSkipped} skipped`)} (${total} total codemods)`,\n );\n\n if (output.filesModified.length > 0) {\n logger.log(\"\");\n logger.info(\n `${dryRun ? \"Files that would be modified\" : \"Modified files\"} (${output.filesModified.length}):`,\n );\n for (const file of output.filesModified) {\n logger.log(` ${styles.path(file)}`);\n }\n }\n\n if (output.warnings.length > 0) {\n logger.log(\"\");\n logger.warn(`Manual attention needed (${output.warnings.length}):`);\n for (const warning of output.warnings) {\n logger.log(` ${styles.warning(\"!\")} ${warning}`);\n }\n }\n\n if (output.errors.length > 0) {\n logger.log(\"\");\n logger.error(`Failed codemods (${output.errors.length}):`);\n for (const { codemodId, message } of output.errors) {\n logger.log(` ${styles.error(codemodId)}: ${message}`);\n }\n }\n}\n\n/**\n * Run the upgrade pipeline:\n * 1. Detect target SDK version from node_modules\n * 2. Invoke @tailor-platform/sdk-codemod CLI\n * 3. Parse JSON output and display results\n * @param options - Upgrade options\n */\nexport async function upgrade(options: UpgradeOptions): Promise<void> {\n const projectRoot = options.path;\n\n // Step 1: Detect target SDK version (the newly installed version)\n const targetVersion = await detectInstalledVersion(projectRoot);\n if (!targetVersion) {\n throw CLIError({\n message: `Could not detect installed @tailor-platform/sdk version in ${projectRoot}`,\n suggestion:\n \"Ensure @tailor-platform/sdk is installed. Run 'pnpm install' or 'npm install' first.\",\n command: \"upgrade\",\n });\n }\n\n logger.info(\n `Upgrading from ${styles.highlight(options.from)} → ${styles.highlight(targetVersion)}`,\n );\n\n if (options.dryRun) {\n logger.info(`${styles.bold(\"[Dry Run]\")} Changes will be previewed but not applied.`);\n }\n\n logger.log(\"\");\n\n // Step 2: Invoke sdk-codemod CLI\n // Use \"latest\" because sdk-codemod may not be published at the exact same\n // version as @tailor-platform/sdk. Version filtering is handled internally\n // by sdk-codemod's registry via the --from / --to arguments.\n const npxCommand = process.platform === \"win32\" ? \"npx.cmd\" : \"npx\";\n\n const result = spawnSync(\n npxCommand,\n [\n \"@tailor-platform/sdk-codemod@latest\",\n \"--from\",\n options.from,\n \"--to\",\n targetVersion,\n \"--target\",\n projectRoot,\n ...(options.dryRun ? [\"--dry-run\"] : []),\n ],\n {\n cwd: projectRoot,\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n encoding: \"utf-8\",\n timeout: 300_000,\n },\n );\n\n if (result.error) {\n throw CLIError({\n message: `Failed to run @tailor-platform/sdk-codemod: ${result.error.message}`,\n suggestion: \"Ensure npx is available and the network is accessible.\",\n command: \"upgrade\",\n });\n }\n\n // Check for non-zero exit without a launch error (e.g. registry/auth/network failures)\n if (result.status !== 0 && !result.stdout.trim()) {\n throw CLIError({\n message: `@tailor-platform/sdk-codemod exited with code ${result.status}`,\n details: result.stderr.trim() || \"(no stderr output)\",\n suggestion:\n \"Review the error above. Common causes: invalid version arguments, network issues, or missing package registry access.\",\n command: \"upgrade\",\n });\n }\n\n // Forward captured stderr so users see dry-run diffs and progress messages\n // written by sdk-codemod. stderr is piped (not inherited) so that the error\n // path above can surface it via CLIError, but on success we still need to\n // replay it verbatim to keep the colorized unified diff output visible.\n if (result.stderr) {\n process.stderr.write(result.stderr);\n }\n\n // Step 3: Parse JSON output\n let output: RunOutput;\n try {\n output = JSON.parse(result.stdout);\n } catch {\n throw CLIError({\n message: \"Failed to parse output from @tailor-platform/sdk-codemod\",\n details: result.stdout || \"(empty stdout)\",\n suggestion: \"This is likely a bug. Please report it.\",\n command: \"upgrade\",\n });\n }\n\n // Step 4: Display results\n // Emit structured data on stdout (honors --json via logger.out) and\n // human-readable summary on stderr (via printUpgradeSummary).\n logger.out(output);\n printUpgradeSummary(output, options.dryRun);\n\n if (output.errors.length > 0) {\n throw CLIError({\n message: `Upgrade completed with ${output.errors.length} error(s)`,\n suggestion: \"Review the errors above and re-run the upgrade after fixing the issues.\",\n command: \"upgrade\",\n });\n }\n}\n"],"mappings":";;;;;;;AAGA,MAAM,mBAAmB;;;;;;;;AASzB,eAAsB,uBAAuB,aAA6C;CACxF,IAAI,MAAM,KAAK,QAAQ,WAAW;CAGlC,OAAO,MAAM;EACX,IAAI;GAEF,MAAM,MAAM,MAAM,gBADF,KAAK,KAAK,KAAK,gBAAgB,gBACP,CAAC;GACzC,IAAI,IAAI,SAAS,OAAO,IAAI;EAC9B,QAAQ,CAER;EACA,MAAM,SAAS,KAAK,QAAQ,GAAG;EAC/B,IAAI,WAAW,KAAK;EACpB,MAAM;CACR;CACA,OAAO;AACT;;;;;;;;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,IAAI,EAAE,KAAK,OAAO,UAAU,aAAa,GACtF;CAEA,IAAI,QAAQ,QACV,OAAO,KAAK,GAAG,OAAO,KAAK,WAAW,EAAE,4CAA4C;CAGtF,OAAO,IAAI,EAAE;CAQb,MAAM,SAAS,UAFI,QAAQ,aAAa,UAAU,YAAY,OAI5D;EACE;EACA;EACA,QAAQ;EACR;EACA;EACA;EACA;EACA,GAAI,QAAQ,SAAS,CAAC,WAAW,IAAI,CAAC;CACxC,GACA;EACE,KAAK;EACL,OAAO;GAAC;GAAU;GAAQ;EAAM;EAChC,UAAU;EACV,SAAS;CACX,CACF;CAEA,IAAI,OAAO,OACT,MAAMA,eAAS;EACb,SAAS,+CAA+C,OAAO,MAAM;EACrE,YAAY;EACZ,SAAS;CACX,CAAC;CAIH,IAAI,OAAO,WAAW,KAAK,CAAC,OAAO,OAAO,KAAK,GAC7C,MAAMA,eAAS;EACb,SAAS,iDAAiD,OAAO;EACjE,SAAS,OAAO,OAAO,KAAK,KAAK;EACjC,YACE;EACF,SAAS;CACX,CAAC;CAOH,IAAI,OAAO,QACT,QAAQ,OAAO,MAAM,OAAO,MAAM;CAIpC,IAAI;CACJ,IAAI;EACF,SAAS,KAAK,MAAM,OAAO,MAAM;CACnC,QAAQ;EACN,MAAMA,eAAS;GACb,SAAS;GACT,SAAS,OAAO,UAAU;GAC1B,YAAY;GACZ,SAAS;EACX,CAAC;CACH;CAKA,OAAO,IAAI,MAAM;CACjB,oBAAoB,QAAQ,QAAQ,MAAM;CAE1C,IAAI,OAAO,OAAO,SAAS,GACzB,MAAMA,eAAS;EACb,SAAS,0BAA0B,OAAO,OAAO,OAAO;EACxD,YAAY;EACZ,SAAS;CACX,CAAC;AAEL"}
1
+ {"version":3,"file":"service-CIGSGg9I.mjs","names":["CLIError"],"sources":["../src/cli/commands/upgrade/version-detector.ts","../src/cli/commands/upgrade/service.ts"],"sourcesContent":["import * as path from \"pathe\";\nimport { readPackageJSON } from \"pkg-types\";\n\nconst SDK_PACKAGE_NAME = \"@tailor-platform/sdk\";\n\n/**\n * Detect the installed SDK version from the user's project.\n * Walks up from projectRoot to find the SDK package in node_modules,\n * matching Node's module resolution for workspace setups with hoisted deps.\n * @param projectRoot - The project root directory to search from\n * @returns The installed SDK version string, or null if not found\n */\nexport async function detectInstalledVersion(projectRoot: string): Promise<string | null> {\n let dir = path.resolve(projectRoot);\n // loop exits when a package.json is found or the root is reached\n // oxlint-disable-next-line typescript/no-unnecessary-condition\n while (true) {\n try {\n const sdkPath = path.join(dir, \"node_modules\", SDK_PACKAGE_NAME);\n const pkg = await readPackageJSON(sdkPath);\n if (pkg.version) return pkg.version;\n } catch {\n // Not found at this level, try parent\n }\n const parent = path.dirname(dir);\n if (parent === dir) break;\n dir = parent;\n }\n return null;\n}\n","import { spawnSync } from \"node:child_process\";\nimport { CLIError } from \"#/cli/shared/errors\";\nimport { logger, styles } from \"#/cli/shared/logger\";\nimport { detectInstalledVersion } from \"./version-detector\";\nimport type { RunOutput } from \"./types\";\n\ninterface UpgradeOptions {\n from: string;\n dryRun: boolean;\n path: string;\n}\n\n/**\n * Print the upgrade summary to the terminal.\n * @param output - The parsed JSON output from sdk-codemod\n * @param dryRun - Whether this was a dry-run\n */\nfunction printUpgradeSummary(output: RunOutput, dryRun: boolean): void {\n if (dryRun) {\n logger.info(`${styles.bold(\"[Dry Run]\")} No files were modified.`);\n logger.log(\"\");\n }\n\n const total = output.codemodsApplied + output.codemodsSkipped + output.errors.length;\n logger.info(\n `Upgrade complete: ${styles.success(`${output.codemodsApplied} applied`)}, ${styles.dim(`${output.codemodsSkipped} skipped`)} (${total} total codemods)`,\n );\n\n if (output.filesModified.length > 0) {\n logger.log(\"\");\n logger.info(\n `${dryRun ? \"Files that would be modified\" : \"Modified files\"} (${output.filesModified.length}):`,\n );\n for (const file of output.filesModified) {\n logger.log(` ${styles.path(file)}`);\n }\n }\n\n if (output.warnings.length > 0) {\n logger.log(\"\");\n logger.warn(`Manual attention needed (${output.warnings.length}):`);\n for (const warning of output.warnings) {\n logger.log(` ${styles.warning(\"!\")} ${warning}`);\n }\n }\n\n if (output.errors.length > 0) {\n logger.log(\"\");\n logger.error(`Failed codemods (${output.errors.length}):`);\n for (const { codemodId, message } of output.errors) {\n logger.log(` ${styles.error(codemodId)}: ${message}`);\n }\n }\n}\n\n/**\n * Run the upgrade pipeline:\n * 1. Detect target SDK version from node_modules\n * 2. Invoke @tailor-platform/sdk-codemod CLI\n * 3. Parse JSON output and display results\n * @param options - Upgrade options\n */\nexport async function upgrade(options: UpgradeOptions): Promise<void> {\n const projectRoot = options.path;\n\n // Step 1: Detect target SDK version (the newly installed version)\n const targetVersion = await detectInstalledVersion(projectRoot);\n if (!targetVersion) {\n throw CLIError({\n message: `Could not detect installed @tailor-platform/sdk version in ${projectRoot}`,\n suggestion:\n \"Ensure @tailor-platform/sdk is installed. Run 'pnpm install' or 'npm install' first.\",\n command: \"upgrade\",\n });\n }\n\n logger.info(\n `Upgrading from ${styles.highlight(options.from)} → ${styles.highlight(targetVersion)}`,\n );\n\n if (options.dryRun) {\n logger.info(`${styles.bold(\"[Dry Run]\")} Changes will be previewed but not applied.`);\n }\n\n logger.log(\"\");\n\n // Step 2: Invoke sdk-codemod CLI\n // Use \"latest\" because sdk-codemod may not be published at the exact same\n // version as @tailor-platform/sdk. Version filtering is handled internally\n // by sdk-codemod's registry via the --from / --to arguments.\n const npxCommand = process.platform === \"win32\" ? \"npx.cmd\" : \"npx\";\n\n const result = spawnSync(\n npxCommand,\n [\n \"@tailor-platform/sdk-codemod@latest\",\n \"--from\",\n options.from,\n \"--to\",\n targetVersion,\n \"--target\",\n projectRoot,\n ...(options.dryRun ? [\"--dry-run\"] : []),\n ],\n {\n cwd: projectRoot,\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n encoding: \"utf-8\",\n timeout: 300_000,\n },\n );\n\n if (result.error) {\n throw CLIError({\n message: `Failed to run @tailor-platform/sdk-codemod: ${result.error.message}`,\n suggestion: \"Ensure npx is available and the network is accessible.\",\n command: \"upgrade\",\n });\n }\n\n // Check for non-zero exit without a launch error (e.g. registry/auth/network failures)\n if (result.status !== 0 && !result.stdout.trim()) {\n throw CLIError({\n message: `@tailor-platform/sdk-codemod exited with code ${result.status}`,\n details: result.stderr.trim() || \"(no stderr output)\",\n suggestion:\n \"Review the error above. Common causes: invalid version arguments, network issues, or missing package registry access.\",\n command: \"upgrade\",\n });\n }\n\n // Forward captured stderr so users see dry-run diffs and progress messages\n // written by sdk-codemod. stderr is piped (not inherited) so that the error\n // path above can surface it via CLIError, but on success we still need to\n // replay it verbatim to keep the colorized unified diff output visible.\n if (result.stderr) {\n process.stderr.write(result.stderr);\n }\n\n // Step 3: Parse JSON output\n let output: RunOutput;\n try {\n output = JSON.parse(result.stdout);\n } catch {\n throw CLIError({\n message: \"Failed to parse output from @tailor-platform/sdk-codemod\",\n details: result.stdout || \"(empty stdout)\",\n suggestion: \"This is likely a bug. Please report it.\",\n command: \"upgrade\",\n });\n }\n\n // Step 4: Display results\n // Emit structured data on stdout (honors --json via logger.out) and\n // human-readable summary on stderr (via printUpgradeSummary).\n logger.out(output);\n printUpgradeSummary(output, options.dryRun);\n\n if (output.errors.length > 0) {\n throw CLIError({\n message: `Upgrade completed with ${output.errors.length} error(s)`,\n suggestion: \"Review the errors above and re-run the upgrade after fixing the issues.\",\n command: \"upgrade\",\n });\n }\n}\n"],"mappings":";;;;;;;AAGA,MAAM,mBAAmB;;;;;;;;AASzB,eAAsB,uBAAuB,aAA6C;CACxF,IAAI,MAAM,KAAK,QAAQ,WAAW;CAGlC,OAAO,MAAM;EACX,IAAI;GAEF,MAAM,MAAM,MAAM,gBADF,KAAK,KAAK,KAAK,gBAAgB,gBACP,CAAC;GACzC,IAAI,IAAI,SAAS,OAAO,IAAI;EAC9B,QAAQ,CAER;EACA,MAAM,SAAS,KAAK,QAAQ,GAAG;EAC/B,IAAI,WAAW,KAAK;EACpB,MAAM;CACR;CACA,OAAO;AACT;;;;;;;;;ACZA,SAAS,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,KAAK,OAAO,UAAU,aAAa,GACtF;CAEA,IAAI,QAAQ,QACV,OAAO,KAAK,GAAG,OAAO,KAAK,WAAW,EAAE,4CAA4C;CAGtF,OAAO,IAAI,EAAE;CAQb,MAAM,SAAS,UAFI,QAAQ,aAAa,UAAU,YAAY,OAI5D;EACE;EACA;EACA,QAAQ;EACR;EACA;EACA;EACA;EACA,GAAI,QAAQ,SAAS,CAAC,WAAW,IAAI,CAAC;CACxC,GACA;EACE,KAAK;EACL,OAAO;GAAC;GAAU;GAAQ;EAAM;EAChC,UAAU;EACV,SAAS;CACX,CACF;CAEA,IAAI,OAAO,OACT,MAAMA,eAAS;EACb,SAAS,+CAA+C,OAAO,MAAM;EACrE,YAAY;EACZ,SAAS;CACX,CAAC;CAIH,IAAI,OAAO,WAAW,KAAK,CAAC,OAAO,OAAO,KAAK,GAC7C,MAAMA,eAAS;EACb,SAAS,iDAAiD,OAAO;EACjE,SAAS,OAAO,OAAO,KAAK,KAAK;EACjC,YACE;EACF,SAAS;CACX,CAAC;CAOH,IAAI,OAAO,QACT,QAAQ,OAAO,MAAM,OAAO,MAAM;CAIpC,IAAI;CACJ,IAAI;EACF,SAAS,KAAK,MAAM,OAAO,MAAM;CACnC,QAAQ;EACN,MAAMA,eAAS;GACb,SAAS;GACT,SAAS,OAAO,UAAU;GAC1B,YAAY;GACZ,SAAS;EACX,CAAC;CACH;CAKA,OAAO,IAAI,MAAM;CACjB,oBAAoB,QAAQ,QAAQ,MAAM;CAE1C,IAAI,OAAO,OAAO,SAAS,GACzB,MAAMA,eAAS;EACb,SAAS,0BAA0B,OAAO,OAAO,OAAO;EACxD,YAAY;EACZ,SAAS;CACX,CAAC;AAEL"}
@@ -0,0 +1,3 @@
1
+ import { t as createExecutorService } from "./service-B0MaodSg.mjs";
2
+
3
+ export { createExecutorService };
@@ -46,10 +46,10 @@ declare function mockFile(options?: MockFileOptions): {
46
46
  calls: FileCall[];
47
47
  clear(): void;
48
48
  reset(): void;
49
- delete: Mock<(namespace: string, typeName: string, fieldName: string, recordId: string) => Promise<void>>;
50
49
  upload: Mock<(namespace: string, typeName: string, fieldName: string, recordId: string, data: string | ArrayBuffer | Uint8Array | number[], options?: FileUploadOptions) => Promise<FileUploadResponse>>;
51
50
  download: Mock<(namespace: string, typeName: string, fieldName: string, recordId: string) => Promise<FileDownloadResponse>>;
52
51
  downloadAsBase64: Mock<(namespace: string, typeName: string, fieldName: string, recordId: string) => Promise<FileDownloadAsBase64Response>>;
52
+ delete: Mock<(namespace: string, typeName: string, fieldName: string, recordId: string) => Promise<void>>;
53
53
  getMetadata: Mock<(namespace: string, typeName: string, fieldName: string, recordId: string) => Promise<FileMetadata>>;
54
54
  openDownloadStream: Mock<(namespace: string, typeName: string, fieldName: string, recordId: string) => Promise<FileStreamIterator>>;
55
55
  downloadStream: Mock<(namespace: string, typeName: string, fieldName: string, recordId: string) => Promise<FileDownloadStreamResponse>>;
@@ -41,7 +41,7 @@ export default defineConfig({
41
41
 
42
42
  **Disable Introspection**: Disable GraphQL introspection. Default is `false`.
43
43
 
44
- **Log Level**: Controls which `console.*` calls are kept when deployment functions are bundled. Supported values are `"DEBUG"`, `"INFO"`, `"WARN"`, `"ERROR"`, and `"SILENT"`. The default is `"DEBUG"` and keeps all console calls. `console.log` is treated as a DEBUG-level call (matching the platform's OpenTelemetry severity mapping), so it is dropped at `"INFO"` and above. For production deployments, use `"WARN"` to keep `console.warn` and `console.error` while dropping debug, log, and info calls:
44
+ **Log Level**: Controls which `console.*` and `logger.*` (from `@tailor-platform/sdk/runtime`) calls are kept when deployment functions are bundled. Supported values are `"DEBUG"`, `"INFO"`, `"WARN"`, `"ERROR"`, and `"SILENT"`. The default is `"DEBUG"` and keeps all calls. `console.log` is treated as a DEBUG-level call (matching the platform's OpenTelemetry severity mapping), so it is dropped at `"INFO"` and above, alongside `console.debug` and `logger.debug`. `logger.setAttributes` has no severity and is never dropped, regardless of `logLevel`. For production deployments, use `"WARN"` to keep warn/error calls while dropping debug, log, and info calls:
45
45
 
46
46
  ```typescript
47
47
  export default defineConfig({
@@ -52,6 +52,8 @@ export default defineConfig({
52
52
 
53
53
  This is a bundle-time setting. Changing `LOG_LEVEL` affects newly bundled deployments; already deployed functions must be redeployed.
54
54
 
55
+ Only `logger.*` calls made through the SDK's `logger` wrapper (from `@tailor-platform/sdk/runtime` or its `@tailor-platform/sdk/runtime/logger` subpath), or written as `globalThis.tailor.logger.*`, are covered. Other equivalent forms — such as the bare `tailor.logger.*` global or `self.tailor.logger.*` — are not affected by `logLevel`.
56
+
55
57
  ### Service Configuration
56
58
 
57
59
  Specify glob patterns to load service files:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailor-platform/sdk",
3
- "version": "1.81.0",
3
+ "version": "1.82.0",
4
4
  "description": "Tailor Platform SDK - The SDK to work with Tailor Platform",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -176,6 +176,7 @@
176
176
  "date-fns": "4.4.0",
177
177
  "es-toolkit": "1.49.0",
178
178
  "find-up-simple": "1.0.1",
179
+ "get-east-asian-width": "1.6.0",
179
180
  "get-tsconfig": "4.14.0",
180
181
  "globals": "17.7.0",
181
182
  "graphql": "17.0.2",
@@ -194,7 +195,6 @@
194
195
  "semver": "7.8.5",
195
196
  "sql-highlight": "6.1.0",
196
197
  "std-env": "4.2.0",
197
- "table": "6.9.0",
198
198
  "ts-cron-validator": "1.1.5",
199
199
  "tsx": "4.23.1",
200
200
  "type-fest": "5.8.0",
@@ -1,3 +0,0 @@
1
- import { n as generatePluginFilesIfNeeded, r as loadApplication, t as defineApplication } from "./application-DDe0er6L.mjs";
2
-
3
- export { defineApplication, generatePluginFilesIfNeeded };