@palantir/pack.document-schema.type-gen 0.32.0 → 0.33.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 (122) hide show
  1. package/README.md +7 -0
  2. package/build/esm/commands/ir/__tests__/irUpdateSchemaHandler.test.js +96 -0
  3. package/build/esm/commands/ir/__tests__/irUpdateSchemaHandler.test.js.map +1 -0
  4. package/build/esm/commands/ir/__tests__/resolveIrInput.test.js +80 -0
  5. package/build/esm/commands/ir/__tests__/resolveIrInput.test.js.map +1 -1
  6. package/build/esm/commands/ir/irDeployHandler.js +5 -0
  7. package/build/esm/commands/ir/irDeployHandler.js.map +1 -1
  8. package/build/esm/commands/ir/irGenAssetHandler.js +6 -1
  9. package/build/esm/commands/ir/irGenAssetHandler.js.map +1 -1
  10. package/build/esm/commands/ir/irGenTypesHandler.js +7 -3
  11. package/build/esm/commands/ir/irGenTypesHandler.js.map +1 -1
  12. package/build/esm/commands/ir/irUpdateSchemaHandler.js +18 -11
  13. package/build/esm/commands/ir/irUpdateSchemaHandler.js.map +1 -1
  14. package/build/esm/commands/ir/resolveIrInput.js +6 -5
  15. package/build/esm/commands/ir/resolveIrInput.js.map +1 -1
  16. package/build/esm/commands/schema/registerSchemaCommands.js +1 -1
  17. package/build/esm/commands/schema/registerSchemaCommands.js.map +1 -1
  18. package/build/esm/commands/schema/schemaIrHandler.js +15 -8
  19. package/build/esm/commands/schema/schemaIrHandler.js.map +1 -1
  20. package/build/esm/lib/pack-docschema-api/pack-docschema-ir/schemaMeta.js.map +1 -1
  21. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/custom-discriminant.js +1 -1
  22. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/custom-discriminant.js.map +1 -1
  23. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/external-refs.js +1 -1
  24. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/external-refs.js.map +1 -1
  25. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/simple-record.js +1 -1
  26. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/simple-record.js.map +1 -1
  27. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/union-types.js +1 -1
  28. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/union-types.js.map +1 -1
  29. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/array-and-map-types.js +1 -1
  30. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/array-and-map-types.js.map +1 -1
  31. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/boolean-fields.js +1 -1
  32. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/boolean-fields.js.map +1 -1
  33. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/custom-discriminant.js +1 -1
  34. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/custom-discriminant.js.map +1 -1
  35. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/datetime-fields.js +1 -1
  36. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/datetime-fields.js.map +1 -1
  37. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/simple-records.js +1 -1
  38. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/simple-records.js.map +1 -1
  39. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/union-before-records.js +1 -1
  40. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/union-before-records.js.map +1 -1
  41. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/union-types.js +1 -1
  42. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/union-types.js.map +1 -1
  43. package/build/esm/utils/ir/__tests__/convertIrToWireSchema.test.js +35 -0
  44. package/build/esm/utils/ir/__tests__/convertIrToWireSchema.test.js.map +1 -1
  45. package/build/esm/utils/ir/convertIrToWireSchema.js +1 -0
  46. package/build/esm/utils/ir/convertIrToWireSchema.js.map +1 -1
  47. package/build/esm/utils/schema/__tests__/__snapshots__/generateDocumentTypeFromSchema/with-name-and-description.js +1 -1
  48. package/build/esm/utils/schema/__tests__/__snapshots__/generateDocumentTypeFromSchema/with-name-and-description.js.map +1 -1
  49. package/build/esm/utils/schema/__tests__/__snapshots__/generateVersionsFromSchema/single-version.js.map +1 -1
  50. package/build/esm/utils/schema/__tests__/__snapshots__/generateVersionsFromSchema/three-version-chain.js.map +1 -1
  51. package/build/esm/utils/schema/__tests__/__snapshots__/generateVersionsFromSchema/two-version.js.map +1 -1
  52. package/build/esm/utils/schema/__tests__/assertSdkNamesUnique.test.js +178 -0
  53. package/build/esm/utils/schema/__tests__/assertSdkNamesUnique.test.js.map +1 -0
  54. package/build/esm/utils/schema/__tests__/generateInternalFromSchema.test.js +40 -1
  55. package/build/esm/utils/schema/__tests__/generateInternalFromSchema.test.js.map +1 -1
  56. package/build/esm/utils/schema/__tests__/resolveSchemaChain.test.js +75 -3
  57. package/build/esm/utils/schema/__tests__/resolveSchemaChain.test.js.map +1 -1
  58. package/build/esm/utils/schema/assertSdkNamesUnique.js +151 -0
  59. package/build/esm/utils/schema/assertSdkNamesUnique.js.map +1 -0
  60. package/build/esm/utils/schema/generateIndexFromSchema.js +3 -5
  61. package/build/esm/utils/schema/generateIndexFromSchema.js.map +1 -1
  62. package/build/esm/utils/schema/generateInternalFromSchema.js +35 -19
  63. package/build/esm/utils/schema/generateInternalFromSchema.js.map +1 -1
  64. package/build/esm/utils/schema/generateModelMetadataFromSchema.js +9 -11
  65. package/build/esm/utils/schema/generateModelMetadataFromSchema.js.map +1 -1
  66. package/build/esm/utils/schema/generateScopeFromSchema.js +6 -9
  67. package/build/esm/utils/schema/generateScopeFromSchema.js.map +1 -1
  68. package/build/esm/utils/schema/generateVersionedTypesFromSchema.js +8 -9
  69. package/build/esm/utils/schema/generateVersionedTypesFromSchema.js.map +1 -1
  70. package/build/esm/utils/schema/generateVersionedZodFromSchema.js +13 -16
  71. package/build/esm/utils/schema/generateVersionedZodFromSchema.js.map +1 -1
  72. package/build/esm/utils/schema/resolveSchemaChain.js +108 -20
  73. package/build/esm/utils/schema/resolveSchemaChain.js.map +1 -1
  74. package/build/esm/utils/schema/runtimeSchema.js +47 -0
  75. package/build/esm/utils/schema/runtimeSchema.js.map +1 -1
  76. package/build/esm/utils/schema/writeAllSdkFiles.js +2 -0
  77. package/build/esm/utils/schema/writeAllSdkFiles.js.map +1 -1
  78. package/build/esm/utils/steps/__tests__/__snapshots__/types/arrayFields.js.map +1 -1
  79. package/build/esm/utils/steps/__tests__/__snapshots__/types/customDiscriminant.js +1 -1
  80. package/build/esm/utils/steps/__tests__/__snapshots__/types/customDiscriminant.js.map +1 -1
  81. package/build/esm/utils/steps/__tests__/__snapshots__/types/generateTypeScriptInterfaces.js +1 -1
  82. package/build/esm/utils/steps/__tests__/__snapshots__/types/generateTypeScriptInterfaces.js.map +1 -1
  83. package/build/esm/utils/steps/__tests__/__snapshots__/types/refTypes.js.map +1 -1
  84. package/build/esm/utils/steps/__tests__/__snapshots__/types/simpleRecord.js.map +1 -1
  85. package/build/esm/utils/steps/__tests__/__snapshots__/types/simpleSteps.js +1 -1
  86. package/build/esm/utils/steps/__tests__/__snapshots__/types/simpleSteps.js.map +1 -1
  87. package/build/esm/utils/steps/convertStepsToIr.js +10 -1
  88. package/build/esm/utils/steps/convertStepsToIr.js.map +1 -1
  89. package/build/types/commands/ir/__tests__/irUpdateSchemaHandler.test.d.ts +2 -0
  90. package/build/types/commands/ir/__tests__/irUpdateSchemaHandler.test.d.ts.map +1 -0
  91. package/build/types/commands/ir/irDeployHandler.d.ts.map +1 -1
  92. package/build/types/commands/ir/irGenAssetHandler.d.ts.map +1 -1
  93. package/build/types/commands/ir/irGenTypesHandler.d.ts.map +1 -1
  94. package/build/types/commands/ir/irUpdateSchemaHandler.d.ts.map +1 -1
  95. package/build/types/commands/ir/resolveIrInput.d.ts +1 -0
  96. package/build/types/commands/ir/resolveIrInput.d.ts.map +1 -1
  97. package/build/types/commands/schema/schemaIrHandler.d.ts +3 -3
  98. package/build/types/commands/schema/schemaIrHandler.d.ts.map +1 -1
  99. package/build/types/lib/pack-docschema-api/pack-docschema-ir/schemaMeta.d.ts +1 -0
  100. package/build/types/lib/pack-docschema-api/pack-docschema-ir/schemaMeta.d.ts.map +1 -1
  101. package/build/types/utils/schema/__tests__/assertSdkNamesUnique.test.d.ts +2 -0
  102. package/build/types/utils/schema/__tests__/assertSdkNamesUnique.test.d.ts.map +1 -0
  103. package/build/types/utils/schema/assertSdkNamesUnique.d.ts +9 -0
  104. package/build/types/utils/schema/assertSdkNamesUnique.d.ts.map +1 -0
  105. package/build/types/utils/schema/generateIndexFromSchema.d.ts.map +1 -1
  106. package/build/types/utils/schema/generateInternalFromSchema.d.ts.map +1 -1
  107. package/build/types/utils/schema/generateModelMetadataFromSchema.d.ts.map +1 -1
  108. package/build/types/utils/schema/generateScopeFromSchema.d.ts.map +1 -1
  109. package/build/types/utils/schema/generateVersionedTypesFromSchema.d.ts.map +1 -1
  110. package/build/types/utils/schema/generateVersionedZodFromSchema.d.ts.map +1 -1
  111. package/build/types/utils/schema/resolveSchemaChain.d.ts +24 -1
  112. package/build/types/utils/schema/resolveSchemaChain.d.ts.map +1 -1
  113. package/build/types/utils/schema/runtimeSchema.d.ts +19 -0
  114. package/build/types/utils/schema/runtimeSchema.d.ts.map +1 -1
  115. package/build/types/utils/schema/writeAllSdkFiles.d.ts.map +1 -1
  116. package/build/types/utils/steps/convertStepsToIr.d.ts +2 -0
  117. package/build/types/utils/steps/convertStepsToIr.d.ts.map +1 -1
  118. package/package.json +5 -5
  119. package/build/esm/utils/unknownVariantSuffix.js +0 -22
  120. package/build/esm/utils/unknownVariantSuffix.js.map +0 -1
  121. package/build/types/utils/unknownVariantSuffix.d.ts +0 -3
  122. package/build/types/utils/unknownVariantSuffix.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"writeAllSdkFiles.js","names":["consola","fs","path","generateDocumentTypeFromChain","generateIndexFromChain","generateInternalFromChain","generateModelMetadataFromChain","generateScopeFromChain","generateVersionedTypesFromChain","generateVersionedZodFromChain","generateVersionsFromChain","writeAllSdkFiles","resolved","outputDir","minSupportedVersion","ensureDir","info","types","version","content","readTypes","filePath","join","writeFile","success","writeTypes","typesPath","typesReExport","zod","zodSchemas","schemaPath","schemaReExport","internal","internalDir","internalTypes","upgrades","internalSchema","internalUpgradeFns","versionsContent","versionsPath","indexContent","indexPath","modelMetadata","modelsPath","modelsFile","versionedDocRefContent","versionedDocRefPath","documentTypeContent","documentTypePath"],"sources":["writeAllSdkFiles.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 { generateDocumentTypeFromChain } from \"./generateDocumentTypeFromSchema.js\";\nimport { generateIndexFromChain } from \"./generateIndexFromSchema.js\";\nimport { generateInternalFromChain } from \"./generateInternalFromSchema.js\";\nimport { generateModelMetadataFromChain } from \"./generateModelMetadataFromSchema.js\";\nimport { generateScopeFromChain } from \"./generateScopeFromSchema.js\";\nimport { generateVersionedTypesFromChain } from \"./generateVersionedTypesFromSchema.js\";\nimport { generateVersionedZodFromChain } from \"./generateVersionedZodFromSchema.js\";\nimport { generateVersionsFromChain } from \"./generateVersionsFromSchema.js\";\nimport type { ResolvedIrChain } from \"./resolveSchemaChain.js\";\n\n/**\n * Generate every versioned SDK output file from a resolved IR chain and write\n * them to `outputDir`.\n */\nexport async function writeAllSdkFiles(\n resolved: ResolvedIrChain,\n outputDir: string,\n minSupportedVersion: number | undefined,\n): Promise<void> {\n await fs.ensureDir(outputDir);\n\n // Versioned types\n consola.info(\"Generating versioned types...\");\n const types = generateVersionedTypesFromChain(resolved, minSupportedVersion);\n for (const [version, content] of types.readTypes) {\n const filePath = path.join(outputDir, `types_v${version}.ts`);\n await fs.writeFile(filePath, content, \"utf8\");\n consola.success(`Generated read types: ${filePath}`);\n }\n for (const [version, content] of types.writeTypes) {\n const filePath = path.join(outputDir, `writeTypes_v${version}.ts`);\n await fs.writeFile(filePath, content, \"utf8\");\n consola.success(`Generated write types: ${filePath}`);\n }\n const typesPath = path.join(outputDir, \"types.ts\");\n await fs.writeFile(typesPath, types.typesReExport, \"utf8\");\n consola.success(`Generated types re-export: ${typesPath}`);\n\n // Versioned Zod\n consola.info(\"Generating versioned Zod schemas...\");\n const zod = generateVersionedZodFromChain(resolved, minSupportedVersion);\n for (const [version, content] of zod.zodSchemas) {\n const filePath = path.join(outputDir, `schema_v${version}.ts`);\n await fs.writeFile(filePath, content, \"utf8\");\n consola.success(`Generated Zod schema: ${filePath}`);\n }\n const schemaPath = path.join(outputDir, \"schema.ts\");\n await fs.writeFile(schemaPath, zod.schemaReExport, \"utf8\");\n consola.success(`Generated schema re-export: ${schemaPath}`);\n\n // Internal\n consola.info(\"Generating internal types and upgrades...\");\n const internal = generateInternalFromChain(resolved);\n const internalDir = path.join(outputDir, \"_internal\");\n await fs.ensureDir(internalDir);\n await fs.writeFile(path.join(internalDir, \"types.ts\"), internal.internalTypes, \"utf8\");\n consola.success(`Generated internal types: ${path.join(internalDir, \"types.ts\")}`);\n await fs.writeFile(path.join(internalDir, \"upgrades.ts\"), internal.upgrades, \"utf8\");\n consola.success(`Generated upgrades: ${path.join(internalDir, \"upgrades.ts\")}`);\n await fs.writeFile(path.join(internalDir, \"schema.ts\"), internal.internalSchema, \"utf8\");\n consola.success(`Generated internal schema: ${path.join(internalDir, \"schema.ts\")}`);\n await fs.writeFile(path.join(internalDir, \"upgradeFns.ts\"), internal.internalUpgradeFns, \"utf8\");\n consola.success(`Generated upgrade functions: ${path.join(internalDir, \"upgradeFns.ts\")}`);\n\n // versions.ts\n consola.info(\"Generating version types...\");\n const versionsContent = generateVersionsFromChain(resolved, minSupportedVersion);\n const versionsPath = path.join(outputDir, \"versions.ts\");\n await fs.writeFile(versionsPath, versionsContent, \"utf8\");\n consola.success(`Generated versions: ${versionsPath}`);\n\n // index.ts\n consola.info(\"Generating index barrel export...\");\n const indexContent = generateIndexFromChain(resolved, minSupportedVersion);\n const indexPath = path.join(outputDir, \"index.ts\");\n await fs.writeFile(indexPath, indexContent, \"utf8\");\n consola.success(`Generated index: ${indexPath}`);\n\n // models.ts\n consola.info(\"Generating model metadata...\");\n const modelMetadata = generateModelMetadataFromChain(resolved, minSupportedVersion);\n const modelsPath = path.join(outputDir, \"models.ts\");\n await fs.writeFile(modelsPath, modelMetadata.modelsFile, \"utf8\");\n consola.success(`Generated models: ${modelsPath}`);\n\n // versionedDocRef.ts\n consola.info(\"Generating versioned document ref types...\");\n const versionedDocRefContent = generateScopeFromChain(resolved, minSupportedVersion);\n const versionedDocRefPath = path.join(outputDir, \"versionedDocRef.ts\");\n await fs.writeFile(versionedDocRefPath, versionedDocRefContent, \"utf8\");\n consola.success(`Generated versioned doc ref: ${versionedDocRefPath}`);\n\n // documentType.ts\n consola.info(\"Generating document type identity constants...\");\n const documentTypeContent = generateDocumentTypeFromChain(resolved);\n const documentTypePath = path.join(outputDir, \"documentType.ts\");\n await fs.writeFile(documentTypePath, documentTypeContent, \"utf8\");\n consola.success(`Generated document type: ${documentTypePath}`);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,OAAO,QAAQ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gBAAgB,GAAG9C,IAAI,CAACoB,IAAI,CAACT,SAAS,EAAE,iBAAiB,CAAC;EAChE,MAAMZ,EAAE,CAACsB,SAAS,CAACyB,gBAAgB,EAAED,mBAAmB,EAAE,MAAM,CAAC;EACjE/C,OAAO,CAACwB,OAAO,CAAC,4BAA4BwB,gBAAgB,EAAE,CAAC;AACjE","ignoreList":[]}
1
+ {"version":3,"file":"writeAllSdkFiles.js","names":["consola","fs","path","assertSdkNamesUnique","generateDocumentTypeFromChain","generateIndexFromChain","generateInternalFromChain","generateModelMetadataFromChain","generateScopeFromChain","generateVersionedTypesFromChain","generateVersionedZodFromChain","generateVersionsFromChain","writeAllSdkFiles","resolved","outputDir","minSupportedVersion","chain","ensureDir","info","types","version","content","readTypes","filePath","join","writeFile","success","writeTypes","typesPath","typesReExport","zod","zodSchemas","schemaPath","schemaReExport","internal","internalDir","internalTypes","upgrades","internalSchema","internalUpgradeFns","versionsContent","versionsPath","indexContent","indexPath","modelMetadata","modelsPath","modelsFile","versionedDocRefContent","versionedDocRefPath","documentTypeContent","documentTypePath"],"sources":["writeAllSdkFiles.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 { assertSdkNamesUnique } from \"./assertSdkNamesUnique.js\";\nimport { generateDocumentTypeFromChain } from \"./generateDocumentTypeFromSchema.js\";\nimport { generateIndexFromChain } from \"./generateIndexFromSchema.js\";\nimport { generateInternalFromChain } from \"./generateInternalFromSchema.js\";\nimport { generateModelMetadataFromChain } from \"./generateModelMetadataFromSchema.js\";\nimport { generateScopeFromChain } from \"./generateScopeFromSchema.js\";\nimport { generateVersionedTypesFromChain } from \"./generateVersionedTypesFromSchema.js\";\nimport { generateVersionedZodFromChain } from \"./generateVersionedZodFromSchema.js\";\nimport { generateVersionsFromChain } from \"./generateVersionsFromSchema.js\";\nimport type { ResolvedIrChain } from \"./resolveSchemaChain.js\";\n\n/**\n * Generate every versioned SDK output file from a resolved IR chain and write\n * them to `outputDir`.\n */\nexport async function writeAllSdkFiles(\n resolved: ResolvedIrChain,\n outputDir: string,\n minSupportedVersion: number | undefined,\n): Promise<void> {\n assertSdkNamesUnique(resolved.chain, minSupportedVersion);\n await fs.ensureDir(outputDir);\n\n // Versioned types\n consola.info(\"Generating versioned types...\");\n const types = generateVersionedTypesFromChain(resolved, minSupportedVersion);\n for (const [version, content] of types.readTypes) {\n const filePath = path.join(outputDir, `types_v${version}.ts`);\n await fs.writeFile(filePath, content, \"utf8\");\n consola.success(`Generated read types: ${filePath}`);\n }\n for (const [version, content] of types.writeTypes) {\n const filePath = path.join(outputDir, `writeTypes_v${version}.ts`);\n await fs.writeFile(filePath, content, \"utf8\");\n consola.success(`Generated write types: ${filePath}`);\n }\n const typesPath = path.join(outputDir, \"types.ts\");\n await fs.writeFile(typesPath, types.typesReExport, \"utf8\");\n consola.success(`Generated types re-export: ${typesPath}`);\n\n // Versioned Zod\n consola.info(\"Generating versioned Zod schemas...\");\n const zod = generateVersionedZodFromChain(resolved, minSupportedVersion);\n for (const [version, content] of zod.zodSchemas) {\n const filePath = path.join(outputDir, `schema_v${version}.ts`);\n await fs.writeFile(filePath, content, \"utf8\");\n consola.success(`Generated Zod schema: ${filePath}`);\n }\n const schemaPath = path.join(outputDir, \"schema.ts\");\n await fs.writeFile(schemaPath, zod.schemaReExport, \"utf8\");\n consola.success(`Generated schema re-export: ${schemaPath}`);\n\n // Internal\n consola.info(\"Generating internal types and upgrades...\");\n const internal = generateInternalFromChain(resolved);\n const internalDir = path.join(outputDir, \"_internal\");\n await fs.ensureDir(internalDir);\n await fs.writeFile(path.join(internalDir, \"types.ts\"), internal.internalTypes, \"utf8\");\n consola.success(`Generated internal types: ${path.join(internalDir, \"types.ts\")}`);\n await fs.writeFile(path.join(internalDir, \"upgrades.ts\"), internal.upgrades, \"utf8\");\n consola.success(`Generated upgrades: ${path.join(internalDir, \"upgrades.ts\")}`);\n await fs.writeFile(path.join(internalDir, \"schema.ts\"), internal.internalSchema, \"utf8\");\n consola.success(`Generated internal schema: ${path.join(internalDir, \"schema.ts\")}`);\n await fs.writeFile(path.join(internalDir, \"upgradeFns.ts\"), internal.internalUpgradeFns, \"utf8\");\n consola.success(`Generated upgrade functions: ${path.join(internalDir, \"upgradeFns.ts\")}`);\n\n // versions.ts\n consola.info(\"Generating version types...\");\n const versionsContent = generateVersionsFromChain(resolved, minSupportedVersion);\n const versionsPath = path.join(outputDir, \"versions.ts\");\n await fs.writeFile(versionsPath, versionsContent, \"utf8\");\n consola.success(`Generated versions: ${versionsPath}`);\n\n // index.ts\n consola.info(\"Generating index barrel export...\");\n const indexContent = generateIndexFromChain(resolved, minSupportedVersion);\n const indexPath = path.join(outputDir, \"index.ts\");\n await fs.writeFile(indexPath, indexContent, \"utf8\");\n consola.success(`Generated index: ${indexPath}`);\n\n // models.ts\n consola.info(\"Generating model metadata...\");\n const modelMetadata = generateModelMetadataFromChain(resolved, minSupportedVersion);\n const modelsPath = path.join(outputDir, \"models.ts\");\n await fs.writeFile(modelsPath, modelMetadata.modelsFile, \"utf8\");\n consola.success(`Generated models: ${modelsPath}`);\n\n // versionedDocRef.ts\n consola.info(\"Generating versioned document ref types...\");\n const versionedDocRefContent = generateScopeFromChain(resolved, minSupportedVersion);\n const versionedDocRefPath = path.join(outputDir, \"versionedDocRef.ts\");\n await fs.writeFile(versionedDocRefPath, versionedDocRefContent, \"utf8\");\n consola.success(`Generated versioned doc ref: ${versionedDocRefPath}`);\n\n // documentType.ts\n consola.info(\"Generating document type identity constants...\");\n const documentTypeContent = generateDocumentTypeFromChain(resolved);\n const documentTypePath = path.join(outputDir, \"documentType.ts\");\n await fs.writeFile(documentTypePath, documentTypeContent, \"utf8\");\n consola.success(`Generated document type: ${documentTypePath}`);\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,oBAAoB,QAAQ,2BAA2B;AAChE,SAASC,6BAA6B,QAAQ,qCAAqC;AACnF,SAASC,sBAAsB,QAAQ,8BAA8B;AACrE,SAASC,yBAAyB,QAAQ,iCAAiC;AAC3E,SAASC,8BAA8B,QAAQ,sCAAsC;AACrF,SAASC,sBAAsB,QAAQ,8BAA8B;AACrE,SAASC,+BAA+B,QAAQ,uCAAuC;AACvF,SAASC,6BAA6B,QAAQ,qCAAqC;AACnF,SAASC,yBAAyB,QAAQ,iCAAiC;AAG3E;AACA;AACA;AACA;AACA,OAAO,eAAeC,gBAAgBA,CACpCC,QAAyB,EACzBC,SAAiB,EACjBC,mBAAuC,EACxB;EACfZ,oBAAoB,CAACU,QAAQ,CAACG,KAAK,EAAED,mBAAmB,CAAC;EACzD,MAAMd,EAAE,CAACgB,SAAS,CAACH,SAAS,CAAC;;EAE7B;EACAd,OAAO,CAACkB,IAAI,CAAC,+BAA+B,CAAC;EAC7C,MAAMC,KAAK,GAAGV,+BAA+B,CAACI,QAAQ,EAAEE,mBAAmB,CAAC;EAC5E,KAAK,MAAM,CAACK,OAAO,EAAEC,OAAO,CAAC,IAAIF,KAAK,CAACG,SAAS,EAAE;IAChD,MAAMC,QAAQ,GAAGrB,IAAI,CAACsB,IAAI,CAACV,SAAS,EAAE,UAAUM,OAAO,KAAK,CAAC;IAC7D,MAAMnB,EAAE,CAACwB,SAAS,CAACF,QAAQ,EAAEF,OA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,mBAAmB,CAAC;EACpF,MAAMiC,mBAAmB,GAAG9C,IAAI,CAACsB,IAAI,CAACV,SAAS,EAAE,oBAAoB,CAAC;EACtE,MAAMb,EAAE,CAACwB,SAAS,CAACuB,mBAAmB,EAAED,sBAAsB,EAAE,MAAM,CAAC;EACvE/C,OAAO,CAAC0B,OAAO,CAAC,gCAAgCsB,mBAAmB,EAAE,CAAC;;EAEtE;EACAhD,OAAO,CAACkB,IAAI,CAAC,gDAAgD,CAAC;EAC9D,MAAM+B,mBAAmB,GAAG7C,6BAA6B,CAACS,QAAQ,CAAC;EACnE,MAAMqC,gBAAgB,GAAGhD,IAAI,CAACsB,IAAI,CAACV,SAAS,EAAE,iBAAiB,CAAC;EAChE,MAAMb,EAAE,CAACwB,SAAS,CAACyB,gBAAgB,EAAED,mBAAmB,EAAE,MAAM,CAAC;EACjEjD,OAAO,CAAC0B,OAAO,CAAC,4BAA4BwB,gBAAgB,EAAE,CAAC;AACjE","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"arrayFields.js","names":[],"sources":["arrayFields.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.32.0 */\n\n\nexport interface Container {\n readonly items: readonly string[];\n readonly numbers: readonly number[];\n}\n\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"arrayFields.js","names":[],"sources":["arrayFields.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.33.0 */\n\n\nexport interface Container {\n readonly items: readonly string[];\n readonly numbers: readonly number[];\n}\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.33.0 */
2
2
 
3
3
  /**
4
4
  * A cat
@@ -1 +1 @@
1
- {"version":3,"file":"customDiscriminant.js","names":["isAnimalCat","value","kind","isAnimalDog"],"sources":["customDiscriminant.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.32.0 */\n\n\n/**\n * A cat\n */\nexport interface Cat {\n readonly meow: string;\n readonly whiskers: number;\n}\n\n/**\n * A dog\n */\nexport interface Dog {\n readonly bark: string;\n readonly tailWags: number;\n}\n\nexport interface AnimalCat extends Cat {\n readonly kind: \"cat\";\n}\n\nexport interface AnimalDog extends Dog {\n readonly kind: \"dog\";\n}\n\nexport type Animal = AnimalCat | AnimalDog;\n\nexport function isAnimalCat(value: Animal): value is AnimalCat {\n return value.kind === \"cat\";\n}\n\nexport function isAnimalDog(value: Animal): value is AnimalDog {\n return value.kind === \"dog\";\n}\n\n"],"mappings":"AAAA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;;AAgBA,OAAO,SAASA,WAAWA,CAACC,KAAa,EAAsB;EAC7D,OAAOA,KAAK,CAACC,IAAI,KAAK,KAAK;AAC7B;AAEA,OAAO,SAASC,WAAWA,CAACF,KAAa,EAAsB;EAC7D,OAAOA,KAAK,CAACC,IAAI,KAAK,KAAK;AAC7B","ignoreList":[]}
1
+ {"version":3,"file":"customDiscriminant.js","names":["isAnimalCat","value","kind","isAnimalDog"],"sources":["customDiscriminant.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.33.0 */\n\n\n/**\n * A cat\n */\nexport interface Cat {\n readonly meow: string;\n readonly whiskers: number;\n}\n\n/**\n * A dog\n */\nexport interface Dog {\n readonly bark: string;\n readonly tailWags: number;\n}\n\nexport interface AnimalCat extends Cat {\n readonly kind: \"cat\";\n}\n\nexport interface AnimalDog extends Dog {\n readonly kind: \"dog\";\n}\n\nexport type Animal = AnimalCat | AnimalDog;\n\nexport function isAnimalCat(value: Animal): value is AnimalCat {\n return value.kind === \"cat\";\n}\n\nexport function isAnimalDog(value: Animal): value is AnimalDog {\n return value.kind === \"dog\";\n}\n\n"],"mappings":"AAAA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;;AAgBA,OAAO,SAASA,WAAWA,CAACC,KAAa,EAAsB;EAC7D,OAAOA,KAAK,CAACC,IAAI,KAAK,KAAK;AAC7B;AAEA,OAAO,SAASC,WAAWA,CAACF,KAAa,EAAsB;EAC7D,OAAOA,KAAK,CAACC,IAAI,KAAK,KAAK;AAC7B","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.33.0 */
2
2
 
3
3
  /**
4
4
  * Represents an edge in a graph
@@ -1 +1 @@
1
- {"version":3,"file":"generateTypeScriptInterfaces.js","names":["isNodeObject","value","type","isNodeTextBox"],"sources":["generateTypeScriptInterfaces.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.32.0 */\n\n\n/**\n * Represents an edge in a graph\n */\nexport interface Edge {\n readonly source: ObjectNode;\n readonly target: ObjectNode;\n}\n\nexport interface ObjectNode {\n readonly x: number;\n readonly y: number;\n readonly label?: string;\n readonly color?: string;\n}\n\n/**\n * Represents a text box in a graph\n */\nexport interface TextBox {\n readonly x: number;\n readonly y: number;\n readonly text: string;\n}\n\nexport interface NodeObject extends ObjectNode {\n readonly type: \"object\";\n}\n\nexport interface NodeTextBox extends TextBox {\n readonly type: \"text-box\";\n}\n\nexport type Node = NodeObject | NodeTextBox;\n\nexport function isNodeObject(value: Node): value is NodeObject {\n return value.type === \"object\";\n}\n\nexport function isNodeTextBox(value: Node): value is NodeTextBox {\n return value.type === \"text-box\";\n}\n\n"],"mappings":"AAAA;;AAGA;AACA;AACA;;AAaA;AACA;AACA;;AAiBA,OAAO,SAASA,YAAYA,CAACC,KAAW,EAAuB;EAC7D,OAAOA,KAAK,CAACC,IAAI,KAAK,QAAQ;AAChC;AAEA,OAAO,SAASC,aAAaA,CAACF,KAAW,EAAwB;EAC/D,OAAOA,KAAK,CAACC,IAAI,KAAK,UAAU;AAClC","ignoreList":[]}
1
+ {"version":3,"file":"generateTypeScriptInterfaces.js","names":["isNodeObject","value","type","isNodeTextBox"],"sources":["generateTypeScriptInterfaces.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.33.0 */\n\n\n/**\n * Represents an edge in a graph\n */\nexport interface Edge {\n readonly source: ObjectNode;\n readonly target: ObjectNode;\n}\n\nexport interface ObjectNode {\n readonly x: number;\n readonly y: number;\n readonly label?: string;\n readonly color?: string;\n}\n\n/**\n * Represents a text box in a graph\n */\nexport interface TextBox {\n readonly x: number;\n readonly y: number;\n readonly text: string;\n}\n\nexport interface NodeObject extends ObjectNode {\n readonly type: \"object\";\n}\n\nexport interface NodeTextBox extends TextBox {\n readonly type: \"text-box\";\n}\n\nexport type Node = NodeObject | NodeTextBox;\n\nexport function isNodeObject(value: Node): value is NodeObject {\n return value.type === \"object\";\n}\n\nexport function isNodeTextBox(value: Node): value is NodeTextBox {\n return value.type === \"text-box\";\n}\n\n"],"mappings":"AAAA;;AAGA;AACA;AACA;;AAaA;AACA;AACA;;AAiBA,OAAO,SAASA,YAAYA,CAACC,KAAW,EAAuB;EAC7D,OAAOA,KAAK,CAACC,IAAI,KAAK,QAAQ;AAChC;AAEA,OAAO,SAASC,aAAaA,CAACF,KAAW,EAAwB;EAC/D,OAAOA,KAAK,CAACC,IAAI,KAAK,UAAU;AAClC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"refTypes.js","names":[],"sources":["refTypes.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.32.0 */\n\nimport type { DocumentId, MediaId, ObjectId, ResourceRid, UserId } from \"@palantir/pack.document-schema.model-types\";\n\n/**\n * A record containing all reference types\n */\nexport interface Document {\n readonly id: string;\n readonly docRef: DocumentId;\n readonly userRef: UserId;\n readonly objectRef: ObjectId;\n readonly mediaRef: MediaId;\n readonly resourceRef: ResourceRid;\n readonly optionalDocRef?: DocumentId;\n readonly docRefArray: readonly DocumentId[];\n readonly userRefArray: readonly UserId[];\n readonly optionalResourceRef?: ResourceRid;\n readonly resourceRefArray: readonly ResourceRid[];\n}\n\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"refTypes.js","names":[],"sources":["refTypes.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.33.0 */\n\nimport type { DocumentId, MediaId, ObjectId, ResourceRid, UserId } from \"@palantir/pack.document-schema.model-types\";\n\n/**\n * A record containing all reference types\n */\nexport interface Document {\n readonly id: string;\n readonly docRef: DocumentId;\n readonly userRef: UserId;\n readonly objectRef: ObjectId;\n readonly mediaRef: MediaId;\n readonly resourceRef: ResourceRid;\n readonly optionalDocRef?: DocumentId;\n readonly docRefArray: readonly DocumentId[];\n readonly userRefArray: readonly UserId[];\n readonly optionalResourceRef?: ResourceRid;\n readonly resourceRefArray: readonly ResourceRid[];\n}\n\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"simpleRecord.js","names":[],"sources":["simpleRecord.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.32.0 */\n\n\n/**\n * A person record\n */\nexport interface Person {\n readonly name: string;\n readonly age: number;\n readonly email?: string;\n}\n\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"simpleRecord.js","names":[],"sources":["simpleRecord.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.33.0 */\n\n\n/**\n * A person record\n */\nexport interface Person {\n readonly name: string;\n readonly age: number;\n readonly email?: string;\n}\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.33.0 */
2
2
 
3
3
  /**
4
4
  * A node in the graph
@@ -1 +1 @@
1
- {"version":3,"file":"simpleSteps.js","names":["isNodeObject","value","type","isNodeTextBox"],"sources":["simpleSteps.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.32.0 */\n\n\n/**\n * A node in the graph\n */\nexport interface ObjectNode {\n readonly x: number;\n readonly y: number;\n readonly object: string;\n readonly label?: string;\n readonly edges: readonly Edge[];\n}\n\n/**\n * A text box in the graph\n */\nexport interface TextBox {\n readonly x: number;\n readonly y: number;\n readonly text: string;\n}\n\n/**\n * An edge in the graph\n */\nexport interface Edge {\n readonly source: ObjectNode;\n readonly target: ObjectNode;\n}\n\nexport interface NodeObject extends ObjectNode {\n readonly type: \"object\";\n}\n\nexport interface NodeTextBox extends TextBox {\n readonly type: \"textBox\";\n}\n\nexport type Node = NodeObject | NodeTextBox;\n\nexport function isNodeObject(value: Node): value is NodeObject {\n return value.type === \"object\";\n}\n\nexport function isNodeTextBox(value: Node): value is NodeTextBox {\n return value.type === \"textBox\";\n}\n\n"],"mappings":"AAAA;;AAGA;AACA;AACA;;AASA;AACA;AACA;;AAOA;AACA;AACA;;AAgBA,OAAO,SAASA,YAAYA,CAACC,KAAW,EAAuB;EAC7D,OAAOA,KAAK,CAACC,IAAI,KAAK,QAAQ;AAChC;AAEA,OAAO,SAASC,aAAaA,CAACF,KAAW,EAAwB;EAC/D,OAAOA,KAAK,CAACC,IAAI,KAAK,SAAS;AACjC","ignoreList":[]}
1
+ {"version":3,"file":"simpleSteps.js","names":["isNodeObject","value","type","isNodeTextBox"],"sources":["simpleSteps.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.33.0 */\n\n\n/**\n * A node in the graph\n */\nexport interface ObjectNode {\n readonly x: number;\n readonly y: number;\n readonly object: string;\n readonly label?: string;\n readonly edges: readonly Edge[];\n}\n\n/**\n * A text box in the graph\n */\nexport interface TextBox {\n readonly x: number;\n readonly y: number;\n readonly text: string;\n}\n\n/**\n * An edge in the graph\n */\nexport interface Edge {\n readonly source: ObjectNode;\n readonly target: ObjectNode;\n}\n\nexport interface NodeObject extends ObjectNode {\n readonly type: \"object\";\n}\n\nexport interface NodeTextBox extends TextBox {\n readonly type: \"textBox\";\n}\n\nexport type Node = NodeObject | NodeTextBox;\n\nexport function isNodeObject(value: Node): value is NodeObject {\n return value.type === \"object\";\n}\n\nexport function isNodeTextBox(value: Node): value is NodeTextBox {\n return value.type === \"textBox\";\n}\n\n"],"mappings":"AAAA;;AAGA;AACA;AACA;;AASA;AACA;AACA;;AAOA;AACA;AACA;;AAgBA,OAAO,SAASA,YAAYA,CAACC,KAAW,EAAuB;EAC7D,OAAOA,KAAK,CAACC,IAAI,KAAK,QAAQ;AAChC;AAEA,OAAO,SAASC,aAAaA,CAACF,KAAW,EAAwB;EAC/D,OAAOA,KAAK,CAACC,IAAI,KAAK,SAAS;AACjC","ignoreList":[]}
@@ -94,9 +94,11 @@ function collectModels(exportKey, modelDef, nameToExportKey, outModels, fallback
94
94
  export function convertRecordDefToIr(recordDef, exportKey, nameToExportKey, fallbackVersion = 1, provenance) {
95
95
  const modelKey = exportKey ?? recordDef.name;
96
96
  const fieldVersions = provenance?.fieldVersions?.[modelKey];
97
+ const fieldMinorVersions = provenance?.fieldMinorVersions?.[modelKey];
97
98
  const deprecations = provenance?.deprecations?.[modelKey];
98
99
  const fields = Object.entries(recordDef.fields).map(([fieldKey, fieldType]) => {
99
100
  const dep = deprecations?.[fieldKey];
101
+ const addedInMinorVersion = fieldMinorVersions?.[fieldKey] ?? 0;
100
102
  return {
101
103
  key: fieldKey,
102
104
  name: fieldKey,
@@ -104,6 +106,9 @@ export function convertRecordDefToIr(recordDef, exportKey, nameToExportKey, fall
104
106
  fieldType: convertTypeToFieldTypeUnion(fieldType, nameToExportKey),
105
107
  metadata: {
106
108
  addedInVersion: fieldVersions?.[fieldKey] ?? fallbackVersion,
109
+ ...(addedInMinorVersion > 0 ? {
110
+ addedInMinorVersion
111
+ } : {}),
107
112
  ...(dep != null ? {
108
113
  deprecatedFromVersion: dep.fromVersion,
109
114
  ...(dep.message != null ? {
@@ -125,6 +130,7 @@ export function convertUnionDefToIr(unionDef, exportKey, nameToExportKey, fallba
125
130
  const modelKey = exportKey ?? unionDef.name;
126
131
  const variantEntries = Object.entries(unionDef.variants).map(([variantName, modelRef]) => [variantName, nameToExportKey?.get(modelRef.name) ?? modelRef.name]);
127
132
  const unionAddedIn = provenance?.modelVersions?.[modelKey] ?? fallbackVersion;
133
+ const unionAddedInMinor = provenance?.modelMinorVersions?.[modelKey] ?? 0;
128
134
  return {
129
135
  key: modelKey,
130
136
  name: unionDef.name,
@@ -132,7 +138,10 @@ export function convertUnionDefToIr(unionDef, exportKey, nameToExportKey, fallba
132
138
  discriminant: unionDef.discriminant,
133
139
  variants: Object.fromEntries(variantEntries),
134
140
  metadata: {
135
- addedInVersion: unionAddedIn
141
+ addedInVersion: unionAddedIn,
142
+ ...(unionAddedInMinor > 0 ? {
143
+ addedInMinorVersion: unionAddedInMinor
144
+ } : {})
136
145
  }
137
146
  };
138
147
  }
@@ -1 +1 @@
1
- {"version":3,"file":"convertStepsToIr.js","names":["invariant","IFieldTypeUnion","IFieldValueUnion","IModelDef","assertNever","convertStepsToSchema","convertStepsToIr","steps","metadata","recordDefinitions","unionDefinitions","schema","Object","fromEntries","map","def","name","convertSchemaToIr","inputSchema","provenance","nameToExportKey","Map","exportKey","modelDef","entries","existing","get","process","env","NODE_ENV","set","fallbackVersion","version","primaryModelKeys","models","collectModels","push","description","outModels","has","type","record","convertRecordDefToIr","union","convertUnionDefToIr","recordDef","modelKey","fieldVersions","deprecations","fields","fieldKey","fieldType","dep","key","undefined","convertTypeToFieldTypeUnion","addedInVersion","deprecatedFromVersion","fromVersion","message","deprecatedMessage","isOptional","docs","unionDef","variantEntries","variants","variantName","modelRef","unionAddedIn","modelVersions","discriminant","schemaType","items","allowNullValue","elementType","item","array","value","convertTypeToFieldValueUnion","Error","resourceRef","resourceRids","boolean","docRef","documentTypeRids","double","mediaRef","object","interfaceTypeRids","objectTypeRids","modelTypes","string","unmanagedJson","userRef"],"sources":["convertStepsToIr.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 * as P from \"@palantir/pack.schema\";\nimport invariant from \"tiny-invariant\";\nimport type {\n IModelTypeKey,\n IUnionVariantKey,\n} from \"../../lib/pack-docschema-api/pack-docschema-api\";\nimport type {\n IFieldDef,\n IRealTimeDocumentSchema,\n IRecordDef,\n IUnionDef,\n} from \"../../lib/pack-docschema-api/pack-docschema-ir/index.js\";\nimport {\n IFieldTypeUnion,\n IFieldValueUnion,\n IModelDef,\n} from \"../../lib/pack-docschema-api/pack-docschema-ir/index.js\";\nimport { assertNever } from \"../assertNever.js\";\nimport { convertStepsToSchema } from \"./convertStepsToSchema.js\";\nimport type { MigrationStep } from \"./parseMigrationSteps.js\";\n\nexport interface SchemaMetadata {\n readonly name?: string;\n readonly description?: string;\n readonly version?: number;\n}\n\n/**\n * Per-field version provenance for a schema, keyed by model export key then\n * field name. Supplied by the version-aware caller (`resolveSchemaChain`) so the\n * IR records the version each field first appeared in (and any deprecation)\n * instead of a placeholder. When omitted, fields fall back to the schema's\n * top-level version (correct for single-version / steps-based callers).\n */\nexport interface SchemaProvenance {\n readonly fieldVersions?: Record<string, Record<string, number>>;\n readonly modelVersions?: Record<string, number>;\n readonly deprecations?: P.VersionDeprecations;\n}\n\n/**\n * Converts migration steps to Palantir IR format\n */\nexport function convertStepsToIr(\n steps: readonly MigrationStep[],\n metadata?: SchemaMetadata,\n): IRealTimeDocumentSchema {\n // First convert steps to document-schema-api format\n const { recordDefinitions, unionDefinitions } = convertStepsToSchema(steps as MigrationStep[]);\n\n const schema = {\n ...Object.fromEntries(recordDefinitions.map(def => [def.name, def])),\n ...Object.fromEntries(unionDefinitions.map(def => [def.name, def])),\n };\n\n return convertSchemaToIr(schema, metadata);\n}\n\n/**\n * Converts record and union definitions to Palantir IR format. When\n * `provenance` is supplied (by the version-aware caller), each field/model is\n * stamped with the version it first appeared in and any deprecation; otherwise\n * everything falls back to `metadata.version` (default 1).\n */\nexport function convertSchemaToIr(\n inputSchema: P.Schema<P.ReturnedSchema>,\n metadata?: SchemaMetadata,\n provenance?: SchemaProvenance,\n): IRealTimeDocumentSchema {\n // Build a mapping from declared model name → export key so that union variant\n // refs (which use declared model names) can be remapped to export keys.\n const nameToExportKey = new Map<string, string>();\n for (const [exportKey, modelDef] of Object.entries(inputSchema)) {\n const existing = nameToExportKey.get(modelDef.name);\n invariant(\n existing == null,\n `Duplicate declared model name \"${modelDef.name}\": exported as both \"${existing}\" and \"${exportKey}\"`,\n );\n nameToExportKey.set(modelDef.name, exportKey);\n }\n const fallbackVersion = metadata?.version ?? 1;\n\n const primaryModelKeys: IModelTypeKey[] = [];\n const models = new Map<IModelTypeKey, IModelDef>();\n\n for (const [exportKey, modelDef] of Object.entries(inputSchema)) {\n if (collectModels(exportKey, modelDef, nameToExportKey, models, fallbackVersion, provenance)) {\n primaryModelKeys.push(exportKey);\n }\n }\n\n return {\n name: metadata?.name ?? \"Generated Schema\",\n description: metadata?.description ?? \"Schema generated from migration steps\",\n version: fallbackVersion,\n primaryModelKeys,\n models: Object.fromEntries(models),\n };\n}\n\nfunction collectModels(\n exportKey: string,\n modelDef: P.ModelDef,\n nameToExportKey: Map<string, string>,\n outModels: Map<IModelTypeKey, IModelDef>,\n fallbackVersion: number,\n provenance?: SchemaProvenance,\n): boolean {\n invariant(\n !outModels.has(exportKey),\n `Duplicate model definition: ${exportKey}`,\n );\n\n switch (modelDef.type) {\n case \"record\": {\n outModels.set(\n exportKey,\n IModelDef.record(\n convertRecordDefToIr(modelDef, exportKey, nameToExportKey, fallbackVersion, provenance),\n ),\n );\n return true;\n }\n case \"union\": {\n outModels.set(\n exportKey,\n IModelDef.union(\n convertUnionDefToIr(modelDef, exportKey, nameToExportKey, fallbackVersion, provenance),\n ),\n );\n return true;\n }\n default:\n assertNever(modelDef);\n }\n}\n\nexport function convertRecordDefToIr(\n recordDef: P.RecordDef,\n exportKey?: string,\n nameToExportKey?: Map<string, string>,\n fallbackVersion: number = 1,\n provenance?: SchemaProvenance,\n): IRecordDef {\n const modelKey = exportKey ?? recordDef.name;\n const fieldVersions = provenance?.fieldVersions?.[modelKey];\n const deprecations = provenance?.deprecations?.[modelKey];\n const fields = Object.entries(recordDef.fields).map(([fieldKey, fieldType]): IFieldDef => {\n const dep = deprecations?.[fieldKey];\n return {\n key: fieldKey,\n name: fieldKey,\n description: undefined,\n fieldType: convertTypeToFieldTypeUnion(fieldType, nameToExportKey),\n metadata: {\n addedInVersion: fieldVersions?.[fieldKey] ?? fallbackVersion,\n ...(dep != null\n ? {\n deprecatedFromVersion: dep.fromVersion,\n ...(dep.message != null ? { deprecatedMessage: dep.message } : {}),\n }\n : {}),\n },\n isOptional: fieldType.type === \"optional\" ? true : undefined,\n };\n });\n\n return {\n key: modelKey,\n name: recordDef.name,\n description: recordDef.docs ?? undefined,\n fields,\n };\n}\n\nexport function convertUnionDefToIr(\n unionDef: P.UnionDef,\n exportKey?: string,\n nameToExportKey?: Map<string, string>,\n fallbackVersion: number = 1,\n provenance?: SchemaProvenance,\n): IUnionDef {\n const modelKey = exportKey ?? unionDef.name;\n const variantEntries = Object.entries(unionDef.variants).map((\n [variantName, modelRef],\n ) =>\n [\n variantName as IUnionVariantKey,\n (nameToExportKey?.get(modelRef.name) ?? modelRef.name) as IModelTypeKey,\n ] as const\n );\n\n const unionAddedIn = provenance?.modelVersions?.[modelKey] ?? fallbackVersion;\n\n return {\n key: modelKey,\n name: unionDef.name,\n description: unionDef.docs,\n discriminant: unionDef.discriminant,\n variants: Object.fromEntries(variantEntries),\n metadata: { addedInVersion: unionAddedIn },\n };\n}\n\n// TODO: rename to convertSchemaTypeToFieldTypeUnion\nexport function convertTypeToFieldTypeUnion(\n schemaType: P.Type,\n nameToExportKey?: Map<string, string>,\n): IFieldTypeUnion {\n switch (schemaType.type) {\n case \"array\": {\n // P.Array.items is typed as TypeBase due to the generic; narrow via type field\n const items = schemaType.items as P.Type;\n const allowNullValue = items.type === \"optional\";\n const elementType: P.Type = allowNullValue ? (items as P.Optional).item as P.Type : items;\n return IFieldTypeUnion.array({\n allowNullValue,\n value: convertTypeToFieldValueUnion(elementType, nameToExportKey),\n });\n }\n\n case \"optional\":\n // Optional flag is handled at field level; unwrap and recurse on inner type\n return convertTypeToFieldTypeUnion(schemaType.item as P.Type, nameToExportKey);\n\n case \"resourceRef\":\n case \"boolean\":\n case \"docRef\":\n case \"double\":\n case \"mediaRef\":\n case \"objectRef\":\n case \"ref\":\n case \"string\":\n case \"unknown\":\n case \"userRef\":\n return IFieldTypeUnion.value(convertTypeToFieldValueUnion(schemaType, nameToExportKey));\n\n default:\n assertNever(schemaType);\n }\n}\n\nfunction convertTypeToFieldValueUnion(\n schemaType: P.Type,\n nameToExportKey?: Map<string, string>,\n): IFieldValueUnion {\n switch (schemaType.type) {\n case \"array\":\n throw new Error(\n \"Nested arrays are not supported in the IR. \"\n + \"Wrap the inner array in a record instead.\",\n );\n\n case \"resourceRef\":\n return IFieldValueUnion.resourceRef({\n resourceRids: [],\n });\n\n case \"boolean\":\n return IFieldValueUnion.boolean({});\n\n case \"docRef\":\n return IFieldValueUnion.docRef({\n documentTypeRids: [], // FIXME: confirm whether we will use rids in the deployed schema.\n });\n\n case \"double\":\n return IFieldValueUnion.double({});\n\n case \"mediaRef\":\n return IFieldValueUnion.mediaRef({});\n\n case \"objectRef\":\n return IFieldValueUnion.object({\n // FIXME: confirm whether we will use rids in the deployed schema.\n interfaceTypeRids: [],\n objectTypeRids: [],\n });\n\n case \"optional\":\n // Nested optional — unwrap and continue\n // TODO: probably warn? maybe throw\n return convertTypeToFieldValueUnion(schemaType.item as P.Type, nameToExportKey);\n\n case \"ref\": {\n const modelKey = nameToExportKey?.get(schemaType.name) ?? schemaType.name;\n return IFieldValueUnion.modelRef({ modelTypes: [modelKey as IModelTypeKey] });\n }\n\n case \"string\":\n return IFieldValueUnion.string({});\n\n case \"unknown\":\n return IFieldValueUnion.unmanagedJson({});\n\n case \"userRef\":\n return IFieldValueUnion.userRef({});\n\n default:\n assertNever(schemaType);\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,OAAOA,SAAS,MAAM,gBAAgB;AAWtC,SACEC,eAAe,EACfC,gBAAgB,EAChBC,SAAS,QACJ,yDAAyD;AAChE,SAASC,WAAW,QAAQ,mBAAmB;AAC/C,SAASC,oBAAoB,QAAQ,2BAA2B;;AAShE;AACA;AACA;AACA;AACA;AACA;AACA;;AAOA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAC9BC,KAA+B,EAC/BC,QAAyB,EACA;EACzB;EACA,MAAM;IAAEC,iBAAiB;IAAEC;EAAiB,CAAC,GAAGL,oBAAoB,CAACE,KAAwB,CAAC;EAE9F,MAAMI,MAAM,GAAG;IACb,GAAGC,MAAM,CAACC,WAAW,CAACJ,iBAAiB,CAACK,GAAG,CAACC,GAAG,IAAI,CAACA,GAAG,CAACC,IAAI,EAAED,GAAG,CAAC,CAAC,CAAC;IACpE,GAAGH,MAAM,CAACC,WAAW,CAACH,gBAAgB,CAACI,GAAG,CAACC,GAAG,IAAI,CAACA,GAAG,CAACC,IAAI,EAAED,GAAG,CAAC,CAAC;EACpE,CAAC;EAED,OAAOE,iBAAiB,CAACN,MAAM,EAAEH,QAAQ,CAAC;AAC5C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASS,iBAAiBA,CAC/BC,WAAuC,EACvCV,QAAyB,EACzBW,UAA6B,EACJ;EACzB;EACA;EACA,MAAMC,eAAe,GAAG,IAAIC,GAAG,CAAiB,CAAC;EACjD,KAAK,MAAM,CAACC,SAAS,EAAEC,QAAQ,CAAC,IAAIX,MAAM,CAACY,OAAO,CAACN,WAAW,CAAC,EAAE;IAC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E;MAChB,CAAC,CAAC;IAEJ,KAAK,SAAS;MACZ,OAAO/E,gBAAgB,CAACgF,OAAO,CAAC,CAAC,CAAC,CAAC;IAErC,KAAK,QAAQ;MACX,OAAOhF,gBAAgB,CAACiF,MAAM,CAAC;QAC7BC,gBAAgB,EAAE,EAAE,CAAE;MACxB,CAAC,CAAC;IAEJ,KAAK,QAAQ;MACX,OAAOlF,gBAAgB,CAACmF,MAAM,CAAC,CAAC,CAAC,CAAC;IAEpC,KAAK,UAAU;MACb,OAAOnF,gBAAgB,CAACoF,QAAQ,CAAC,CAAC,CAAC,CAAC;IAEtC,KAAK,WAAW;MACd,OAAOpF,gBAAgB,CAACqF,MAAM,CAAC;QAC7B;QACAC,iBAAiB,EAAE,EAAE;QACrBC,cAAc,EAAE;MAClB,CAAC,CAAC;IAEJ,KAAK,UAAU;MACb;MACA;MACA,OAAOX,4BAA4B,CAACP,UAAU,CAACI,IAAI,EAAYvD,eAAe,CAAC;IAEjF,KAAK,KAAK;MAAE;QACV,MAAM0B,QAAQ,GAAG1B,eAAe,EAAEM,GAAG,CAAC6C,UAAU,CAACvD,IAAI,CAAC,IAAIuD,UAAU,CAACvD,IAAI;QACzE,OAAOd,gBAAgB,CAACiE,QAAQ,CAAC;UAAEuB,UAAU,EAAE,CAAC5C,QAAQ;QAAmB,CAAC,CAAC;MAC/E;IAEA,KAAK,QAAQ;MACX,OAAO5C,gBAAgB,CAACyF,MAAM,CAAC,CAAC,CAAC,CAAC;IAEpC,KAAK,SAAS;MACZ,OAAOzF,gBAAgB,CAAC0F,aAAa,CAAC,CAAC,CAAC,CAAC;IAE3C,KAAK,SAAS;MACZ,OAAO1F,gBAAgB,CAAC2F,OAAO,CAAC,CAAC,CAAC,CAAC;IAErC;MACEzF,WAAW,CAACmE,UAAU,CAAC;EAC3B;AACF","ignoreList":[]}
1
+ {"version":3,"file":"convertStepsToIr.js","names":["invariant","IFieldTypeUnion","IFieldValueUnion","IModelDef","assertNever","convertStepsToSchema","convertStepsToIr","steps","metadata","recordDefinitions","unionDefinitions","schema","Object","fromEntries","map","def","name","convertSchemaToIr","inputSchema","provenance","nameToExportKey","Map","exportKey","modelDef","entries","existing","get","process","env","NODE_ENV","set","fallbackVersion","version","primaryModelKeys","models","collectModels","push","description","outModels","has","type","record","convertRecordDefToIr","union","convertUnionDefToIr","recordDef","modelKey","fieldVersions","fieldMinorVersions","deprecations","fields","fieldKey","fieldType","dep","addedInMinorVersion","key","undefined","convertTypeToFieldTypeUnion","addedInVersion","deprecatedFromVersion","fromVersion","message","deprecatedMessage","isOptional","docs","unionDef","variantEntries","variants","variantName","modelRef","unionAddedIn","modelVersions","unionAddedInMinor","modelMinorVersions","discriminant","schemaType","items","allowNullValue","elementType","item","array","value","convertTypeToFieldValueUnion","Error","resourceRef","resourceRids","boolean","docRef","documentTypeRids","double","mediaRef","object","interfaceTypeRids","objectTypeRids","modelTypes","string","unmanagedJson","userRef"],"sources":["convertStepsToIr.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 * as P from \"@palantir/pack.schema\";\nimport invariant from \"tiny-invariant\";\nimport type {\n IModelTypeKey,\n IUnionVariantKey,\n} from \"../../lib/pack-docschema-api/pack-docschema-api\";\nimport type {\n IFieldDef,\n IRealTimeDocumentSchema,\n IRecordDef,\n IUnionDef,\n} from \"../../lib/pack-docschema-api/pack-docschema-ir/index.js\";\nimport {\n IFieldTypeUnion,\n IFieldValueUnion,\n IModelDef,\n} from \"../../lib/pack-docschema-api/pack-docschema-ir/index.js\";\nimport { assertNever } from \"../assertNever.js\";\nimport { convertStepsToSchema } from \"./convertStepsToSchema.js\";\nimport type { MigrationStep } from \"./parseMigrationSteps.js\";\n\nexport interface SchemaMetadata {\n readonly name?: string;\n readonly description?: string;\n readonly version?: number;\n}\n\n/**\n * Per-field version provenance for a schema, keyed by model export key then\n * field name. Supplied by the version-aware caller (`resolveSchemaChain`) so the\n * IR records the version each field first appeared in (and any deprecation)\n * instead of a placeholder. When omitted, fields fall back to the schema's\n * top-level version (correct for single-version / steps-based callers).\n */\nexport interface SchemaProvenance {\n readonly fieldVersions?: Record<string, Record<string, number>>;\n readonly modelVersions?: Record<string, number>;\n readonly fieldMinorVersions?: Record<string, Record<string, number>>;\n readonly modelMinorVersions?: Record<string, number>;\n readonly deprecations?: P.VersionDeprecations;\n}\n\n/**\n * Converts migration steps to Palantir IR format\n */\nexport function convertStepsToIr(\n steps: readonly MigrationStep[],\n metadata?: SchemaMetadata,\n): IRealTimeDocumentSchema {\n // First convert steps to document-schema-api format\n const { recordDefinitions, unionDefinitions } = convertStepsToSchema(steps as MigrationStep[]);\n\n const schema = {\n ...Object.fromEntries(recordDefinitions.map(def => [def.name, def])),\n ...Object.fromEntries(unionDefinitions.map(def => [def.name, def])),\n };\n\n return convertSchemaToIr(schema, metadata);\n}\n\n/**\n * Converts record and union definitions to Palantir IR format. When\n * `provenance` is supplied (by the version-aware caller), each field/model is\n * stamped with the version it first appeared in and any deprecation; otherwise\n * everything falls back to `metadata.version` (default 1).\n */\nexport function convertSchemaToIr(\n inputSchema: P.Schema<P.ReturnedSchema>,\n metadata?: SchemaMetadata,\n provenance?: SchemaProvenance,\n): IRealTimeDocumentSchema {\n // Build a mapping from declared model name → export key so that union variant\n // refs (which use declared model names) can be remapped to export keys.\n const nameToExportKey = new Map<string, string>();\n for (const [exportKey, modelDef] of Object.entries(inputSchema)) {\n const existing = nameToExportKey.get(modelDef.name);\n invariant(\n existing == null,\n `Duplicate declared model name \"${modelDef.name}\": exported as both \"${existing}\" and \"${exportKey}\"`,\n );\n nameToExportKey.set(modelDef.name, exportKey);\n }\n const fallbackVersion = metadata?.version ?? 1;\n\n const primaryModelKeys: IModelTypeKey[] = [];\n const models = new Map<IModelTypeKey, IModelDef>();\n\n for (const [exportKey, modelDef] of Object.entries(inputSchema)) {\n if (collectModels(exportKey, modelDef, nameToExportKey, models, fallbackVersion, provenance)) {\n primaryModelKeys.push(exportKey);\n }\n }\n\n return {\n name: metadata?.name ?? \"Generated Schema\",\n description: metadata?.description ?? \"Schema generated from migration steps\",\n version: fallbackVersion,\n primaryModelKeys,\n models: Object.fromEntries(models),\n };\n}\n\nfunction collectModels(\n exportKey: string,\n modelDef: P.ModelDef,\n nameToExportKey: Map<string, string>,\n outModels: Map<IModelTypeKey, IModelDef>,\n fallbackVersion: number,\n provenance?: SchemaProvenance,\n): boolean {\n invariant(\n !outModels.has(exportKey),\n `Duplicate model definition: ${exportKey}`,\n );\n\n switch (modelDef.type) {\n case \"record\": {\n outModels.set(\n exportKey,\n IModelDef.record(\n convertRecordDefToIr(modelDef, exportKey, nameToExportKey, fallbackVersion, provenance),\n ),\n );\n return true;\n }\n case \"union\": {\n outModels.set(\n exportKey,\n IModelDef.union(\n convertUnionDefToIr(modelDef, exportKey, nameToExportKey, fallbackVersion, provenance),\n ),\n );\n return true;\n }\n default:\n assertNever(modelDef);\n }\n}\n\nexport function convertRecordDefToIr(\n recordDef: P.RecordDef,\n exportKey?: string,\n nameToExportKey?: Map<string, string>,\n fallbackVersion: number = 1,\n provenance?: SchemaProvenance,\n): IRecordDef {\n const modelKey = exportKey ?? recordDef.name;\n const fieldVersions = provenance?.fieldVersions?.[modelKey];\n const fieldMinorVersions = provenance?.fieldMinorVersions?.[modelKey];\n const deprecations = provenance?.deprecations?.[modelKey];\n const fields = Object.entries(recordDef.fields).map(([fieldKey, fieldType]): IFieldDef => {\n const dep = deprecations?.[fieldKey];\n const addedInMinorVersion = fieldMinorVersions?.[fieldKey] ?? 0;\n return {\n key: fieldKey,\n name: fieldKey,\n description: undefined,\n fieldType: convertTypeToFieldTypeUnion(fieldType, nameToExportKey),\n metadata: {\n addedInVersion: fieldVersions?.[fieldKey] ?? fallbackVersion,\n ...(addedInMinorVersion > 0 ? { addedInMinorVersion } : {}),\n ...(dep != null\n ? {\n deprecatedFromVersion: dep.fromVersion,\n ...(dep.message != null ? { deprecatedMessage: dep.message } : {}),\n }\n : {}),\n },\n isOptional: fieldType.type === \"optional\" ? true : undefined,\n };\n });\n\n return {\n key: modelKey,\n name: recordDef.name,\n description: recordDef.docs ?? undefined,\n fields,\n };\n}\n\nexport function convertUnionDefToIr(\n unionDef: P.UnionDef,\n exportKey?: string,\n nameToExportKey?: Map<string, string>,\n fallbackVersion: number = 1,\n provenance?: SchemaProvenance,\n): IUnionDef {\n const modelKey = exportKey ?? unionDef.name;\n const variantEntries = Object.entries(unionDef.variants).map((\n [variantName, modelRef],\n ) =>\n [\n variantName as IUnionVariantKey,\n (nameToExportKey?.get(modelRef.name) ?? modelRef.name) as IModelTypeKey,\n ] as const\n );\n\n const unionAddedIn = provenance?.modelVersions?.[modelKey] ?? fallbackVersion;\n const unionAddedInMinor = provenance?.modelMinorVersions?.[modelKey] ?? 0;\n\n return {\n key: modelKey,\n name: unionDef.name,\n description: unionDef.docs,\n discriminant: unionDef.discriminant,\n variants: Object.fromEntries(variantEntries),\n metadata: {\n addedInVersion: unionAddedIn,\n ...(unionAddedInMinor > 0 ? { addedInMinorVersion: unionAddedInMinor } : {}),\n },\n };\n}\n\n// TODO: rename to convertSchemaTypeToFieldTypeUnion\nexport function convertTypeToFieldTypeUnion(\n schemaType: P.Type,\n nameToExportKey?: Map<string, string>,\n): IFieldTypeUnion {\n switch (schemaType.type) {\n case \"array\": {\n // P.Array.items is typed as TypeBase due to the generic; narrow via type field\n const items = schemaType.items as P.Type;\n const allowNullValue = items.type === \"optional\";\n const elementType: P.Type = allowNullValue ? (items as P.Optional).item as P.Type : items;\n return IFieldTypeUnion.array({\n allowNullValue,\n value: convertTypeToFieldValueUnion(elementType, nameToExportKey),\n });\n }\n\n case \"optional\":\n // Optional flag is handled at field level; unwrap and recurse on inner type\n return convertTypeToFieldTypeUnion(schemaType.item as P.Type, nameToExportKey);\n\n case \"resourceRef\":\n case \"boolean\":\n case \"docRef\":\n case \"double\":\n case \"mediaRef\":\n case \"objectRef\":\n case \"ref\":\n case \"string\":\n case \"unknown\":\n case \"userRef\":\n return IFieldTypeUnion.value(convertTypeToFieldValueUnion(schemaType, nameToExportKey));\n\n default:\n assertNever(schemaType);\n }\n}\n\nfunction convertTypeToFieldValueUnion(\n schemaType: P.Type,\n nameToExportKey?: Map<string, string>,\n): IFieldValueUnion {\n switch (schemaType.type) {\n case \"array\":\n throw new Error(\n \"Nested arrays are not supported in the IR. \"\n + \"Wrap the inner array in a record instead.\",\n );\n\n case \"resourceRef\":\n return IFieldValueUnion.resourceRef({\n resourceRids: [],\n });\n\n case \"boolean\":\n return IFieldValueUnion.boolean({});\n\n case \"docRef\":\n return IFieldValueUnion.docRef({\n documentTypeRids: [], // FIXME: confirm whether we will use rids in the deployed schema.\n });\n\n case \"double\":\n return IFieldValueUnion.double({});\n\n case \"mediaRef\":\n return IFieldValueUnion.mediaRef({});\n\n case \"objectRef\":\n return IFieldValueUnion.object({\n // FIXME: confirm whether we will use rids in the deployed schema.\n interfaceTypeRids: [],\n objectTypeRids: [],\n });\n\n case \"optional\":\n // Nested optional — unwrap and continue\n // TODO: probably warn? maybe throw\n return convertTypeToFieldValueUnion(schemaType.item as P.Type, nameToExportKey);\n\n case \"ref\": {\n const modelKey = nameToExportKey?.get(schemaType.name) ?? schemaType.name;\n return IFieldValueUnion.modelRef({ modelTypes: [modelKey as IModelTypeKey] });\n }\n\n case \"string\":\n return IFieldValueUnion.string({});\n\n case \"unknown\":\n return IFieldValueUnion.unmanagedJson({});\n\n case \"userRef\":\n return IFieldValueUnion.userRef({});\n\n default:\n assertNever(schemaType);\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AAC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AAS;MACZ,OAAO9F,gBAAgB,CAAC+F,OAAO,CAAC,CAAC,CAAC,CAAC;IAErC;MACE7F,WAAW,CAACuE,UAAU,CAAC;EAC3B;AACF","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=irUpdateSchemaHandler.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"irUpdateSchemaHandler.test.d.ts","sourceRoot":"","sources":["../../../../../src/commands/ir/__tests__/irUpdateSchemaHandler.test.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"irDeployHandler.d.ts","sourceRoot":"","sources":["../../../../src/commands/ir/irDeployHandler.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAA6B,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAWpF,UAAU,aAAa;IACrB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC;IACzC,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B,wCAAwC;IACxC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,6HAA6H;IAC7H,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,iJAAiJ;IACjJ,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC;;;OAGG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;CACpC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CA8B3E"}
1
+ {"version":3,"file":"irDeployHandler.d.ts","sourceRoot":"","sources":["../../../../src/commands/ir/irDeployHandler.ts"],"names":[],"mappings":"AAiBA,OAAO,KA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irGenAssetHandler.d.ts","sourceRoot":"","sources":["../../../../src/commands/ir/irGenAssetHandler.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAqB,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAU5E,UAAU,iBAAiB;IACzB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC;IACzC,QAAQ,CAAC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAC3C,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;CACnC;AAYD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,iBAAiB,GAAG,IAAI,CAoGlE"}
@@ -1 +1 @@
1
- {"version":3,"file":"irGenTypesHandler.d.ts","sourceRoot":"","sources":["../../../../src/commands/ir/irGenTypesHandler.ts"],"names":[],"mappings":"AA0BA,UAAU,iBAAiB;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAsBjF"}
1
+ {"version":3,"file":"irGenTypesHandler.d.ts","sourceRoot":"","sources":["../../../../src/commands/ir/irGenTypesHandler.ts"],"names":[],"mappings":"AA2BA,UAAU,iBAAiB;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAyBjF"}
@@ -1 +1 @@
1
- {"version":3,"file":"irUpdateSchemaHandler.d.ts","sourceRoot":"","sources":["../../../../src/commands/ir/irUpdateSchemaHandler.ts"],"names":[],"mappings":"AA2BA,UAAU,qBAAqB;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAClC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;CACpC;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CA6DzF"}
1
+ {"version":3,"file":"irUpdateSchemaHandler.d.ts","sourceRoot":"","sources":["../../../../src/commands/ir/irUpdateSchemaHandler.ts"],"names":[],"mappings":"AA4BA,UAAU,qBAAqB;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAClC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;CACpC;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAiEzF"}
@@ -2,6 +2,7 @@ import type { IRealTimeDocumentSchema } from "../../lib/pack-docschema-api/pack-
2
2
  export interface ResolvedIrInput {
3
3
  readonly ir: IRealTimeDocumentSchema;
4
4
  readonly latestVersion: number;
5
+ readonly latestMinorVersion: number;
5
6
  readonly minSupportedVersion: number;
6
7
  readonly owningApplicationId?: string;
7
8
  }
@@ -1 +1 @@
1
- {"version":3,"file":"resolveIrInput.d.ts","sourceRoot":"","sources":["../../../../src/commands/ir/resolveIrInput.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yDAAyD,CAAC;AAGvG,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,EAAE,uBAAuB,CAAC;IACrC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;CACvC;AA4CD,wBAAgB,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,eAAe,CAI/E"}
1
+ {"version":3,"file":"resolveIrInput.d.ts","sourceRoot":"","sources":["../../../../src/commands/ir/resolveIrInput.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yDAAyD,CAAC;AAQvG,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,EAAE,uBAAuB,CAAC;IACrC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;CACvC;AAuCD,wBAAgB,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,eAAe,CAI/E"}
@@ -15,7 +15,7 @@ export declare function readPackConfig(configPath: string): Promise<PackConfigVa
15
15
  * Resolve a TypeScript schema module to a versioned IR chain JSON file.
16
16
  *
17
17
  * The output is a `{ latestVersion, minSupportedVersion?, chain }` payload
18
- * where each entry is `{ version, ir, migrations? }` and `ir` is a
18
+ * where each entry is `{ version, minorVersion?, ir, migrations? }` and `ir` is a
19
19
  * single-version `IRealTimeDocumentSchema`. This is the input format for
20
20
  * `ir gen-types` and `ir asset`.
21
21
  *
@@ -38,8 +38,8 @@ export declare function readPackConfig(configPath: string): Promise<PackConfigVa
38
38
  *
39
39
  * Note: this is distinct from the legacy single-version IR JSON consumed by
40
40
  * `ir zod`, which is a bare `IRealTimeDocumentSchema` (no chain, no migrations).
41
- * Tools that previously read that format should pick the entry matching
42
- * `latestVersion` from `chain` and use its `ir` field.
41
+ * Tools that previously read that format should use the `ir` field of the last
42
+ * entry in `chain` (several entries can share a major version, e.g. 3.0 and 3.1).
43
43
  */
44
44
  export declare function schemaIrHandler(options: SchemaIrOptions): Promise<void>;
45
45
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"schemaIrHandler.d.ts","sourceRoot":"","sources":["../../../../src/commands/schema/schemaIrHandler.ts"],"names":[],"mappings":"AAuBA,UAAU,eAAe;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AASD,UAAU,gBAAgB;IACxB,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC;IACzC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IACtC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;CACvC;AAwBD,wBAAsB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CA0ClF;AAgBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CA6C7E"}
1
+ {"version":3,"file":"schemaIrHandler.d.ts","sourceRoot":"","sources":["../../../../src/commands/schema/schemaIrHandler.ts"],"names":[],"mappings":"AA6BA,UAAU,eAAe;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AASD,UAAU,gBAAgB;IACxB,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC;IACzC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IACtC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;CACvC;AAwBD,wBAAsB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CA0ClF;AAiBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CA+C7E"}
@@ -1,6 +1,7 @@
1
1
  import type { ISchemaVersion } from "../pack-docschema-api/schemaVersion.js";
2
2
  export interface ISchemaMeta {
3
3
  readonly "addedInVersion": ISchemaVersion;
4
+ readonly "addedInMinorVersion"?: number | null;
4
5
  readonly "deprecatedFromVersion"?: ISchemaVersion | null;
5
6
  readonly "deprecatedMessage"?: string | null;
6
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"schemaMeta.d.ts","sourceRoot":"","sources":["../../../../../src/lib/pack-docschema-api/pack-docschema-ir/schemaMeta.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAC7E,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,gBAAgB,EAAE,cAAc,CAAC;IAC1C,QAAQ,CAAC,uBAAuB,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IACzD,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9C"}
1
+ {"version":3,"file":"schemaMeta.d.ts","sourceRoot":"","sources":["../../../../../src/lib/pack-docschema-api/pack-docschema-ir/schemaMeta.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAC7E,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,gBAAgB,EAAE,cAAc,CAAC;IAC1C,QAAQ,CAAC,qBAAqB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/C,QAAQ,CAAC,uBAAuB,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IACzD,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9C"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=assertSdkNamesUnique.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assertSdkNamesUnique.test.d.ts","sourceRoot":"","sources":["../../../../../src/utils/schema/__tests__/assertSdkNamesUnique.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ import { type VersionedIrEntry } from "./resolveSchemaChain.js";
2
+ /**
3
+ * Throw if the generated SDK would use one name for two different things, so a clash fails
4
+ * here with a clear message instead of as a TypeScript error in the generated files. Run it
5
+ * before a schema is deployed: model keys are stored in documents, so renaming a model
6
+ * afterwards breaks existing data. Returns the names it checked, for tests.
7
+ */
8
+ export declare function assertSdkNamesUnique(irChain: VersionedIrEntry[], minSupportedVersion: number | undefined): ReadonlyMap<string, string>;
9
+ //# sourceMappingURL=assertSdkNamesUnique.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assertSdkNamesUnique.d.ts","sourceRoot":"","sources":["../../../../src/utils/schema/assertSdkNamesUnique.ts"],"names":[],"mappings":"AAkBA,OAAO,EAGL,KAAK,gBAAgB,EACtB,MAAM,yBAAyB,CAAC;AAmBjC;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,gBAAgB,EAAE,EAC3B,mBAAmB,EAAE,MAAM,GAAG,SAAS,GACtC,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAqI7B"}
@@ -1 +1 @@
1
- {"version":3,"file":"generateIndexFromSchema.d.ts","sourceRoot":"","sources":["../../../../src/utils/schema/generateIndexFromSchema.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAe/D;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,eAAe,EACzB,mBAAmB,CAAC,EAAE,MAAM,GAC3B,MAAM,CAwDR"}
1
+ {"version":3,"file":"generateIndexFromSchema.d.ts","sourceRoot":"","sources":["../../../../src/utils/schema/generateIndexFromSchema.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAiB/D;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,eAAe,EACzB,mBAAmB,CAAC,EAAE,MAAM,GAC3B,MAAM,CAuDR"}
@@ -1 +1 @@
1
- {"version":3,"file":"generateInternalFromSchema.d.ts","sourceRoot":"","sources":["../../../../src/utils/schema/generateInternalFromSchema.ts"],"names":[],"mappings":"AA2BA,OAAO,EAEL,KAAK,eAAe,EAErB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,WAAW,mBAAmB;IAClC,iCAAiC;IACjC,aAAa,EAAE,MAAM,CAAC;IACtB,oCAAoC;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,kCAAkC;IAClC,cAAc,EAAE,MAAM,CAAC;IACvB,sCAAsC;IACtC,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAgdD;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,eAAe,GACxB,mBAAmB,CAarB"}
1
+ {"version":3,"file":"generateInternalFromSchema.d.ts","sourceRoot":"","sources":["../../../../src/utils/schema/generateInternalFromSchema.ts"],"names":[],"mappings":"AA2BA,OAAO,EAGL,KAAK,eAAe,EAGrB,MAAM,yBAAyB,CAAC;AAQjC,MAAM,WAAW,mBAAmB;IAClC,iCAAiC;IACjC,aAAa,EAAE,MAAM,CAAC;IACtB,oCAAoC;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,kCAAkC;IAClC,cAAc,EAAE,MAAM,CAAC;IACvB,sCAAsC;IACtC,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAoeD;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,eAAe,GACxB,mBAAmB,CAcrB"}
@@ -1 +1 @@
1
- {"version":3,"file":"generateModelMetadataFromSchema.d.ts","sourceRoot":"","sources":["../../../../src/utils/schema/generateModelMetadataFromSchema.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAW/D,MAAM,WAAW,mBAAmB;IAClC,sFAAsF;IACtF,UAAU,EAAE,MAAM,CAAC;CACpB;AAeD;;GAEG;AACH,wBAAgB,8BAA8B,CAC5C,QAAQ,EAAE,eAAe,EACzB,mBAAmB,CAAC,EAAE,MAAM,GAC3B,mBAAmB,CAiMrB"}
1
+ {"version":3,"file":"generateModelMetadataFromSchema.d.ts","sourceRoot":"","sources":["../../../../src/utils/schema/generateModelMetadataFromSchema.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAa/D,MAAM,WAAW,mBAAmB;IAClC,sFAAsF;IACtF,UAAU,EAAE,MAAM,CAAC;CACpB;AAeD;;GAEG;AACH,wBAAgB,8BAA8B,CAC5C,QAAQ,EAAE,eAAe,EACzB,mBAAmB,CAAC,EAAE,MAAM,GAC3B,mBAAmB,CAgMrB"}
@@ -1 +1 @@
1
- {"version":3,"file":"generateScopeFromSchema.d.ts","sourceRoot":"","sources":["../../../../src/utils/schema/generateScopeFromSchema.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAW/D;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,eAAe,EACzB,mBAAmB,CAAC,EAAE,MAAM,GAC3B,MAAM,CA8IR"}
1
+ {"version":3,"file":"generateScopeFromSchema.d.ts","sourceRoot":"","sources":["../../../../src/utils/schema/generateScopeFromSchema.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAY/D;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,eAAe,EACzB,mBAAmB,CAAC,EAAE,MAAM,GAC3B,MAAM,CA2IR"}
@@ -1 +1 @@
1
- {"version":3,"file":"generateVersionedTypesFromSchema.d.ts","sourceRoot":"","sources":["../../../../src/utils/schema/generateVersionedTypesFromSchema.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,eAAe,EAAoB,MAAM,yBAAyB,CAAC;AAUjF,MAAM,WAAW,oBAAoB;IACnC,gDAAgD;IAChD,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,qDAAqD;IACrD,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,yEAAyE;IACzE,aAAa,EAAE,MAAM,CAAC;CACvB;AA2MD;;;GAGG;AACH,wBAAgB,+BAA+B,CAC7C,QAAQ,EAAE,eAAe,EACzB,mBAAmB,CAAC,EAAE,MAAM,GAC3B,oBAAoB,CAiBtB"}
1
+ {"version":3,"file":"generateVersionedTypesFromSchema.d.ts","sourceRoot":"","sources":["../../../../src/utils/schema/generateVersionedTypesFromSchema.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,eAAe,EAAoB,MAAM,yBAAyB,CAAC;AAYjF,MAAM,WAAW,oBAAoB;IACnC,gDAAgD;IAChD,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,qDAAqD;IACrD,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,yEAAyE;IACzE,aAAa,EAAE,MAAM,CAAC;CACvB;AA0MD;;;GAGG;AACH,wBAAgB,+BAA+B,CAC7C,QAAQ,EAAE,eAAe,EACzB,mBAAmB,CAAC,EAAE,MAAM,GAC3B,oBAAoB,CAiBtB"}
@@ -1 +1 @@
1
- {"version":3,"file":"generateVersionedZodFromSchema.d.ts","sourceRoot":"","sources":["../../../../src/utils/schema/generateVersionedZodFromSchema.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,eAAe,EAAoB,MAAM,yBAAyB,CAAC;AAIjF,MAAM,WAAW,kBAAkB;IACjC,iDAAiD;IACjD,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,4EAA4E;IAC5E,cAAc,EAAE,MAAM,CAAC;CACxB;AAmJD;;GAEG;AACH,wBAAgB,6BAA6B,CAC3C,QAAQ,EAAE,eAAe,EACzB,mBAAmB,CAAC,EAAE,MAAM,GAC3B,kBAAkB,CAepB"}
1
+ {"version":3,"file":"generateVersionedZodFromSchema.d.ts","sourceRoot":"","sources":["../../../../src/utils/schema/generateVersionedZodFromSchema.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,eAAe,EAAoB,MAAM,yBAAyB,CAAC;AAUjF,MAAM,WAAW,kBAAkB;IACjC,iDAAiD;IACjD,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,4EAA4E;IAC5E,cAAc,EAAE,MAAM,CAAC;CACxB;AA+ID;;GAEG;AACH,wBAAgB,6BAA6B,CAC3C,QAAQ,EAAE,eAAe,EACzB,mBAAmB,CAAC,EAAE,MAAM,GAC3B,kBAAkB,CAepB"}
@@ -8,6 +8,7 @@ export interface SerializedFieldMigration {
8
8
  export type SerializedVersionMigrations = Record<string, Record<string, SerializedFieldMigration>>;
9
9
  export interface VersionedIrEntry {
10
10
  version: number;
11
+ minorVersion?: number;
11
12
  ir: IRealTimeDocumentSchema;
12
13
  migrations?: SerializedVersionMigrations;
13
14
  }
@@ -15,6 +16,12 @@ export interface ResolvedIrChain {
15
16
  chain: VersionedIrEntry[];
16
17
  latestVersion: number;
17
18
  minVersion: number;
19
+ /**
20
+ * Every version, including minors (e.g. 3.0, 3.1, 3.2). `chain` merges these into one entry per
21
+ * major. Upgrade steps compare neighbors here, so `title` added in 3.2 gets a `v3_2` step.
22
+ * If absent, `chain` is used.
23
+ */
24
+ stepChain?: VersionedIrEntry[];
18
25
  }
19
26
  export interface IrChainPayload {
20
27
  comment?: string;
@@ -23,6 +30,12 @@ export interface IrChainPayload {
23
30
  owningApplicationId?: string;
24
31
  chain: VersionedIrEntry[];
25
32
  }
33
+ export interface FullSchemaVersion {
34
+ readonly major: number;
35
+ readonly minor: number;
36
+ }
37
+ export declare function getEntryMinorVersion(entry: VersionedIrEntry): number;
38
+ export declare function formatSchemaVersion(major: number, minor: number): string;
26
39
  export interface SchemaIdentity {
27
40
  readonly name?: string;
28
41
  readonly description?: string;
@@ -43,7 +56,7 @@ export declare function resolveMinVersion(chain: VersionedIrEntry[], minSupporte
43
56
  * defaults.
44
57
  * Throws on empty chain or invalid minSupportedVersion.
45
58
  */
46
- export declare function resolveSchemaChain(schema: SchemaDefinition, minSupportedVersion?: number, identity?: SchemaIdentity, maxVersion?: number): ResolvedIrChain;
59
+ export declare function resolveSchemaChain(schema: SchemaDefinition, minSupportedVersion?: number, identity?: SchemaIdentity, maxVersion?: FullSchemaVersion): ResolvedIrChain;
47
60
  /**
48
61
  * Return a copy of the chain with deprecated fields removed from every version
49
62
  * at or after the version in which they were deprecated.
@@ -56,6 +69,13 @@ export declare function resolveSchemaChain(schema: SchemaDefinition, minSupporte
56
69
  * are left untouched.
57
70
  */
58
71
  export declare function stripDeprecatedFieldsForSdk(chain: VersionedIrEntry[]): VersionedIrEntry[];
72
+ /**
73
+ * Merge each major's minor versions into one entry, for generating SDK types.
74
+ *
75
+ * E.g. 3.0, 3.1 and 3.2 become one `3` entry that uses 3.2's IR, so `ShapeBox_v3` has every 3.x
76
+ * field. Migrations from all three are kept, because each lives only on the version that added it.
77
+ */
78
+ export declare function collapseChainToMajors(chain: VersionedIrEntry[]): VersionedIrEntry[];
59
79
  /**
60
80
  * True if the chain has any field that requires a runtime upgrade function.
61
81
  * Drives whether the generated SDK emits `DocumentModel` as a factory
@@ -68,6 +88,9 @@ export declare function stripDeprecatedFieldsForSdk(chain: VersionedIrEntry[]):
68
88
  * app must supply a zero-arg thunk; `undefined` is not a legal value.
69
89
  *
70
90
  * Optional additive fields don't trigger it; the lens leaves them alone.
91
+ * Pass every version (`stepChain`), so a required field added in a minor, like `title` in 3.2, counts.
71
92
  */
72
93
  export declare function chainNeedsUpgradeFns(chain: VersionedIrEntry[]): boolean;
94
+ /** Upgrade function key for a step: `v2` for 2.0, `v2_1` for 2.1. Must match the key `applyReadLens` builds. */
95
+ export declare function upgradeStepKey(major: number, minor: number): string;
73
96
  //# sourceMappingURL=resolveSchemaChain.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolveSchemaChain.d.ts","sourceRoot":"","sources":["../../../../src/utils/schema/resolveSchemaChain.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,gBAAgB,EAAqB,MAAM,uBAAuB,CAAC;AACjF,OAAO,KAAK,EAEV,uBAAuB,EACxB,MAAM,yDAAyD,CAAC;AAKjE,0DAA0D;AAC1D,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;CACzC;AAED,qEAAqE;AACrE,MAAM,MAAM,2BAA2B,GAAG,MAAM,CAC9C,MAAM,EACN,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,CACzC,CAAC;AAEF,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,uBAAuB,CAAC;IAC5B,UAAU,CAAC,EAAE,2BAA2B,CAAC;CAC1C;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;CACpB;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aAAa,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAkB/C;AA0BD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,gBAAgB,EACxB,mBAAmB,CAAC,EAAE,MAAM,EAC5B,QAAQ,GAAE,cAAmB,EAC7B,UAAU,CAAC,EAAE,iBAAiB,GAC7B,eAAe,CAIjB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,gBAAgB,EAAE,CAgBzF;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,gBAAgB,EAAE,CAmBnF;AAeD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAmBvE;AAED,gHAAgH;AAChH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAEnE"}
@@ -12,6 +12,25 @@ export declare function versionedSchemaName(exportName: string, version: number)
12
12
  export declare function modelName(exportName: string): string;
13
13
  /** Unversioned Zod schema name: `RecordNameSchema` */
14
14
  export declare function schemaName(exportName: string): string;
15
+ /** Union variant name: (`Shape_v1`, `"my-box"`) -> `Shape_v1MyBox`. */
16
+ export declare function unionVariantName(unionName: string, variantKey: string): string;
17
+ /** Type guard function name: `isShape_v1Circle` */
18
+ export declare function typeGuardName(typeName: string): string;
19
+ /** Upgrade registry constant name: `RecordNameUpgrades` */
20
+ export declare function upgradesName(modelKey: string): string;
21
+ /** All-versions internal type name: `RecordName__Internal` */
22
+ export declare function internalTypeName(modelKey: string): string;
23
+ /** Per-version internal type name: `RecordName__vN` */
24
+ export declare function versionedInternalTypeName(modelKey: string, version: number): string;
25
+ /** Internal Zod schema name: `RecordNameInternalSchema` */
26
+ export declare function internalSchemaName(modelKey: string): string;
27
+ /** Versioned document ref type name: `VersionedDocRef_vN` */
28
+ export declare function versionedDocRefName(version: number): string;
29
+ /**
30
+ * Names the SDK uses in the same files as model names, so no model may produce one. Other
31
+ * library names only appear next to suffixed names like `Foo_v1`, so they can't clash.
32
+ */
33
+ export declare const RESERVED_SDK_NAMES: readonly string[];
15
34
  /** Per-version types file path: `./types_vN.js` */
16
35
  export declare function typesFilePath(version: number): string;
17
36
  /** Per-version write types file path: `./writeTypes_vN.js` */
@@ -1 +1 @@
1
- {"version":3,"file":"runtimeSchema.d.ts","sourceRoot":"","sources":["../../../../src/utils/schema/runtimeSchema.ts"],"names":[],"mappings":"AAgBA,gDAAgD;AAChD,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAE7E;AAED,+FAA+F;AAC/F,wBAAgB,aAAa,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,wDAAwD;AACxD,wBAAgB,uBAAuB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAErE;AAED,uDAAuD;AACvD,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAElF;AAED,uDAAuD;AACvD,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAE/E;AAED,6CAA6C;AAC7C,wBAAgB,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED,sDAAsD;AACtD,wBAAgB,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAErD;AAED,mDAAmD;AACnD,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAErD;AAED,8DAA8D;AAC9D,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED,8CAA8C;AAC9C,eAAO,MAAM,mBAAmB,eAAe,CAAC;AAEhD,gDAAg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dkFiles.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D;;;GAGG;AACH,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,eAAe,EACzB,SAAS,EAAE,MAAM,EACjB,mBAAmB,EAAE,MAAM,GAAG,SAAS,GACtC,OAAO,CAAC,IAAI,CAAC,CAgFf"}
1
+ {"version":3,"file":"writeAllSdkFiles.d.ts","sourceRoot":"","sources":["../../../../src/utils/schema/writeAllSdkFiles.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D;;;GAGG;AACH,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,eAAe,EACzB,SAAS,EAAE,MAAM,EACjB,mBAAmB,EAAE,MAAM,GAAG,SAAS,GACtC,OAAO,CAAC,IAAI,CAAC,CAiFf"}
@@ -17,6 +17,8 @@ export interface SchemaMetadata {
17
17
  export interface SchemaProvenance {
18
18
  readonly fieldVersions?: Record<string, Record<string, number>>;
19
19
  readonly modelVersions?: Record<string, number>;
20
+ readonly fieldMinorVersions?: Record<string, Record<string, number>>;
21
+ readonly modelMinorVersions?: Record<string, number>;
20
22
  readonly deprecations?: P.VersionDeprecations;
21
23
  }
22
24
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"convertStepsToIr.d.ts","sourceRoot":"","sources":["../../../../src/utils/steps/convertStepsToIr.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,KAAK,CAAC,MAAM,uBAAuB,CAAC;AAMhD,OAAO,KAAK,EAEV,uBAAuB,EACvB,UAAU,EACV,SAAS,EACV,MAAM,yDAAyD,CAAC;AACjE,OAAO,EACL,eAAe,EAGhB,MAAM,yDAAyD,CAAC;AAGjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAA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