@palantir/pack.document-schema.type-gen 0.17.0 → 0.19.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 (58) hide show
  1. package/build/esm/commands/ir/__tests__/resolveIrInput.test.js +11 -0
  2. package/build/esm/commands/ir/__tests__/resolveIrInput.test.js.map +1 -1
  3. package/build/esm/commands/ir/irDeployHandler.js +8 -4
  4. package/build/esm/commands/ir/irDeployHandler.js.map +1 -1
  5. package/build/esm/commands/ir/irGenAssetHandler.js +18 -10
  6. package/build/esm/commands/ir/irGenAssetHandler.js.map +1 -1
  7. package/build/esm/commands/ir/resolveIrInput.js +2 -1
  8. package/build/esm/commands/ir/resolveIrInput.js.map +1 -1
  9. package/build/esm/commands/schema/__tests__/readPackConfig.test.js +25 -2
  10. package/build/esm/commands/schema/__tests__/readPackConfig.test.js.map +1 -1
  11. package/build/esm/commands/schema/schemaIrHandler.js +14 -2
  12. package/build/esm/commands/schema/schemaIrHandler.js.map +1 -1
  13. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/custom-discriminant.js +1 -1
  14. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/custom-discriminant.js.map +1 -1
  15. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/external-refs.js +1 -1
  16. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/external-refs.js.map +1 -1
  17. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/simple-record.js +1 -1
  18. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/simple-record.js.map +1 -1
  19. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/union-types.js +1 -1
  20. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/union-types.js.map +1 -1
  21. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/array-and-map-types.js +1 -1
  22. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/array-and-map-types.js.map +1 -1
  23. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/boolean-fields.js +1 -1
  24. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/boolean-fields.js.map +1 -1
  25. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/custom-discriminant.js +1 -1
  26. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/custom-discriminant.js.map +1 -1
  27. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/datetime-fields.js +1 -1
  28. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/datetime-fields.js.map +1 -1
  29. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/simple-records.js +1 -1
  30. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/simple-records.js.map +1 -1
  31. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/union-before-records.js +1 -1
  32. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/union-before-records.js.map +1 -1
  33. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/union-types.js +1 -1
  34. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/union-types.js.map +1 -1
  35. package/build/esm/utils/schema/__tests__/__snapshots__/generateDocumentTypeFromSchema/with-name-and-description.js +1 -1
  36. package/build/esm/utils/schema/__tests__/__snapshots__/generateDocumentTypeFromSchema/with-name-and-description.js.map +1 -1
  37. package/build/esm/utils/schema/__tests__/__snapshots__/generateVersionsFromSchema/single-version.js.map +1 -1
  38. package/build/esm/utils/schema/__tests__/__snapshots__/generateVersionsFromSchema/three-version-chain.js.map +1 -1
  39. package/build/esm/utils/schema/__tests__/__snapshots__/generateVersionsFromSchema/two-version.js.map +1 -1
  40. package/build/esm/utils/schema/resolveSchemaChain.js.map +1 -1
  41. package/build/esm/utils/steps/__tests__/__snapshots__/types/arrayFields.js.map +1 -1
  42. package/build/esm/utils/steps/__tests__/__snapshots__/types/customDiscriminant.js +1 -1
  43. package/build/esm/utils/steps/__tests__/__snapshots__/types/customDiscriminant.js.map +1 -1
  44. package/build/esm/utils/steps/__tests__/__snapshots__/types/generateTypeScriptInterfaces.js +1 -1
  45. package/build/esm/utils/steps/__tests__/__snapshots__/types/generateTypeScriptInterfaces.js.map +1 -1
  46. package/build/esm/utils/steps/__tests__/__snapshots__/types/refTypes.js.map +1 -1
  47. package/build/esm/utils/steps/__tests__/__snapshots__/types/simpleRecord.js.map +1 -1
  48. package/build/esm/utils/steps/__tests__/__snapshots__/types/simpleSteps.js +1 -1
  49. package/build/esm/utils/steps/__tests__/__snapshots__/types/simpleSteps.js.map +1 -1
  50. package/build/types/commands/ir/irDeployHandler.d.ts.map +1 -1
  51. package/build/types/commands/ir/irGenAssetHandler.d.ts.map +1 -1
  52. package/build/types/commands/ir/resolveIrInput.d.ts +1 -0
  53. package/build/types/commands/ir/resolveIrInput.d.ts.map +1 -1
  54. package/build/types/commands/schema/schemaIrHandler.d.ts +4 -0
  55. package/build/types/commands/schema/schemaIrHandler.d.ts.map +1 -1
  56. package/build/types/utils/schema/resolveSchemaChain.d.ts +1 -0
  57. package/build/types/utils/schema/resolveSchemaChain.d.ts.map +1 -1
  58. package/package.json +2 -2
@@ -52,6 +52,17 @@ describe("resolveIrInput", () => {
52
52
  minSupportedVersion: 1
53
53
  });
54
54
  });
55
+ it("carries owningApplicationId through from a chain payload", () => {
56
+ const resolved = resolveIrInput({
57
+ latestVersion: 1,
58
+ owningApplicationId: "app-123",
59
+ chain: [{
60
+ version: 1,
61
+ ir: ir(1)
62
+ }]
63
+ }, "chain.json");
64
+ expect(resolved.owningApplicationId).toBe("app-123");
65
+ });
55
66
  it("defaults chain minSupportedVersion to latestVersion", () => {
56
67
  const resolved = resolveIrInput({
57
68
  latestVersion: 3,
@@ -1 +1 @@
1
- {"version":3,"file":"resolveIrInput.test.js","names":["describe","expect","it","resolveIrInput","ir","version","name","description","primaryModelKeys","models","resolved","toEqual","latestVersion","minSupportedVersion","chain","toBe","toThrow"],"sources":["resolveIrInput.test.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { describe, expect, it } from \"vitest\";\nimport type { IRealTimeDocumentSchema } from \"../../../lib/pack-docschema-api/pack-docschema-ir/index.js\";\nimport { resolveIrInput } from \"../resolveIrInput.js\";\n\nfunction ir(version: number): IRealTimeDocumentSchema {\n return {\n name: `Test v${version}`,\n description: \"Test schema\",\n version,\n primaryModelKeys: [],\n models: {},\n };\n}\n\ndescribe(\"resolveIrInput\", () => {\n it(\"passes through legacy single-version IR\", () => {\n const resolved = resolveIrInput(ir(2), \"legacy.json\");\n\n expect(resolved).toEqual({\n ir: ir(2),\n latestVersion: 2,\n minSupportedVersion: 2,\n });\n });\n\n it(\"selects the latest entry from a versioned IR chain\", () => {\n const resolved = resolveIrInput({\n latestVersion: 3,\n minSupportedVersion: 1,\n chain: [\n { version: 1, ir: ir(1) },\n { version: 3, ir: ir(3) },\n ],\n }, \"chain.json\");\n\n expect(resolved).toEqual({\n ir: ir(3),\n latestVersion: 3,\n minSupportedVersion: 1,\n });\n });\n\n it(\"defaults chain minSupportedVersion to latestVersion\", () => {\n const resolved = resolveIrInput({\n latestVersion: 3,\n chain: [\n { version: 1, ir: ir(1) },\n { version: 3, ir: ir(3) },\n ],\n }, \"chain.json\");\n\n expect(resolved.minSupportedVersion).toBe(3);\n });\n\n it(\"rejects an empty chain\", () => {\n expect(() =>\n resolveIrInput({\n latestVersion: 1,\n chain: [],\n }, \"empty.json\")\n ).toThrow(\"chain\");\n });\n\n it(\"rejects a chain with an invalid minSupportedVersion\", () => {\n expect(() =>\n resolveIrInput({\n latestVersion: 3,\n minSupportedVersion: 2,\n chain: [\n { version: 1, ir: ir(1) },\n { version: 3, ir: ir(3) },\n ],\n }, \"missing.json\")\n ).toThrow(\"minSupportedVersion 2\");\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAE7C,SAASC,cAAc,QAAQ,sBAAsB;AAErD,SAASC,EAAEA,CAACC,OAAe,EAA2B;EACpD,OAAO;IACLC,IAAI,EAAE,SAASD,OAAO,EAAE;IACxBE,WAAW,EAAE,aAAa;IAC1BF,OAAO;IACPG,gBAAgB,EAAE,EAAE;IACpBC,MAAM,EAAE,CAAC;EACX,CAAC;AACH;AAEAT,QAAQ,CAAC,gBAAgB,EAAE,MAAM;EAC/BE,EAAE,CAAC,yCAAyC,EAAE,MAAM;IAClD,MAAMQ,QAAQ,GAAGP,cAAc,CAACC,EAAE,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC;IAErDH,MAAM,CAACS,QAAQ,CAAC,CAACC,OAAO,CAAC;MACvBP,EAAE,EAAEA,EAAE,CAAC,CAAC,CAAC;MACTQ,aAAa,EAAE,CAAC;MAChBC,mBAAmB,EAAE;IACvB,CAAC,CAAC;EACJ,CAAC,CAAC;EAEFX,EAAE,CAAC,oDAAoD,EAAE,MAAM;IAC7D,MAAMQ,QAAQ,GAAGP,cAAc,CAAC;MAC9BS,aAAa,EAAE,CAAC;MAChBC,mBAAmB,EAAE,CAAC;MACtBC,KAAK,EAAE,CACL;QAAET,OAAO,EAAE,CAAC;QAAED,EAAE,EAAEA,EAAE,CAAC,CAAC;MAAE,CAAC,EACzB;QAA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,CACnB,CAAC,CAACY,OAAO,CAAC,uBAAuB,CAAC;EACpC,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"resolveIrInput.test.js","names":["describe","expect","it","resolveIrInput","ir","version","name","description","primaryModelKeys","models","resolved","toEqual","latestVersion","minSupportedVersion","chain","owningApplicationId","toBe","toThrow"],"sources":["resolveIrInput.test.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { describe, expect, it } from \"vitest\";\nimport type { IRealTimeDocumentSchema } from \"../../../lib/pack-docschema-api/pack-docschema-ir/index.js\";\nimport { resolveIrInput } from \"../resolveIrInput.js\";\n\nfunction ir(version: number): IRealTimeDocumentSchema {\n return {\n name: `Test v${version}`,\n description: \"Test schema\",\n version,\n primaryModelKeys: [],\n models: {},\n };\n}\n\ndescribe(\"resolveIrInput\", () => {\n it(\"passes through legacy single-version IR\", () => {\n const resolved = resolveIrInput(ir(2), \"legacy.json\");\n\n expect(resolved).toEqual({\n ir: ir(2),\n latestVersion: 2,\n minSupportedVersion: 2,\n });\n });\n\n it(\"selects the latest entry from a versioned IR chain\", () => {\n const resolved = resolveIrInput({\n latestVersion: 3,\n minSupportedVersion: 1,\n chain: [\n { version: 1, ir: ir(1) },\n { version: 3, ir: ir(3) },\n ],\n }, \"chain.json\");\n\n expect(resolved).toEqual({\n ir: ir(3),\n latestVersion: 3,\n minSupportedVersion: 1,\n });\n });\n\n it(\"carries owningApplicationId through from a chain payload\", () => {\n const resolved = resolveIrInput({\n latestVersion: 1,\n owningApplicationId: \"app-123\",\n chain: [{ version: 1, ir: ir(1) }],\n }, \"chain.json\");\n\n expect(resolved.owningApplicationId).toBe(\"app-123\");\n });\n\n it(\"defaults chain minSupportedVersion to latestVersion\", () => {\n const resolved = resolveIrInput({\n latestVersion: 3,\n chain: [\n { version: 1, ir: ir(1) },\n { version: 3, ir: ir(3) },\n ],\n }, \"chain.json\");\n\n expect(resolved.minSupportedVersion).toBe(3);\n });\n\n it(\"rejects an empty chain\", () => {\n expect(() =>\n resolveIrInput({\n latestVersion: 1,\n chain: [],\n }, \"empty.json\")\n ).toThrow(\"chain\");\n });\n\n it(\"rejects a chain with an invalid minSupportedVersion\", () => {\n expect(() =>\n resolveIrInput({\n latestVersion: 3,\n minSupportedVersion: 2,\n chain: [\n { version: 1, ir: ir(1) },\n { version: 3, ir: ir(3) },\n ],\n }, \"missing.json\")\n ).toThrow(\"minSupportedVersion 2\");\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAE7C,SAASC,cAAc,QAAQ,sBAAsB;AAErD,SAASC,EAAEA,CAACC,OAAe,EAA2B;EACpD,OAAO;IACLC,IAAI,EAAE,SAASD,OAAO,EAAE;IACxBE,WAAW,EAAE,aAAa;IAC1BF,OAAO;IACPG,gBAAgB,EAAE,EAAE;IACpBC,MAAM,EAAE,CAAC;EACX,CAAC;AACH;AAEAT,QAAQ,CAAC,gBAAgB,EAAE,MAAM;EAC/BE,EAAE,CAAC,yCAAyC,EAAE,MAAM;IAClD,MAAMQ,QAAQ,GAAGP,cAAc,CAACC,EAAE,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC;IAErDH,MAAM,CAACS,QAAQ,CAAC,CAACC,OAAO,CAAC;MACvBP,EAAE,EAAEA,EAAE,CAAC,CAAC,CAAC;MACTQ,aAAa,EAAE,CAAC;MA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B,CAAC,EAAE,YAAY,CAAC;IAEhBH,MAAM,CAACS,QAAQ,CAACG,mBAAmB,CAAC,CAACG,IAAI,CAAC,CAAC,CAAC;EAC9C,CAAC,CAAC;EAEFd,EAAE,CAAC,wBAAwB,EAAE,MAAM;IACjCD,MAAM,CAAC,MACLE,cAAc,CAAC;MACbS,aAAa,EAAE,CAAC;MAChBE,KAAK,EAAE;IACT,CAAC,EAAE,YAAY,CACjB,CAAC,CAACG,OAAO,CAAC,OAAO,CAAC;EACpB,CAAC,CAAC;EAEFf,EAAE,CAAC,qDAAqD,EAAE,MAAM;IAC9DD,MAAM,CAAC,MACLE,cAAc,CAAC;MACbS,aAAa,EAAE,CAAC;MAChBC,mBAAmB,EAAE,CAAC;MACtBC,KAAK,EAAE,CACL;QAAET,OAAO,EAAE,CAAC;QAAED,EAAE,EAAEA,EAAE,CAAC,CAAC;MAAE,CAAC,EACzB;QAAEC,OAAO,EAAE,CAAC;QAAED,EAAE,EAAEA,EAAE,CAAC,CAAC;MAAE,CAAC;IAE7B,CAAC,EAAE,cAAc,CACnB,CAAC,CAACa,OAAO,CAAC,uBAAuB,CAAC;EACpC,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -29,12 +29,13 @@ export async function irDeployHandler(options) {
29
29
  consola.info(`Reading schema from: ${irPath}`);
30
30
  const {
31
31
  ir,
32
- latestVersion
32
+ latestVersion,
33
+ owningApplicationId
33
34
  } = resolveIrInput(JSON.parse(readFileSync(irPath, "utf8")), irPath);
34
35
  const schema = convertIrToWireSchema(ir);
35
36
  const fileSystemType = options.fileSystemType ?? "ARTIFACTS";
36
37
  if (options.firstParty) {
37
- await deployFirstParty(options, ir.name, schema, latestVersion, fileSystemType);
38
+ await deployFirstParty(options, ir.name, schema, latestVersion, fileSystemType, owningApplicationId);
38
39
  } else {
39
40
  await deployThirdParty(options, ir.name, schema, fileSystemType);
40
41
  }
@@ -63,7 +64,7 @@ async function deployThirdParty(options, name, schema, fileSystemType) {
63
64
  });
64
65
  consola.success("Successfully created document type", result);
65
66
  }
66
- async function deployFirstParty(options, name, schema, version, fileSystemType) {
67
+ async function deployFirstParty(options, name, schema, version, fileSystemType, owningApplicationId) {
67
68
  if (options.ontologyRid == null) {
68
69
  throw new CommanderError(1, "EINVAL", "--ontology-rid is required when deploying a first-party document type");
69
70
  }
@@ -78,7 +79,10 @@ async function deployFirstParty(options, name, schema, version, fileSystemType)
78
79
  ontologyRid: options.ontologyRid,
79
80
  schema,
80
81
  version,
81
- fileSystemType
82
+ fileSystemType,
83
+ ...(owningApplicationId != null ? {
84
+ owningApplicationId
85
+ } : {})
82
86
  }
83
87
  };
84
88
  consola.info("Creating first-party document type", request);
@@ -1 +1 @@
1
- {"version":3,"file":"irDeployHandler.js","names":["createPlatformClient","PalantirApiError","DocumentTypes","CommanderError","consola","readFileSync","resolve","convertIrToWireSchema","buildPrefixRewriteFetch","DEFAULT_API_PREFIX","resolveIrInput","irDeployHandler","options","irPath","ir","info","latestVersion","JSON","parse","schema","fileSystemType","firstParty","deployFirstParty","name","deployThirdParty","error","parentFolder","osdkClient","baseUrl","Promise","auth","request","parentFolderRid","result","create","preview","success","version","ontologyRid","fetchFn","firstPartyPrefix","undefined","requestBody","createFirstParty","message","errorName","errorCode","details","filter","Boolean","join"],"sources":["irDeployHandler.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createPlatformClient, PalantirApiError } from \"@osdk/client\";\nimport type {\n CreateDocumentTypeRequest,\n CreateFirstPartyDocumentTypeRequest,\n FileSystemType,\n} from \"@osdk/foundry.pack\";\nimport { DocumentTypes } from \"@osdk/foundry.pack\";\nimport { CommanderError } from \"commander\";\nimport { consola } from \"consola\";\nimport { readFileSync } from \"fs\";\nimport { resolve } from \"path\";\nimport { convertIrToWireSchema } from \"../../utils/ir/convertIrToWireSchema.js\";\nimport { buildPrefixRewriteFetch, DEFAULT_API_PREFIX } from \"../utils/firstPartyPrefix.js\";\nimport { resolveIrInput } from \"./resolveIrInput.js\";\n\ninterface DeployOptions {\n readonly ir: string;\n readonly baseUrl: string;\n readonly auth: string;\n readonly fileSystemType?: FileSystemType;\n readonly firstParty?: boolean;\n /** Required for third-party deploys. */\n readonly parentFolder?: string;\n /** Required for first-party deploys. */\n readonly ontologyRid?: string;\n /** Overrides the API prefix for first-party deploys (e.g. /api/gotham). */\n readonly firstPartyPrefix?: string;\n}\n\nexport async function irDeployHandler(options: DeployOptions): Promise<void> {\n try {\n const irPath = resolve(options.ir);\n consola.info(`Reading schema from: ${irPath}`);\n\n const { ir, latestVersion } = resolveIrInput(\n JSON.parse(readFileSync(irPath, \"utf8\")) as unknown,\n irPath,\n );\n const schema = convertIrToWireSchema(ir);\n const fileSystemType = options.fileSystemType ?? \"ARTIFACTS\";\n\n if (options.firstParty) {\n await deployFirstParty(options, ir.name, schema, latestVersion, fileSystemType);\n } else {\n await deployThirdParty(options, ir.name, schema, fileSystemType);\n }\n } catch (error) {\n if (error instanceof CommanderError) {\n throw error;\n }\n consola.error(\"❌ Error during Deploy:\", error);\n throw new CommanderError(1, \"ERRIRMDEPLOY\", \"Error deploying IR document schema\");\n }\n}\n\ntype DocumentTypeSchema = CreateDocumentTypeRequest[\"schema\"];\n\nasync function deployThirdParty(\n options: DeployOptions,\n name: string,\n schema: DocumentTypeSchema,\n fileSystemType: FileSystemType,\n): Promise<void> {\n if (options.parentFolder == null) {\n throw new CommanderError(\n 1,\n \"EINVAL\",\n \"--parent-folder is required when deploying a third-party document type\",\n );\n }\n\n const osdkClient = createPlatformClient(options.baseUrl, () => Promise.resolve(options.auth));\n\n const request: CreateDocumentTypeRequest = {\n name,\n parentFolderRid: options.parentFolder,\n schema,\n fileSystemType,\n };\n\n consola.info(\"Creating document type with schema\", request);\n const result = await DocumentTypes.create(osdkClient, request, { preview: true });\n consola.success(\"Successfully created document type\", result);\n}\n\nasync function deployFirstParty(\n options: DeployOptions,\n name: string,\n schema: DocumentTypeSchema,\n version: number,\n fileSystemType: FileSystemType,\n): Promise<void> {\n if (options.ontologyRid == null) {\n throw new CommanderError(\n 1,\n \"EINVAL\",\n \"--ontology-rid is required when deploying a first-party document type\",\n );\n }\n\n const fetchFn = options.firstPartyPrefix != null\n ? buildPrefixRewriteFetch(options.firstPartyPrefix)\n : undefined;\n if (fetchFn != null) {\n consola.info(`Rewriting OSDK '${DEFAULT_API_PREFIX}' -> '${options.firstPartyPrefix}'`);\n }\n\n const osdkClient = createPlatformClient(\n options.baseUrl,\n () => Promise.resolve(options.auth),\n undefined,\n fetchFn,\n );\n\n const request: CreateFirstPartyDocumentTypeRequest = {\n requestBody: {\n name,\n ontologyRid: options.ontologyRid,\n schema,\n version,\n fileSystemType,\n },\n };\n\n consola.info(\"Creating first-party document type\", request);\n try {\n const result = await DocumentTypes.createFirstParty(osdkClient, request, { preview: true });\n consola.success(\"Successfully created first-party document type\", result);\n } catch (error) {\n if (error instanceof PalantirApiError) {\n const { message, errorName, errorCode } = error;\n const details = [errorName, errorCode].filter(Boolean).join(\" \");\n consola.error(\n `❌ Error during first-party deploy: ${message}${details ? ` [${details}]` : \"\"}`,\n );\n }\n throw error;\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,oBAAoB,EAAEC,gBAAgB,QAAQ,cAAc;AAMrE,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,cAAc,QAAQ,WAAW;AAC1C,SAASC,OAAO,QAAQ,SAAS;AACjC,SAASC,YAAY,QAAQ,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MR,OAA4C,GAAG;IACnDW,WAAW,EAAE;MACXnB,IAAI;MACJe,WAAW,EAAE1B,OAAO,CAAC0B,WAAW;MAChCnB,MAAM;MACNkB,OAAO;MACPjB;IACF;EACF,CAAC;EAEDhB,OAAO,CAACW,IAAI,CAAC,oCAAoC,EAAEgB,OAAO,CAAC;EAC3D,IAAI;IACF,MAAME,MAAM,GAAG,MAAM/B,aAAa,CAACyC,gBAAgB,CAAChB,UAAU,EAAEI,OAAO,EAAE;MAAEI,OAAO,EAAE;IAAK,CAAC,CAAC;IAC3F/B,OAAO,CAACgC,OAAO,CAAC,gDAAgD,EAAEH,MAAM,CAAC;EAC3E,CAAC,CAAC,OAAOR,KAAK,EAAE;IACd,IAAIA,KAAK,YAAYxB,gBAAgB,EAAE;MACrC,MAAM;QAAE2C,OAAO;QAAEC,SAAS;QAAEC;MAAU,CAAC,GAAGrB,KAAK;MAC/C,MAAMsB,OAAO,GAAG,CAACF,SAAS,EAAEC,SAAS,CAAC,CAACE,MAAM,CAACC,OAAO,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC;MAChE9C,OAAO,CAACqB,KAAK,CACX,sCAAsCmB,OAAO,GAAGG,OAAO,GAAG,KAAKA,OAAO,GAAG,GAAG,EAAE,EAChF,CAAC;IACH;IACA,MAAMtB,KAAK;EACb;AACF","ignoreList":[]}
1
+ {"version":3,"file":"irDeployHandler.js","names":["createPlatformClient","PalantirApiError","DocumentTypes","CommanderError","consola","readFileSync","resolve","convertIrToWireSchema","buildPrefixRewriteFetch","DEFAULT_API_PREFIX","resolveIrInput","irDeployHandler","options","irPath","ir","info","latestVersion","owningApplicationId","JSON","parse","schema","fileSystemType","firstParty","deployFirstParty","name","deployThirdParty","error","parentFolder","osdkClient","baseUrl","Promise","auth","request","parentFolderRid","result","create","preview","success","version","ontologyRid","fetchFn","firstPartyPrefix","undefined","requestBody","createFirstParty","message","errorName","errorCode","details","filter","Boolean","join"],"sources":["irDeployHandler.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createPlatformClient, PalantirApiError } from \"@osdk/client\";\nimport type {\n CreateDocumentTypeRequest,\n CreateFirstPartyDocumentTypeRequest,\n FileSystemType,\n} from \"@osdk/foundry.pack\";\nimport { DocumentTypes } from \"@osdk/foundry.pack\";\nimport { CommanderError } from \"commander\";\nimport { consola } from \"consola\";\nimport { readFileSync } from \"fs\";\nimport { resolve } from \"path\";\nimport { convertIrToWireSchema } from \"../../utils/ir/convertIrToWireSchema.js\";\nimport { buildPrefixRewriteFetch, DEFAULT_API_PREFIX } from \"../utils/firstPartyPrefix.js\";\nimport { resolveIrInput } from \"./resolveIrInput.js\";\n\ninterface DeployOptions {\n readonly ir: string;\n readonly baseUrl: string;\n readonly auth: string;\n readonly fileSystemType?: FileSystemType;\n readonly firstParty?: boolean;\n /** Required for third-party deploys. */\n readonly parentFolder?: string;\n /** Required for first-party deploys. */\n readonly ontologyRid?: string;\n /** Overrides the API prefix for first-party deploys (e.g. /api/gotham). */\n readonly firstPartyPrefix?: string;\n}\n\nexport async function irDeployHandler(options: DeployOptions): Promise<void> {\n try {\n const irPath = resolve(options.ir);\n consola.info(`Reading schema from: ${irPath}`);\n\n const { ir, latestVersion, owningApplicationId } = resolveIrInput(\n JSON.parse(readFileSync(irPath, \"utf8\")) as unknown,\n irPath,\n );\n const schema = convertIrToWireSchema(ir);\n const fileSystemType = options.fileSystemType ?? \"ARTIFACTS\";\n\n if (options.firstParty) {\n await deployFirstParty(\n options,\n ir.name,\n schema,\n latestVersion,\n fileSystemType,\n owningApplicationId,\n );\n } else {\n await deployThirdParty(options, ir.name, schema, fileSystemType);\n }\n } catch (error) {\n if (error instanceof CommanderError) {\n throw error;\n }\n consola.error(\"❌ Error during Deploy:\", error);\n throw new CommanderError(1, \"ERRIRMDEPLOY\", \"Error deploying IR document schema\");\n }\n}\n\ntype DocumentTypeSchema = CreateDocumentTypeRequest[\"schema\"];\n\nasync function deployThirdParty(\n options: DeployOptions,\n name: string,\n schema: DocumentTypeSchema,\n fileSystemType: FileSystemType,\n): Promise<void> {\n if (options.parentFolder == null) {\n throw new CommanderError(\n 1,\n \"EINVAL\",\n \"--parent-folder is required when deploying a third-party document type\",\n );\n }\n\n const osdkClient = createPlatformClient(options.baseUrl, () => Promise.resolve(options.auth));\n\n const request: CreateDocumentTypeRequest = {\n name,\n parentFolderRid: options.parentFolder,\n schema,\n fileSystemType,\n };\n\n consola.info(\"Creating document type with schema\", request);\n const result = await DocumentTypes.create(osdkClient, request, { preview: true });\n consola.success(\"Successfully created document type\", result);\n}\n\nasync function deployFirstParty(\n options: DeployOptions,\n name: string,\n schema: DocumentTypeSchema,\n version: number,\n fileSystemType: FileSystemType,\n owningApplicationId: string | undefined,\n): Promise<void> {\n if (options.ontologyRid == null) {\n throw new CommanderError(\n 1,\n \"EINVAL\",\n \"--ontology-rid is required when deploying a first-party document type\",\n );\n }\n\n const fetchFn = options.firstPartyPrefix != null\n ? buildPrefixRewriteFetch(options.firstPartyPrefix)\n : undefined;\n if (fetchFn != null) {\n consola.info(`Rewriting OSDK '${DEFAULT_API_PREFIX}' -> '${options.firstPartyPrefix}'`);\n }\n\n const osdkClient = createPlatformClient(\n options.baseUrl,\n () => Promise.resolve(options.auth),\n undefined,\n fetchFn,\n );\n\n const request: CreateFirstPartyDocumentTypeRequest = {\n requestBody: {\n name,\n ontologyRid: options.ontologyRid,\n schema,\n version,\n fileSystemType,\n ...(owningApplicationId != null ? { owningApplicationId } : {}),\n },\n };\n\n consola.info(\"Creating first-party document type\", request);\n try {\n const result = await DocumentTypes.createFirstParty(osdkClient, request, { preview: true });\n consola.success(\"Successfully created first-party document type\", result);\n } catch (error) {\n if (error instanceof PalantirApiError) {\n const { message, errorName, errorCode } = error;\n const details = [errorName, errorCode].filter(Boolean).join(\" \");\n consola.error(\n `❌ Error during first-party deploy: ${message}${details ? ` [${details}]` : \"\"}`,\n );\n }\n throw error;\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,oBAAoB,EAAEC,gBAAgB,QAAQ,cAAc;AAMrE,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,cAAc,QAAQ,WAAW;AAC1C,SAASC,OAAO,QAAQ,SAAS;AACjC,SAASC,YAAY,QAAQ,IAAI;AACjC,SAASC,OAAO,QAAQ,MAAM;AAC9B,SAASC,qBAAqB,QAAQ,yCAAyC;AAC/E,SAASC,uBAAuB,EAAEC,kBAAkB,QAAQ,8BAA8B;AAC1F,SAASC,cAAc,QAAQ,qBAAqB;AAgBpD,OAAO,eAAeC,eAAeA,CAACC,OAAsB,EAAiB;EAC3E,IAAI;IACF,MAAMC,MAAM,GAAGP,OAAO,CAACM,OAAO,CAACE,EAAE,CAAC;IAClCV,OAAO,CAACW,IAAI,CAAC,wBAAwBF,MAAM,EAAE,CAAC;IAE9C,MAAM;MAAEC,EAAE;MAAEE,aAAa;MAAEC;IAAoB,CAAC,GAAGP,cAAc,CAC/DQ,IAAI,CAACC,KAAK,CAACd,YAAY,CAACQ,MAAM,EAAE,MAAM,CAAC,CAAC,EACxCA,MACF,CAAC;IACD,MAAMO,MAAM,GAAGb,qBAAqB,CAACO,EAAE,CAAC;IACxC,MAAMO,cAAc,GAAGT,OAAO,CAACS,cAAc,IAAI,WAAW;IAE5D,IAAIT,OAAO,CAACU,UAAU,EAAE;MACtB,MAAMC,gBAAgB,CACpBX,OAAO,EACPE,EAAE,CAACU,IAAI,EACPJ,MAAM,EACNJ,aAA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ACE,MAAM,CAACC,OAAO,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC;MAChE/C,OAAO,CAACsB,KAAK,CACX,sCAAsCmB,OAAO,GAAGG,OAAO,GAAG,KAAKA,OAAO,GAAG,GAAG,EAAE,EAChF,CAAC;IACH;IACA,MAAMtB,KAAK;EACb;AACF","ignoreList":[]}
@@ -59,7 +59,8 @@ export function irGenAssetHandler(options) {
59
59
  const {
60
60
  ir: irSchema,
61
61
  latestVersion,
62
- minSupportedVersion
62
+ minSupportedVersion,
63
+ owningApplicationId
63
64
  } = resolved;
64
65
  const {
65
66
  name: documentTypeName
@@ -69,13 +70,7 @@ export function irGenAssetHandler(options) {
69
70
  if (fileSystemType !== "ARTIFACTS" && fileSystemType !== "COMPASS") {
70
71
  throw new CommanderError(1, "EINVAL", `Invalid fileSystemType "${fileSystemType}". Must be "ARTIFACTS" or "COMPASS".`);
71
72
  }
72
- const outputDir = dirname(outputPath);
73
- if (!existsSync(outputDir)) {
74
- mkdirSync(outputDir, {
75
- recursive: true
76
- });
77
- }
78
- writeFileSync(outputPath, JSON.stringify({
73
+ const asset = {
79
74
  comment: GENERATED_JSON_COMMENT,
80
75
  documentTypeName,
81
76
  documentStorageType: {
@@ -83,8 +78,18 @@ export function irGenAssetHandler(options) {
83
78
  schema: wireSchema
84
79
  },
85
80
  fileSystemType,
86
- schemaVersion: latestVersion
87
- }, null, 2), "utf8");
81
+ schemaVersion: latestVersion,
82
+ ...(owningApplicationId != null ? {
83
+ owningApplicationId
84
+ } : {})
85
+ };
86
+ const outputDir = dirname(outputPath);
87
+ if (!existsSync(outputDir)) {
88
+ mkdirSync(outputDir, {
89
+ recursive: true
90
+ });
91
+ }
92
+ writeFileSync(outputPath, JSON.stringify(asset, null, 2), "utf8");
88
93
  const compatibilityRangePath = resolve(options.compatibilityRangeOutput ?? deriveCompatibilityRangePath(outputPath));
89
94
  const compatibilityRangeDir = dirname(compatibilityRangePath);
90
95
  if (!existsSync(compatibilityRangeDir)) {
@@ -107,6 +112,9 @@ export function irGenAssetHandler(options) {
107
112
  consola.info(` Schema version: ${latestVersion}`);
108
113
  consola.info(` Compatibility range: [${minSupportedVersion}, ${latestVersion}]`);
109
114
  consola.info(` File system type: ${fileSystemType}`);
115
+ if (owningApplicationId != null) {
116
+ consola.info(` Owning application id: ${owningApplicationId}`);
117
+ }
110
118
  } catch (error) {
111
119
  if (error instanceof CommanderError) {
112
120
  throw error;
@@ -1 +1 @@
1
- {"version":3,"file":"irGenAssetHandler.js","names":["CommanderError","consola","existsSync","mkdirSync","readFileSync","writeFileSync","basename","dirname","extname","join","resolve","GENERATED_JSON_COMMENT","convertIrToWireSchema","resolveIrInput","deriveCompatibilityRangePath","assetOutputPath","stem","irGenAssetHandler","options","irPath","ir","outputPath","output","info","parsed","JSON","parse","resolved","irSchema","latestVersion","minSupportedVersion","name","documentTypeName","wireSchema","fileSystemType","outputDir","recursive","stringify","comment","documentStorageType","type","schema","schemaVersion","compatibilityRangePath","compatibilityRangeOutput","compatibilityRangeDir","min","max","success","error"],"sources":["irGenAssetHandler.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 { DocumentTypeAsset, FileSystemType } from \"@osdk/foundry.pack\";\nimport { CommanderError } from \"commander\";\nimport { consola } from \"consola\";\nimport { existsSync, mkdirSync, readFileSync, writeFileSync } from \"fs\";\nimport { basename, dirname, extname, join, resolve } from \"path\";\nimport { GENERATED_JSON_COMMENT } from \"../../utils/generatedFileHeader.js\";\nimport { convertIrToWireSchema } from \"../../utils/ir/convertIrToWireSchema.js\";\nimport { resolveIrInput } from \"./resolveIrInput.js\";\n\ninterface IrGenAssetOptions {\n readonly ir: string;\n readonly output: string;\n readonly fileSystemType?: FileSystemType;\n readonly compatibilityRangeOutput?: string;\n}\n\ninterface SchemaCompatibilityRangeFile {\n readonly min: number;\n readonly max: number;\n}\n\nfunction deriveCompatibilityRangePath(assetOutputPath: string): string {\n const stem = basename(assetOutputPath, extname(assetOutputPath));\n return join(dirname(assetOutputPath), `${stem}-schema-compatibility-range.json`);\n}\n\n/**\n * Generates a document type asset JSON file (and a sibling schema\n * compatibility range JSON file) from an IR schema.\n *\n * The input IR may be either:\n * - a chain payload `{ latestVersion, minSupportedVersion?, chain }` produced\n * by `schema ir`. The latest entry's `ir` is used as the wire schema; the\n * asset's `schemaVersion` is `latestVersion`; the compatibility range is\n * `{ min: minSupportedVersion ?? latestVersion, max: latestVersion }`.\n * - a bare single-version `IRealTimeDocumentSchema` (legacy). The compat\n * range defaults to `{ min: version, max: version }` since no chain\n * information is available.\n *\n * This command is intended for internal platform applications where the\n * document type asset must exist on disk so the platform can discover it and\n * register the document type automatically at deploy time. Most users should\n * use `ir deploy` to register document types via the Foundry API instead.\n *\n * If you are unsure whether you need this command, you almost certainly do not.\n */\nexport function irGenAssetHandler(options: IrGenAssetOptions): void {\n try {\n const irPath = resolve(options.ir);\n const outputPath = resolve(options.output);\n\n if (!existsSync(irPath)) {\n throw new CommanderError(1, \"ENOENT\", `IR file does not exist: ${irPath}`);\n }\n\n consola.info(`Reading IR schema from: ${irPath}`);\n const parsed = JSON.parse(readFileSync(irPath, \"utf8\")) as unknown;\n\n const resolved = resolveIrInput(parsed, irPath);\n\n const { ir: irSchema, latestVersion, minSupportedVersion } = resolved;\n const { name: documentTypeName } = irSchema;\n const wireSchema = convertIrToWireSchema(irSchema);\n\n const fileSystemType = options.fileSystemType ?? \"ARTIFACTS\";\n if (fileSystemType !== \"ARTIFACTS\" && fileSystemType !== \"COMPASS\") {\n throw new CommanderError(\n 1,\n \"EINVAL\",\n `Invalid fileSystemType \"${fileSystemType}\". Must be \"ARTIFACTS\" or \"COMPASS\".`,\n );\n }\n\n const asset: DocumentTypeAsset = {\n comment: GENERATED_JSON_COMMENT,\n documentTypeName,\n documentStorageType: {\n type: \"yjs\",\n schema: wireSchema,\n },\n fileSystemType,\n schemaVersion: latestVersion,\n };\n\n const outputDir = dirname(outputPath);\n if (!existsSync(outputDir)) {\n mkdirSync(outputDir, { recursive: true });\n }\n writeFileSync(outputPath, JSON.stringify(asset, null, 2), \"utf8\");\n\n const compatibilityRange: SchemaCompatibilityRangeFile = {\n min: minSupportedVersion,\n max: latestVersion,\n };\n const compatibilityRangePath = resolve(\n options.compatibilityRangeOutput ?? deriveCompatibilityRangePath(outputPath),\n );\n const compatibilityRangeDir = dirname(compatibilityRangePath);\n if (!existsSync(compatibilityRangeDir)) {\n mkdirSync(compatibilityRangeDir, { recursive: true });\n }\n const compatibilityRangeOutput = {\n comment: GENERATED_JSON_COMMENT,\n ...compatibilityRange,\n };\n writeFileSync(\n compatibilityRangePath,\n JSON.stringify(compatibilityRangeOutput, null, 2),\n \"utf8\",\n );\n\n consola.success(\"Successfully generated document type asset\");\n consola.info(` Output: ${outputPath}`);\n consola.info(` Compatibility range output: ${compatibilityRangePath}`);\n consola.info(` Document type: ${documentTypeName}`);\n consola.info(` Schema version: ${latestVersion}`);\n consola.info(` Compatibility range: [${minSupportedVersion}, ${latestVersion}]`);\n consola.info(` File system type: ${fileSystemType}`);\n } catch (error) {\n if (error instanceof CommanderError) {\n throw error;\n }\n consola.error(\"Error generating document type asset:\", error);\n throw new CommanderError(1, \"IR_ASSET_ERROR\", \"Failed to generate document type asset\");\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,cAAc,QAAQ,WAAW;AAC1C,SAASC,OAAO,QAAQ,SAAS;AACjC,SAASC,UAAU,EAAEC,SAAS,EAAEC,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AACY,SAAS,CAACO,wBAAwB,EAAE,IAAI,EAAE,CAAC,CAAC,EACjD,MACF,CAAC;IAED3C,OAAO,CAAC+C,OAAO,CAAC,4CAA4C,CAAC;IAC7D/C,OAAO,CAACsB,IAAI,CAAC,cAAcF,UAAU,EAAE,CAAC;IACxCpB,OAAO,CAACsB,IAAI,CAAC,kCAAkCoB,sBAAsB,EAAE,CAAC;IACxE1C,OAAO,CAACsB,IAAI,CAAC,qBAAqBS,gBAAgB,EAAE,CAAC;IACrD/B,OAAO,CAACsB,IAAI,CAAC,sBAAsBM,aAAa,EAAE,CAAC;IACnD5B,OAAO,CAACsB,IAAI,CAAC,4BAA4BO,mBAAmB,KAAKD,aAAa,GAAG,CAAC;IAClF5B,OAAO,CAACsB,IAAI,CAAC,wBAAwBW,cAAc,EAAE,CAAC;EACxD,CAAC,CAAC,OAAOe,KAAK,EAAE;IACd,IAAIA,KAAK,YAAYjD,cAAc,EAAE;MACnC,MAAMiD,KAAK;IACb;IACAhD,OAAO,CAACgD,KAAK,CAAC,uCAAuC,EAAEA,KAAK,CAAC;IAC7D,MAAM,IAAIjD,cAAc,CAAC,CAAC,EAAE,gBAAgB,EAAE,wCAAwC,CAAC;EACzF;AACF","ignoreList":[]}
1
+ {"version":3,"file":"irGenAssetHandler.js","names":["CommanderError","consola","existsSync","mkdirSync","readFileSync","writeFileSync","basename","dirname","extname","join","resolve","GENERATED_JSON_COMMENT","convertIrToWireSchema","resolveIrInput","deriveCompatibilityRangePath","assetOutputPath","stem","irGenAssetHandler","options","irPath","ir","outputPath","output","info","parsed","JSON","parse","resolved","irSchema","latestVersion","minSupportedVersion","owningApplicationId","name","documentTypeName","wireSchema","fileSystemType","asset","comment","documentStorageType","type","schema","schemaVersion","outputDir","recursive","stringify","compatibilityRangePath","compatibilityRangeOutput","compatibilityRangeDir","min","max","success","error"],"sources":["irGenAssetHandler.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 { DocumentTypeAsset, FileSystemType } from \"@osdk/foundry.pack\";\nimport { CommanderError } from \"commander\";\nimport { consola } from \"consola\";\nimport { existsSync, mkdirSync, readFileSync, writeFileSync } from \"fs\";\nimport { basename, dirname, extname, join, resolve } from \"path\";\nimport { GENERATED_JSON_COMMENT } from \"../../utils/generatedFileHeader.js\";\nimport { convertIrToWireSchema } from \"../../utils/ir/convertIrToWireSchema.js\";\nimport { resolveIrInput } from \"./resolveIrInput.js\";\n\ninterface IrGenAssetOptions {\n readonly ir: string;\n readonly output: string;\n readonly fileSystemType?: FileSystemType;\n readonly compatibilityRangeOutput?: string;\n}\n\ninterface SchemaCompatibilityRangeFile {\n readonly min: number;\n readonly max: number;\n}\n\nfunction deriveCompatibilityRangePath(assetOutputPath: string): string {\n const stem = basename(assetOutputPath, extname(assetOutputPath));\n return join(dirname(assetOutputPath), `${stem}-schema-compatibility-range.json`);\n}\n\n/**\n * Generates a document type asset JSON file (and a sibling schema\n * compatibility range JSON file) from an IR schema.\n *\n * The input IR may be either:\n * - a chain payload `{ latestVersion, minSupportedVersion?, chain }` produced\n * by `schema ir`. The latest entry's `ir` is used as the wire schema; the\n * asset's `schemaVersion` is `latestVersion`; the compatibility range is\n * `{ min: minSupportedVersion ?? latestVersion, max: latestVersion }`.\n * - a bare single-version `IRealTimeDocumentSchema` (legacy). The compat\n * range defaults to `{ min: version, max: version }` since no chain\n * information is available.\n *\n * This command is intended for internal platform applications where the\n * document type asset must exist on disk so the platform can discover it and\n * register the document type automatically at deploy time. Most users should\n * use `ir deploy` to register document types via the Foundry API instead.\n *\n * If you are unsure whether you need this command, you almost certainly do not.\n */\nexport function irGenAssetHandler(options: IrGenAssetOptions): void {\n try {\n const irPath = resolve(options.ir);\n const outputPath = resolve(options.output);\n\n if (!existsSync(irPath)) {\n throw new CommanderError(1, \"ENOENT\", `IR file does not exist: ${irPath}`);\n }\n\n consola.info(`Reading IR schema from: ${irPath}`);\n const parsed = JSON.parse(readFileSync(irPath, \"utf8\")) as unknown;\n\n const resolved = resolveIrInput(parsed, irPath);\n\n const { ir: irSchema, latestVersion, minSupportedVersion, owningApplicationId } = resolved;\n const { name: documentTypeName } = irSchema;\n const wireSchema = convertIrToWireSchema(irSchema);\n\n const fileSystemType = options.fileSystemType ?? \"ARTIFACTS\";\n if (fileSystemType !== \"ARTIFACTS\" && fileSystemType !== \"COMPASS\") {\n throw new CommanderError(\n 1,\n \"EINVAL\",\n `Invalid fileSystemType \"${fileSystemType}\". Must be \"ARTIFACTS\" or \"COMPASS\".`,\n );\n }\n\n const asset: DocumentTypeAsset = {\n comment: GENERATED_JSON_COMMENT,\n documentTypeName,\n documentStorageType: {\n type: \"yjs\",\n schema: wireSchema,\n },\n fileSystemType,\n schemaVersion: latestVersion,\n ...(owningApplicationId != null ? { owningApplicationId } : {}),\n };\n\n const outputDir = dirname(outputPath);\n if (!existsSync(outputDir)) {\n mkdirSync(outputDir, { recursive: true });\n }\n writeFileSync(outputPath, JSON.stringify(asset, null, 2), \"utf8\");\n\n const compatibilityRange: SchemaCompatibilityRangeFile = {\n min: minSupportedVersion,\n max: latestVersion,\n };\n const compatibilityRangePath = resolve(\n options.compatibilityRangeOutput ?? deriveCompatibilityRangePath(outputPath),\n );\n const compatibilityRangeDir = dirname(compatibilityRangePath);\n if (!existsSync(compatibilityRangeDir)) {\n mkdirSync(compatibilityRangeDir, { recursive: true });\n }\n const compatibilityRangeOutput = {\n comment: GENERATED_JSON_COMMENT,\n ...compatibilityRange,\n };\n writeFileSync(\n compatibilityRangePath,\n JSON.stringify(compatibilityRangeOutput, null, 2),\n \"utf8\",\n );\n\n consola.success(\"Successfully generated document type asset\");\n consola.info(` Output: ${outputPath}`);\n consola.info(` Compatibility range output: ${compatibilityRangePath}`);\n consola.info(` Document type: ${documentTypeName}`);\n consola.info(` Schema version: ${latestVersion}`);\n consola.info(` Compatibility range: [${minSupportedVersion}, ${latestVersion}]`);\n consola.info(` File system type: ${fileSystemType}`);\n if (owningApplicationId != null) {\n consola.info(` Owning application id: ${owningApplicationId}`);\n }\n } catch (error) {\n if (error instanceof CommanderError) {\n throw error;\n }\n consola.error(\"Error generating document type asset:\", error);\n throw new CommanderError(1, \"IR_ASSET_ERROR\", \"Failed to generate document type asset\");\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,cAAc,QAAQ,WAAW;AAC1C,SAASC,OAAO,QAAQ,SAAS;AACjC,SAASC,UAAU,EAAEC,SAAS,EAAEC,YAAY,EAAEC,aAAa,QAAQ,IAAI;AACvE,SAASC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,EAAEC,IAAI,EAAEC,OAAO,QAAQ,MAAM;AAChE,SAASC,sBAAsB,QAAQ,oCAAoC;AAC3E,SAASC,qBAAqB,QAAQ,yCAAyC;AAC/E,SAASC,cAAc,QAAQ,qBAAqB;AAcpD,SAASC,4BAA4BA,CAACC,eAAuB,EAAU;EACrE,MAAMC,IAAI,GAAGV,QAAQ,CAACS,eAAe,EAAEP,OAAO,CAACO,eAAe,CAAC,CAAC;EAChE,OAAON,IAAI,CAACF,OAAO,CAACQ,eAAe,CAAC,EAAE,GAAGC,IAAI,kCAAkC,CAAC;AAClF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,iBAAiBA,CAACC,OAA0B,EAAQ;EAClE,IAAI;IACF,MAAMC,MAAM,GAAGT,OAAO,CAACQ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AE,CAAC;IACtD,IAAIJ,mBAAmB,IAAI,IAAI,EAAE;MAC/B9B,OAAO,CAACsB,IAAI,CAAC,6BAA6BQ,mBAAmB,EAAE,CAAC;IAClE;EACF,CAAC,CAAC,OAAOoB,KAAK,EAAE;IACd,IAAIA,KAAK,YAAYnD,cAAc,EAAE;MACnC,MAAMmD,KAAK;IACb;IACAlD,OAAO,CAACkD,KAAK,CAAC,uCAAuC,EAAEA,KAAK,CAAC;IAC7D,MAAM,IAAInD,cAAc,CAAC,CAAC,EAAE,gBAAgB,EAAE,wCAAwC,CAAC;EACzF;AACF","ignoreList":[]}
@@ -34,7 +34,8 @@ function resolveFromChain(payload, irPath) {
34
34
  return {
35
35
  ir: latestEntry.ir,
36
36
  latestVersion,
37
- minSupportedVersion: minVersion
37
+ minSupportedVersion: minVersion,
38
+ owningApplicationId: payload.owningApplicationId
38
39
  };
39
40
  }
40
41
  function resolveFromSingleIr(ir) {
@@ -1 +1 @@
1
- {"version":3,"file":"resolveIrInput.js","names":["CommanderError","resolveMinVersion","isChainPayload","parsed","Array","isArray","chain","latestVersion","resolveFromChain","payload","irPath","length","minVersion","minSupportedVersion","latestEntry","find","c","version","ir","resolveFromSingleIr","resolveIrInput"],"sources":["resolveIrInput.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { CommanderError } from \"commander\";\nimport type { IRealTimeDocumentSchema } from \"../../lib/pack-docschema-api/pack-docschema-ir/index.js\";\nimport { type IrChainPayload, resolveMinVersion } from \"../../utils/schema/resolveSchemaChain.js\";\n\nexport interface ResolvedIrInput {\n readonly ir: IRealTimeDocumentSchema;\n readonly latestVersion: number;\n readonly minSupportedVersion: number;\n}\n\nfunction isChainPayload(parsed: unknown): parsed is IrChainPayload {\n return (\n typeof parsed === \"object\"\n && parsed != null\n && \"chain\" in parsed\n && Array.isArray((parsed as IrChainPayload).chain)\n && typeof (parsed as IrChainPayload).latestVersion === \"number\"\n );\n}\n\nfunction resolveFromChain(payload: IrChainPayload, irPath: string): ResolvedIrInput {\n if (payload.chain.length === 0) {\n throw new CommanderError(\n 1,\n \"EINVAL\",\n `Invalid IR chain payload at ${irPath}: 'chain' is empty`,\n );\n }\n const { latestVersion, minVersion } = resolveMinVersion(\n payload.chain,\n payload.minSupportedVersion,\n );\n const latestEntry = payload.chain.find(c => c.version === latestVersion);\n if (latestEntry == null) {\n throw new CommanderError(\n 1,\n \"EINVAL\",\n `IR chain payload at ${irPath} has no entry matching latestVersion ${latestVersion}`,\n );\n }\n return { ir: latestEntry.ir, latestVersion, minSupportedVersion: minVersion };\n}\n\nfunction resolveFromSingleIr(ir: IRealTimeDocumentSchema): ResolvedIrInput {\n return { ir, latestVersion: ir.version, minSupportedVersion: ir.version };\n}\n\nexport function resolveIrInput(parsed: unknown, irPath: string): ResolvedIrInput {\n return isChainPayload(parsed)\n ? resolveFromChain(parsed, irPath)\n : resolveFromSingleIr(parsed as IRealTimeDocumentSchema);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,cAAc,QAAQ,WAAW;AAE1C,SAA8BC,iBAAiB,QAAQ,0CAA0C;AAQjG,SAASC,cAAcA,CAACC,MAAe,EAA4B;EACjE,OACE,OAAOA,MAAM,KAAK,QAAQ,IACvBA,MAAM,IAAI,IAAI,IACd,OAAO,IAAIA,MAAM,IACjBC,KAAK,CAACC,OAAO,CAAEF,MAAM,CAAoBG,KAAK,CAAC,IAC/C,OAAQH,MAAM,CAAoBI,aAAa,KAAK,QAAQ;AAEnE;AAEA,SAASC,gBAAgBA,CAACC,OAAuB,EAAEC,MAAc,EAAmB;EAClF,IAAID,OAAO,CAACH,KAAK,CAACK,MAAM,KAAK,CAAC,EAAE;IAC9B,MAAM,IAAIX,cAAc,CACtB,CAAC,EACD,QAAQ,EACR,+BAA+BU,MAAM,oBACvC,CAAC;EACH;EACA,MAAM;IAAEH,aAAa;IAAEK;EAAW,CAAC,GAAGX,iBAAiB,CACrDQ,OAAO,CAACH,KAAK,EACbG,OAAO,CAACI,mBACV,CAAC;EACD,MAAMC,WAAW,GAAGL,OAAO,CAACH,KAAK,CAACS,IAAI,CAACC,CAAC,IAAIA,CAAC,CAACC,OAAO,KAAKV,aAAa,CAAC;EACxE,IAAIO,WAAW,IAAI,IAAI,EAAE;IACvB,MAAM,IAAId,cAAc,CACtB,CAAC,EACD,QAAQ,EACR,uBAAuBU,MAAM,wCAAwCH,aAAa,EACpF,CAAC;EACH;EACA,OAAO;IAAEW,EAAE,EAAEJ,WAAW,CAACI,EAAE;IAAEX,aAAa;IAAEM,mBAAmB,EAAED;EAAW,CAAC;AAC/E;AAEA,SAASO,mBAAmBA,CAACD,EAA2B,EAAmB;EACzE,OAAO;IAAEA,EAAE;IAAEX,aAAa,EAAEW,EAAE,CAACD,OAAO;IAAEJ,mBAAmB,EAAEK,EAAE,CAACD;EAAQ,CAAC;AAC3E;AAEA,OAAO,SAASG,cAAcA,CAACjB,MAAe,EAAEO,MAAc,EAAmB;EAC/E,OAAOR,cAAc,CAACC,MAAM,CAAC,GACzBK,gBAAgB,CAACL,MAAM,EAAEO,MAAM,CAAC,GAChCS,mBAAmB,CAAChB,MAAiC,CAAC;AAC5D","ignoreList":[]}
1
+ {"version":3,"file":"resolveIrInput.js","names":["CommanderError","resolveMinVersion","isChainPayload","parsed","Array","isArray","chain","latestVersion","resolveFromChain","payload","irPath","length","minVersion","minSupportedVersion","latestEntry","find","c","version","ir","owningApplicationId","resolveFromSingleIr","resolveIrInput"],"sources":["resolveIrInput.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { CommanderError } from \"commander\";\nimport type { IRealTimeDocumentSchema } from \"../../lib/pack-docschema-api/pack-docschema-ir/index.js\";\nimport { type IrChainPayload, resolveMinVersion } from \"../../utils/schema/resolveSchemaChain.js\";\n\nexport interface ResolvedIrInput {\n readonly ir: IRealTimeDocumentSchema;\n readonly latestVersion: number;\n readonly minSupportedVersion: number;\n readonly owningApplicationId?: string;\n}\n\nfunction isChainPayload(parsed: unknown): parsed is IrChainPayload {\n return (\n typeof parsed === \"object\"\n && parsed != null\n && \"chain\" in parsed\n && Array.isArray((parsed as IrChainPayload).chain)\n && typeof (parsed as IrChainPayload).latestVersion === \"number\"\n );\n}\n\nfunction resolveFromChain(payload: IrChainPayload, irPath: string): ResolvedIrInput {\n if (payload.chain.length === 0) {\n throw new CommanderError(\n 1,\n \"EINVAL\",\n `Invalid IR chain payload at ${irPath}: 'chain' is empty`,\n );\n }\n const { latestVersion, minVersion } = resolveMinVersion(\n payload.chain,\n payload.minSupportedVersion,\n );\n const latestEntry = payload.chain.find(c => c.version === latestVersion);\n if (latestEntry == null) {\n throw new CommanderError(\n 1,\n \"EINVAL\",\n `IR chain payload at ${irPath} has no entry matching latestVersion ${latestVersion}`,\n );\n }\n return {\n ir: latestEntry.ir,\n latestVersion,\n minSupportedVersion: minVersion,\n owningApplicationId: payload.owningApplicationId,\n };\n}\n\nfunction resolveFromSingleIr(ir: IRealTimeDocumentSchema): ResolvedIrInput {\n return { ir, latestVersion: ir.version, minSupportedVersion: ir.version };\n}\n\nexport function resolveIrInput(parsed: unknown, irPath: string): ResolvedIrInput {\n return isChainPayload(parsed)\n ? resolveFromChain(parsed, irPath)\n : resolveFromSingleIr(parsed as IRealTimeDocumentSchema);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,cAAc,QAAQ,WAAW;AAE1C,SAA8BC,iBAAiB,QAAQ,0CAA0C;AASjG,SAASC,cAAcA,CAACC,MAAe,EAA4B;EACjE,OACE,OAAOA,MAAM,KAAK,QAAQ,IACvBA,MAAM,IAAI,IAAI,IACd,OAAO,IAAIA,MAAM,IACjBC,KAAK,CAACC,OAAO,CAAEF,MAAM,CAAoBG,KAAK,CAAC,IAC/C,OAAQH,MAAM,CAAoBI,aAAa,KAAK,QAAQ;AAEnE;AAEA,SAASC,gBAAgBA,CAACC,OAAuB,EAAEC,MAAc,EAAmB;EAClF,IAAID,OAAO,CAACH,KAAK,CAACK,MAAM,KAAK,CAAC,EAAE;IAC9B,MAAM,IAAIX,cAAc,CACtB,CAAC,EACD,QAAQ,EACR,+BAA+BU,MAAM,oBACvC,CAAC;EACH;EACA,MAAM;IAAEH,aAAa;IAAEK;EAAW,CAAC,GAAGX,iBAAiB,CACrDQ,OAAO,CAACH,KAAK,EACbG,OAAO,CAACI,mBACV,CAAC;EACD,MAAMC,WAAW,GAAGL,OAAO,CAACH,KAAK,CAACS,IAAI,CAACC,CAAC,IAAIA,CAAC,CAACC,OAAO,KAAKV,aAAa,CAAC;EACxE,IAAIO,WAAW,IAAI,IAAI,EAAE;IACvB,MAAM,IAAId,cAAc,CACtB,CAAC,EACD,QAAQ,EACR,uBAAuBU,MAAM,wCAAwCH,aAAa,EACpF,CAAC;EACH;EACA,OAAO;IACLW,EAAE,EAAEJ,WAAW,CAACI,EAAE;IAClBX,aAAa;IACbM,mBAAmB,EAAED,UAAU;IAC/BO,mBAAmB,EAAEV,OAAO,CAACU;EAC/B,CAAC;AACH;AAEA,SAASC,mBAAmBA,CAACF,EAA2B,EAAmB;EACzE,OAAO;IAAEA,EAAE;IAAEX,aAAa,EAAEW,EAAE,CAACD,OAAO;IAAEJ,mBAAmB,EAAEK,EAAE,CAACD;EAAQ,CAAC;AAC3E;AAEA,OAAO,SAASI,cAAcA,CAAClB,MAAe,EAAEO,MAAc,EAAmB;EAC/E,OAAOR,cAAc,CAACC,MAAM,CAAC,GACzBK,gBAAgB,CAACL,MAAM,EAAEO,MAAM,CAAC,GAChCU,mBAAmB,CAACjB,MAAiC,CAAC;AAC5D","ignoreList":[]}
@@ -41,7 +41,8 @@ describe("readPackConfig", () => {
41
41
  await expect(readPackConfig(configPath)).resolves.toEqual({
42
42
  documentTypeName: "Canvas Document Type",
43
43
  documentTypeDescription: "Document type description for demo canvas",
44
- minSupportedVersion: 1
44
+ minSupportedVersion: 1,
45
+ owningApplicationId: undefined
45
46
  });
46
47
  });
47
48
  it("reads a valid config with minSupportedVersion omitted", async () => {
@@ -52,8 +53,30 @@ describe("readPackConfig", () => {
52
53
  await expect(readPackConfig(configPath)).resolves.toEqual({
53
54
  documentTypeName: "Canvas Document Type",
54
55
  documentTypeDescription: "Document type description for demo canvas",
55
- minSupportedVersion: undefined
56
+ minSupportedVersion: undefined,
57
+ owningApplicationId: undefined
58
+ });
59
+ });
60
+ it("reads owningApplicationId when present", async () => {
61
+ const configPath = await writeConfig({
62
+ documentTypeName: "Canvas Document Type",
63
+ documentTypeDescription: "Document type description for demo canvas",
64
+ owningApplicationId: "app-123"
65
+ });
66
+ await expect(readPackConfig(configPath)).resolves.toEqual({
67
+ documentTypeName: "Canvas Document Type",
68
+ documentTypeDescription: "Document type description for demo canvas",
69
+ minSupportedVersion: undefined,
70
+ owningApplicationId: "app-123"
71
+ });
72
+ });
73
+ it("throws when owningApplicationId is an empty string", async () => {
74
+ const configPath = await writeConfig({
75
+ documentTypeName: "Canvas Document Type",
76
+ documentTypeDescription: "Document type description for demo canvas",
77
+ owningApplicationId: " "
56
78
  });
79
+ await expect(readPackConfig(configPath)).rejects.toThrow("'owningApplicationId' in");
57
80
  });
58
81
  it("throws when the config file does not exist", async () => {
59
82
  const configPath = path.join(tmpDir, "missing.json");
@@ -1 +1 @@
1
- {"version":3,"file":"readPackConfig.test.js","names":["fs","os","path","afterEach","beforeEach","describe","expect","it","readPackConfig","tmpDir","mkdtemp","join","tmpdir","remove","writeConfig","config","configPath","writeJson","documentTypeName","documentTypeDescription","minSupportedVersion","resolves","toEqual","undefined","rejects","toThrow"],"sources":["readPackConfig.test.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport fs from \"fs-extra\";\nimport os from \"os\";\nimport path from \"path\";\nimport { afterEach, beforeEach, describe, expect, it } from \"vitest\";\nimport { readPackConfig } from \"../schemaIrHandler.js\";\n\ndescribe(\"readPackConfig\", () => {\n let tmpDir: string;\n\n beforeEach(async () => {\n tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), \"pack-config-\"));\n });\n\n afterEach(async () => {\n await fs.remove(tmpDir);\n });\n\n async function writeConfig(config: unknown): Promise<string> {\n const configPath = path.join(tmpDir, \"pack-config.json\");\n await fs.writeJson(configPath, config);\n return configPath;\n }\n\n it(\"reads a valid config\", async () => {\n const configPath = await writeConfig({\n documentTypeName: \"Canvas Document Type\",\n documentTypeDescription: \"Document type description for demo canvas\",\n minSupportedVersion: 1,\n });\n await expect(readPackConfig(configPath)).resolves.toEqual({\n documentTypeName: \"Canvas Document Type\",\n documentTypeDescription: \"Document type description for demo canvas\",\n minSupportedVersion: 1,\n });\n });\n\n it(\"reads a valid config with minSupportedVersion omitted\", async () => {\n const configPath = await writeConfig({\n documentTypeName: \"Canvas Document Type\",\n documentTypeDescription: \"Document type description for demo canvas\",\n });\n await expect(readPackConfig(configPath)).resolves.toEqual({\n documentTypeName: \"Canvas Document Type\",\n documentTypeDescription: \"Document type description for demo canvas\",\n minSupportedVersion: undefined,\n });\n });\n\n it(\"throws when the config file does not exist\", async () => {\n const configPath = path.join(tmpDir, \"missing.json\");\n await expect(readPackConfig(configPath)).rejects.toThrow(\n `--config file not found: ${configPath}`,\n );\n });\n\n it(\"throws when documentTypeName is missing\", async () => {\n const configPath = await writeConfig({\n documentTypeDescription: \"Document type description for demo canvas\",\n });\n await expect(readPackConfig(configPath)).rejects.toThrow(\n \"'documentTypeName' is required\",\n );\n });\n\n it(\"throws when documentTypeName is an empty string\", async () => {\n const configPath = await writeConfig({\n documentTypeName: \" \",\n documentTypeDescription: \"Document type description for demo canvas\",\n });\n await expect(readPackConfig(configPath)).rejects.toThrow(\n \"'documentTypeName' in\",\n );\n });\n\n it(\"throws when documentTypeName is not a string\", async () => {\n const configPath = await writeConfig({\n documentTypeName: 42,\n documentTypeDescription: \"Document type description for demo canvas\",\n });\n await expect(readPackConfig(configPath)).rejects.toThrow(\n \"'documentTypeName' in\",\n );\n });\n\n it(\"throws when documentTypeDescription is missing\", async () => {\n const configPath = await writeConfig({\n documentTypeName: \"Canvas Document Type\",\n });\n await expect(readPackConfig(configPath)).rejects.toThrow(\n \"'documentTypeDescription' is required\",\n );\n });\n\n it(\"throws when documentTypeDescription is an empty string\", async () => {\n const configPath = await writeConfig({\n documentTypeName: \"Canvas Document Type\",\n documentTypeDescription: \"\",\n });\n await expect(readPackConfig(configPath)).rejects.toThrow(\n \"'documentTypeDescription' in\",\n );\n });\n\n it(\"throws when minSupportedVersion is not a positive integer\", async () => {\n const configPath = await writeConfig({\n documentTypeName: \"Canvas Document Type\",\n documentTypeDescription: \"Document type description for demo canvas\",\n minSupportedVersion: 0,\n });\n await expect(readPackConfig(configPath)).rejects.toThrow(\n \"'minSupportedVersion' in\",\n );\n });\n\n it(\"throws when minSupportedVersion is not an integer\", async () => {\n const configPath = await writeConfig({\n documentTypeName: \"Canvas Document Type\",\n documentTypeDescription: \"Document type description for demo canvas\",\n minSupportedVersion: 1.5,\n });\n await expect(readPackConfig(configPath)).rejects.toThrow(\n \"'minSupportedVersion' in\",\n );\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,EAAE,MAAM,UAAU;AACzB,OAAOC,EAAE,MAAM,IAAI;AACnB,OAAOC,IAAI,MAAM,MAAM;AACvB,SAASC,SAAS,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AACpE,SAASC,cAAc,QAAQ,uBAAuB;AAEtDH,QAAQ,CAAC,gBAAgB,EAAE,MAAM;EAC/B,IAAII,MAAc;EAElBL,UAAU,CAAC,YAAY;IACrBK,MAAM,GAAG,MAAMT,EAAE,CAACU,OAAO,CAACR,IAAI,CAACS,IAAI,CAACV,EAAE,CAACW,MAAM,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC;EACnE,CAAC,CAAC;EAEFT,SAAS,CAAC,YAAY;IACpB,MAAMH,EAAE,CAACa,MAAM,CAACJ,MAAM,CAAC;EACzB,CAAC,CAAC;EAEF,eAAeK,WAAWA,CAACC,MAAe,EAAmB;IAC3D,MAAMC,UAAU,GAAGd,IAAI,CAACS,IAAI,CAACF,MAAM,EAAE,kBAAkB,CAAC;IACxD,MAAMT,EAAE,CAACiB,SAAS,CAACD,UAAU,EAAED,MAAM,CAAC;IACtC,OAAOC,UAAU;EACnB;EAEAT,EAAE,CAAC,sBAAsB,EAAE,YAAY;IACrC,MAAMS,UAAU,GAAG,MAAMF,WAAW,CAAC;MACnCI,g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,OAAO,CACtD,0BACF,CAAC;EACH,CAAC,CAAC;EAEFlB,EAAE,CAAC,mDAAmD,EAAE,YAAY;IAClE,MAAMS,UAAU,GAAG,MAAMF,WAAW,CAAC;MACnCI,gBAAgB,EAAE,sBAAsB;MACxCC,uBAAuB,EAAE,2CAA2C;MACpEC,mBAAmB,EAAE;IACvB,CAAC,CAAC;IACF,MAAMd,MAAM,CAACE,cAAc,CAACQ,UAAU,CAAC,CAAC,CAACQ,OAAO,CAACC,OAAO,CACtD,0BACF,CAAC;EACH,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"readPackConfig.test.js","names":["fs","os","path","afterEach","beforeEach","describe","expect","it","readPackConfig","tmpDir","mkdtemp","join","tmpdir","remove","writeConfig","config","configPath","writeJson","documentTypeName","documentTypeDescription","minSupportedVersion","resolves","toEqual","owningApplicationId","undefined","rejects","toThrow"],"sources":["readPackConfig.test.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport fs from \"fs-extra\";\nimport os from \"os\";\nimport path from \"path\";\nimport { afterEach, beforeEach, describe, expect, it } from \"vitest\";\nimport { readPackConfig } from \"../schemaIrHandler.js\";\n\ndescribe(\"readPackConfig\", () => {\n let tmpDir: string;\n\n beforeEach(async () => {\n tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), \"pack-config-\"));\n });\n\n afterEach(async () => {\n await fs.remove(tmpDir);\n });\n\n async function writeConfig(config: unknown): Promise<string> {\n const configPath = path.join(tmpDir, \"pack-config.json\");\n await fs.writeJson(configPath, config);\n return configPath;\n }\n\n it(\"reads a valid config\", async () => {\n const configPath = await writeConfig({\n documentTypeName: \"Canvas Document Type\",\n documentTypeDescription: \"Document type description for demo canvas\",\n minSupportedVersion: 1,\n });\n await expect(readPackConfig(configPath)).resolves.toEqual({\n documentTypeName: \"Canvas Document Type\",\n documentTypeDescription: \"Document type description for demo canvas\",\n minSupportedVersion: 1,\n owningApplicationId: undefined,\n });\n });\n\n it(\"reads a valid config with minSupportedVersion omitted\", async () => {\n const configPath = await writeConfig({\n documentTypeName: \"Canvas Document Type\",\n documentTypeDescription: \"Document type description for demo canvas\",\n });\n await expect(readPackConfig(configPath)).resolves.toEqual({\n documentTypeName: \"Canvas Document Type\",\n documentTypeDescription: \"Document type description for demo canvas\",\n minSupportedVersion: undefined,\n owningApplicationId: undefined,\n });\n });\n\n it(\"reads owningApplicationId when present\", async () => {\n const configPath = await writeConfig({\n documentTypeName: \"Canvas Document Type\",\n documentTypeDescription: \"Document type description for demo canvas\",\n owningApplicationId: \"app-123\",\n });\n await expect(readPackConfig(configPath)).resolves.toEqual({\n documentTypeName: \"Canvas Document Type\",\n documentTypeDescription: \"Document type description for demo canvas\",\n minSupportedVersion: undefined,\n owningApplicationId: \"app-123\",\n });\n });\n\n it(\"throws when owningApplicationId is an empty string\", async () => {\n const configPath = await writeConfig({\n documentTypeName: \"Canvas Document Type\",\n documentTypeDescription: \"Document type description for demo canvas\",\n owningApplicationId: \" \",\n });\n await expect(readPackConfig(configPath)).rejects.toThrow(\n \"'owningApplicationId' in\",\n );\n });\n\n it(\"throws when the config file does not exist\", async () => {\n const configPath = path.join(tmpDir, \"missing.json\");\n await expect(readPackConfig(configPath)).rejects.toThrow(\n `--config file not found: ${configPath}`,\n );\n });\n\n it(\"throws when documentTypeName is missing\", async () => {\n const configPath = await writeConfig({\n documentTypeDescription: \"Document type description for demo canvas\",\n });\n await expect(readPackConfig(configPath)).rejects.toThrow(\n \"'documentTypeName' is required\",\n );\n });\n\n it(\"throws when documentTypeName is an empty string\", async () => {\n const configPath = await writeConfig({\n documentTypeName: \" \",\n documentTypeDescription: \"Document type description for demo canvas\",\n });\n await expect(readPackConfig(configPath)).rejects.toThrow(\n \"'documentTypeName' in\",\n );\n });\n\n it(\"throws when documentTypeName is not a string\", async () => {\n const configPath = await writeConfig({\n documentTypeName: 42,\n documentTypeDescription: \"Document type description for demo canvas\",\n });\n await expect(readPackConfig(configPath)).rejects.toThrow(\n \"'documentTypeName' in\",\n );\n });\n\n it(\"throws when documentTypeDescription is missing\", async () => {\n const configPath = await writeConfig({\n documentTypeName: \"Canvas Document Type\",\n });\n await expect(readPackConfig(configPath)).rejects.toThrow(\n \"'documentTypeDescription' is required\",\n );\n });\n\n it(\"throws when documentTypeDescription is an empty string\", async () => {\n const configPath = await writeConfig({\n documentTypeName: \"Canvas Document Type\",\n documentTypeDescription: \"\",\n });\n await expect(readPackConfig(configPath)).rejects.toThrow(\n \"'documentTypeDescription' in\",\n );\n });\n\n it(\"throws when minSupportedVersion is not a positive integer\", async () => {\n const configPath = await writeConfig({\n documentTypeName: \"Canvas Document Type\",\n documentTypeDescription: \"Document type description for demo canvas\",\n minSupportedVersion: 0,\n });\n await expect(readPackConfig(configPath)).rejects.toThrow(\n \"'minSupportedVersion' in\",\n );\n });\n\n it(\"throws when minSupportedVersion is not an integer\", async () => {\n const configPath = await writeConfig({\n documentTypeName: \"Canvas Document Type\",\n documentTypeDescription: \"Document type description for demo canvas\",\n minSupportedVersion: 1.5,\n });\n await expect(readPackConfig(configPath)).rejects.toThrow(\n \"'minSupportedVersion' in\",\n );\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,EAAE,MAAM,UAAU;AACzB,OAAOC,EAAE,MAAM,IAAI;AACnB,OAAOC,IAAI,MAAM,MAAM;AACvB,SAASC,SAAS,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,MAAM,EAA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E,YAAY;IAC1E,MAAMS,UAAU,GAAG,MAAMF,WAAW,CAAC;MACnCI,gBAAgB,EAAE,sBAAsB;MACxCC,uBAAuB,EAAE,2CAA2C;MACpEC,mBAAmB,EAAE;IACvB,CAAC,CAAC;IACF,MAAMd,MAAM,CAACE,cAAc,CAACQ,UAAU,CAAC,CAAC,CAACS,OAAO,CAACC,OAAO,CACtD,0BACF,CAAC;EACH,CAAC,CAAC;EAEFnB,EAAE,CAAC,mDAAmD,EAAE,YAAY;IAClE,MAAMS,UAAU,GAAG,MAAMF,WAAW,CAAC;MACnCI,gBAAgB,EAAE,sBAAsB;MACxCC,uBAAuB,EAAE,2CAA2C;MACpEC,mBAAmB,EAAE;IACvB,CAAC,CAAC;IACF,MAAMd,MAAM,CAACE,cAAc,CAACQ,UAAU,CAAC,CAAC,CAACS,OAAO,CAACC,OAAO,CACtD,0BACF,CAAC;EACH,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -48,10 +48,15 @@ export async function readPackConfig(configPath) {
48
48
  }
49
49
  minSupportedVersion = rawMin;
50
50
  }
51
+ let owningApplicationId;
52
+ if (config.owningApplicationId != null) {
53
+ owningApplicationId = assertNonEmptyString(config.owningApplicationId, "owningApplicationId", resolvedConfigPath);
54
+ }
51
55
  return {
52
56
  documentTypeName,
53
57
  documentTypeDescription,
54
- minSupportedVersion
58
+ minSupportedVersion,
59
+ owningApplicationId
55
60
  };
56
61
  }
57
62
  function parseMaxVersion(maxVersion) {
@@ -85,6 +90,9 @@ function parseMaxVersion(maxVersion) {
85
90
  * (`ir gen-types`, `ir asset`) read the same value. Omitting the field is
86
91
  * an explicit opt-out: the IR will not include `minSupportedVersion` and
87
92
  * downstream tools default to supporting only the latest schema version.
93
+ * - `owningApplicationId`: the application that owns this document type; when
94
+ * set, it is embedded in the payload and surfaced as `owningApplicationId`
95
+ * by `ir asset`.
88
96
  *
89
97
  * Note: this is distinct from the legacy single-version IR JSON consumed by
90
98
  * `ir zod`, which is a bare `IRealTimeDocumentSchema` (no chain, no migrations).
@@ -101,7 +109,8 @@ export async function schemaIrHandler(options) {
101
109
  const {
102
110
  documentTypeName,
103
111
  documentTypeDescription,
104
- minSupportedVersion
112
+ minSupportedVersion,
113
+ owningApplicationId
105
114
  } = await readPackConfig(config);
106
115
  if (minSupportedVersion == null) {
107
116
  consola.warn(`--config ${path.resolve(config)} does not set 'minSupportedVersion'. The generated IR will not include it, so downstream tools (ir gen-types, ir asset) will default to supporting only the latest schema version. Add 'minSupportedVersion' to your pack-config to enable back-compat.`);
@@ -124,6 +133,9 @@ export async function schemaIrHandler(options) {
124
133
  ...(minSupportedVersion != null ? {
125
134
  minSupportedVersion
126
135
  } : {}),
136
+ ...(owningApplicationId != null ? {
137
+ owningApplicationId
138
+ } : {}),
127
139
  chain
128
140
  };
129
141
  await fs.writeFile(outputPath, JSON.stringify(payload, null, 2) + "\n", "utf8");
@@ -1 +1 @@
1
- {"version":3,"file":"schemaIrHandler.js","names":["consola","fs","path","GENERATED_JSON_COMMENT","loadSchemaModule","resolveSchemaChain","assertNonEmptyString","value","field","configPath","trim","Error","JSON","stringify","readRequiredNonEmptyString","readPackConfig","resolvedConfigPath","resolve","pathExists","config","readJson","documentTypeName","documentTypeDescription","minSupportedVersion","rawMin","Number","isInteger","parseMaxVersion","maxVersion","undefined","test","schemaIrHandler","options","input","output","warn","info","schema","chain","latestVersion","name","description","outputPath","ensureDir","dirname","payload","comment","writeFile","success","length"],"sources":["schemaIrHandler.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"consola\";\nimport fs from \"fs-extra\";\nimport path from \"path\";\nimport { GENERATED_JSON_COMMENT } from \"../../utils/generatedFileHeader.js\";\nimport { loadSchemaModule } from \"../../utils/schema/loadSchemaModule.js\";\nimport { resolveSchemaChain } from \"../../utils/schema/resolveSchemaChain.js\";\n\ninterface SchemaIrOptions {\n input: string;\n output: string;\n config: string;\n maxVersion?: string;\n}\n\ninterface PackConfigLike {\n documentTypeName?: unknown;\n documentTypeDescription?: unknown;\n minSupportedVersion?: unknown;\n}\n\ninterface PackConfigValues {\n readonly documentTypeName: string;\n readonly documentTypeDescription: string;\n readonly minSupportedVersion?: number;\n}\n\nfunction assertNonEmptyString(value: unknown, field: string, configPath: string): string {\n if (typeof value !== \"string\" || value.trim() === \"\") {\n throw new Error(\n `'${field}' in ${configPath} must be a non-empty string, got: ${JSON.stringify(value)}`,\n );\n }\n return value;\n}\n\nfunction readRequiredNonEmptyString(\n value: unknown,\n field: string,\n configPath: string,\n): string {\n if (value == null) {\n throw new Error(\n `'${field}' is required in ${configPath} and must be a non-empty string`,\n );\n }\n return assertNonEmptyString(value, field, configPath);\n}\n\nexport async function readPackConfig(configPath: string): Promise<PackConfigValues> {\n const resolvedConfigPath = path.resolve(configPath);\n if (!(await fs.pathExists(resolvedConfigPath))) {\n throw new Error(`--config file not found: ${resolvedConfigPath}`);\n }\n const config = (await fs.readJson(resolvedConfigPath)) as PackConfigLike;\n\n const documentTypeName = readRequiredNonEmptyString(\n config.documentTypeName,\n \"documentTypeName\",\n resolvedConfigPath,\n );\n\n const documentTypeDescription = readRequiredNonEmptyString(\n config.documentTypeDescription,\n \"documentTypeDescription\",\n resolvedConfigPath,\n );\n\n let minSupportedVersion: number | undefined;\n const rawMin = config.minSupportedVersion;\n if (rawMin != null) {\n if (typeof rawMin !== \"number\" || !Number.isInteger(rawMin) || rawMin <= 0) {\n throw new Error(\n `'minSupportedVersion' in ${resolvedConfigPath} must be a positive integer, got: ${\n JSON.stringify(rawMin)\n }`,\n );\n }\n minSupportedVersion = rawMin;\n }\n\n return { documentTypeName, documentTypeDescription, minSupportedVersion };\n}\n\nfunction parseMaxVersion(maxVersion: string | undefined): number | undefined {\n if (maxVersion == null) {\n return undefined;\n }\n\n if (!/^[1-9]\\d*$/.test(maxVersion)) {\n throw new Error(\n `--max-version must be a positive integer, got: ${JSON.stringify(maxVersion)}`,\n );\n }\n\n return Number(maxVersion);\n}\n\n/**\n * Resolve a TypeScript schema module to a versioned IR chain JSON file.\n *\n * The output is a `{ latestVersion, minSupportedVersion?, chain }` payload\n * where each entry is `{ version, ir, migrations? }` and `ir` is a\n * single-version `IRealTimeDocumentSchema`. This is the input format for\n * `ir gen-types` and `ir asset`.\n *\n * `--config <pack-config.json>` is required: the pack-config is the single\n * source of truth for document-type identity. Required fields:\n * - `documentTypeName`: the document type name embedded into each chain\n * entry's IR (and surfaced as `documentTypeName` by `ir asset`).\n * - `documentTypeDescription`: document type description embedded into each\n * chain entry's IR.\n * Optional fields:\n * - `minSupportedVersion`: declares the oldest version this SDK supports;\n * when set, it must match one of the chain entries' `version` values and is\n * embedded as `minSupportedVersion` in the payload so downstream consumers\n * (`ir gen-types`, `ir asset`) read the same value. Omitting the field is\n * an explicit opt-out: the IR will not include `minSupportedVersion` and\n * downstream tools default to supporting only the latest schema version.\n *\n * Note: this is distinct from the legacy single-version IR JSON consumed by\n * `ir zod`, which is a bare `IRealTimeDocumentSchema` (no chain, no migrations).\n * Tools that previously read that format should pick the entry matching\n * `latestVersion` from `chain` and use its `ir` field.\n */\nexport async function schemaIrHandler(options: SchemaIrOptions): Promise<void> {\n const { input, output, config } = options;\n const maxVersion = parseMaxVersion(options.maxVersion);\n const { documentTypeName, documentTypeDescription, minSupportedVersion } = await readPackConfig(\n config,\n );\n\n if (minSupportedVersion == null) {\n consola.warn(\n `--config ${\n path.resolve(config)\n } does not set 'minSupportedVersion'. The generated IR will not include it, so downstream tools (ir gen-types, ir asset) will default to supporting only the latest schema version. Add 'minSupportedVersion' to your pack-config to enable back-compat.`,\n );\n }\n\n consola.info(`Loading schema from: ${input}`);\n const schema = await loadSchemaModule(input);\n\n consola.info(\"Resolving versioned IR chain...\");\n const { chain, latestVersion } = resolveSchemaChain(\n schema,\n minSupportedVersion,\n {\n name: documentTypeName,\n description: documentTypeDescription,\n },\n maxVersion,\n );\n\n const outputPath = path.resolve(output);\n await fs.ensureDir(path.dirname(outputPath));\n\n const payload = {\n comment: GENERATED_JSON_COMMENT,\n latestVersion,\n ...(minSupportedVersion != null ? { minSupportedVersion } : {}),\n chain,\n };\n await fs.writeFile(outputPath, JSON.stringify(payload, null, 2) + \"\\n\", \"utf8\");\n\n consola.success(\n `Wrote IR chain (${chain.length} version(s), min=${\n minSupportedVersion ?? latestVersion\n }, max=${latestVersion}) to: ${outputPath}`,\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,OAAO,QAAQ,SAAS;AACjC,OAAOC,EAAE,MAAM,UAAU;AACzB,OAAOC,IAAI,MAAM,MAAM;AACvB,SAASC,sBAAsB,QAAQ,oCAAoC;AAC3E,SAASC,gBAAgB,QAAQ,wCAAwC;AACzE,SAASC,kBAAkB,QAAQ,0CAA0C;AAqB7E,SAASC,oBAAoBA,CAACC,KAAc,EAAEC,KAAa,EAAEC,UAAkB,EAAU;EACvF,IAAI,OAAOF,KAAK,KAAK,QAAQ,IAAIA,KAAK,CAACG,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE;IACpD,MAAM,IAAIC,KAAK,CACb,IAAIH,KAAK,QAAQC,UAAU,qCAAqCG,IAAI,CAACC,SAAS,CAACN,KAAK,CAAC,EACvF,CAAC;EACH;EACA,OAAOA,KAAK;AACd;AAEA,SAASO,0BAA0BA,CACjCP,KAAc,EACdC,KAAa,EACbC,UAAkB,EACV;EACR,IAAIF,KAAK,IAAI,IAAI,EAAE;IACjB,MAAM,IAAII,KAAK,CACb,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AAO,GAAG;IACdC,OAAO,EAAE3C,sBAAsB;IAC/BoC,aAAa;IACb,IAAIhB,mBAAmB,IAAI,IAAI,GAAG;MAAEA;IAAoB,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/De;EACF,CAAC;EACD,MAAMrC,EAAE,CAAC8C,SAAS,CAACL,UAAU,EAAE9B,IAAI,CAACC,SAAS,CAACgC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC;EAE/E7C,OAAO,CAACgD,OAAO,CACb,mBAAmBV,KAAK,CAACW,MAAM,oBAC7B1B,mBAAmB,IAAIgB,aAAa,SAC7BA,aAAa,SAASG,UAAU,EAC3C,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"schemaIrHandler.js","names":["consola","fs","path","GENERATED_JSON_COMMENT","loadSchemaModule","resolveSchemaChain","assertNonEmptyString","value","field","configPath","trim","Error","JSON","stringify","readRequiredNonEmptyString","readPackConfig","resolvedConfigPath","resolve","pathExists","config","readJson","documentTypeName","documentTypeDescription","minSupportedVersion","rawMin","Number","isInteger","owningApplicationId","parseMaxVersion","maxVersion","undefined","test","schemaIrHandler","options","input","output","warn","info","schema","chain","latestVersion","name","description","outputPath","ensureDir","dirname","payload","comment","writeFile","success","length"],"sources":["schemaIrHandler.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"consola\";\nimport fs from \"fs-extra\";\nimport path from \"path\";\nimport { GENERATED_JSON_COMMENT } from \"../../utils/generatedFileHeader.js\";\nimport { loadSchemaModule } from \"../../utils/schema/loadSchemaModule.js\";\nimport { resolveSchemaChain } from \"../../utils/schema/resolveSchemaChain.js\";\n\ninterface SchemaIrOptions {\n input: string;\n output: string;\n config: string;\n maxVersion?: string;\n}\n\ninterface PackConfigLike {\n documentTypeName?: unknown;\n documentTypeDescription?: unknown;\n minSupportedVersion?: unknown;\n owningApplicationId?: unknown;\n}\n\ninterface PackConfigValues {\n readonly documentTypeName: string;\n readonly documentTypeDescription: string;\n readonly minSupportedVersion?: number;\n readonly owningApplicationId?: string;\n}\n\nfunction assertNonEmptyString(value: unknown, field: string, configPath: string): string {\n if (typeof value !== \"string\" || value.trim() === \"\") {\n throw new Error(\n `'${field}' in ${configPath} must be a non-empty string, got: ${JSON.stringify(value)}`,\n );\n }\n return value;\n}\n\nfunction readRequiredNonEmptyString(\n value: unknown,\n field: string,\n configPath: string,\n): string {\n if (value == null) {\n throw new Error(\n `'${field}' is required in ${configPath} and must be a non-empty string`,\n );\n }\n return assertNonEmptyString(value, field, configPath);\n}\n\nexport async function readPackConfig(configPath: string): Promise<PackConfigValues> {\n const resolvedConfigPath = path.resolve(configPath);\n if (!(await fs.pathExists(resolvedConfigPath))) {\n throw new Error(`--config file not found: ${resolvedConfigPath}`);\n }\n const config = (await fs.readJson(resolvedConfigPath)) as PackConfigLike;\n\n const documentTypeName = readRequiredNonEmptyString(\n config.documentTypeName,\n \"documentTypeName\",\n resolvedConfigPath,\n );\n\n const documentTypeDescription = readRequiredNonEmptyString(\n config.documentTypeDescription,\n \"documentTypeDescription\",\n resolvedConfigPath,\n );\n\n let minSupportedVersion: number | undefined;\n const rawMin = config.minSupportedVersion;\n if (rawMin != null) {\n if (typeof rawMin !== \"number\" || !Number.isInteger(rawMin) || rawMin <= 0) {\n throw new Error(\n `'minSupportedVersion' in ${resolvedConfigPath} must be a positive integer, got: ${\n JSON.stringify(rawMin)\n }`,\n );\n }\n minSupportedVersion = rawMin;\n }\n\n let owningApplicationId: string | undefined;\n if (config.owningApplicationId != null) {\n owningApplicationId = assertNonEmptyString(\n config.owningApplicationId,\n \"owningApplicationId\",\n resolvedConfigPath,\n );\n }\n\n return { documentTypeName, documentTypeDescription, minSupportedVersion, owningApplicationId };\n}\n\nfunction parseMaxVersion(maxVersion: string | undefined): number | undefined {\n if (maxVersion == null) {\n return undefined;\n }\n\n if (!/^[1-9]\\d*$/.test(maxVersion)) {\n throw new Error(\n `--max-version must be a positive integer, got: ${JSON.stringify(maxVersion)}`,\n );\n }\n\n return Number(maxVersion);\n}\n\n/**\n * Resolve a TypeScript schema module to a versioned IR chain JSON file.\n *\n * The output is a `{ latestVersion, minSupportedVersion?, chain }` payload\n * where each entry is `{ version, ir, migrations? }` and `ir` is a\n * single-version `IRealTimeDocumentSchema`. This is the input format for\n * `ir gen-types` and `ir asset`.\n *\n * `--config <pack-config.json>` is required: the pack-config is the single\n * source of truth for document-type identity. Required fields:\n * - `documentTypeName`: the document type name embedded into each chain\n * entry's IR (and surfaced as `documentTypeName` by `ir asset`).\n * - `documentTypeDescription`: document type description embedded into each\n * chain entry's IR.\n * Optional fields:\n * - `minSupportedVersion`: declares the oldest version this SDK supports;\n * when set, it must match one of the chain entries' `version` values and is\n * embedded as `minSupportedVersion` in the payload so downstream consumers\n * (`ir gen-types`, `ir asset`) read the same value. Omitting the field is\n * an explicit opt-out: the IR will not include `minSupportedVersion` and\n * downstream tools default to supporting only the latest schema version.\n * - `owningApplicationId`: the application that owns this document type; when\n * set, it is embedded in the payload and surfaced as `owningApplicationId`\n * by `ir asset`.\n *\n * Note: this is distinct from the legacy single-version IR JSON consumed by\n * `ir zod`, which is a bare `IRealTimeDocumentSchema` (no chain, no migrations).\n * Tools that previously read that format should pick the entry matching\n * `latestVersion` from `chain` and use its `ir` field.\n */\nexport async function schemaIrHandler(options: SchemaIrOptions): Promise<void> {\n const { input, output, config } = options;\n const maxVersion = parseMaxVersion(options.maxVersion);\n const { documentTypeName, documentTypeDescription, minSupportedVersion, owningApplicationId } =\n await readPackConfig(config);\n\n if (minSupportedVersion == null) {\n consola.warn(\n `--config ${\n path.resolve(config)\n } does not set 'minSupportedVersion'. The generated IR will not include it, so downstream tools (ir gen-types, ir asset) will default to supporting only the latest schema version. Add 'minSupportedVersion' to your pack-config to enable back-compat.`,\n );\n }\n\n consola.info(`Loading schema from: ${input}`);\n const schema = await loadSchemaModule(input);\n\n consola.info(\"Resolving versioned IR chain...\");\n const { chain, latestVersion } = resolveSchemaChain(\n schema,\n minSupportedVersion,\n {\n name: documentTypeName,\n description: documentTypeDescription,\n },\n maxVersion,\n );\n\n const outputPath = path.resolve(output);\n await fs.ensureDir(path.dirname(outputPath));\n\n const payload = {\n comment: GENERATED_JSON_COMMENT,\n latestVersion,\n ...(minSupportedVersion != null ? { minSupportedVersion } : {}),\n ...(owningApplicationId != null ? { owningApplicationId } : {}),\n chain,\n };\n await fs.writeFile(outputPath, JSON.stringify(payload, null, 2) + \"\\n\", \"utf8\");\n\n consola.success(\n `Wrote IR chain (${chain.length} version(s), min=${\n minSupportedVersion ?? latestVersion\n }, max=${latestVersion}) to: ${outputPath}`,\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,OAAO,QAAQ,SAAS;AACjC,OAAOC,EAAE,MAAM,UAAU;AACzB,OAAOC,IAAI,MAAM,MAAM;AACvB,SAASC,sBAAsB,QAAQ,oCAAoC;AAC3E,SAASC,gBAAgB,QAAQ,wCAAwC;AACzE,SAASC,kBAAkB,QAAQ,0CAA0C;AAuB7E,SAASC,oBAAoBA,CAACC,KAAc,EAAEC,KAAa,EAAEC,UAAkB,EAAU;EACvF,IAAI,OAAOF,KAAK,KAAK,QAAQ,IAAIA,KAAK,CAACG,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE;IACpD,MAAM,IAAIC,KAAK,CACb,IAAIH,KAAK,QAAQC,UAAU,qCAAqCG,IAAI,CAACC,SAAS,CAACN,KAAK,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K,CAAC;EAE5ClC,OAAO,CAACqC,IAAI,CAAC,iCAAiC,CAAC;EAC/C,MAAM;IAAEE,KAAK;IAAEC;EAAc,CAAC,GAAGnC,kBAAkB,CACjDiC,MAAM,EACNf,mBAAmB,EACnB;IACEkB,IAAI,EAAEpB,gBAAgB;IACtBqB,WAAW,EAAEpB;EACf,CAAC,EACDO,UACF,CAAC;EAED,MAAMc,UAAU,GAAGzC,IAAI,CAACe,OAAO,CAACkB,MAAM,CAAC;EACvC,MAAMlC,EAAE,CAAC2C,SAAS,CAAC1C,IAAI,CAAC2C,OAAO,CAACF,UAAU,CAAC,CAAC;EAE5C,MAAMG,OAAO,GAAG;IACdC,OAAO,EAAE5C,sBAAsB;IAC/BqC,aAAa;IACb,IAAIjB,mBAAmB,IAAI,IAAI,GAAG;MAAEA;IAAoB,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/D,IAAII,mBAAmB,IAAI,IAAI,GAAG;MAAEA;IAAoB,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/DY;EACF,CAAC;EACD,MAAMtC,EAAE,CAAC+C,SAAS,CAACL,UAAU,EAAE/B,IAAI,CAACC,SAAS,CAACiC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC;EAE/E9C,OAAO,CAACiD,OAAO,CACb,mBAAmBV,KAAK,CAACW,MAAM,oBAC7B3B,mBAAmB,IAAIiB,aAAa,SAC7BA,aAAa,SAASG,UAAU,EAC3C,CAAC;AACH","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- /* Generated by @palantir/pack.document-schema.type-gen@0.17.0 */
1
+ /* Generated by @palantir/pack.document-schema.type-gen@0.19.0 */
2
2
 
3
3
  import { Metadata } from '@palantir/pack.document-schema.model-types';
4
4
  import { AnimalCatSchema, AnimalDogSchema, AnimalSchema, CatSchema, DogSchema } from './schema.js';
@@ -1 +1 @@
1
- {"version":3,"file":"custom-discriminant.js","names":["Metadata","AnimalCatSchema","AnimalDogSchema","AnimalSchema","CatSchema","DogSchema","CatModel","__type","zodSchema","name","DogModel","AnimalModel","discriminant","AnimalCatModel","AnimalDogModel","DocumentModel","Cat","Dog","Animal","AnimalCat","AnimalDog","version"],"sources":["custom-discriminant.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.17.0 */\n\nimport type {\n DocumentSchema,\n RecordModel,\n UnionModel,\n} from '@palantir/pack.document-schema.model-types';\nimport { Metadata } from '@palantir/pack.document-schema.model-types';\nimport type { Animal, AnimalCat, AnimalDog, Cat, Dog } from './types.js';\nimport {\n AnimalCatSchema,\n AnimalDogSchema,\n AnimalSchema,\n CatSchema,\n DogSchema,\n} from './schema.js';\n\nexport interface CatModel extends RecordModel<Cat, typeof CatSchema> {}\nexport const CatModel: CatModel = {\n __type: {} as Cat,\n zodSchema: CatSchema,\n [Metadata]: {\n name: 'Cat',\n },\n};\n\nexport interface DogModel extends RecordModel<Dog, typeof DogSchema> {}\nexport const DogModel: DogModel = {\n __type: {} as Dog,\n zodSchema: DogSchema,\n [Metadata]: {\n name: 'Dog',\n },\n};\n\nexport interface AnimalModel extends UnionModel<Animal, typeof AnimalSchema> {}\nexport const AnimalModel: AnimalModel = {\n __type: {} as Animal,\n zodSchema: AnimalSchema,\n [Metadata]: {\n discriminant: 'kind',\n name: 'Animal',\n },\n};\n\nexport interface AnimalCatModel extends UnionModel<\n AnimalCat,\n typeof AnimalCatSchema\n> {}\nexport const AnimalCatModel: AnimalCatModel = {\n __type: {} as AnimalCat,\n zodSchema: AnimalCatSchema,\n [Metadata]: {\n discriminant: 'kind',\n name: 'AnimalCat',\n },\n};\n\nexport interface AnimalDogModel extends UnionModel<\n AnimalDog,\n typeof AnimalDogSchema\n> {}\nexport const AnimalDogModel: AnimalDogModel = {\n __type: {} as AnimalDog,\n zodSchema: AnimalDogSchema,\n [Metadata]: {\n discriminant: 'kind',\n name: 'AnimalDog',\n },\n};\n\nexport const DocumentModel = {\n Cat: CatModel,\n Dog: DogModel,\n Animal: AnimalModel,\n AnimalCat: AnimalCatModel,\n AnimalDog: AnimalDogModel,\n [Metadata]: {\n version: 1,\n },\n} as const satisfies DocumentSchema;\n\nexport type DocumentModel = typeof DocumentModel;\n"],"mappings":"AAAA;;AAOA,SAASA,QAAQ,QAAQ,4CAA4C;AAErE,SACEC,eAAe,EACfC,eAAe,EACfC,YAAY,EACZC,SAAS,EACTC,SAAS,QACJ,aAAa;AAGpB,OAAO,MAAMC,QAAkB,GAAG;EAChCC,MAAM,EAAE,CAAC,CAAQ;EACjBC,SAAS,EAAEJ,SAAS;EACpB,CAACJ,QAAQ,GAAG;IACVS,IAAI,EAAE;EACR;AACF,CAAC;AAGD,OAAO,MAAMC,QAAkB,GAAG;EAChCH,MAAM,EAAE,CAAC,CAAQ;EACjBC,SAAS,EAAEH,SAAS;EACpB,CAACL,QAAQ,GAAG;IACVS,IAAI,EAAE;EACR;AACF,CAAC;AAGD,OAAO,MAAME,WAAwB,GAAG;EACtCJ,MAAM,EAAE,CAAC,CAAW;EACpBC,SAAS,EAAEL,YAAY;EACvB,CAACH,QAAQ,GAAG;IACVY,YAAY,EAAE,MAAM;IACpBH,IAAI,EAAE;EACR;AACF,CAAC;AAMD,OAAO,MAAMI,cAA8B,GAAG;EAC5CN,MAAM,EAAE,CAAC,CAAc;EACvBC,SAAS,EAAEP,eAAe;EAC1B,CAACD,QAAQ,GAAG;IACVY,YAAY,EAAE,MAAM;IACpBH,IAAI,EAAE;EACR;AACF,CAAC;AAMD,OAAO,MAAMK,cAA8B,GAAG;EAC5CP,MAAM,EAAE,CAAC,CAAc;EACvBC,SAAS,EAAEN,eAAe;EAC1B,CAACF,QAAQ,GAAG;IACVY,YAAY,EAAE,MAAM;IACpBH,IAAI,EAAE;EACR;AACF,CAAC;AAED,OAAO,MAAMM,aAAa,GAAG;EAC3BC,GAAG,EAAEV,QAAQ;EACbW,GAAG,EAAEP,QAAQ;EACbQ,MAAM,EAAEP,WAAW;EACnBQ,SAAS,EAAEN,cAAc;EACzBO,SAAS,EAAEN,cAAc;EACzB,CAACd,QAAQ,GAAG;IACVqB,OAAO,EAAE;EACX;AACF,CAAmC","ignoreList":[]}
1
+ {"version":3,"file":"custom-discriminant.js","names":["Metadata","AnimalCatSchema","AnimalDogSchema","AnimalSchema","CatSchema","DogSchema","CatModel","__type","zodSchema","name","DogModel","AnimalModel","discriminant","AnimalCatModel","AnimalDogModel","DocumentModel","Cat","Dog","Animal","AnimalCat","AnimalDog","version"],"sources":["custom-discriminant.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.19.0 */\n\nimport type {\n DocumentSchema,\n RecordModel,\n UnionModel,\n} from '@palantir/pack.document-schema.model-types';\nimport { Metadata } from '@palantir/pack.document-schema.model-types';\nimport type { Animal, AnimalCat, AnimalDog, Cat, Dog } from './types.js';\nimport {\n AnimalCatSchema,\n AnimalDogSchema,\n AnimalSchema,\n CatSchema,\n DogSchema,\n} from './schema.js';\n\nexport interface CatModel extends RecordModel<Cat, typeof CatSchema> {}\nexport const CatModel: CatModel = {\n __type: {} as Cat,\n zodSchema: CatSchema,\n [Metadata]: {\n name: 'Cat',\n },\n};\n\nexport interface DogModel extends RecordModel<Dog, typeof DogSchema> {}\nexport const DogModel: DogModel = {\n __type: {} as Dog,\n zodSchema: DogSchema,\n [Metadata]: {\n name: 'Dog',\n },\n};\n\nexport interface AnimalModel extends UnionModel<Animal, typeof AnimalSchema> {}\nexport const AnimalModel: AnimalModel = {\n __type: {} as Animal,\n zodSchema: AnimalSchema,\n [Metadata]: {\n discriminant: 'kind',\n name: 'Animal',\n },\n};\n\nexport interface AnimalCatModel extends UnionModel<\n AnimalCat,\n typeof AnimalCatSchema\n> {}\nexport const AnimalCatModel: AnimalCatModel = {\n __type: {} as AnimalCat,\n zodSchema: AnimalCatSchema,\n [Metadata]: {\n discriminant: 'kind',\n name: 'AnimalCat',\n },\n};\n\nexport interface AnimalDogModel extends UnionModel<\n AnimalDog,\n typeof AnimalDogSchema\n> {}\nexport const AnimalDogModel: AnimalDogModel = {\n __type: {} as AnimalDog,\n zodSchema: AnimalDogSchema,\n [Metadata]: {\n discriminant: 'kind',\n name: 'AnimalDog',\n },\n};\n\nexport const DocumentModel = {\n Cat: CatModel,\n Dog: DogModel,\n Animal: AnimalModel,\n AnimalCat: AnimalCatModel,\n AnimalDog: AnimalDogModel,\n [Metadata]: {\n version: 1,\n },\n} as const satisfies DocumentSchema;\n\nexport type DocumentModel = typeof DocumentModel;\n"],"mappings":"AAAA;;AAOA,SAASA,QAAQ,QAAQ,4CAA4C;AAErE,SACEC,eAAe,EACfC,eAAe,EACfC,YAAY,EACZC,SAAS,EACTC,SAAS,QACJ,aAAa;AAGpB,OAAO,MAAMC,QAAkB,GAAG;EAChCC,MAAM,EAAE,CAAC,CAAQ;EACjBC,SAAS,EAAEJ,SAAS;EACpB,CAACJ,QAAQ,GAAG;IACVS,IAAI,EAAE;EACR;AACF,CAAC;AAGD,OAAO,MAAMC,QAAkB,GAAG;EAChCH,MAAM,EAAE,CAAC,CAAQ;EACjBC,SAAS,EAAEH,SAAS;EACpB,CAACL,QAAQ,GAAG;IACVS,IAAI,EAAE;EACR;AACF,CAAC;AAGD,OAAO,MAAME,WAAwB,GAAG;EACtCJ,MAAM,EAAE,CAAC,CAAW;EACpBC,SAAS,EAAEL,YAAY;EACvB,CAACH,QAAQ,GAAG;IACVY,YAAY,EAAE,MAAM;IACpBH,IAAI,EAAE;EACR;AACF,CAAC;AAMD,OAAO,MAAMI,cAA8B,GAAG;EAC5CN,MAAM,EAAE,CAAC,CAAc;EACvBC,SAAS,EAAEP,eAAe;EAC1B,CAACD,QAAQ,GAAG;IACVY,YAAY,EAAE,MAAM;IACpBH,IAAI,EAAE;EACR;AACF,CAAC;AAMD,OAAO,MAAMK,cAA8B,GAAG;EAC5CP,MAAM,EAAE,CAAC,CAAc;EACvBC,SAAS,EAAEN,eAAe;EAC1B,CAACF,QAAQ,GAAG;IACVY,YAAY,EAAE,MAAM;IACpBH,IAAI,EAAE;EACR;AACF,CAAC;AAED,OAAO,MAAMM,aAAa,GAAG;EAC3BC,GAAG,EAAEV,QAAQ;EACbW,GAAG,EAAEP,QAAQ;EACbQ,MAAM,EAAEP,WAAW;EACnBQ,SAAS,EAAEN,cAAc;EACzBO,SAAS,EAAEN,cAAc;EACzB,CAACd,QAAQ,GAAG;IACVqB,OAAO,EAAE;EACX;AACF,CAAmC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- /* Generated by @palantir/pack.document-schema.type-gen@0.17.0 */
1
+ /* Generated by @palantir/pack.document-schema.type-gen@0.19.0 */
2
2
 
3
3
  import { Metadata } from '@palantir/pack.document-schema.model-types';
4
4
  import { EventSchema } from './schema.js';
@@ -1 +1 @@
1
- {"version":3,"file":"external-refs.js","names":["Metadata","EventSchema","EventModel","__type","zodSchema","externalRefFieldTypes","documentRef","userRef","name","DocumentModel","Event","version"],"sources":["external-refs.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.17.0 */\n\nimport type {\n DocumentSchema,\n RecordModel,\n UnionModel,\n} from '@palantir/pack.document-schema.model-types';\nimport { Metadata } from '@palantir/pack.document-schema.model-types';\nimport type { Event } from './types.js';\nimport { EventSchema } from './schema.js';\n\nexport interface EventModel extends RecordModel<Event, typeof EventSchema> {}\nexport const EventModel: EventModel = {\n __type: {} as Event,\n zodSchema: EventSchema,\n [Metadata]: {\n externalRefFieldTypes: {\n documentRef: 'docRef',\n userRef: 'userRef',\n },\n name: 'Event',\n },\n};\n\nexport const DocumentModel = {\n Event: EventModel,\n [Metadata]: {\n version: 1,\n },\n} as const satisfies DocumentSchema;\n\nexport type DocumentModel = typeof DocumentModel;\n"],"mappings":"AAAA;;AAOA,SAASA,QAAQ,QAAQ,4CAA4C;AAErE,SAASC,WAAW,QAAQ,aAAa;AAGzC,OAAO,MAAMC,UAAsB,GAAG;EACpCC,MAAM,EAAE,CAAC,CAAU;EACnBC,SAAS,EAAEH,WAAW;EACtB,CAACD,QAAQ,GAAG;IACVK,qBAAqB,EAAE;MACrBC,WAAW,EAAE,QAAQ;MACrBC,OAAO,EAAE;IACX,CAAC;IACDC,IAAI,EAAE;EACR;AACF,CAAC;AAED,OAAO,MAAMC,aAAa,GAAG;EAC3BC,KAAK,EAAER,UAAU;EACjB,CAACF,QAAQ,GAAG;IACVW,OAAO,EAAE;EACX;AACF,CAAmC","ignoreList":[]}
1
+ {"version":3,"file":"external-refs.js","names":["Metadata","EventSchema","EventModel","__type","zodSchema","externalRefFieldTypes","documentRef","userRef","name","DocumentModel","Event","version"],"sources":["external-refs.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.19.0 */\n\nimport type {\n DocumentSchema,\n RecordModel,\n UnionModel,\n} from '@palantir/pack.document-schema.model-types';\nimport { Metadata } from '@palantir/pack.document-schema.model-types';\nimport type { Event } from './types.js';\nimport { EventSchema } from './schema.js';\n\nexport interface EventModel extends RecordModel<Event, typeof EventSchema> {}\nexport const EventModel: EventModel = {\n __type: {} as Event,\n zodSchema: EventSchema,\n [Metadata]: {\n externalRefFieldTypes: {\n documentRef: 'docRef',\n userRef: 'userRef',\n },\n name: 'Event',\n },\n};\n\nexport const DocumentModel = {\n Event: EventModel,\n [Metadata]: {\n version: 1,\n },\n} as const satisfies DocumentSchema;\n\nexport type DocumentModel = typeof DocumentModel;\n"],"mappings":"AAAA;;AAOA,SAASA,QAAQ,QAAQ,4CAA4C;AAErE,SAASC,WAAW,QAAQ,aAAa;AAGzC,OAAO,MAAMC,UAAsB,GAAG;EACpCC,MAAM,EAAE,CAAC,CAAU;EACnBC,SAAS,EAAEH,WAAW;EACtB,CAACD,QAAQ,GAAG;IACVK,qBAAqB,EAAE;MACrBC,WAAW,EAAE,QAAQ;MACrBC,OAAO,EAAE;IACX,CAAC;IACDC,IAAI,EAAE;EACR;AACF,CAAC;AAED,OAAO,MAAMC,aAAa,GAAG;EAC3BC,KAAK,EAAER,UAAU;EACjB,CAACF,QAAQ,GAAG;IACVW,OAAO,EAAE;EACX;AACF,CAAmC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- /* Generated by @palantir/pack.document-schema.type-gen@0.17.0 */
1
+ /* Generated by @palantir/pack.document-schema.type-gen@0.19.0 */
2
2
 
3
3
  import { Metadata } from '@palantir/pack.document-schema.model-types';
4
4
  import { PersonSchema } from './schema.js';
@@ -1 +1 @@
1
- {"version":3,"file":"simple-record.js","names":["Metadata","PersonSchema","PersonModel","__type","zodSchema","name","DocumentModel","Person","version"],"sources":["simple-record.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.17.0 */\n\nimport type {\n DocumentSchema,\n RecordModel,\n UnionModel,\n} from '@palantir/pack.document-schema.model-types';\nimport { Metadata } from '@palantir/pack.document-schema.model-types';\nimport type { Person } from './types.js';\nimport { PersonSchema } from './schema.js';\n\nexport interface PersonModel extends RecordModel<Person, typeof PersonSchema> {}\nexport const PersonModel: PersonModel = {\n __type: {} as Person,\n zodSchema: PersonSchema,\n [Metadata]: {\n name: 'Person',\n },\n};\n\nexport const DocumentModel = {\n Person: PersonModel,\n [Metadata]: {\n version: 1,\n },\n} as const satisfies DocumentSchema;\n\nexport type DocumentModel = typeof DocumentModel;\n"],"mappings":"AAAA;;AAOA,SAASA,QAAQ,QAAQ,4CAA4C;AAErE,SAASC,YAAY,QAAQ,aAAa;AAG1C,OAAO,MAAMC,WAAwB,GAAG;EACtCC,MAAM,EAAE,CAAC,CAAW;EACpBC,SAAS,EAAEH,YAAY;EACvB,CAACD,QAAQ,GAAG;IACVK,IAAI,EAAE;EACR;AACF,CAAC;AAED,OAAO,MAAMC,aAAa,GAAG;EAC3BC,MAAM,EAAEL,WAAW;EACnB,CAACF,QAAQ,GAAG;IACVQ,OAAO,EAAE;EACX;AACF,CAAmC","ignoreList":[]}
1
+ {"version":3,"file":"simple-record.js","names":["Metadata","PersonSchema","PersonModel","__type","zodSchema","name","DocumentModel","Person","version"],"sources":["simple-record.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.19.0 */\n\nimport type {\n DocumentSchema,\n RecordModel,\n UnionModel,\n} from '@palantir/pack.document-schema.model-types';\nimport { Metadata } from '@palantir/pack.document-schema.model-types';\nimport type { Person } from './types.js';\nimport { PersonSchema } from './schema.js';\n\nexport interface PersonModel extends RecordModel<Person, typeof PersonSchema> {}\nexport const PersonModel: PersonModel = {\n __type: {} as Person,\n zodSchema: PersonSchema,\n [Metadata]: {\n name: 'Person',\n },\n};\n\nexport const DocumentModel = {\n Person: PersonModel,\n [Metadata]: {\n version: 1,\n },\n} as const satisfies DocumentSchema;\n\nexport type DocumentModel = typeof DocumentModel;\n"],"mappings":"AAAA;;AAOA,SAASA,QAAQ,QAAQ,4CAA4C;AAErE,SAASC,YAAY,QAAQ,aAAa;AAG1C,OAAO,MAAMC,WAAwB,GAAG;EACtCC,MAAM,EAAE,CAAC,CAAW;EACpBC,SAAS,EAAEH,YAAY;EACvB,CAACD,QAAQ,GAAG;IACVK,IAAI,EAAE;EACR;AACF,CAAC;AAED,OAAO,MAAMC,aAAa,GAAG;EAC3BC,MAAM,EAAEL,WAAW;EACnB,CAACF,QAAQ,GAAG;IACVQ,OAAO,EAAE;EACX;AACF,CAAmC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- /* Generated by @palantir/pack.document-schema.type-gen@0.17.0 */
1
+ /* Generated by @palantir/pack.document-schema.type-gen@0.19.0 */
2
2
 
3
3
  import { Metadata } from '@palantir/pack.document-schema.model-types';
4
4
  import { NodeObjectSchema, NodeSchema, NodeTextBoxSchema, ObjectNodeSchema, TextBoxSchema } from './schema.js';
@@ -1 +1 @@
1
- {"version":3,"file":"union-types.js","names":["Metadata","NodeObjectSchema","NodeSchema","NodeTextBoxSchema","ObjectNodeSchema","TextBoxSchema","ObjectNodeModel","__type","zodSchema","name","TextBoxModel","NodeModel","discriminant","NodeObjectModel","NodeTextBoxModel","DocumentModel","ObjectNode","TextBox","Node","NodeObject","NodeTextBox","version"],"sources":["union-types.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.17.0 */\n\nimport type {\n DocumentSchema,\n RecordModel,\n UnionModel,\n} from '@palantir/pack.document-schema.model-types';\nimport { Metadata } from '@palantir/pack.document-schema.model-types';\nimport type {\n Node,\n NodeObject,\n NodeTextBox,\n ObjectNode,\n TextBox,\n} from './types.js';\nimport {\n NodeObjectSchema,\n NodeSchema,\n NodeTextBoxSchema,\n ObjectNodeSchema,\n TextBoxSchema,\n} from './schema.js';\n\nexport interface ObjectNodeModel extends RecordModel<\n ObjectNode,\n typeof ObjectNodeSchema\n> {}\nexport const ObjectNodeModel: ObjectNodeModel = {\n __type: {} as ObjectNode,\n zodSchema: ObjectNodeSchema,\n [Metadata]: {\n name: 'ObjectNode',\n },\n};\n\nexport interface TextBoxModel extends RecordModel<\n TextBox,\n typeof TextBoxSchema\n> {}\nexport const TextBoxModel: TextBoxModel = {\n __type: {} as TextBox,\n zodSchema: TextBoxSchema,\n [Metadata]: {\n name: 'TextBox',\n },\n};\n\nexport interface NodeModel extends UnionModel<Node, typeof NodeSchema> {}\nexport const NodeModel: NodeModel = {\n __type: {} as Node,\n zodSchema: NodeSchema,\n [Metadata]: {\n discriminant: 'type',\n name: 'Node',\n },\n};\n\nexport interface NodeObjectModel extends UnionModel<\n NodeObject,\n typeof NodeObjectSchema\n> {}\nexport const NodeObjectModel: NodeObjectModel = {\n __type: {} as NodeObject,\n zodSchema: NodeObjectSchema,\n [Metadata]: {\n discriminant: 'type',\n name: 'NodeObject',\n },\n};\n\nexport interface NodeTextBoxModel extends UnionModel<\n NodeTextBox,\n typeof NodeTextBoxSchema\n> {}\nexport const NodeTextBoxModel: NodeTextBoxModel = {\n __type: {} as NodeTextBox,\n zodSchema: NodeTextBoxSchema,\n [Metadata]: {\n discriminant: 'type',\n name: 'NodeTextBox',\n },\n};\n\nexport const DocumentModel = {\n ObjectNode: ObjectNodeModel,\n TextBox: TextBoxModel,\n Node: NodeModel,\n NodeObject: NodeObjectModel,\n NodeTextBox: NodeTextBoxModel,\n [Metadata]: {\n version: 1,\n },\n} as const satisfies DocumentSchema;\n\nexport type DocumentModel = typeof DocumentModel;\n"],"mappings":"AAAA;;AAOA,SAASA,QAAQ,QAAQ,4CAA4C;AAQrE,SACEC,gBAAgB,EAChBC,UAAU,EACVC,iBAAiB,EACjBC,gBAAgB,EAChBC,aAAa,QACR,aAAa;AAMpB,OAAO,MAAMC,eAAgC,GAAG;EAC9CC,MAAM,EAAE,CAAC,CAAe;EACxBC,SAAS,EAAEJ,gBAAgB;EAC3B,CAACJ,QAAQ,GAAG;IACVS,IAAI,EAAE;EACR;AACF,CAAC;AAMD,OAAO,MAAMC,YAA0B,GAAG;EACxCH,MAAM,EAAE,CAAC,CAAY;EACrBC,SAAS,EAAEH,aAAa;EACxB,CAACL,QAAQ,GAAG;IACVS,IAAI,EAAE;EACR;AACF,CAAC;AAGD,OAAO,MAAME,SAAoB,GAAG;EAClCJ,MAAM,EAAE,CAAC,CAAS;EAClBC,SAAS,EAAEN,UAAU;EACrB,CAACF,QAAQ,GAAG;IACVY,YAAY,EAAE,MAAM;IACpBH,IAAI,EAAE;EACR;AACF,CAAC;AAMD,OAAO,MAAMI,eAAgC,GAAG;EAC9CN,MAAM,EAAE,CAAC,CAAe;EACxBC,SAAS,EAAEP,gBAAgB;EAC3B,CAACD,QAAQ,GAAG;IACVY,YAAY,EAAE,MAAM;IACpBH,IAAI,EAAE;EACR;AACF,CAAC;AAMD,OAAO,MAAMK,gBAAkC,GAAG;EAChDP,MAAM,EAAE,CAAC,CAAgB;EACzBC,SAAS,EAAEL,iBAAiB;EAC5B,CAACH,QAAQ,GAAG;IACVY,YAAY,EAAE,MAAM;IACpBH,IAAI,EAAE;EACR;AACF,CAAC;AAED,OAAO,MAAMM,aAAa,GAAG;EAC3BC,UAAU,EAAEV,eAAe;EAC3BW,OAAO,EAAEP,YAAY;EACrBQ,IAAI,EAAEP,SAAS;EACfQ,UAAU,EAAEN,eAAe;EAC3BO,WAAW,EAAEN,gBAAgB;EAC7B,CAACd,QAAQ,GAAG;IACVqB,OAAO,EAAE;EACX;AACF,CAAmC","ignoreList":[]}
1
+ {"version":3,"file":"union-types.js","names":["Metadata","NodeObjectSchema","NodeSchema","NodeTextBoxSchema","ObjectNodeSchema","TextBoxSchema","ObjectNodeModel","__type","zodSchema","name","TextBoxModel","NodeModel","discriminant","NodeObjectModel","NodeTextBoxModel","DocumentModel","ObjectNode","TextBox","Node","NodeObject","NodeTextBox","version"],"sources":["union-types.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.19.0 */\n\nimport type {\n DocumentSchema,\n RecordModel,\n UnionModel,\n} from '@palantir/pack.document-schema.model-types';\nimport { Metadata } from '@palantir/pack.document-schema.model-types';\nimport type {\n Node,\n NodeObject,\n NodeTextBox,\n ObjectNode,\n TextBox,\n} from './types.js';\nimport {\n NodeObjectSchema,\n NodeSchema,\n NodeTextBoxSchema,\n ObjectNodeSchema,\n TextBoxSchema,\n} from './schema.js';\n\nexport interface ObjectNodeModel extends RecordModel<\n ObjectNode,\n typeof ObjectNodeSchema\n> {}\nexport const ObjectNodeModel: ObjectNodeModel = {\n __type: {} as ObjectNode,\n zodSchema: ObjectNodeSchema,\n [Metadata]: {\n name: 'ObjectNode',\n },\n};\n\nexport interface TextBoxModel extends RecordModel<\n TextBox,\n typeof TextBoxSchema\n> {}\nexport const TextBoxModel: TextBoxModel = {\n __type: {} as TextBox,\n zodSchema: TextBoxSchema,\n [Metadata]: {\n name: 'TextBox',\n },\n};\n\nexport interface NodeModel extends UnionModel<Node, typeof NodeSchema> {}\nexport const NodeModel: NodeModel = {\n __type: {} as Node,\n zodSchema: NodeSchema,\n [Metadata]: {\n discriminant: 'type',\n name: 'Node',\n },\n};\n\nexport interface NodeObjectModel extends UnionModel<\n NodeObject,\n typeof NodeObjectSchema\n> {}\nexport const NodeObjectModel: NodeObjectModel = {\n __type: {} as NodeObject,\n zodSchema: NodeObjectSchema,\n [Metadata]: {\n discriminant: 'type',\n name: 'NodeObject',\n },\n};\n\nexport interface NodeTextBoxModel extends UnionModel<\n NodeTextBox,\n typeof NodeTextBoxSchema\n> {}\nexport const NodeTextBoxModel: NodeTextBoxModel = {\n __type: {} as NodeTextBox,\n zodSchema: NodeTextBoxSchema,\n [Metadata]: {\n discriminant: 'type',\n name: 'NodeTextBox',\n },\n};\n\nexport const DocumentModel = {\n ObjectNode: ObjectNodeModel,\n TextBox: TextBoxModel,\n Node: NodeModel,\n NodeObject: NodeObjectModel,\n NodeTextBox: NodeTextBoxModel,\n [Metadata]: {\n version: 1,\n },\n} as const satisfies DocumentSchema;\n\nexport type DocumentModel = typeof DocumentModel;\n"],"mappings":"AAAA;;AAOA,SAASA,QAAQ,QAAQ,4CAA4C;AAQrE,SACEC,gBAAgB,EAChBC,UAAU,EACVC,iBAAiB,EACjBC,gBAAgB,EAChBC,aAAa,QACR,aAAa;AAMpB,OAAO,MAAMC,eAAgC,GAAG;EAC9CC,MAAM,EAAE,CAAC,CAAe;EACxBC,SAAS,EAAEJ,gBAAgB;EAC3B,CAACJ,QAAQ,GAAG;IACVS,IAAI,EAAE;EACR;AACF,CAAC;AAMD,OAAO,MAAMC,YAA0B,GAAG;EACxCH,MAAM,EAAE,CAAC,CAAY;EACrBC,SAAS,EAAEH,aAAa;EACxB,CAACL,QAAQ,GAAG;IACVS,IAAI,EAAE;EACR;AACF,CAAC;AAGD,OAAO,MAAME,SAAoB,GAAG;EAClCJ,MAAM,EAAE,CAAC,CAAS;EAClBC,SAAS,EAAEN,UAAU;EACrB,CAACF,QAAQ,GAAG;IACVY,YAAY,EAAE,MAAM;IACpBH,IAAI,EAAE;EACR;AACF,CAAC;AAMD,OAAO,MAAMI,eAAgC,GAAG;EAC9CN,MAAM,EAAE,CAAC,CAAe;EACxBC,SAAS,EAAEP,gBAAgB;EAC3B,CAACD,QAAQ,GAAG;IACVY,YAAY,EAAE,MAAM;IACpBH,IAAI,EAAE;EACR;AACF,CAAC;AAMD,OAAO,MAAMK,gBAAkC,GAAG;EAChDP,MAAM,EAAE,CAAC,CAAgB;EACzBC,SAAS,EAAEL,iBAAiB;EAC5B,CAACH,QAAQ,GAAG;IACVY,YAAY,EAAE,MAAM;IACpBH,IAAI,EAAE;EACR;AACF,CAAC;AAED,OAAO,MAAMM,aAAa,GAAG;EAC3BC,UAAU,EAAEV,eAAe;EAC3BW,OAAO,EAAEP,YAAY;EACrBQ,IAAI,EAAEP,SAAS;EACfQ,UAAU,EAAEN,eAAe;EAC3BO,WAAW,EAAEN,gBAAgB;EAC7B,CAACd,QAAQ,GAAG;IACVqB,OAAO,EAAE;EACX;AACF,CAAmC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- /* Generated by @palantir/pack.document-schema.type-gen@0.17.0 */
1
+ /* Generated by @palantir/pack.document-schema.type-gen@0.19.0 */
2
2
 
3
3
  import { z } from 'zod';
4
4
  export const ContainerSchema = z.object({
@@ -1 +1 @@
1
- {"version":3,"file":"array-and-map-types.js","names":["z","ContainerSchema","object","tags","array","string","metadata","record","unknown"],"sources":["array-and-map-types.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.17.0 */\n\nimport { z } from 'zod';\n\nexport const ContainerSchema = z.object({\n tags: z.array(z.string()),\n metadata: z.record(z.string(), z.unknown()),\n});\n"],"mappings":"AAAA;;AAEA,SAASA,CAAC,QAAQ,KAAK;AAEvB,OAAO,MAAMC,eAAe,GAAGD,CAAC,CAACE,MAAM,CAAC;EACtCC,IAAI,EAAEH,CAAC,CAACI,KAAK,CAACJ,CAAC,CAACK,MAAM,CAAC,CAAC,CAAC;EACzBC,QAAQ,EAAEN,CAAC,CAACO,MAAM,CAACP,CAAC,CAACK,MAAM,CAAC,CAAC,EAAEL,CAAC,CAACQ,OAAO,CAAC,CAAC;AAC5C,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"array-and-map-types.js","names":["z","ContainerSchema","object","tags","array","string","metadata","record","unknown"],"sources":["array-and-map-types.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.19.0 */\n\nimport { z } from 'zod';\n\nexport const ContainerSchema = z.object({\n tags: z.array(z.string()),\n metadata: z.record(z.string(), z.unknown()),\n});\n"],"mappings":"AAAA;;AAEA,SAASA,CAAC,QAAQ,KAAK;AAEvB,OAAO,MAAMC,eAAe,GAAGD,CAAC,CAACE,MAAM,CAAC;EACtCC,IAAI,EAAEH,CAAC,CAACI,KAAK,CAACJ,CAAC,CAACK,MAAM,CAAC,CAAC,CAAC;EACzBC,QAAQ,EAAEN,CAAC,CAACO,MAAM,CAACP,CAAC,CAACK,MAAM,CAAC,CAAC,EAAEL,CAAC,CAACQ,OAAO,CAAC,CAAC;AAC5C,CAAC,CAAC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- /* Generated by @palantir/pack.document-schema.type-gen@0.17.0 */
1
+ /* Generated by @palantir/pack.document-schema.type-gen@0.19.0 */
2
2
 
3
3
  import { z } from 'zod';
4
4
  export const FeatureSchema = z.object({
@@ -1 +1 @@
1
- {"version":3,"file":"boolean-fields.js","names":["z","FeatureSchema","object","enabled","boolean","isPublic","optional","flags","array"],"sources":["boolean-fields.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.17.0 */\n\nimport { z } from 'zod';\n\nexport const FeatureSchema = z.object({\n enabled: z.boolean(),\n isPublic: z.boolean().optional(),\n flags: z.array(z.boolean()),\n});\n"],"mappings":"AAAA;;AAEA,SAASA,CAAC,QAAQ,KAAK;AAEvB,OAAO,MAAMC,aAAa,GAAGD,CAAC,CAACE,MAAM,CAAC;EACpCC,OAAO,EAAEH,CAAC,CAACI,OAAO,CAAC,CAAC;EACpBC,QAAQ,EAAEL,CAAC,CAACI,OAAO,CAAC,CAAC,CAACE,QAAQ,CAAC,CAAC;EAChCC,KAAK,EAAEP,CAAC,CAACQ,KAAK,CAACR,CAAC,CAACI,OAAO,CAAC,CAAC;AAC5B,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"boolean-fields.js","names":["z","FeatureSchema","object","enabled","boolean","isPublic","optional","flags","array"],"sources":["boolean-fields.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.19.0 */\n\nimport { z } from 'zod';\n\nexport const FeatureSchema = z.object({\n enabled: z.boolean(),\n isPublic: z.boolean().optional(),\n flags: z.array(z.boolean()),\n});\n"],"mappings":"AAAA;;AAEA,SAASA,CAAC,QAAQ,KAAK;AAEvB,OAAO,MAAMC,aAAa,GAAGD,CAAC,CAACE,MAAM,CAAC;EACpCC,OAAO,EAAEH,CAAC,CAACI,OAAO,CAAC,CAAC;EACpBC,QAAQ,EAAEL,CAAC,CAACI,OAAO,CAAC,CAAC,CAACE,QAAQ,CAAC,CAAC;EAChCC,KAAK,EAAEP,CAAC,CAACQ,KAAK,CAACR,CAAC,CAACI,OAAO,CAAC,CAAC;AAC5B,CAAC,CAAC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- /* Generated by @palantir/pack.document-schema.type-gen@0.17.0 */
1
+ /* Generated by @palantir/pack.document-schema.type-gen@0.19.0 */
2
2
 
3
3
  import { z } from 'zod';
4
4
  export const CatSchema = z.object({
@@ -1 +1 @@
1
- {"version":3,"file":"custom-discriminant.js","names":["z","CatSchema","object","meow","string","DogSchema","bark","AnimalCatSchema","extend","kind","literal","AnimalDogSchema","AnimalSchema","discriminatedUnion"],"sources":["custom-discriminant.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.17.0 */\n\nimport { z } from 'zod';\n\nexport const CatSchema = z.object({\n meow: z.string(),\n});\n\nexport const DogSchema = z.object({\n bark: z.string(),\n});\n\nexport const AnimalCatSchema = CatSchema.extend({\n kind: z.literal('cat'),\n});\n\nexport const AnimalDogSchema = DogSchema.extend({\n kind: z.literal('dog'),\n});\n\nexport const AnimalSchema = z.discriminatedUnion('kind', [\n AnimalCatSchema,\n AnimalDogSchema,\n]);\n"],"mappings":"AAAA;;AAEA,SAASA,CAAC,QAAQ,KAAK;AAEvB,OAAO,MAAMC,SAAS,GAAGD,CAAC,CAACE,MAAM,CAAC;EAChCC,IAAI,EAAEH,CAAC,CAACI,MAAM,CAAC;AACjB,CAAC,CAAC;AAEF,OAAO,MAAMC,SAAS,GAAGL,CAAC,CAACE,MAAM,CAAC;EAChCI,IAAI,EAAEN,CAAC,CAACI,MAAM,CAAC;AACjB,CAAC,CAAC;AAEF,OAAO,MAAMG,eAAe,GAAGN,SAAS,CAACO,MAAM,CAAC;EAC9CC,IAAI,EAAET,CAAC,CAACU,OAAO,CAAC,KAAK;AACvB,CAAC,CAAC;AAEF,OAAO,MAAMC,eAAe,GAAGN,SAAS,CAACG,MAAM,CAAC;EAC9CC,IAAI,EAAET,CAAC,CAACU,OAAO,CAAC,KAAK;AACvB,CAAC,CAAC;AAEF,OAAO,MAAME,YAAY,GAAGZ,CAAC,CAACa,kBAAkB,CAAC,MAAM,EAAE,CACvDN,eAAe,EACfI,eAAe,CAChB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"custom-discriminant.js","names":["z","CatSchema","object","meow","string","DogSchema","bark","AnimalCatSchema","extend","kind","literal","AnimalDogSchema","AnimalSchema","discriminatedUnion"],"sources":["custom-discriminant.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.19.0 */\n\nimport { z } from 'zod';\n\nexport const CatSchema = z.object({\n meow: z.string(),\n});\n\nexport const DogSchema = z.object({\n bark: z.string(),\n});\n\nexport const AnimalCatSchema = CatSchema.extend({\n kind: z.literal('cat'),\n});\n\nexport const AnimalDogSchema = DogSchema.extend({\n kind: z.literal('dog'),\n});\n\nexport const AnimalSchema = z.discriminatedUnion('kind', [\n AnimalCatSchema,\n AnimalDogSchema,\n]);\n"],"mappings":"AAAA;;AAEA,SAASA,CAAC,QAAQ,KAAK;AAEvB,OAAO,MAAMC,SAAS,GAAGD,CAAC,CAACE,MAAM,CAAC;EAChCC,IAAI,EAAEH,CAAC,CAACI,MAAM,CAAC;AACjB,CAAC,CAAC;AAEF,OAAO,MAAMC,SAAS,GAAGL,CAAC,CAACE,MAAM,CAAC;EAChCI,IAAI,EAAEN,CAAC,CAACI,MAAM,CAAC;AACjB,CAAC,CAAC;AAEF,OAAO,MAAMG,eAAe,GAAGN,SAAS,CAACO,MAAM,CAAC;EAC9CC,IAAI,EAAET,CAAC,CAACU,OAAO,CAAC,KAAK;AACvB,CAAC,CAAC;AAEF,OAAO,MAAMC,eAAe,GAAGN,SAAS,CAACG,MAAM,CAAC;EAC9CC,IAAI,EAAET,CAAC,CAACU,OAAO,CAAC,KAAK;AACvB,CAAC,CAAC;AAEF,OAAO,MAAME,YAAY,GAAGZ,CAAC,CAACa,kBAAkB,CAAC,MAAM,EAAE,CACvDN,eAAe,EACfI,eAAe,CAChB,CAAC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- /* Generated by @palantir/pack.document-schema.type-gen@0.17.0 */
1
+ /* Generated by @palantir/pack.document-schema.type-gen@0.19.0 */
2
2
 
3
3
  import { z } from 'zod';
4
4
  export const EventSchema = z.object({
@@ -1 +1 @@
1
- {"version":3,"file":"datetime-fields.js","names":["z","EventSchema","object","timestamp","string","datetime"],"sources":["datetime-fields.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.17.0 */\n\nimport { z } from 'zod';\n\nexport const EventSchema = z.object({\n timestamp: z.string().datetime(),\n});\n"],"mappings":"AAAA;;AAEA,SAASA,CAAC,QAAQ,KAAK;AAEvB,OAAO,MAAMC,WAAW,GAAGD,CAAC,CAACE,MAAM,CAAC;EAClCC,SAAS,EAAEH,CAAC,CAACI,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC;AACjC,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"datetime-fields.js","names":["z","EventSchema","object","timestamp","string","datetime"],"sources":["datetime-fields.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.19.0 */\n\nimport { z } from 'zod';\n\nexport const EventSchema = z.object({\n timestamp: z.string().datetime(),\n});\n"],"mappings":"AAAA;;AAEA,SAASA,CAAC,QAAQ,KAAK;AAEvB,OAAO,MAAMC,WAAW,GAAGD,CAAC,CAACE,MAAM,CAAC;EAClCC,SAAS,EAAEH,CAAC,CAACI,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC;AACjC,CAAC,CAAC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- /* Generated by @palantir/pack.document-schema.type-gen@0.17.0 */
1
+ /* Generated by @palantir/pack.document-schema.type-gen@0.19.0 */
2
2
 
3
3
  import { z } from 'zod';
4
4
  export const PersonSchema = z.object({
@@ -1 +1 @@
1
- {"version":3,"file":"simple-records.js","names":["z","PersonSchema","object","name","string","min","max","age","number","int","email","optional"],"sources":["simple-records.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.17.0 */\n\nimport { z } from 'zod';\n\nexport const PersonSchema = z.object({\n name: z.string().min(2).max(50),\n age: z.number().int().min(0).max(150),\n email: z.string().optional(),\n});\n"],"mappings":"AAAA;;AAEA,SAASA,CAAC,QAAQ,KAAK;AAEvB,OAAO,MAAMC,YAAY,GAAGD,CAAC,CAACE,MAAM,CAAC;EACnCC,IAAI,EAAEH,CAAC,CAACI,MAAM,CAAC,CAAC,CAACC,GAAG,CAAC,CAAC,CAAC,CAACC,GAAG,CAAC,EAAE,CAAC;EAC/BC,GAAG,EAAEP,CAAC,CAACQ,MAAM,CAAC,CAAC,CAACC,GAAG,CAAC,CAAC,CAACJ,GAAG,CAAC,CAAC,CAAC,CAACC,GAAG,CAAC,GAAG,CAAC;EACrCI,KAAK,EAAEV,CAAC,CAACI,MAAM,CAAC,CAAC,CAACO,QAAQ,CAAC;AAC7B,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"simple-records.js","names":["z","PersonSchema","object","name","string","min","max","age","number","int","email","optional"],"sources":["simple-records.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.19.0 */\n\nimport { z } from 'zod';\n\nexport const PersonSchema = z.object({\n name: z.string().min(2).max(50),\n age: z.number().int().min(0).max(150),\n email: z.string().optional(),\n});\n"],"mappings":"AAAA;;AAEA,SAASA,CAAC,QAAQ,KAAK;AAEvB,OAAO,MAAMC,YAAY,GAAGD,CAAC,CAACE,MAAM,CAAC;EACnCC,IAAI,EAAEH,CAAC,CAACI,MAAM,CAAC,CAAC,CAACC,GAAG,CAAC,CAAC,CAAC,CAACC,GAAG,CAAC,EAAE,CAAC;EAC/BC,GAAG,EAAEP,CAAC,CAACQ,MAAM,CAAC,CAAC,CAACC,GAAG,CAAC,CAAC,CAACJ,GAAG,CAAC,CAAC,CAAC,CAACC,GAAG,CAAC,GAAG,CAAC;EACrCI,KAAK,EAAEV,CAAC,CAACI,MAAM,CAAC,CAAC,CAACO,QAAQ,CAAC;AAC7B,CAAC,CAAC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- /* Generated by @palantir/pack.document-schema.type-gen@0.17.0 */
1
+ /* Generated by @palantir/pack.document-schema.type-gen@0.19.0 */
2
2
 
3
3
  import { z } from 'zod';
4
4
  export const FooSchema = z.object({
@@ -1 +1 @@
1
- {"version":3,"file":"union-before-records.js","names":["z","FooSchema","object","value","string","BarSchema","count","number","int","FooBarFooSchema","extend","type","literal","FooBarBarSchema","FooBarSchema","discriminatedUnion"],"sources":["union-before-records.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.17.0 */\n\nimport { z } from 'zod';\n\nexport const FooSchema = z.object({\n value: z.string(),\n});\n\nexport const BarSchema = z.object({\n count: z.number().int(),\n});\n\nexport const FooBarFooSchema = FooSchema.extend({\n type: z.literal('foo'),\n});\n\nexport const FooBarBarSchema = BarSchema.extend({\n type: z.literal('bar'),\n});\n\nexport const FooBarSchema = z.discriminatedUnion('type', [\n FooBarFooSchema,\n FooBarBarSchema,\n]);\n"],"mappings":"AAAA;;AAEA,SAASA,CAAC,QAAQ,KAAK;AAEvB,OAAO,MAAMC,SAAS,GAAGD,CAAC,CAACE,MAAM,CAAC;EAChCC,KAAK,EAAEH,CAAC,CAACI,MAAM,CAAC;AAClB,CAAC,CAAC;AAEF,OAAO,MAAMC,SAAS,GAAGL,CAAC,CAACE,MAAM,CAAC;EAChCI,KAAK,EAAEN,CAAC,CAACO,MAAM,CAAC,CAAC,CAACC,GAAG,CAAC;AACxB,CAAC,CAAC;AAEF,OAAO,MAAMC,eAAe,GAAGR,SAAS,CAACS,MAAM,CAAC;EAC9CC,IAAI,EAAEX,CAAC,CAACY,OAAO,CAAC,KAAK;AACvB,CAAC,CAAC;AAEF,OAAO,MAAMC,eAAe,GAAGR,SAAS,CAACK,MAAM,CAAC;EAC9CC,IAAI,EAAEX,CAAC,CAACY,OAAO,CAAC,KAAK;AACvB,CAAC,CAAC;AAEF,OAAO,MAAME,YAAY,GAAGd,CAAC,CAACe,kBAAkB,CAAC,MAAM,EAAE,CACvDN,eAAe,EACfI,eAAe,CAChB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"union-before-records.js","names":["z","FooSchema","object","value","string","BarSchema","count","number","int","FooBarFooSchema","extend","type","literal","FooBarBarSchema","FooBarSchema","discriminatedUnion"],"sources":["union-before-records.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.19.0 */\n\nimport { z } from 'zod';\n\nexport const FooSchema = z.object({\n value: z.string(),\n});\n\nexport const BarSchema = z.object({\n count: z.number().int(),\n});\n\nexport const FooBarFooSchema = FooSchema.extend({\n type: z.literal('foo'),\n});\n\nexport const FooBarBarSchema = BarSchema.extend({\n type: z.literal('bar'),\n});\n\nexport const FooBarSchema = z.discriminatedUnion('type', [\n FooBarFooSchema,\n FooBarBarSchema,\n]);\n"],"mappings":"AAAA;;AAEA,SAASA,CAAC,QAAQ,KAAK;AAEvB,OAAO,MAAMC,SAAS,GAAGD,CAAC,CAACE,MAAM,CAAC;EAChCC,KAAK,EAAEH,CAAC,CAACI,MAAM,CAAC;AAClB,CAAC,CAAC;AAEF,OAAO,MAAMC,SAAS,GAAGL,CAAC,CAACE,MAAM,CAAC;EAChCI,KAAK,EAAEN,CAAC,CAACO,MAAM,CAAC,CAAC,CAACC,GAAG,CAAC;AACxB,CAAC,CAAC;AAEF,OAAO,MAAMC,eAAe,GAAGR,SAAS,CAACS,MAAM,CAAC;EAC9CC,IAAI,EAAEX,CAAC,CAACY,OAAO,CAAC,KAAK;AACvB,CAAC,CAAC;AAEF,OAAO,MAAMC,eAAe,GAAGR,SAAS,CAACK,MAAM,CAAC;EAC9CC,IAAI,EAAEX,CAAC,CAACY,OAAO,CAAC,KAAK;AACvB,CAAC,CAAC;AAEF,OAAO,MAAME,YAAY,GAAGd,CAAC,CAACe,kBAAkB,CAAC,MAAM,EAAE,CACvDN,eAAe,EACfI,eAAe,CAChB,CAAC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- /* Generated by @palantir/pack.document-schema.type-gen@0.17.0 */
1
+ /* Generated by @palantir/pack.document-schema.type-gen@0.19.0 */
2
2
 
3
3
  import { z } from 'zod';
4
4
  export const ObjectNodeSchema = z.object({
@@ -1 +1 @@
1
- {"version":3,"file":"union-types.js","names":["z","ObjectNodeSchema","object","x","number","y","label","string","optional","TextBoxSchema","text","NodeObjectSchema","extend","type","literal","NodeTextBoxSchema","NodeSchema","discriminatedUnion"],"sources":["union-types.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.17.0 */\n\nimport { z } from 'zod';\n\nexport const ObjectNodeSchema = z.object({\n x: z.number(),\n y: z.number(),\n label: z.string().optional(),\n});\n\nexport const TextBoxSchema = z.object({\n x: z.number(),\n y: z.number(),\n text: z.string(),\n});\n\nexport const NodeObjectSchema = ObjectNodeSchema.extend({\n type: z.literal('object'),\n});\n\nexport const NodeTextBoxSchema = TextBoxSchema.extend({\n type: z.literal('text-box'),\n});\n\nexport const NodeSchema = z.discriminatedUnion('type', [\n NodeObjectSchema,\n NodeTextBoxSchema,\n]);\n"],"mappings":"AAAA;;AAEA,SAASA,CAAC,QAAQ,KAAK;AAEvB,OAAO,MAAMC,gBAAgB,GAAGD,CAAC,CAACE,MAAM,CAAC;EACvCC,CAAC,EAAEH,CAAC,CAACI,MAAM,CAAC,CAAC;EACbC,CAAC,EAAEL,CAAC,CAACI,MAAM,CAAC,CAAC;EACbE,KAAK,EAAEN,CAAC,CAACO,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC;AAC7B,CAAC,CAAC;AAEF,OAAO,MAAMC,aAAa,GAAGT,CAAC,CAACE,MAAM,CAAC;EACpCC,CAAC,EAAEH,CAAC,CAACI,MAAM,CAAC,CAAC;EACbC,CAAC,EAAEL,CAAC,CAACI,MAAM,CAAC,CAAC;EACbM,IAAI,EAAEV,CAAC,CAACO,MAAM,CAAC;AACjB,CAAC,CAAC;AAEF,OAAO,MAAMI,gBAAgB,GAAGV,gBAAgB,CAACW,MAAM,CAAC;EACtDC,IAAI,EAAEb,CAAC,CAACc,OAAO,CAAC,QAAQ;AAC1B,CAAC,CAAC;AAEF,OAAO,MAAMC,iBAAiB,GAAGN,aAAa,CAACG,MAAM,CAAC;EACpDC,IAAI,EAAEb,CAAC,CAACc,OAAO,CAAC,UAAU;AAC5B,CAAC,CAAC;AAEF,OAAO,MAAME,UAAU,GAAGhB,CAAC,CAACiB,kBAAkB,CAAC,MAAM,EAAE,CACrDN,gBAAgB,EAChBI,iBAAiB,CAClB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"union-types.js","names":["z","ObjectNodeSchema","object","x","number","y","label","string","optional","TextBoxSchema","text","NodeObjectSchema","extend","type","literal","NodeTextBoxSchema","NodeSchema","discriminatedUnion"],"sources":["union-types.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.19.0 */\n\nimport { z } from 'zod';\n\nexport const ObjectNodeSchema = z.object({\n x: z.number(),\n y: z.number(),\n label: z.string().optional(),\n});\n\nexport const TextBoxSchema = z.object({\n x: z.number(),\n y: z.number(),\n text: z.string(),\n});\n\nexport const NodeObjectSchema = ObjectNodeSchema.extend({\n type: z.literal('object'),\n});\n\nexport const NodeTextBoxSchema = TextBoxSchema.extend({\n type: z.literal('text-box'),\n});\n\nexport const NodeSchema = z.discriminatedUnion('type', [\n NodeObjectSchema,\n NodeTextBoxSchema,\n]);\n"],"mappings":"AAAA;;AAEA,SAASA,CAAC,QAAQ,KAAK;AAEvB,OAAO,MAAMC,gBAAgB,GAAGD,CAAC,CAACE,MAAM,CAAC;EACvCC,CAAC,EAAEH,CAAC,CAACI,MAAM,CAAC,CAAC;EACbC,CAAC,EAAEL,CAAC,CAACI,MAAM,CAAC,CAAC;EACbE,KAAK,EAAEN,CAAC,CAACO,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC;AAC7B,CAAC,CAAC;AAEF,OAAO,MAAMC,aAAa,GAAGT,CAAC,CAACE,MAAM,CAAC;EACpCC,CAAC,EAAEH,CAAC,CAACI,MAAM,CAAC,CAAC;EACbC,CAAC,EAAEL,CAAC,CAACI,MAAM,CAAC,CAAC;EACbM,IAAI,EAAEV,CAAC,CAACO,MAAM,CAAC;AACjB,CAAC,CAAC;AAEF,OAAO,MAAMI,gBAAgB,GAAGV,gBAAgB,CAACW,MAAM,CAAC;EACtDC,IAAI,EAAEb,CAAC,CAACc,OAAO,CAAC,QAAQ;AAC1B,CAAC,CAAC;AAEF,OAAO,MAAMC,iBAAiB,GAAGN,aAAa,CAACG,MAAM,CAAC;EACpDC,IAAI,EAAEb,CAAC,CAACc,OAAO,CAAC,UAAU;AAC5B,CAAC,CAAC;AAEF,OAAO,MAAME,UAAU,GAAGhB,CAAC,CAACiB,kBAAkB,CAAC,MAAM,EAAE,CACrDN,gBAAgB,EAChBI,iBAAiB,CAClB,CAAC","ignoreList":[]}
@@ -2,7 +2,7 @@
2
2
  // documentType.ts
3
3
  // ============================================================
4
4
 
5
- /* Generated by @palantir/pack.document-schema.type-gen@0.17.0 */
5
+ /* Generated by @palantir/pack.document-schema.type-gen@0.19.0 */
6
6
 
7
7
  export const DOCUMENT_TYPE_NAME = 'Canvas Document Type';
8
8
  export const DOCUMENT_TYPE_DESCRIPTION = 'Document type description for demo canvas';
@@ -1 +1 @@
1
- {"version":3,"file":"with-name-and-description.js","names":["DOCUMENT_TYPE_NAME","DOCUMENT_TYPE_DESCRIPTION"],"sources":["with-name-and-description.ts"],"sourcesContent":["// ============================================================\n// documentType.ts\n// ============================================================\n\n/* Generated by @palantir/pack.document-schema.type-gen@0.17.0 */\n\nexport const DOCUMENT_TYPE_NAME = 'Canvas Document Type';\nexport const DOCUMENT_TYPE_DESCRIPTION =\n 'Document type description for demo canvas';\n"],"mappings":"AAAA;AACA;AACA;;AAEA;;AAEA,OAAO,MAAMA,kBAAkB,GAAG,sBAAsB;AACxD,OAAO,MAAMC,yBAAyB,GACpC,2CAA2C","ignoreList":[]}
1
+ {"version":3,"file":"with-name-and-description.js","names":["DOCUMENT_TYPE_NAME","DOCUMENT_TYPE_DESCRIPTION"],"sources":["with-name-and-description.ts"],"sourcesContent":["// ============================================================\n// documentType.ts\n// ============================================================\n\n/* Generated by @palantir/pack.document-schema.type-gen@0.19.0 */\n\nexport const DOCUMENT_TYPE_NAME = 'Canvas Document Type';\nexport const DOCUMENT_TYPE_DESCRIPTION =\n 'Document type description for demo canvas';\n"],"mappings":"AAAA;AACA;AACA;;AAEA;;AAEA,OAAO,MAAMA,kBAAkB,GAAG,sBAAsB;AACxD,OAAO,MAAMC,yBAAyB,GACpC,2CAA2C","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"single-version.js","names":[],"sources":["single-version.ts"],"sourcesContent":["// ============================================================\n// versions.ts\n// ============================================================\n\n/* Generated by @palantir/pack.document-schema.type-gen@0.17.0 */\n\nexport type SupportedVersions = 1;\nexport type LatestVersion = 1;\nexport type MinSupportedVersion = 1;\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"single-version.js","names":[],"sources":["single-version.ts"],"sourcesContent":["// ============================================================\n// versions.ts\n// ============================================================\n\n/* Generated by @palantir/pack.document-schema.type-gen@0.19.0 */\n\nexport type SupportedVersions = 1;\nexport type LatestVersion = 1;\nexport type MinSupportedVersion = 1;\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"three-version-chain.js","names":[],"sources":["three-version-chain.ts"],"sourcesContent":["// ============================================================\n// versions.ts\n// ============================================================\n\n/* Generated by @palantir/pack.document-schema.type-gen@0.17.0 */\n\nexport type SupportedVersions = 1 | 2 | 3;\nexport type LatestVersion = 3;\nexport type MinSupportedVersion = 1;\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"three-version-chain.js","names":[],"sources":["three-version-chain.ts"],"sourcesContent":["// ============================================================\n// versions.ts\n// ============================================================\n\n/* Generated by @palantir/pack.document-schema.type-gen@0.19.0 */\n\nexport type SupportedVersions = 1 | 2 | 3;\nexport type LatestVersion = 3;\nexport type MinSupportedVersion = 1;\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"two-version.js","names":[],"sources":["two-version.ts"],"sourcesContent":["// ============================================================\n// versions.ts\n// ============================================================\n\n/* Generated by @palantir/pack.document-schema.type-gen@0.17.0 */\n\nexport type SupportedVersions = 1 | 2;\nexport type LatestVersion = 2;\nexport type MinSupportedVersion = 1;\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"two-version.js","names":[],"sources":["two-version.ts"],"sourcesContent":["// ============================================================\n// versions.ts\n// ============================================================\n\n/* Generated by @palantir/pack.document-schema.type-gen@0.19.0 */\n\nexport type SupportedVersions = 1 | 2;\nexport type LatestVersion = 2;\nexport type MinSupportedVersion = 1;\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"resolveSchemaChain.js","names":["IModelDef","IModelDefCtor","convertSchemaToIr","collectVersionedIrChain","input","identity","schemas","collectSchemaDefinitions","provenances","deriveProvenance","map","schema","index","version","ir","models","name","description","type","migrations","serializeMigrations","current","unshift","previous","firstModelVersions","Map","firstFieldVersions","modelVersions","fieldVersions","modelKey","modelDef","Object","entries","has","set","get","fieldVersionsForModel","fields","fieldKey","keys","length","deprecations","undefined","result","fieldEntries","fieldName","migration","derivedFrom","resolveMinVersion","chain","minSupportedVersion","Error","latestVersion","some","c","join","minVersion","capVersionedIrChain","maxVersion","filter","resolveSchemaChain","stripDeprecatedFieldsForSdk","entry","record","field","dep","metadata","deprecatedFromVersion","chainNeedsUpgradeFns","i","prevEntry","currEntry","currModelDef","prevModelDef","prevFields","Set","f","key","recordMigrations","isOptional"],"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 {\n IModelDef,\n IRealTimeDocumentSchema,\n} from \"../../lib/pack-docschema-api/pack-docschema-ir/index.js\";\nimport { IModelDef as IModelDefCtor } from \"../../lib/pack-docschema-api/pack-docschema-ir/index.js\";\nimport type { SchemaProvenance } from \"../steps/convertStepsToIr.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 schemas = collectSchemaDefinitions(input);\n const provenances = deriveProvenance(schemas);\n\n return schemas.map((schema, index): VersionedIrEntry => ({\n version: schema.version,\n ir: convertSchemaToIr(\n schema.models,\n { version: schema.version, name: identity.name, description: identity.description },\n provenances[index]!,\n ),\n ...(schema.type === \"versioned\" ? { migrations: serializeMigrations(schema.migrations) } : {}),\n }));\n}\n\nfunction collectSchemaDefinitions(input: SchemaDefinition): SchemaDefinition[] {\n const schemas: SchemaDefinition[] = [];\n let current: SchemaDefinition = input;\n\n while (current.type === \"versioned\") {\n schemas.unshift(current);\n current = current.previous;\n }\n schemas.unshift(current);\n\n return schemas;\n}\n\n/**\n * Build field/model provenance by walking the version chain from oldest to\n * newest. The first version where a model key or record field appears is the\n * version stamped into IR metadata.\n */\nfunction deriveProvenance(schemas: readonly SchemaDefinition[]): SchemaProvenance[] {\n const firstModelVersions = new Map<string, number>();\n const firstFieldVersions = new Map<string, Map<string, number>>();\n\n return schemas.map(schema => {\n const modelVersions: Record<string, number> = {};\n const fieldVersions: Record<string, Record<string, number>> = {};\n\n for (const [modelKey, modelDef] of Object.entries(schema.models)) {\n if (!firstModelVersions.has(modelKey)) {\n firstModelVersions.set(modelKey, schema.version);\n }\n modelVersions[modelKey] = firstModelVersions.get(modelKey)!;\n\n if (modelDef.type !== \"record\") continue;\n\n let fieldVersionsForModel = firstFieldVersions.get(modelKey);\n if (fieldVersionsForModel == null) {\n fieldVersionsForModel = new Map<string, number>();\n firstFieldVersions.set(modelKey, fieldVersionsForModel);\n }\n\n const fields: Record<string, number> = {};\n for (const fieldKey of Object.keys(modelDef.fields)) {\n if (!fieldVersionsForModel.has(fieldKey)) {\n fieldVersionsForModel.set(fieldKey, schema.version);\n }\n fields[fieldKey] = fieldVersionsForModel.get(fieldKey)!;\n }\n\n if (Object.keys(fields).length > 0) {\n fieldVersions[modelKey] = fields;\n }\n }\n\n return {\n fieldVersions,\n modelVersions,\n deprecations: \"deprecations\" in schema ? schema.deprecations : undefined,\n };\n });\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\nfunction capVersionedIrChain(\n chain: VersionedIrEntry[],\n maxVersion: number | undefined,\n): VersionedIrEntry[] {\n if (maxVersion == null) {\n return chain;\n }\n\n if (!chain.some(c => c.version === maxVersion)) {\n throw new Error(\n `maxVersion ${maxVersion} is not in the schema chain `\n + `(available versions: ${chain.map(c => c.version).join(\", \")})`,\n );\n }\n\n return chain.filter(c => c.version <= maxVersion);\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 maxVersion?: number,\n): ResolvedIrChain {\n const chain = capVersionedIrChain(collectVersionedIrChain(schema, identity), maxVersion);\n const { latestVersion, minVersion } = resolveMinVersion(chain, minSupportedVersion);\n return { chain, latestVersion, minVersion };\n}\n\n/**\n * Return a copy of the chain with deprecated fields removed from every version\n * at or after the version in which they were deprecated.\n *\n * The SDK type generators (`writeAllSdkFiles` and friends) must treat a\n * deprecated field exactly as a removed field: it disappears from that version's\n * public read/write types and per-version internal types, and the prev/curr diff\n * records it as a `removedField` (driving the upgrade lens). The field is still\n * collected into the all-versions `__Internal` type from earlier versions, which\n * are left untouched.\n */\nexport function stripDeprecatedFieldsForSdk(chain: VersionedIrEntry[]): VersionedIrEntry[] {\n return chain.map((entry): VersionedIrEntry => {\n const models: Record<string, IModelDef> = {};\n for (const [modelKey, modelDef] of Object.entries(entry.ir.models)) {\n if (modelDef.type === \"record\") {\n const fields = modelDef.record.fields.filter(field => {\n const dep = field.metadata.deprecatedFromVersion;\n return dep == null || entry.version < dep;\n });\n models[modelKey] = IModelDefCtor.record({ ...modelDef.record, fields });\n } else {\n models[modelKey] = modelDef;\n }\n }\n return { ...entry, ir: { ...entry.ir, models } };\n });\n}\n\n/**\n * True if the chain has any field that requires a runtime upgrade function.\n * Drives whether the generated SDK emits `DocumentModel` as a factory\n * (requires the app to supply typed upgrade functions) or as a const.\n *\n * Two cases trigger this:\n * - A field declares `derivedFrom` with one or more source fields — the app\n * must supply a forward function.\n * - A required field is added in a version past v1 (no `derivedFrom`) — the\n * app must supply a zero-arg thunk; `undefined` is not a legal value.\n *\n * Optional additive fields don't trigger it; the lens leaves them alone.\n */\nexport function chainNeedsUpgradeFns(chain: VersionedIrEntry[]): boolean {\n for (let i = 1; i < chain.length; i++) {\n const prevEntry = chain[i - 1]!;\n const currEntry = chain[i]!;\n for (const [modelKey, currModelDef] of Object.entries(currEntry.ir.models)) {\n if (currModelDef.type !== \"record\") continue;\n const prevModelDef = prevEntry.ir.models[modelKey];\n if (prevModelDef == null || prevModelDef.type !== \"record\") continue;\n const prevFields = new Set(prevModelDef.record.fields.map(f => f.key));\n const recordMigrations = currEntry.migrations?.[modelKey];\n for (const field of currModelDef.record.fields) {\n if (prevFields.has(field.key)) continue;\n const derivedFrom = recordMigrations?.[field.key]?.derivedFrom ?? [];\n if (derivedFrom.length > 0) return true;\n if (field.isOptional !== true) 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;;AAOA,SAASA,SAAS,IAAIC,aAAa,QAAQ,yDAAyD;AAEpG,SAASC,iBAAiB,QAAQ,8BAA8B;;AAEhE;;AAKA;;AA8BA,SAASC,uBAAuBA,CAC9BC,KAAuB,EACvBC,QAAwB,EACJ;EACpB,MAAMC,OAAO,GAAGC,wBAAwB,CAACH,KAAK,CAAC;EAC/C,MAAMI,WAAW,GAAGC,gBAAgB,CAACH,OAAO,CAAC;EAE7C,OAAOA,OAAO,CAACI,GAAG,CAAC,CAACC,MAAM,EAAEC,KAAK,MAAwB;IACvDC,OAAO,EAAEF,MAAM,CAACE,OAAO;IACvBC,EAAE,EAAEZ,iBAAiB,CACnBS,MAAM,CAACI,MAAM,EACb;MAAEF,OAAO,EAAEF,MAAM,CAACE,OAAO;MAAEG,IAAI,EAAEX,QAAQ,CAACW,IAAI;MAAEC,WAAW,EAAEZ,QAAQ,CAACY;IAAY,CAAC,EACnFT,WAAW,CAACI,KAAK,CACnB,CAAC;IACD,IAAID,MAAM,CAACO,IAAI,KAAK,WAAW,GAAG;MAAEC,UAAU,EAAEC,mBAAmB,CAACT,MAAM,CAACQ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AGd,KAAK,CAACa,GAAG,CAAC,EAAE9B,WAAW,IAAI,EAAE;QACpE,IAAIA,WAAW,CAACP,MAAM,GAAG,CAAC,EAAE,OAAO,IAAI;QACvC,IAAIwB,KAAK,CAACe,UAAU,KAAK,IAAI,EAAE,OAAO,IAAI;MAC5C;IACF;EACF;EACA,OAAO,KAAK;AACd","ignoreList":[]}
1
+ {"version":3,"file":"resolveSchemaChain.js","names":["IModelDef","IModelDefCtor","convertSchemaToIr","collectVersionedIrChain","input","identity","schemas","collectSchemaDefinitions","provenances","deriveProvenance","map","schema","index","version","ir","models","name","description","type","migrations","serializeMigrations","current","unshift","previous","firstModelVersions","Map","firstFieldVersions","modelVersions","fieldVersions","modelKey","modelDef","Object","entries","has","set","get","fieldVersionsForModel","fields","fieldKey","keys","length","deprecations","undefined","result","fieldEntries","fieldName","migration","derivedFrom","resolveMinVersion","chain","minSupportedVersion","Error","latestVersion","some","c","join","minVersion","capVersionedIrChain","maxVersion","filter","resolveSchemaChain","stripDeprecatedFieldsForSdk","entry","record","field","dep","metadata","deprecatedFromVersion","chainNeedsUpgradeFns","i","prevEntry","currEntry","currModelDef","prevModelDef","prevFields","Set","f","key","recordMigrations","isOptional"],"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 {\n IModelDef,\n IRealTimeDocumentSchema,\n} from \"../../lib/pack-docschema-api/pack-docschema-ir/index.js\";\nimport { IModelDef as IModelDefCtor } from \"../../lib/pack-docschema-api/pack-docschema-ir/index.js\";\nimport type { SchemaProvenance } from \"../steps/convertStepsToIr.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 owningApplicationId?: string;\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 schemas = collectSchemaDefinitions(input);\n const provenances = deriveProvenance(schemas);\n\n return schemas.map((schema, index): VersionedIrEntry => ({\n version: schema.version,\n ir: convertSchemaToIr(\n schema.models,\n { version: schema.version, name: identity.name, description: identity.description },\n provenances[index]!,\n ),\n ...(schema.type === \"versioned\" ? { migrations: serializeMigrations(schema.migrations) } : {}),\n }));\n}\n\nfunction collectSchemaDefinitions(input: SchemaDefinition): SchemaDefinition[] {\n const schemas: SchemaDefinition[] = [];\n let current: SchemaDefinition = input;\n\n while (current.type === \"versioned\") {\n schemas.unshift(current);\n current = current.previous;\n }\n schemas.unshift(current);\n\n return schemas;\n}\n\n/**\n * Build field/model provenance by walking the version chain from oldest to\n * newest. The first version where a model key or record field appears is the\n * version stamped into IR metadata.\n */\nfunction deriveProvenance(schemas: readonly SchemaDefinition[]): SchemaProvenance[] {\n const firstModelVersions = new Map<string, number>();\n const firstFieldVersions = new Map<string, Map<string, number>>();\n\n return schemas.map(schema => {\n const modelVersions: Record<string, number> = {};\n const fieldVersions: Record<string, Record<string, number>> = {};\n\n for (const [modelKey, modelDef] of Object.entries(schema.models)) {\n if (!firstModelVersions.has(modelKey)) {\n firstModelVersions.set(modelKey, schema.version);\n }\n modelVersions[modelKey] = firstModelVersions.get(modelKey)!;\n\n if (modelDef.type !== \"record\") continue;\n\n let fieldVersionsForModel = firstFieldVersions.get(modelKey);\n if (fieldVersionsForModel == null) {\n fieldVersionsForModel = new Map<string, number>();\n firstFieldVersions.set(modelKey, fieldVersionsForModel);\n }\n\n const fields: Record<string, number> = {};\n for (const fieldKey of Object.keys(modelDef.fields)) {\n if (!fieldVersionsForModel.has(fieldKey)) {\n fieldVersionsForModel.set(fieldKey, schema.version);\n }\n fields[fieldKey] = fieldVersionsForModel.get(fieldKey)!;\n }\n\n if (Object.keys(fields).length > 0) {\n fieldVersions[modelKey] = fields;\n }\n }\n\n return {\n fieldVersions,\n modelVersions,\n deprecations: \"deprecations\" in schema ? schema.deprecations : undefined,\n };\n });\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\nfunction capVersionedIrChain(\n chain: VersionedIrEntry[],\n maxVersion: number | undefined,\n): VersionedIrEntry[] {\n if (maxVersion == null) {\n return chain;\n }\n\n if (!chain.some(c => c.version === maxVersion)) {\n throw new Error(\n `maxVersion ${maxVersion} is not in the schema chain `\n + `(available versions: ${chain.map(c => c.version).join(\", \")})`,\n );\n }\n\n return chain.filter(c => c.version <= maxVersion);\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 maxVersion?: number,\n): ResolvedIrChain {\n const chain = capVersionedIrChain(collectVersionedIrChain(schema, identity), maxVersion);\n const { latestVersion, minVersion } = resolveMinVersion(chain, minSupportedVersion);\n return { chain, latestVersion, minVersion };\n}\n\n/**\n * Return a copy of the chain with deprecated fields removed from every version\n * at or after the version in which they were deprecated.\n *\n * The SDK type generators (`writeAllSdkFiles` and friends) must treat a\n * deprecated field exactly as a removed field: it disappears from that version's\n * public read/write types and per-version internal types, and the prev/curr diff\n * records it as a `removedField` (driving the upgrade lens). The field is still\n * collected into the all-versions `__Internal` type from earlier versions, which\n * are left untouched.\n */\nexport function stripDeprecatedFieldsForSdk(chain: VersionedIrEntry[]): VersionedIrEntry[] {\n return chain.map((entry): VersionedIrEntry => {\n const models: Record<string, IModelDef> = {};\n for (const [modelKey, modelDef] of Object.entries(entry.ir.models)) {\n if (modelDef.type === \"record\") {\n const fields = modelDef.record.fields.filter(field => {\n const dep = field.metadata.deprecatedFromVersion;\n return dep == null || entry.version < dep;\n });\n models[modelKey] = IModelDefCtor.record({ ...modelDef.record, fields });\n } else {\n models[modelKey] = modelDef;\n }\n }\n return { ...entry, ir: { ...entry.ir, models } };\n });\n}\n\n/**\n * True if the chain has any field that requires a runtime upgrade function.\n * Drives whether the generated SDK emits `DocumentModel` as a factory\n * (requires the app to supply typed upgrade functions) or as a const.\n *\n * Two cases trigger this:\n * - A field declares `derivedFrom` with one or more source fields — the app\n * must supply a forward function.\n * - A required field is added in a version past v1 (no `derivedFrom`) — the\n * app must supply a zero-arg thunk; `undefined` is not a legal value.\n *\n * Optional additive fields don't trigger it; the lens leaves them alone.\n */\nexport function chainNeedsUpgradeFns(chain: VersionedIrEntry[]): boolean {\n for (let i = 1; i < chain.length; i++) {\n const prevEntry = chain[i - 1]!;\n const currEntry = chain[i]!;\n for (const [modelKey, currModelDef] of Object.entries(currEntry.ir.models)) {\n if (currModelDef.type !== \"record\") continue;\n const prevModelDef = prevEntry.ir.models[modelKey];\n if (prevModelDef == null || prevModelDef.type !== \"record\") continue;\n const prevFields = new Set(prevModelDef.record.fields.map(f => f.key));\n const recordMigrations = currEntry.migrations?.[modelKey];\n for (const field of currModelDef.record.fields) {\n if (prevFields.has(field.key)) continue;\n const derivedFrom = recordMigrations?.[field.key]?.derivedFrom ?? [];\n if (derivedFrom.length > 0) return true;\n if (field.isOptional !== true) 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;;AAOA,SAASA,SAAS,IAAIC,aAAa,QAAQ,yDAAyD;AAEpG,SAASC,iBAAiB,QAAQ,8BAA8B;;AAEhE;;AAKA;;AA+BA,SAASC,uBAAuBA,CAC9BC,KAAuB,EACvBC,QAAwB,EACJ;EACpB,MAAMC,OAAO,GAAGC,wBAAwB,CAACH,KAAK,CAAC;EAC/C,MAAMI,WAAW,GAAGC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IAAI,IAAIA,YAAY,CAACvD,IAAI,KAAK,QAAQ,EAAE;MAC5D,MAAMwD,UAAU,GAAG,IAAIC,GAAG,CAACF,YAAY,CAACV,MAAM,CAAC1B,MAAM,CAAC3B,GAAG,CAACkE,CAAC,IAAIA,CAAC,CAACC,GAAG,CAAC,CAAC;MACtE,MAAMC,gBAAgB,GAAGP,SAAS,CAACpD,UAAU,GAAGU,QAAQ,CAAC;MACzD,KAAK,MAAMmC,KAAK,IAAIQ,YAAY,CAACT,MAAM,CAAC1B,MAAM,EAAE;QAC9C,IAAIqC,UAAU,CAACzC,GAAG,CAAC+B,KAAK,CAACa,GAAG,CAAC,EAAE;QAC/B,MAAM9B,WAAW,GAAG+B,gBAAgB,GAAGd,KAAK,CAACa,GAAG,CAAC,EAAE9B,WAAW,IAAI,EAAE;QACpE,IAAIA,WAAW,CAACP,MAAM,GAAG,CAAC,EAAE,OAAO,IAAI;QACvC,IAAIwB,KAAK,CAACe,UAAU,KAAK,IAAI,EAAE,OAAO,IAAI;MAC5C;IACF;EACF;EACA,OAAO,KAAK;AACd","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"arrayFields.js","names":[],"sources":["arrayFields.ts"],"sourcesContent":["/* Generated by @palantir/pack.document-schema.type-gen@0.17.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.19.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.17.0 */
1
+ /* Generated by @palantir/pack.document-schema.type-gen@0.19.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.17.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.19.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.17.0 */
1
+ /* Generated by @palantir/pack.document-schema.type-gen@0.19.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.17.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.19.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.17.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.19.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.17.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.19.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.17.0 */
1
+ /* Generated by @palantir/pack.document-schema.type-gen@0.19.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.17.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.19.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 +1 @@
1
- {"version":3,"file":"irDeployHandler.d.ts","sourceRoot":"","sources":["../../../../src/commands/ir/irDeployHandler.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAGV,cAAc,EACf,MAAM,oBAAoB,CAAC;AAU5B,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,wCAAwC;IACxC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,2EAA2E;IAC3E,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;CACpC;AAED,wBAAsB,eAAe,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAwB3E"}
1
+ {"version":3,"file":"irDeployHandler.d.ts","sourceRoot":"","sources":["../../../../src/commands/ir/irDeployHandler.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAGV,cAAc,EACf,MAAM,oBAAoB,CAAC;AAU5B,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,wCAAwC;IACxC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,2EAA2E;IAC3E,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;CACpC;AAED,wBAAsB,eAAe,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CA+B3E"}
@@ -1 +1 @@
1
- {"version":3,"file":"irGenAssetHandler.d.ts","sourceRoot":"","sources":["../../../../src/commands/ir/irGenAssetHandler.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAqB,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAS5E,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;AAYD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,iBAAiB,GAAG,IAAI,CA+ElE"}
1
+ {"version":3,"file":"irGenAssetHandler.d.ts","sourceRoot":"","sources":["../../../../src/commands/ir/irGenAssetHandler.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAqB,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAS5E,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;AAYD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,iBAAiB,GAAG,IAAI,CAmFlE"}
@@ -3,6 +3,7 @@ export interface ResolvedIrInput {
3
3
  readonly ir: IRealTimeDocumentSchema;
4
4
  readonly latestVersion: number;
5
5
  readonly minSupportedVersion: number;
6
+ readonly owningApplicationId?: string;
6
7
  }
7
8
  export declare function resolveIrInput(parsed: unknown, irPath: string): ResolvedIrInput;
8
9
  //# sourceMappingURL=resolveIrInput.d.ts.map
@@ -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;CACtC;AAuCD,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;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"}
@@ -8,6 +8,7 @@ interface PackConfigValues {
8
8
  readonly documentTypeName: string;
9
9
  readonly documentTypeDescription: string;
10
10
  readonly minSupportedVersion?: number;
11
+ readonly owningApplicationId?: string;
11
12
  }
12
13
  export declare function readPackConfig(configPath: string): Promise<PackConfigValues>;
13
14
  /**
@@ -31,6 +32,9 @@ export declare function readPackConfig(configPath: string): Promise<PackConfigVa
31
32
  * (`ir gen-types`, `ir asset`) read the same value. Omitting the field is
32
33
  * an explicit opt-out: the IR will not include `minSupportedVersion` and
33
34
  * downstream tools default to supporting only the latest schema version.
35
+ * - `owningApplicationId`: the application that owns this document type; when
36
+ * set, it is embedded in the payload and surfaced as `owningApplicationId`
37
+ * by `ir asset`.
34
38
  *
35
39
  * Note: this is distinct from the legacy single-version IR JSON consumed by
36
40
  * `ir zod`, which is a bare `IRealTimeDocumentSchema` (no chain, no migrations).
@@ -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;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;AAgBD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;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":"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"}
@@ -20,6 +20,7 @@ export interface IrChainPayload {
20
20
  comment?: string;
21
21
  latestVersion: number;
22
22
  minSupportedVersion?: number;
23
+ owningApplicationId?: string;
23
24
  chain: VersionedIrEntry[];
24
25
  }
25
26
  export interface SchemaIdentity {
@@ -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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B,CAChC,MAAM,EAAE,gBAAgB,EACxB,mBAAmB,CAAC,EAAE,MAAM,EAC5B,QAAQ,GAAE,cAAmB,EAC7B,UAAU,CAAC,EAAE,MAAM,GAClB,eAAe,CAIjB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,gBAAgB,EAAE,CAgBzF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAmBvE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@palantir/pack.document-schema.type-gen",
3
- "version": "0.17.0",
3
+ "version": "0.19.0",
4
4
  "description": "TypeScript type generation from document schema",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@osdk/client": "^2.5.2",
21
- "@osdk/foundry.pack": "^2.66.0",
21
+ "@osdk/foundry.pack": "^2.68.0",
22
22
  "commander": "^14.0.0",
23
23
  "conjure-client": "^2.15.0",
24
24
  "consola": "^3.4.2",