@tailor-platform/sdk 1.76.2 → 1.78.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 (88) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/{application-CqjCcZ2n.mjs → application-CUxVA7Fs.mjs} +8 -8
  3. package/dist/application-CUxVA7Fs.mjs.map +1 -0
  4. package/dist/application-Dp_-ioiP.mjs +3 -0
  5. package/dist/cli/commands/deploy/deploy.d.mts +8 -3
  6. package/dist/cli/commands/show.d.mts +9 -3
  7. package/dist/cli/commands/workspace/create.d.mts +3 -0
  8. package/dist/cli/commands/workspace/list.d.mts +1 -0
  9. package/dist/cli/commands/workspace/transform.d.mts +2 -0
  10. package/dist/cli/index.mjs +69 -22
  11. package/dist/cli/index.mjs.map +1 -1
  12. package/dist/cli/lib.d.mts +2 -2
  13. package/dist/cli/lib.mjs +2 -2
  14. package/dist/cli/lib.mjs.map +1 -1
  15. package/dist/cli/shared/workspace-name.d.mts +1 -0
  16. package/dist/cli/skills.mjs +1 -1
  17. package/dist/completion/zsh-worker.zsh +18 -1
  18. package/dist/configure/index.mjs +198 -4
  19. package/dist/configure/index.mjs.map +1 -1
  20. package/dist/configure/services/idp/index.d.mts +1 -4
  21. package/dist/{crashreport-DZDr-TvH.mjs → crashreport-BNWUM6Kf.mjs} +2 -2
  22. package/dist/{crashreport-DZDr-TvH.mjs.map → crashreport-BNWUM6Kf.mjs.map} +1 -1
  23. package/dist/{crashreport-np4-_DX2.mjs → crashreport-BafWvjjX.mjs} +1 -1
  24. package/dist/errors-DVFS0AZk.mjs +100 -0
  25. package/dist/errors-DVFS0AZk.mjs.map +1 -0
  26. package/dist/{globals-z6zYMjlr.mjs → globals-CvizbGLY.mjs} +2 -2
  27. package/dist/{globals-z6zYMjlr.mjs.map → globals-CvizbGLY.mjs.map} +1 -1
  28. package/dist/{logger-BEiZZ3qT.mjs → logger-BwS4ppwO.mjs} +3 -3
  29. package/dist/logger-BwS4ppwO.mjs.map +1 -0
  30. package/dist/{registry-CTgoVWc_.mjs → registry-CYBRvfaU.mjs} +2 -2
  31. package/dist/{registry-CTgoVWc_.mjs.map → registry-CYBRvfaU.mjs.map} +1 -1
  32. package/dist/{runtime-DlklyuHN.mjs → runtime-BD2vYJFT.mjs} +1169 -539
  33. package/dist/runtime-BD2vYJFT.mjs.map +1 -0
  34. package/dist/{schema-DbTR1c6M.mjs → schema-U6DxoZ8D.mjs} +203 -3
  35. package/dist/schema-U6DxoZ8D.mjs.map +1 -0
  36. package/dist/{secretmanager-Bd45j7an.mjs → secretmanager-IY4UvinW.mjs} +42 -9
  37. package/dist/secretmanager-IY4UvinW.mjs.map +1 -0
  38. package/dist/service-CghpdV-9.mjs +3 -0
  39. package/dist/{service-DBFZQloR.mjs → service-Cp0I7ZFe.mjs} +3 -3
  40. package/dist/{service-DBFZQloR.mjs.map → service-Cp0I7ZFe.mjs.map} +1 -1
  41. package/dist/{service-BCRJ-3NV.mjs → service-D12iQGcS.mjs} +2 -2
  42. package/dist/{service-BCRJ-3NV.mjs.map → service-D12iQGcS.mjs.map} +1 -1
  43. package/dist/{test-env-key-IPapa1KJ.mjs → test-env-key-DuZycyWM.mjs} +2 -2
  44. package/dist/{test-env-key-IPapa1KJ.mjs.map → test-env-key-DuZycyWM.mjs.map} +1 -1
  45. package/dist/types/auth.generated.d.mts +9 -36
  46. package/dist/types/executor.generated.d.mts +19 -59
  47. package/dist/types/idp.generated.d.mts +518 -517
  48. package/dist/types/resolver.generated.d.mts +6 -2
  49. package/dist/types/tailordb.generated.d.mts +8 -7
  50. package/dist/utils/test/index.mjs +1 -1
  51. package/dist/vitest/environment.mjs +1 -1
  52. package/dist/vitest/index.d.mts +8 -8
  53. package/dist/vitest/index.mjs +600 -186
  54. package/dist/vitest/index.mjs.map +1 -1
  55. package/dist/vitest/mock.d.mts +8 -8
  56. package/dist/vitest/mocks/aigateway.d.mts +14 -4
  57. package/dist/vitest/mocks/authconnection.d.mts +14 -4
  58. package/dist/vitest/mocks/file.d.mts +24 -6
  59. package/dist/vitest/mocks/iconv.d.mts +28 -4
  60. package/dist/vitest/mocks/idp.d.mts +25 -9
  61. package/dist/vitest/mocks/secretmanager.d.mts +13 -4
  62. package/dist/vitest/mocks/tailordb.d.mts +48 -7
  63. package/dist/vitest/mocks/workflow.d.mts +41 -9
  64. package/dist/vitest/setup.mjs +2 -2
  65. package/docs/cli/application.md +58 -11
  66. package/docs/cli/setup.md +1 -1
  67. package/docs/cli/workspace.md +6 -4
  68. package/docs/cli-reference.md +12 -8
  69. package/docs/runtime.md +3 -4
  70. package/docs/services/aigateway.md +2 -0
  71. package/docs/services/tailordb.md +42 -0
  72. package/docs/services/workflow.md +1 -1
  73. package/docs/testing.md +103 -89
  74. package/package.json +7 -7
  75. package/dist/application-6zsDLGKv.mjs +0 -3
  76. package/dist/application-CqjCcZ2n.mjs.map +0 -1
  77. package/dist/errors-Dtf2WPaW.mjs +0 -42
  78. package/dist/errors-Dtf2WPaW.mjs.map +0 -1
  79. package/dist/field-runtime-D4QWRiB1.mjs +0 -203
  80. package/dist/field-runtime-D4QWRiB1.mjs.map +0 -1
  81. package/dist/logger-BEiZZ3qT.mjs.map +0 -1
  82. package/dist/runtime-DlklyuHN.mjs.map +0 -1
  83. package/dist/schema-DbTR1c6M.mjs.map +0 -1
  84. package/dist/secretmanager-Bd45j7an.mjs.map +0 -1
  85. package/dist/service-CPMlIg3X.mjs +0 -3
  86. package/dist/types-BzJ7A_fn.mjs +0 -199
  87. package/dist/types-BzJ7A_fn.mjs.map +0 -1
  88. package/dist/types-CG9H7HuE.mjs +0 -4
@@ -1,42 +0,0 @@
1
- import chalk from "chalk";
2
-
3
- //#region src/cli/shared/errors.ts
4
- /**
5
- * Format CLI error for output
6
- * @param error - CLIError instance to format
7
- * @returns Formatted error message
8
- */
9
- function formatError(error) {
10
- const parts = [chalk.red(`Error${error.code ? ` [${error.code}]` : ""}: ${error.message}`)];
11
- if (error.details) parts.push(`\n ${chalk.gray("Details:")} ${error.details}`);
12
- if (error.suggestion) parts.push(`\n ${chalk.cyan("Suggestion:")} ${error.suggestion}`);
13
- if (error.command) parts.push(`\n ${chalk.gray("Help:")} Run \`tailor-sdk ${error.command} --help\` for usage information.`);
14
- return parts.join("");
15
- }
16
- /**
17
- * Create a CLI error with formatted output
18
- * @param options - Options to construct a CLIError
19
- * @returns Constructed CLIError instance
20
- */
21
- function createCLIError(options) {
22
- const error = new Error(options.message);
23
- error.name = "CLIError";
24
- error.code = options.code;
25
- error.details = options.details;
26
- error.suggestion = options.suggestion;
27
- error.command = options.command;
28
- error.format = () => formatError(error);
29
- return error;
30
- }
31
- /**
32
- * Type guard to check if an error is a CLIError
33
- * @param error - Error to check
34
- * @returns True if the error is a CLIError
35
- */
36
- function isCLIError(error) {
37
- return error instanceof Error && error.name === "CLIError";
38
- }
39
-
40
- //#endregion
41
- export { isCLIError as n, createCLIError as t };
42
- //# sourceMappingURL=errors-Dtf2WPaW.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors-Dtf2WPaW.mjs","names":[],"sources":["../src/cli/shared/errors.ts"],"sourcesContent":["import chalk from \"chalk\";\n\n/**\n * Options for creating a CLI error\n */\nexport interface CLIErrorOptions {\n message: string;\n details?: string;\n suggestion?: string;\n command?: string;\n code?: string;\n}\n\n/**\n * CLI error interface with formatted output\n */\nexport interface CLIError extends Error {\n readonly code?: string;\n readonly details?: string;\n readonly suggestion?: string;\n readonly command?: string;\n format(): string;\n}\n\ntype CLIErrorInternal = Error & {\n code?: string;\n details?: string;\n suggestion?: string;\n command?: string;\n format(): string;\n};\n\n/**\n * Format CLI error for output\n * @param error - CLIError instance to format\n * @returns Formatted error message\n */\nfunction formatError(error: CLIError): string {\n const parts: string[] = [\n chalk.red(`Error${error.code ? ` [${error.code}]` : \"\"}: ${error.message}`),\n ];\n\n if (error.details) {\n parts.push(`\\n ${chalk.gray(\"Details:\")} ${error.details}`);\n }\n\n if (error.suggestion) {\n parts.push(`\\n ${chalk.cyan(\"Suggestion:\")} ${error.suggestion}`);\n }\n\n if (error.command) {\n parts.push(\n `\\n ${chalk.gray(\"Help:\")} Run \\`tailor-sdk ${error.command} --help\\` for usage information.`,\n );\n }\n\n return parts.join(\"\");\n}\n\n/**\n * Create a CLI error with formatted output\n * @param options - Options to construct a CLIError\n * @returns Constructed CLIError instance\n */\nfunction createCLIError(options: CLIErrorOptions): CLIError {\n const error = new Error(options.message) as CLIErrorInternal;\n error.name = \"CLIError\";\n error.code = options.code;\n error.details = options.details;\n error.suggestion = options.suggestion;\n error.command = options.command;\n error.format = () => formatError(error);\n return error;\n}\n\n/**\n * Type guard to check if an error is a CLIError\n * @param error - Error to check\n * @returns True if the error is a CLIError\n */\nexport function isCLIError(error: unknown): error is CLIError {\n return error instanceof Error && error.name === \"CLIError\";\n}\n\n// Re-export createCLIError as CLIError for backward compatibility\nexport { createCLIError as CLIError };\n"],"mappings":";;;;;;;;AAqCA,SAAS,YAAY,OAAyB;CAC5C,MAAM,QAAkB,CACtB,MAAM,IAAI,QAAQ,MAAM,OAAO,KAAK,MAAM,KAAK,KAAK,GAAG,IAAI,MAAM,SAAS,CAC5E;CAEA,IAAI,MAAM,SACR,MAAM,KAAK,OAAO,MAAM,KAAK,UAAU,EAAE,GAAG,MAAM,SAAS;CAG7D,IAAI,MAAM,YACR,MAAM,KAAK,OAAO,MAAM,KAAK,aAAa,EAAE,GAAG,MAAM,YAAY;CAGnE,IAAI,MAAM,SACR,MAAM,KACJ,OAAO,MAAM,KAAK,OAAO,EAAE,oBAAoB,MAAM,QAAQ,iCAC/D;CAGF,OAAO,MAAM,KAAK,EAAE;AACtB;;;;;;AAOA,SAAS,eAAe,SAAoC;CAC1D,MAAM,QAAQ,IAAI,MAAM,QAAQ,OAAO;CACvC,MAAM,OAAO;CACb,MAAM,OAAO,QAAQ;CACrB,MAAM,UAAU,QAAQ;CACxB,MAAM,aAAa,QAAQ;CAC3B,MAAM,UAAU,QAAQ;CACxB,MAAM,eAAe,YAAY,KAAK;CACtC,OAAO;AACT;;;;;;AAOA,SAAgB,WAAW,OAAmC;CAC5D,OAAO,iBAAiB,SAAS,MAAM,SAAS;AAClD"}
@@ -1,203 +0,0 @@
1
- //#region src/configure/types/field.ts
2
- /**
3
- * Normalize allowed values into EnumValue objects with descriptions.
4
- * @param values - Allowed values as strings or EnumValue objects
5
- * @returns Normalized allowed values
6
- */
7
- function mapAllowedValues(values) {
8
- return values.map((value) => {
9
- if (typeof value === "string") return {
10
- value,
11
- description: ""
12
- };
13
- return {
14
- ...value,
15
- description: value.description ?? ""
16
- };
17
- });
18
- }
19
-
20
- //#endregion
21
- //#region src/configure/types/field-runtime.ts
22
- const regex = {
23
- uuid: /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,
24
- date: /^(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})$/,
25
- time: /^(?<hour>\d{2}):(?<minute>\d{2})$/,
26
- datetime: /^(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})T(?<hour>\d{2}):(?<minute>\d{2}):(?<second>\d{2})(\.(?<millisec>\d{3}))?Z$/,
27
- decimal: /^-?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/
28
- };
29
- function validateBaseValue(args) {
30
- const { field, value, pathArray, issues } = args;
31
- const path = pathArray.length > 0 ? pathArray : void 0;
32
- const initialIssueCount = issues.length;
33
- switch (field.type) {
34
- case "string":
35
- if (typeof value !== "string") issues.push({
36
- message: `Expected a string: received ${String(value)}`,
37
- path
38
- });
39
- break;
40
- case "integer":
41
- if (typeof value !== "number" || !Number.isInteger(value)) issues.push({
42
- message: `Expected an integer: received ${String(value)}`,
43
- path
44
- });
45
- break;
46
- case "float":
47
- if (typeof value !== "number" || !Number.isFinite(value)) issues.push({
48
- message: `Expected a number: received ${String(value)}`,
49
- path
50
- });
51
- break;
52
- case "boolean":
53
- if (typeof value !== "boolean") issues.push({
54
- message: `Expected a boolean: received ${String(value)}`,
55
- path
56
- });
57
- break;
58
- case "uuid":
59
- if (typeof value !== "string" || !regex.uuid.test(value)) issues.push({
60
- message: `Expected a valid UUID: received ${String(value)}`,
61
- path
62
- });
63
- break;
64
- case "date":
65
- if (typeof value !== "string" || !regex.date.test(value)) issues.push({
66
- message: `Expected to match "yyyy-MM-dd" format: received ${String(value)}`,
67
- path
68
- });
69
- break;
70
- case "datetime":
71
- if (typeof value !== "string" || !regex.datetime.test(value)) issues.push({
72
- message: `Expected to match ISO format: received ${String(value)}`,
73
- path
74
- });
75
- break;
76
- case "time":
77
- if (typeof value !== "string" || !regex.time.test(value)) issues.push({
78
- message: `Expected to match "HH:mm" format: received ${String(value)}`,
79
- path
80
- });
81
- break;
82
- case "decimal":
83
- if (typeof value !== "string" || !regex.decimal.test(value)) issues.push({
84
- message: `Expected a decimal string: received ${String(value)}`,
85
- path
86
- });
87
- break;
88
- case "enum":
89
- if (field._metadata.allowedValues) {
90
- const allowedValues = field._metadata.allowedValues.map((v) => v.value);
91
- if (typeof value !== "string" || !allowedValues.includes(value)) issues.push({
92
- message: `Must be one of [${allowedValues.join(", ")}]: received ${String(value)}`,
93
- path
94
- });
95
- }
96
- break;
97
- case "nested": {
98
- if (typeof value !== "object" || value === null || Array.isArray(value) || value instanceof Date) {
99
- issues.push({
100
- message: `Expected an object: received ${String(value)}`,
101
- path
102
- });
103
- return false;
104
- }
105
- let nestedBaseValid = true;
106
- for (const [fieldName, nestedField] of Object.entries(field.fields)) {
107
- const fieldValue = value[fieldName];
108
- if (!validateBaseField({
109
- ...args,
110
- field: nestedField,
111
- value: fieldValue,
112
- pathArray: pathArray.concat(fieldName)
113
- })) nestedBaseValid = false;
114
- }
115
- return nestedBaseValid;
116
- }
117
- }
118
- return issues.length === initialIssueCount;
119
- }
120
- function validateCustomValue(args, validateFns) {
121
- const { value, data, user, pathArray, issues } = args;
122
- const path = pathArray.length > 0 ? pathArray : void 0;
123
- for (const validateInput of validateFns) {
124
- const { fn, message } = typeof validateInput === "function" ? {
125
- fn: validateInput,
126
- message: "Validation failed"
127
- } : {
128
- fn: validateInput[0],
129
- message: validateInput[1]
130
- };
131
- if (!fn({
132
- value,
133
- data,
134
- user
135
- })) issues.push({
136
- message,
137
- path
138
- });
139
- }
140
- }
141
- function validateBaseField(args) {
142
- const { field, value, pathArray, issues } = args;
143
- const path = pathArray.length > 0 ? pathArray : void 0;
144
- const isNullOrUndefined = value === null || value === void 0;
145
- if (field._metadata.required && isNullOrUndefined) {
146
- issues.push({
147
- message: "Required field is missing",
148
- path
149
- });
150
- return false;
151
- }
152
- if (!field._metadata.required && isNullOrUndefined) return true;
153
- let baseValid = true;
154
- if (field._metadata.array) {
155
- if (!Array.isArray(value)) {
156
- issues.push({
157
- message: "Expected an array",
158
- path
159
- });
160
- return false;
161
- }
162
- for (let i = 0; i < value.length; i++) if (!validateBaseValue({
163
- ...args,
164
- value: value[i],
165
- pathArray: pathArray.concat(`[${i}]`)
166
- })) baseValid = false;
167
- } else baseValid = validateBaseValue(args);
168
- return baseValid;
169
- }
170
- function validateCustomField(args) {
171
- const { field, value, pathArray } = args;
172
- if (value === null || value === void 0) return;
173
- if (field.type === "nested") {
174
- const records = field._metadata.array ? value : [value];
175
- for (let i = 0; i < records.length; i++) {
176
- const record = records[i];
177
- const recordPath = field._metadata.array ? pathArray.concat(`[${i}]`) : pathArray;
178
- for (const [fieldName, nestedField] of Object.entries(field.fields)) validateCustomField({
179
- ...args,
180
- field: nestedField,
181
- value: record[fieldName],
182
- pathArray: recordPath.concat(fieldName)
183
- });
184
- }
185
- }
186
- const validateFns = field._metadata.validate;
187
- if (validateFns?.length) validateCustomValue(args, validateFns);
188
- }
189
- function parseInternal(args) {
190
- const { value } = args;
191
- const issues = [];
192
- const validationArgs = {
193
- ...args,
194
- issues
195
- };
196
- if (validateBaseField(validationArgs)) validateCustomField(validationArgs);
197
- if (issues.length > 0) return { issues };
198
- return { value: value ?? null };
199
- }
200
-
201
- //#endregion
202
- export { mapAllowedValues as n, parseInternal as t };
203
- //# sourceMappingURL=field-runtime-D4QWRiB1.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"field-runtime-D4QWRiB1.mjs","names":[],"sources":["../src/configure/types/field.ts","../src/configure/types/field-runtime.ts"],"sourcesContent":["import type { EnumValue } from \"#/configure/types/field.types\";\n\nexport type AllowedValues = readonly [string | EnumValue, ...(string | EnumValue)[]];\n\n/**\n * Normalize allowed values into EnumValue objects with descriptions.\n * @param values - Allowed values as strings or EnumValue objects\n * @returns Normalized allowed values\n */\nexport function mapAllowedValues(values: AllowedValues): EnumValue[] {\n return values.map((value) => {\n if (typeof value === \"string\") {\n return { value, description: \"\" };\n }\n return { ...value, description: value.description ?? \"\" };\n });\n}\n\nexport type AllowedValuesOutput<V extends AllowedValues> = V[number] extends infer T\n ? T extends string\n ? T\n : T extends { value: infer K }\n ? K\n : never\n : never;\n","import type { FieldMetadata, TailorFieldType } from \"#/configure/types/field.types\";\nimport type { TailorUser } from \"#/runtime/types\";\nimport type { StandardSchemaV1 } from \"@standard-schema/spec\";\n\nconst regex = {\n uuid: /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,\n date: /^(?<year>\\d{4})-(?<month>\\d{2})-(?<day>\\d{2})$/,\n time: /^(?<hour>\\d{2}):(?<minute>\\d{2})$/,\n datetime:\n /^(?<year>\\d{4})-(?<month>\\d{2})-(?<day>\\d{2})T(?<hour>\\d{2}):(?<minute>\\d{2}):(?<second>\\d{2})(\\.(?<millisec>\\d{3}))?Z$/,\n decimal: /^-?(\\d+\\.?\\d*|\\.\\d+)([eE][+-]?\\d+)?$/,\n} as const;\n\nexport type FieldParseArgs = {\n value: unknown;\n data: unknown;\n user: TailorUser;\n};\n\nexport type FieldParseInternalArgs = {\n value: unknown;\n data: unknown;\n user: TailorUser;\n pathArray: string[];\n};\n\nexport type FieldRuntime<T extends TailorFieldType = TailorFieldType> = {\n readonly type: T;\n readonly fields: Record<string, FieldRuntime>;\n _metadata: FieldMetadata;\n _parseInternal(args: FieldParseInternalArgs): StandardSchemaV1.Result<unknown>;\n};\n\ntype FieldParseRuntimeArgs<T extends TailorFieldType> = FieldParseInternalArgs & {\n field: FieldRuntime<T>;\n};\n\ntype FieldValidationArgs<T extends TailorFieldType> = FieldParseRuntimeArgs<T> & {\n issues: StandardSchemaV1.Issue[];\n};\n\nfunction validateBaseValue<T extends TailorFieldType>(args: FieldValidationArgs<T>): boolean {\n const { field, value, pathArray, issues } = args;\n const path = pathArray.length > 0 ? pathArray : undefined;\n const initialIssueCount = issues.length;\n\n switch (field.type) {\n case \"string\":\n if (typeof value !== \"string\") {\n issues.push({\n message: `Expected a string: received ${String(value)}`,\n path,\n });\n }\n break;\n\n case \"integer\":\n if (typeof value !== \"number\" || !Number.isInteger(value)) {\n issues.push({\n message: `Expected an integer: received ${String(value)}`,\n path,\n });\n }\n break;\n\n case \"float\":\n if (typeof value !== \"number\" || !Number.isFinite(value)) {\n issues.push({\n message: `Expected a number: received ${String(value)}`,\n path,\n });\n }\n break;\n\n case \"boolean\":\n if (typeof value !== \"boolean\") {\n issues.push({\n message: `Expected a boolean: received ${String(value)}`,\n path,\n });\n }\n break;\n\n case \"uuid\":\n if (typeof value !== \"string\" || !regex.uuid.test(value)) {\n issues.push({\n message: `Expected a valid UUID: received ${String(value)}`,\n path,\n });\n }\n break;\n case \"date\":\n if (typeof value !== \"string\" || !regex.date.test(value)) {\n issues.push({\n message: `Expected to match \"yyyy-MM-dd\" format: received ${String(value)}`,\n path,\n });\n }\n break;\n case \"datetime\":\n if (typeof value !== \"string\" || !regex.datetime.test(value)) {\n issues.push({\n message: `Expected to match ISO format: received ${String(value)}`,\n path,\n });\n }\n break;\n case \"time\":\n if (typeof value !== \"string\" || !regex.time.test(value)) {\n issues.push({\n message: `Expected to match \"HH:mm\" format: received ${String(value)}`,\n path,\n });\n }\n break;\n case \"decimal\":\n if (typeof value !== \"string\" || !regex.decimal.test(value)) {\n issues.push({\n message: `Expected a decimal string: received ${String(value)}`,\n path,\n });\n }\n break;\n\n case \"enum\":\n if (field._metadata.allowedValues) {\n const allowedValues = field._metadata.allowedValues.map((v) => v.value);\n if (typeof value !== \"string\" || !allowedValues.includes(value)) {\n issues.push({\n message: `Must be one of [${allowedValues.join(\", \")}]: received ${String(value)}`,\n path,\n });\n }\n }\n break;\n\n case \"nested\": {\n // Runtime input may not match the declared field type.\n // oxlint-disable typescript/no-unnecessary-condition\n if (\n typeof value !== \"object\" ||\n value === null ||\n Array.isArray(value) ||\n value instanceof Date\n ) {\n // oxlint-enable typescript/no-unnecessary-condition\n issues.push({\n message: `Expected an object: received ${String(value)}`,\n path,\n });\n return false;\n }\n\n let nestedBaseValid = true;\n for (const [fieldName, nestedField] of Object.entries(field.fields)) {\n const fieldValue = (value as Record<string, unknown>)[fieldName];\n if (\n !validateBaseField({\n ...args,\n field: nestedField,\n value: fieldValue,\n pathArray: pathArray.concat(fieldName),\n })\n ) {\n nestedBaseValid = false;\n }\n }\n return nestedBaseValid;\n }\n }\n\n return issues.length === initialIssueCount;\n}\n\nfunction validateCustomValue<T extends TailorFieldType>(\n args: FieldValidationArgs<T>,\n validateFns: NonNullable<FieldMetadata[\"validate\"]>,\n): void {\n const { value, data, user, pathArray, issues } = args;\n const path = pathArray.length > 0 ? pathArray : undefined;\n\n for (const validateInput of validateFns) {\n const { fn, message } =\n typeof validateInput === \"function\"\n ? { fn: validateInput, message: \"Validation failed\" }\n : { fn: validateInput[0], message: validateInput[1] };\n\n if (!fn({ value, data, user })) {\n issues.push({\n message,\n path,\n });\n }\n }\n}\n\nfunction validateBaseField<T extends TailorFieldType>(args: FieldValidationArgs<T>): boolean {\n const { field, value, pathArray, issues } = args;\n const path = pathArray.length > 0 ? pathArray : undefined;\n\n const isNullOrUndefined = value === null || value === undefined;\n if (field._metadata.required && isNullOrUndefined) {\n issues.push({\n message: \"Required field is missing\",\n path,\n });\n return false;\n }\n\n if (!field._metadata.required && isNullOrUndefined) {\n return true;\n }\n\n let baseValid = true;\n if (field._metadata.array) {\n if (!Array.isArray(value)) {\n issues.push({\n message: \"Expected an array\",\n path,\n });\n return false;\n }\n\n for (let i = 0; i < value.length; i++) {\n if (\n !validateBaseValue({\n ...args,\n value: value[i],\n pathArray: pathArray.concat(`[${i}]`),\n })\n ) {\n baseValid = false;\n }\n }\n } else {\n baseValid = validateBaseValue(args);\n }\n\n return baseValid;\n}\n\nfunction validateCustomField<T extends TailorFieldType>(args: FieldValidationArgs<T>): void {\n const { field, value, pathArray } = args;\n if (value === null || value === undefined) {\n return;\n }\n\n if (field.type === \"nested\") {\n const records = field._metadata.array\n ? (value as Record<string, unknown>[])\n : [value as Record<string, unknown>];\n\n for (let i = 0; i < records.length; i++) {\n const record = records[i] as Record<string, unknown>;\n const recordPath = field._metadata.array ? pathArray.concat(`[${i}]`) : pathArray;\n for (const [fieldName, nestedField] of Object.entries(field.fields)) {\n validateCustomField({\n ...args,\n field: nestedField,\n value: record[fieldName],\n pathArray: recordPath.concat(fieldName),\n });\n }\n }\n }\n\n const validateFns = field._metadata.validate;\n if (validateFns?.length) {\n validateCustomValue(args, validateFns);\n }\n}\n\nexport function parseInternal<T extends TailorFieldType, Output>(\n args: FieldParseRuntimeArgs<T>,\n): StandardSchemaV1.Result<Output> {\n const { value } = args;\n const issues: StandardSchemaV1.Issue[] = [];\n const validationArgs = { ...args, issues };\n const baseValid = validateBaseField(validationArgs);\n if (baseValid) {\n validateCustomField(validationArgs);\n }\n if (issues.length > 0) {\n return { issues };\n }\n\n return { value: (value ?? null) as Output };\n}\n"],"mappings":";;;;;;AASA,SAAgB,iBAAiB,QAAoC;CACnE,OAAO,OAAO,KAAK,UAAU;EAC3B,IAAI,OAAO,UAAU,UACnB,OAAO;GAAE;GAAO,aAAa;EAAG;EAElC,OAAO;GAAE,GAAG;GAAO,aAAa,MAAM,eAAe;EAAG;CAC1D,CAAC;AACH;;;;ACZA,MAAM,QAAQ;CACZ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,OAAO,SAAS;GACxC,CAAC;EAEL;CACF;CAEA,MAAM,cAAc,MAAM,UAAU;CACpC,IAAI,aAAa,QACf,oBAAoB,MAAM,WAAW;AAEzC;AAEA,SAAgB,cACd,MACiC;CACjC,MAAM,EAAE,UAAU;CAClB,MAAM,SAAmC,CAAC;CAC1C,MAAM,iBAAiB;EAAE,GAAG;EAAM;CAAO;CAEzC,IADkB,kBAAkB,cACxB,GACV,oBAAoB,cAAc;CAEpC,IAAI,OAAO,SAAS,GAClB,OAAO,EAAE,OAAO;CAGlB,OAAO,EAAE,OAAQ,SAAS,KAAgB;AAC5C"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger-BEiZZ3qT.mjs","names":[],"sources":["../src/cli/shared/parse-boolean.ts","../src/cli/shared/logger.ts"],"sourcesContent":["const TRUTHY_VALUES = new Set([\"true\", \"t\", \"yes\", \"y\", \"on\", \"1\"]);\nconst FALSY_VALUES = new Set([\"false\", \"f\", \"no\", \"n\", \"off\", \"0\"]);\n\n/**\n * Parse a string value as a boolean.\n *\n * Recognized values (case-insensitive, trimmed) follow Python's\n * `distutils.util.strtobool` convention:\n * - truthy: `true, t, yes, y, on, 1`\n * - falsy: `false, f, no, n, off, 0`\n *\n * Undefined, empty strings, and unrecognized values return `undefined` so\n * that callers can fall back to their own defaults.\n * @param value - The input string (e.g. an environment variable or CLI flag value)\n * @returns `true`, `false`, or `undefined` when the value is unset or unrecognized\n */\nexport function parseBoolean(value: string | undefined): boolean | undefined {\n if (value === undefined) return undefined;\n const normalized = value.trim().toLowerCase();\n if (normalized === \"\") return undefined;\n if (TRUTHY_VALUES.has(normalized)) return true;\n if (FALSY_VALUES.has(normalized)) return false;\n return undefined;\n}\n","import { formatWithOptions, type InspectOptions } from \"node:util\";\nimport chalk from \"chalk\";\nimport { formatDistanceToNowStrict } from \"date-fns\";\nimport { getBorderCharacters, table } from \"table\";\nimport { parseBoolean } from \"./parse-boolean\";\n\n/**\n * Error thrown when a prompt is attempted in a CI environment\n */\nexport class CIPromptError extends Error {\n constructor(message?: string) {\n super(\n message ??\n \"Interactive prompts are not available in CI environments. Use --yes flag to skip confirmation prompts.\",\n );\n this.name = \"CIPromptError\";\n }\n}\n\n/**\n * Semantic style functions for inline text styling\n */\nexport const styles = {\n // Status colors\n success: chalk.green,\n error: chalk.red,\n warning: chalk.yellow,\n info: chalk.cyan,\n\n // Action colors (for change sets)\n create: chalk.green,\n update: chalk.yellow,\n delete: chalk.red,\n unchanged: chalk.gray,\n\n // Emphasis\n bold: chalk.bold,\n dim: chalk.gray,\n highlight: chalk.cyanBright,\n successBright: chalk.greenBright,\n errorBright: chalk.redBright,\n\n // Resource types\n resourceType: chalk.bold,\n resourceName: chalk.cyan,\n\n // File paths\n path: chalk.cyan,\n\n // Values\n value: chalk.white,\n placeholder: chalk.gray.italic,\n};\n\n/**\n * Standardized symbols for CLI output\n */\nexport const symbols = {\n success: chalk.green(\"\\u2713\"),\n error: chalk.red(\"\\u2716\"),\n warning: chalk.yellow(\"\\u26a0\"),\n info: chalk.cyan(\"i\"),\n create: chalk.green(\"+\"),\n update: chalk.yellow(\"~\"),\n delete: chalk.red(\"-\"),\n replace: chalk.magenta(\"\\u00b1\"),\n bullet: chalk.gray(\"\\u2022\"),\n arrow: chalk.gray(\"\\u2192\"),\n};\n\n/**\n * Log output modes\n */\nexport type LogMode = \"default\" | \"stream\" | \"plain\";\n\nexport interface LogOptions {\n /** Output mode (default: \"default\") */\n mode?: LogMode;\n /** Number of spaces to indent the entire line (default: 0) */\n indent?: number;\n}\n\n/** Field transformer function. null excludes the field from table output. */\nexport type FieldTransformer = ((value: unknown, item: object) => string) | null;\n\nexport interface OutOptions {\n /** Table display field transform/exclude settings. Only applied in table mode (not JSON). */\n display?: Record<string, FieldTransformer>;\n\n /** Show null values in table output (default: false) */\n showNull?: boolean;\n}\n\n// In JSON mode, all logs go to stderr to keep stdout clean for JSON data\nlet _jsonMode = false;\n\n// Type icons for log output\nconst TYPE_ICONS: Record<string, string> = {\n info: \"ℹ\",\n success: \"✔\",\n warn: \"⚠\",\n error: \"✖\",\n debug: \"⚙\",\n trace: \"→\",\n log: \"\",\n};\n\n// Color functions for icon and message text\nconst TYPE_COLORS: Record<string, (text: string) => string> = {\n info: chalk.cyan,\n success: chalk.green,\n warn: chalk.yellow,\n error: chalk.red,\n debug: chalk.gray,\n trace: chalk.gray,\n log: (text) => text,\n};\n\ninterface FormatLogLineOptions {\n mode: string;\n indent: number;\n type: string;\n message: string;\n timestamp?: string;\n}\n\n/**\n * Formats a log line with the appropriate prefix and indentation\n * @param opts - Formatting options\n * @returns Formatted log line\n */\nexport function formatLogLine(opts: FormatLogLineOptions): string {\n const { mode, indent, type, message, timestamp } = opts;\n const indentPrefix = indent > 0 ? \" \".repeat(indent) : \"\";\n const colorFn = TYPE_COLORS[type] || ((text: string) => text);\n\n // Plain mode: color only, no icon, no timestamp\n if (mode === \"plain\") {\n return `${indentPrefix}${colorFn(message)}\\n`;\n }\n\n // Default/Stream mode: with icon and color\n const icon = TYPE_ICONS[type] || \"\";\n const prefix = icon ? `${icon} ` : \"\";\n const coloredOutput = colorFn(`${prefix}${message}`);\n const timestampPrefix = timestamp ?? \"\";\n\n return `${indentPrefix}${timestampPrefix}${coloredOutput}\\n`;\n}\n\n/**\n * Writes a formatted log line to stderr.\n * @param type - Log type (info, success, warn, error, log)\n * @param message - Log message\n * @param opts - Log options (mode and indent)\n */\nfunction writeLog(type: string, message: string, opts?: LogOptions): void {\n const mode = opts?.mode ?? \"default\";\n const indent = opts?.indent ?? 0;\n const inspectOpts: InspectOptions = {\n breakLength: process.stdout.columns || 80,\n };\n const formattedMessage = formatWithOptions(inspectOpts, message);\n const timestamp = mode === \"stream\" ? `${new Date().toLocaleTimeString()} ` : \"\";\n const output = formatLogLine({ mode, indent, type, message: formattedMessage, timestamp });\n process.stderr.write(output);\n}\n\nexport const logger = {\n get jsonMode(): boolean {\n return _jsonMode;\n },\n set jsonMode(value: boolean) {\n _jsonMode = value;\n },\n\n info(message: string, opts?: LogOptions): void {\n writeLog(\"info\", message, opts);\n },\n\n success(message: string, opts?: LogOptions): void {\n writeLog(\"success\", message, opts);\n },\n\n warn(message: string, opts?: LogOptions): void {\n writeLog(\"warn\", message, opts);\n },\n\n error(message: string, opts?: LogOptions): void {\n writeLog(\"error\", message, opts);\n },\n\n log(message: string): void {\n writeLog(\"log\", message, { mode: \"plain\" });\n },\n\n newline(): void {\n process.stderr.write(\"\\n\");\n },\n\n debug(message: string): void {\n if (parseBoolean(process.env.DEBUG) === true) {\n writeLog(\"log\", styles.dim(message), { mode: \"plain\" });\n }\n },\n\n out(data: string | object | object[], options?: OutOptions): void {\n if (typeof data === \"string\") {\n process.stdout.write(data.endsWith(\"\\n\") ? data : data + \"\\n\");\n return;\n }\n\n if (this.jsonMode) {\n // eslint-disable-next-line no-restricted-syntax\n console.log(JSON.stringify(data));\n return;\n }\n\n const display = options?.display;\n\n // Helper to format a value for table display\n const formatValue = (value: unknown, pretty = false): string => {\n if (options?.showNull && value === null) return \"NULL\";\n if (value === null || value === undefined) return \"N/A\";\n if (value instanceof Date) {\n return formatDistanceToNowStrict(value, { addSuffix: true });\n }\n if (typeof value === \"object\") {\n return pretty ? JSON.stringify(value, null, 2) : JSON.stringify(value);\n }\n return String(value);\n };\n\n // Helper to check if field should be excluded\n const isExcluded = (key: string): boolean => {\n return display !== undefined && key in display && display[key] === null;\n };\n\n // Helper to apply transformer or default formatting\n const transformValue = (key: string, value: unknown, item: object, pretty = false): string => {\n if (display && key in display) {\n const transformer = display[key];\n if (transformer) {\n return transformer(value, item);\n }\n }\n return formatValue(value, pretty);\n };\n\n if (!Array.isArray(data)) {\n const entries = Object.entries(data).filter(([key]) => !isExcluded(key));\n const formattedEntries = entries.map(([key, value]) => [\n key,\n transformValue(key, value, data, true),\n ]);\n const t = table(formattedEntries, {\n singleLine: false,\n border: getBorderCharacters(\"norc\"),\n });\n process.stdout.write(t);\n return;\n }\n\n if (data.length === 0) {\n return;\n }\n\n const allHeaders = Array.from(new Set(data.flatMap((item) => Object.keys(item))));\n const headers = allHeaders.filter((h) => !isExcluded(h));\n const rows = data.map((item) =>\n headers.map((header) =>\n transformValue(header, (item as Record<string, unknown>)[header], item),\n ),\n );\n\n const t = table([headers, ...rows], {\n border: getBorderCharacters(\"norc\"),\n drawHorizontalLine: (lineIndex, rowCount) => {\n return lineIndex === 0 || lineIndex === 1 || lineIndex === rowCount;\n },\n });\n process.stdout.write(t);\n },\n};\n"],"mappings":";;;;;;AAAA,MAAM,gCAAgB,IAAI,IAAI;CAAC;CAAQ;CAAK;CAAO;CAAK;CAAM;AAAG,CAAC;AAClE,MAAM,+BAAe,IAAI,IAAI;CAAC;CAAS;CAAK;CAAM;CAAK;CAAO;AAAG,CAAC;;;;;;;;;;;;;;AAelE,SAAgB,aAAa,OAAgD;CAC3E,IAAI,UAAU,QAAW,OAAO;CAChC,MAAM,aAAa,MAAM,KAAK,CAAC,CAAC,YAAY;CAC5C,IAAI,eAAe,IAAI,OAAO;CAC9B,IAAI,cAAc,IAAI,UAAU,GAAG,OAAO;CAC1C,IAAI,aAAa,IAAI,UAAU,GAAG,OAAO;AAE3C;;;;;;;ACdA,IAAa,gBAAb,cAAmC,MAAM;CACvC,YAAY,SAAkB;EAC5B,MACE,WACE,wGACJ;EACA,KAAK,OAAO;CACd;AACF;;;;AAKA,MAAa,SAAS;CAEpB,SAAS,MAAM;CACf,OAAO,MAAM;CACb,SAAS,MAAM;CACf,MAAM,MAAM;CAGZ,QAAQ,MAAM;CACd,QAAQ,MAAM;CACd,QAAQ,MAAM;CACd,WAAW,MAAM;CAGjB,MAAM,MAAM;CACZ,KAAK,MAAM;CACX,WAAW,MAAM;CACjB,eAAe,MAAM;CACrB,aAAa,MAAM;CAGnB,cAAc,MAAM;CACpB,cAAc,MAAM;CAGpB,MAAM,MAAM;CAGZ,OAAO,MAAM;CACb,aAAa,MAAM,KAAK;AAC1B;;;;AAKA,MAAa,UAAU;CACrB,SAAS,MAAM,MAAM,GA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