@palantir/pack.document-schema.type-gen 0.32.0 → 0.34.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 (131) hide show
  1. package/README.md +7 -0
  2. package/build/esm/commands/ir/__tests__/irDeployFirstParty.test.js +1 -1
  3. package/build/esm/commands/ir/__tests__/irDeployFirstParty.test.js.map +1 -1
  4. package/build/esm/commands/ir/__tests__/irUpdateSchemaHandler.test.js +96 -0
  5. package/build/esm/commands/ir/__tests__/irUpdateSchemaHandler.test.js.map +1 -0
  6. package/build/esm/commands/ir/__tests__/resolveIrInput.test.js +80 -0
  7. package/build/esm/commands/ir/__tests__/resolveIrInput.test.js.map +1 -1
  8. package/build/esm/commands/ir/irDeployHandler.js +6 -1
  9. package/build/esm/commands/ir/irDeployHandler.js.map +1 -1
  10. package/build/esm/commands/ir/irGenAssetHandler.js +6 -1
  11. package/build/esm/commands/ir/irGenAssetHandler.js.map +1 -1
  12. package/build/esm/commands/ir/irGenTypesHandler.js +7 -3
  13. package/build/esm/commands/ir/irGenTypesHandler.js.map +1 -1
  14. package/build/esm/commands/ir/irUpdateSchemaHandler.js +19 -12
  15. package/build/esm/commands/ir/irUpdateSchemaHandler.js.map +1 -1
  16. package/build/esm/commands/ir/resolveIrInput.js +6 -5
  17. package/build/esm/commands/ir/resolveIrInput.js.map +1 -1
  18. package/build/esm/commands/schema/registerSchemaCommands.js +1 -1
  19. package/build/esm/commands/schema/registerSchemaCommands.js.map +1 -1
  20. package/build/esm/commands/schema/schemaIrHandler.js +15 -8
  21. package/build/esm/commands/schema/schemaIrHandler.js.map +1 -1
  22. package/build/esm/lib/pack-docschema-api/pack-docschema-ir/schemaMeta.js.map +1 -1
  23. package/build/esm/lib/pack-docschema-api/pack-docschema-ir/unionDef.js.map +1 -1
  24. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/custom-discriminant.js +1 -1
  25. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/custom-discriminant.js.map +1 -1
  26. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/external-refs.js +1 -1
  27. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/external-refs.js.map +1 -1
  28. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/simple-record.js +1 -1
  29. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/simple-record.js.map +1 -1
  30. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/union-types.js +1 -1
  31. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/union-types.js.map +1 -1
  32. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/array-and-map-types.js +1 -1
  33. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/array-and-map-types.js.map +1 -1
  34. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/boolean-fields.js +1 -1
  35. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/boolean-fields.js.map +1 -1
  36. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/custom-discriminant.js +1 -1
  37. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/custom-discriminant.js.map +1 -1
  38. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/datetime-fields.js +1 -1
  39. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/datetime-fields.js.map +1 -1
  40. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/simple-records.js +1 -1
  41. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/simple-records.js.map +1 -1
  42. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/union-before-records.js +1 -1
  43. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/union-before-records.js.map +1 -1
  44. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/union-types.js +1 -1
  45. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/union-types.js.map +1 -1
  46. package/build/esm/utils/ir/__tests__/convertIrToWireSchema.test.js +71 -0
  47. package/build/esm/utils/ir/__tests__/convertIrToWireSchema.test.js.map +1 -1
  48. package/build/esm/utils/ir/convertIrToWireSchema.js +10 -7
  49. package/build/esm/utils/ir/convertIrToWireSchema.js.map +1 -1
  50. package/build/esm/utils/schema/__tests__/__snapshots__/generateDocumentTypeFromSchema/with-name-and-description.js +1 -1
  51. package/build/esm/utils/schema/__tests__/__snapshots__/generateDocumentTypeFromSchema/with-name-and-description.js.map +1 -1
  52. package/build/esm/utils/schema/__tests__/__snapshots__/generateVersionsFromSchema/single-version.js.map +1 -1
  53. package/build/esm/utils/schema/__tests__/__snapshots__/generateVersionsFromSchema/three-version-chain.js.map +1 -1
  54. package/build/esm/utils/schema/__tests__/__snapshots__/generateVersionsFromSchema/two-version.js.map +1 -1
  55. package/build/esm/utils/schema/__tests__/assertSdkNamesUnique.test.js +178 -0
  56. package/build/esm/utils/schema/__tests__/assertSdkNamesUnique.test.js.map +1 -0
  57. package/build/esm/utils/schema/__tests__/generateInternalFromSchema.test.js +71 -1
  58. package/build/esm/utils/schema/__tests__/generateInternalFromSchema.test.js.map +1 -1
  59. package/build/esm/utils/schema/__tests__/resolveSchemaChain.test.js +122 -3
  60. package/build/esm/utils/schema/__tests__/resolveSchemaChain.test.js.map +1 -1
  61. package/build/esm/utils/schema/assertSdkNamesUnique.js +151 -0
  62. package/build/esm/utils/schema/assertSdkNamesUnique.js.map +1 -0
  63. package/build/esm/utils/schema/generateIndexFromSchema.js +3 -5
  64. package/build/esm/utils/schema/generateIndexFromSchema.js.map +1 -1
  65. package/build/esm/utils/schema/generateInternalFromSchema.js +42 -19
  66. package/build/esm/utils/schema/generateInternalFromSchema.js.map +1 -1
  67. package/build/esm/utils/schema/generateModelMetadataFromSchema.js +9 -11
  68. package/build/esm/utils/schema/generateModelMetadataFromSchema.js.map +1 -1
  69. package/build/esm/utils/schema/generateScopeFromSchema.js +6 -9
  70. package/build/esm/utils/schema/generateScopeFromSchema.js.map +1 -1
  71. package/build/esm/utils/schema/generateVersionedTypesFromSchema.js +8 -9
  72. package/build/esm/utils/schema/generateVersionedTypesFromSchema.js.map +1 -1
  73. package/build/esm/utils/schema/generateVersionedZodFromSchema.js +13 -16
  74. package/build/esm/utils/schema/generateVersionedZodFromSchema.js.map +1 -1
  75. package/build/esm/utils/schema/resolveSchemaChain.js +137 -21
  76. package/build/esm/utils/schema/resolveSchemaChain.js.map +1 -1
  77. package/build/esm/utils/schema/runtimeSchema.js +47 -0
  78. package/build/esm/utils/schema/runtimeSchema.js.map +1 -1
  79. package/build/esm/utils/schema/writeAllSdkFiles.js +2 -0
  80. package/build/esm/utils/schema/writeAllSdkFiles.js.map +1 -1
  81. package/build/esm/utils/steps/__tests__/__snapshots__/types/arrayFields.js.map +1 -1
  82. package/build/esm/utils/steps/__tests__/__snapshots__/types/customDiscriminant.js +1 -1
  83. package/build/esm/utils/steps/__tests__/__snapshots__/types/customDiscriminant.js.map +1 -1
  84. package/build/esm/utils/steps/__tests__/__snapshots__/types/generateTypeScriptInterfaces.js +1 -1
  85. package/build/esm/utils/steps/__tests__/__snapshots__/types/generateTypeScriptInterfaces.js.map +1 -1
  86. package/build/esm/utils/steps/__tests__/__snapshots__/types/refTypes.js.map +1 -1
  87. package/build/esm/utils/steps/__tests__/__snapshots__/types/simpleRecord.js.map +1 -1
  88. package/build/esm/utils/steps/__tests__/__snapshots__/types/simpleSteps.js +1 -1
  89. package/build/esm/utils/steps/__tests__/__snapshots__/types/simpleSteps.js.map +1 -1
  90. package/build/esm/utils/steps/convertStepsToIr.js +30 -2
  91. package/build/esm/utils/steps/convertStepsToIr.js.map +1 -1
  92. package/build/types/commands/ir/__tests__/irUpdateSchemaHandler.test.d.ts +2 -0
  93. package/build/types/commands/ir/__tests__/irUpdateSchemaHandler.test.d.ts.map +1 -0
  94. package/build/types/commands/ir/irDeployHandler.d.ts +1 -1
  95. package/build/types/commands/ir/irDeployHandler.d.ts.map +1 -1
  96. package/build/types/commands/ir/irGenAssetHandler.d.ts +1 -1
  97. package/build/types/commands/ir/irGenAssetHandler.d.ts.map +1 -1
  98. package/build/types/commands/ir/irGenTypesHandler.d.ts.map +1 -1
  99. package/build/types/commands/ir/irUpdateSchemaHandler.d.ts.map +1 -1
  100. package/build/types/commands/ir/resolveIrInput.d.ts +1 -0
  101. package/build/types/commands/ir/resolveIrInput.d.ts.map +1 -1
  102. package/build/types/commands/schema/schemaIrHandler.d.ts +3 -3
  103. package/build/types/commands/schema/schemaIrHandler.d.ts.map +1 -1
  104. package/build/types/lib/pack-docschema-api/pack-docschema-ir/schemaMeta.d.ts +1 -0
  105. package/build/types/lib/pack-docschema-api/pack-docschema-ir/schemaMeta.d.ts.map +1 -1
  106. package/build/types/lib/pack-docschema-api/pack-docschema-ir/unionDef.d.ts +3 -0
  107. package/build/types/lib/pack-docschema-api/pack-docschema-ir/unionDef.d.ts.map +1 -1
  108. package/build/types/utils/ir/convertIrToWireSchema.d.ts +2 -2
  109. package/build/types/utils/ir/convertIrToWireSchema.d.ts.map +1 -1
  110. package/build/types/utils/schema/__tests__/assertSdkNamesUnique.test.d.ts +2 -0
  111. package/build/types/utils/schema/__tests__/assertSdkNamesUnique.test.d.ts.map +1 -0
  112. package/build/types/utils/schema/assertSdkNamesUnique.d.ts +9 -0
  113. package/build/types/utils/schema/assertSdkNamesUnique.d.ts.map +1 -0
  114. package/build/types/utils/schema/generateIndexFromSchema.d.ts.map +1 -1
  115. package/build/types/utils/schema/generateInternalFromSchema.d.ts.map +1 -1
  116. package/build/types/utils/schema/generateModelMetadataFromSchema.d.ts.map +1 -1
  117. package/build/types/utils/schema/generateScopeFromSchema.d.ts.map +1 -1
  118. package/build/types/utils/schema/generateVersionedTypesFromSchema.d.ts.map +1 -1
  119. package/build/types/utils/schema/generateVersionedZodFromSchema.d.ts.map +1 -1
  120. package/build/types/utils/schema/resolveSchemaChain.d.ts +24 -1
  121. package/build/types/utils/schema/resolveSchemaChain.d.ts.map +1 -1
  122. package/build/types/utils/schema/runtimeSchema.d.ts +19 -0
  123. package/build/types/utils/schema/runtimeSchema.d.ts.map +1 -1
  124. package/build/types/utils/schema/writeAllSdkFiles.d.ts.map +1 -1
  125. package/build/types/utils/steps/convertStepsToIr.d.ts +4 -0
  126. package/build/types/utils/steps/convertStepsToIr.d.ts.map +1 -1
  127. package/package.json +19 -5
  128. package/build/esm/utils/unknownVariantSuffix.js +0 -22
  129. package/build/esm/utils/unknownVariantSuffix.js.map +0 -1
  130. package/build/types/utils/unknownVariantSuffix.d.ts +0 -3
  131. package/build/types/utils/unknownVariantSuffix.d.ts.map +0 -1
@@ -15,12 +15,13 @@
15
15
  */
16
16
 
17
17
  import { createPlatformClient } from "@osdk/client";
18
- import { DocumentTypes } from "@osdk/foundry.pack";
18
+ import { DocumentTypes } from "@palantir/pack.core/generatedPlatformSdk";
19
19
  import { CommanderError } from "commander";
20
20
  import { consola } from "consola";
21
21
  import { readFileSync } from "fs";
22
22
  import { resolve } from "path";
23
23
  import { convertIrToWireSchema } from "../../utils/ir/convertIrToWireSchema.js";
24
+ import { formatSchemaVersion } from "../../utils/schema/resolveSchemaChain.js";
24
25
  import { buildPrefixRewriteFetch, DEFAULT_API_PREFIX } from "../utils/firstPartyPrefix.js";
25
26
  import { resolveIrInput } from "./resolveIrInput.js";
26
27
  /**
@@ -33,34 +34,40 @@ export async function irUpdateSchemaHandler(options) {
33
34
  consola.info(`Reading schema from: ${irPath}`);
34
35
  const {
35
36
  ir,
36
- latestVersion
37
+ latestVersion,
38
+ latestMinorVersion
37
39
  } = resolveIrInput(JSON.parse(readFileSync(irPath, "utf8")), irPath);
38
40
  const schema = convertIrToWireSchema(ir);
41
+ const versionLabel = formatSchemaVersion(latestVersion, latestMinorVersion);
39
42
  const fetchFn = options.firstPartyPrefix != null ? buildPrefixRewriteFetch(options.firstPartyPrefix) : undefined;
40
43
  if (fetchFn != null) {
41
44
  consola.info(`Rewriting OSDK '${DEFAULT_API_PREFIX}' -> '${options.firstPartyPrefix}'`);
42
45
  }
43
46
  const osdkClient = createPlatformClient(options.baseUrl, () => Promise.resolve(options.auth), undefined, fetchFn);
47
+ const requestBody = {
48
+ ontologyRid: options.ontologyRid,
49
+ schema,
50
+ version: latestVersion,
51
+ ...(latestMinorVersion > 0 ? {
52
+ schemaMinorVersion: latestMinorVersion
53
+ } : {}),
54
+ ...(options.forceOverwrite ? {
55
+ forceOverwrite: true
56
+ } : {})
57
+ };
44
58
  const request = {
45
59
  documentTypeName: ir.name,
46
- requestBody: {
47
- ontologyRid: options.ontologyRid,
48
- schema,
49
- version: latestVersion,
50
- ...(options.forceOverwrite ? {
51
- forceOverwrite: true
52
- } : {})
53
- }
60
+ requestBody
54
61
  };
55
62
  if (options.forceOverwrite) {
56
63
  consola.warn("--force-overwrite is set: backwards-compatibility validation will be skipped.");
57
64
  }
58
- consola.info(`Updating schema for document type "${ir.name}" -> version ${latestVersion}`);
65
+ consola.info(`Updating schema for document type "${ir.name}" -> version ${versionLabel}`);
59
66
  const result = await DocumentTypes.updateSchema(osdkClient, request, {
60
67
  preview: true
61
68
  });
62
69
  if (result.type === "success") {
63
- consola.success(`Schema updated successfully (version ${result.version})`);
70
+ consola.success(`Schema updated successfully (version ${formatSchemaVersion(result.version, result.schemaMinorVersion)})`);
64
71
  return;
65
72
  }
66
73
  consola.error(`Schema validation failed with ${result.violations.length} violation(s):`);
@@ -1 +1 @@
1
- {"version":3,"file":"irUpdateSchemaHandler.js","names":["createPlatformClient","DocumentTypes","CommanderError","consola","readFileSync","resolve","convertIrToWireSchema","buildPrefixRewriteFetch","DEFAULT_API_PREFIX","resolveIrInput","irUpdateSchemaHandler","options","irPath","ir","info","latestVersion","JSON","parse","schema","fetchFn","firstPartyPrefix","undefined","osdkClient","baseUrl","Promise","auth","request","documentTypeName","name","requestBody","ontologyRid","version","forceOverwrite","warn","result","updateSchema","preview","type","success","error","violations","length","violation","fieldPath","message","violationType"],"sources":["irUpdateSchemaHandler.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 { createPlatformClient } 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 { convertIrToWireSchema } from \"../../utils/ir/convertIrToWireSchema.js\";\nimport { buildPrefixRewriteFetch, DEFAULT_API_PREFIX } from \"../utils/firstPartyPrefix.js\";\nimport { resolveIrInput } from \"./resolveIrInput.js\";\n\ninterface IrUpdateSchemaOptions {\n readonly ir: string;\n readonly baseUrl: string;\n readonly auth: string;\n readonly ontologyRid: string;\n readonly forceOverwrite?: boolean;\n readonly firstPartyPrefix?: string;\n}\n\n/**\n * Updates the schema of an existing document type from an IR file. Sources the wire schema and version directly from\n * the IR (the same single source of truth used by `ir deploy`), avoiding a separately-generated asset file.\n */\nexport async function irUpdateSchemaHandler(options: IrUpdateSchemaOptions): Promise<void> {\n try {\n const irPath = resolve(options.ir);\n consola.info(`Reading schema from: ${irPath}`);\n\n const { ir, latestVersion } = resolveIrInput(\n JSON.parse(readFileSync(irPath, \"utf8\")) as unknown,\n irPath,\n );\n const schema = convertIrToWireSchema(ir);\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: ir.name,\n requestBody: {\n ontologyRid: options.ontologyRid,\n schema,\n version: latestVersion,\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 consola.info(`Updating schema for document type \"${ir.name}\" -> version ${latestVersion}`);\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(\n ` - ${violation.fieldPath}: ${violation.message} (${violation.violationType})`,\n );\n }\n throw new CommanderError(1, \"ERRIRUPDATESCHEMA\", \"Schema validation failed\");\n } catch (error) {\n if (error instanceof CommanderError) {\n throw error;\n }\n consola.error(\"❌ Error during update-schema:\", error);\n throw new CommanderError(1, \"ERRIRUPDATESCHEMA\", \"Error updating schema from IR\");\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,oBAAoB,QAAQ,cAAc;AAEnD,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,cAAc,QAAQ,WAAW;AAC1C,SAASC,OAAO,QAAQ,SAAS;AACjC,SAASC,YAAY,QAAQ,IAAI;AACjC,SAASC,OAAO,QAAQ,MAAM;AAC9B,SAASC,qBAAqB,QAAQ,yCAAyC;AAC/E,SAASC,uBAAuB,EAAEC,kBAAkB,QAAQ,8BAA8B;AAC1F,SAASC,cAAc,QAAQ,qB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EAAE,CAACe,IAAI,gBAAgBb,aAAa,EAAE,CAAC;IAE1F,MAAMmB,MAAM,GAAG,MAAMjC,aAAa,CAACkC,YAAY,CAACb,UAAU,EAAEI,OAAO,EAAE;MAAEU,OAAO,EAAE;IAAK,CAAC,CAAC;IAEvF,IAAIF,MAAM,CAACG,IAAI,KAAK,SAAS,EAAE;MAC7BlC,OAAO,CAACmC,OAAO,CAAC,wCAAwCJ,MAAM,CAACH,OAAO,GAAG,CAAC;MAC1E;IACF;IAEA5B,OAAO,CAACoC,KAAK,CAAC,iCAAiCL,MAAM,CAACM,UAAU,CAACC,MAAM,gBAAgB,CAAC;IACxF,KAAK,MAAMC,SAAS,IAAIR,MAAM,CAACM,UAAU,EAAE;MACzCrC,OAAO,CAACoC,KAAK,CACX,OAAOG,SAAS,CAACC,SAAS,KAAKD,SAAS,CAACE,OAAO,KAAKF,SAAS,CAACG,aAAa,GAC9E,CAAC;IACH;IACA,MAAM,IAAI3C,cAAc,CAAC,CAAC,EAAE,mBAAmB,EAAE,0BAA0B,CAAC;EAC9E,CAAC,CAAC,OAAOqC,KAAK,EAAE;IACd,IAAIA,KAAK,YAAYrC,cAAc,EAAE;MACnC,MAAMqC,KAAK;IACb;IACApC,OAAO,CAACoC,KAAK,CAAC,+BAA+B,EAAEA,KAAK,CAAC;IACrD,MAAM,IAAIrC,cAAc,CAAC,CAAC,EAAE,mBAAmB,EAAE,+BAA+B,CAAC;EACnF;AACF","ignoreList":[]}
1
+ {"version":3,"file":"irUpdateSchemaHandler.js","names":["createPlatformClient","DocumentTypes","CommanderError","consola","readFileSync","resolve","convertIrToWireSchema","formatSchemaVersion","buildPrefixRewriteFetch","DEFAULT_API_PREFIX","resolveIrInput","irUpdateSchemaHandler","options","irPath","ir","info","latestVersion","latestMinorVersion","JSON","parse","schema","versionLabel","fetchFn","firstPartyPrefix","undefined","osdkClient","baseUrl","Promise","auth","requestBody","ontologyRid","version","schemaMinorVersion","forceOverwrite","request","documentTypeName","name","warn","result","updateSchema","preview","type","success","error","violations","length","violation","fieldPath","message","violationType"],"sources":["irUpdateSchemaHandler.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 { createPlatformClient } from \"@osdk/client\";\nimport type {\n UpdateSchemaDocumentTypeRequest,\n UpdateSchemaRequestBody,\n} from \"@palantir/pack.core/generatedPlatformSdk\";\nimport { DocumentTypes } from \"@palantir/pack.core/generatedPlatformSdk\";\nimport { CommanderError } from \"commander\";\nimport { consola } from \"consola\";\nimport { readFileSync } from \"fs\";\nimport { resolve } from \"path\";\nimport { convertIrToWireSchema } from \"../../utils/ir/convertIrToWireSchema.js\";\nimport { formatSchemaVersion } from \"../../utils/schema/resolveSchemaChain.js\";\nimport { buildPrefixRewriteFetch, DEFAULT_API_PREFIX } from \"../utils/firstPartyPrefix.js\";\nimport { resolveIrInput } from \"./resolveIrInput.js\";\n\ninterface IrUpdateSchemaOptions {\n readonly ir: string;\n readonly baseUrl: string;\n readonly auth: string;\n readonly ontologyRid: string;\n readonly forceOverwrite?: boolean;\n readonly firstPartyPrefix?: string;\n}\n\n/**\n * Updates the schema of an existing document type from an IR file. Sources the wire schema and version directly from\n * the IR (the same single source of truth used by `ir deploy`), avoiding a separately-generated asset file.\n */\nexport async function irUpdateSchemaHandler(options: IrUpdateSchemaOptions): Promise<void> {\n try {\n const irPath = resolve(options.ir);\n consola.info(`Reading schema from: ${irPath}`);\n\n const { ir, latestVersion, latestMinorVersion } = resolveIrInput(\n JSON.parse(readFileSync(irPath, \"utf8\")) as unknown,\n irPath,\n );\n const schema = convertIrToWireSchema(ir);\n const versionLabel = formatSchemaVersion(latestVersion, latestMinorVersion);\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 requestBody: UpdateSchemaRequestBody = {\n ontologyRid: options.ontologyRid,\n schema,\n version: latestVersion,\n ...(latestMinorVersion > 0 ? { schemaMinorVersion: latestMinorVersion } : {}),\n ...(options.forceOverwrite ? { forceOverwrite: true } : {}),\n };\n const request: UpdateSchemaDocumentTypeRequest = { documentTypeName: ir.name, requestBody };\n\n if (options.forceOverwrite) {\n consola.warn(\"--force-overwrite is set: backwards-compatibility validation will be skipped.\");\n }\n consola.info(`Updating schema for document type \"${ir.name}\" -> version ${versionLabel}`);\n\n const result = await DocumentTypes.updateSchema(osdkClient, request, { preview: true });\n\n if (result.type === \"success\") {\n consola.success(\n `Schema updated successfully (version ${\n formatSchemaVersion(result.version, result.schemaMinorVersion)\n })`,\n );\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(\n ` - ${violation.fieldPath}: ${violation.message} (${violation.violationType})`,\n );\n }\n throw new CommanderError(1, \"ERRIRUPDATESCHEMA\", \"Schema validation failed\");\n } catch (error) {\n if (error instanceof CommanderError) {\n throw error;\n }\n consola.error(\"❌ Error during update-schema:\", error);\n throw new CommanderError(1, \"ERRIRUPDATESCHEMA\", \"Error updating schema from IR\");\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,oBAAoB,QAAQ,cAAc;AAKnD,SAASC,aAAa,QAAQ,0CAA0C;AACxE,SAAS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YAAYzC,cAAc,EAAE;MACnC,MAAMyC,KAAK;IACb;IACAxC,OAAO,CAACwC,KAAK,CAAC,+BAA+B,EAAEA,KAAK,CAAC;IACrD,MAAM,IAAIzC,cAAc,CAAC,CAAC,EAAE,mBAAmB,EAAE,+BAA+B,CAAC;EACnF;AACF","ignoreList":[]}
@@ -15,7 +15,8 @@
15
15
  */
16
16
 
17
17
  import { CommanderError } from "commander";
18
- import { resolveMinVersion } from "../../utils/schema/resolveSchemaChain.js";
18
+ import { assertSdkNamesUnique } from "../../utils/schema/assertSdkNamesUnique.js";
19
+ import { getEntryMinorVersion, resolveMinVersion } from "../../utils/schema/resolveSchemaChain.js";
19
20
  function isChainPayload(parsed) {
20
21
  return typeof parsed === "object" && parsed != null && "chain" in parsed && Array.isArray(parsed.chain) && typeof parsed.latestVersion === "number";
21
22
  }
@@ -27,13 +28,12 @@ function resolveFromChain(payload, irPath) {
27
28
  latestVersion,
28
29
  minVersion
29
30
  } = resolveMinVersion(payload.chain, payload.minSupportedVersion);
30
- const latestEntry = payload.chain.find(c => c.version === latestVersion);
31
- if (latestEntry == null) {
32
- throw new CommanderError(1, "EINVAL", `IR chain payload at ${irPath} has no entry matching latestVersion ${latestVersion}`);
33
- }
31
+ const latestEntry = payload.chain[payload.chain.length - 1];
32
+ assertSdkNamesUnique(payload.chain, payload.minSupportedVersion);
34
33
  return {
35
34
  ir: latestEntry.ir,
36
35
  latestVersion,
36
+ latestMinorVersion: getEntryMinorVersion(latestEntry),
37
37
  minSupportedVersion: minVersion,
38
38
  owningApplicationId: payload.owningApplicationId
39
39
  };
@@ -42,6 +42,7 @@ function resolveFromSingleIr(ir) {
42
42
  return {
43
43
  ir,
44
44
  latestVersion: ir.version,
45
+ latestMinorVersion: 0,
45
46
  minSupportedVersion: ir.version
46
47
  };
47
48
  }
@@ -1 +1 @@
1
- {"version":3,"file":"resolveIrInput.js","names":["CommanderError","resolveMinVersion","isChainPayload","parsed","Array","isArray","chain","latestVersion","resolveFromChain","payload","irPath","length","minVersion","minSupportedVersion","latestEntry","find","c","version","ir","owningApplicationId","resolveFromSingleIr","resolveIrInput"],"sources":["resolveIrInput.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 { CommanderError } from \"commander\";\nimport type { IRealTimeDocumentSchema } from \"../../lib/pack-docschema-api/pack-docschema-ir/index.js\";\nimport { type IrChainPayload, resolveMinVersion } from \"../../utils/schema/resolveSchemaChain.js\";\n\nexport interface ResolvedIrInput {\n readonly ir: IRealTimeDocumentSchema;\n readonly latestVersion: number;\n readonly minSupportedVersion: number;\n readonly owningApplicationId?: string;\n}\n\nfunction isChainPayload(parsed: unknown): parsed is IrChainPayload {\n return (\n typeof parsed === \"object\"\n && parsed != null\n && \"chain\" in parsed\n && Array.isArray((parsed as IrChainPayload).chain)\n && typeof (parsed as IrChainPayload).latestVersion === \"number\"\n );\n}\n\nfunction resolveFromChain(payload: IrChainPayload, irPath: string): ResolvedIrInput {\n if (payload.chain.length === 0) {\n throw new CommanderError(\n 1,\n \"EINVAL\",\n `Invalid IR chain payload at ${irPath}: 'chain' is empty`,\n );\n }\n const { latestVersion, minVersion } = resolveMinVersion(\n payload.chain,\n payload.minSupportedVersion,\n );\n const latestEntry = payload.chain.find(c => c.version === latestVersion);\n if (latestEntry == null) {\n throw new CommanderError(\n 1,\n \"EINVAL\",\n `IR chain payload at ${irPath} has no entry matching latestVersion ${latestVersion}`,\n );\n }\n return {\n ir: latestEntry.ir,\n latestVersion,\n minSupportedVersion: minVersion,\n owningApplicationId: payload.owningApplicationId,\n };\n}\n\nfunction resolveFromSingleIr(ir: IRealTimeDocumentSchema): ResolvedIrInput {\n return { ir, latestVersion: ir.version, minSupportedVersion: ir.version };\n}\n\nexport function resolveIrInput(parsed: unknown, irPath: string): ResolvedIrInput {\n return isChainPayload(parsed)\n ? resolveFromChain(parsed, irPath)\n : resolveFromSingleIr(parsed as IRealTimeDocumentSchema);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,cAAc,QAAQ,WAAW;AAE1C,SAA8BC,iBAAiB,QAAQ,0CAA0C;AASjG,SAASC,cAAcA,CAACC,MAAe,EAA4B;EACjE,OACE,OAAOA,MAAM,KAAK,QAAQ,IACvBA,MAAM,IAAI,IAAI,IACd,OAAO,IAAIA,MAAM,IACjBC,KAAK,CAACC,OAAO,CAAEF,MAAM,CAAoBG,KAAK,CAAC,IAC/C,OAAQH,MAAM,CAAoBI,aAAa,KAAK,QAAQ;AAEnE;AAEA,SAASC,gBAAgBA,CAACC,OAAuB,EAAEC,MAAc,EAAmB;EAClF,IAAID,OAAO,CAACH,KAAK,CAACK,MAAM,KAAK,CAAC,EAAE;IAC9B,MAAM,IAAIX,cAAc,CACtB,CAAC,EACD,QAAQ,EACR,+BAA+BU,MAAM,oBACvC,CAAC;EACH;EACA,MAAM;IAAEH,aAAa;IAAEK;EAAW,CAAC,GAAGX,iBAAiB,CACrDQ,OAAO,CAACH,KAAK,EACbG,OAAO,CAACI,mBACV,CAAC;EACD,MAAMC,WAAW,GAAGL,OAAO,CAACH,KAAK,CAACS,IAAI,CAACC,CAAC,IAAIA,CAAC,CAACC,OAAO,KAAKV,aAAa,CAAC;EACxE,IAAIO,WAAW,IAAI,IAAI,EAAE;IACvB,MAAM,IAAId,cAAc,CACtB,CAAC,EACD,QAAQ,EACR,uBAAuBU,MAAM,wCAAwCH,aAAa,EACpF,CAAC;EACH;EACA,OAAO;IACLW,EAAE,EAAEJ,WAAW,CAACI,EAAE;IAClBX,aAAa;IACbM,mBAAmB,EAAED,UAAU;IAC/BO,mBAAmB,EAAEV,OAAO,CAACU;EAC/B,CAAC;AACH;AAEA,SAASC,mBAAmBA,CAACF,EAA2B,EAAmB;EACzE,OAAO;IAAEA,EAAE;IAAEX,aAAa,EAAEW,EAAE,CAACD,OAAO;IAAEJ,mBAAmB,EAAEK,EAAE,CAACD;EAAQ,CAAC;AAC3E;AAEA,OAAO,SAASI,cAAcA,CAAClB,MAAe,EAAEO,MAAc,EAAmB;EAC/E,OAAOR,cAAc,CAACC,MAAM,CAAC,GACzBK,gBAAgB,CAACL,MAAM,EAAEO,MAAM,CAAC,GAChCU,mBAAmB,CAACjB,MAAiC,CAAC;AAC5D","ignoreList":[]}
1
+ {"version":3,"file":"resolveIrInput.js","names":["CommanderError","assertSdkNamesUnique","getEntryMinorVersion","resolveMinVersion","isChainPayload","parsed","Array","isArray","chain","latestVersion","resolveFromChain","payload","irPath","length","minVersion","minSupportedVersion","latestEntry","ir","latestMinorVersion","owningApplicationId","resolveFromSingleIr","version","resolveIrInput"],"sources":["resolveIrInput.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 { CommanderError } from \"commander\";\nimport type { IRealTimeDocumentSchema } from \"../../lib/pack-docschema-api/pack-docschema-ir/index.js\";\nimport { assertSdkNamesUnique } from \"../../utils/schema/assertSdkNamesUnique.js\";\nimport {\n getEntryMinorVersion,\n type IrChainPayload,\n resolveMinVersion,\n} from \"../../utils/schema/resolveSchemaChain.js\";\n\nexport interface ResolvedIrInput {\n readonly ir: IRealTimeDocumentSchema;\n readonly latestVersion: number;\n readonly latestMinorVersion: number;\n readonly minSupportedVersion: number;\n readonly owningApplicationId?: string;\n}\n\nfunction isChainPayload(parsed: unknown): parsed is IrChainPayload {\n return (\n typeof parsed === \"object\"\n && parsed != null\n && \"chain\" in parsed\n && Array.isArray((parsed as IrChainPayload).chain)\n && typeof (parsed as IrChainPayload).latestVersion === \"number\"\n );\n}\n\nfunction resolveFromChain(payload: IrChainPayload, irPath: string): ResolvedIrInput {\n if (payload.chain.length === 0) {\n throw new CommanderError(\n 1,\n \"EINVAL\",\n `Invalid IR chain payload at ${irPath}: 'chain' is empty`,\n );\n }\n const { latestVersion, minVersion } = resolveMinVersion(\n payload.chain,\n payload.minSupportedVersion,\n );\n const latestEntry = payload.chain[payload.chain.length - 1]!;\n assertSdkNamesUnique(payload.chain, payload.minSupportedVersion);\n return {\n ir: latestEntry.ir,\n latestVersion,\n latestMinorVersion: getEntryMinorVersion(latestEntry),\n minSupportedVersion: minVersion,\n owningApplicationId: payload.owningApplicationId,\n };\n}\n\nfunction resolveFromSingleIr(ir: IRealTimeDocumentSchema): ResolvedIrInput {\n return { ir, latestVersion: ir.version, latestMinorVersion: 0, minSupportedVersion: ir.version };\n}\n\nexport function resolveIrInput(parsed: unknown, irPath: string): ResolvedIrInput {\n return isChainPayload(parsed)\n ? resolveFromChain(parsed, irPath)\n : resolveFromSingleIr(parsed as IRealTimeDocumentSchema);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,cAAc,QAAQ,WAAW;AAE1C,SAASC,oBAAoB,QAAQ,4CAA4C;AACjF,SACEC,oBAAoB,EAEpBC,iBAAiB,QACZ,0CAA0C;AAUjD,SAASC,cAAcA,CAACC,MAAe,EAA4B;EACjE,OACE,OAAOA,MAAM,KAAK,QAAQ,IACvBA,MAAM,IAAI,IAAI,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{ schemaToYamlHandler } from "./schemaToYamlHandler.js";
19
19
  export function registerSchemaCommands(program) {
20
20
  const schemaCmd = program.command("schema").description("Commands for working with TypeScript schema definitions");
21
21
  schemaCmd.command("yaml").description("Convert TypeScript schema to YAML migration steps").requiredOption("-i, --input <file>", "Input TypeScript schema file").requiredOption("-o, --output <file>", "Output YAML file").action(schemaToYamlHandler);
22
- schemaCmd.command("ir").description("Resolve a TypeScript schema module to a versioned IR chain JSON file").requiredOption("-i, --input <file>", "Input TypeScript/JavaScript schema module").requiredOption("-o, --output <file>", "Output IR chain JSON file").requiredOption("--config <file>", "Path to the SDK's pack-config JSON file. Its optional 'minSupportedVersion' field declares the oldest schema version this SDK supports; omit the field to track latest only.").option("--max-version <version>", "Generate an IR chain capped at this schema version").action(schemaIrHandler);
22
+ schemaCmd.command("ir").description("Resolve a TypeScript schema module to a versioned IR chain JSON file").requiredOption("-i, --input <file>", "Input TypeScript/JavaScript schema module").requiredOption("-o, --output <file>", "Output IR chain JSON file").requiredOption("--config <file>", "Path to the SDK's pack-config JSON file. Its optional 'minSupportedVersion' field declares the oldest schema version this SDK supports; omit the field to track latest only.").option("--max-version <version>", "Generate an IR chain capped at this schema version, e.g. 2 (meaning 2.0) or 2.1").action(schemaIrHandler);
23
23
  }
24
24
  //# sourceMappingURL=registerSchemaCommands.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"registerSchemaCommands.js","names":["schemaIrHandler","schemaToYamlHandler","registerSchemaCommands","program","schemaCmd","command","description","requiredOption","action","option"],"sources":["registerSchemaCommands.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { Command } from \"commander\";\nimport { schemaIrHandler } from \"./schemaIrHandler.js\";\nimport { schemaToYamlHandler } from \"./schemaToYamlHandler.js\";\n\nexport function registerSchemaCommands(program: Command): void {\n const schemaCmd = program\n .command(\"schema\")\n .description(\"Commands for working with TypeScript schema definitions\");\n\n schemaCmd\n .command(\"yaml\")\n .description(\"Convert TypeScript schema to YAML migration steps\")\n .requiredOption(\"-i, --input <file>\", \"Input TypeScript schema file\")\n .requiredOption(\"-o, --output <file>\", \"Output YAML file\")\n .action(schemaToYamlHandler);\n\n schemaCmd\n .command(\"ir\")\n .description(\"Resolve a TypeScript schema module to a versioned IR chain JSON file\")\n .requiredOption(\"-i, --input <file>\", \"Input TypeScript/JavaScript schema module\")\n .requiredOption(\"-o, --output <file>\", \"Output IR chain JSON file\")\n .requiredOption(\n \"--config <file>\",\n \"Path to the SDK's pack-config JSON file. Its optional 'minSupportedVersion' field declares the oldest schema version this SDK supports; omit the field to track latest only.\",\n )\n .option(\n \"--max-version <version>\",\n \"Generate an IR chain capped at this schema version\",\n )\n .action(schemaIrHandler);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,eAAe,QAAQ,sBAAsB;AACtD,SAASC,mBAAmB,QAAQ,0BAA0B;AAE9D,OAAO,SAASC,sBAAsBA,CAACC,OAAgB,EAAQ;EAC7D,MAAMC,SAAS,GAAGD,OAAO,CACtBE,OAAO,CAAC,QAAQ,CAAC,CACjBC,WAAW,CAAC,yDAAyD,CAAC;EAEzEF,SAAS,CACNC,OAAO,CAAC,MAAM,CAAC,CACfC,WAAW,CAAC,mDAAmD,CAAC,CAChEC,cAAc,CAAC,oBAAoB,EAAE,8BAA8B,CAAC,CACpEA,cAAc,CAAC,qBAAqB,EAAE,kBAAkB,CAAC,CACzDC,MAAM,CAACP,mBAAmB,CAAC;EAE9BG,SAAS,CACNC,OAAO,CAAC,IAAI,CAAC,CACbC,WAAW,CAAC,sEAAsE,CAAC,CACnFC,cAAc,CAAC,oBAAoB,EAAE,2CAA2C,CAAC,CACjFA,cAAc,CAAC,qBAAqB,EAAE,2BAA2B,CAAC,CAClEA,cAAc,CACb,iBAAiB,EACjB,8KACF,CAAC,CACAE,MAAM,CACL,yBAAyB,EACzB,oDACF,CAAC,CACAD,MAAM,CAACR,eAAe,CAAC;AAC5B","ignoreList":[]}
1
+ {"version":3,"file":"registerSchemaCommands.js","names":["schemaIrHandler","schemaToYamlHandler","registerSchemaCommands","program","schemaCmd","command","description","requiredOption","action","option"],"sources":["registerSchemaCommands.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { Command } from \"commander\";\nimport { schemaIrHandler } from \"./schemaIrHandler.js\";\nimport { schemaToYamlHandler } from \"./schemaToYamlHandler.js\";\n\nexport function registerSchemaCommands(program: Command): void {\n const schemaCmd = program\n .command(\"schema\")\n .description(\"Commands for working with TypeScript schema definitions\");\n\n schemaCmd\n .command(\"yaml\")\n .description(\"Convert TypeScript schema to YAML migration steps\")\n .requiredOption(\"-i, --input <file>\", \"Input TypeScript schema file\")\n .requiredOption(\"-o, --output <file>\", \"Output YAML file\")\n .action(schemaToYamlHandler);\n\n schemaCmd\n .command(\"ir\")\n .description(\"Resolve a TypeScript schema module to a versioned IR chain JSON file\")\n .requiredOption(\"-i, --input <file>\", \"Input TypeScript/JavaScript schema module\")\n .requiredOption(\"-o, --output <file>\", \"Output IR chain JSON file\")\n .requiredOption(\n \"--config <file>\",\n \"Path to the SDK's pack-config JSON file. Its optional 'minSupportedVersion' field declares the oldest schema version this SDK supports; omit the field to track latest only.\",\n )\n .option(\n \"--max-version <version>\",\n \"Generate an IR chain capped at this schema version, e.g. 2 (meaning 2.0) or 2.1\",\n )\n .action(schemaIrHandler);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,eAAe,QAAQ,sBAAsB;AACtD,SAASC,mBAAmB,QAAQ,0BAA0B;AAE9D,OAAO,SAASC,sBAAsBA,CAACC,OAAgB,EAAQ;EAC7D,MAAMC,SAAS,GAAGD,OAAO,CACtBE,OAAO,CAAC,QAAQ,CAAC,CACjBC,WAAW,CAAC,yDAAyD,CAAC;EAEzEF,SAAS,CACNC,OAAO,CAAC,MAAM,CAAC,CACfC,WAAW,CAAC,mDAAmD,CAAC,CAChEC,cAAc,CAAC,oBAAoB,EAAE,8BAA8B,CAAC,CACpEA,cAAc,CAAC,qBAAqB,EAAE,kBAAkB,CAAC,CACzDC,MAAM,CAACP,mBAAmB,CAAC;EAE9BG,SAAS,CACNC,OAAO,CAAC,IAAI,CAAC,CACbC,WAAW,CAAC,sEAAsE,CAAC,CACnFC,cAAc,CAAC,oBAAoB,EAAE,2CAA2C,CAAC,CACjFA,cAAc,CAAC,qBAAqB,EAAE,2BAA2B,CAAC,CAClEA,cAAc,CACb,iBAAiB,EACjB,8KACF,CAAC,CACAE,MAAM,CACL,yBAAyB,EACzB,iFACF,CAAC,CACAD,MAAM,CAACR,eAAe,CAAC;AAC5B","ignoreList":[]}
@@ -18,8 +18,9 @@ import { consola } from "consola";
18
18
  import fs from "fs-extra";
19
19
  import path from "path";
20
20
  import { GENERATED_JSON_COMMENT } from "../../utils/generatedFileHeader.js";
21
+ import { assertSdkNamesUnique } from "../../utils/schema/assertSdkNamesUnique.js";
21
22
  import { loadSchemaModule } from "../../utils/schema/loadSchemaModule.js";
22
- import { resolveSchemaChain } from "../../utils/schema/resolveSchemaChain.js";
23
+ import { formatSchemaVersion, getEntryMinorVersion, resolveSchemaChain } from "../../utils/schema/resolveSchemaChain.js";
23
24
  function assertNonEmptyString(value, field, configPath) {
24
25
  if (typeof value !== "string" || value.trim() === "") {
25
26
  throw new Error(`'${field}' in ${configPath} must be a non-empty string, got: ${JSON.stringify(value)}`);
@@ -63,17 +64,21 @@ function parseMaxVersion(maxVersion) {
63
64
  if (maxVersion == null) {
64
65
  return undefined;
65
66
  }
66
- if (!/^[1-9]\d*$/.test(maxVersion)) {
67
- throw new Error(`--max-version must be a positive integer, got: ${JSON.stringify(maxVersion)}`);
67
+ const match = /^([1-9]\d*)(?:\.(0|[1-9]\d*))?$/.exec(maxVersion);
68
+ if (match == null) {
69
+ throw new Error(`--max-version must be a version like 2 or 2.1, got: ${JSON.stringify(maxVersion)}`);
68
70
  }
69
- return Number(maxVersion);
71
+ return {
72
+ major: Number(match[1]),
73
+ minor: Number(match[2] ?? 0)
74
+ };
70
75
  }
71
76
 
72
77
  /**
73
78
  * Resolve a TypeScript schema module to a versioned IR chain JSON file.
74
79
  *
75
80
  * The output is a `{ latestVersion, minSupportedVersion?, chain }` payload
76
- * where each entry is `{ version, ir, migrations? }` and `ir` is a
81
+ * where each entry is `{ version, minorVersion?, ir, migrations? }` and `ir` is a
77
82
  * single-version `IRealTimeDocumentSchema`. This is the input format for
78
83
  * `ir gen-types` and `ir asset`.
79
84
  *
@@ -96,8 +101,8 @@ function parseMaxVersion(maxVersion) {
96
101
  *
97
102
  * Note: this is distinct from the legacy single-version IR JSON consumed by
98
103
  * `ir zod`, which is a bare `IRealTimeDocumentSchema` (no chain, no migrations).
99
- * Tools that previously read that format should pick the entry matching
100
- * `latestVersion` from `chain` and use its `ir` field.
104
+ * Tools that previously read that format should use the `ir` field of the last
105
+ * entry in `chain` (several entries can share a major version, e.g. 3.0 and 3.1).
101
106
  */
102
107
  export async function schemaIrHandler(options) {
103
108
  const {
@@ -125,6 +130,7 @@ export async function schemaIrHandler(options) {
125
130
  name: documentTypeName,
126
131
  description: documentTypeDescription
127
132
  }, maxVersion);
133
+ assertSdkNamesUnique(chain, minSupportedVersion);
128
134
  const outputPath = path.resolve(output);
129
135
  await fs.ensureDir(path.dirname(outputPath));
130
136
  const payload = {
@@ -139,6 +145,7 @@ export async function schemaIrHandler(options) {
139
145
  chain
140
146
  };
141
147
  await fs.writeFile(outputPath, JSON.stringify(payload, null, 2) + "\n", "utf8");
142
- consola.success(`Wrote IR chain (${chain.length} version(s), min=${minSupportedVersion ?? latestVersion}, max=${latestVersion}) to: ${outputPath}`);
148
+ const latestEntry = chain[chain.length - 1];
149
+ consola.success(`Wrote IR chain (${chain.length} version(s), min=${minSupportedVersion ?? latestVersion}, max=${formatSchemaVersion(latestEntry.version, getEntryMinorVersion(latestEntry))}) to: ${outputPath}`);
143
150
  }
144
151
  //# sourceMappingURL=schemaIrHandler.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"schemaIrHandler.js","names":["consola","fs","path","GENERATED_JSON_COMMENT","loadSchemaModule","resolveSchemaChain","assertNonEmptyString","value","field","configPath","trim","Error","JSON","stringify","readRequiredNonEmptyString","readPackConfig","resolvedConfigPath","resolve","pathExists","config","readJson","documentTypeName","documentTypeDescription","minSupportedVersion","rawMin","Number","isInteger","owningApplicationId","parseMaxVersion","maxVersion","undefined","test","schemaIrHandler","options","input","output","warn","info","schema","chain","latestVersion","name","description","outputPath","ensureDir","dirname","payload","comment","writeFile","success","length"],"sources":["schemaIrHandler.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"consola\";\nimport fs from \"fs-extra\";\nimport path from \"path\";\nimport { GENERATED_JSON_COMMENT } from \"../../utils/generatedFileHeader.js\";\nimport { loadSchemaModule } from \"../../utils/schema/loadSchemaModule.js\";\nimport { resolveSchemaChain } from \"../../utils/schema/resolveSchemaChain.js\";\n\ninterface SchemaIrOptions {\n input: string;\n output: string;\n config: string;\n maxVersion?: string;\n}\n\ninterface PackConfigLike {\n documentTypeName?: unknown;\n documentTypeDescription?: unknown;\n minSupportedVersion?: unknown;\n owningApplicationId?: unknown;\n}\n\ninterface PackConfigValues {\n readonly documentTypeName: string;\n readonly documentTypeDescription: string;\n readonly minSupportedVersion?: number;\n readonly owningApplicationId?: string;\n}\n\nfunction assertNonEmptyString(value: unknown, field: string, configPath: string): string {\n if (typeof value !== \"string\" || value.trim() === \"\") {\n throw new Error(\n `'${field}' in ${configPath} must be a non-empty string, got: ${JSON.stringify(value)}`,\n );\n }\n return value;\n}\n\nfunction readRequiredNonEmptyString(\n value: unknown,\n field: string,\n configPath: string,\n): string {\n if (value == null) {\n throw new Error(\n `'${field}' is required in ${configPath} and must be a non-empty string`,\n );\n }\n return assertNonEmptyString(value, field, configPath);\n}\n\nexport async function readPackConfig(configPath: string): Promise<PackConfigValues> {\n const resolvedConfigPath = path.resolve(configPath);\n if (!(await fs.pathExists(resolvedConfigPath))) {\n throw new Error(`--config file not found: ${resolvedConfigPath}`);\n }\n const config = (await fs.readJson(resolvedConfigPath)) as PackConfigLike;\n\n const documentTypeName = readRequiredNonEmptyString(\n config.documentTypeName,\n \"documentTypeName\",\n resolvedConfigPath,\n );\n\n const documentTypeDescription = readRequiredNonEmptyString(\n config.documentTypeDescription,\n \"documentTypeDescription\",\n resolvedConfigPath,\n );\n\n let minSupportedVersion: number | undefined;\n const rawMin = config.minSupportedVersion;\n if (rawMin != null) {\n if (typeof rawMin !== \"number\" || !Number.isInteger(rawMin) || rawMin <= 0) {\n throw new Error(\n `'minSupportedVersion' in ${resolvedConfigPath} must be a positive integer, got: ${\n JSON.stringify(rawMin)\n }`,\n );\n }\n minSupportedVersion = rawMin;\n }\n\n let owningApplicationId: string | undefined;\n if (config.owningApplicationId != null) {\n owningApplicationId = assertNonEmptyString(\n config.owningApplicationId,\n \"owningApplicationId\",\n resolvedConfigPath,\n );\n }\n\n return { documentTypeName, documentTypeDescription, minSupportedVersion, owningApplicationId };\n}\n\nfunction parseMaxVersion(maxVersion: string | undefined): number | undefined {\n if (maxVersion == null) {\n return undefined;\n }\n\n if (!/^[1-9]\\d*$/.test(maxVersion)) {\n throw new Error(\n `--max-version must be a positive integer, got: ${JSON.stringify(maxVersion)}`,\n );\n }\n\n return Number(maxVersion);\n}\n\n/**\n * Resolve a TypeScript schema module to a versioned IR chain JSON file.\n *\n * The output is a `{ latestVersion, minSupportedVersion?, chain }` payload\n * where each entry is `{ version, ir, migrations? }` and `ir` is a\n * single-version `IRealTimeDocumentSchema`. This is the input format for\n * `ir gen-types` and `ir asset`.\n *\n * `--config <pack-config.json>` is required: the pack-config is the single\n * source of truth for document-type identity. Required fields:\n * - `documentTypeName`: the document type name embedded into each chain\n * entry's IR (and surfaced as `documentTypeName` by `ir asset`).\n * - `documentTypeDescription`: document type description embedded into each\n * chain entry's IR.\n * Optional fields:\n * - `minSupportedVersion`: declares the oldest version this SDK supports;\n * when set, it must match one of the chain entries' `version` values and is\n * embedded as `minSupportedVersion` in the payload so downstream consumers\n * (`ir gen-types`, `ir asset`) read the same value. Omitting the field is\n * an explicit opt-out: the IR will not include `minSupportedVersion` and\n * downstream tools default to supporting only the latest schema version.\n * - `owningApplicationId`: the application that owns this document type; when\n * set, it is embedded in the payload and surfaced as `owningApplicationId`\n * by `ir asset`.\n *\n * Note: this is distinct from the legacy single-version IR JSON consumed by\n * `ir zod`, which is a bare `IRealTimeDocumentSchema` (no chain, no migrations).\n * Tools that previously read that format should pick the entry matching\n * `latestVersion` from `chain` and use its `ir` field.\n */\nexport async function schemaIrHandler(options: SchemaIrOptions): Promise<void> {\n const { input, output, config } = options;\n const maxVersion = parseMaxVersion(options.maxVersion);\n const { documentTypeName, documentTypeDescription, minSupportedVersion, owningApplicationId } =\n await readPackConfig(config);\n\n if (minSupportedVersion == null) {\n consola.warn(\n `--config ${\n path.resolve(config)\n } does not set 'minSupportedVersion'. The generated IR will not include it, so downstream tools (ir gen-types, ir asset) will default to supporting only the latest schema version. Add 'minSupportedVersion' to your pack-config to enable back-compat.`,\n );\n }\n\n consola.info(`Loading schema from: ${input}`);\n const schema = await loadSchemaModule(input);\n\n consola.info(\"Resolving versioned IR chain...\");\n const { chain, latestVersion } = resolveSchemaChain(\n schema,\n minSupportedVersion,\n {\n name: documentTypeName,\n description: documentTypeDescription,\n },\n maxVersion,\n );\n\n const outputPath = path.resolve(output);\n await fs.ensureDir(path.dirname(outputPath));\n\n const payload = {\n comment: GENERATED_JSON_COMMENT,\n latestVersion,\n ...(minSupportedVersion != null ? { minSupportedVersion } : {}),\n ...(owningApplicationId != null ? { owningApplicationId } : {}),\n chain,\n };\n await fs.writeFile(outputPath, JSON.stringify(payload, null, 2) + \"\\n\", \"utf8\");\n\n consola.success(\n `Wrote IR chain (${chain.length} version(s), min=${\n minSupportedVersion ?? latestVersion\n }, max=${latestVersion}) to: ${outputPath}`,\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,OAAO,QAAQ,SAAS;AACjC,OAAOC,EAAE,MAAM,UAAU;AACzB,OAAOC,IAAI,MAAM,MAAM;AACvB,SAASC,sBAAsB,QAAQ,oCAAoC;AAC3E,SAASC,gBAAgB,QAAQ,wCAAwC;AACzE,SAASC,kBAAkB,QAAQ,0CAA0C;AAuB7E,SAASC,oBAAoBA,CAACC,KAAc,EAAEC,KAAa,EAAEC,UAAkB,EAAU;EACvF,IAAI,OAAOF,KAAK,KAAK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,OAAO,CAACE,MAAM,CAAC,yPAExB,CAAC;EACH;EAEAnB,OAAO,CAACqC,IAAI,CAAC,wBAAwBH,KAAK,EAAE,CAAC;EAC7C,MAAMI,MAAM,GAAG,MAAMlC,gBAAgB,CAAC8B,KAAK,CAAC;EAE5ClC,OAAO,CAACqC,IAAI,CAAC,iCAAiC,CAAC;EAC/C,MAAM;IAAEE,KAAK;IAAEC;EAAc,CAAC,GAAGnC,kBAAkB,CACjDiC,MAAM,EACNf,mBAAmB,EACnB;IACEkB,IAAI,EAAEpB,gBAAgB;IACtBqB,WAAW,EAAEpB;EACf,CAAC,EACDO,UACF,CAAC;EAED,MAAMc,UAAU,GAAGzC,IAAI,CAACe,OAAO,CAACkB,MAAM,CAAC;EACvC,MAAMlC,EAAE,CAAC2C,SAAS,CAAC1C,IAAI,CAAC2C,OAAO,CAACF,UAAU,CAAC,CAAC;EAE5C,MAAMG,OAAO,GAAG;IACdC,OAAO,EAAE5C,sBAAsB;IAC/BqC,aAAa;IACb,IAAIjB,mBAAmB,IAAI,IAAI,GAAG;MAAEA;IAAoB,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/D,IAAII,mBAAmB,IAAI,IAAI,GAAG;MAAEA;IAAoB,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/DY;EACF,CAAC;EACD,MAAMtC,EAAE,CAAC+C,SAAS,CAACL,UAAU,EAAE/B,IAAI,CAACC,SAAS,CAACiC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC;EAE/E9C,OAAO,CAACiD,OAAO,CACb,mBAAmBV,KAAK,CAACW,MAAM,oBAC7B3B,mBAAmB,IAAIiB,aAAa,SAC7BA,aAAa,SAASG,UAAU,EAC3C,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"schemaIrHandler.js","names":["consola","fs","path","GENERATED_JSON_COMMENT","assertSdkNamesUnique","loadSchemaModule","formatSchemaVersion","getEntryMinorVersion","resolveSchemaChain","assertNonEmptyString","value","field","configPath","trim","Error","JSON","stringify","readRequiredNonEmptyString","readPackConfig","resolvedConfigPath","resolve","pathExists","config","readJson","documentTypeName","documentTypeDescription","minSupportedVersion","rawMin","Number","isInteger","owningApplicationId","parseMaxVersion","maxVersion","undefined","match","exec","major","minor","schemaIrHandler","options","input","output","warn","info","schema","chain","latestVersion","name","description","outputPath","ensureDir","dirname","payload","comment","writeFile","latestEntry","length","success","version"],"sources":["schemaIrHandler.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"consola\";\nimport fs from \"fs-extra\";\nimport path from \"path\";\nimport { GENERATED_JSON_COMMENT } from \"../../utils/generatedFileHeader.js\";\nimport { assertSdkNamesUnique } from \"../../utils/schema/assertSdkNamesUnique.js\";\nimport { loadSchemaModule } from \"../../utils/schema/loadSchemaModule.js\";\nimport {\n formatSchemaVersion,\n type FullSchemaVersion,\n getEntryMinorVersion,\n resolveSchemaChain,\n} from \"../../utils/schema/resolveSchemaChain.js\";\n\ninterface SchemaIrOptions {\n input: string;\n output: string;\n config: string;\n maxVersion?: string;\n}\n\ninterface PackConfigLike {\n documentTypeName?: unknown;\n documentTypeDescription?: unknown;\n minSupportedVersion?: unknown;\n owningApplicationId?: unknown;\n}\n\ninterface PackConfigValues {\n readonly documentTypeName: string;\n readonly documentTypeDescription: string;\n readonly minSupportedVersion?: number;\n readonly owningApplicationId?: string;\n}\n\nfunction assertNonEmptyString(value: unknown, field: string, configPath: string): string {\n if (typeof value !== \"string\" || value.trim() === \"\") {\n throw new Error(\n `'${field}' in ${configPath} must be a non-empty string, got: ${JSON.stringify(value)}`,\n );\n }\n return value;\n}\n\nfunction readRequiredNonEmptyString(\n value: unknown,\n field: string,\n configPath: string,\n): string {\n if (value == null) {\n throw new Error(\n `'${field}' is required in ${configPath} and must be a non-empty string`,\n );\n }\n return assertNonEmptyString(value, field, configPath);\n}\n\nexport async function readPackConfig(configPath: string): Promise<PackConfigValues> {\n const resolvedConfigPath = path.resolve(configPath);\n if (!(await fs.pathExists(resolvedConfigPath))) {\n throw new Error(`--config file not found: ${resolvedConfigPath}`);\n }\n const config = (await fs.readJson(resolvedConfigPath)) as PackConfigLike;\n\n const documentTypeName = readRequiredNonEmptyString(\n config.documentTypeName,\n \"documentTypeName\",\n resolvedConfigPath,\n );\n\n const documentTypeDescription = readRequiredNonEmptyString(\n config.documentTypeDescription,\n \"documentTypeDescription\",\n resolvedConfigPath,\n );\n\n let minSupportedVersion: number | undefined;\n const rawMin = config.minSupportedVersion;\n if (rawMin != null) {\n if (typeof rawMin !== \"number\" || !Number.isInteger(rawMin) || rawMin <= 0) {\n throw new Error(\n `'minSupportedVersion' in ${resolvedConfigPath} must be a positive integer, got: ${\n JSON.stringify(rawMin)\n }`,\n );\n }\n minSupportedVersion = rawMin;\n }\n\n let owningApplicationId: string | undefined;\n if (config.owningApplicationId != null) {\n owningApplicationId = assertNonEmptyString(\n config.owningApplicationId,\n \"owningApplicationId\",\n resolvedConfigPath,\n );\n }\n\n return { documentTypeName, documentTypeDescription, minSupportedVersion, owningApplicationId };\n}\n\nfunction parseMaxVersion(maxVersion: string | undefined): FullSchemaVersion | undefined {\n if (maxVersion == null) {\n return undefined;\n }\n\n const match = /^([1-9]\\d*)(?:\\.(0|[1-9]\\d*))?$/.exec(maxVersion);\n if (match == null) {\n throw new Error(\n `--max-version must be a version like 2 or 2.1, got: ${JSON.stringify(maxVersion)}`,\n );\n }\n\n return { major: Number(match[1]), minor: Number(match[2] ?? 0) };\n}\n\n/**\n * Resolve a TypeScript schema module to a versioned IR chain JSON file.\n *\n * The output is a `{ latestVersion, minSupportedVersion?, chain }` payload\n * where each entry is `{ version, minorVersion?, ir, migrations? }` and `ir` is a\n * single-version `IRealTimeDocumentSchema`. This is the input format for\n * `ir gen-types` and `ir asset`.\n *\n * `--config <pack-config.json>` is required: the pack-config is the single\n * source of truth for document-type identity. Required fields:\n * - `documentTypeName`: the document type name embedded into each chain\n * entry's IR (and surfaced as `documentTypeName` by `ir asset`).\n * - `documentTypeDescription`: document type description embedded into each\n * chain entry's IR.\n * Optional fields:\n * - `minSupportedVersion`: declares the oldest version this SDK supports;\n * when set, it must match one of the chain entries' `version` values and is\n * embedded as `minSupportedVersion` in the payload so downstream consumers\n * (`ir gen-types`, `ir asset`) read the same value. Omitting the field is\n * an explicit opt-out: the IR will not include `minSupportedVersion` and\n * downstream tools default to supporting only the latest schema version.\n * - `owningApplicationId`: the application that owns this document type; when\n * set, it is embedded in the payload and surfaced as `owningApplicationId`\n * by `ir asset`.\n *\n * Note: this is distinct from the legacy single-version IR JSON consumed by\n * `ir zod`, which is a bare `IRealTimeDocumentSchema` (no chain, no migrations).\n * Tools that previously read that format should use the `ir` field of the last\n * entry in `chain` (several entries can share a major version, e.g. 3.0 and 3.1).\n */\nexport async function schemaIrHandler(options: SchemaIrOptions): Promise<void> {\n const { input, output, config } = options;\n const maxVersion = parseMaxVersion(options.maxVersion);\n const { documentTypeName, documentTypeDescription, minSupportedVersion, owningApplicationId } =\n await readPackConfig(config);\n\n if (minSupportedVersion == null) {\n consola.warn(\n `--config ${\n path.resolve(config)\n } does not set 'minSupportedVersion'. The generated IR will not include it, so downstream tools (ir gen-types, ir asset) will default to supporting only the latest schema version. Add 'minSupportedVersion' to your pack-config to enable back-compat.`,\n );\n }\n\n consola.info(`Loading schema from: ${input}`);\n const schema = await loadSchemaModule(input);\n\n consola.info(\"Resolving versioned IR chain...\");\n const { chain, latestVersion } = resolveSchemaChain(\n schema,\n minSupportedVersion,\n {\n name: documentTypeName,\n description: documentTypeDescription,\n },\n maxVersion,\n );\n assertSdkNamesUnique(chain, minSupportedVersion);\n\n const outputPath = path.resolve(output);\n await fs.ensureDir(path.dirname(outputPath));\n\n const payload = {\n comment: GENERATED_JSON_COMMENT,\n latestVersion,\n ...(minSupportedVersion != null ? { minSupportedVersion } : {}),\n ...(owningApplicationId != null ? { owningApplicationId } : {}),\n chain,\n };\n await fs.writeFile(outputPath, JSON.stringify(payload, null, 2) + \"\\n\", \"utf8\");\n\n const latestEntry = chain[chain.length - 1]!;\n consola.success(\n `Wrote IR chain (${chain.length} version(s), min=${minSupportedVersion ?? latestVersion}, max=${\n formatSchemaVersion(latestEntry.version, getEntryMinorVersion(latestEntry))\n }) to: ${outputPath}`,\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,OAAO,QAAQ,SAAS;AACjC,OAAOC,EAAE,MAAM,UAAU;AACzB,OAAOC,IAAI,MAAM,MAAM;AACvB,SAASC,sBAAsB,QAAQ,oCAAoC;AAC3E,SAASC,oBAAoB,QAAQ,4CAA4C;AACjF,SAASC,gBAAgB,QAAQ,wCAAwC;AACzE,SACEC,mBAAmB,EAEnBC,oBAAoB,EACpBC,kBAAkB,QACb,0CAA0C;AAuBjD,SAASC,oBAAoBA,CAACC,KAAc,EAAEC,KAAa,EAAEC,UAAkB,EAAU;EACvF,IAAI,OAAOF,KAAK,KAAK,QAAQ,IAAIA,KAAK,CAACG,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE;IACpD,MAAM,IAAIC,KAAK,CACb,IAAIH,KAAK,QAAQC,UAAU,qCAAqCG,IAAI,CAACC,SAAS,CAACN,KAAK,CAAC,EACvF,CAAC;EACH;EACA,OAAOA,KAAK;AACd;AAEA,SAASO,0BAA0BA,CACjCP,KAAc,EACdC,KAAa,EACbC,UAAkB,EACV;EACR,IAAIF,KAAK,IAAI,IAAI,EAAE;IACjB,MAAM,IA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AC;EAE5CxC,OAAO,CAAC2C,IAAI,CAAC,iCAAiC,CAAC;EAC/C,MAAM;IAAEE,KAAK;IAAEC;EAAc,CAAC,GAAGtC,kBAAkB,CACjDoC,MAAM,EACNlB,mBAAmB,EACnB;IACEqB,IAAI,EAAEvB,gBAAgB;IACtBwB,WAAW,EAAEvB;EACf,CAAC,EACDO,UACF,CAAC;EACD5B,oBAAoB,CAACyC,KAAK,EAAEnB,mBAAmB,CAAC;EAEhD,MAAMuB,UAAU,GAAG/C,IAAI,CAACkB,OAAO,CAACqB,MAAM,CAAC;EACvC,MAAMxC,EAAE,CAACiD,SAAS,CAAChD,IAAI,CAACiD,OAAO,CAACF,UAAU,CAAC,CAAC;EAE5C,MAAMG,OAAO,GAAG;IACdC,OAAO,EAAElD,sBAAsB;IAC/B2C,aAAa;IACb,IAAIpB,mBAAmB,IAAI,IAAI,GAAG;MAAEA;IAAoB,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/D,IAAII,mBAAmB,IAAI,IAAI,GAAG;MAAEA;IAAoB,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/De;EACF,CAAC;EACD,MAAM5C,EAAE,CAACqD,SAAS,CAACL,UAAU,EAAElC,IAAI,CAACC,SAAS,CAACoC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC;EAE/E,MAAMG,WAAW,GAAGV,KAAK,CAACA,KAAK,CAACW,MAAM,GAAG,CAAC,CAAE;EAC5CxD,OAAO,CAACyD,OAAO,CACb,mBAAmBZ,KAAK,CAACW,MAAM,oBAAoB9B,mBAAmB,IAAIoB,aAAa,SACrFxC,mBAAmB,CAACiD,WAAW,CAACG,OAAO,EAAEnD,oBAAoB,CAACgD,WAAW,CAAC,CAAC,SACpEN,UAAU,EACrB,CAAC;AACH","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"schemaMeta.js","names":[],"sources":["schemaMeta.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 { ISchemaVersion } from \"../pack-docschema-api/schemaVersion.js\";\nexport interface ISchemaMeta {\n readonly \"addedInVersion\": ISchemaVersion;\n readonly \"deprecatedFromVersion\"?: ISchemaVersion | null;\n readonly \"deprecatedMessage\"?: string | null;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"schemaMeta.js","names":[],"sources":["schemaMeta.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 { ISchemaVersion } from \"../pack-docschema-api/schemaVersion.js\";\nexport interface ISchemaMeta {\n readonly \"addedInVersion\": ISchemaVersion;\n readonly \"addedInMinorVersion\"?: number | null;\n readonly \"deprecatedFromVersion\"?: ISchemaVersion | null;\n readonly \"deprecatedMessage\"?: string | null;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"unionDef.js","names":[],"sources":["unionDef.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 { IFieldKey } from \"../pack-docschema-api/fieldKey.js\";\nimport type { IModelTypeKey } from \"../pack-docschema-api/modelTypeKey.js\";\nimport type { IUnionVariantKey } from \"../pack-docschema-api/unionVariantKey.js\";\nimport type { ISchemaMeta } from \"./schemaMeta.js\";\nexport interface IUnionDef {\n readonly \"key\": IModelTypeKey;\n readonly \"discriminant\": IFieldKey;\n readonly \"name\": string;\n readonly \"description\"?: string | null;\n readonly \"variants\": {\n readonly [key: IUnionVariantKey]: IModelTypeKey;\n };\n readonly \"metadata\": ISchemaMeta;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"unionDef.js","names":[],"sources":["unionDef.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 { IFieldKey } from \"../pack-docschema-api/fieldKey.js\";\nimport type { IModelTypeKey } from \"../pack-docschema-api/modelTypeKey.js\";\nimport type { IUnionVariantKey } from \"../pack-docschema-api/unionVariantKey.js\";\nimport type { ISchemaMeta } from \"./schemaMeta.js\";\nexport interface IUnionDef {\n readonly \"key\": IModelTypeKey;\n readonly \"discriminant\": IFieldKey;\n readonly \"name\": string;\n readonly \"description\"?: string | null;\n readonly \"variants\": {\n readonly [key: IUnionVariantKey]: IModelTypeKey;\n };\n readonly \"metadata\": ISchemaMeta;\n readonly \"variantMetadata\"?: {\n readonly [key: IUnionVariantKey]: ISchemaMeta;\n } | null;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- /* Generated by @palantir/pack.document-schema.type-gen@0.32.0 */
1
+ /* Generated by @palantir/pack.document-schema.type-gen@0.34.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.32.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.34.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.32.0 */
1
+ /* Generated by @palantir/pack.document-schema.type-gen@0.34.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","resourceRef","name","DocumentModel","Event","version"],"sources":["external-refs.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.32.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 resourceRef: 'resourceRef',\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,SAAS;MAClBC,WAAW,EAAE;IACf,CAAC;IACDC,IAAI,EAAE;EACR;AACF,CAAC;AAED,OAAO,MAAMC,aAAa,GAAG;EAC3BC,KAAK,EAAET,UAAU;EACjB,CAACF,QAAQ,GAAG;IACVY,OAAO,EAAE;EACX;AACF,CAAmC","ignoreList":[]}
1
+ {"version":3,"file":"external-refs.js","names":["Metadata","EventSchema","EventModel","__type","zodSchema","externalRefFieldTypes","documentRef","userRef","resourceRef","name","DocumentModel","Event","version"],"sources":["external-refs.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.34.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 resourceRef: 'resourceRef',\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,SAAS;MAClBC,WAAW,EAAE;IACf,CAAC;IACDC,IAAI,EAAE;EACR;AACF,CAAC;AAED,OAAO,MAAMC,aAAa,GAAG;EAC3BC,KAAK,EAAET,UAAU;EACjB,CAACF,QAAQ,GAAG;IACVY,OAAO,EAAE;EACX;AACF,CAAmC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- /* Generated by @palantir/pack.document-schema.type-gen@0.32.0 */
1
+ /* Generated by @palantir/pack.document-schema.type-gen@0.34.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.32.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.34.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.32.0 */
1
+ /* Generated by @palantir/pack.document-schema.type-gen@0.34.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.32.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.34.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.32.0 */
1
+ /* Generated by @palantir/pack.document-schema.type-gen@0.34.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.32.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.34.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.32.0 */
1
+ /* Generated by @palantir/pack.document-schema.type-gen@0.34.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.32.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.34.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.32.0 */
1
+ /* Generated by @palantir/pack.document-schema.type-gen@0.34.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.32.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.34.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.32.0 */
1
+ /* Generated by @palantir/pack.document-schema.type-gen@0.34.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.32.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.34.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.32.0 */
1
+ /* Generated by @palantir/pack.document-schema.type-gen@0.34.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.32.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.34.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.32.0 */
1
+ /* Generated by @palantir/pack.document-schema.type-gen@0.34.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.32.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.34.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.32.0 */
1
+ /* Generated by @palantir/pack.document-schema.type-gen@0.34.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.32.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.34.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":[]}