@palantir/pack.document-schema.type-gen 0.11.0 → 0.12.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 (90) hide show
  1. package/build/esm/commands/asset/assetDeployHandler.js +1 -1
  2. package/build/esm/commands/asset/assetDeployHandler.js.map +1 -1
  3. package/build/esm/commands/asset/assetUpdateSchemaHandler.js +1 -1
  4. package/build/esm/commands/asset/assetUpdateSchemaHandler.js.map +1 -1
  5. package/build/esm/commands/ir/irGenAssetHandler.js +81 -12
  6. package/build/esm/commands/ir/irGenAssetHandler.js.map +1 -1
  7. package/build/esm/commands/ir/irGenTypesHandler.js +4 -2
  8. package/build/esm/commands/ir/irGenTypesHandler.js.map +1 -1
  9. package/build/esm/commands/ir/registerIrCommands.js +2 -2
  10. package/build/esm/commands/ir/registerIrCommands.js.map +1 -1
  11. package/build/esm/commands/schema/__tests__/readPackConfig.test.js +112 -0
  12. package/build/esm/commands/schema/__tests__/readPackConfig.test.js.map +1 -0
  13. package/build/esm/commands/schema/registerSchemaCommands.js +1 -1
  14. package/build/esm/commands/schema/registerSchemaCommands.js.map +1 -1
  15. package/build/esm/commands/schema/schemaIrHandler.js +77 -11
  16. package/build/esm/commands/schema/schemaIrHandler.js.map +1 -1
  17. package/build/esm/commands/types.js.map +1 -1
  18. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/custom-discriminant.js +1 -1
  19. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/custom-discriminant.js.map +1 -1
  20. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/external-refs.js +1 -1
  21. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/external-refs.js.map +1 -1
  22. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/simple-record.js +1 -1
  23. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/simple-record.js.map +1 -1
  24. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/union-types.js +1 -1
  25. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/union-types.js.map +1 -1
  26. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/array-and-map-types.js +1 -1
  27. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/array-and-map-types.js.map +1 -1
  28. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/boolean-fields.js +1 -1
  29. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/boolean-fields.js.map +1 -1
  30. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/custom-discriminant.js +1 -1
  31. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/custom-discriminant.js.map +1 -1
  32. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/datetime-fields.js +1 -1
  33. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/datetime-fields.js.map +1 -1
  34. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/simple-records.js +1 -1
  35. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/simple-records.js.map +1 -1
  36. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/union-before-records.js +1 -1
  37. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/union-before-records.js.map +1 -1
  38. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/union-types.js +1 -1
  39. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/union-types.js.map +1 -1
  40. package/build/esm/utils/schema/__tests__/__snapshots__/generateDocumentTypeFromSchema/with-name-and-description.js +9 -0
  41. package/build/esm/utils/schema/__tests__/__snapshots__/generateDocumentTypeFromSchema/with-name-and-description.js.map +1 -0
  42. package/build/esm/utils/schema/__tests__/__snapshots__/generateVersionsFromSchema/single-version.js.map +1 -1
  43. package/build/esm/utils/schema/__tests__/__snapshots__/generateVersionsFromSchema/three-version-chain.js.map +1 -1
  44. package/build/esm/utils/schema/__tests__/__snapshots__/generateVersionsFromSchema/two-version.js.map +1 -1
  45. package/build/esm/utils/schema/__tests__/generateDocumentTypeFromSchema.test.js +34 -0
  46. package/build/esm/utils/schema/__tests__/generateDocumentTypeFromSchema.test.js.map +1 -0
  47. package/build/esm/utils/schema/generateDocumentTypeFromSchema.js +39 -0
  48. package/build/esm/utils/schema/generateDocumentTypeFromSchema.js.map +1 -0
  49. package/build/esm/utils/schema/generateIndexFromSchema.js +3 -1
  50. package/build/esm/utils/schema/generateIndexFromSchema.js.map +1 -1
  51. package/build/esm/utils/schema/resolveSchemaChain.js +12 -5
  52. package/build/esm/utils/schema/resolveSchemaChain.js.map +1 -1
  53. package/build/esm/utils/schema/runtimeSchema.js +3 -0
  54. package/build/esm/utils/schema/runtimeSchema.js.map +1 -1
  55. package/build/esm/utils/schema/writeAllSdkFiles.js +8 -8
  56. package/build/esm/utils/schema/writeAllSdkFiles.js.map +1 -1
  57. package/build/esm/utils/steps/__tests__/__snapshots__/types/arrayFields.js.map +1 -1
  58. package/build/esm/utils/steps/__tests__/__snapshots__/types/customDiscriminant.js +1 -1
  59. package/build/esm/utils/steps/__tests__/__snapshots__/types/customDiscriminant.js.map +1 -1
  60. package/build/esm/utils/steps/__tests__/__snapshots__/types/generateTypeScriptInterfaces.js +1 -1
  61. package/build/esm/utils/steps/__tests__/__snapshots__/types/generateTypeScriptInterfaces.js.map +1 -1
  62. package/build/esm/utils/steps/__tests__/__snapshots__/types/refTypes.js.map +1 -1
  63. package/build/esm/utils/steps/__tests__/__snapshots__/types/simpleRecord.js.map +1 -1
  64. package/build/esm/utils/steps/__tests__/__snapshots__/types/simpleSteps.js +1 -1
  65. package/build/esm/utils/steps/__tests__/__snapshots__/types/simpleSteps.js.map +1 -1
  66. package/build/types/commands/ir/irGenAssetHandler.d.ts +16 -5
  67. package/build/types/commands/ir/irGenAssetHandler.d.ts.map +1 -1
  68. package/build/types/commands/ir/irGenTypesHandler.d.ts +0 -1
  69. package/build/types/commands/ir/irGenTypesHandler.d.ts.map +1 -1
  70. package/build/types/commands/ir/registerIrCommands.d.ts.map +1 -1
  71. package/build/types/commands/schema/__tests__/readPackConfig.test.d.ts +2 -0
  72. package/build/types/commands/schema/__tests__/readPackConfig.test.d.ts.map +1 -0
  73. package/build/types/commands/schema/registerSchemaCommands.d.ts.map +1 -1
  74. package/build/types/commands/schema/schemaIrHandler.d.ts +28 -6
  75. package/build/types/commands/schema/schemaIrHandler.d.ts.map +1 -1
  76. package/build/types/commands/types.d.ts +3 -1
  77. package/build/types/commands/types.d.ts.map +1 -1
  78. package/build/types/utils/schema/__tests__/generateDocumentTypeFromSchema.test.d.ts +2 -0
  79. package/build/types/utils/schema/__tests__/generateDocumentTypeFromSchema.test.d.ts.map +1 -0
  80. package/build/types/utils/schema/generateDocumentTypeFromSchema.d.ts +17 -0
  81. package/build/types/utils/schema/generateDocumentTypeFromSchema.d.ts.map +1 -0
  82. package/build/types/utils/schema/generateIndexFromSchema.d.ts +1 -0
  83. package/build/types/utils/schema/generateIndexFromSchema.d.ts.map +1 -1
  84. package/build/types/utils/schema/resolveSchemaChain.d.ts +14 -1
  85. package/build/types/utils/schema/resolveSchemaChain.d.ts.map +1 -1
  86. package/build/types/utils/schema/runtimeSchema.d.ts +2 -0
  87. package/build/types/utils/schema/runtimeSchema.d.ts.map +1 -1
  88. package/build/types/utils/schema/writeAllSdkFiles.d.ts +0 -1
  89. package/build/types/utils/schema/writeAllSdkFiles.d.ts.map +1 -1
  90. package/package.json +3 -3
@@ -20,37 +20,103 @@ import path from "path";
20
20
  import { GENERATED_JSON_COMMENT } from "../../utils/generatedFileHeader.js";
21
21
  import { loadSchemaModule } from "../../utils/schema/loadSchemaModule.js";
22
22
  import { resolveSchemaChain } from "../../utils/schema/resolveSchemaChain.js";
23
+ function assertNonEmptyString(value, field, configPath) {
24
+ if (typeof value !== "string" || value.trim() === "") {
25
+ throw new Error(`'${field}' in ${configPath} must be a non-empty string, got: ${JSON.stringify(value)}`);
26
+ }
27
+ return value;
28
+ }
29
+ function readRequiredNonEmptyString(value, field, configPath) {
30
+ if (value == null) {
31
+ throw new Error(`'${field}' is required in ${configPath} and must be a non-empty string`);
32
+ }
33
+ return assertNonEmptyString(value, field, configPath);
34
+ }
35
+ export async function readPackConfig(configPath) {
36
+ const resolvedConfigPath = path.resolve(configPath);
37
+ if (!(await fs.pathExists(resolvedConfigPath))) {
38
+ throw new Error(`--config file not found: ${resolvedConfigPath}`);
39
+ }
40
+ const config = await fs.readJson(resolvedConfigPath);
41
+ const documentTypeName = readRequiredNonEmptyString(config.documentTypeName, "documentTypeName", resolvedConfigPath);
42
+ const documentTypeDescription = readRequiredNonEmptyString(config.documentTypeDescription, "documentTypeDescription", resolvedConfigPath);
43
+ let minSupportedVersion;
44
+ const rawMin = config.minSupportedVersion;
45
+ if (rawMin != null) {
46
+ if (typeof rawMin !== "number" || !Number.isInteger(rawMin) || rawMin <= 0) {
47
+ throw new Error(`'minSupportedVersion' in ${resolvedConfigPath} must be a positive integer, got: ${JSON.stringify(rawMin)}`);
48
+ }
49
+ minSupportedVersion = rawMin;
50
+ }
51
+ return {
52
+ documentTypeName,
53
+ documentTypeDescription,
54
+ minSupportedVersion
55
+ };
56
+ }
57
+
23
58
  /**
24
59
  * Resolve a TypeScript schema module to a versioned IR chain JSON file.
25
60
  *
26
- * The output is a `{ latestVersion, chain }` payload where each entry is
27
- * `{ version, ir, migrations? }` and `ir` is a single-version
28
- * `IRealTimeDocumentSchema`. This is the input format for `ir gen-types`.
61
+ * The output is a `{ latestVersion, minSupportedVersion?, chain }` payload
62
+ * where each entry is `{ version, ir, migrations? }` and `ir` is a
63
+ * single-version `IRealTimeDocumentSchema`. This is the input format for
64
+ * `ir gen-types` and `ir asset`.
65
+ *
66
+ * `--config <pack-config.json>` is required: the pack-config is the single
67
+ * source of truth for document-type identity. Required fields:
68
+ * - `documentTypeName`: the document type name embedded into each chain
69
+ * entry's IR (and surfaced as `documentTypeName` by `ir asset`).
70
+ * - `documentTypeDescription`: document type description embedded into each
71
+ * chain entry's IR.
72
+ * Optional fields:
73
+ * - `minSupportedVersion`: declares the oldest version this SDK supports;
74
+ * when set, it must match one of the chain entries' `version` values and is
75
+ * embedded as `minSupportedVersion` in the payload so downstream consumers
76
+ * (`ir gen-types`, `ir asset`) read the same value. Omitting the field is
77
+ * an explicit opt-out: the IR will not include `minSupportedVersion` and
78
+ * downstream tools default to supporting only the latest schema version.
29
79
  *
30
80
  * Note: this is distinct from the legacy single-version IR JSON consumed by
31
- * `ir deploy` / `ir asset` / `ir zod`, which is a bare `IRealTimeDocumentSchema`
32
- * (no chain, no migrations). Tools that previously read that format should
33
- * pick the entry matching `latestVersion` from `chain` and use its `ir` field.
81
+ * `ir deploy` / `ir zod`, which is a bare `IRealTimeDocumentSchema` (no chain,
82
+ * no migrations). Tools that previously read that format should pick the
83
+ * entry matching `latestVersion` from `chain` and use its `ir` field.
34
84
  */
35
85
  export async function schemaIrHandler(options) {
36
86
  const {
37
87
  input,
38
- output
88
+ output,
89
+ config
39
90
  } = options;
91
+ const {
92
+ documentTypeName,
93
+ documentTypeDescription,
94
+ minSupportedVersion
95
+ } = await readPackConfig(config);
96
+ if (minSupportedVersion == null) {
97
+ consola.warn(`--config ${path.resolve(config)} does not set 'minSupportedVersion'. The generated IR will not include it, so downstream tools (ir gen-types, ir asset) will default to supporting only the latest schema version. Add 'minSupportedVersion' to your pack-config to enable back-compat.`);
98
+ }
40
99
  consola.info(`Loading schema from: ${input}`);
41
100
  const schema = await loadSchemaModule(input);
42
101
  consola.info("Resolving versioned IR chain...");
43
102
  const {
44
103
  chain,
45
104
  latestVersion
46
- } = resolveSchemaChain(schema);
105
+ } = resolveSchemaChain(schema, minSupportedVersion, {
106
+ name: documentTypeName,
107
+ description: documentTypeDescription
108
+ });
47
109
  const outputPath = path.resolve(output);
48
110
  await fs.ensureDir(path.dirname(outputPath));
49
- await fs.writeFile(outputPath, JSON.stringify({
111
+ const payload = {
50
112
  __comment: GENERATED_JSON_COMMENT,
51
113
  latestVersion,
114
+ ...(minSupportedVersion != null ? {
115
+ minSupportedVersion
116
+ } : {}),
52
117
  chain
53
- }, null, 2) + "\n", "utf8");
54
- consola.success(`Wrote IR chain (${chain.length} version(s)) to: ${outputPath}`);
118
+ };
119
+ await fs.writeFile(outputPath, JSON.stringify(payload, null, 2) + "\n", "utf8");
120
+ consola.success(`Wrote IR chain (${chain.length} version(s), min=${minSupportedVersion ?? latestVersion}, max=${latestVersion}) to: ${outputPath}`);
55
121
  }
56
122
  //# sourceMappingURL=schemaIrHandler.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"schemaIrHandler.js","names":["consola","fs","path","GENERATED_JSON_COMMENT","loadSchemaModule","resolveSchemaChain","schemaIrHandler","options","input","output","info","schema","chain","latestVersion","outputPath","resolve","ensureDir","dirname","writeFile","JSON","stringify","__comment","success","length"],"sources":["schemaIrHandler.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"consola\";\nimport fs from \"fs-extra\";\nimport path from \"path\";\nimport { GENERATED_JSON_COMMENT } from \"../../utils/generatedFileHeader.js\";\nimport { loadSchemaModule } from \"../../utils/schema/loadSchemaModule.js\";\nimport { resolveSchemaChain } from \"../../utils/schema/resolveSchemaChain.js\";\n\ninterface SchemaIrOptions {\n input: string;\n output: string;\n}\n\n/**\n * Resolve a TypeScript schema module to a versioned IR chain JSON file.\n *\n * The output is a `{ latestVersion, chain }` payload where each entry is\n * `{ version, ir, migrations? }` and `ir` is a single-version\n * `IRealTimeDocumentSchema`. This is the input format for `ir gen-types`.\n *\n * Note: this is distinct from the legacy single-version IR JSON consumed by\n * `ir deploy` / `ir asset` / `ir zod`, which is a bare `IRealTimeDocumentSchema`\n * (no chain, no migrations). Tools that previously read that format should\n * pick the entry matching `latestVersion` from `chain` and use its `ir` field.\n */\nexport async function schemaIrHandler(options: SchemaIrOptions): Promise<void> {\n const { input, output } = options;\n\n consola.info(`Loading schema from: ${input}`);\n const schema = await loadSchemaModule(input);\n\n consola.info(\"Resolving versioned IR chain...\");\n const { chain, latestVersion } = resolveSchemaChain(schema);\n\n const outputPath = path.resolve(output);\n await fs.ensureDir(path.dirname(outputPath));\n\n const payload = {\n __comment: GENERATED_JSON_COMMENT,\n latestVersion,\n chain,\n };\n await fs.writeFile(outputPath, JSON.stringify(payload, null, 2) + \"\\n\", \"utf8\");\n\n consola.success(`Wrote IR chain (${chain.length} version(s)) to: ${outputPath}`);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,OAAO,QAAQ,SAAS;AACjC,OAAOC,EAAE,MAAM,UAAU;AACzB,OAAOC,IAAI,MAAM,MAAM;AACvB,SAASC,sBAAsB,QAAQ,oCAAoC;AAC3E,SAASC,gBAAgB,QAAQ,wCAAwC;AACzE,SAASC,kBAAkB,QAAQ,0CAA0C;AAO7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,eAAeA,CAACC,OAAwB,EAAiB;EAC7E,MAAM;IAAEC,KAAK;IAAEC;EAAO,CAAC,GAAGF,OAAO;EAEjCP,OAAO,CAACU,IAAI,CAAC,wBAAwBF,KAAK,EAAE,CAAC;EAC7C,MAAMG,MAAM,GAAG,MAAMP,gBAAgB,CAACI,KAAK,CAAC;EAE5CR,OAAO,CAACU,IAAI,CAAC,iCAAiC,CAAC;EAC/C,MAAM;IAAEE,KAAK;IAAEC;EAAc,CAAC,GAAGR,kBAAkB,CAACM,MAAM,CAAC;EAE3D,MAAMG,UAAU,GAAGZ,IAAI,CAACa,OAAO,CAACN,MAAM,CAAC;EACvC,MAAMR,EAAE,CAACe,SAAS,CAACd,IAAI,CAACe,OAAO,CAACH,UAAU,CAAC,CAAC;EAO5C,MAAMb,EAAE,CAACiB,SAAS,CAACJ,UAAU,EAAEK,IAAI,CAACC,SAAS,CAL7B;IACdC,SAAS,EAAElB,sBAAsB;IACjCU,aAAa;IACbD;EACF,CAAC,EACsD,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC;EAE/EZ,OAAO,CAACsB,OAAO,CAAC,mBAAmBV,KAAK,CAACW,MAAM,oBAAoBT,UAAU,EAAE,CAAC;AAClF","ignoreList":[]}
1
+ {"version":3,"file":"schemaIrHandler.js","names":["consola","fs","path","GENERATED_JSON_COMMENT","loadSchemaModule","resolveSchemaChain","assertNonEmptyString","value","field","configPath","trim","Error","JSON","stringify","readRequiredNonEmptyString","readPackConfig","resolvedConfigPath","resolve","pathExists","config","readJson","documentTypeName","documentTypeDescription","minSupportedVersion","rawMin","Number","isInteger","schemaIrHandler","options","input","output","warn","info","schema","chain","latestVersion","name","description","outputPath","ensureDir","dirname","payload","__comment","writeFile","success","length"],"sources":["schemaIrHandler.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"consola\";\nimport fs from \"fs-extra\";\nimport path from \"path\";\nimport { GENERATED_JSON_COMMENT } from \"../../utils/generatedFileHeader.js\";\nimport { loadSchemaModule } from \"../../utils/schema/loadSchemaModule.js\";\nimport { resolveSchemaChain } from \"../../utils/schema/resolveSchemaChain.js\";\n\ninterface SchemaIrOptions {\n input: string;\n output: string;\n config: string;\n}\n\ninterface PackConfigLike {\n documentTypeName?: unknown;\n documentTypeDescription?: unknown;\n minSupportedVersion?: unknown;\n}\n\ninterface PackConfigValues {\n readonly documentTypeName: string;\n readonly documentTypeDescription: string;\n readonly minSupportedVersion?: number;\n}\n\nfunction assertNonEmptyString(value: unknown, field: string, configPath: string): string {\n if (typeof value !== \"string\" || value.trim() === \"\") {\n throw new Error(\n `'${field}' in ${configPath} must be a non-empty string, got: ${JSON.stringify(value)}`,\n );\n }\n return value;\n}\n\nfunction readRequiredNonEmptyString(\n value: unknown,\n field: string,\n configPath: string,\n): string {\n if (value == null) {\n throw new Error(\n `'${field}' is required in ${configPath} and must be a non-empty string`,\n );\n }\n return assertNonEmptyString(value, field, configPath);\n}\n\nexport async function readPackConfig(configPath: string): Promise<PackConfigValues> {\n const resolvedConfigPath = path.resolve(configPath);\n if (!(await fs.pathExists(resolvedConfigPath))) {\n throw new Error(`--config file not found: ${resolvedConfigPath}`);\n }\n const config = (await fs.readJson(resolvedConfigPath)) as PackConfigLike;\n\n const documentTypeName = readRequiredNonEmptyString(\n config.documentTypeName,\n \"documentTypeName\",\n resolvedConfigPath,\n );\n\n const documentTypeDescription = readRequiredNonEmptyString(\n config.documentTypeDescription,\n \"documentTypeDescription\",\n resolvedConfigPath,\n );\n\n let minSupportedVersion: number | undefined;\n const rawMin = config.minSupportedVersion;\n if (rawMin != null) {\n if (typeof rawMin !== \"number\" || !Number.isInteger(rawMin) || rawMin <= 0) {\n throw new Error(\n `'minSupportedVersion' in ${resolvedConfigPath} must be a positive integer, got: ${\n JSON.stringify(rawMin)\n }`,\n );\n }\n minSupportedVersion = rawMin;\n }\n\n return { documentTypeName, documentTypeDescription, minSupportedVersion };\n}\n\n/**\n * Resolve a TypeScript schema module to a versioned IR chain JSON file.\n *\n * The output is a `{ latestVersion, minSupportedVersion?, chain }` payload\n * where each entry is `{ version, ir, migrations? }` and `ir` is a\n * single-version `IRealTimeDocumentSchema`. This is the input format for\n * `ir gen-types` and `ir asset`.\n *\n * `--config <pack-config.json>` is required: the pack-config is the single\n * source of truth for document-type identity. Required fields:\n * - `documentTypeName`: the document type name embedded into each chain\n * entry's IR (and surfaced as `documentTypeName` by `ir asset`).\n * - `documentTypeDescription`: document type description embedded into each\n * chain entry's IR.\n * Optional fields:\n * - `minSupportedVersion`: declares the oldest version this SDK supports;\n * when set, it must match one of the chain entries' `version` values and is\n * embedded as `minSupportedVersion` in the payload so downstream consumers\n * (`ir gen-types`, `ir asset`) read the same value. Omitting the field is\n * an explicit opt-out: the IR will not include `minSupportedVersion` and\n * downstream tools default to supporting only the latest schema version.\n *\n * Note: this is distinct from the legacy single-version IR JSON consumed by\n * `ir deploy` / `ir zod`, which is a bare `IRealTimeDocumentSchema` (no chain,\n * no migrations). Tools that previously read that format should pick the\n * entry matching `latestVersion` from `chain` and use its `ir` field.\n */\nexport async function schemaIrHandler(options: SchemaIrOptions): Promise<void> {\n const { input, output, config } = options;\n const { documentTypeName, documentTypeDescription, minSupportedVersion } = await readPackConfig(\n config,\n );\n\n if (minSupportedVersion == null) {\n consola.warn(\n `--config ${\n path.resolve(config)\n } does not set 'minSupportedVersion'. The generated IR will not include it, so downstream tools (ir gen-types, ir asset) will default to supporting only the latest schema version. Add 'minSupportedVersion' to your pack-config to enable back-compat.`,\n );\n }\n\n consola.info(`Loading schema from: ${input}`);\n const schema = await loadSchemaModule(input);\n\n consola.info(\"Resolving versioned IR chain...\");\n const { chain, latestVersion } = resolveSchemaChain(schema, minSupportedVersion, {\n name: documentTypeName,\n description: documentTypeDescription,\n });\n\n const outputPath = path.resolve(output);\n await fs.ensureDir(path.dirname(outputPath));\n\n const payload = {\n __comment: GENERATED_JSON_COMMENT,\n latestVersion,\n ...(minSupportedVersion != null ? { minSupportedVersion } : {}),\n chain,\n };\n await fs.writeFile(outputPath, JSON.stringify(payload, null, 2) + \"\\n\", \"utf8\");\n\n consola.success(\n `Wrote IR chain (${chain.length} version(s), min=${\n minSupportedVersion ?? latestVersion\n }, max=${latestVersion}) to: ${outputPath}`,\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,OAAO,QAAQ,SAAS;AACjC,OAAOC,EAAE,MAAM,UAAU;AACzB,OAAOC,IAAI,MAAM,MAAM;AACvB,SAASC,sBAAsB,QAAQ,oCAAoC;AAC3E,SAASC,gBAAgB,QAAQ,wCAAwC;AACzE,SAASC,kBAAkB,QAAQ,0CAA0C;AAoB7E,SAASC,oBAAoBA,CAACC,KAAc,EAAEC,KAAa,EAAEC,UAAkB,EAAU;EACvF,IAAI,OAAOF,KAAK,KAAK,QAAQ,IAAIA,KAAK,CAACG,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE;IACpD,MAAM,IAAIC,KAAK,CACb,IAAIH,KAAK,QAAQC,UAAU,qCAAqCG,IAAI,CAACC,SAAS,CAACN,KAAK,CAAC,EACvF,CAAC;EACH;EACA,OAAOA,KAAK;AACd;AAEA,SAASO,0BAA0BA,CACjCP,KAAc,EACdC,KAAa,EACbC,UAAkB,EACV;EACR,IAAIF,KAAK,IAAI,IAAI,EAAE;IACjB,MAAM,IAAII,KAAK,CACb,IAAIH,KAAK,oBAAoBC,UAAU,iCACzC,CAAC;EACH;EACA,OAAOH,oBAAoB,CAACC,KAAK,EAAEC,KAAK,EAAEC,UAAU,CAAC;AACvD;AAEA,OAAO,eAAeM,cAAcA,CAACN,UAAkB,EAA6B;EAClF,MAAMO,kBAAkB,GAAGd,IAAI,CAACe,OAAO,CAACR,UAAU,CAAC;EACnD,IAAI,EAAE,MAAMR,EAAE,CAACiB,UAAU,CAACF,kBAAkB,CAAC,CAAC,EAAE;IAC9C,MAAM,IAAIL,KAAK,CAAC,4BAA4BK,kBAAkB,EAAE,CAAC;EACnE;EACA,MAAMG,MAAM,GAAI,MAAMlB,EAAE,CAACmB,QAAQ,CAACJ,kBAAkB,CAAoB;EAExE,MAAMK,gBAAgB,GAAGP,0BAA0B,CACjDK,MAAM,CAACE,gBAAgB,EACvB,kBAAkB,EAClBL,kBACF,CAAC;EAED,MAAMM,uBAAuB,GAAGR,0BAA0B,CACxDK,MAAM,CAACG,uBAAuB,EAC9B,yBAAyB,EACzBN,kBACF,CAAC;EAED,IAAIO,mBAAuC;EAC3C,MAAMC,MAAM,GAAGL,MAAM,CAACI,mBAAmB;EACzC,IAAIC,MAAM,IAAI,IAAI,EAAE;IAClB,IAAI,OAAOA,MAAM,KAAK,QAAQ,IAAI,CAACC,MAAM,CAACC,SAAS,CAACF,MAAM,CAAC,IAAIA,MAAM,IAAI,CAAC,EAAE;MAC1E,MAAM,IAAIb,KAAK,CACb,4BAA4BK,kBAAkB,qCAC5CJ,IAAI,CAACC,SAAS,CAACW,MAAM,CAAC,EAE1B,CAAC;IACH;IACAD,mBAAmB,GAAGC,MAAM;EAC9B;EAEA,OAAO;IAAEH,gBAAgB;IAAEC,uBAAuB;IAAEC;EAAoB,CAAC;AAC3E;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeI,eAAeA,CAACC,OAAwB,EAAiB;EAC7E,MAAM;IAAEC,KAAK;IAAEC,MAAM;IAAEX;EAAO,CAAC,GAAGS,OAAO;EACzC,MAAM;IAAEP,gBAAgB;IAAEC,uBAAuB;IAAEC;EAAoB,CAAC,GAAG,MAAMR,cAAc,CAC7FI,MACF,CAAC;EAED,IAAII,mBAAmB,IAAI,IAAI,EAAE;IAC/BvB,OAAO,CAAC+B,IAAI,CACV,YACE7B,IAAI,CAACe,OAAO,CAACE,MAAM,CAAC,yPAExB,CAAC;EACH;EAEAnB,OAAO,CAACgC,IAAI,CAAC,wBAAwBH,KAAK,EAAE,CAAC;EAC7C,MAAMI,MAAM,GAAG,MAAM7B,gBAAgB,CAACyB,KAAK,CAAC;EAE5C7B,OAAO,CAACgC,IAAI,CAAC,iCAAiC,CAAC;EAC/C,MAAM;IAAEE,KAAK;IAAEC;EAAc,CAAC,GAAG9B,kBAAkB,CAAC4B,MAAM,EAAEV,mBAAmB,EAAE;IAC/Ea,IAAI,EAAEf,gBAAgB;IACtBgB,WAAW,EAAEf;EACf,CAAC,CAAC;EAEF,MAAMgB,UAAU,GAAGpC,IAAI,CAACe,OAAO,CAACa,MAAM,CAAC;EACvC,MAAM7B,EAAE,CAACsC,SAAS,CAACrC,IAAI,CAACsC,OAAO,CAACF,UAAU,CAAC,CAAC;EAE5C,MAAMG,OAAO,GAAG;IACdC,SAAS,EAAEvC,sBAAsB;IACjCgC,aAAa;IACb,IAAIZ,mBAAmB,IAAI,IAAI,GAAG;MAAEA;IAAoB,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/DW;EACF,CAAC;EACD,MAAMjC,EAAE,CAAC0C,SAAS,CAACL,UAAU,EAAE1B,IAAI,CAACC,SAAS,CAAC4B,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC;EAE/EzC,OAAO,CAAC4C,OAAO,CACb,mBAAmBV,KAAK,CAACW,MAAM,oBAC7BtB,mBAAmB,IAAIY,aAAa,SAC7BA,aAAa,SAASG,UAAU,EAC3C,CAAC;AACH","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["types.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { DocumentTypeSchema } from \"@osdk/foundry.pack\";\n\nexport type FileSystemType = \"ARTIFACTS\" | \"COMPASS\";\n\nexport interface DocumentTypeAsset {\n readonly documentTypeName: string;\n readonly documentStorageType: {\n readonly type: \"yjs\";\n readonly yjs: DocumentTypeSchema;\n };\n readonly fileSystemType: FileSystemType;\n readonly schemaVersion: number;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["types.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { DocumentTypeSchema } from \"@osdk/foundry.pack\";\n\nexport type FileSystemType = \"ARTIFACTS\" | \"COMPASS\";\n\nexport interface DocumentTypeAsset {\n readonly documentTypeName: string;\n readonly documentStorageType: {\n readonly type: \"yjs\";\n readonly yjs: {\n readonly schema: DocumentTypeSchema;\n };\n };\n readonly fileSystemType: FileSystemType;\n readonly schemaVersion: number;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- /* Generated by @palantir/pack.document-schema.type-gen@0.11.0 */
1
+ /* Generated by @palantir/pack.document-schema.type-gen@0.12.0 */
2
2
 
3
3
  import { Metadata } from '@palantir/pack.document-schema.model-types';
4
4
  import { AnimalCatSchema, AnimalDogSchema, AnimalSchema, CatSchema, DogSchema } from './schema.js';
@@ -1 +1 @@
1
- {"version":3,"file":"custom-discriminant.js","names":["Metadata","AnimalCatSchema","AnimalDogSchema","AnimalSchema","CatSchema","DogSchema","CatModel","__type","zodSchema","name","DogModel","AnimalModel","discriminant","AnimalCatModel","AnimalDogModel","DocumentModel","Cat","Dog","Animal","AnimalCat","AnimalDog","version"],"sources":["custom-discriminant.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.11.0 */\n\nimport type {\n DocumentSchema,\n RecordModel,\n UnionModel,\n} from '@palantir/pack.document-schema.model-types';\nimport { Metadata } from '@palantir/pack.document-schema.model-types';\nimport type { Animal, AnimalCat, AnimalDog, Cat, Dog } from './types.js';\nimport {\n AnimalCatSchema,\n AnimalDogSchema,\n AnimalSchema,\n CatSchema,\n DogSchema,\n} from './schema.js';\n\nexport interface CatModel extends RecordModel<Cat, typeof CatSchema> {}\nexport const CatModel: CatModel = {\n __type: {} as Cat,\n zodSchema: CatSchema,\n [Metadata]: {\n name: 'Cat',\n },\n};\n\nexport interface DogModel extends RecordModel<Dog, typeof DogSchema> {}\nexport const DogModel: DogModel = {\n __type: {} as Dog,\n zodSchema: DogSchema,\n [Metadata]: {\n name: 'Dog',\n },\n};\n\nexport interface AnimalModel extends UnionModel<Animal, typeof AnimalSchema> {}\nexport const AnimalModel: AnimalModel = {\n __type: {} as Animal,\n zodSchema: AnimalSchema,\n [Metadata]: {\n discriminant: 'kind',\n name: 'Animal',\n },\n};\n\nexport interface AnimalCatModel extends UnionModel<\n AnimalCat,\n typeof AnimalCatSchema\n> {}\nexport const AnimalCatModel: AnimalCatModel = {\n __type: {} as AnimalCat,\n zodSchema: AnimalCatSchema,\n [Metadata]: {\n discriminant: 'kind',\n name: 'AnimalCat',\n },\n};\n\nexport interface AnimalDogModel extends UnionModel<\n AnimalDog,\n typeof AnimalDogSchema\n> {}\nexport const AnimalDogModel: AnimalDogModel = {\n __type: {} as AnimalDog,\n zodSchema: AnimalDogSchema,\n [Metadata]: {\n discriminant: 'kind',\n name: 'AnimalDog',\n },\n};\n\nexport const DocumentModel = {\n Cat: CatModel,\n Dog: DogModel,\n Animal: AnimalModel,\n AnimalCat: AnimalCatModel,\n AnimalDog: AnimalDogModel,\n [Metadata]: {\n version: 1,\n },\n} as const satisfies DocumentSchema;\n\nexport type DocumentModel = typeof DocumentModel;\n"],"mappings":"AAAA;;AAOA,SAASA,QAAQ,QAAQ,4CAA4C;AAErE,SACEC,eAAe,EACfC,eAAe,EACfC,YAAY,EACZC,SAAS,EACTC,SAAS,QACJ,aAAa;AAGpB,OAAO,MAAMC,QAAkB,GAAG;EAChCC,MAAM,EAAE,CAAC,CAAQ;EACjBC,SAAS,EAAEJ,SAAS;EACpB,CAACJ,QAAQ,GAAG;IACVS,IAAI,EAAE;EACR;AACF,CAAC;AAGD,OAAO,MAAMC,QAAkB,GAAG;EAChCH,MAAM,EAAE,CAAC,CAAQ;EACjBC,SAAS,EAAEH,SAAS;EACpB,CAACL,QAAQ,GAAG;IACVS,IAAI,EAAE;EACR;AACF,CAAC;AAGD,OAAO,MAAME,WAAwB,GAAG;EACtCJ,MAAM,EAAE,CAAC,CAAW;EACpBC,SAAS,EAAEL,YAAY;EACvB,CAACH,QAAQ,GAAG;IACVY,YAAY,EAAE,MAAM;IACpBH,IAAI,EAAE;EACR;AACF,CAAC;AAMD,OAAO,MAAMI,cAA8B,GAAG;EAC5CN,MAAM,EAAE,CAAC,CAAc;EACvBC,SAAS,EAAEP,eAAe;EAC1B,CAACD,QAAQ,GAAG;IACVY,YAAY,EAAE,MAAM;IACpBH,IAAI,EAAE;EACR;AACF,CAAC;AAMD,OAAO,MAAMK,cAA8B,GAAG;EAC5CP,MAAM,EAAE,CAAC,CAAc;EACvBC,SAAS,EAAEN,eAAe;EAC1B,CAACF,QAAQ,GAAG;IACVY,YAAY,EAAE,MAAM;IACpBH,IAAI,EAAE;EACR;AACF,CAAC;AAED,OAAO,MAAMM,aAAa,GAAG;EAC3BC,GAAG,EAAEV,QAAQ;EACbW,GAAG,EAAEP,QAAQ;EACbQ,MAAM,EAAEP,WAAW;EACnBQ,SAAS,EAAEN,cAAc;EACzBO,SAAS,EAAEN,cAAc;EACzB,CAACd,QAAQ,GAAG;IACVqB,OAAO,EAAE;EACX;AACF,CAAmC","ignoreList":[]}
1
+ {"version":3,"file":"custom-discriminant.js","names":["Metadata","AnimalCatSchema","AnimalDogSchema","AnimalSchema","CatSchema","DogSchema","CatModel","__type","zodSchema","name","DogModel","AnimalModel","discriminant","AnimalCatModel","AnimalDogModel","DocumentModel","Cat","Dog","Animal","AnimalCat","AnimalDog","version"],"sources":["custom-discriminant.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.12.0 */\n\nimport type {\n DocumentSchema,\n RecordModel,\n UnionModel,\n} from '@palantir/pack.document-schema.model-types';\nimport { Metadata } from '@palantir/pack.document-schema.model-types';\nimport type { Animal, AnimalCat, AnimalDog, Cat, Dog } from './types.js';\nimport {\n AnimalCatSchema,\n AnimalDogSchema,\n AnimalSchema,\n CatSchema,\n DogSchema,\n} from './schema.js';\n\nexport interface CatModel extends RecordModel<Cat, typeof CatSchema> {}\nexport const CatModel: CatModel = {\n __type: {} as Cat,\n zodSchema: CatSchema,\n [Metadata]: {\n name: 'Cat',\n },\n};\n\nexport interface DogModel extends RecordModel<Dog, typeof DogSchema> {}\nexport const DogModel: DogModel = {\n __type: {} as Dog,\n zodSchema: DogSchema,\n [Metadata]: {\n name: 'Dog',\n },\n};\n\nexport interface AnimalModel extends UnionModel<Animal, typeof AnimalSchema> {}\nexport const AnimalModel: AnimalModel = {\n __type: {} as Animal,\n zodSchema: AnimalSchema,\n [Metadata]: {\n discriminant: 'kind',\n name: 'Animal',\n },\n};\n\nexport interface AnimalCatModel extends UnionModel<\n AnimalCat,\n typeof AnimalCatSchema\n> {}\nexport const AnimalCatModel: AnimalCatModel = {\n __type: {} as AnimalCat,\n zodSchema: AnimalCatSchema,\n [Metadata]: {\n discriminant: 'kind',\n name: 'AnimalCat',\n },\n};\n\nexport interface AnimalDogModel extends UnionModel<\n AnimalDog,\n typeof AnimalDogSchema\n> {}\nexport const AnimalDogModel: AnimalDogModel = {\n __type: {} as AnimalDog,\n zodSchema: AnimalDogSchema,\n [Metadata]: {\n discriminant: 'kind',\n name: 'AnimalDog',\n },\n};\n\nexport const DocumentModel = {\n Cat: CatModel,\n Dog: DogModel,\n Animal: AnimalModel,\n AnimalCat: AnimalCatModel,\n AnimalDog: AnimalDogModel,\n [Metadata]: {\n version: 1,\n },\n} as const satisfies DocumentSchema;\n\nexport type DocumentModel = typeof DocumentModel;\n"],"mappings":"AAAA;;AAOA,SAASA,QAAQ,QAAQ,4CAA4C;AAErE,SACEC,eAAe,EACfC,eAAe,EACfC,YAAY,EACZC,SAAS,EACTC,SAAS,QACJ,aAAa;AAGpB,OAAO,MAAMC,QAAkB,GAAG;EAChCC,MAAM,EAAE,CAAC,CAAQ;EACjBC,SAAS,EAAEJ,SAAS;EACpB,CAACJ,QAAQ,GAAG;IACVS,IAAI,EAAE;EACR;AACF,CAAC;AAGD,OAAO,MAAMC,QAAkB,GAAG;EAChCH,MAAM,EAAE,CAAC,CAAQ;EACjBC,SAAS,EAAEH,SAAS;EACpB,CAACL,QAAQ,GAAG;IACVS,IAAI,EAAE;EACR;AACF,CAAC;AAGD,OAAO,MAAME,WAAwB,GAAG;EACtCJ,MAAM,EAAE,CAAC,CAAW;EACpBC,SAAS,EAAEL,YAAY;EACvB,CAACH,QAAQ,GAAG;IACVY,YAAY,EAAE,MAAM;IACpBH,IAAI,EAAE;EACR;AACF,CAAC;AAMD,OAAO,MAAMI,cAA8B,GAAG;EAC5CN,MAAM,EAAE,CAAC,CAAc;EACvBC,SAAS,EAAEP,eAAe;EAC1B,CAACD,QAAQ,GAAG;IACVY,YAAY,EAAE,MAAM;IACpBH,IAAI,EAAE;EACR;AACF,CAAC;AAMD,OAAO,MAAMK,cAA8B,GAAG;EAC5CP,MAAM,EAAE,CAAC,CAAc;EACvBC,SAAS,EAAEN,eAAe;EAC1B,CAACF,QAAQ,GAAG;IACVY,YAAY,EAAE,MAAM;IACpBH,IAAI,EAAE;EACR;AACF,CAAC;AAED,OAAO,MAAMM,aAAa,GAAG;EAC3BC,GAAG,EAAEV,QAAQ;EACbW,GAAG,EAAEP,QAAQ;EACbQ,MAAM,EAAEP,WAAW;EACnBQ,SAAS,EAAEN,cAAc;EACzBO,SAAS,EAAEN,cAAc;EACzB,CAACd,QAAQ,GAAG;IACVqB,OAAO,EAAE;EACX;AACF,CAAmC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- /* Generated by @palantir/pack.document-schema.type-gen@0.11.0 */
1
+ /* Generated by @palantir/pack.document-schema.type-gen@0.12.0 */
2
2
 
3
3
  import { Metadata } from '@palantir/pack.document-schema.model-types';
4
4
  import { EventSchema } from './schema.js';
@@ -1 +1 @@
1
- {"version":3,"file":"external-refs.js","names":["Metadata","EventSchema","EventModel","__type","zodSchema","externalRefFieldTypes","documentRef","userRef","name","DocumentModel","Event","version"],"sources":["external-refs.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.11.0 */\n\nimport type {\n DocumentSchema,\n RecordModel,\n UnionModel,\n} from '@palantir/pack.document-schema.model-types';\nimport { Metadata } from '@palantir/pack.document-schema.model-types';\nimport type { Event } from './types.js';\nimport { EventSchema } from './schema.js';\n\nexport interface EventModel extends RecordModel<Event, typeof EventSchema> {}\nexport const EventModel: EventModel = {\n __type: {} as Event,\n zodSchema: EventSchema,\n [Metadata]: {\n externalRefFieldTypes: {\n documentRef: 'docRef',\n userRef: 'userRef',\n },\n name: 'Event',\n },\n};\n\nexport const DocumentModel = {\n Event: EventModel,\n [Metadata]: {\n version: 1,\n },\n} as const satisfies DocumentSchema;\n\nexport type DocumentModel = typeof DocumentModel;\n"],"mappings":"AAAA;;AAOA,SAASA,QAAQ,QAAQ,4CAA4C;AAErE,SAASC,WAAW,QAAQ,aAAa;AAGzC,OAAO,MAAMC,UAAsB,GAAG;EACpCC,MAAM,EAAE,CAAC,CAAU;EACnBC,SAAS,EAAEH,WAAW;EACtB,CAACD,QAAQ,GAAG;IACVK,qBAAqB,EAAE;MACrBC,WAAW,EAAE,QAAQ;MACrBC,OAAO,EAAE;IACX,CAAC;IACDC,IAAI,EAAE;EACR;AACF,CAAC;AAED,OAAO,MAAMC,aAAa,GAAG;EAC3BC,KAAK,EAAER,UAAU;EACjB,CAACF,QAAQ,GAAG;IACVW,OAAO,EAAE;EACX;AACF,CAAmC","ignoreList":[]}
1
+ {"version":3,"file":"external-refs.js","names":["Metadata","EventSchema","EventModel","__type","zodSchema","externalRefFieldTypes","documentRef","userRef","name","DocumentModel","Event","version"],"sources":["external-refs.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.12.0 */\n\nimport type {\n DocumentSchema,\n RecordModel,\n UnionModel,\n} from '@palantir/pack.document-schema.model-types';\nimport { Metadata } from '@palantir/pack.document-schema.model-types';\nimport type { Event } from './types.js';\nimport { EventSchema } from './schema.js';\n\nexport interface EventModel extends RecordModel<Event, typeof EventSchema> {}\nexport const EventModel: EventModel = {\n __type: {} as Event,\n zodSchema: EventSchema,\n [Metadata]: {\n externalRefFieldTypes: {\n documentRef: 'docRef',\n userRef: 'userRef',\n },\n name: 'Event',\n },\n};\n\nexport const DocumentModel = {\n Event: EventModel,\n [Metadata]: {\n version: 1,\n },\n} as const satisfies DocumentSchema;\n\nexport type DocumentModel = typeof DocumentModel;\n"],"mappings":"AAAA;;AAOA,SAASA,QAAQ,QAAQ,4CAA4C;AAErE,SAASC,WAAW,QAAQ,aAAa;AAGzC,OAAO,MAAMC,UAAsB,GAAG;EACpCC,MAAM,EAAE,CAAC,CAAU;EACnBC,SAAS,EAAEH,WAAW;EACtB,CAACD,QAAQ,GAAG;IACVK,qBAAqB,EAAE;MACrBC,WAAW,EAAE,QAAQ;MACrBC,OAAO,EAAE;IACX,CAAC;IACDC,IAAI,EAAE;EACR;AACF,CAAC;AAED,OAAO,MAAMC,aAAa,GAAG;EAC3BC,KAAK,EAAER,UAAU;EACjB,CAACF,QAAQ,GAAG;IACVW,OAAO,EAAE;EACX;AACF,CAAmC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- /* Generated by @palantir/pack.document-schema.type-gen@0.11.0 */
1
+ /* Generated by @palantir/pack.document-schema.type-gen@0.12.0 */
2
2
 
3
3
  import { Metadata } from '@palantir/pack.document-schema.model-types';
4
4
  import { PersonSchema } from './schema.js';
@@ -1 +1 @@
1
- {"version":3,"file":"simple-record.js","names":["Metadata","PersonSchema","PersonModel","__type","zodSchema","name","DocumentModel","Person","version"],"sources":["simple-record.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.11.0 */\n\nimport type {\n DocumentSchema,\n RecordModel,\n UnionModel,\n} from '@palantir/pack.document-schema.model-types';\nimport { Metadata } from '@palantir/pack.document-schema.model-types';\nimport type { Person } from './types.js';\nimport { PersonSchema } from './schema.js';\n\nexport interface PersonModel extends RecordModel<Person, typeof PersonSchema> {}\nexport const PersonModel: PersonModel = {\n __type: {} as Person,\n zodSchema: PersonSchema,\n [Metadata]: {\n name: 'Person',\n },\n};\n\nexport const DocumentModel = {\n Person: PersonModel,\n [Metadata]: {\n version: 1,\n },\n} as const satisfies DocumentSchema;\n\nexport type DocumentModel = typeof DocumentModel;\n"],"mappings":"AAAA;;AAOA,SAASA,QAAQ,QAAQ,4CAA4C;AAErE,SAASC,YAAY,QAAQ,aAAa;AAG1C,OAAO,MAAMC,WAAwB,GAAG;EACtCC,MAAM,EAAE,CAAC,CAAW;EACpBC,SAAS,EAAEH,YAAY;EACvB,CAACD,QAAQ,GAAG;IACVK,IAAI,EAAE;EACR;AACF,CAAC;AAED,OAAO,MAAMC,aAAa,GAAG;EAC3BC,MAAM,EAAEL,WAAW;EACnB,CAACF,QAAQ,GAAG;IACVQ,OAAO,EAAE;EACX;AACF,CAAmC","ignoreList":[]}
1
+ {"version":3,"file":"simple-record.js","names":["Metadata","PersonSchema","PersonModel","__type","zodSchema","name","DocumentModel","Person","version"],"sources":["simple-record.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.12.0 */\n\nimport type {\n DocumentSchema,\n RecordModel,\n UnionModel,\n} from '@palantir/pack.document-schema.model-types';\nimport { Metadata } from '@palantir/pack.document-schema.model-types';\nimport type { Person } from './types.js';\nimport { PersonSchema } from './schema.js';\n\nexport interface PersonModel extends RecordModel<Person, typeof PersonSchema> {}\nexport const PersonModel: PersonModel = {\n __type: {} as Person,\n zodSchema: PersonSchema,\n [Metadata]: {\n name: 'Person',\n },\n};\n\nexport const DocumentModel = {\n Person: PersonModel,\n [Metadata]: {\n version: 1,\n },\n} as const satisfies DocumentSchema;\n\nexport type DocumentModel = typeof DocumentModel;\n"],"mappings":"AAAA;;AAOA,SAASA,QAAQ,QAAQ,4CAA4C;AAErE,SAASC,YAAY,QAAQ,aAAa;AAG1C,OAAO,MAAMC,WAAwB,GAAG;EACtCC,MAAM,EAAE,CAAC,CAAW;EACpBC,SAAS,EAAEH,YAAY;EACvB,CAACD,QAAQ,GAAG;IACVK,IAAI,EAAE;EACR;AACF,CAAC;AAED,OAAO,MAAMC,aAAa,GAAG;EAC3BC,MAAM,EAAEL,WAAW;EACnB,CAACF,QAAQ,GAAG;IACVQ,OAAO,EAAE;EACX;AACF,CAAmC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- /* Generated by @palantir/pack.document-schema.type-gen@0.11.0 */
1
+ /* Generated by @palantir/pack.document-schema.type-gen@0.12.0 */
2
2
 
3
3
  import { Metadata } from '@palantir/pack.document-schema.model-types';
4
4
  import { NodeObjectSchema, NodeSchema, NodeTextBoxSchema, ObjectNodeSchema, TextBoxSchema } from './schema.js';
@@ -1 +1 @@
1
- {"version":3,"file":"union-types.js","names":["Metadata","NodeObjectSchema","NodeSchema","NodeTextBoxSchema","ObjectNodeSchema","TextBoxSchema","ObjectNodeModel","__type","zodSchema","name","TextBoxModel","NodeModel","discriminant","NodeObjectModel","NodeTextBoxModel","DocumentModel","ObjectNode","TextBox","Node","NodeObject","NodeTextBox","version"],"sources":["union-types.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.11.0 */\n\nimport type {\n DocumentSchema,\n RecordModel,\n UnionModel,\n} from '@palantir/pack.document-schema.model-types';\nimport { Metadata } from '@palantir/pack.document-schema.model-types';\nimport type {\n Node,\n NodeObject,\n NodeTextBox,\n ObjectNode,\n TextBox,\n} from './types.js';\nimport {\n NodeObjectSchema,\n NodeSchema,\n NodeTextBoxSchema,\n ObjectNodeSchema,\n TextBoxSchema,\n} from './schema.js';\n\nexport interface ObjectNodeModel extends RecordModel<\n ObjectNode,\n typeof ObjectNodeSchema\n> {}\nexport const ObjectNodeModel: ObjectNodeModel = {\n __type: {} as ObjectNode,\n zodSchema: ObjectNodeSchema,\n [Metadata]: {\n name: 'ObjectNode',\n },\n};\n\nexport interface TextBoxModel extends RecordModel<\n TextBox,\n typeof TextBoxSchema\n> {}\nexport const TextBoxModel: TextBoxModel = {\n __type: {} as TextBox,\n zodSchema: TextBoxSchema,\n [Metadata]: {\n name: 'TextBox',\n },\n};\n\nexport interface NodeModel extends UnionModel<Node, typeof NodeSchema> {}\nexport const NodeModel: NodeModel = {\n __type: {} as Node,\n zodSchema: NodeSchema,\n [Metadata]: {\n discriminant: 'type',\n name: 'Node',\n },\n};\n\nexport interface NodeObjectModel extends UnionModel<\n NodeObject,\n typeof NodeObjectSchema\n> {}\nexport const NodeObjectModel: NodeObjectModel = {\n __type: {} as NodeObject,\n zodSchema: NodeObjectSchema,\n [Metadata]: {\n discriminant: 'type',\n name: 'NodeObject',\n },\n};\n\nexport interface NodeTextBoxModel extends UnionModel<\n NodeTextBox,\n typeof NodeTextBoxSchema\n> {}\nexport const NodeTextBoxModel: NodeTextBoxModel = {\n __type: {} as NodeTextBox,\n zodSchema: NodeTextBoxSchema,\n [Metadata]: {\n discriminant: 'type',\n name: 'NodeTextBox',\n },\n};\n\nexport const DocumentModel = {\n ObjectNode: ObjectNodeModel,\n TextBox: TextBoxModel,\n Node: NodeModel,\n NodeObject: NodeObjectModel,\n NodeTextBox: NodeTextBoxModel,\n [Metadata]: {\n version: 1,\n },\n} as const satisfies DocumentSchema;\n\nexport type DocumentModel = typeof DocumentModel;\n"],"mappings":"AAAA;;AAOA,SAASA,QAAQ,QAAQ,4CAA4C;AAQrE,SACEC,gBAAgB,EAChBC,UAAU,EACVC,iBAAiB,EACjBC,gBAAgB,EAChBC,aAAa,QACR,aAAa;AAMpB,OAAO,MAAMC,eAAgC,GAAG;EAC9CC,MAAM,EAAE,CAAC,CAAe;EACxBC,SAAS,EAAEJ,gBAAgB;EAC3B,CAACJ,QAAQ,GAAG;IACVS,IAAI,EAAE;EACR;AACF,CAAC;AAMD,OAAO,MAAMC,YAA0B,GAAG;EACxCH,MAAM,EAAE,CAAC,CAAY;EACrBC,SAAS,EAAEH,aAAa;EACxB,CAACL,QAAQ,GAAG;IACVS,IAAI,EAAE;EACR;AACF,CAAC;AAGD,OAAO,MAAME,SAAoB,GAAG;EAClCJ,MAAM,EAAE,CAAC,CAAS;EAClBC,SAAS,EAAEN,UAAU;EACrB,CAACF,QAAQ,GAAG;IACVY,YAAY,EAAE,MAAM;IACpBH,IAAI,EAAE;EACR;AACF,CAAC;AAMD,OAAO,MAAMI,eAAgC,GAAG;EAC9CN,MAAM,EAAE,CAAC,CAAe;EACxBC,SAAS,EAAEP,gBAAgB;EAC3B,CAACD,QAAQ,GAAG;IACVY,YAAY,EAAE,MAAM;IACpBH,IAAI,EAAE;EACR;AACF,CAAC;AAMD,OAAO,MAAMK,gBAAkC,GAAG;EAChDP,MAAM,EAAE,CAAC,CAAgB;EACzBC,SAAS,EAAEL,iBAAiB;EAC5B,CAACH,QAAQ,GAAG;IACVY,YAAY,EAAE,MAAM;IACpBH,IAAI,EAAE;EACR;AACF,CAAC;AAED,OAAO,MAAMM,aAAa,GAAG;EAC3BC,UAAU,EAAEV,eAAe;EAC3BW,OAAO,EAAEP,YAAY;EACrBQ,IAAI,EAAEP,SAAS;EACfQ,UAAU,EAAEN,eAAe;EAC3BO,WAAW,EAAEN,gBAAgB;EAC7B,CAACd,QAAQ,GAAG;IACVqB,OAAO,EAAE;EACX;AACF,CAAmC","ignoreList":[]}
1
+ {"version":3,"file":"union-types.js","names":["Metadata","NodeObjectSchema","NodeSchema","NodeTextBoxSchema","ObjectNodeSchema","TextBoxSchema","ObjectNodeModel","__type","zodSchema","name","TextBoxModel","NodeModel","discriminant","NodeObjectModel","NodeTextBoxModel","DocumentModel","ObjectNode","TextBox","Node","NodeObject","NodeTextBox","version"],"sources":["union-types.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.12.0 */\n\nimport type {\n DocumentSchema,\n RecordModel,\n UnionModel,\n} from '@palantir/pack.document-schema.model-types';\nimport { Metadata } from '@palantir/pack.document-schema.model-types';\nimport type {\n Node,\n NodeObject,\n NodeTextBox,\n ObjectNode,\n TextBox,\n} from './types.js';\nimport {\n NodeObjectSchema,\n NodeSchema,\n NodeTextBoxSchema,\n ObjectNodeSchema,\n TextBoxSchema,\n} from './schema.js';\n\nexport interface ObjectNodeModel extends RecordModel<\n ObjectNode,\n typeof ObjectNodeSchema\n> {}\nexport const ObjectNodeModel: ObjectNodeModel = {\n __type: {} as ObjectNode,\n zodSchema: ObjectNodeSchema,\n [Metadata]: {\n name: 'ObjectNode',\n },\n};\n\nexport interface TextBoxModel extends RecordModel<\n TextBox,\n typeof TextBoxSchema\n> {}\nexport const TextBoxModel: TextBoxModel = {\n __type: {} as TextBox,\n zodSchema: TextBoxSchema,\n [Metadata]: {\n name: 'TextBox',\n },\n};\n\nexport interface NodeModel extends UnionModel<Node, typeof NodeSchema> {}\nexport const NodeModel: NodeModel = {\n __type: {} as Node,\n zodSchema: NodeSchema,\n [Metadata]: {\n discriminant: 'type',\n name: 'Node',\n },\n};\n\nexport interface NodeObjectModel extends UnionModel<\n NodeObject,\n typeof NodeObjectSchema\n> {}\nexport const NodeObjectModel: NodeObjectModel = {\n __type: {} as NodeObject,\n zodSchema: NodeObjectSchema,\n [Metadata]: {\n discriminant: 'type',\n name: 'NodeObject',\n },\n};\n\nexport interface NodeTextBoxModel extends UnionModel<\n NodeTextBox,\n typeof NodeTextBoxSchema\n> {}\nexport const NodeTextBoxModel: NodeTextBoxModel = {\n __type: {} as NodeTextBox,\n zodSchema: NodeTextBoxSchema,\n [Metadata]: {\n discriminant: 'type',\n name: 'NodeTextBox',\n },\n};\n\nexport const DocumentModel = {\n ObjectNode: ObjectNodeModel,\n TextBox: TextBoxModel,\n Node: NodeModel,\n NodeObject: NodeObjectModel,\n NodeTextBox: NodeTextBoxModel,\n [Metadata]: {\n version: 1,\n },\n} as const satisfies DocumentSchema;\n\nexport type DocumentModel = typeof DocumentModel;\n"],"mappings":"AAAA;;AAOA,SAASA,QAAQ,QAAQ,4CAA4C;AAQrE,SACEC,gBAAgB,EAChBC,UAAU,EACVC,iBAAiB,EACjBC,gBAAgB,EAChBC,aAAa,QACR,aAAa;AAMpB,OAAO,MAAMC,eAAgC,GAAG;EAC9CC,MAAM,EAAE,CAAC,CAAe;EACxBC,SAAS,EAAEJ,gBAAgB;EAC3B,CAACJ,QAAQ,GAAG;IACVS,IAAI,EAAE;EACR;AACF,CAAC;AAMD,OAAO,MAAMC,YAA0B,GAAG;EACxCH,MAAM,EAAE,CAAC,CAAY;EACrBC,SAAS,EAAEH,aAAa;EACxB,CAACL,QAAQ,GAAG;IACVS,IAAI,EAAE;EACR;AACF,CAAC;AAGD,OAAO,MAAME,SAAoB,GAAG;EAClCJ,MAAM,EAAE,CAAC,CAAS;EAClBC,SAAS,EAAEN,UAAU;EACrB,CAACF,QAAQ,GAAG;IACVY,YAAY,EAAE,MAAM;IACpBH,IAAI,EAAE;EACR;AACF,CAAC;AAMD,OAAO,MAAMI,eAAgC,GAAG;EAC9CN,MAAM,EAAE,CAAC,CAAe;EACxBC,SAAS,EAAEP,gBAAgB;EAC3B,CAACD,QAAQ,GAAG;IACVY,YAAY,EAAE,MAAM;IACpBH,IAAI,EAAE;EACR;AACF,CAAC;AAMD,OAAO,MAAMK,gBAAkC,GAAG;EAChDP,MAAM,EAAE,CAAC,CAAgB;EACzBC,SAAS,EAAEL,iBAAiB;EAC5B,CAACH,QAAQ,GAAG;IACVY,YAAY,EAAE,MAAM;IACpBH,IAAI,EAAE;EACR;AACF,CAAC;AAED,OAAO,MAAMM,aAAa,GAAG;EAC3BC,UAAU,EAAEV,eAAe;EAC3BW,OAAO,EAAEP,YAAY;EACrBQ,IAAI,EAAEP,SAAS;EACfQ,UAAU,EAAEN,eAAe;EAC3BO,WAAW,EAAEN,gBAAgB;EAC7B,CAACd,QAAQ,GAAG;IACVqB,OAAO,EAAE;EACX;AACF,CAAmC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- /* Generated by @palantir/pack.document-schema.type-gen@0.11.0 */
1
+ /* Generated by @palantir/pack.document-schema.type-gen@0.12.0 */
2
2
 
3
3
  import { z } from 'zod';
4
4
  export const ContainerSchema = z.object({
@@ -1 +1 @@
1
- {"version":3,"file":"array-and-map-types.js","names":["z","ContainerSchema","object","tags","array","string","metadata","record","unknown"],"sources":["array-and-map-types.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.11.0 */\n\nimport { z } from 'zod';\n\nexport const ContainerSchema = z.object({\n tags: z.array(z.string()),\n metadata: z.record(z.string(), z.unknown()),\n});\n"],"mappings":"AAAA;;AAEA,SAASA,CAAC,QAAQ,KAAK;AAEvB,OAAO,MAAMC,eAAe,GAAGD,CAAC,CAACE,MAAM,CAAC;EACtCC,IAAI,EAAEH,CAAC,CAACI,KAAK,CAACJ,CAAC,CAACK,MAAM,CAAC,CAAC,CAAC;EACzBC,QAAQ,EAAEN,CAAC,CAACO,MAAM,CAACP,CAAC,CAACK,MAAM,CAAC,CAAC,EAAEL,CAAC,CAACQ,OAAO,CAAC,CAAC;AAC5C,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"array-and-map-types.js","names":["z","ContainerSchema","object","tags","array","string","metadata","record","unknown"],"sources":["array-and-map-types.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.12.0 */\n\nimport { z } from 'zod';\n\nexport const ContainerSchema = z.object({\n tags: z.array(z.string()),\n metadata: z.record(z.string(), z.unknown()),\n});\n"],"mappings":"AAAA;;AAEA,SAASA,CAAC,QAAQ,KAAK;AAEvB,OAAO,MAAMC,eAAe,GAAGD,CAAC,CAACE,MAAM,CAAC;EACtCC,IAAI,EAAEH,CAAC,CAACI,KAAK,CAACJ,CAAC,CAACK,MAAM,CAAC,CAAC,CAAC;EACzBC,QAAQ,EAAEN,CAAC,CAACO,MAAM,CAACP,CAAC,CAACK,MAAM,CAAC,CAAC,EAAEL,CAAC,CAACQ,OAAO,CAAC,CAAC;AAC5C,CAAC,CAAC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- /* Generated by @palantir/pack.document-schema.type-gen@0.11.0 */
1
+ /* Generated by @palantir/pack.document-schema.type-gen@0.12.0 */
2
2
 
3
3
  import { z } from 'zod';
4
4
  export const FeatureSchema = z.object({
@@ -1 +1 @@
1
- {"version":3,"file":"boolean-fields.js","names":["z","FeatureSchema","object","enabled","boolean","isPublic","optional","flags","array"],"sources":["boolean-fields.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.11.0 */\n\nimport { z } from 'zod';\n\nexport const FeatureSchema = z.object({\n enabled: z.boolean(),\n isPublic: z.boolean().optional(),\n flags: z.array(z.boolean()),\n});\n"],"mappings":"AAAA;;AAEA,SAASA,CAAC,QAAQ,KAAK;AAEvB,OAAO,MAAMC,aAAa,GAAGD,CAAC,CAACE,MAAM,CAAC;EACpCC,OAAO,EAAEH,CAAC,CAACI,OAAO,CAAC,CAAC;EACpBC,QAAQ,EAAEL,CAAC,CAACI,OAAO,CAAC,CAAC,CAACE,QAAQ,CAAC,CAAC;EAChCC,KAAK,EAAEP,CAAC,CAACQ,KAAK,CAACR,CAAC,CAACI,OAAO,CAAC,CAAC;AAC5B,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"boolean-fields.js","names":["z","FeatureSchema","object","enabled","boolean","isPublic","optional","flags","array"],"sources":["boolean-fields.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.12.0 */\n\nimport { z } from 'zod';\n\nexport const FeatureSchema = z.object({\n enabled: z.boolean(),\n isPublic: z.boolean().optional(),\n flags: z.array(z.boolean()),\n});\n"],"mappings":"AAAA;;AAEA,SAASA,CAAC,QAAQ,KAAK;AAEvB,OAAO,MAAMC,aAAa,GAAGD,CAAC,CAACE,MAAM,CAAC;EACpCC,OAAO,EAAEH,CAAC,CAACI,OAAO,CAAC,CAAC;EACpBC,QAAQ,EAAEL,CAAC,CAACI,OAAO,CAAC,CAAC,CAACE,QAAQ,CAAC,CAAC;EAChCC,KAAK,EAAEP,CAAC,CAACQ,KAAK,CAACR,CAAC,CAACI,OAAO,CAAC,CAAC;AAC5B,CAAC,CAAC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- /* Generated by @palantir/pack.document-schema.type-gen@0.11.0 */
1
+ /* Generated by @palantir/pack.document-schema.type-gen@0.12.0 */
2
2
 
3
3
  import { z } from 'zod';
4
4
  export const CatSchema = z.object({
@@ -1 +1 @@
1
- {"version":3,"file":"custom-discriminant.js","names":["z","CatSchema","object","meow","string","DogSchema","bark","AnimalCatSchema","extend","kind","literal","AnimalDogSchema","AnimalSchema","discriminatedUnion"],"sources":["custom-discriminant.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.11.0 */\n\nimport { z } from 'zod';\n\nexport const CatSchema = z.object({\n meow: z.string(),\n});\n\nexport const DogSchema = z.object({\n bark: z.string(),\n});\n\nexport const AnimalCatSchema = CatSchema.extend({\n kind: z.literal('cat'),\n});\n\nexport const AnimalDogSchema = DogSchema.extend({\n kind: z.literal('dog'),\n});\n\nexport const AnimalSchema = z.discriminatedUnion('kind', [\n AnimalCatSchema,\n AnimalDogSchema,\n]);\n"],"mappings":"AAAA;;AAEA,SAASA,CAAC,QAAQ,KAAK;AAEvB,OAAO,MAAMC,SAAS,GAAGD,CAAC,CAACE,MAAM,CAAC;EAChCC,IAAI,EAAEH,CAAC,CAACI,MAAM,CAAC;AACjB,CAAC,CAAC;AAEF,OAAO,MAAMC,SAAS,GAAGL,CAAC,CAACE,MAAM,CAAC;EAChCI,IAAI,EAAEN,CAAC,CAACI,MAAM,CAAC;AACjB,CAAC,CAAC;AAEF,OAAO,MAAMG,eAAe,GAAGN,SAAS,CAACO,MAAM,CAAC;EAC9CC,IAAI,EAAET,CAAC,CAACU,OAAO,CAAC,KAAK;AACvB,CAAC,CAAC;AAEF,OAAO,MAAMC,eAAe,GAAGN,SAAS,CAACG,MAAM,CAAC;EAC9CC,IAAI,EAAET,CAAC,CAACU,OAAO,CAAC,KAAK;AACvB,CAAC,CAAC;AAEF,OAAO,MAAME,YAAY,GAAGZ,CAAC,CAACa,kBAAkB,CAAC,MAAM,EAAE,CACvDN,eAAe,EACfI,eAAe,CAChB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"custom-discriminant.js","names":["z","CatSchema","object","meow","string","DogSchema","bark","AnimalCatSchema","extend","kind","literal","AnimalDogSchema","AnimalSchema","discriminatedUnion"],"sources":["custom-discriminant.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.12.0 */\n\nimport { z } from 'zod';\n\nexport const CatSchema = z.object({\n meow: z.string(),\n});\n\nexport const DogSchema = z.object({\n bark: z.string(),\n});\n\nexport const AnimalCatSchema = CatSchema.extend({\n kind: z.literal('cat'),\n});\n\nexport const AnimalDogSchema = DogSchema.extend({\n kind: z.literal('dog'),\n});\n\nexport const AnimalSchema = z.discriminatedUnion('kind', [\n AnimalCatSchema,\n AnimalDogSchema,\n]);\n"],"mappings":"AAAA;;AAEA,SAASA,CAAC,QAAQ,KAAK;AAEvB,OAAO,MAAMC,SAAS,GAAGD,CAAC,CAACE,MAAM,CAAC;EAChCC,IAAI,EAAEH,CAAC,CAACI,MAAM,CAAC;AACjB,CAAC,CAAC;AAEF,OAAO,MAAMC,SAAS,GAAGL,CAAC,CAACE,MAAM,CAAC;EAChCI,IAAI,EAAEN,CAAC,CAACI,MAAM,CAAC;AACjB,CAAC,CAAC;AAEF,OAAO,MAAMG,eAAe,GAAGN,SAAS,CAACO,MAAM,CAAC;EAC9CC,IAAI,EAAET,CAAC,CAACU,OAAO,CAAC,KAAK;AACvB,CAAC,CAAC;AAEF,OAAO,MAAMC,eAAe,GAAGN,SAAS,CAACG,MAAM,CAAC;EAC9CC,IAAI,EAAET,CAAC,CAACU,OAAO,CAAC,KAAK;AACvB,CAAC,CAAC;AAEF,OAAO,MAAME,YAAY,GAAGZ,CAAC,CAACa,kBAAkB,CAAC,MAAM,EAAE,CACvDN,eAAe,EACfI,eAAe,CAChB,CAAC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- /* Generated by @palantir/pack.document-schema.type-gen@0.11.0 */
1
+ /* Generated by @palantir/pack.document-schema.type-gen@0.12.0 */
2
2
 
3
3
  import { z } from 'zod';
4
4
  export const EventSchema = z.object({
@@ -1 +1 @@
1
- {"version":3,"file":"datetime-fields.js","names":["z","EventSchema","object","timestamp","string","datetime"],"sources":["datetime-fields.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.11.0 */\n\nimport { z } from 'zod';\n\nexport const EventSchema = z.object({\n timestamp: z.string().datetime(),\n});\n"],"mappings":"AAAA;;AAEA,SAASA,CAAC,QAAQ,KAAK;AAEvB,OAAO,MAAMC,WAAW,GAAGD,CAAC,CAACE,MAAM,CAAC;EAClCC,SAAS,EAAEH,CAAC,CAACI,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC;AACjC,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"datetime-fields.js","names":["z","EventSchema","object","timestamp","string","datetime"],"sources":["datetime-fields.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.12.0 */\n\nimport { z } from 'zod';\n\nexport const EventSchema = z.object({\n timestamp: z.string().datetime(),\n});\n"],"mappings":"AAAA;;AAEA,SAASA,CAAC,QAAQ,KAAK;AAEvB,OAAO,MAAMC,WAAW,GAAGD,CAAC,CAACE,MAAM,CAAC;EAClCC,SAAS,EAAEH,CAAC,CAACI,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC;AACjC,CAAC,CAAC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- /* Generated by @palantir/pack.document-schema.type-gen@0.11.0 */
1
+ /* Generated by @palantir/pack.document-schema.type-gen@0.12.0 */
2
2
 
3
3
  import { z } from 'zod';
4
4
  export const PersonSchema = z.object({
@@ -1 +1 @@
1
- {"version":3,"file":"simple-records.js","names":["z","PersonSchema","object","name","string","min","max","age","number","int","email","optional"],"sources":["simple-records.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.11.0 */\n\nimport { z } from 'zod';\n\nexport const PersonSchema = z.object({\n name: z.string().min(2).max(50),\n age: z.number().int().min(0).max(150),\n email: z.string().optional(),\n});\n"],"mappings":"AAAA;;AAEA,SAASA,CAAC,QAAQ,KAAK;AAEvB,OAAO,MAAMC,YAAY,GAAGD,CAAC,CAACE,MAAM,CAAC;EACnCC,IAAI,EAAEH,CAAC,CAACI,MAAM,CAAC,CAAC,CAACC,GAAG,CAAC,CAAC,CAAC,CAACC,GAAG,CAAC,EAAE,CAAC;EAC/BC,GAAG,EAAEP,CAAC,CAACQ,MAAM,CAAC,CAAC,CAACC,GAAG,CAAC,CAAC,CAACJ,GAAG,CAAC,CAAC,CAAC,CAACC,GAAG,CAAC,GAAG,CAAC;EACrCI,KAAK,EAAEV,CAAC,CAACI,MAAM,CAAC,CAAC,CAACO,QAAQ,CAAC;AAC7B,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"simple-records.js","names":["z","PersonSchema","object","name","string","min","max","age","number","int","email","optional"],"sources":["simple-records.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.12.0 */\n\nimport { z } from 'zod';\n\nexport const PersonSchema = z.object({\n name: z.string().min(2).max(50),\n age: z.number().int().min(0).max(150),\n email: z.string().optional(),\n});\n"],"mappings":"AAAA;;AAEA,SAASA,CAAC,QAAQ,KAAK;AAEvB,OAAO,MAAMC,YAAY,GAAGD,CAAC,CAACE,MAAM,CAAC;EACnCC,IAAI,EAAEH,CAAC,CAACI,MAAM,CAAC,CAAC,CAACC,GAAG,CAAC,CAAC,CAAC,CAACC,GAAG,CAAC,EAAE,CAAC;EAC/BC,GAAG,EAAEP,CAAC,CAACQ,MAAM,CAAC,CAAC,CAACC,GAAG,CAAC,CAAC,CAACJ,GAAG,CAAC,CAAC,CAAC,CAACC,GAAG,CAAC,GAAG,CAAC;EACrCI,KAAK,EAAEV,CAAC,CAACI,MAAM,CAAC,CAAC,CAACO,QAAQ,CAAC;AAC7B,CAAC,CAAC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- /* Generated by @palantir/pack.document-schema.type-gen@0.11.0 */
1
+ /* Generated by @palantir/pack.document-schema.type-gen@0.12.0 */
2
2
 
3
3
  import { z } from 'zod';
4
4
  export const FooSchema = z.object({
@@ -1 +1 @@
1
- {"version":3,"file":"union-before-records.js","names":["z","FooSchema","object","value","string","BarSchema","count","number","int","FooBarFooSchema","extend","type","literal","FooBarBarSchema","FooBarSchema","discriminatedUnion"],"sources":["union-before-records.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.11.0 */\n\nimport { z } from 'zod';\n\nexport const FooSchema = z.object({\n value: z.string(),\n});\n\nexport const BarSchema = z.object({\n count: z.number().int(),\n});\n\nexport const FooBarFooSchema = FooSchema.extend({\n type: z.literal('foo'),\n});\n\nexport const FooBarBarSchema = BarSchema.extend({\n type: z.literal('bar'),\n});\n\nexport const FooBarSchema = z.discriminatedUnion('type', [\n FooBarFooSchema,\n FooBarBarSchema,\n]);\n"],"mappings":"AAAA;;AAEA,SAASA,CAAC,QAAQ,KAAK;AAEvB,OAAO,MAAMC,SAAS,GAAGD,CAAC,CAACE,MAAM,CAAC;EAChCC,KAAK,EAAEH,CAAC,CAACI,MAAM,CAAC;AAClB,CAAC,CAAC;AAEF,OAAO,MAAMC,SAAS,GAAGL,CAAC,CAACE,MAAM,CAAC;EAChCI,KAAK,EAAEN,CAAC,CAACO,MAAM,CAAC,CAAC,CAACC,GAAG,CAAC;AACxB,CAAC,CAAC;AAEF,OAAO,MAAMC,eAAe,GAAGR,SAAS,CAACS,MAAM,CAAC;EAC9CC,IAAI,EAAEX,CAAC,CAACY,OAAO,CAAC,KAAK;AACvB,CAAC,CAAC;AAEF,OAAO,MAAMC,eAAe,GAAGR,SAAS,CAACK,MAAM,CAAC;EAC9CC,IAAI,EAAEX,CAAC,CAACY,OAAO,CAAC,KAAK;AACvB,CAAC,CAAC;AAEF,OAAO,MAAME,YAAY,GAAGd,CAAC,CAACe,kBAAkB,CAAC,MAAM,EAAE,CACvDN,eAAe,EACfI,eAAe,CAChB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"union-before-records.js","names":["z","FooSchema","object","value","string","BarSchema","count","number","int","FooBarFooSchema","extend","type","literal","FooBarBarSchema","FooBarSchema","discriminatedUnion"],"sources":["union-before-records.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.12.0 */\n\nimport { z } from 'zod';\n\nexport const FooSchema = z.object({\n value: z.string(),\n});\n\nexport const BarSchema = z.object({\n count: z.number().int(),\n});\n\nexport const FooBarFooSchema = FooSchema.extend({\n type: z.literal('foo'),\n});\n\nexport const FooBarBarSchema = BarSchema.extend({\n type: z.literal('bar'),\n});\n\nexport const FooBarSchema = z.discriminatedUnion('type', [\n FooBarFooSchema,\n FooBarBarSchema,\n]);\n"],"mappings":"AAAA;;AAEA,SAASA,CAAC,QAAQ,KAAK;AAEvB,OAAO,MAAMC,SAAS,GAAGD,CAAC,CAACE,MAAM,CAAC;EAChCC,KAAK,EAAEH,CAAC,CAACI,MAAM,CAAC;AAClB,CAAC,CAAC;AAEF,OAAO,MAAMC,SAAS,GAAGL,CAAC,CAACE,MAAM,CAAC;EAChCI,KAAK,EAAEN,CAAC,CAACO,MAAM,CAAC,CAAC,CAACC,GAAG,CAAC;AACxB,CAAC,CAAC;AAEF,OAAO,MAAMC,eAAe,GAAGR,SAAS,CAACS,MAAM,CAAC;EAC9CC,IAAI,EAAEX,CAAC,CAACY,OAAO,CAAC,KAAK;AACvB,CAAC,CAAC;AAEF,OAAO,MAAMC,eAAe,GAAGR,SAAS,CAACK,MAAM,CAAC;EAC9CC,IAAI,EAAEX,CAAC,CAACY,OAAO,CAAC,KAAK;AACvB,CAAC,CAAC;AAEF,OAAO,MAAME,YAAY,GAAGd,CAAC,CAACe,kBAAkB,CAAC,MAAM,EAAE,CACvDN,eAAe,EACfI,eAAe,CAChB,CAAC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- /* Generated by @palantir/pack.document-schema.type-gen@0.11.0 */
1
+ /* Generated by @palantir/pack.document-schema.type-gen@0.12.0 */
2
2
 
3
3
  import { z } from 'zod';
4
4
  export const ObjectNodeSchema = z.object({
@@ -1 +1 @@
1
- {"version":3,"file":"union-types.js","names":["z","ObjectNodeSchema","object","x","number","y","label","string","optional","TextBoxSchema","text","NodeObjectSchema","extend","type","literal","NodeTextBoxSchema","NodeSchema","discriminatedUnion"],"sources":["union-types.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.11.0 */\n\nimport { z } from 'zod';\n\nexport const ObjectNodeSchema = z.object({\n x: z.number(),\n y: z.number(),\n label: z.string().optional(),\n});\n\nexport const TextBoxSchema = z.object({\n x: z.number(),\n y: z.number(),\n text: z.string(),\n});\n\nexport const NodeObjectSchema = ObjectNodeSchema.extend({\n type: z.literal('object'),\n});\n\nexport const NodeTextBoxSchema = TextBoxSchema.extend({\n type: z.literal('text-box'),\n});\n\nexport const NodeSchema = z.discriminatedUnion('type', [\n NodeObjectSchema,\n NodeTextBoxSchema,\n]);\n"],"mappings":"AAAA;;AAEA,SAASA,CAAC,QAAQ,KAAK;AAEvB,OAAO,MAAMC,gBAAgB,GAAGD,CAAC,CAACE,MAAM,CAAC;EACvCC,CAAC,EAAEH,CAAC,CAACI,MAAM,CAAC,CAAC;EACbC,CAAC,EAAEL,CAAC,CAACI,MAAM,CAAC,CAAC;EACbE,KAAK,EAAEN,CAAC,CAACO,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC;AAC7B,CAAC,CAAC;AAEF,OAAO,MAAMC,aAAa,GAAGT,CAAC,CAACE,MAAM,CAAC;EACpCC,CAAC,EAAEH,CAAC,CAACI,MAAM,CAAC,CAAC;EACbC,CAAC,EAAEL,CAAC,CAACI,MAAM,CAAC,CAAC;EACbM,IAAI,EAAEV,CAAC,CAACO,MAAM,CAAC;AACjB,CAAC,CAAC;AAEF,OAAO,MAAMI,gBAAgB,GAAGV,gBAAgB,CAACW,MAAM,CAAC;EACtDC,IAAI,EAAEb,CAAC,CAACc,OAAO,CAAC,QAAQ;AAC1B,CAAC,CAAC;AAEF,OAAO,MAAMC,iBAAiB,GAAGN,aAAa,CAACG,MAAM,CAAC;EACpDC,IAAI,EAAEb,CAAC,CAACc,OAAO,CAAC,UAAU;AAC5B,CAAC,CAAC;AAEF,OAAO,MAAME,UAAU,GAAGhB,CAAC,CAACiB,kBAAkB,CAAC,MAAM,EAAE,CACrDN,gBAAgB,EAChBI,iBAAiB,CAClB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"union-types.js","names":["z","ObjectNodeSchema","object","x","number","y","label","string","optional","TextBoxSchema","text","NodeObjectSchema","extend","type","literal","NodeTextBoxSchema","NodeSchema","discriminatedUnion"],"sources":["union-types.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.12.0 */\n\nimport { z } from 'zod';\n\nexport const ObjectNodeSchema = z.object({\n x: z.number(),\n y: z.number(),\n label: z.string().optional(),\n});\n\nexport const TextBoxSchema = z.object({\n x: z.number(),\n y: z.number(),\n text: z.string(),\n});\n\nexport const NodeObjectSchema = ObjectNodeSchema.extend({\n type: z.literal('object'),\n});\n\nexport const NodeTextBoxSchema = TextBoxSchema.extend({\n type: z.literal('text-box'),\n});\n\nexport const NodeSchema = z.discriminatedUnion('type', [\n NodeObjectSchema,\n NodeTextBoxSchema,\n]);\n"],"mappings":"AAAA;;AAEA,SAASA,CAAC,QAAQ,KAAK;AAEvB,OAAO,MAAMC,gBAAgB,GAAGD,CAAC,CAACE,MAAM,CAAC;EACvCC,CAAC,EAAEH,CAAC,CAACI,MAAM,CAAC,CAAC;EACbC,CAAC,EAAEL,CAAC,CAACI,MAAM,CAAC,CAAC;EACbE,KAAK,EAAEN,CAAC,CAACO,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC;AAC7B,CAAC,CAAC;AAEF,OAAO,MAAMC,aAAa,GAAGT,CAAC,CAACE,MAAM,CAAC;EACpCC,CAAC,EAAEH,CAAC,CAACI,MAAM,CAAC,CAAC;EACbC,CAAC,EAAEL,CAAC,CAACI,MAAM,CAAC,CAAC;EACbM,IAAI,EAAEV,CAAC,CAACO,MAAM,CAAC;AACjB,CAAC,CAAC;AAEF,OAAO,MAAMI,gBAAgB,GAAGV,gBAAgB,CAACW,MAAM,CAAC;EACtDC,IAAI,EAAEb,CAAC,CAACc,OAAO,CAAC,QAAQ;AAC1B,CAAC,CAAC;AAEF,OAAO,MAAMC,iBAAiB,GAAGN,aAAa,CAACG,MAAM,CAAC;EACpDC,IAAI,EAAEb,CAAC,CAACc,OAAO,CAAC,UAAU;AAC5B,CAAC,CAAC;AAEF,OAAO,MAAME,UAAU,GAAGhB,CAAC,CAACiB,kBAAkB,CAAC,MAAM,EAAE,CACrDN,gBAAgB,EAChBI,iBAAiB,CAClB,CAAC","ignoreList":[]}
@@ -0,0 +1,9 @@
1
+ // ============================================================
2
+ // documentType.ts
3
+ // ============================================================
4
+
5
+ /* Generated by @palantir/pack.document-schema.type-gen@0.12.0 */
6
+
7
+ export const DOCUMENT_TYPE_NAME = 'Canvas Document Type';
8
+ export const DOCUMENT_TYPE_DESCRIPTION = 'Document type description for demo canvas';
9
+ //# sourceMappingURL=with-name-and-description.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with-name-and-description.js","names":["DOCUMENT_TYPE_NAME","DOCUMENT_TYPE_DESCRIPTION"],"sources":["with-name-and-description.ts"],"sourcesContent":["// ============================================================\n// documentType.ts\n// ============================================================\n\n/* Generated by @palantir/pack.document-schema.type-gen@0.12.0 */\n\nexport const DOCUMENT_TYPE_NAME = 'Canvas Document Type';\nexport const DOCUMENT_TYPE_DESCRIPTION =\n 'Document type description for demo canvas';\n"],"mappings":"AAAA;AACA;AACA;;AAEA;;AAEA,OAAO,MAAMA,kBAAkB,GAAG,sBAAsB;AACxD,OAAO,MAAMC,yBAAyB,GACpC,2CAA2C","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"single-version.js","names":[],"sources":["single-version.ts"],"sourcesContent":["// ============================================================\n// versions.ts\n// ============================================================\n\n/* Generated by @palantir/pack.document-schema.type-gen@0.11.0 */\n\nexport type SupportedVersions = 1;\nexport type LatestVersion = 1;\nexport type MinSupportedVersion = 1;\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"single-version.js","names":[],"sources":["single-version.ts"],"sourcesContent":["// ============================================================\n// versions.ts\n// ============================================================\n\n/* Generated by @palantir/pack.document-schema.type-gen@0.12.0 */\n\nexport type SupportedVersions = 1;\nexport type LatestVersion = 1;\nexport type MinSupportedVersion = 1;\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"three-version-chain.js","names":[],"sources":["three-version-chain.ts"],"sourcesContent":["// ============================================================\n// versions.ts\n// ============================================================\n\n/* Generated by @palantir/pack.document-schema.type-gen@0.11.0 */\n\nexport type SupportedVersions = 1 | 2 | 3;\nexport type LatestVersion = 3;\nexport type MinSupportedVersion = 1;\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"three-version-chain.js","names":[],"sources":["three-version-chain.ts"],"sourcesContent":["// ============================================================\n// versions.ts\n// ============================================================\n\n/* Generated by @palantir/pack.document-schema.type-gen@0.12.0 */\n\nexport type SupportedVersions = 1 | 2 | 3;\nexport type LatestVersion = 3;\nexport type MinSupportedVersion = 1;\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"two-version.js","names":[],"sources":["two-version.ts"],"sourcesContent":["// ============================================================\n// versions.ts\n// ============================================================\n\n/* Generated by @palantir/pack.document-schema.type-gen@0.11.0 */\n\nexport type SupportedVersions = 1 | 2;\nexport type LatestVersion = 2;\nexport type MinSupportedVersion = 1;\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"two-version.js","names":[],"sources":["two-version.ts"],"sourcesContent":["// ============================================================\n// versions.ts\n// ============================================================\n\n/* Generated by @palantir/pack.document-schema.type-gen@0.12.0 */\n\nexport type SupportedVersions = 1 | 2;\nexport type LatestVersion = 2;\nexport type MinSupportedVersion = 1;\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,34 @@
1
+ /*
2
+ * Copyright 2026 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import path from "path";
18
+ import { describe, expect, it } from "vitest";
19
+ import { generateDocumentTypeFromChain } from "../generateDocumentTypeFromSchema.js";
20
+ import { resolveSchemaChain } from "../resolveSchemaChain.js";
21
+ import { singleVersionSchema } from "./fixtures.js";
22
+ import { formatSingleSnapshot } from "./snapshotUtils.js";
23
+ describe("generateDocumentTypeFromChain", () => {
24
+ const snapshotDir = path.join(__dirname, "__snapshots__", "generateDocumentTypeFromSchema");
25
+ it("emits name and description from identity", async () => {
26
+ const resolved = resolveSchemaChain(singleVersionSchema, undefined, {
27
+ name: "Canvas Document Type",
28
+ description: "Document type description for demo canvas"
29
+ });
30
+ const result = generateDocumentTypeFromChain(resolved);
31
+ await expect(await formatSingleSnapshot("documentType.ts", result)).toMatchFileSnapshot(path.join(snapshotDir, "with-name-and-description.ts"));
32
+ });
33
+ });
34
+ //# sourceMappingURL=generateDocumentTypeFromSchema.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateDocumentTypeFromSchema.test.js","names":["path","describe","expect","it","generateDocumentTypeFromChain","resolveSchemaChain","singleVersionSchema","formatSingleSnapshot","snapshotDir","join","__dirname","resolved","undefined","name","description","result","toMatchFileSnapshot"],"sources":["generateDocumentTypeFromSchema.test.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport path from \"path\";\nimport { describe, expect, it } from \"vitest\";\nimport { generateDocumentTypeFromChain } from \"../generateDocumentTypeFromSchema.js\";\nimport { resolveSchemaChain } from \"../resolveSchemaChain.js\";\nimport { singleVersionSchema } from \"./fixtures.js\";\nimport { formatSingleSnapshot } from \"./snapshotUtils.js\";\n\ndescribe(\"generateDocumentTypeFromChain\", () => {\n const snapshotDir = path.join(__dirname, \"__snapshots__\", \"generateDocumentTypeFromSchema\");\n\n it(\"emits name and description from identity\", async () => {\n const resolved = resolveSchemaChain(singleVersionSchema, undefined, {\n name: \"Canvas Document Type\",\n description: \"Document type description for demo canvas\",\n });\n const result = generateDocumentTypeFromChain(resolved);\n await expect(await formatSingleSnapshot(\"documentType.ts\", result)).toMatchFileSnapshot(\n path.join(snapshotDir, \"with-name-and-description.ts\"),\n );\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,IAAI,MAAM,MAAM;AACvB,SAASC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAC7C,SAASC,6BAA6B,QAAQ,sCAAsC;AACpF,SAASC,kBAAkB,QAAQ,0BAA0B;AAC7D,SAASC,mBAAmB,QAAQ,eAAe;AACnD,SAASC,oBAAoB,QAAQ,oBAAoB;AAEzDN,QAAQ,CAAC,+BAA+B,EAAE,MAAM;EAC9C,MAAMO,WAAW,GAAGR,IAAI,CAACS,IAAI,CAACC,SAAS,EAAE,eAAe,EAAE,gCAAgC,CAAC;EAE3FP,EAAE,CAAC,0CAA0C,EAAE,YAAY;IACzD,MAAMQ,QAAQ,GAAGN,kBAAkB,CAACC,mBAAmB,EAAEM,SAAS,EAAE;MAClEC,IAAI,EAAE,sBAAsB;MAC5BC,WAAW,EAAE;IACf,CAAC,CAAC;IACF,MAAMC,MAAM,GAAGX,6BAA6B,CAACO,QAAQ,CAAC;IACtD,MAAMT,MAAM,CAAC,MAAMK,oBAAoB,CAAC,iBAAiB,EAAEQ,MAAM,CAAC,CAAC,CAACC,mBAAmB,CACrFhB,IAAI,CAACS,IAAI,CAACD,WAAW,EAAE,8BAA8B,CACvD,CAAC;EACH,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,39 @@
1
+ /*
2
+ * Copyright 2026 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { GENERATED_FILE_HEADER } from "../generatedFileHeader.js";
18
+ /**
19
+ * Generate documentType.ts: runtime constants for the document type's user-facing
20
+ * identity, sourced from the IR's top-level `name` and `description`.
21
+ *
22
+ * Output:
23
+ * ```
24
+ * export const DOCUMENT_TYPE_NAME = "Canvas Document";
25
+ * export const DOCUMENT_TYPE_DESCRIPTION = "Schema for the Demo Canvas Application";
26
+ * ```
27
+ *
28
+ * Identity is read off the latest chain entry's IR — it is the same string on
29
+ * every entry (populated by `resolveSchemaChain` from pack-config), so the
30
+ * choice of entry is incidental.
31
+ */
32
+ export function generateDocumentTypeFromChain(resolved) {
33
+ const latestIr = resolved.chain[resolved.chain.length - 1].ir;
34
+ let output = GENERATED_FILE_HEADER;
35
+ output += `export const DOCUMENT_TYPE_NAME = ${JSON.stringify(latestIr.name)};\n`;
36
+ output += `export const DOCUMENT_TYPE_DESCRIPTION = ${JSON.stringify(latestIr.description)};\n`;
37
+ return output;
38
+ }
39
+ //# sourceMappingURL=generateDocumentTypeFromSchema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateDocumentTypeFromSchema.js","names":["GENERATED_FILE_HEADER","generateDocumentTypeFromChain","resolved","latestIr","chain","length","ir","output","JSON","stringify","name","description"],"sources":["generateDocumentTypeFromSchema.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { GENERATED_FILE_HEADER } from \"../generatedFileHeader.js\";\nimport type { ResolvedIrChain } from \"./resolveSchemaChain.js\";\n\n/**\n * Generate documentType.ts: runtime constants for the document type's user-facing\n * identity, sourced from the IR's top-level `name` and `description`.\n *\n * Output:\n * ```\n * export const DOCUMENT_TYPE_NAME = \"Canvas Document\";\n * export const DOCUMENT_TYPE_DESCRIPTION = \"Schema for the Demo Canvas Application\";\n * ```\n *\n * Identity is read off the latest chain entry's IR — it is the same string on\n * every entry (populated by `resolveSchemaChain` from pack-config), so the\n * choice of entry is incidental.\n */\nexport function generateDocumentTypeFromChain(resolved: ResolvedIrChain): string {\n const latestIr = resolved.chain[resolved.chain.length - 1]!.ir;\n\n let output = GENERATED_FILE_HEADER;\n output += `export const DOCUMENT_TYPE_NAME = ${JSON.stringify(latestIr.name)};\\n`;\n output += `export const DOCUMENT_TYPE_DESCRIPTION = ${JSON.stringify(latestIr.description)};\\n`;\n return output;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,qBAAqB,QAAQ,2BAA2B;AAGjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,6BAA6BA,CAACC,QAAyB,EAAU;EAC/E,MAAMC,QAAQ,GAAGD,QAAQ,CAACE,KAAK,CAACF,QAAQ,CAACE,KAAK,CAACC,MAAM,GAAG,CAAC,CAAC,CAAEC,EAAE;EAE9D,IAAIC,MAAM,GAAGP,qBAAqB;EAClCO,MAAM,IAAI,qCAAqCC,IAAI,CAACC,SAAS,CAACN,QAAQ,CAACO,IAAI,CAAC,KAAK;EACjFH,MAAM,IAAI,4CAA4CC,IAAI,CAACC,SAAS,CAACN,QAAQ,CAACQ,WAAW,CAAC,KAAK;EAC/F,OAAOJ,MAAM;AACf","ignoreList":[]}
@@ -17,7 +17,7 @@
17
17
  import { formatVariantName } from "../formatVariantName.js";
18
18
  import { GENERATED_FILE_HEADER } from "../generatedFileHeader.js";
19
19
  import { resolveMinVersion } from "./resolveSchemaChain.js";
20
- import { INTERNAL_UPGRADE_FNS_PATH, MODELS_PATH, TYPES_REEXPORT_PATH, typesFilePath, VERSIONED_DOC_REF_PATH, versionedTypeName, VERSIONS_PATH } from "./runtimeSchema.js";
20
+ import { DOCUMENT_TYPE_PATH, INTERNAL_UPGRADE_FNS_PATH, MODELS_PATH, TYPES_REEXPORT_PATH, typesFilePath, VERSIONED_DOC_REF_PATH, versionedTypeName, VERSIONS_PATH } from "./runtimeSchema.js";
21
21
 
22
22
  /**
23
23
  * Generate the index.ts barrel export from a versioned schema.
@@ -28,6 +28,7 @@ import { INTERNAL_UPGRADE_FNS_PATH, MODELS_PATH, TYPES_REEXPORT_PATH, typesFileP
28
28
  * - `types.js` (star export — latest-version type aliases)
29
29
  * - `versions.js` (star export — SupportedVersions, LatestVersion, MinSupportedVersion)
30
30
  * - `versionedDocRef.js` (star export — VersionedDocRef types and factory)
31
+ * - `documentType.js` (star export — DOCUMENT_TYPE_NAME and DOCUMENT_TYPE_DESCRIPTION)
31
32
  * - `DocumentUpgradeFns` type (the typed shape the factory accepts)
32
33
  * - Per supported version: explicit named type exports from `types_vN.js`
33
34
  * (not star exports, to avoid polluting autocomplete for read-only consumers)
@@ -46,6 +47,7 @@ export function generateIndexFromChain(resolved, minSupportedVersion) {
46
47
  output += `export * from "${TYPES_REEXPORT_PATH}";\n`;
47
48
  output += `export * from "${VERSIONS_PATH}";\n`;
48
49
  output += `export * from "${VERSIONED_DOC_REF_PATH}";\n`;
50
+ output += `export * from "${DOCUMENT_TYPE_PATH}";\n`;
49
51
  // The typed upgrade-function table shape. Apps reference this type when
50
52
  // constructing the value passed to `DocumentModel(...)`.
51
53
  output += `export { type DocumentUpgradeFns } from "${INTERNAL_UPGRADE_FNS_PATH}";\n`;
@@ -1 +1 @@
1
- {"version":3,"file":"generateIndexFromSchema.js","names":["formatVariantName","GENERATED_FILE_HEADER","resolveMinVersion","INTERNAL_UPGRADE_FNS_PATH","MODELS_PATH","TYPES_REEXPORT_PATH","typesFilePath","VERSIONED_DOC_REF_PATH","versionedTypeName","VERSIONS_PATH","generateIndexFromChain","resolved","minSupportedVersion","chain","minVersion","output","version","ir","typeNames","modelKey","modelDef","Object","entries","models","type","push","variantName","keys","union","variants","formattedVariant","length","sort","join"],"sources":["generateIndexFromSchema.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { formatVariantName } from \"../formatVariantName.js\";\nimport { GENERATED_FILE_HEADER } from \"../generatedFileHeader.js\";\nimport type { ResolvedIrChain } from \"./resolveSchemaChain.js\";\nimport { resolveMinVersion } from \"./resolveSchemaChain.js\";\nimport {\n INTERNAL_UPGRADE_FNS_PATH,\n MODELS_PATH,\n TYPES_REEXPORT_PATH,\n typesFilePath,\n VERSIONED_DOC_REF_PATH,\n versionedTypeName,\n VERSIONS_PATH,\n} from \"./runtimeSchema.js\";\n\n/**\n * Generate the index.ts barrel export from a versioned schema.\n *\n * Exports:\n * - `models.js` (star export — model constants and `DocumentModel`; emitted\n * as a factory function when the schema has derived fields, otherwise a const)\n * - `types.js` (star export — latest-version type aliases)\n * - `versions.js` (star export — SupportedVersions, LatestVersion, MinSupportedVersion)\n * - `versionedDocRef.js` (star export — VersionedDocRef types and factory)\n * - `DocumentUpgradeFns` type (the typed shape the factory accepts)\n * - Per supported version: explicit named type exports from `types_vN.js`\n * (not star exports, to avoid polluting autocomplete for read-only consumers)\n */\nexport function generateIndexFromChain(\n resolved: ResolvedIrChain,\n minSupportedVersion?: number,\n): string {\n const { chain } = resolved;\n const { minVersion } = resolveMinVersion(chain, minSupportedVersion);\n\n let output = GENERATED_FILE_HEADER;\n\n // Star exports for core modules\n output += `export * from \"${MODELS_PATH}\";\\n`;\n output += `export * from \"${TYPES_REEXPORT_PATH}\";\\n`;\n output += `export * from \"${VERSIONS_PATH}\";\\n`;\n output += `export * from \"${VERSIONED_DOC_REF_PATH}\";\\n`;\n // The typed upgrade-function table shape. Apps reference this type when\n // constructing the value passed to `DocumentModel(...)`.\n output += `export { type DocumentUpgradeFns } from \"${INTERNAL_UPGRADE_FNS_PATH}\";\\n`;\n\n // Per-version explicit named type exports\n for (const { version, ir } of chain) {\n if (version < minVersion) continue;\n\n const typeNames: string[] = [];\n\n for (const [modelKey, modelDef] of Object.entries(ir.models)) {\n if (modelDef.type === \"record\") {\n typeNames.push(versionedTypeName(modelKey, version));\n } else if (modelDef.type === \"union\") {\n typeNames.push(versionedTypeName(modelKey, version));\n\n // Union variant types\n for (const variantName of Object.keys(modelDef.union.variants)) {\n const formattedVariant = formatVariantName(variantName);\n typeNames.push(`${versionedTypeName(modelKey, version)}${formattedVariant}`);\n }\n }\n }\n\n if (typeNames.length > 0) {\n output += `export type { ${typeNames.sort().join(\", \")} } from \"${\n typesFilePath(version)\n }\";\\n`;\n }\n }\n\n return output;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,iBAAiB,QAAQ,yBAAyB;AAC3D,SAASC,qBAAqB,QAAQ,2BAA2B;AAEjE,SAASC,iBAAiB,QAAQ,yBAAyB;AAC3D,SACEC,yBAAyB,EACzBC,WAAW,EACXC,mBAAmB,EACnBC,aAAa,EACbC,sBAAsB,EACtBC,iBAAiB,EACjBC,aAAa,QACR,oBAAoB;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,sBAAsBA,CACpCC,QAAyB,EACzBC,mBAA4B,EACpB;EACR,MAAM;IAAEC;EAAM,CAAC,GAAGF,QAAQ;EAC1B,MAAM;IAAEG;EAAW,CAAC,GAAGZ,iBAAiB,CAACW,KAAK,EAAED,mBAAmB,CAAC;EAEpE,IAAIG,MAAM,GAAGd,qBAAqB;;EAElC;EACAc,MAAM,IAAI,kBAAkBX,WAAW,MAAM;EAC7CW,MAAM,IAAI,kBAAkBV,mBAAmB,MAAM;EACrDU,MAAM,IAAI,kBAAkBN,aAAa,MAAM;EAC/CM,MAAM,IAAI,kBAAkBR,sBAAsB,MAAM;EACxD;EACA;EACAQ,MAAM,IAAI,4CAA4CZ,yBAAyB,MAAM;;EAErF;EACA,KAAK,MAAM;IAAEa,OAAO;IAAEC;EAAG,CAAC,IAAIJ,KAAK,EAAE;IACnC,IAAIG,OAAO,GAAGF,UAAU,EAAE;IAE1B,MAAMI,SAAmB,GAAG,EAAE;IAE9B,KAAK,MAAM,CAACC,QAAQ,EAAEC,QAAQ,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACL,EAAE,CAACM,MAAM,CAAC,EAAE;MAC5D,IAAIH,QAAQ,CAACI,IAAI,KAAK,QAAQ,EAAE;QAC9BN,SAAS,CAACO,IAAI,CAACjB,iBAAiB,CAACW,QAAQ,EAAEH,OAAO,CAAC,CAAC;MACtD,CAAC,MAAM,IAAII,QAAQ,CAACI,IAAI,KAAK,OAAO,EAAE;QACpCN,SAAS,CAACO,IAAI,CAACjB,iBAAiB,CAACW,QAAQ,EAAEH,OAAO,CAAC,CAAC;;QAEpD;QACA,KAAK,MAAMU,WAAW,IAAIL,MAAM,CAACM,IAAI,CAACP,QAAQ,CAACQ,KAAK,CAACC,QAAQ,CAAC,EAAE;UAC9D,MAAMC,gBAAgB,GAAG9B,iBAAiB,CAAC0B,WAAW,CAAC;UACvDR,SAAS,CAACO,IAAI,CAAC,GAAGjB,iBAAiB,CAACW,QAAQ,EAAEH,OAAO,CAAC,GAAGc,gBAAgB,EAAE,CAAC;QAC9E;MACF;IACF;IAEA,IAAIZ,SAAS,CAACa,MAAM,GAAG,CAAC,EAAE;MACxBhB,MAAM,IAAI,iBAAiBG,SAAS,CAACc,IAAI,CAAC,CAAC,CAACC,IAAI,CAAC,IAAI,CAAC,YACpD3B,aAAa,CAACU,OAAO,CAAC,MAClB;IACR;EACF;EAEA,OAAOD,MAAM;AACf","ignoreList":[]}
1
+ {"version":3,"file":"generateIndexFromSchema.js","names":["formatVariantName","GENERATED_FILE_HEADER","resolveMinVersion","DOCUMENT_TYPE_PATH","INTERNAL_UPGRADE_FNS_PATH","MODELS_PATH","TYPES_REEXPORT_PATH","typesFilePath","VERSIONED_DOC_REF_PATH","versionedTypeName","VERSIONS_PATH","generateIndexFromChain","resolved","minSupportedVersion","chain","minVersion","output","version","ir","typeNames","modelKey","modelDef","Object","entries","models","type","push","variantName","keys","union","variants","formattedVariant","length","sort","join"],"sources":["generateIndexFromSchema.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { formatVariantName } from \"../formatVariantName.js\";\nimport { GENERATED_FILE_HEADER } from \"../generatedFileHeader.js\";\nimport type { ResolvedIrChain } from \"./resolveSchemaChain.js\";\nimport { resolveMinVersion } from \"./resolveSchemaChain.js\";\nimport {\n DOCUMENT_TYPE_PATH,\n INTERNAL_UPGRADE_FNS_PATH,\n MODELS_PATH,\n TYPES_REEXPORT_PATH,\n typesFilePath,\n VERSIONED_DOC_REF_PATH,\n versionedTypeName,\n VERSIONS_PATH,\n} from \"./runtimeSchema.js\";\n\n/**\n * Generate the index.ts barrel export from a versioned schema.\n *\n * Exports:\n * - `models.js` (star export — model constants and `DocumentModel`; emitted\n * as a factory function when the schema has derived fields, otherwise a const)\n * - `types.js` (star export — latest-version type aliases)\n * - `versions.js` (star export — SupportedVersions, LatestVersion, MinSupportedVersion)\n * - `versionedDocRef.js` (star export — VersionedDocRef types and factory)\n * - `documentType.js` (star export — DOCUMENT_TYPE_NAME and DOCUMENT_TYPE_DESCRIPTION)\n * - `DocumentUpgradeFns` type (the typed shape the factory accepts)\n * - Per supported version: explicit named type exports from `types_vN.js`\n * (not star exports, to avoid polluting autocomplete for read-only consumers)\n */\nexport function generateIndexFromChain(\n resolved: ResolvedIrChain,\n minSupportedVersion?: number,\n): string {\n const { chain } = resolved;\n const { minVersion } = resolveMinVersion(chain, minSupportedVersion);\n\n let output = GENERATED_FILE_HEADER;\n\n // Star exports for core modules\n output += `export * from \"${MODELS_PATH}\";\\n`;\n output += `export * from \"${TYPES_REEXPORT_PATH}\";\\n`;\n output += `export * from \"${VERSIONS_PATH}\";\\n`;\n output += `export * from \"${VERSIONED_DOC_REF_PATH}\";\\n`;\n output += `export * from \"${DOCUMENT_TYPE_PATH}\";\\n`;\n // The typed upgrade-function table shape. Apps reference this type when\n // constructing the value passed to `DocumentModel(...)`.\n output += `export { type DocumentUpgradeFns } from \"${INTERNAL_UPGRADE_FNS_PATH}\";\\n`;\n\n // Per-version explicit named type exports\n for (const { version, ir } of chain) {\n if (version < minVersion) continue;\n\n const typeNames: string[] = [];\n\n for (const [modelKey, modelDef] of Object.entries(ir.models)) {\n if (modelDef.type === \"record\") {\n typeNames.push(versionedTypeName(modelKey, version));\n } else if (modelDef.type === \"union\") {\n typeNames.push(versionedTypeName(modelKey, version));\n\n // Union variant types\n for (const variantName of Object.keys(modelDef.union.variants)) {\n const formattedVariant = formatVariantName(variantName);\n typeNames.push(`${versionedTypeName(modelKey, version)}${formattedVariant}`);\n }\n }\n }\n\n if (typeNames.length > 0) {\n output += `export type { ${typeNames.sort().join(\", \")} } from \"${\n typesFilePath(version)\n }\";\\n`;\n }\n }\n\n return output;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,iBAAiB,QAAQ,yBAAyB;AAC3D,SAASC,qBAAqB,QAAQ,2BAA2B;AAEjE,SAASC,iBAAiB,QAAQ,yBAAyB;AAC3D,SACEC,kBAAkB,EAClBC,yBAAyB,EACzBC,WAAW,EACXC,mBAAmB,EACnBC,aAAa,EACbC,sBAAsB,EACtBC,iBAAiB,EACjBC,aAAa,QACR,oBAAoB;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,sBAAsBA,CACpCC,QAAyB,EACzBC,mBAA4B,EACpB;EACR,MAAM;IAAEC;EAAM,CAAC,GAAGF,QAAQ;EAC1B,MAAM;IAAEG;EAAW,CAAC,GAAGb,iBAAiB,CAACY,KAAK,EAAED,mBAAmB,CAAC;EAEpE,IAAIG,MAAM,GAAGf,qBAAqB;;EAElC;EACAe,MAAM,IAAI,kBAAkBX,WAAW,MAAM;EAC7CW,MAAM,IAAI,kBAAkBV,mBAAmB,MAAM;EACrDU,MAAM,IAAI,kBAAkBN,aAAa,MAAM;EAC/CM,MAAM,IAAI,kBAAkBR,sBAAsB,MAAM;EACxDQ,MAAM,IAAI,kBAAkBb,kBAAkB,MAAM;EACpD;EACA;EACAa,MAAM,IAAI,4CAA4CZ,yBAAyB,MAAM;;EAErF;EACA,KAAK,MAAM;IAAEa,OAAO;IAAEC;EAAG,CAAC,IAAIJ,KAAK,EAAE;IACnC,IAAIG,OAAO,GAAGF,UAAU,EAAE;IAE1B,MAAMI,SAAmB,GAAG,EAAE;IAE9B,KAAK,MAAM,CAACC,QAAQ,EAAEC,QAAQ,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACL,EAAE,CAACM,MAAM,CAAC,EAAE;MAC5D,IAAIH,QAAQ,CAACI,IAAI,KAAK,QAAQ,EAAE;QAC9BN,SAAS,CAACO,IAAI,CAACjB,iBAAiB,CAACW,QAAQ,EAAEH,OAAO,CAAC,CAAC;MACtD,CAAC,MAAM,IAAII,QAAQ,CAACI,IAAI,KAAK,OAAO,EAAE;QACpCN,SAAS,CAACO,IAAI,CAACjB,iBAAiB,CAACW,QAAQ,EAAEH,OAAO,CAAC,CAAC;;QAEpD;QACA,KAAK,MAAMU,WAAW,IAAIL,MAAM,CAACM,IAAI,CAACP,QAAQ,CAACQ,KAAK,CAACC,QAAQ,CAAC,EAAE;UAC9D,MAAMC,gBAAgB,GAAG/B,iBAAiB,CAAC2B,WAAW,CAAC;UACvDR,SAAS,CAACO,IAAI,CAAC,GAAGjB,iBAAiB,CAACW,QAAQ,EAAEH,OAAO,CAAC,GAAGc,gBAAgB,EAAE,CAAC;QAC9E;MACF;IACF;IAEA,IAAIZ,SAAS,CAACa,MAAM,GAAG,CAAC,EAAE;MACxBhB,MAAM,IAAI,iBAAiBG,SAAS,CAACc,IAAI,CAAC,CAAC,CAACC,IAAI,CAAC,IAAI,CAAC,YACpD3B,aAAa,CAACU,OAAO,CAAC,MAClB;IACR;EACF;EAEA,OAAOD,MAAM;AACf","ignoreList":[]}