@palantir/pack.document-schema.type-gen 0.10.0 → 0.11.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 (73) hide show
  1. package/build/esm/commands/asset/assetUpdateSchemaHandler.js +84 -0
  2. package/build/esm/commands/asset/assetUpdateSchemaHandler.js.map +1 -0
  3. package/build/esm/commands/asset/registerAssetCommands.js +2 -0
  4. package/build/esm/commands/asset/registerAssetCommands.js.map +1 -1
  5. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/custom-discriminant.js +1 -1
  6. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/custom-discriminant.js.map +1 -1
  7. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/external-refs.js +1 -1
  8. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/external-refs.js.map +1 -1
  9. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/simple-record.js +1 -1
  10. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/simple-record.js.map +1 -1
  11. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/union-types.js +1 -1
  12. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/union-types.js.map +1 -1
  13. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/array-and-map-types.js +1 -1
  14. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/array-and-map-types.js.map +1 -1
  15. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/boolean-fields.js +1 -1
  16. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/boolean-fields.js.map +1 -1
  17. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/custom-discriminant.js +1 -1
  18. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/custom-discriminant.js.map +1 -1
  19. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/datetime-fields.js +1 -1
  20. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/datetime-fields.js.map +1 -1
  21. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/simple-records.js +1 -1
  22. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/simple-records.js.map +1 -1
  23. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/union-before-records.js +1 -1
  24. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/union-before-records.js.map +1 -1
  25. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/union-types.js +1 -1
  26. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/union-types.js.map +1 -1
  27. package/build/esm/utils/schema/__tests__/__snapshots__/generateVersionsFromSchema/single-version.js.map +1 -1
  28. package/build/esm/utils/schema/__tests__/__snapshots__/generateVersionsFromSchema/three-version-chain.js.map +1 -1
  29. package/build/esm/utils/schema/__tests__/__snapshots__/generateVersionsFromSchema/two-version.js.map +1 -1
  30. package/build/esm/utils/schema/__tests__/fixtures.js +2 -8
  31. package/build/esm/utils/schema/__tests__/fixtures.js.map +1 -1
  32. package/build/esm/utils/schema/__tests__/generateModelMetadataFromSchema.test.js +5 -1
  33. package/build/esm/utils/schema/__tests__/generateModelMetadataFromSchema.test.js.map +1 -1
  34. package/build/esm/utils/schema/__tests__/snapshotUtils.js +3 -0
  35. package/build/esm/utils/schema/__tests__/snapshotUtils.js.map +1 -1
  36. package/build/esm/utils/schema/generateIndexFromSchema.js +7 -2
  37. package/build/esm/utils/schema/generateIndexFromSchema.js.map +1 -1
  38. package/build/esm/utils/schema/generateInternalFromSchema.js +138 -11
  39. package/build/esm/utils/schema/generateInternalFromSchema.js.map +1 -1
  40. package/build/esm/utils/schema/generateModelMetadataFromSchema.js +45 -13
  41. package/build/esm/utils/schema/generateModelMetadataFromSchema.js.map +1 -1
  42. package/build/esm/utils/schema/resolveSchemaChain.js +20 -11
  43. package/build/esm/utils/schema/resolveSchemaChain.js.map +1 -1
  44. package/build/esm/utils/schema/runtimeSchema.js +3 -0
  45. package/build/esm/utils/schema/runtimeSchema.js.map +1 -1
  46. package/build/esm/utils/schema/writeAllSdkFiles.js +2 -0
  47. package/build/esm/utils/schema/writeAllSdkFiles.js.map +1 -1
  48. package/build/esm/utils/steps/__tests__/__snapshots__/types/arrayFields.js.map +1 -1
  49. package/build/esm/utils/steps/__tests__/__snapshots__/types/customDiscriminant.js +1 -1
  50. package/build/esm/utils/steps/__tests__/__snapshots__/types/customDiscriminant.js.map +1 -1
  51. package/build/esm/utils/steps/__tests__/__snapshots__/types/generateTypeScriptInterfaces.js +1 -1
  52. package/build/esm/utils/steps/__tests__/__snapshots__/types/generateTypeScriptInterfaces.js.map +1 -1
  53. package/build/esm/utils/steps/__tests__/__snapshots__/types/refTypes.js.map +1 -1
  54. package/build/esm/utils/steps/__tests__/__snapshots__/types/simpleRecord.js.map +1 -1
  55. package/build/esm/utils/steps/__tests__/__snapshots__/types/simpleSteps.js +1 -1
  56. package/build/esm/utils/steps/__tests__/__snapshots__/types/simpleSteps.js.map +1 -1
  57. package/build/types/commands/asset/assetUpdateSchemaHandler.d.ts +12 -0
  58. package/build/types/commands/asset/assetUpdateSchemaHandler.d.ts.map +1 -0
  59. package/build/types/commands/asset/registerAssetCommands.d.ts.map +1 -1
  60. package/build/types/utils/schema/__tests__/fixtures.d.ts.map +1 -1
  61. package/build/types/utils/schema/__tests__/snapshotUtils.d.ts +2 -0
  62. package/build/types/utils/schema/__tests__/snapshotUtils.d.ts.map +1 -1
  63. package/build/types/utils/schema/generateIndexFromSchema.d.ts +3 -1
  64. package/build/types/utils/schema/generateIndexFromSchema.d.ts.map +1 -1
  65. package/build/types/utils/schema/generateInternalFromSchema.d.ts +5 -3
  66. package/build/types/utils/schema/generateInternalFromSchema.d.ts.map +1 -1
  67. package/build/types/utils/schema/generateModelMetadataFromSchema.d.ts.map +1 -1
  68. package/build/types/utils/schema/resolveSchemaChain.d.ts +7 -7
  69. package/build/types/utils/schema/resolveSchemaChain.d.ts.map +1 -1
  70. package/build/types/utils/schema/runtimeSchema.d.ts +2 -0
  71. package/build/types/utils/schema/runtimeSchema.d.ts.map +1 -1
  72. package/build/types/utils/schema/writeAllSdkFiles.d.ts.map +1 -1
  73. package/package.json +4 -4
@@ -0,0 +1,84 @@
1
+ /*
2
+ * Copyright 2025 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 { createPlatformClient, PalantirApiError } from "@osdk/client";
18
+ import { DocumentTypes } from "@osdk/foundry.pack";
19
+ import { CommanderError } from "commander";
20
+ import { consola } from "consola";
21
+ import { readFileSync } from "fs";
22
+ import { resolve } from "path";
23
+ import { buildPrefixRewriteFetch } from "./assetDeployHandler.js";
24
+ const DEFAULT_API_PREFIX = "/api";
25
+
26
+ /** Updates the schema of an existing document type using a generated asset JSON file. */
27
+ export async function assetUpdateSchemaHandler(options) {
28
+ try {
29
+ const assetPath = resolve(options.input);
30
+ consola.info(`Reading asset file from: ${assetPath}`);
31
+ const assetContent = readFileSync(assetPath, "utf8");
32
+ const asset = JSON.parse(assetContent);
33
+ const fetchFn = options.firstPartyPrefix != null ? buildPrefixRewriteFetch(options.firstPartyPrefix) : undefined;
34
+ if (fetchFn != null) {
35
+ consola.info(`Rewriting OSDK '${DEFAULT_API_PREFIX}' -> '${options.firstPartyPrefix}'`);
36
+ }
37
+ const osdkClient = createPlatformClient(options.baseUrl, () => Promise.resolve(options.auth), undefined, fetchFn);
38
+ const request = {
39
+ documentTypeName: asset.documentTypeName,
40
+ requestBody: {
41
+ ontologyRid: options.ontologyRid,
42
+ schema: asset.documentStorageType.yjs,
43
+ version: asset.schemaVersion,
44
+ ...(options.forceOverwrite ? {
45
+ forceOverwrite: true
46
+ } : {})
47
+ }
48
+ };
49
+ if (options.forceOverwrite) {
50
+ consola.warn("--force-overwrite is set: backwards-compatibility validation will be skipped.");
51
+ }
52
+ consola.info(`Updating schema for document type "${asset.documentTypeName}" -> version ${asset.schemaVersion}`);
53
+ const result = await DocumentTypes.updateSchema(osdkClient, request, {
54
+ preview: true
55
+ });
56
+ if (result.type === "success") {
57
+ consola.success(`Schema updated successfully (version ${result.version})`);
58
+ return;
59
+ }
60
+ consola.error(`Schema validation failed with ${result.violations.length} violation(s):`);
61
+ for (const violation of result.violations) {
62
+ consola.error(` - ${violation.fieldPath}\t${violation.violationType}\t${violation.message}`);
63
+ }
64
+ consola.info("Hint: re-run with --force-overwrite to skip validation.");
65
+ throw new CommanderError(1, "ERRSCHEMAVALIDATION", "Schema validation failed during update");
66
+ } catch (error) {
67
+ if (error instanceof CommanderError) {
68
+ throw error;
69
+ }
70
+ if (error instanceof PalantirApiError) {
71
+ const {
72
+ message,
73
+ errorName,
74
+ errorCode
75
+ } = error;
76
+ const details = [errorName, errorCode].filter(Boolean).join(" ");
77
+ consola.error(`❌ Error during schema update: ${message}${details ? ` [${details}]` : ""}`);
78
+ } else {
79
+ consola.error("❌ Error during schema update:", error);
80
+ }
81
+ throw new CommanderError(1, "ERRASSETUPDATESCHEMA", "Error updating document type schema");
82
+ }
83
+ }
84
+ //# sourceMappingURL=assetUpdateSchemaHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assetUpdateSchemaHandler.js","names":["createPlatformClient","PalantirApiError","DocumentTypes","CommanderError","consola","readFileSync","resolve","buildPrefixRewriteFetch","DEFAULT_API_PREFIX","assetUpdateSchemaHandler","options","assetPath","input","info","assetContent","asset","JSON","parse","fetchFn","firstPartyPrefix","undefined","osdkClient","baseUrl","Promise","auth","request","documentTypeName","requestBody","ontologyRid","schema","documentStorageType","yjs","version","schemaVersion","forceOverwrite","warn","result","updateSchema","preview","type","success","error","violations","length","violation","fieldPath","violationType","message","errorName","errorCode","details","filter","Boolean","join"],"sources":["assetUpdateSchemaHandler.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 { createPlatformClient, PalantirApiError } from \"@osdk/client\";\nimport type { UpdateSchemaDocumentTypeRequest } from \"@osdk/foundry.pack\";\nimport { DocumentTypes } from \"@osdk/foundry.pack\";\nimport { CommanderError } from \"commander\";\nimport { consola } from \"consola\";\nimport { readFileSync } from \"fs\";\nimport { resolve } from \"path\";\nimport type { DocumentTypeAsset } from \"../types.js\";\nimport { buildPrefixRewriteFetch } from \"./assetDeployHandler.js\";\n\ninterface AssetUpdateSchemaOptions {\n readonly input: string;\n readonly baseUrl: string;\n readonly auth: string;\n readonly ontologyRid: string;\n readonly forceOverwrite?: boolean;\n readonly firstPartyPrefix?: string;\n}\n\nconst DEFAULT_API_PREFIX = \"/api\";\n\n/** Updates the schema of an existing document type using a generated asset JSON file. */\nexport async function assetUpdateSchemaHandler(\n options: AssetUpdateSchemaOptions,\n): Promise<void> {\n try {\n const assetPath = resolve(options.input);\n\n consola.info(`Reading asset file from: ${assetPath}`);\n\n const assetContent = readFileSync(assetPath, \"utf8\");\n const asset = JSON.parse(assetContent) as DocumentTypeAsset;\n\n const fetchFn = options.firstPartyPrefix != null\n ? buildPrefixRewriteFetch(options.firstPartyPrefix)\n : undefined;\n if (fetchFn != null) {\n consola.info(`Rewriting OSDK '${DEFAULT_API_PREFIX}' -> '${options.firstPartyPrefix}'`);\n }\n\n const osdkClient = createPlatformClient(\n options.baseUrl,\n () => Promise.resolve(options.auth),\n undefined,\n fetchFn,\n );\n\n const request: UpdateSchemaDocumentTypeRequest = {\n documentTypeName: asset.documentTypeName,\n requestBody: {\n ontologyRid: options.ontologyRid,\n schema: asset.documentStorageType.yjs,\n version: asset.schemaVersion,\n ...(options.forceOverwrite ? { forceOverwrite: true } : {}),\n },\n };\n\n if (options.forceOverwrite) {\n consola.warn(\"--force-overwrite is set: backwards-compatibility validation will be skipped.\");\n }\n\n consola.info(\n `Updating schema for document type \"${asset.documentTypeName}\" -> version ${asset.schemaVersion}`,\n );\n\n const result = await DocumentTypes.updateSchema(osdkClient, request, { preview: true });\n\n if (result.type === \"success\") {\n consola.success(`Schema updated successfully (version ${result.version})`);\n return;\n }\n\n consola.error(`Schema validation failed with ${result.violations.length} violation(s):`);\n for (const violation of result.violations) {\n consola.error(` - ${violation.fieldPath}\\t${violation.violationType}\\t${violation.message}`);\n }\n consola.info(\"Hint: re-run with --force-overwrite to skip validation.\");\n throw new CommanderError(\n 1,\n \"ERRSCHEMAVALIDATION\",\n \"Schema validation failed during update\",\n );\n } catch (error) {\n if (error instanceof CommanderError) {\n throw error;\n }\n if (error instanceof PalantirApiError) {\n const { message, errorName, errorCode } = error;\n const details = [errorName, errorCode].filter(Boolean).join(\" \");\n consola.error(\n `❌ Error during schema update: ${message}${details ? ` [${details}]` : \"\"}`,\n );\n } else {\n consola.error(\"❌ Error during schema update:\", error);\n }\n throw new CommanderError(1, \"ERRASSETUPDATESCHEMA\", \"Error updating document type schema\");\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,oBAAoB,EA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,IAAI,CAAC,GAAG,CAAC;MAChEjD,OAAO,CAACqC,KAAK,CACX,iCAAiCM,OAAO,GAAGG,OAAO,GAAG,KAAKA,OAAO,GAAG,GAAG,EAAE,EAC3E,CAAC;IACH,CAAC,MAAM;MACL9C,OAAO,CAACqC,KAAK,CAAC,+BAA+B,EAAEA,KAAK,CAAC;IACvD;IACA,MAAM,IAAItC,cAAc,CAAC,CAAC,EAAE,sBAAsB,EAAE,qCAAqC,CAAC;EAC5F;AACF","ignoreList":[]}
@@ -15,8 +15,10 @@
15
15
  */
16
16
 
17
17
  import { assetDeployHandler } from "./assetDeployHandler.js";
18
+ import { assetUpdateSchemaHandler } from "./assetUpdateSchemaHandler.js";
18
19
  export function registerAssetCommands(program) {
19
20
  const assetCmd = program.command("asset").description("Asset-based document type commands");
20
21
  assetCmd.command("deploy").description("Deploy a document type to a Foundry stack using an asset JSON file").requiredOption("-i, --input <file>", "Path to asset JSON file (output of 'ir asset')").requiredOption("-b, --base-url <url>", "Base URL for Foundry API").requiredOption("-a, --auth <token>", "Authentication token for Foundry API").requiredOption("-o, --ontology-rid <rid>", "Target ontology RID").option("--first-party-prefix <path>", "Override the API prefix used for first-party deploy (e.g. /api/gotham). Defaults to /api.").action(assetDeployHandler);
22
+ assetCmd.command("update-schema").description("Update the schema of an existing document type using an asset JSON file").requiredOption("-i, --input <file>", "Path to asset JSON file (output of 'ir asset')").requiredOption("-b, --base-url <url>", "Base URL for Foundry API").requiredOption("-a, --auth <token>", "Authentication token for Foundry API").requiredOption("-o, --ontology-rid <rid>", "Target ontology RID").option("--force-overwrite", "Skip backwards-compatibility validation when updating the schema", false).option("--first-party-prefix <path>", "Override the API prefix used for first-party requests (e.g. /api/gotham). Defaults to /api.").action(assetUpdateSchemaHandler);
21
23
  }
22
24
  //# sourceMappingURL=registerAssetCommands.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"registerAssetCommands.js","names":["assetDeployHandler","registerAssetCommands","program","assetCmd","command","description","requiredOption","option","action"],"sources":["registerAssetCommands.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 { assetDeployHandler } from \"./assetDeployHandler.js\";\n\nexport function registerAssetCommands(program: Command): void {\n const assetCmd = program\n .command(\"asset\")\n .description(\"Asset-based document type commands\");\n\n assetCmd\n .command(\"deploy\")\n .description(\"Deploy a document type to a Foundry stack using an asset JSON file\")\n .requiredOption(\"-i, --input <file>\", \"Path to asset JSON file (output of 'ir asset')\")\n .requiredOption(\"-b, --base-url <url>\", \"Base URL for Foundry API\")\n .requiredOption(\"-a, --auth <token>\", \"Authentication token for Foundry API\")\n .requiredOption(\"-o, --ontology-rid <rid>\", \"Target ontology RID\")\n .option(\n \"--first-party-prefix <path>\",\n \"Override the API prefix used for first-party deploy (e.g. /api/gotham). Defaults to /api.\",\n )\n .action(assetDeployHandler);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,kBAAkB,QAAQ,yBAAyB;AAE5D,OAAO,SAASC,qBAAqBA,CAACC,OAAgB,EAAQ;EAC5D,MAAMC,QAAQ,GAAGD,OAAO,CACrBE,OAAO,CAAC,OAAO,CAAC,CAChBC,WAAW,CAAC,oCAAoC,CAAC;EAEpDF,QAAQ,CACLC,OAAO,CAAC,QAAQ,CAAC,CACjBC,WAAW,CAAC,oEAAoE,CAAC,CACjFC,cAAc,CAAC,oBAAoB,EAAE,gDAAgD,CAAC,CACtFA,cAAc,CAAC,sBAAsB,EAAE,0BAA0B,CAAC,CAClEA,cAAc,CAAC,oBAAoB,EAAE,sCAAsC,CAAC,CAC5EA,cAAc,CAAC,0BAA0B,EAAE,qBAAqB,CAAC,CACjEC,MAAM,CACL,6BAA6B,EAC7B,2FACF,CAAC,CACAC,MAAM,CAACR,kBAAkB,CAAC;AAC/B","ignoreList":[]}
1
+ {"version":3,"file":"registerAssetCommands.js","names":["assetDeployHandler","assetUpdateSchemaHandler","registerAssetCommands","program","assetCmd","command","description","requiredOption","option","action"],"sources":["registerAssetCommands.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 { assetDeployHandler } from \"./assetDeployHandler.js\";\nimport { assetUpdateSchemaHandler } from \"./assetUpdateSchemaHandler.js\";\n\nexport function registerAssetCommands(program: Command): void {\n const assetCmd = program\n .command(\"asset\")\n .description(\"Asset-based document type commands\");\n\n assetCmd\n .command(\"deploy\")\n .description(\"Deploy a document type to a Foundry stack using an asset JSON file\")\n .requiredOption(\"-i, --input <file>\", \"Path to asset JSON file (output of 'ir asset')\")\n .requiredOption(\"-b, --base-url <url>\", \"Base URL for Foundry API\")\n .requiredOption(\"-a, --auth <token>\", \"Authentication token for Foundry API\")\n .requiredOption(\"-o, --ontology-rid <rid>\", \"Target ontology RID\")\n .option(\n \"--first-party-prefix <path>\",\n \"Override the API prefix used for first-party deploy (e.g. /api/gotham). Defaults to /api.\",\n )\n .action(assetDeployHandler);\n\n assetCmd\n .command(\"update-schema\")\n .description(\n \"Update the schema of an existing document type using an asset JSON file\",\n )\n .requiredOption(\"-i, --input <file>\", \"Path to asset JSON file (output of 'ir asset')\")\n .requiredOption(\"-b, --base-url <url>\", \"Base URL for Foundry API\")\n .requiredOption(\"-a, --auth <token>\", \"Authentication token for Foundry API\")\n .requiredOption(\"-o, --ontology-rid <rid>\", \"Target ontology RID\")\n .option(\n \"--force-overwrite\",\n \"Skip backwards-compatibility validation when updating the schema\",\n false,\n )\n .option(\n \"--first-party-prefix <path>\",\n \"Override the API prefix used for first-party requests (e.g. /api/gotham). Defaults to /api.\",\n )\n .action(assetUpdateSchemaHandler);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,kBAAkB,QAAQ,yBAAyB;AAC5D,SAASC,wBAAwB,QAAQ,+BAA+B;AAExE,OAAO,SAASC,qBAAqBA,CAACC,OAAgB,EAAQ;EAC5D,MAAMC,QAAQ,GAAGD,OAAO,CACrBE,OAAO,CAAC,OAAO,CAAC,CAChBC,WAAW,CAAC,oCAAoC,CAAC;EAEpDF,QAAQ,CACLC,OAAO,CAAC,QAAQ,CAAC,CACjBC,WAAW,CAAC,oEAAoE,CAAC,CACjFC,cAAc,CAAC,oBAAoB,EAAE,gDAAgD,CAAC,CACtFA,cAAc,CAAC,sBAAsB,EAAE,0BAA0B,CAAC,CAClEA,cAAc,CAAC,oBAAoB,EAAE,sCAAsC,CAAC,CAC5EA,cAAc,CAAC,0BAA0B,EAAE,qBAAqB,CAAC,CACjEC,MAAM,CACL,6BAA6B,EAC7B,2FACF,CAAC,CACAC,MAAM,CAACT,kBAAkB,CAAC;EAE7BI,QAAQ,CACLC,OAAO,CAAC,eAAe,CAAC,CACxBC,WAAW,CACV,yEACF,CAAC,CACAC,cAAc,CAAC,oBAAoB,EAAE,gDAAgD,CAAC,CACtFA,cAAc,CAAC,sBAAsB,EAAE,0BAA0B,CAAC,CAClEA,cAAc,CAAC,oBAAoB,EAAE,sCAAsC,CAAC,CAC5EA,cAAc,CAAC,0BAA0B,EAAE,qBAAqB,CAAC,CACjEC,MAAM,CACL,mBAAmB,EACnB,kEAAkE,EAClE,KACF,CAAC,CACAA,MAAM,CACL,6BAA6B,EAC7B,6FACF,CAAC,CACAC,MAAM,CAACR,wBAAwB,CAAC;AACrC","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.11.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.11.0 */\n\nimport type {\n DocumentSchema,\n RecordModel,\n UnionModel,\n} from '@palantir/pack.document-schema.model-types';\nimport { Metadata } from '@palantir/pack.document-schema.model-types';\nimport type { Animal, AnimalCat, AnimalDog, Cat, Dog } from './types.js';\nimport {\n AnimalCatSchema,\n AnimalDogSchema,\n AnimalSchema,\n CatSchema,\n DogSchema,\n} from './schema.js';\n\nexport interface CatModel extends RecordModel<Cat, typeof CatSchema> {}\nexport const CatModel: CatModel = {\n __type: {} as Cat,\n zodSchema: CatSchema,\n [Metadata]: {\n name: 'Cat',\n },\n};\n\nexport interface DogModel extends RecordModel<Dog, typeof DogSchema> {}\nexport const DogModel: DogModel = {\n __type: {} as Dog,\n zodSchema: DogSchema,\n [Metadata]: {\n name: 'Dog',\n },\n};\n\nexport interface AnimalModel extends UnionModel<Animal, typeof AnimalSchema> {}\nexport const AnimalModel: AnimalModel = {\n __type: {} as Animal,\n zodSchema: AnimalSchema,\n [Metadata]: {\n discriminant: 'kind',\n name: 'Animal',\n },\n};\n\nexport interface AnimalCatModel extends UnionModel<\n AnimalCat,\n typeof AnimalCatSchema\n> {}\nexport const AnimalCatModel: AnimalCatModel = {\n __type: {} as AnimalCat,\n zodSchema: AnimalCatSchema,\n [Metadata]: {\n discriminant: 'kind',\n name: 'AnimalCat',\n },\n};\n\nexport interface AnimalDogModel extends UnionModel<\n AnimalDog,\n typeof AnimalDogSchema\n> {}\nexport const AnimalDogModel: AnimalDogModel = {\n __type: {} as AnimalDog,\n zodSchema: AnimalDogSchema,\n [Metadata]: {\n discriminant: 'kind',\n name: 'AnimalDog',\n },\n};\n\nexport const DocumentModel = {\n Cat: CatModel,\n Dog: DogModel,\n Animal: AnimalModel,\n AnimalCat: AnimalCatModel,\n AnimalDog: AnimalDogModel,\n [Metadata]: {\n version: 1,\n },\n} as const satisfies DocumentSchema;\n\nexport type DocumentModel = typeof DocumentModel;\n"],"mappings":"AAAA;;AAOA,SAASA,QAAQ,QAAQ,4CAA4C;AAErE,SACEC,eAAe,EACfC,eAAe,EACfC,YAAY,EACZC,SAAS,EACTC,SAAS,QACJ,aAAa;AAGpB,OAAO,MAAMC,QAAkB,GAAG;EAChCC,MAAM,EAAE,CAAC,CAAQ;EACjBC,SAAS,EAAEJ,SAAS;EACpB,CAACJ,QAAQ,GAAG;IACVS,IAAI,EAAE;EACR;AACF,CAAC;AAGD,OAAO,MAAMC,QAAkB,GAAG;EAChCH,MAAM,EAAE,CAAC,CAAQ;EACjBC,SAAS,EAAEH,SAAS;EACpB,CAACL,QAAQ,GAAG;IACVS,IAAI,EAAE;EACR;AACF,CAAC;AAGD,OAAO,MAAME,WAAwB,GAAG;EACtCJ,MAAM,EAAE,CAAC,CAAW;EACpBC,SAAS,EAAEL,YAAY;EACvB,CAACH,QAAQ,GAAG;IACVY,YAAY,EAAE,MAAM;IACpBH,IAAI,EAAE;EACR;AACF,CAAC;AAMD,OAAO,MAAMI,cAA8B,GAAG;EAC5CN,MAAM,EAAE,CAAC,CAAc;EACvBC,SAAS,EAAEP,eAAe;EAC1B,CAACD,QAAQ,GAAG;IACVY,YAAY,EAAE,MAAM;IACpBH,IAAI,EAAE;EACR;AACF,CAAC;AAMD,OAAO,MAAMK,cAA8B,GAAG;EAC5CP,MAAM,EAAE,CAAC,CAAc;EACvBC,SAAS,EAAEN,eAAe;EAC1B,CAACF,QAAQ,GAAG;IACVY,YAAY,EAAE,MAAM;IACpBH,IAAI,EAAE;EACR;AACF,CAAC;AAED,OAAO,MAAMM,aAAa,GAAG;EAC3BC,GAAG,EAAEV,QAAQ;EACbW,GAAG,EAAEP,QAAQ;EACbQ,MAAM,EAAEP,WAAW;EACnBQ,SAAS,EAAEN,cAAc;EACzBO,SAAS,EAAEN,cAAc;EACzB,CAACd,QAAQ,GAAG;IACVqB,OAAO,EAAE;EACX;AACF,CAAmC","ignoreList":[]}
@@ -1,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.11.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.11.0 */\n\nimport type {\n DocumentSchema,\n RecordModel,\n UnionModel,\n} from '@palantir/pack.document-schema.model-types';\nimport { Metadata } from '@palantir/pack.document-schema.model-types';\nimport type { Event } from './types.js';\nimport { EventSchema } from './schema.js';\n\nexport interface EventModel extends RecordModel<Event, typeof EventSchema> {}\nexport const EventModel: EventModel = {\n __type: {} as Event,\n zodSchema: EventSchema,\n [Metadata]: {\n externalRefFieldTypes: {\n documentRef: 'docRef',\n userRef: 'userRef',\n },\n name: 'Event',\n },\n};\n\nexport const DocumentModel = {\n Event: EventModel,\n [Metadata]: {\n version: 1,\n },\n} as const satisfies DocumentSchema;\n\nexport type DocumentModel = typeof DocumentModel;\n"],"mappings":"AAAA;;AAOA,SAASA,QAAQ,QAAQ,4CAA4C;AAErE,SAASC,WAAW,QAAQ,aAAa;AAGzC,OAAO,MAAMC,UAAsB,GAAG;EACpCC,MAAM,EAAE,CAAC,CAAU;EACnBC,SAAS,EAAEH,WAAW;EACtB,CAACD,QAAQ,GAAG;IACVK,qBAAqB,EAAE;MACrBC,WAAW,EAAE,QAAQ;MACrBC,OAAO,EAAE;IACX,CAAC;IACDC,IAAI,EAAE;EACR;AACF,CAAC;AAED,OAAO,MAAMC,aAAa,GAAG;EAC3BC,KAAK,EAAER,UAAU;EACjB,CAACF,QAAQ,GAAG;IACVW,OAAO,EAAE;EACX;AACF,CAAmC","ignoreList":[]}
@@ -1,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.11.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.11.0 */\n\nimport type {\n DocumentSchema,\n RecordModel,\n UnionModel,\n} from '@palantir/pack.document-schema.model-types';\nimport { Metadata } from '@palantir/pack.document-schema.model-types';\nimport type { Person } from './types.js';\nimport { PersonSchema } from './schema.js';\n\nexport interface PersonModel extends RecordModel<Person, typeof PersonSchema> {}\nexport const PersonModel: PersonModel = {\n __type: {} as Person,\n zodSchema: PersonSchema,\n [Metadata]: {\n name: 'Person',\n },\n};\n\nexport const DocumentModel = {\n Person: PersonModel,\n [Metadata]: {\n version: 1,\n },\n} as const satisfies DocumentSchema;\n\nexport type DocumentModel = typeof DocumentModel;\n"],"mappings":"AAAA;;AAOA,SAASA,QAAQ,QAAQ,4CAA4C;AAErE,SAASC,YAAY,QAAQ,aAAa;AAG1C,OAAO,MAAMC,WAAwB,GAAG;EACtCC,MAAM,EAAE,CAAC,CAAW;EACpBC,SAAS,EAAEH,YAAY;EACvB,CAACD,QAAQ,GAAG;IACVK,IAAI,EAAE;EACR;AACF,CAAC;AAED,OAAO,MAAMC,aAAa,GAAG;EAC3BC,MAAM,EAAEL,WAAW;EACnB,CAACF,QAAQ,GAAG;IACVQ,OAAO,EAAE;EACX;AACF,CAAmC","ignoreList":[]}
@@ -1,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.11.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.11.0 */\n\nimport type {\n DocumentSchema,\n RecordModel,\n UnionModel,\n} from '@palantir/pack.document-schema.model-types';\nimport { Metadata } from '@palantir/pack.document-schema.model-types';\nimport type {\n Node,\n NodeObject,\n NodeTextBox,\n ObjectNode,\n TextBox,\n} from './types.js';\nimport {\n NodeObjectSchema,\n NodeSchema,\n NodeTextBoxSchema,\n ObjectNodeSchema,\n TextBoxSchema,\n} from './schema.js';\n\nexport interface ObjectNodeModel extends RecordModel<\n ObjectNode,\n typeof ObjectNodeSchema\n> {}\nexport const ObjectNodeModel: ObjectNodeModel = {\n __type: {} as ObjectNode,\n zodSchema: ObjectNodeSchema,\n [Metadata]: {\n name: 'ObjectNode',\n },\n};\n\nexport interface TextBoxModel extends RecordModel<\n TextBox,\n typeof TextBoxSchema\n> {}\nexport const TextBoxModel: TextBoxModel = {\n __type: {} as TextBox,\n zodSchema: TextBoxSchema,\n [Metadata]: {\n name: 'TextBox',\n },\n};\n\nexport interface NodeModel extends UnionModel<Node, typeof NodeSchema> {}\nexport const NodeModel: NodeModel = {\n __type: {} as Node,\n zodSchema: NodeSchema,\n [Metadata]: {\n discriminant: 'type',\n name: 'Node',\n },\n};\n\nexport interface NodeObjectModel extends UnionModel<\n NodeObject,\n typeof NodeObjectSchema\n> {}\nexport const NodeObjectModel: NodeObjectModel = {\n __type: {} as NodeObject,\n zodSchema: NodeObjectSchema,\n [Metadata]: {\n discriminant: 'type',\n name: 'NodeObject',\n },\n};\n\nexport interface NodeTextBoxModel extends UnionModel<\n NodeTextBox,\n typeof NodeTextBoxSchema\n> {}\nexport const NodeTextBoxModel: NodeTextBoxModel = {\n __type: {} as NodeTextBox,\n zodSchema: NodeTextBoxSchema,\n [Metadata]: {\n discriminant: 'type',\n name: 'NodeTextBox',\n },\n};\n\nexport const DocumentModel = {\n ObjectNode: ObjectNodeModel,\n TextBox: TextBoxModel,\n Node: NodeModel,\n NodeObject: NodeObjectModel,\n NodeTextBox: NodeTextBoxModel,\n [Metadata]: {\n version: 1,\n },\n} as const satisfies DocumentSchema;\n\nexport type DocumentModel = typeof DocumentModel;\n"],"mappings":"AAAA;;AAOA,SAASA,QAAQ,QAAQ,4CAA4C;AAQrE,SACEC,gBAAgB,EAChBC,UAAU,EACVC,iBAAiB,EACjBC,gBAAgB,EAChBC,aAAa,QACR,aAAa;AAMpB,OAAO,MAAMC,eAAgC,GAAG;EAC9CC,MAAM,EAAE,CAAC,CAAe;EACxBC,SAAS,EAAEJ,gBAAgB;EAC3B,CAACJ,QAAQ,GAAG;IACVS,IAAI,EAAE;EACR;AACF,CAAC;AAMD,OAAO,MAAMC,YAA0B,GAAG;EACxCH,MAAM,EAAE,CAAC,CAAY;EACrBC,SAAS,EAAEH,aAAa;EACxB,CAACL,QAAQ,GAAG;IACVS,IAAI,EAAE;EACR;AACF,CAAC;AAGD,OAAO,MAAME,SAAoB,GAAG;EAClCJ,MAAM,EAAE,CAAC,CAAS;EAClBC,SAAS,EAAEN,UAAU;EACrB,CAACF,QAAQ,GAAG;IACVY,YAAY,EAAE,MAAM;IACpBH,IAAI,EAAE;EACR;AACF,CAAC;AAMD,OAAO,MAAMI,eAAgC,GAAG;EAC9CN,MAAM,EAAE,CAAC,CAAe;EACxBC,SAAS,EAAEP,gBAAgB;EAC3B,CAACD,QAAQ,GAAG;IACVY,YAAY,EAAE,MAAM;IACpBH,IAAI,EAAE;EACR;AACF,CAAC;AAMD,OAAO,MAAMK,gBAAkC,GAAG;EAChDP,MAAM,EAAE,CAAC,CAAgB;EACzBC,SAAS,EAAEL,iBAAiB;EAC5B,CAACH,QAAQ,GAAG;IACVY,YAAY,EAAE,MAAM;IACpBH,IAAI,EAAE;EACR;AACF,CAAC;AAED,OAAO,MAAMM,aAAa,GAAG;EAC3BC,UAAU,EAAEV,eAAe;EAC3BW,OAAO,EAAEP,YAAY;EACrBQ,IAAI,EAAEP,SAAS;EACfQ,UAAU,EAAEN,eAAe;EAC3BO,WAAW,EAAEN,gBAAgB;EAC7B,CAACd,QAAQ,GAAG;IACVqB,OAAO,EAAE;EACX;AACF,CAAmC","ignoreList":[]}
@@ -1,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.11.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.11.0 */\n\nimport { z } from 'zod';\n\nexport const ContainerSchema = z.object({\n tags: z.array(z.string()),\n metadata: z.record(z.string(), z.unknown()),\n});\n"],"mappings":"AAAA;;AAEA,SAASA,CAAC,QAAQ,KAAK;AAEvB,OAAO,MAAMC,eAAe,GAAGD,CAAC,CAACE,MAAM,CAAC;EACtCC,IAAI,EAAEH,CAAC,CAACI,KAAK,CAACJ,CAAC,CAACK,MAAM,CAAC,CAAC,CAAC;EACzBC,QAAQ,EAAEN,CAAC,CAACO,MAAM,CAACP,CAAC,CAACK,MAAM,CAAC,CAAC,EAAEL,CAAC,CAACQ,OAAO,CAAC,CAAC;AAC5C,CAAC,CAAC","ignoreList":[]}
@@ -1,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.11.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.11.0 */\n\nimport { z } from 'zod';\n\nexport const FeatureSchema = z.object({\n enabled: z.boolean(),\n isPublic: z.boolean().optional(),\n flags: z.array(z.boolean()),\n});\n"],"mappings":"AAAA;;AAEA,SAASA,CAAC,QAAQ,KAAK;AAEvB,OAAO,MAAMC,aAAa,GAAGD,CAAC,CAACE,MAAM,CAAC;EACpCC,OAAO,EAAEH,CAAC,CAACI,OAAO,CAAC,CAAC;EACpBC,QAAQ,EAAEL,CAAC,CAACI,OAAO,CAAC,CAAC,CAACE,QAAQ,CAAC,CAAC;EAChCC,KAAK,EAAEP,CAAC,CAACQ,KAAK,CAACR,CAAC,CAACI,OAAO,CAAC,CAAC;AAC5B,CAAC,CAAC","ignoreList":[]}
@@ -1,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.11.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.11.0 */\n\nimport { z } from 'zod';\n\nexport const CatSchema = z.object({\n meow: z.string(),\n});\n\nexport const DogSchema = z.object({\n bark: z.string(),\n});\n\nexport const AnimalCatSchema = CatSchema.extend({\n kind: z.literal('cat'),\n});\n\nexport const AnimalDogSchema = DogSchema.extend({\n kind: z.literal('dog'),\n});\n\nexport const AnimalSchema = z.discriminatedUnion('kind', [\n AnimalCatSchema,\n AnimalDogSchema,\n]);\n"],"mappings":"AAAA;;AAEA,SAASA,CAAC,QAAQ,KAAK;AAEvB,OAAO,MAAMC,SAAS,GAAGD,CAAC,CAACE,MAAM,CAAC;EAChCC,IAAI,EAAEH,CAAC,CAACI,MAAM,CAAC;AACjB,CAAC,CAAC;AAEF,OAAO,MAAMC,SAAS,GAAGL,CAAC,CAACE,MAAM,CAAC;EAChCI,IAAI,EAAEN,CAAC,CAACI,MAAM,CAAC;AACjB,CAAC,CAAC;AAEF,OAAO,MAAMG,eAAe,GAAGN,SAAS,CAACO,MAAM,CAAC;EAC9CC,IAAI,EAAET,CAAC,CAACU,OAAO,CAAC,KAAK;AACvB,CAAC,CAAC;AAEF,OAAO,MAAMC,eAAe,GAAGN,SAAS,CAACG,MAAM,CAAC;EAC9CC,IAAI,EAAET,CAAC,CAACU,OAAO,CAAC,KAAK;AACvB,CAAC,CAAC;AAEF,OAAO,MAAME,YAAY,GAAGZ,CAAC,CAACa,kBAAkB,CAAC,MAAM,EAAE,CACvDN,eAAe,EACfI,eAAe,CAChB,CAAC","ignoreList":[]}
@@ -1,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.11.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.11.0 */\n\nimport { z } from 'zod';\n\nexport const EventSchema = z.object({\n timestamp: z.string().datetime(),\n});\n"],"mappings":"AAAA;;AAEA,SAASA,CAAC,QAAQ,KAAK;AAEvB,OAAO,MAAMC,WAAW,GAAGD,CAAC,CAACE,MAAM,CAAC;EAClCC,SAAS,EAAEH,CAAC,CAACI,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC;AACjC,CAAC,CAAC","ignoreList":[]}
@@ -1,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.11.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.11.0 */\n\nimport { z } from 'zod';\n\nexport const PersonSchema = z.object({\n name: z.string().min(2).max(50),\n age: z.number().int().min(0).max(150),\n email: z.string().optional(),\n});\n"],"mappings":"AAAA;;AAEA,SAASA,CAAC,QAAQ,KAAK;AAEvB,OAAO,MAAMC,YAAY,GAAGD,CAAC,CAACE,MAAM,CAAC;EACnCC,IAAI,EAAEH,CAAC,CAACI,MAAM,CAAC,CAAC,CAACC,GAAG,CAAC,CAAC,CAAC,CAACC,GAAG,CAAC,EAAE,CAAC;EAC/BC,GAAG,EAAEP,CAAC,CAACQ,MAAM,CAAC,CAAC,CAACC,GAAG,CAAC,CAAC,CAACJ,GAAG,CAAC,CAAC,CAAC,CAACC,GAAG,CAAC,GAAG,CAAC;EACrCI,KAAK,EAAEV,CAAC,CAACI,MAAM,CAAC,CAAC,CAACO,QAAQ,CAAC;AAC7B,CAAC,CAAC","ignoreList":[]}
@@ -1,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.11.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.11.0 */\n\nimport { z } from 'zod';\n\nexport const FooSchema = z.object({\n value: z.string(),\n});\n\nexport const BarSchema = z.object({\n count: z.number().int(),\n});\n\nexport const FooBarFooSchema = FooSchema.extend({\n type: z.literal('foo'),\n});\n\nexport const FooBarBarSchema = BarSchema.extend({\n type: z.literal('bar'),\n});\n\nexport const FooBarSchema = z.discriminatedUnion('type', [\n FooBarFooSchema,\n FooBarBarSchema,\n]);\n"],"mappings":"AAAA;;AAEA,SAASA,CAAC,QAAQ,KAAK;AAEvB,OAAO,MAAMC,SAAS,GAAGD,CAAC,CAACE,MAAM,CAAC;EAChCC,KAAK,EAAEH,CAAC,CAACI,MAAM,CAAC;AAClB,CAAC,CAAC;AAEF,OAAO,MAAMC,SAAS,GAAGL,CAAC,CAACE,MAAM,CAAC;EAChCI,KAAK,EAAEN,CAAC,CAACO,MAAM,CAAC,CAAC,CAACC,GAAG,CAAC;AACxB,CAAC,CAAC;AAEF,OAAO,MAAMC,eAAe,GAAGR,SAAS,CAACS,MAAM,CAAC;EAC9CC,IAAI,EAAEX,CAAC,CAACY,OAAO,CAAC,KAAK;AACvB,CAAC,CAAC;AAEF,OAAO,MAAMC,eAAe,GAAGR,SAAS,CAACK,MAAM,CAAC;EAC9CC,IAAI,EAAEX,CAAC,CAACY,OAAO,CAAC,KAAK;AACvB,CAAC,CAAC;AAEF,OAAO,MAAME,YAAY,GAAGd,CAAC,CAACe,kBAAkB,CAAC,MAAM,EAAE,CACvDN,eAAe,EACfI,eAAe,CAChB,CAAC","ignoreList":[]}
@@ -1,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.11.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.11.0 */\n\nimport { z } from 'zod';\n\nexport const ObjectNodeSchema = z.object({\n x: z.number(),\n y: z.number(),\n label: z.string().optional(),\n});\n\nexport const TextBoxSchema = z.object({\n x: z.number(),\n y: z.number(),\n text: z.string(),\n});\n\nexport const NodeObjectSchema = ObjectNodeSchema.extend({\n type: z.literal('object'),\n});\n\nexport const NodeTextBoxSchema = TextBoxSchema.extend({\n type: z.literal('text-box'),\n});\n\nexport const NodeSchema = z.discriminatedUnion('type', [\n NodeObjectSchema,\n NodeTextBoxSchema,\n]);\n"],"mappings":"AAAA;;AAEA,SAASA,CAAC,QAAQ,KAAK;AAEvB,OAAO,MAAMC,gBAAgB,GAAGD,CAAC,CAACE,MAAM,CAAC;EACvCC,CAAC,EAAEH,CAAC,CAACI,MAAM,CAAC,CAAC;EACbC,CAAC,EAAEL,CAAC,CAACI,MAAM,CAAC,CAAC;EACbE,KAAK,EAAEN,CAAC,CAACO,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC;AAC7B,CAAC,CAAC;AAEF,OAAO,MAAMC,aAAa,GAAGT,CAAC,CAACE,MAAM,CAAC;EACpCC,CAAC,EAAEH,CAAC,CAACI,MAAM,CAAC,CAAC;EACbC,CAAC,EAAEL,CAAC,CAACI,MAAM,CAAC,CAAC;EACbM,IAAI,EAAEV,CAAC,CAACO,MAAM,CAAC;AACjB,CAAC,CAAC;AAEF,OAAO,MAAMI,gBAAgB,GAAGV,gBAAgB,CAACW,MAAM,CAAC;EACtDC,IAAI,EAAEb,CAAC,CAACc,OAAO,CAAC,QAAQ;AAC1B,CAAC,CAAC;AAEF,OAAO,MAAMC,iBAAiB,GAAGN,aAAa,CAACG,MAAM,CAAC;EACpDC,IAAI,EAAEb,CAAC,CAACc,OAAO,CAAC,UAAU;AAC5B,CAAC,CAAC;AAEF,OAAO,MAAME,UAAU,GAAGhB,CAAC,CAACiB,kBAAkB,CAAC,MAAM,EAAE,CACrDN,gBAAgB,EAChBI,iBAAiB,CAClB,CAAC","ignoreList":[]}
@@ -1 +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.11.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.11.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.11.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,O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ACD,OAAO;IACLI,IAAI,EAAE,WAAW;IACjBC,MAAM,EAAEkE,QAAQ;IAChB9D,OAAO,EAAE,CAAC;IACVC,QAAQ,EAAE;MACRN,IAAI,EAAE,WAAW;MACjBC,MAAM,EAAEgE,QAAQ;MAChB5D,OAAO,EAAE,CAAC;MACVC,QAAQ,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;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,MAAM,EAAE;QACNC,IAAI,EAAEL,CAAC,CAACM,MAAM;QACdC,KAAK,EAAEP,CAAC,CAACM,MAAM;QACfE,GAAG,EAAER,CAAC,CAACM,MAAM;QACbG,MAAM,EAAET,CAAC,CAACM,MAAM;QAChBY,SAAS,EAAElB,CAAC,CAACW,QAAQ,CAACX,CAAC,CAACY,MAAM,CAAC;QAC/BO,WAAW,EAAEnB,CAAC,C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AAK,EAAEV,CAAC,CAACW,QAAQ,CAACX,CAAC,CAACY,MAAM;MAC5B;IACF,CAAC;EACH,CAAC;EACD,MAAMoE,QAAQ,GAAG;IACfH,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;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":[]}
@@ -18,7 +18,7 @@ import path from "path";
18
18
  import { describe, expect, it } from "vitest";
19
19
  import { generateModelMetadataFromChain } from "../generateModelMetadataFromSchema.js";
20
20
  import { resolveSchemaChain } from "../resolveSchemaChain.js";
21
- import { singleVersionSchema, threeVersionChainSchema, twoVersionFieldRemovalSchema, unionTypesSchema } from "./fixtures.js";
21
+ import { singleVersionSchema, threeVersionChainSchema, twoVersionDerivedFieldsSchema, twoVersionFieldRemovalSchema, unionTypesSchema } from "./fixtures.js";
22
22
  import { formatModelMetadataSnapshot } from "./snapshotUtils.js";
23
23
  describe("generateModelMetadataFromChain", () => {
24
24
  const snapshotDir = path.join(__dirname, "__snapshots__", "generateModelMetadataFromSchema");
@@ -38,5 +38,9 @@ describe("generateModelMetadataFromChain", () => {
38
38
  const result = generateModelMetadataFromChain(resolveSchemaChain(unionTypesSchema));
39
39
  await expect(await formatModelMetadataSnapshot(result)).toMatchFileSnapshot(path.join(snapshotDir, "union-types.snap"));
40
40
  });
41
+ it("two-version schema with derived fields emits DocumentModel as a factory", async () => {
42
+ const result = generateModelMetadataFromChain(resolveSchemaChain(twoVersionDerivedFieldsSchema, 1), 1);
43
+ await expect(await formatModelMetadataSnapshot(result)).toMatchFileSnapshot(path.join(snapshotDir, "two-version-derived-fields.snap"));
44
+ });
41
45
  });
42
46
  //# sourceMappingURL=generateModelMetadataFromSchema.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"generateModelMetadataFromSchema.test.js","names":["path","describe","expect","it","generateModelMetadataFromChain","resolveSchemaChain","singleVersionSchema","threeVersionChainSchema","twoVersionFieldRemovalSchema","unionTypesSchema","formatModelMetadataSnapshot","snapshotDir","join","__dirname","result","toMatchFileSnapshot"],"sources":["generateModelMetadataFromSchema.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 { generateModelMetadataFromChain } from \"../generateModelMetadataFromSchema.js\";\nimport { resolveSchemaChain } from \"../resolveSchemaChain.js\";\nimport {\n singleVersionSchema,\n threeVersionChainSchema,\n twoVersionFieldRemovalSchema,\n unionTypesSchema,\n} from \"./fixtures.js\";\nimport { formatModelMetadataSnapshot } from \"./snapshotUtils.js\";\n\ndescribe(\"generateModelMetadataFromChain\", () => {\n const snapshotDir = path.join(__dirname, \"__snapshots__\", \"generateModelMetadataFromSchema\");\n\n it(\"single-version schema\", async () => {\n const result = generateModelMetadataFromChain(resolveSchemaChain(singleVersionSchema));\n await expect(await formatModelMetadataSnapshot(result)).toMatchFileSnapshot(\n path.join(snapshotDir, \"single-version.snap\"),\n );\n });\n\n it(\"two-version field removal\", async () => {\n const result = generateModelMetadataFromChain(\n resolveSchemaChain(twoVersionFieldRemovalSchema, 1),\n 1,\n );\n await expect(await formatModelMetadataSnapshot(result)).toMatchFileSnapshot(\n path.join(snapshotDir, \"two-version-field-removal.snap\"),\n );\n });\n\n it(\"three-version chain\", async () => {\n const result = generateModelMetadataFromChain(\n resolveSchemaChain(threeVersionChainSchema, 1),\n 1,\n );\n await expect(await formatModelMetadataSnapshot(result)).toMatchFileSnapshot(\n path.join(snapshotDir, \"three-version-chain.snap\"),\n );\n });\n\n it(\"union types schema\", async () => {\n const result = generateModelMetadataFromChain(resolveSchemaChain(unionTypesSchema));\n await expect(await formatModelMetadataSnapshot(result)).toMatchFileSnapshot(\n path.join(snapshotDir, \"union-types.snap\"),\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,8BAA8B,QAAQ,uCAAuC;AACtF,SAASC,kBAAkB,QAAQ,0BAA0B;AAC7D,SACEC,mBAAmB,EACnBC,uBAAuB,EACvBC,4BAA4B,EAC5BC,gBAAgB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CAAC,CAAC,CAACC,mBAAmB,CACzEf,IAAI,CAACY,IAAI,CAACD,WAAW,EAAE,kBAAkB,CAC3C,CAAC;EACH,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"generateModelMetadataFromSchema.test.js","names":["path","describe","expect","it","generateModelMetadataFromChain","resolveSchemaChain","singleVersionSchema","threeVersionChainSchema","twoVersionDerivedFieldsSchema","twoVersionFieldRemovalSchema","unionTypesSchema","formatModelMetadataSnapshot","snapshotDir","join","__dirname","result","toMatchFileSnapshot"],"sources":["generateModelMetadataFromSchema.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 { generateModelMetadataFromChain } from \"../generateModelMetadataFromSchema.js\";\nimport { resolveSchemaChain } from \"../resolveSchemaChain.js\";\nimport {\n singleVersionSchema,\n threeVersionChainSchema,\n twoVersionDerivedFieldsSchema,\n twoVersionFieldRemovalSchema,\n unionTypesSchema,\n} from \"./fixtures.js\";\nimport { formatModelMetadataSnapshot } from \"./snapshotUtils.js\";\n\ndescribe(\"generateModelMetadataFromChain\", () => {\n const snapshotDir = path.join(__dirname, \"__snapshots__\", \"generateModelMetadataFromSchema\");\n\n it(\"single-version schema\", async () => {\n const result = generateModelMetadataFromChain(resolveSchemaChain(singleVersionSchema));\n await expect(await formatModelMetadataSnapshot(result)).toMatchFileSnapshot(\n path.join(snapshotDir, \"single-version.snap\"),\n );\n });\n\n it(\"two-version field removal\", async () => {\n const result = generateModelMetadataFromChain(\n resolveSchemaChain(twoVersionFieldRemovalSchema, 1),\n 1,\n );\n await expect(await formatModelMetadataSnapshot(result)).toMatchFileSnapshot(\n path.join(snapshotDir, \"two-version-field-removal.snap\"),\n );\n });\n\n it(\"three-version chain\", async () => {\n const result = generateModelMetadataFromChain(\n resolveSchemaChain(threeVersionChainSchema, 1),\n 1,\n );\n await expect(await formatModelMetadataSnapshot(result)).toMatchFileSnapshot(\n path.join(snapshotDir, \"three-version-chain.snap\"),\n );\n });\n\n it(\"union types schema\", async () => {\n const result = generateModelMetadataFromChain(resolveSchemaChain(unionTypesSchema));\n await expect(await formatModelMetadataSnapshot(result)).toMatchFileSnapshot(\n path.join(snapshotDir, \"union-types.snap\"),\n );\n });\n\n it(\"two-version schema with derived fields emits DocumentModel as a factory\", async () => {\n const result = generateModelMetadataFromChain(\n resolveSchemaChain(twoVersionDerivedFieldsSchema, 1),\n 1,\n );\n await expect(await formatModelMetadataSnapshot(result)).toMatchFileSnapshot(\n path.join(snapshotDir, \"two-version-derived-fields.snap\"),\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,8BAA8B,QAAQ,uCAAuC;AACtF,SAASC,kBAAkB,QAAQ,0BAA0B;AAC7D,SACEC,mBAAmB,EACnBC,uBAAuB,EACvBC,6BAA6B,EAC7BC,4BAA4B,EAC5BC,gBAAgB,QACX,eAAe;AACtB,SAASC,2BAA2B,QAAQ,oBAAoB;AAEhEV,QAAQ,CAAC,gCAAgC,EAAE,MAAM;EAC/C,MAAMW,WAAW,GAAGZ,IAAI,CAACa,IAAI,CAACC,SAAS,EAAE,eAAe,EAAE,iCAAiC,CAAC;EAE5FX,EAAE,CAAC,uBAAuB,EAAE,YAAY;IACtC,MAA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C,EACpD,CACF,CAAC;IACD,MAAMN,MAAM,CAAC,MAAMS,2BAA2B,CAACI,MAAM,CAAC,CAAC,CAACC,mBAAmB,CACzEhB,IAAI,CAACa,IAAI,CAACD,WAAW,EAAE,iCAAiC,CAC1D,CAAC;EACH,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -95,12 +95,15 @@ export async function formatVersionedZodSnapshot(result) {
95
95
  * ...
96
96
  * // === _internal/schema.ts ===
97
97
  * ...
98
+ * // === _internal/upgradeFns.ts ===
99
+ * ...
98
100
  */
99
101
  export async function formatInternalTypesSnapshot(result) {
100
102
  const sections = [];
101
103
  sections.push(section("_internal/types.ts", await fmt(result.internalTypes)));
102
104
  sections.push(section("_internal/upgrades.ts", await fmt(result.upgrades)));
103
105
  sections.push(section("_internal/schema.ts", await fmt(result.internalSchema)));
106
+ sections.push(section("_internal/upgradeFns.ts", await fmt(result.internalUpgradeFns)));
104
107
  return sections.join("\n");
105
108
  }
106
109
  //# sourceMappingURL=snapshotUtils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"snapshotUtils.js","names":["format","prettierOpts","parser","singleQuote","trailingComma","fmt","code","section","filename","content","bar","repeat","formatVersionedTypesSnapshot","result","sections","sortedVersions","readTypes","keys","sort","a","b","version","push","get","writeTypes","typesReExport","join","formatModelMetadataSnapshot","modelsFile","formatSingleSnapshot","formatVersionedZodSnapshot","zodSchemas","schemaReExport","formatInternalTypesSnapshot","internalTypes","upgrades","internalSchema"],"sources":["snapshotUtils.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 { format } from \"prettier\";\nimport type { InternalTypesOutput } from \"../generateInternalFromSchema.js\";\nimport type { ModelMetadataOutput } from \"../generateModelMetadataFromSchema.js\";\nimport type { VersionedTypesOutput } from \"../generateVersionedTypesFromSchema.js\";\nimport type { VersionedZodOutput } from \"../generateVersionedZodFromSchema.js\";\n\nconst prettierOpts = {\n parser: \"typescript\" as const,\n singleQuote: true,\n trailingComma: \"es5\" as const,\n};\n\nasync function fmt(code: string): Promise<string> {\n return format(code, prettierOpts);\n}\n\nfunction section(filename: string, content: string): string {\n const bar = \"=\".repeat(60);\n return `// ${bar}\\n// ${filename}\\n// ${bar}\\n\\n${content}`;\n}\n\n/**\n * Combine a VersionedTypesOutput into a single snapshot string.\n *\n * Layout:\n * // === types_v1.ts ===\n * ...formatted code...\n * // === writeTypes_v1.ts ===\n * ...\n * // === types.ts ===\n * ...\n */\nexport async function formatVersionedTypesSnapshot(\n result: VersionedTypesOutput,\n): Promise<string> {\n const sections: string[] = [];\n\n const sortedVersions = [...result.readTypes.keys()].sort((a, b) => a - b);\n\n for (const version of sortedVersions) {\n sections.push(section(`types_v${version}.ts`, await fmt(result.readTypes.get(version)!)));\n }\n for (const version of sortedVersions) {\n sections.push(section(`writeTypes_v${version}.ts`, await fmt(result.writeTypes.get(version)!)));\n }\n sections.push(section(\"types.ts\", await fmt(result.typesReExport)));\n\n return sections.join(\"\\n\");\n}\n\n/**\n * Format a ModelMetadataOutput into a snapshot string.\n */\nexport async function formatModelMetadataSnapshot(\n result: ModelMetadataOutput,\n): Promise<string> {\n return section(\"models.ts\", await fmt(result.modelsFile));\n}\n\n/**\n * Format a single generated string into a snapshot.\n */\nexport async function formatSingleSnapshot(\n filename: string,\n code: string,\n): Promise<string> {\n return section(filename, await fmt(code));\n}\n\n/**\n * Combine a VersionedZodOutput into a single snapshot string.\n *\n * Layout:\n * // === schema_v1.ts ===\n * ...formatted code...\n * // === schema.ts ===\n * ...\n */\nexport async function formatVersionedZodSnapshot(\n result: VersionedZodOutput,\n): Promise<string> {\n const sections: string[] = [];\n\n const sortedVersions = [...result.zodSchemas.keys()].sort((a, b) => a - b);\n\n for (const version of sortedVersions) {\n sections.push(section(`schema_v${version}.ts`, await fmt(result.zodSchemas.get(version)!)));\n }\n sections.push(section(\"schema.ts\", await fmt(result.schemaReExport)));\n\n return sections.join(\"\\n\");\n}\n\n/**\n * Combine an InternalTypesOutput into a single snapshot string.\n *\n * Layout:\n * // === _internal/types.ts ===\n * ...formatted code...\n * // === _internal/upgrades.ts ===\n * ...\n * // === _internal/schema.ts ===\n * ...\n */\nexport async function formatInternalTypesSnapshot(\n result: InternalTypesOutput,\n): Promise<string> {\n const sections: string[] = [];\n\n sections.push(section(\"_internal/types.ts\", await fmt(result.internalTypes)));\n sections.push(section(\"_internal/upgrades.ts\", await fmt(result.upgrades)));\n sections.push(section(\"_internal/schema.ts\", await fmt(result.internalSchema)));\n\n return sections.join(\"\\n\");\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,MAAM,QAAQ,UAAU;AAMjC,MAAMC,YAAY,GAAG;EACnBC,MAAM,EAAE,YAAqB;EAC7BC,WAAW,EAAE,IAAI;EACjBC,aAAa,EAAE;AACjB,CAAC;AAED,eAAeC,GAAGA,CAACC,IAAY,EAAmB;EAChD,OAAON,MAAM,CAACM,IAAI,EAAEL,YAAY,CAAC;AACnC;AAEA,SAASM,OAAOA,CAACC,QAAgB,EAAEC,OAAe,EAAU;EAC1D,MAAMC,GAAG,GAAG,GAAG,CAACC,MAAM,CAAC,EAAE,CAAC;EAC1B,OAAO,MAAMD,GAAG,QAAQF,QAAQ,QAAQE,GAAG,OAAOD,OAAO,EAAE;AAC7D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeG,4BAA4BA,CAChDC,MAA4B,EACX;EACjB,MAAMC,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AMC,cAAc,GAAG,CAAC,GAAGF,MAAM,CAACkB,UAAU,CAACd,IAAI,CAAC,CAAC,CAAC,CAACC,IAAI,CAAC,CAACC,CAAC,EAAEC,CAAC,KAAKD,CAAC,GAAGC,CAAC,CAAC;EAE1E,KAAK,MAAMC,OAAO,IAAIN,cAAc,EAAE;IACpCD,QAAQ,CAACQ,IAAI,CAACf,OAAO,CAAC,WAAWc,OAAO,KAAK,EAAE,MAAMhB,GAAG,CAACQ,MAAM,CAACkB,UAAU,CAACR,GAAG,CAACF,OAAO,CAAE,CAAC,CAAC,CAAC;EAC7F;EACAP,QAAQ,CAACQ,IAAI,CAACf,OAAO,CAAC,WAAW,EAAE,MAAMF,GAAG,CAACQ,MAAM,CAACmB,cAAc,CAAC,CAAC,CAAC;EAErE,OAAOlB,QAAQ,CAACY,IAAI,CAAC,IAAI,CAAC;AAC5B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeO,2BAA2BA,CAC/CpB,MAA2B,EACV;EACjB,MAAMC,QAAkB,GAAG,EAAE;EAE7BA,QAAQ,CAACQ,IAAI,CAACf,OAAO,CAAC,oBAAoB,EAAE,MAAMF,GAAG,CAACQ,MAAM,CAACqB,aAAa,CAAC,CAAC,CAAC;EAC7EpB,QAAQ,CAACQ,IAAI,CAACf,OAAO,CAAC,uBAAuB,EAAE,MAAMF,GAAG,CAACQ,MAAM,CAACsB,QAAQ,CAAC,CAAC,CAAC;EAC3ErB,QAAQ,CAACQ,IAAI,CAACf,OAAO,CAAC,qBAAqB,EAAE,MAAMF,GAAG,CAACQ,MAAM,CAACuB,cAAc,CAAC,CAAC,CAAC;EAE/E,OAAOtB,QAAQ,CAACY,IAAI,CAAC,IAAI,CAAC;AAC5B","ignoreList":[]}
1
+ {"version":3,"file":"snapshotUtils.js","names":["format","prettierOpts","parser","singleQuote","trailingComma","fmt","code","section","filename","content","bar","repeat","formatVersionedTypesSnapshot","result","sections","sortedVersions","readTypes","keys","sort","a","b","version","push","get","writeTypes","typesReExport","join","formatModelMetadataSnapshot","modelsFile","formatSingleSnapshot","formatVersionedZodSnapshot","zodSchemas","schemaReExport","formatInternalTypesSnapshot","internalTypes","upgrades","internalSchema","internalUpgradeFns"],"sources":["snapshotUtils.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 { format } from \"prettier\";\nimport type { InternalTypesOutput } from \"../generateInternalFromSchema.js\";\nimport type { ModelMetadataOutput } from \"../generateModelMetadataFromSchema.js\";\nimport type { VersionedTypesOutput } from \"../generateVersionedTypesFromSchema.js\";\nimport type { VersionedZodOutput } from \"../generateVersionedZodFromSchema.js\";\n\nconst prettierOpts = {\n parser: \"typescript\" as const,\n singleQuote: true,\n trailingComma: \"es5\" as const,\n};\n\nasync function fmt(code: string): Promise<string> {\n return format(code, prettierOpts);\n}\n\nfunction section(filename: string, content: string): string {\n const bar = \"=\".repeat(60);\n return `// ${bar}\\n// ${filename}\\n// ${bar}\\n\\n${content}`;\n}\n\n/**\n * Combine a VersionedTypesOutput into a single snapshot string.\n *\n * Layout:\n * // === types_v1.ts ===\n * ...formatted code...\n * // === writeTypes_v1.ts ===\n * ...\n * // === types.ts ===\n * ...\n */\nexport async function formatVersionedTypesSnapshot(\n result: VersionedTypesOutput,\n): Promise<string> {\n const sections: string[] = [];\n\n const sortedVersions = [...result.readTypes.keys()].sort((a, b) => a - b);\n\n for (const version of sortedVersions) {\n sections.push(section(`types_v${version}.ts`, await fmt(result.readTypes.get(version)!)));\n }\n for (const version of sortedVersions) {\n sections.push(section(`writeTypes_v${version}.ts`, await fmt(result.writeTypes.get(version)!)));\n }\n sections.push(section(\"types.ts\", await fmt(result.typesReExport)));\n\n return sections.join(\"\\n\");\n}\n\n/**\n * Format a ModelMetadataOutput into a snapshot string.\n */\nexport async function formatModelMetadataSnapshot(\n result: ModelMetadataOutput,\n): Promise<string> {\n return section(\"models.ts\", await fmt(result.modelsFile));\n}\n\n/**\n * Format a single generated string into a snapshot.\n */\nexport async function formatSingleSnapshot(\n filename: string,\n code: string,\n): Promise<string> {\n return section(filename, await fmt(code));\n}\n\n/**\n * Combine a VersionedZodOutput into a single snapshot string.\n *\n * Layout:\n * // === schema_v1.ts ===\n * ...formatted code...\n * // === schema.ts ===\n * ...\n */\nexport async function formatVersionedZodSnapshot(\n result: VersionedZodOutput,\n): Promise<string> {\n const sections: string[] = [];\n\n const sortedVersions = [...result.zodSchemas.keys()].sort((a, b) => a - b);\n\n for (const version of sortedVersions) {\n sections.push(section(`schema_v${version}.ts`, await fmt(result.zodSchemas.get(version)!)));\n }\n sections.push(section(\"schema.ts\", await fmt(result.schemaReExport)));\n\n return sections.join(\"\\n\");\n}\n\n/**\n * Combine an InternalTypesOutput into a single snapshot string.\n *\n * Layout:\n * // === _internal/types.ts ===\n * ...formatted code...\n * // === _internal/upgrades.ts ===\n * ...\n * // === _internal/schema.ts ===\n * ...\n * // === _internal/upgradeFns.ts ===\n * ...\n */\nexport async function formatInternalTypesSnapshot(\n result: InternalTypesOutput,\n): Promise<string> {\n const sections: string[] = [];\n\n sections.push(section(\"_internal/types.ts\", await fmt(result.internalTypes)));\n sections.push(section(\"_internal/upgrades.ts\", await fmt(result.upgrades)));\n sections.push(section(\"_internal/schema.ts\", await fmt(result.internalSchema)));\n sections.push(section(\"_internal/upgradeFns.ts\", await fmt(result.internalUpgradeFns)));\n\n return sections.join(\"\\n\");\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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