@palantir/pack.document-schema.type-gen 0.10.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 (111) 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 +84 -0
  4. package/build/esm/commands/asset/assetUpdateSchemaHandler.js.map +1 -0
  5. package/build/esm/commands/asset/registerAssetCommands.js +2 -0
  6. package/build/esm/commands/asset/registerAssetCommands.js.map +1 -1
  7. package/build/esm/commands/ir/irGenAssetHandler.js +81 -12
  8. package/build/esm/commands/ir/irGenAssetHandler.js.map +1 -1
  9. package/build/esm/commands/ir/irGenTypesHandler.js +4 -2
  10. package/build/esm/commands/ir/irGenTypesHandler.js.map +1 -1
  11. package/build/esm/commands/ir/registerIrCommands.js +2 -2
  12. package/build/esm/commands/ir/registerIrCommands.js.map +1 -1
  13. package/build/esm/commands/schema/__tests__/readPackConfig.test.js +112 -0
  14. package/build/esm/commands/schema/__tests__/readPackConfig.test.js.map +1 -0
  15. package/build/esm/commands/schema/registerSchemaCommands.js +1 -1
  16. package/build/esm/commands/schema/registerSchemaCommands.js.map +1 -1
  17. package/build/esm/commands/schema/schemaIrHandler.js +77 -11
  18. package/build/esm/commands/schema/schemaIrHandler.js.map +1 -1
  19. package/build/esm/commands/types.js.map +1 -1
  20. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/custom-discriminant.js +1 -1
  21. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/custom-discriminant.js.map +1 -1
  22. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/external-refs.js +1 -1
  23. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/external-refs.js.map +1 -1
  24. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/simple-record.js +1 -1
  25. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/simple-record.js.map +1 -1
  26. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/union-types.js +1 -1
  27. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/union-types.js.map +1 -1
  28. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/array-and-map-types.js +1 -1
  29. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/array-and-map-types.js.map +1 -1
  30. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/boolean-fields.js +1 -1
  31. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/boolean-fields.js.map +1 -1
  32. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/custom-discriminant.js +1 -1
  33. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/custom-discriminant.js.map +1 -1
  34. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/datetime-fields.js +1 -1
  35. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/datetime-fields.js.map +1 -1
  36. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/simple-records.js +1 -1
  37. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/simple-records.js.map +1 -1
  38. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/union-before-records.js +1 -1
  39. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/union-before-records.js.map +1 -1
  40. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/union-types.js +1 -1
  41. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/union-types.js.map +1 -1
  42. package/build/esm/utils/schema/__tests__/__snapshots__/generateDocumentTypeFromSchema/with-name-and-description.js +9 -0
  43. package/build/esm/utils/schema/__tests__/__snapshots__/generateDocumentTypeFromSchema/with-name-and-description.js.map +1 -0
  44. package/build/esm/utils/schema/__tests__/__snapshots__/generateVersionsFromSchema/single-version.js.map +1 -1
  45. package/build/esm/utils/schema/__tests__/__snapshots__/generateVersionsFromSchema/three-version-chain.js.map +1 -1
  46. package/build/esm/utils/schema/__tests__/__snapshots__/generateVersionsFromSchema/two-version.js.map +1 -1
  47. package/build/esm/utils/schema/__tests__/fixtures.js +2 -8
  48. package/build/esm/utils/schema/__tests__/fixtures.js.map +1 -1
  49. package/build/esm/utils/schema/__tests__/generateDocumentTypeFromSchema.test.js +34 -0
  50. package/build/esm/utils/schema/__tests__/generateDocumentTypeFromSchema.test.js.map +1 -0
  51. package/build/esm/utils/schema/__tests__/generateModelMetadataFromSchema.test.js +5 -1
  52. package/build/esm/utils/schema/__tests__/generateModelMetadataFromSchema.test.js.map +1 -1
  53. package/build/esm/utils/schema/__tests__/snapshotUtils.js +3 -0
  54. package/build/esm/utils/schema/__tests__/snapshotUtils.js.map +1 -1
  55. package/build/esm/utils/schema/generateDocumentTypeFromSchema.js +39 -0
  56. package/build/esm/utils/schema/generateDocumentTypeFromSchema.js.map +1 -0
  57. package/build/esm/utils/schema/generateIndexFromSchema.js +9 -2
  58. package/build/esm/utils/schema/generateIndexFromSchema.js.map +1 -1
  59. package/build/esm/utils/schema/generateInternalFromSchema.js +138 -11
  60. package/build/esm/utils/schema/generateInternalFromSchema.js.map +1 -1
  61. package/build/esm/utils/schema/generateModelMetadataFromSchema.js +45 -13
  62. package/build/esm/utils/schema/generateModelMetadataFromSchema.js.map +1 -1
  63. package/build/esm/utils/schema/resolveSchemaChain.js +32 -16
  64. package/build/esm/utils/schema/resolveSchemaChain.js.map +1 -1
  65. package/build/esm/utils/schema/runtimeSchema.js +6 -0
  66. package/build/esm/utils/schema/runtimeSchema.js.map +1 -1
  67. package/build/esm/utils/schema/writeAllSdkFiles.js +10 -8
  68. package/build/esm/utils/schema/writeAllSdkFiles.js.map +1 -1
  69. package/build/esm/utils/steps/__tests__/__snapshots__/types/arrayFields.js.map +1 -1
  70. package/build/esm/utils/steps/__tests__/__snapshots__/types/customDiscriminant.js +1 -1
  71. package/build/esm/utils/steps/__tests__/__snapshots__/types/customDiscriminant.js.map +1 -1
  72. package/build/esm/utils/steps/__tests__/__snapshots__/types/generateTypeScriptInterfaces.js +1 -1
  73. package/build/esm/utils/steps/__tests__/__snapshots__/types/generateTypeScriptInterfaces.js.map +1 -1
  74. package/build/esm/utils/steps/__tests__/__snapshots__/types/refTypes.js.map +1 -1
  75. package/build/esm/utils/steps/__tests__/__snapshots__/types/simpleRecord.js.map +1 -1
  76. package/build/esm/utils/steps/__tests__/__snapshots__/types/simpleSteps.js +1 -1
  77. package/build/esm/utils/steps/__tests__/__snapshots__/types/simpleSteps.js.map +1 -1
  78. package/build/types/commands/asset/assetUpdateSchemaHandler.d.ts +12 -0
  79. package/build/types/commands/asset/assetUpdateSchemaHandler.d.ts.map +1 -0
  80. package/build/types/commands/asset/registerAssetCommands.d.ts.map +1 -1
  81. package/build/types/commands/ir/irGenAssetHandler.d.ts +16 -5
  82. package/build/types/commands/ir/irGenAssetHandler.d.ts.map +1 -1
  83. package/build/types/commands/ir/irGenTypesHandler.d.ts +0 -1
  84. package/build/types/commands/ir/irGenTypesHandler.d.ts.map +1 -1
  85. package/build/types/commands/ir/registerIrCommands.d.ts.map +1 -1
  86. package/build/types/commands/schema/__tests__/readPackConfig.test.d.ts +2 -0
  87. package/build/types/commands/schema/__tests__/readPackConfig.test.d.ts.map +1 -0
  88. package/build/types/commands/schema/registerSchemaCommands.d.ts.map +1 -1
  89. package/build/types/commands/schema/schemaIrHandler.d.ts +28 -6
  90. package/build/types/commands/schema/schemaIrHandler.d.ts.map +1 -1
  91. package/build/types/commands/types.d.ts +3 -1
  92. package/build/types/commands/types.d.ts.map +1 -1
  93. package/build/types/utils/schema/__tests__/fixtures.d.ts.map +1 -1
  94. package/build/types/utils/schema/__tests__/generateDocumentTypeFromSchema.test.d.ts +2 -0
  95. package/build/types/utils/schema/__tests__/generateDocumentTypeFromSchema.test.d.ts.map +1 -0
  96. package/build/types/utils/schema/__tests__/snapshotUtils.d.ts +2 -0
  97. package/build/types/utils/schema/__tests__/snapshotUtils.d.ts.map +1 -1
  98. package/build/types/utils/schema/generateDocumentTypeFromSchema.d.ts +17 -0
  99. package/build/types/utils/schema/generateDocumentTypeFromSchema.d.ts.map +1 -0
  100. package/build/types/utils/schema/generateIndexFromSchema.d.ts +4 -1
  101. package/build/types/utils/schema/generateIndexFromSchema.d.ts.map +1 -1
  102. package/build/types/utils/schema/generateInternalFromSchema.d.ts +5 -3
  103. package/build/types/utils/schema/generateInternalFromSchema.d.ts.map +1 -1
  104. package/build/types/utils/schema/generateModelMetadataFromSchema.d.ts.map +1 -1
  105. package/build/types/utils/schema/resolveSchemaChain.d.ts +21 -8
  106. package/build/types/utils/schema/resolveSchemaChain.d.ts.map +1 -1
  107. package/build/types/utils/schema/runtimeSchema.d.ts +4 -0
  108. package/build/types/utils/schema/runtimeSchema.d.ts.map +1 -1
  109. package/build/types/utils/schema/writeAllSdkFiles.d.ts +0 -1
  110. package/build/types/utils/schema/writeAllSdkFiles.d.ts.map +1 -1
  111. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"registerSchemaCommands.js","names":["schemaIrHandler","schemaToYamlHandler","registerSchemaCommands","program","schemaCmd","command","description","requiredOption","action"],"sources":["registerSchemaCommands.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 { Command } from \"commander\";\nimport { schemaIrHandler } from \"./schemaIrHandler.js\";\nimport { schemaToYamlHandler } from \"./schemaToYamlHandler.js\";\n\nexport function registerSchemaCommands(program: Command): void {\n const schemaCmd = program\n .command(\"schema\")\n .description(\"Commands for working with TypeScript schema definitions\");\n\n schemaCmd\n .command(\"yaml\")\n .description(\"Convert TypeScript schema to YAML migration steps\")\n .requiredOption(\"-i, --input <file>\", \"Input TypeScript schema file\")\n .requiredOption(\"-o, --output <file>\", \"Output YAML file\")\n .action(schemaToYamlHandler);\n\n schemaCmd\n .command(\"ir\")\n .description(\"Resolve a TypeScript schema module to a versioned IR chain JSON file\")\n .requiredOption(\"-i, --input <file>\", \"Input TypeScript/JavaScript schema module\")\n .requiredOption(\"-o, --output <file>\", \"Output IR chain JSON file\")\n .action(schemaIrHandler);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,eAAe,QAAQ,sBAAsB;AACtD,SAASC,mBAAmB,QAAQ,0BAA0B;AAE9D,OAAO,SAASC,sBAAsBA,CAACC,OAAgB,EAAQ;EAC7D,MAAMC,SAAS,GAAGD,OAAO,CACtBE,OAAO,CAAC,QAAQ,CAAC,CACjBC,WAAW,CAAC,yDAAyD,CAAC;EAEzEF,SAAS,CACNC,OAAO,CAAC,MAAM,CAAC,CACfC,WAAW,CAAC,mDAAmD,CAAC,CAChEC,cAAc,CAAC,oBAAoB,EAAE,8BAA8B,CAAC,CACpEA,cAAc,CAAC,qBAAqB,EAAE,kBAAkB,CAAC,CACzDC,MAAM,CAACP,mBAAmB,CAAC;EAE9BG,SAAS,CACNC,OAAO,CAAC,IAAI,CAAC,CACbC,WAAW,CAAC,sEAAsE,CAAC,CACnFC,cAAc,CAAC,oBAAoB,EAAE,2CAA2C,CAAC,CACjFA,cAAc,CAAC,qBAAqB,EAAE,2BAA2B,CAAC,CAClEC,MAAM,CAACR,eAAe,CAAC;AAC5B","ignoreList":[]}
1
+ {"version":3,"file":"registerSchemaCommands.js","names":["schemaIrHandler","schemaToYamlHandler","registerSchemaCommands","program","schemaCmd","command","description","requiredOption","action"],"sources":["registerSchemaCommands.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 { Command } from \"commander\";\nimport { schemaIrHandler } from \"./schemaIrHandler.js\";\nimport { schemaToYamlHandler } from \"./schemaToYamlHandler.js\";\n\nexport function registerSchemaCommands(program: Command): void {\n const schemaCmd = program\n .command(\"schema\")\n .description(\"Commands for working with TypeScript schema definitions\");\n\n schemaCmd\n .command(\"yaml\")\n .description(\"Convert TypeScript schema to YAML migration steps\")\n .requiredOption(\"-i, --input <file>\", \"Input TypeScript schema file\")\n .requiredOption(\"-o, --output <file>\", \"Output YAML file\")\n .action(schemaToYamlHandler);\n\n schemaCmd\n .command(\"ir\")\n .description(\"Resolve a TypeScript schema module to a versioned IR chain JSON file\")\n .requiredOption(\"-i, --input <file>\", \"Input TypeScript/JavaScript schema module\")\n .requiredOption(\"-o, --output <file>\", \"Output IR chain JSON file\")\n .requiredOption(\n \"--config <file>\",\n \"Path to the SDK's pack-config JSON file. Its optional 'minSupportedVersion' field declares the oldest schema version this SDK supports; omit the field to track latest only.\",\n )\n .action(schemaIrHandler);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,eAAe,QAAQ,sBAAsB;AACtD,SAASC,mBAAmB,QAAQ,0BAA0B;AAE9D,OAAO,SAASC,sBAAsBA,CAACC,OAAgB,EAAQ;EAC7D,MAAMC,SAAS,GAAGD,OAAO,CACtBE,OAAO,CAAC,QAAQ,CAAC,CACjBC,WAAW,CAAC,yDAAyD,CAAC;EAEzEF,SAAS,CACNC,OAAO,CAAC,MAAM,CAAC,CACfC,WAAW,CAAC,mDAAmD,CAAC,CAChEC,cAAc,CAAC,oBAAoB,EAAE,8BAA8B,CAAC,CACpEA,cAAc,CAAC,qBAAqB,EAAE,kBAAkB,CAAC,CACzDC,MAAM,CAACP,mBAAmB,CAAC;EAE9BG,SAAS,CACNC,OAAO,CAAC,IAAI,CAAC,CACbC,WAAW,CAAC,sEAAsE,CAAC,CACnFC,cAAc,CAAC,oBAAoB,EAAE,2CAA2C,CAAC,CACjFA,cAAc,CAAC,qBAAqB,EAAE,2BAA2B,CAAC,CAClEA,cAAc,CACb,iBAAiB,EACjB,8KACF,CAAC,CACAC,MAAM,CAACR,eAAe,CAAC;AAC5B","ignoreList":[]}
@@ -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,oCA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AAI,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.10.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.10.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;AAEr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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.10.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.10.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.10.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.10.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.10.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.10.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.10.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.10.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.10.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.10.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.10.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.10.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.10.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.10.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.10.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.10.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.10.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.10.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.10.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.10.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.10.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.10.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":[]}
@@ -141,16 +141,10 @@ export const twoVersionDerivedFieldsSchema = {
141
141
  migrations: {
142
142
  ShapeBox: {
143
143
  fillColor: {
144
- derivedFrom: ["color"],
145
- forward: ({
146
- color
147
- }) => color
144
+ derivedFrom: ["color"]
148
145
  },
149
146
  strokeColor: {
150
- derivedFrom: ["color"],
151
- forward: ({
152
- color
153
- }) => color
147
+ derivedFrom: ["color"]
154
148
  }
155
149
  }
156
150
  }
@@ -1 +1 @@
1
- {"version":3,"file":"fixtures.js","names":["defineRecord","defineSchema","defineSchemaUpdate","defineUnion","modelToRef","nextSchema","P","singleVersionModels","ShapeBox","docs","fields","left","Double","right","top","bottom","color","Optional","String","singleVersionSchemaNarrow","singleVersionSchema","twoVersionFieldRemovalSchema","type","models","fillColor","strokeColor","opacity","version","previous","addFillColorUpdate","schema","addField","build","twoVersionAdditiveSchema","addSchemaUpdate","CircleRecord","radius","DocRef","UserRefField","refFieldsSchema","Circle","Drawing","mainShape","extraShapes","Array","background","attachment","owner","RectangleRecord","width","height","unionTypesSchema","Rectangle","Shape","variants","circle","rectangle","nestedOptionalsSchema","Config","tags","scores","label","twoVersionDerivedFieldsSchema","migrations","derivedFrom","forward","aliasedEntryNameSchema","FooAlias","name","AnimalRecord","species","PlantRecord","genus","LivingBeingUnion","animal","plant","nestedUnionSchema","Animal","Plant","LivingBeing","Entity","livingBeing","optionalToRequiredFieldSchema","v1","Item","threeVersionChainSchema","v1Models","v2Models","hexColor","v3Models"],"sources":["fixtures.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 type { SchemaBuilder, SchemaDefinition } from \"@palantir/pack.schema\";\nimport {\n defineRecord,\n defineSchema,\n defineSchemaUpdate,\n defineUnion,\n modelToRef,\n nextSchema,\n} from \"@palantir/pack.schema\";\nimport * as P from \"@palantir/pack.schema\";\n\n/** Single-version schema: ShapeBox with 5 fields */\nconst singleVersionModels = {\n ShapeBox: defineRecord(\"ShapeBox\", {\n docs: \"A box shape\",\n fields: {\n left: P.Double,\n right: P.Double,\n top: P.Double,\n bottom: P.Double,\n color: P.Optional(P.String),\n },\n }),\n};\nconst singleVersionSchemaNarrow = defineSchema(singleVersionModels);\nexport const singleVersionSchema: SchemaDefinition = singleVersionSchemaNarrow;\n\n/** Two-version schema with field removal (color removed, fillColor + strokeColor + opacity added) */\nexport const twoVersionFieldRemovalSchema: SchemaDefinition = {\n type: \"versioned\",\n models: {\n ShapeBox: defineRecord(\"ShapeBox\", {\n docs: \"A box shape\",\n fields: {\n left: P.Double,\n right: P.Double,\n top: P.Double,\n bottom: P.Double,\n fillColor: P.Optional(P.String),\n strokeColor: P.Optional(P.String),\n opacity: P.Optional(P.Double),\n },\n }),\n },\n version: 2,\n previous: singleVersionSchema,\n};\n\n/** Two-version schema with additive change only (adds fillColor) */\nconst addFillColorUpdate = defineSchemaUpdate(\n \"addFillColor\",\n (schema: SchemaBuilder<typeof singleVersionModels>) => ({\n ShapeBox: schema.ShapeBox\n .addField(\"fillColor\", P.Optional(P.String))\n .build(),\n }),\n);\n\nexport const twoVersionAdditiveSchema: SchemaDefinition = nextSchema(singleVersionSchemaNarrow)\n .addSchemaUpdate(addFillColorUpdate)\n .build();\n\n/** Schema with ref fields: tests import paths for record refs, DocumentRef, UserRef */\nconst CircleRecord = defineRecord(\"Circle\", {\n docs: \"A circle\",\n fields: {\n radius: P.Double,\n },\n});\n\nconst DocRef: P.DocRef = { type: \"docRef\" };\nconst UserRefField: P.UserRef = { type: \"userRef\" };\n\nexport const refFieldsSchema: SchemaDefinition = defineSchema({\n Circle: CircleRecord,\n Drawing: defineRecord(\"Drawing\", {\n docs: \"A drawing with references\",\n fields: {\n mainShape: CircleRecord,\n extraShapes: P.Array(modelToRef(CircleRecord)),\n background: P.Optional(modelToRef(CircleRecord)),\n attachment: DocRef,\n owner: P.Optional(UserRefField),\n },\n }),\n});\n\n/** Schema with union types: tests union variant interfaces, discriminated union, and type guards */\nconst RectangleRecord = defineRecord(\"Rectangle\", {\n docs: \"A rectangle\",\n fields: {\n width: P.Double,\n height: P.Double,\n },\n});\n\nexport const unionTypesSchema: SchemaDefinition = defineSchema({\n Circle: CircleRecord,\n Rectangle: RectangleRecord,\n Shape: defineUnion(\"Shape\", {\n docs: \"A shape\",\n variants: {\n circle: CircleRecord,\n rectangle: RectangleRecord,\n },\n }),\n});\n\n/** Schema with nested optionals: tests that optional inside array structures is preserved */\nexport const nestedOptionalsSchema: SchemaDefinition = defineSchema({\n Config: defineRecord(\"Config\", {\n docs: \"A config with nested optional fields\",\n fields: {\n tags: P.Array(P.Optional(P.String)),\n scores: P.Array(P.Optional(P.Double)),\n label: P.Optional(P.String),\n },\n }),\n});\n\n/** Two-version schema with derived fields (color split into fillColor + strokeColor) */\nexport const twoVersionDerivedFieldsSchema: SchemaDefinition = {\n type: \"versioned\",\n models: {\n ShapeBox: defineRecord(\"ShapeBox\", {\n docs: \"A box shape\",\n fields: {\n left: P.Double,\n right: P.Double,\n top: P.Double,\n bottom: P.Double,\n fillColor: P.Optional(P.String),\n strokeColor: P.Optional(P.String),\n opacity: P.Optional(P.Double),\n },\n }),\n },\n version: 2,\n previous: singleVersionSchema,\n migrations: {\n ShapeBox: {\n fillColor: {\n derivedFrom: [\"color\"],\n forward: ({ color }: Record<string, unknown>) => color,\n },\n strokeColor: {\n derivedFrom: [\"color\"],\n forward: ({ color }: Record<string, unknown>) => color,\n },\n },\n },\n};\n\n/** Schema with aliased export key: export key \"FooAlias\" differs from model name \"Foo\" */\nexport const aliasedEntryNameSchema: SchemaDefinition = defineSchema({\n FooAlias: defineRecord(\"Foo\", {\n docs: \"A record exported under an alias\",\n fields: {\n name: P.String,\n },\n }),\n});\n\n/** Schema with nested union: Entity union has a variant that points to another union (LivingBeing) */\nconst AnimalRecord = defineRecord(\"Animal\", {\n docs: \"An animal\",\n fields: { species: P.String },\n});\n\nconst PlantRecord = defineRecord(\"Plant\", {\n docs: \"A plant\",\n fields: { genus: P.String },\n});\n\nconst LivingBeingUnion = defineUnion(\"LivingBeing\", {\n docs: \"A living being\",\n variants: {\n animal: AnimalRecord,\n plant: PlantRecord,\n },\n});\n\nexport const nestedUnionSchema: SchemaDefinition = defineSchema({\n Animal: AnimalRecord,\n Plant: PlantRecord,\n LivingBeing: LivingBeingUnion,\n Entity: defineUnion(\"Entity\", {\n docs: \"An entity\",\n variants: {\n livingBeing: LivingBeingUnion,\n },\n }),\n});\n\n/**\n * Two-version schema where a field starts as Optional(String) in v1 and becomes\n * required (String) in v2. The internal schema must remain optional because\n * documents written under v1 may legitimately omit the field.\n */\nexport const optionalToRequiredFieldSchema: SchemaDefinition = (() => {\n const v1 = defineSchema({\n Item: defineRecord(\"Item\", {\n docs: \"An item\",\n fields: {\n name: P.String,\n label: P.Optional(P.String),\n },\n }),\n });\n return {\n type: \"versioned\" as const,\n models: {\n Item: defineRecord(\"Item\", {\n docs: \"An item\",\n fields: {\n name: P.String,\n label: P.String,\n },\n }),\n },\n version: 2,\n previous: v1,\n };\n})();\n\n/** Three-version chain: Item (name, color -> name, hexColor -> name, hexColor, tags) */\nexport const threeVersionChainSchema: SchemaDefinition = (() => {\n const v1Models = {\n Item: defineRecord(\"Item\", {\n docs: \"\",\n fields: {\n name: P.String,\n color: P.Optional(P.String),\n },\n }),\n };\n const v2Models = {\n Item: defineRecord(\"Item\", {\n docs: \"\",\n fields: {\n name: P.String,\n hexColor: P.Optional(P.String),\n },\n }),\n };\n const v3Models = {\n Item: defineRecord(\"Item\", {\n docs: \"\",\n fields: {\n name: P.String,\n hexColor: P.Optional(P.String),\n tags: P.Optional(P.String),\n },\n }),\n };\n return {\n type: \"versioned\",\n models: v3Models,\n version: 3,\n previous: {\n type: \"versioned\",\n models: v2Models,\n version: 2,\n previous: { type: \"initial\", version: 1, models: v1Models },\n },\n };\n})();\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SACEA,YAAY,EACZC,YAAY,EACZC,kBAAkB,EAClBC,WAAW,EACXC,UAAU,EACVC,UAAU,QACL,uBAAuB;AAC9B,OAAO,KAAKC,CAAC,MAAM,uBAAuB;;AAE1C;AACA,MAAMC,mBAAmB,GAAG;EAC1BC,QAAQ,EAAER,YAAY,CAAC,UAAU,EAAE;IACjCS,IAAI,EAAE,aAAa;IACnBC,MAAM,EAAE;MACNC,IAAI,EAAEL,CAAC,CAACM,MAAM;MACdC,KAAK,EAAEP,CAAC,CAACM,MAAM;MACfE,GAAG,EAAER,CAAC,CAACM,MAAM;MACbG,MAAM,EAAET,CAAC,CAACM,MAAM;MAChBI,KAAK,EAAEV,CAAC,CAACW,QAAQ,CAACX,CAAC,CAACY,MAAM;IAC5B;EACF,CAAC;AACH,CAAC;AACD,MAAMC,yBAAyB,GAAGlB,YAAY,CAACM,mBAAmB,CAAC;AACnE,OAAO,MAAMa,mBAAqC,GAAGD,yBAAyB;;AAE9E;AACA,OAAO,MAAME,4BAA8C,GAAG;EAC5DC,IAAI,EAAE,WAAW;EACjBC,MAAM,EAAE;IACNf,QAAQ,EAAER,YAAY,CAAC,UAAU,EAAE;MACjCS,IAAI,EAAE,aAAa;MACnBC,M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,EAAE;QAAEN,IAAI,EAAE,SAAS;QAAEK,OAAO,EAAE,CAAC;QAAEJ,MAAM,EAAE+D;MAAS;IAC5D;EACF,CAAC;AACH,CAAC,EAAE,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"fixtures.js","names":["defineRecord","defineSchema","defineSchemaUpdate","defineUnion","modelToRef","nextSchema","P","singleVersionModels","ShapeBox","docs","fields","left","Double","right","top","bottom","color","Optional","String","singleVersionSchemaNarrow","singleVersionSchema","twoVersionFieldRemovalSchema","type","models","fillColor","strokeColor","opacity","version","previous","addFillColorUpdate","schema","addField","build","twoVersionAdditiveSchema","addSchemaUpdate","CircleRecord","radius","DocRef","UserRefField","refFieldsSchema","Circle","Drawing","mainShape","extraShapes","Array","background","attachment","owner","RectangleRecord","width","height","unionTypesSchema","Rectangle","Shape","variants","circle","rectangle","nestedOptionalsSchema","Config","tags","scores","label","twoVersionDerivedFieldsSchema","migrations","derivedFrom","aliasedEntryNameSchema","FooAlias","name","AnimalRecord","species","PlantRecord","genus","LivingBeingUnion","animal","plant","nestedUnionSchema","Animal","Plant","LivingBeing","Entity","livingBeing","optionalToRequiredFieldSchema","v1","Item","threeVersionChainSchema","v1Models","v2Models","hexColor","v3Models"],"sources":["fixtures.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 type { SchemaBuilder, SchemaDefinition } from \"@palantir/pack.schema\";\nimport {\n defineRecord,\n defineSchema,\n defineSchemaUpdate,\n defineUnion,\n modelToRef,\n nextSchema,\n} from \"@palantir/pack.schema\";\nimport * as P from \"@palantir/pack.schema\";\n\n/** Single-version schema: ShapeBox with 5 fields */\nconst singleVersionModels = {\n ShapeBox: defineRecord(\"ShapeBox\", {\n docs: \"A box shape\",\n fields: {\n left: P.Double,\n right: P.Double,\n top: P.Double,\n bottom: P.Double,\n color: P.Optional(P.String),\n },\n }),\n};\nconst singleVersionSchemaNarrow = defineSchema(singleVersionModels);\nexport const singleVersionSchema: SchemaDefinition = singleVersionSchemaNarrow;\n\n/** Two-version schema with field removal (color removed, fillColor + strokeColor + opacity added) */\nexport const twoVersionFieldRemovalSchema: SchemaDefinition = {\n type: \"versioned\",\n models: {\n ShapeBox: defineRecord(\"ShapeBox\", {\n docs: \"A box shape\",\n fields: {\n left: P.Double,\n right: P.Double,\n top: P.Double,\n bottom: P.Double,\n fillColor: P.Optional(P.String),\n strokeColor: P.Optional(P.String),\n opacity: P.Optional(P.Double),\n },\n }),\n },\n version: 2,\n previous: singleVersionSchema,\n};\n\n/** Two-version schema with additive change only (adds fillColor) */\nconst addFillColorUpdate = defineSchemaUpdate(\n \"addFillColor\",\n (schema: SchemaBuilder<typeof singleVersionModels>) => ({\n ShapeBox: schema.ShapeBox\n .addField(\"fillColor\", P.Optional(P.String))\n .build(),\n }),\n);\n\nexport const twoVersionAdditiveSchema: SchemaDefinition = nextSchema(singleVersionSchemaNarrow)\n .addSchemaUpdate(addFillColorUpdate)\n .build();\n\n/** Schema with ref fields: tests import paths for record refs, DocumentRef, UserRef */\nconst CircleRecord = defineRecord(\"Circle\", {\n docs: \"A circle\",\n fields: {\n radius: P.Double,\n },\n});\n\nconst DocRef: P.DocRef = { type: \"docRef\" };\nconst UserRefField: P.UserRef = { type: \"userRef\" };\n\nexport const refFieldsSchema: SchemaDefinition = defineSchema({\n Circle: CircleRecord,\n Drawing: defineRecord(\"Drawing\", {\n docs: \"A drawing with references\",\n fields: {\n mainShape: CircleRecord,\n extraShapes: P.Array(modelToRef(CircleRecord)),\n background: P.Optional(modelToRef(CircleRecord)),\n attachment: DocRef,\n owner: P.Optional(UserRefField),\n },\n }),\n});\n\n/** Schema with union types: tests union variant interfaces, discriminated union, and type guards */\nconst RectangleRecord = defineRecord(\"Rectangle\", {\n docs: \"A rectangle\",\n fields: {\n width: P.Double,\n height: P.Double,\n },\n});\n\nexport const unionTypesSchema: SchemaDefinition = defineSchema({\n Circle: CircleRecord,\n Rectangle: RectangleRecord,\n Shape: defineUnion(\"Shape\", {\n docs: \"A shape\",\n variants: {\n circle: CircleRecord,\n rectangle: RectangleRecord,\n },\n }),\n});\n\n/** Schema with nested optionals: tests that optional inside array structures is preserved */\nexport const nestedOptionalsSchema: SchemaDefinition = defineSchema({\n Config: defineRecord(\"Config\", {\n docs: \"A config with nested optional fields\",\n fields: {\n tags: P.Array(P.Optional(P.String)),\n scores: P.Array(P.Optional(P.Double)),\n label: P.Optional(P.String),\n },\n }),\n});\n\n/** Two-version schema with derived fields (color split into fillColor + strokeColor) */\nexport const twoVersionDerivedFieldsSchema: SchemaDefinition = {\n type: \"versioned\",\n models: {\n ShapeBox: defineRecord(\"ShapeBox\", {\n docs: \"A box shape\",\n fields: {\n left: P.Double,\n right: P.Double,\n top: P.Double,\n bottom: P.Double,\n fillColor: P.Optional(P.String),\n strokeColor: P.Optional(P.String),\n opacity: P.Optional(P.Double),\n },\n }),\n },\n version: 2,\n previous: singleVersionSchema,\n migrations: {\n ShapeBox: {\n fillColor: {\n derivedFrom: [\"color\"],\n },\n strokeColor: {\n derivedFrom: [\"color\"],\n },\n },\n },\n};\n\n/** Schema with aliased export key: export key \"FooAlias\" differs from model name \"Foo\" */\nexport const aliasedEntryNameSchema: SchemaDefinition = defineSchema({\n FooAlias: defineRecord(\"Foo\", {\n docs: \"A record exported under an alias\",\n fields: {\n name: P.String,\n },\n }),\n});\n\n/** Schema with nested union: Entity union has a variant that points to another union (LivingBeing) */\nconst AnimalRecord = defineRecord(\"Animal\", {\n docs: \"An animal\",\n fields: { species: P.String },\n});\n\nconst PlantRecord = defineRecord(\"Plant\", {\n docs: \"A plant\",\n fields: { genus: P.String },\n});\n\nconst LivingBeingUnion = defineUnion(\"LivingBeing\", {\n docs: \"A living being\",\n variants: {\n animal: AnimalRecord,\n plant: PlantRecord,\n },\n});\n\nexport const nestedUnionSchema: SchemaDefinition = defineSchema({\n Animal: AnimalRecord,\n Plant: PlantRecord,\n LivingBeing: LivingBeingUnion,\n Entity: defineUnion(\"Entity\", {\n docs: \"An entity\",\n variants: {\n livingBeing: LivingBeingUnion,\n },\n }),\n});\n\n/**\n * Two-version schema where a field starts as Optional(String) in v1 and becomes\n * required (String) in v2. The internal schema must remain optional because\n * documents written under v1 may legitimately omit the field.\n */\nexport const optionalToRequiredFieldSchema: SchemaDefinition = (() => {\n const v1 = defineSchema({\n Item: defineRecord(\"Item\", {\n docs: \"An item\",\n fields: {\n name: P.String,\n label: P.Optional(P.String),\n },\n }),\n });\n return {\n type: \"versioned\" as const,\n models: {\n Item: defineRecord(\"Item\", {\n docs: \"An item\",\n fields: {\n name: P.String,\n label: P.String,\n },\n }),\n },\n version: 2,\n previous: v1,\n };\n})();\n\n/** Three-version chain: Item (name, color -> name, hexColor -> name, hexColor, tags) */\nexport const threeVersionChainSchema: SchemaDefinition = (() => {\n const v1Models = {\n Item: defineRecord(\"Item\", {\n docs: \"\",\n fields: {\n name: P.String,\n color: P.Optional(P.String),\n },\n }),\n };\n const v2Models = {\n Item: defineRecord(\"Item\", {\n docs: \"\",\n fields: {\n name: P.String,\n hexColor: P.Optional(P.String),\n },\n }),\n };\n const v3Models = {\n Item: defineRecord(\"Item\", {\n docs: \"\",\n fields: {\n name: P.String,\n hexColor: P.Optional(P.String),\n tags: P.Optional(P.String),\n },\n }),\n };\n return {\n type: \"versioned\",\n models: v3Models,\n version: 3,\n previous: {\n type: \"versioned\",\n models: v2Models,\n version: 2,\n previous: { type: \"initial\", version: 1, models: v1Models },\n },\n };\n})();\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A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QACNyD,IAAI,EAAE7D,CAAC,CAACY,MAAM;QACdqE,QAAQ,EAAEjF,CAAC,CAACW,QAAQ,CAACX,CAAC,CAACY,MAAM;MAC/B;IACF,CAAC;EACH,CAAC;EACD,MAAMsE,QAAQ,GAAG;IACfL,IAAI,EAAEnF,YAAY,CAAC,MAAM,EAAE;MACzBS,IAAI,EAAE,EAAE;MACRC,MAAM,EAAE;QACNyD,IAAI,EAAE7D,CAAC,CAACY,MAAM;QACdqE,QAAQ,EAAEjF,CAAC,CAACW,QAAQ,CAACX,CAAC,CAACY,MAAM,CAAC;QAC9ByC,IAAI,EAAErD,CAAC,CAACW,QAAQ,CAACX,CAAC,CAACY,MAAM;MAC3B;IACF,CAAC;EACH,CAAC;EACD,OAAO;IACLI,IAAI,EAAE,WAAW;IACjBC,MAAM,EAAEiE,QAAQ;IAChB7D,OAAO,EAAE,CAAC;IACVC,QAAQ,EAAE;MACRN,IAAI,EAAE,WAAW;MACjBC,MAAM,EAAE+D,QAAQ;MAChB3D,OAAO,EAAE,CAAC;MACVC,QAAQ,EAAE;QAAEN,IAAI,EAAE,SAAS;QAAEK,OAAO,EAAE,CAAC;QAAEJ,MAAM,EAAE8D;MAAS;IAC5D;EACF,CAAC;AACH,CAAC,EAAE,CAAC","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":[]}