@palantir/pack.document-schema.type-gen 0.11.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/build/esm/commands/asset/assetDeployHandler.js +1 -1
  2. package/build/esm/commands/asset/assetDeployHandler.js.map +1 -1
  3. package/build/esm/commands/asset/assetUpdateSchemaHandler.js +1 -1
  4. package/build/esm/commands/asset/assetUpdateSchemaHandler.js.map +1 -1
  5. package/build/esm/commands/ir/irGenAssetHandler.js +81 -12
  6. package/build/esm/commands/ir/irGenAssetHandler.js.map +1 -1
  7. package/build/esm/commands/ir/irGenTypesHandler.js +4 -2
  8. package/build/esm/commands/ir/irGenTypesHandler.js.map +1 -1
  9. package/build/esm/commands/ir/registerIrCommands.js +2 -2
  10. package/build/esm/commands/ir/registerIrCommands.js.map +1 -1
  11. package/build/esm/commands/schema/__tests__/readPackConfig.test.js +112 -0
  12. package/build/esm/commands/schema/__tests__/readPackConfig.test.js.map +1 -0
  13. package/build/esm/commands/schema/registerSchemaCommands.js +1 -1
  14. package/build/esm/commands/schema/registerSchemaCommands.js.map +1 -1
  15. package/build/esm/commands/schema/schemaIrHandler.js +77 -11
  16. package/build/esm/commands/schema/schemaIrHandler.js.map +1 -1
  17. package/build/esm/commands/types.js.map +1 -1
  18. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/custom-discriminant.js +1 -1
  19. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/custom-discriminant.js.map +1 -1
  20. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/external-refs.js +1 -1
  21. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/external-refs.js.map +1 -1
  22. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/simple-record.js +1 -1
  23. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/simple-record.js.map +1 -1
  24. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/union-types.js +1 -1
  25. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/union-types.js.map +1 -1
  26. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/array-and-map-types.js +1 -1
  27. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/array-and-map-types.js.map +1 -1
  28. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/boolean-fields.js +1 -1
  29. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/boolean-fields.js.map +1 -1
  30. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/custom-discriminant.js +1 -1
  31. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/custom-discriminant.js.map +1 -1
  32. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/datetime-fields.js +1 -1
  33. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/datetime-fields.js.map +1 -1
  34. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/simple-records.js +1 -1
  35. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/simple-records.js.map +1 -1
  36. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/union-before-records.js +1 -1
  37. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/union-before-records.js.map +1 -1
  38. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/union-types.js +1 -1
  39. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/union-types.js.map +1 -1
  40. package/build/esm/utils/schema/__tests__/__snapshots__/generateDocumentTypeFromSchema/with-name-and-description.js +9 -0
  41. package/build/esm/utils/schema/__tests__/__snapshots__/generateDocumentTypeFromSchema/with-name-and-description.js.map +1 -0
  42. package/build/esm/utils/schema/__tests__/__snapshots__/generateVersionsFromSchema/single-version.js.map +1 -1
  43. package/build/esm/utils/schema/__tests__/__snapshots__/generateVersionsFromSchema/three-version-chain.js.map +1 -1
  44. package/build/esm/utils/schema/__tests__/__snapshots__/generateVersionsFromSchema/two-version.js.map +1 -1
  45. package/build/esm/utils/schema/__tests__/generateDocumentTypeFromSchema.test.js +34 -0
  46. package/build/esm/utils/schema/__tests__/generateDocumentTypeFromSchema.test.js.map +1 -0
  47. package/build/esm/utils/schema/generateDocumentTypeFromSchema.js +39 -0
  48. package/build/esm/utils/schema/generateDocumentTypeFromSchema.js.map +1 -0
  49. package/build/esm/utils/schema/generateIndexFromSchema.js +3 -1
  50. package/build/esm/utils/schema/generateIndexFromSchema.js.map +1 -1
  51. package/build/esm/utils/schema/resolveSchemaChain.js +12 -5
  52. package/build/esm/utils/schema/resolveSchemaChain.js.map +1 -1
  53. package/build/esm/utils/schema/runtimeSchema.js +3 -0
  54. package/build/esm/utils/schema/runtimeSchema.js.map +1 -1
  55. package/build/esm/utils/schema/writeAllSdkFiles.js +8 -8
  56. package/build/esm/utils/schema/writeAllSdkFiles.js.map +1 -1
  57. package/build/esm/utils/steps/__tests__/__snapshots__/types/arrayFields.js.map +1 -1
  58. package/build/esm/utils/steps/__tests__/__snapshots__/types/customDiscriminant.js +1 -1
  59. package/build/esm/utils/steps/__tests__/__snapshots__/types/customDiscriminant.js.map +1 -1
  60. package/build/esm/utils/steps/__tests__/__snapshots__/types/generateTypeScriptInterfaces.js +1 -1
  61. package/build/esm/utils/steps/__tests__/__snapshots__/types/generateTypeScriptInterfaces.js.map +1 -1
  62. package/build/esm/utils/steps/__tests__/__snapshots__/types/refTypes.js.map +1 -1
  63. package/build/esm/utils/steps/__tests__/__snapshots__/types/simpleRecord.js.map +1 -1
  64. package/build/esm/utils/steps/__tests__/__snapshots__/types/simpleSteps.js +1 -1
  65. package/build/esm/utils/steps/__tests__/__snapshots__/types/simpleSteps.js.map +1 -1
  66. package/build/types/commands/ir/irGenAssetHandler.d.ts +16 -5
  67. package/build/types/commands/ir/irGenAssetHandler.d.ts.map +1 -1
  68. package/build/types/commands/ir/irGenTypesHandler.d.ts +0 -1
  69. package/build/types/commands/ir/irGenTypesHandler.d.ts.map +1 -1
  70. package/build/types/commands/ir/registerIrCommands.d.ts.map +1 -1
  71. package/build/types/commands/schema/__tests__/readPackConfig.test.d.ts +2 -0
  72. package/build/types/commands/schema/__tests__/readPackConfig.test.d.ts.map +1 -0
  73. package/build/types/commands/schema/registerSchemaCommands.d.ts.map +1 -1
  74. package/build/types/commands/schema/schemaIrHandler.d.ts +28 -6
  75. package/build/types/commands/schema/schemaIrHandler.d.ts.map +1 -1
  76. package/build/types/commands/types.d.ts +3 -1
  77. package/build/types/commands/types.d.ts.map +1 -1
  78. package/build/types/utils/schema/__tests__/generateDocumentTypeFromSchema.test.d.ts +2 -0
  79. package/build/types/utils/schema/__tests__/generateDocumentTypeFromSchema.test.d.ts.map +1 -0
  80. package/build/types/utils/schema/generateDocumentTypeFromSchema.d.ts +17 -0
  81. package/build/types/utils/schema/generateDocumentTypeFromSchema.d.ts.map +1 -0
  82. package/build/types/utils/schema/generateIndexFromSchema.d.ts +1 -0
  83. package/build/types/utils/schema/generateIndexFromSchema.d.ts.map +1 -1
  84. package/build/types/utils/schema/resolveSchemaChain.d.ts +14 -1
  85. package/build/types/utils/schema/resolveSchemaChain.d.ts.map +1 -1
  86. package/build/types/utils/schema/runtimeSchema.d.ts +2 -0
  87. package/build/types/utils/schema/runtimeSchema.d.ts.map +1 -1
  88. package/build/types/utils/schema/writeAllSdkFiles.d.ts +0 -1
  89. package/build/types/utils/schema/writeAllSdkFiles.d.ts.map +1 -1
  90. package/package.json +3 -3
@@ -20,14 +20,16 @@ import { convertSchemaToIr } from "../steps/convertStepsToIr.js";
20
20
 
21
21
  /** Serialized migrations keyed by `[recordModelName][fieldName]`. */
22
22
 
23
- function collectVersionedIrChain(input) {
23
+ function collectVersionedIrChain(input, identity) {
24
24
  const chain = [];
25
25
  let current = input;
26
26
  while (current.type === "versioned") {
27
27
  chain.unshift({
28
28
  version: current.version,
29
29
  ir: convertSchemaToIr(current.models, {
30
- version: current.version
30
+ version: current.version,
31
+ name: identity.name,
32
+ description: identity.description
31
33
  }),
32
34
  migrations: serializeMigrations(current.migrations)
33
35
  });
@@ -36,7 +38,9 @@ function collectVersionedIrChain(input) {
36
38
  chain.unshift({
37
39
  version: current.version,
38
40
  ir: convertSchemaToIr(current.models, {
39
- version: current.version
41
+ version: current.version,
42
+ name: identity.name,
43
+ description: identity.description
40
44
  })
41
45
  });
42
46
  return chain;
@@ -79,10 +83,13 @@ export function resolveMinVersion(chain, minSupportedVersion) {
79
83
  /**
80
84
  * Collect the version chain and resolve min/latest versions.
81
85
  * Each version's models are converted to IR (IRealTimeDocumentSchema).
86
+ * `identity.name` / `identity.description` are embedded into each chain entry's
87
+ * IR; when omitted (e.g. test callers), `convertSchemaToIr` falls back to its
88
+ * defaults.
82
89
  * Throws on empty chain or invalid minSupportedVersion.
83
90
  */
84
- export function resolveSchemaChain(schema, minSupportedVersion) {
85
- const chain = collectVersionedIrChain(schema);
91
+ export function resolveSchemaChain(schema, minSupportedVersion, identity = {}) {
92
+ const chain = collectVersionedIrChain(schema, identity);
86
93
  const {
87
94
  latestVersion,
88
95
  minVersion
@@ -1 +1 @@
1
- {"version":3,"file":"resolveSchemaChain.js","names":["convertSchemaToIr","collectVersionedIrChain","input","chain","current","type","unshift","version","ir","models","migrations","serializeMigrations","previous","undefined","result","modelKey","fields","Object","entries","fieldEntries","fieldName","migration","derivedFrom","resolveMinVersion","minSupportedVersion","length","Error","latestVersion","some","c","map","join","minVersion","resolveSchemaChain","schema","chainHasDerivedFields","entry","recordMigrations","values","fieldMigration"],"sources":["resolveSchemaChain.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { SchemaDefinition, VersionMigrations } from \"@palantir/pack.schema\";\nimport type { IRealTimeDocumentSchema } from \"../../lib/pack-docschema-api/pack-docschema-ir/index.js\";\nimport { convertSchemaToIr } from \"../steps/convertStepsToIr.js\";\n\n/** JSON-serializable form of a single field migration. */\nexport interface SerializedFieldMigration {\n readonly derivedFrom: readonly string[];\n}\n\n/** Serialized migrations keyed by `[recordModelName][fieldName]`. */\nexport type SerializedVersionMigrations = Record<\n string,\n Record<string, SerializedFieldMigration>\n>;\n\nexport interface VersionedIrEntry {\n version: number;\n ir: IRealTimeDocumentSchema;\n migrations?: SerializedVersionMigrations;\n}\n\nexport interface ResolvedIrChain {\n chain: VersionedIrEntry[];\n latestVersion: number;\n minVersion: number;\n}\n\nfunction collectVersionedIrChain(input: SchemaDefinition): VersionedIrEntry[] {\n const chain: VersionedIrEntry[] = [];\n let current: SchemaDefinition = input;\n\n while (current.type === \"versioned\") {\n chain.unshift({\n version: current.version,\n ir: convertSchemaToIr(current.models, { version: current.version }),\n migrations: serializeMigrations(current.migrations),\n });\n current = current.previous;\n }\n chain.unshift({\n version: current.version,\n ir: convertSchemaToIr(current.models, { version: current.version }),\n });\n\n return chain;\n}\n\n/** Convert schema-builder migrations to their JSON-serializable form. */\nfunction serializeMigrations(\n migrations: VersionMigrations | undefined,\n): SerializedVersionMigrations | undefined {\n if (migrations == null) return undefined;\n const result: SerializedVersionMigrations = {};\n for (const [modelKey, fields] of Object.entries(migrations)) {\n const fieldEntries: Record<string, SerializedFieldMigration> = {};\n for (const [fieldName, migration] of Object.entries(fields)) {\n fieldEntries[fieldName] = {\n derivedFrom: [...migration.derivedFrom],\n };\n }\n result[modelKey] = fieldEntries;\n }\n return result;\n}\n\n/**\n * Validate `minSupportedVersion` against an already-resolved chain and return\n * the effective `minVersion`. Throws on invalid input.\n */\nexport function resolveMinVersion(\n chain: VersionedIrEntry[],\n minSupportedVersion: number | undefined,\n): { latestVersion: number; minVersion: number } {\n if (chain.length === 0) {\n throw new Error(\"Schema version chain is empty\");\n }\n\n const latestVersion = chain[chain.length - 1]!.version;\n\n if (minSupportedVersion != null && !chain.some(c => c.version === minSupportedVersion)) {\n throw new Error(\n `minSupportedVersion ${minSupportedVersion} is not in the schema chain `\n + `(available versions: ${chain.map(c => c.version).join(\", \")})`,\n );\n }\n\n return {\n latestVersion,\n minVersion: minSupportedVersion ?? latestVersion,\n };\n}\n\n/**\n * Collect the version chain and resolve min/latest versions.\n * Each version's models are converted to IR (IRealTimeDocumentSchema).\n * Throws on empty chain or invalid minSupportedVersion.\n */\nexport function resolveSchemaChain(\n schema: SchemaDefinition,\n minSupportedVersion?: number,\n): ResolvedIrChain {\n const chain = collectVersionedIrChain(schema);\n const { latestVersion, minVersion } = resolveMinVersion(chain, minSupportedVersion);\n return { chain, latestVersion, minVersion };\n}\n\n/**\n * True if any migration in the chain declares a non-empty `derivedFrom`. Drives\n * whether the generated SDK emits `DocumentModel` as a factory (requires the\n * app to supply typed upgrade functions) or as a const (no upgrade functions needed).\n */\nexport function chainHasDerivedFields(chain: VersionedIrEntry[]): boolean {\n for (const entry of chain) {\n if (entry.migrations == null) continue;\n for (const recordMigrations of Object.values(entry.migrations)) {\n for (const fieldMigration of Object.values(recordMigrations)) {\n if (fieldMigration.derivedFrom.length > 0) return true;\n }\n }\n }\n return false;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,iBAAiB,QAAQ,8BAA8B;;AAEhE;;AAKA;;AAkBA,SAASC,uBAAuBA,CAACC,KAAuB,EAAsB;EAC5E,MAAMC,KAAyB,GAAG,EAAE;EACpC,IAAIC,OAAyB,GAAGF,KAAK;EAErC,OAAOE,OAAO,CAACC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,CAACG,MAAM,GAAG,CAAC,EAAE,OAAO,IAAI;MACxD;IACF;EACF;EACA,OAAO,KAAK;AACd","ignoreList":[]}
1
+ {"version":3,"file":"resolveSchemaChain.js","names":["convertSchemaToIr","collectVersionedIrChain","input","identity","chain","current","type","unshift","version","ir","models","name","description","migrations","serializeMigrations","previous","undefined","result","modelKey","fields","Object","entries","fieldEntries","fieldName","migration","derivedFrom","resolveMinVersion","minSupportedVersion","length","Error","latestVersion","some","c","map","join","minVersion","resolveSchemaChain","schema","chainHasDerivedFields","entry","recordMigrations","values","fieldMigration"],"sources":["resolveSchemaChain.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { SchemaDefinition, VersionMigrations } from \"@palantir/pack.schema\";\nimport type { IRealTimeDocumentSchema } from \"../../lib/pack-docschema-api/pack-docschema-ir/index.js\";\nimport { convertSchemaToIr } from \"../steps/convertStepsToIr.js\";\n\n/** JSON-serializable form of a single field migration. */\nexport interface SerializedFieldMigration {\n readonly derivedFrom: readonly string[];\n}\n\n/** Serialized migrations keyed by `[recordModelName][fieldName]`. */\nexport type SerializedVersionMigrations = Record<\n string,\n Record<string, SerializedFieldMigration>\n>;\n\nexport interface VersionedIrEntry {\n version: number;\n ir: IRealTimeDocumentSchema;\n migrations?: SerializedVersionMigrations;\n}\n\nexport interface ResolvedIrChain {\n chain: VersionedIrEntry[];\n latestVersion: number;\n minVersion: number;\n}\n\nexport interface IrChainPayload {\n __comment?: string;\n latestVersion: number;\n minSupportedVersion?: number;\n chain: VersionedIrEntry[];\n}\n\nexport interface SchemaIdentity {\n readonly name?: string;\n readonly description?: string;\n}\n\nfunction collectVersionedIrChain(\n input: SchemaDefinition,\n identity: SchemaIdentity,\n): VersionedIrEntry[] {\n const chain: VersionedIrEntry[] = [];\n let current: SchemaDefinition = input;\n\n while (current.type === \"versioned\") {\n chain.unshift({\n version: current.version,\n ir: convertSchemaToIr(current.models, {\n version: current.version,\n name: identity.name,\n description: identity.description,\n }),\n migrations: serializeMigrations(current.migrations),\n });\n current = current.previous;\n }\n chain.unshift({\n version: current.version,\n ir: convertSchemaToIr(current.models, {\n version: current.version,\n name: identity.name,\n description: identity.description,\n }),\n });\n\n return chain;\n}\n\n/** Convert schema-builder migrations to their JSON-serializable form. */\nfunction serializeMigrations(\n migrations: VersionMigrations | undefined,\n): SerializedVersionMigrations | undefined {\n if (migrations == null) return undefined;\n const result: SerializedVersionMigrations = {};\n for (const [modelKey, fields] of Object.entries(migrations)) {\n const fieldEntries: Record<string, SerializedFieldMigration> = {};\n for (const [fieldName, migration] of Object.entries(fields)) {\n fieldEntries[fieldName] = {\n derivedFrom: [...migration.derivedFrom],\n };\n }\n result[modelKey] = fieldEntries;\n }\n return result;\n}\n\n/**\n * Validate `minSupportedVersion` against an already-resolved chain and return\n * the effective `minVersion`. Throws on invalid input.\n */\nexport function resolveMinVersion(\n chain: VersionedIrEntry[],\n minSupportedVersion: number | undefined,\n): { latestVersion: number; minVersion: number } {\n if (chain.length === 0) {\n throw new Error(\"Schema version chain is empty\");\n }\n\n const latestVersion = chain[chain.length - 1]!.version;\n\n if (minSupportedVersion != null && !chain.some(c => c.version === minSupportedVersion)) {\n throw new Error(\n `minSupportedVersion ${minSupportedVersion} is not in the schema chain `\n + `(available versions: ${chain.map(c => c.version).join(\", \")})`,\n );\n }\n\n return {\n latestVersion,\n minVersion: minSupportedVersion ?? latestVersion,\n };\n}\n\n/**\n * Collect the version chain and resolve min/latest versions.\n * Each version's models are converted to IR (IRealTimeDocumentSchema).\n * `identity.name` / `identity.description` are embedded into each chain entry's\n * IR; when omitted (e.g. test callers), `convertSchemaToIr` falls back to its\n * defaults.\n * Throws on empty chain or invalid minSupportedVersion.\n */\nexport function resolveSchemaChain(\n schema: SchemaDefinition,\n minSupportedVersion?: number,\n identity: SchemaIdentity = {},\n): ResolvedIrChain {\n const chain = collectVersionedIrChain(schema, identity);\n const { latestVersion, minVersion } = resolveMinVersion(chain, minSupportedVersion);\n return { chain, latestVersion, minVersion };\n}\n\n/**\n * True if any migration in the chain declares a non-empty `derivedFrom`. Drives\n * whether the generated SDK emits `DocumentModel` as a factory (requires the\n * app to supply typed upgrade functions) or as a const (no upgrade functions needed).\n */\nexport function chainHasDerivedFields(chain: VersionedIrEntry[]): boolean {\n for (const entry of chain) {\n if (entry.migrations == null) continue;\n for (const recordMigrations of Object.values(entry.migrations)) {\n for (const fieldMigration of Object.values(recordMigrations)) {\n if (fieldMigration.derivedFrom.length > 0) return true;\n }\n }\n }\n return false;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,iBAAiB,QAAQ,8BAA8B;;AAEhE;;AAKA;;AA8BA,SAASC,uBAAuBA,CAC9BC,KAAuB,EACvBC,QAAwB,EACJ;EACpB,MAAMC,KAAyB,GAAG,EAAE;EACpC,IAAIC,OAAyB,GAAGH,KAAK;EAErC,OAAOG,OAAO,CAACC,IAAI,KAAK,WAAW,EAAE;IACnCF,KAAK,CAACG,OAAO,CAAC;MACZC,OAAO,EAAEH,OAAO,CAACG,OAAO;MACxBC,EAAE,EAAET,iBAAiB,CAACK,OAAO,CAACK,MAAM,EAAE;QACpCF,OAAO,EAAEH,OAAO,CAACG,OAAO;QACxBG,IAAI,EAAER,QAAQ,CAACQ,IAAI;QACnBC,WAAW,EAAET,QAAQ,CAACS;MACxB,CAAC,CAAC;MACFC,UAAU,EAAEC,mBAAmB,CAACT,OAAO,CAACQ,UAAU;IACpD,CAAC,CAAC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
69
69
 
70
70
  /** Versioned doc ref file path: `./versionedDocRef.js` */
71
71
  export const VERSIONED_DOC_REF_PATH = "./versionedDocRef.js";
72
+
73
+ /** Document type identity constants file path: `./documentType.js` */
74
+ export const DOCUMENT_TYPE_PATH = "./documentType.js";
72
75
  //# sourceMappingURL=runtimeSchema.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtimeSchema.js","names":["versionedTypeName","exportName","version","versionedWriteTypeName","versionedSchemaName","modelName","schemaName","typesFilePath","writeTypesFilePath","TYPES_REEXPORT_PATH","SCHEMA_REEXPORT_PATH","MODELS_PATH","INTERNAL_UPGRADES_PATH","INTERNAL_UPGRADE_FNS_PATH","VERSIONS_PATH","VERSIONED_DOC_REF_PATH"],"sources":["runtimeSchema.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\n/** Versioned read type name: `RecordName_vN` */\nexport function versionedTypeName(exportName: string, version: number): string {\n return `${exportName}_v${version}`;\n}\n\n/** Versioned write type name: `RecordNameUpdate_vN` */\nexport function versionedWriteTypeName(exportName: string, version: number): string {\n return `${exportName}Update_v${version}`;\n}\n\n/** Versioned Zod schema name: `RecordNameSchema_vN` */\nexport function versionedSchemaName(exportName: string, version: number): string {\n return `${exportName}Schema_v${version}`;\n}\n\n/** Model constant name: `RecordNameModel` */\nexport function modelName(exportName: string): string {\n return `${exportName}Model`;\n}\n\n/** Unversioned Zod schema name: `RecordNameSchema` */\nexport function schemaName(exportName: string): string {\n return `${exportName}Schema`;\n}\n\n/** Per-version types file path: `./types_vN.js` */\nexport function typesFilePath(version: number): string {\n return `./types_v${version}.js`;\n}\n\n/** Per-version write types file path: `./writeTypes_vN.js` */\nexport function writeTypesFilePath(version: number): string {\n return `./writeTypes_v${version}.js`;\n}\n\n/** Types re-export file path: `./types.js` */\nexport const TYPES_REEXPORT_PATH = \"./types.js\";\n\n/** Schema re-export file path: `./schema.js` */\nexport const SCHEMA_REEXPORT_PATH = \"./schema.js\";\n\n/** Models file path: `./models.js` */\nexport const MODELS_PATH = \"./models.js\";\n\n/** Internal upgrades file path: `./_internal/upgrades.js` */\nexport const INTERNAL_UPGRADES_PATH = \"./_internal/upgrades.js\";\n\n/** Internal upgrade-functions file path: `./_internal/upgradeFns.js` */\nexport const INTERNAL_UPGRADE_FNS_PATH = \"./_internal/upgradeFns.js\";\n\n/** Versions file path: `./versions.js` */\nexport const VERSIONS_PATH = \"./versions.js\";\n\n/** Versioned doc ref file path: `./versionedDocRef.js` */\nexport const VERSIONED_DOC_REF_PATH = \"./versionedDocRef.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,OAAO,SAASA,iBAAiBA,CAACC,UAAkB,EAAEC,OAAe,EAAU;EAC7E,OAAO,GAAGD,UAAU,KAAKC,OAAO,EAAE;AACpC;;AAEA;AACA,OAAO,SAASC,sBAAsBA,CAACF,UAAkB,EAAEC,OAAe,EAAU;EAClF,OAAO,GAAGD,UAAU,WAAWC,OAAO,EAAE;AAC1C;;AAEA;AACA,OAAO,SAASE,mBAAmBA,CAACH,UAAkB,EAAEC,OAAe,EAAU;EAC/E,OAAO,GAAGD,UAAU,WAAWC,OAAO,EAAE;AAC1C;;AAEA;AACA,OAAO,SAASG,SAASA,CAACJ,UAAkB,EAAU;EACpD,OAAO,GAAGA,UAAU,OAAO;AAC7B;;AAEA;AACA,OAAO,SAASK,UAAUA,CAACL,UAAkB,EAAU;EACrD,OAAO,GAAGA,UAAU,QAAQ;AAC9B;;AAEA;AACA,OAAO,SAASM,aAAaA,CAACL,OAAe,EAAU;EACrD,OAAO,YAAYA,OAAO,KAAK;AACjC;;AAEA;AACA,OAAO,SAASM,kBAAkBA,CAACN,OAAe,EAAU;EAC1D,OAAO,iBAAiBA,OAAO,KAAK;AACtC;;AAEA;AACA,OAAO,MAAMO,mBAAmB,GAAG,YAAY;;AAE/C;AACA,OAAO,MAAMC,oBAAoB,GAAG,aAAa;;AAEjD;AACA,OAAO,MAAMC,WAAW,GAAG,aAAa;;AAExC;AACA,OAAO,MAAMC,sBAAsB,GAAG,yBAAyB;;AAE/D;AACA,OAAO,MAAMC,yBAAyB,GAAG,2BAA2B;;AAEpE;AACA,OAAO,MAAMC,aAAa,GAAG,eAAe;;AAE5C;AACA,OAAO,MAAMC,sBAAsB,GAAG,sBAAsB","ignoreList":[]}
1
+ {"version":3,"file":"runtimeSchema.js","names":["versionedTypeName","exportName","version","versionedWriteTypeName","versionedSchemaName","modelName","schemaName","typesFilePath","writeTypesFilePath","TYPES_REEXPORT_PATH","SCHEMA_REEXPORT_PATH","MODELS_PATH","INTERNAL_UPGRADES_PATH","INTERNAL_UPGRADE_FNS_PATH","VERSIONS_PATH","VERSIONED_DOC_REF_PATH","DOCUMENT_TYPE_PATH"],"sources":["runtimeSchema.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\n/** Versioned read type name: `RecordName_vN` */\nexport function versionedTypeName(exportName: string, version: number): string {\n return `${exportName}_v${version}`;\n}\n\n/** Versioned write type name: `RecordNameUpdate_vN` */\nexport function versionedWriteTypeName(exportName: string, version: number): string {\n return `${exportName}Update_v${version}`;\n}\n\n/** Versioned Zod schema name: `RecordNameSchema_vN` */\nexport function versionedSchemaName(exportName: string, version: number): string {\n return `${exportName}Schema_v${version}`;\n}\n\n/** Model constant name: `RecordNameModel` */\nexport function modelName(exportName: string): string {\n return `${exportName}Model`;\n}\n\n/** Unversioned Zod schema name: `RecordNameSchema` */\nexport function schemaName(exportName: string): string {\n return `${exportName}Schema`;\n}\n\n/** Per-version types file path: `./types_vN.js` */\nexport function typesFilePath(version: number): string {\n return `./types_v${version}.js`;\n}\n\n/** Per-version write types file path: `./writeTypes_vN.js` */\nexport function writeTypesFilePath(version: number): string {\n return `./writeTypes_v${version}.js`;\n}\n\n/** Types re-export file path: `./types.js` */\nexport const TYPES_REEXPORT_PATH = \"./types.js\";\n\n/** Schema re-export file path: `./schema.js` */\nexport const SCHEMA_REEXPORT_PATH = \"./schema.js\";\n\n/** Models file path: `./models.js` */\nexport const MODELS_PATH = \"./models.js\";\n\n/** Internal upgrades file path: `./_internal/upgrades.js` */\nexport const INTERNAL_UPGRADES_PATH = \"./_internal/upgrades.js\";\n\n/** Internal upgrade-functions file path: `./_internal/upgradeFns.js` */\nexport const INTERNAL_UPGRADE_FNS_PATH = \"./_internal/upgradeFns.js\";\n\n/** Versions file path: `./versions.js` */\nexport const VERSIONS_PATH = \"./versions.js\";\n\n/** Versioned doc ref file path: `./versionedDocRef.js` */\nexport const VERSIONED_DOC_REF_PATH = \"./versionedDocRef.js\";\n\n/** Document type identity constants file path: `./documentType.js` */\nexport const DOCUMENT_TYPE_PATH = \"./documentType.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,OAAO,SAASA,iBAAiBA,CAACC,UAAkB,EAAEC,OAAe,EAAU;EAC7E,OAAO,GAAGD,UAAU,KAAKC,OAAO,EAAE;AACpC;;AAEA;AACA,OAAO,SAASC,sBAAsBA,CAACF,UAAkB,EAAEC,OAAe,EAAU;EAClF,OAAO,GAAGD,UAAU,WAAWC,OAAO,EAAE;AAC1C;;AAEA;AACA,OAAO,SAASE,mBAAmBA,CAACH,UAAkB,EAAEC,OAAe,EAAU;EAC/E,OAAO,GAAGD,UAAU,WAAWC,OAAO,EAAE;AAC1C;;AAEA;AACA,OAAO,SAASG,SAASA,CAACJ,UAAkB,EAAU;EACpD,OAAO,GAAGA,UAAU,OAAO;AAC7B;;AAEA;AACA,OAAO,SAASK,UAAUA,CAACL,UAAkB,EAAU;EACrD,OAAO,GAAGA,UAAU,QAAQ;AAC9B;;AAEA;AACA,OAAO,SAASM,aAAaA,CAACL,OAAe,EAAU;EACrD,OAAO,YAAYA,OAAO,KAAK;AACjC;;AAEA;AACA,OAAO,SAASM,kBAAkBA,CAACN,OAAe,EAAU;EAC1D,OAAO,iBAAiBA,OAAO,KAAK;AACtC;;AAEA;AACA,OAAO,MAAMO,mBAAmB,GAAG,YAAY;;AAE/C;AACA,OAAO,MAAMC,oBAAoB,GAAG,aAAa;;AAEjD;AACA,OAAO,MAAMC,WAAW,GAAG,aAAa;;AAExC;AACA,OAAO,MAAMC,sBAAsB,GAAG,yBAAyB;;AAE/D;AACA,OAAO,MAAMC,yBAAyB,GAAG,2BAA2B;;AAEpE;AACA,OAAO,MAAMC,aAAa,GAAG,eAAe;;AAE5C;AACA,OAAO,MAAMC,sBAAsB,GAAG,sBAAsB;;AAE5D;AACA,OAAO,MAAMC,kBAAkB,GAAG,mBAAmB","ignoreList":[]}
@@ -17,6 +17,7 @@
17
17
  import { consola } from "consola";
18
18
  import fs from "fs-extra";
19
19
  import path from "path";
20
+ import { generateDocumentTypeFromChain } from "./generateDocumentTypeFromSchema.js";
20
21
  import { generateIndexFromChain } from "./generateIndexFromSchema.js";
21
22
  import { generateInternalFromChain } from "./generateInternalFromSchema.js";
22
23
  import { generateModelMetadataFromChain } from "./generateModelMetadataFromSchema.js";
@@ -101,13 +102,12 @@ export async function writeAllSdkFiles(resolved, outputDir, minSupportedVersion)
101
102
  const versionedDocRefPath = path.join(outputDir, "versionedDocRef.ts");
102
103
  await fs.writeFile(versionedDocRefPath, versionedDocRefContent, "utf8");
103
104
  consola.success(`Generated versioned doc ref: ${versionedDocRefPath}`);
104
- }
105
- export function parseMinVersion(minVersion) {
106
- if (minVersion == null) return undefined;
107
- const parsed = parseInt(minVersion, 10);
108
- if (isNaN(parsed)) {
109
- throw new Error(`--min-version must be a valid integer, got: "${minVersion}"`);
110
- }
111
- return parsed;
105
+
106
+ // documentType.ts
107
+ consola.info("Generating document type identity constants...");
108
+ const documentTypeContent = generateDocumentTypeFromChain(resolved);
109
+ const documentTypePath = path.join(outputDir, "documentType.ts");
110
+ await fs.writeFile(documentTypePath, documentTypeContent, "utf8");
111
+ consola.success(`Generated document type: ${documentTypePath}`);
112
112
  }
113
113
  //# sourceMappingURL=writeAllSdkFiles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"writeAllSdkFiles.js","names":["consola","fs","path","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","parseMinVersion","minVersion","undefined","parsed","parseInt","isNaN","Error"],"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 { 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\nexport function parseMinVersion(minVersion: string | undefined): number | undefined {\n if (minVersion == null) return undefined;\n const parsed = parseInt(minVersion, 10);\n if (isNaN(parsed)) {\n throw new Error(`--min-version must be a valid integer, got: \"${minVersion}\"`);\n }\n return parsed;\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,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;EACf,MAAMZ,EAAE,CAACa,SAAS,CAACF,SAAS,CAAC;;EAE7B;EACAZ,OAAO,CAACe,IAAI,CAAC,+BAA+B,CAAC;EAC7C,MAAMC,KAAK,GAAGT,+BAA+B,CAACI,QAAQ,EAAEE,mBAAmB,CAAC;EAC5E,KAAK,MAAM,CAACI,OAAO,EAAEC,OAAO,CAAC,IAAIF,KAAK,CAACG,SAAS,EAAE;IAChD,MAAMC,QAAQ,GAAGlB,IAAI,CAACmB,IAAI,CAACT,SAAS,EAAE,UAAUK,OAAO,KAAK,CAA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,GAAGtC,sBAAsB,CAACK,QAAQ,EAAEE,mBAAmB,CAAC;EACpF,MAAMgC,mBAAmB,GAAG3C,IAAI,CAACmB,IAAI,CAACT,SAAS,EAAE,oBAAoB,CAAC;EACtE,MAAMX,EAAE,CAACqB,SAAS,CAACuB,mBAAmB,EAAED,sBAAsB,EAAE,MAAM,CAAC;EACvE5C,OAAO,CAACuB,OAAO,CAAC,gCAAgCsB,mBAAmB,EAAE,CAAC;AACxE;AAEA,OAAO,SAASC,eAAeA,CAACC,UAA8B,EAAsB;EAClF,IAAIA,UAAU,IAAI,IAAI,EAAE,OAAOC,SAAS;EACxC,MAAMC,MAAM,GAAGC,QAAQ,CAACH,UAAU,EAAE,EAAE,CAAC;EACvC,IAAII,KAAK,CAACF,MAAM,CAAC,EAAE;IACjB,MAAM,IAAIG,KAAK,CAAC,gDAAgDL,UAAU,GAAG,CAAC;EAChF;EACA,OAAOE,MAAM;AACf","ignoreList":[]}
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,SAAS;AACjC,OAAOC,EAAE,MAAM,UAAU;AACzB,OAAOC,IAAI,MAAM,MAAM;AACvB,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;EACf,MAAMb,EAAE,CAACc,SAAS,CAACF,SAAS,CAAC;;EAE7B;EACAb,OAAO,CAACgB,IAAI,CAAC,+BAA+B,CAAC;EAC7C,MAAMC,KAAK,GAAGT,+BAA+B,CAACI,QAAQ,EAAEE,mBAAmB,CAAC;EAC5E,KAAK,MAAM,CAACI,OAAO,EAAEC,OAAO,CAAC,IAAIF,KAAK,CAACG,SA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,CAAC,qBAAqBmB,UAAU,EAAE,CAAC;;EAElD;EACA3C,OAAO,CAACgB,IAAI,CAAC,4CAA4C,CAAC;EAC1D,MAAM6B,sBAAsB,GAAGtC,sBAAsB,CAACK,QAAQ,EAAEE,mBAAmB,CAAC;EACpF,MAAMgC,mBAAmB,GAAG5C,IAAI,CAACoB,IAAI,CAACT,SAAS,EAAE,oBAAoB,CAAC;EACtE,MAAMZ,EAAE,CAACsB,SAAS,CAACuB,mBAAmB,EAAED,sBAAsB,EAAE,MAAM,CAAC;EACvE7C,OAAO,CAACwB,OAAO,CAAC,gCAAgCsB,mBAAmB,EAAE,CAAC;;EAEtE;EACA9C,OAAO,CAACgB,IAAI,CAAC,gDAAgD,CAAC;EAC9D,MAAM+B,mBAAmB,GAAG5C,6BAA6B,CAACS,QAAQ,CAAC;EACnE,MAAMoC,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 +1 @@
1
- {"version":3,"file":"arrayFields.js","names":[],"sources":["arrayFields.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.11.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.12.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.11.0 */
1
+ /* Generated by @palantir/pack.document-schema.type-gen@0.12.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.11.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.12.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.11.0 */
1
+ /* Generated by @palantir/pack.document-schema.type-gen@0.12.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.11.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.12.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.11.0 */\n\nimport type { DocumentRef, MediaRef, ObjectRef, UserRef } 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: DocumentRef;\n readonly userRef: UserRef;\n readonly objectRef: ObjectRef;\n readonly mediaRef: MediaRef;\n readonly optionalDocRef?: DocumentRef;\n readonly docRefArray: readonly DocumentRef[];\n readonly userRefArray: readonly UserRef[];\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.12.0 */\n\nimport type { DocumentRef, MediaRef, ObjectRef, UserRef } 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: DocumentRef;\n readonly userRef: UserRef;\n readonly objectRef: ObjectRef;\n readonly mediaRef: MediaRef;\n readonly optionalDocRef?: DocumentRef;\n readonly docRefArray: readonly DocumentRef[];\n readonly userRefArray: readonly UserRef[];\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.11.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.12.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.11.0 */
1
+ /* Generated by @palantir/pack.document-schema.type-gen@0.12.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.11.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.12.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":[]}
@@ -3,14 +3,25 @@ interface IrGenAssetOptions {
3
3
  readonly ir: string;
4
4
  readonly output: string;
5
5
  readonly fileSystemType?: FileSystemType;
6
+ readonly compatibilityRangeOutput?: string;
6
7
  }
7
8
  /**
8
- * Generates a document type asset JSON file from an IR schema.
9
+ * Generates a document type asset JSON file (and a sibling schema
10
+ * compatibility range JSON file) from an IR schema.
9
11
  *
10
- * This command is intended for internal platform applications where the document
11
- * type asset must exist on disk so the platform can discover it and register the
12
- * document type automatically at deploy time. Most users should use `ir deploy`
13
- * to register document types via the Foundry API instead.
12
+ * The input IR may be either:
13
+ * - a chain payload `{ latestVersion, minSupportedVersion?, chain }` produced
14
+ * by `schema ir`. The latest entry's `ir` is used as the wire schema; the
15
+ * asset's `schemaVersion` is `latestVersion`; the compatibility range is
16
+ * `{ min: minSupportedVersion ?? latestVersion, max: latestVersion }`.
17
+ * - a bare single-version `IRealTimeDocumentSchema` (legacy). The compat
18
+ * range defaults to `{ min: version, max: version }` since no chain
19
+ * information is available.
20
+ *
21
+ * This command is intended for internal platform applications where the
22
+ * document type asset must exist on disk so the platform can discover it and
23
+ * register the document type automatically at deploy time. Most users should
24
+ * use `ir deploy` to register document types via the Foundry API instead.
14
25
  *
15
26
  * If you are unsure whether you need this command, you almost certainly do not.
16
27
  */
@@ -1 +1 @@
1
- {"version":3,"file":"irGenAssetHandler.d.ts","sourceRoot":"","sources":["../../../../src/commands/ir/irGenAssetHandler.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAqB,cAAc,EAAE,MAAM,aAAa,CAAC;AAErE,UAAU,iBAAiB;IACzB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC;CAC1C;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,iBAAiB,GAAG,IAAI,CAuDlE"}
1
+ {"version":3,"file":"irGenAssetHandler.d.ts","sourceRoot":"","sources":["../../../../src/commands/ir/irGenAssetHandler.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAqB,cAAc,EAAE,MAAM,aAAa,CAAC;AAErE,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;CAC5C;AAwDD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,iBAAiB,GAAG,IAAI,CAmFlE"}
@@ -1,7 +1,6 @@
1
1
  interface IrGenTypesOptions {
2
2
  schema: string;
3
3
  output: string;
4
- minVersion?: string;
5
4
  }
6
5
  export declare function irGenTypesHandler(options: IrGenTypesOptions): Promise<void>;
7
6
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"irGenTypesHandler.d.ts","sourceRoot":"","sources":["../../../../src/commands/ir/irGenTypesHandler.ts"],"names":[],"mappings":"AAsBA,UAAU,iBAAiB;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAQD,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAqBjF"}
1
+ {"version":3,"file":"irGenTypesHandler.d.ts","sourceRoot":"","sources":["../../../../src/commands/ir/irGenTypesHandler.ts"],"names":[],"mappings":"AAsBA,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,CAqBjF"}
@@ -1 +1 @@
1
- {"version":3,"file":"registerIrCommands.d.ts","sourceRoot":"","sources":["../../../../src/commands/ir/registerIrCommands.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOzC,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAqEzD"}
1
+ {"version":3,"file":"registerIrCommands.d.ts","sourceRoot":"","sources":["../../../../src/commands/ir/registerIrCommands.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOzC,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA2EzD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=readPackConfig.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readPackConfig.test.d.ts","sourceRoot":"","sources":["../../../../../src/commands/schema/__tests__/readPackConfig.test.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"registerSchemaCommands.d.ts","sourceRoot":"","sources":["../../../../src/commands/schema/registerSchemaCommands.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAkB7D"}
1
+ {"version":3,"file":"registerSchemaCommands.d.ts","sourceRoot":"","sources":["../../../../src/commands/schema/registerSchemaCommands.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAsB7D"}
@@ -1,18 +1,40 @@
1
1
  interface SchemaIrOptions {
2
2
  input: string;
3
3
  output: string;
4
+ config: string;
4
5
  }
6
+ interface PackConfigValues {
7
+ readonly documentTypeName: string;
8
+ readonly documentTypeDescription: string;
9
+ readonly minSupportedVersion?: number;
10
+ }
11
+ export declare function readPackConfig(configPath: string): Promise<PackConfigValues>;
5
12
  /**
6
13
  * Resolve a TypeScript schema module to a versioned IR chain JSON file.
7
14
  *
8
- * The output is a `{ latestVersion, chain }` payload where each entry is
9
- * `{ version, ir, migrations? }` and `ir` is a single-version
10
- * `IRealTimeDocumentSchema`. This is the input format for `ir gen-types`.
15
+ * The output is a `{ latestVersion, minSupportedVersion?, chain }` payload
16
+ * where each entry is `{ version, ir, migrations? }` and `ir` is a
17
+ * single-version `IRealTimeDocumentSchema`. This is the input format for
18
+ * `ir gen-types` and `ir asset`.
19
+ *
20
+ * `--config <pack-config.json>` is required: the pack-config is the single
21
+ * source of truth for document-type identity. Required fields:
22
+ * - `documentTypeName`: the document type name embedded into each chain
23
+ * entry's IR (and surfaced as `documentTypeName` by `ir asset`).
24
+ * - `documentTypeDescription`: document type description embedded into each
25
+ * chain entry's IR.
26
+ * Optional fields:
27
+ * - `minSupportedVersion`: declares the oldest version this SDK supports;
28
+ * when set, it must match one of the chain entries' `version` values and is
29
+ * embedded as `minSupportedVersion` in the payload so downstream consumers
30
+ * (`ir gen-types`, `ir asset`) read the same value. Omitting the field is
31
+ * an explicit opt-out: the IR will not include `minSupportedVersion` and
32
+ * downstream tools default to supporting only the latest schema version.
11
33
  *
12
34
  * Note: this is distinct from the legacy single-version IR JSON consumed by
13
- * `ir deploy` / `ir asset` / `ir zod`, which is a bare `IRealTimeDocumentSchema`
14
- * (no chain, no migrations). Tools that previously read that format should
15
- * pick the entry matching `latestVersion` from `chain` and use its `ir` field.
35
+ * `ir deploy` / `ir zod`, which is a bare `IRealTimeDocumentSchema` (no chain,
36
+ * no migrations). Tools that previously read that format should pick the
37
+ * entry matching `latestVersion` from `chain` and use its `ir` field.
16
38
  */
17
39
  export declare function schemaIrHandler(options: SchemaIrOptions): Promise<void>;
18
40
  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;CAChB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAoB7E"}
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;CAChB;AAQD,UAAU,gBAAgB;IACxB,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC;IACzC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;CACvC;AAwBD,wBAAsB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAiClF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAuC7E"}
@@ -4,7 +4,9 @@ export interface DocumentTypeAsset {
4
4
  readonly documentTypeName: string;
5
5
  readonly documentStorageType: {
6
6
  readonly type: "yjs";
7
- readonly yjs: DocumentTypeSchema;
7
+ readonly yjs: {
8
+ readonly schema: DocumentTypeSchema;
9
+ };
8
10
  };
9
11
  readonly fileSystemType: FileSystemType;
10
12
  readonly schemaVersion: number;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/commands/types.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,SAAS,CAAC;AAErD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,mBAAmB,EAAE;QAC5B,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;QACrB,QAAQ,CAAC,GAAG,EAAE,kBAAkB,CAAC;KAClC,CAAC;IACF,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IACxC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/commands/types.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,SAAS,CAAC;AAErD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,mBAAmB,EAAE;QAC5B,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;QACrB,QAAQ,CAAC,GAAG,EAAE;YACZ,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC;SACrC,CAAC;KACH,CAAC;IACF,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IACxC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=generateDocumentTypeFromSchema.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateDocumentTypeFromSchema.test.d.ts","sourceRoot":"","sources":["../../../../../src/utils/schema/__tests__/generateDocumentTypeFromSchema.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,17 @@
1
+ import type { ResolvedIrChain } from "./resolveSchemaChain.js";
2
+ /**
3
+ * Generate documentType.ts: runtime constants for the document type's user-facing
4
+ * identity, sourced from the IR's top-level `name` and `description`.
5
+ *
6
+ * Output:
7
+ * ```
8
+ * export const DOCUMENT_TYPE_NAME = "Canvas Document";
9
+ * export const DOCUMENT_TYPE_DESCRIPTION = "Schema for the Demo Canvas Application";
10
+ * ```
11
+ *
12
+ * Identity is read off the latest chain entry's IR — it is the same string on
13
+ * every entry (populated by `resolveSchemaChain` from pack-config), so the
14
+ * choice of entry is incidental.
15
+ */
16
+ export declare function generateDocumentTypeFromChain(resolved: ResolvedIrChain): string;
17
+ //# sourceMappingURL=generateDocumentTypeFromSchema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateDocumentTypeFromSchema.d.ts","sourceRoot":"","sources":["../../../../src/utils/schema/generateDocumentTypeFromSchema.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D;;;;;;;;;;;;;GAaG;AACH,wBAAgB,6BAA6B,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,CAO/E"}
@@ -8,6 +8,7 @@ import type { ResolvedIrChain } from "./resolveSchemaChain.js";
8
8
  * - `types.js` (star export — latest-version type aliases)
9
9
  * - `versions.js` (star export — SupportedVersions, LatestVersion, MinSupportedVersion)
10
10
  * - `versionedDocRef.js` (star export — VersionedDocRef types and factory)
11
+ * - `documentType.js` (star export — DOCUMENT_TYPE_NAME and DOCUMENT_TYPE_DESCRIPTION)
11
12
  * - `DocumentUpgradeFns` type (the typed shape the factory accepts)
12
13
  * - Per supported version: explicit named type exports from `types_vN.js`
13
14
  * (not star exports, to avoid polluting autocomplete for read-only consumers)
@@ -1 +1 @@
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;AAY/D;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,eAAe,EACzB,mBAAmB,CAAC,EAAE,MAAM,GAC3B,MAAM,CA2CR"}
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;AAa/D;;;;;;;;;;;;;GAaG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,eAAe,EACzB,mBAAmB,CAAC,EAAE,MAAM,GAC3B,MAAM,CA4CR"}
@@ -16,6 +16,16 @@ export interface ResolvedIrChain {
16
16
  latestVersion: number;
17
17
  minVersion: number;
18
18
  }
19
+ export interface IrChainPayload {
20
+ __comment?: string;
21
+ latestVersion: number;
22
+ minSupportedVersion?: number;
23
+ chain: VersionedIrEntry[];
24
+ }
25
+ export interface SchemaIdentity {
26
+ readonly name?: string;
27
+ readonly description?: string;
28
+ }
19
29
  /**
20
30
  * Validate `minSupportedVersion` against an already-resolved chain and return
21
31
  * the effective `minVersion`. Throws on invalid input.
@@ -27,9 +37,12 @@ export declare function resolveMinVersion(chain: VersionedIrEntry[], minSupporte
27
37
  /**
28
38
  * Collect the version chain and resolve min/latest versions.
29
39
  * Each version's models are converted to IR (IRealTimeDocumentSchema).
40
+ * `identity.name` / `identity.description` are embedded into each chain entry's
41
+ * IR; when omitted (e.g. test callers), `convertSchemaToIr` falls back to its
42
+ * defaults.
30
43
  * Throws on empty chain or invalid minSupportedVersion.
31
44
  */
32
- export declare function resolveSchemaChain(schema: SchemaDefinition, minSupportedVersion?: number): ResolvedIrChain;
45
+ export declare function resolveSchemaChain(schema: SchemaDefinition, minSupportedVersion?: number, identity?: SchemaIdentity): ResolvedIrChain;
33
46
  /**
34
47
  * True if any migration in the chain declares a non-empty `derivedFrom`. Drives
35
48
  * whether the generated SDK emits `DocumentModel` as a factory (requires the
@@ -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,EAAE,uBAAuB,EAAE,MAAM,yDAAyD,CAAC;AAGvG,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;AAwCD;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,gBAAgB,EAAE,EACzB,mBAAmB,EAAE,MAAM,GAAG,SAAS,GACtC;IAAE,aAAa,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAkB/C;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,gBAAgB,EACxB,mBAAmB,CAAC,EAAE,MAAM,GAC3B,eAAe,CAIjB;AAED;;;;GA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CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAkB/C;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,gBAAgB,EACxB,mBAAmB,CAAC,EAAE,MAAM,EAC5B,QAAQ,GAAE,cAAmB,GAC5B,eAAe,CAIjB;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAUxE"}
@@ -26,4 +26,6 @@ export declare const INTERNAL_UPGRADE_FNS_PATH = "./_internal/upgradeFns.js";
26
26
  export declare const VERSIONS_PATH = "./versions.js";
27
27
  /** Versioned doc ref file path: `./versionedDocRef.js` */
28
28
  export declare const VERSIONED_DOC_REF_PATH = "./versionedDocRef.js";
29
+ /** Document type identity constants file path: `./documentType.js` */
30
+ export declare const DOCUMENT_TYPE_PATH = "./documentType.js";
29
31
  //# sourceMappingURL=runtimeSchema.d.ts.map
@@ -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,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;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AAC;AAEhD,gDAAgD;AAChD,eAAO,MAAM,oBAAoB,gBAAgB,CAAC;AAElD,sCAAsC;AACtC,eAAO,MAAM,WAAW,gBAAgB,CAAC;AAEzC,6DAA6D;AAC7D,eAAO,MAAM,sBAAsB,4BAA4B,CAAC;AAEhE,wEAAwE;AACxE,eAAO,MAAM,yBAAyB,8BAA8B,CAAC;AAErE,0CAA0C;AAC1C,eAAO,MAAM,aAAa,kBAAkB,CAAC;AAE7C,0DAA0D;AAC1D,eAAO,MAAM,sBAAsB,yBAAyB,CAAC;AAE7D,sEAAsE;AACtE,eAAO,MAAM,kBAAkB,sBAAsB,CAAC"}
@@ -4,5 +4,4 @@ import type { ResolvedIrChain } from "./resolveSchemaChain.js";
4
4
  * them to `outputDir`.
5
5
  */
6
6
  export declare function writeAllSdkFiles(resolved: ResolvedIrChain, outputDir: string, minSupportedVersion: number | undefined): Promise<void>;
7
- export declare function parseMinVersion(minVersion: string | undefined): number | undefined;
8
7
  //# sourceMappingURL=writeAllSdkFiles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"writeAllSdkFiles.d.ts","sourceRoot":"","sources":["../../../../src/utils/schema/writeAllSdkFiles.ts"],"names":[],"mappings":"AA0BA,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,CAyEf;AAED,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAOlF"}
1
+ {"version":3,"file":"writeAllSdkFiles.d.ts","sourceRoot":"","sources":["../../../../src/utils/schema/writeAllSdkFiles.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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@palantir/pack.document-schema.type-gen",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "description": "TypeScript type generation from document schema",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -27,8 +27,8 @@
27
27
  "tiny-invariant": "^1.3.3",
28
28
  "yaml": "^2.8.2",
29
29
  "zod": "^4.1.13",
30
- "@palantir/pack.document-schema.model-types": "~0.10.0",
31
- "@palantir/pack.schema": "0.6.0"
30
+ "@palantir/pack.schema": "0.7.0",
31
+ "@palantir/pack.document-schema.model-types": "~0.11.0"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/fs-extra": "^11.0.4",