@palantir/pack.document-schema.type-gen 0.9.0 → 0.10.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 (148) hide show
  1. package/build/esm/commands/asset/__tests__/buildPrefixRewriteFetch.test.js +85 -0
  2. package/build/esm/commands/asset/__tests__/buildPrefixRewriteFetch.test.js.map +1 -0
  3. package/build/esm/commands/asset/assetDeployHandler.js +36 -1
  4. package/build/esm/commands/asset/assetDeployHandler.js.map +1 -1
  5. package/build/esm/commands/asset/registerAssetCommands.js +1 -1
  6. package/build/esm/commands/asset/registerAssetCommands.js.map +1 -1
  7. package/build/esm/commands/ir/irGenTypesHandler.js +49 -0
  8. package/build/esm/commands/ir/irGenTypesHandler.js.map +1 -0
  9. package/build/esm/commands/ir/registerIrCommands.js +2 -0
  10. package/build/esm/commands/ir/registerIrCommands.js.map +1 -1
  11. package/build/esm/commands/schema/registerSchemaCommands.js +2 -2
  12. package/build/esm/commands/schema/registerSchemaCommands.js.map +1 -1
  13. package/build/esm/commands/schema/schemaIrHandler.js +56 -0
  14. package/build/esm/commands/schema/schemaIrHandler.js.map +1 -0
  15. package/build/esm/index.js +0 -6
  16. package/build/esm/index.js.map +1 -1
  17. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/custom-discriminant.js +1 -1
  18. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/custom-discriminant.js.map +1 -1
  19. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/external-refs.js +1 -1
  20. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/external-refs.js.map +1 -1
  21. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/simple-record.js +1 -1
  22. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/simple-record.js.map +1 -1
  23. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/union-types.js +1 -1
  24. package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/union-types.js.map +1 -1
  25. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/array-and-map-types.js +1 -1
  26. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/array-and-map-types.js.map +1 -1
  27. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/boolean-fields.js +1 -1
  28. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/boolean-fields.js.map +1 -1
  29. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/custom-discriminant.js +1 -1
  30. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/custom-discriminant.js.map +1 -1
  31. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/datetime-fields.js +1 -1
  32. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/datetime-fields.js.map +1 -1
  33. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/simple-records.js +1 -1
  34. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/simple-records.js.map +1 -1
  35. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/union-before-records.js +1 -1
  36. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/union-before-records.js.map +1 -1
  37. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/union-types.js +1 -1
  38. package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/union-types.js.map +1 -1
  39. package/build/esm/utils/ir/__tests__/convertIrToWireSchema.test.js +23 -0
  40. package/build/esm/utils/ir/__tests__/convertIrToWireSchema.test.js.map +1 -1
  41. package/build/esm/utils/ir/irFieldHelpers.js +383 -0
  42. package/build/esm/utils/ir/irFieldHelpers.js.map +1 -0
  43. package/build/esm/utils/schema/__tests__/__snapshots__/generateVersionsFromSchema/single-version.js.map +1 -1
  44. package/build/esm/utils/schema/__tests__/__snapshots__/generateVersionsFromSchema/three-version-chain.js.map +1 -1
  45. package/build/esm/utils/schema/__tests__/__snapshots__/generateVersionsFromSchema/two-version.js.map +1 -1
  46. package/build/esm/utils/schema/__tests__/convertSchemaToSteps.test.js +13 -0
  47. package/build/esm/utils/schema/__tests__/convertSchemaToSteps.test.js.map +1 -1
  48. package/build/esm/utils/schema/__tests__/fixtures.js +76 -5
  49. package/build/esm/utils/schema/__tests__/fixtures.js.map +1 -1
  50. package/build/esm/utils/schema/__tests__/generateInternalFromSchema.test.js +19 -7
  51. package/build/esm/utils/schema/__tests__/generateInternalFromSchema.test.js.map +1 -1
  52. package/build/esm/utils/schema/__tests__/generateModelMetadataFromSchema.test.js +7 -6
  53. package/build/esm/utils/schema/__tests__/generateModelMetadataFromSchema.test.js.map +1 -1
  54. package/build/esm/utils/schema/__tests__/generateScopeFromSchema.test.js +6 -5
  55. package/build/esm/utils/schema/__tests__/generateScopeFromSchema.test.js.map +1 -1
  56. package/build/esm/utils/schema/__tests__/generateVersionedTypesFromSchema.test.js +19 -10
  57. package/build/esm/utils/schema/__tests__/generateVersionedTypesFromSchema.test.js.map +1 -1
  58. package/build/esm/utils/schema/__tests__/generateVersionedZodFromSchema.test.js +15 -10
  59. package/build/esm/utils/schema/__tests__/generateVersionedZodFromSchema.test.js.map +1 -1
  60. package/build/esm/utils/schema/__tests__/generateVersionsFromSchema.test.js +6 -5
  61. package/build/esm/utils/schema/__tests__/generateVersionsFromSchema.test.js.map +1 -1
  62. package/build/esm/utils/schema/convertSchemaToSteps.js +6 -0
  63. package/build/esm/utils/schema/convertSchemaToSteps.js.map +1 -1
  64. package/build/esm/utils/schema/generateIndexFromSchema.js +15 -13
  65. package/build/esm/utils/schema/generateIndexFromSchema.js.map +1 -1
  66. package/build/esm/utils/schema/generateInternalFromSchema.js +68 -184
  67. package/build/esm/utils/schema/generateInternalFromSchema.js.map +1 -1
  68. package/build/esm/utils/schema/generateModelMetadataFromSchema.js +46 -69
  69. package/build/esm/utils/schema/generateModelMetadataFromSchema.js.map +1 -1
  70. package/build/esm/utils/schema/generateScopeFromSchema.js +29 -33
  71. package/build/esm/utils/schema/generateScopeFromSchema.js.map +1 -1
  72. package/build/esm/utils/schema/generateTypesFromSchema.js +9 -1
  73. package/build/esm/utils/schema/generateTypesFromSchema.js.map +1 -1
  74. package/build/esm/utils/schema/generateVersionedTypesFromSchema.js +61 -155
  75. package/build/esm/utils/schema/generateVersionedTypesFromSchema.js.map +1 -1
  76. package/build/esm/utils/schema/generateVersionedZodFromSchema.js +58 -94
  77. package/build/esm/utils/schema/generateVersionedZodFromSchema.js.map +1 -1
  78. package/build/esm/utils/schema/generateVersionsFromSchema.js +7 -5
  79. package/build/esm/utils/schema/generateVersionsFromSchema.js.map +1 -1
  80. package/build/esm/utils/schema/loadSchemaModule.js +53 -0
  81. package/build/esm/utils/schema/loadSchemaModule.js.map +1 -0
  82. package/build/esm/utils/schema/resolveSchemaChain.js +59 -9
  83. package/build/esm/utils/schema/resolveSchemaChain.js.map +1 -1
  84. package/build/esm/utils/schema/runtimeSchema.js +0 -27
  85. package/build/esm/utils/schema/runtimeSchema.js.map +1 -1
  86. package/build/esm/utils/schema/writeAllSdkFiles.js +111 -0
  87. package/build/esm/utils/schema/writeAllSdkFiles.js.map +1 -0
  88. package/build/esm/utils/steps/__tests__/__snapshots__/types/arrayFields.js.map +1 -1
  89. package/build/esm/utils/steps/__tests__/__snapshots__/types/customDiscriminant.js +1 -1
  90. package/build/esm/utils/steps/__tests__/__snapshots__/types/customDiscriminant.js.map +1 -1
  91. package/build/esm/utils/steps/__tests__/__snapshots__/types/generateTypeScriptInterfaces.js +1 -1
  92. package/build/esm/utils/steps/__tests__/__snapshots__/types/generateTypeScriptInterfaces.js.map +1 -1
  93. package/build/esm/utils/steps/__tests__/__snapshots__/types/refTypes.js.map +1 -1
  94. package/build/esm/utils/steps/__tests__/__snapshots__/types/simpleRecord.js.map +1 -1
  95. package/build/esm/utils/steps/__tests__/__snapshots__/types/simpleSteps.js +1 -1
  96. package/build/esm/utils/steps/__tests__/__snapshots__/types/simpleSteps.js.map +1 -1
  97. package/build/esm/utils/steps/__tests__/convertStepsToIr.test.js +93 -1
  98. package/build/esm/utils/steps/__tests__/convertStepsToIr.test.js.map +1 -1
  99. package/build/esm/utils/steps/convertStepsToIr.js +43 -35
  100. package/build/esm/utils/steps/convertStepsToIr.js.map +1 -1
  101. package/build/types/commands/asset/__tests__/buildPrefixRewriteFetch.test.d.ts +2 -0
  102. package/build/types/commands/asset/__tests__/buildPrefixRewriteFetch.test.d.ts.map +1 -0
  103. package/build/types/commands/asset/assetDeployHandler.d.ts +15 -0
  104. package/build/types/commands/asset/assetDeployHandler.d.ts.map +1 -1
  105. package/build/types/commands/asset/registerAssetCommands.d.ts.map +1 -1
  106. package/build/types/commands/ir/irGenTypesHandler.d.ts +8 -0
  107. package/build/types/commands/ir/irGenTypesHandler.d.ts.map +1 -0
  108. package/build/types/commands/ir/registerIrCommands.d.ts.map +1 -1
  109. package/build/types/commands/schema/registerSchemaCommands.d.ts.map +1 -1
  110. package/build/types/commands/schema/schemaIrHandler.d.ts +19 -0
  111. package/build/types/commands/schema/schemaIrHandler.d.ts.map +1 -0
  112. package/build/types/index.d.ts +1 -6
  113. package/build/types/index.d.ts.map +1 -1
  114. package/build/types/utils/ir/irFieldHelpers.d.ts +36 -0
  115. package/build/types/utils/ir/irFieldHelpers.d.ts.map +1 -0
  116. package/build/types/utils/schema/__tests__/fixtures.d.ts +10 -1
  117. package/build/types/utils/schema/__tests__/fixtures.d.ts.map +1 -1
  118. package/build/types/utils/schema/convertSchemaToSteps.d.ts.map +1 -1
  119. package/build/types/utils/schema/generateIndexFromSchema.d.ts +2 -2
  120. package/build/types/utils/schema/generateIndexFromSchema.d.ts.map +1 -1
  121. package/build/types/utils/schema/generateInternalFromSchema.d.ts +3 -6
  122. package/build/types/utils/schema/generateInternalFromSchema.d.ts.map +1 -1
  123. package/build/types/utils/schema/generateModelMetadataFromSchema.d.ts +3 -8
  124. package/build/types/utils/schema/generateModelMetadataFromSchema.d.ts.map +1 -1
  125. package/build/types/utils/schema/generateScopeFromSchema.d.ts +2 -2
  126. package/build/types/utils/schema/generateScopeFromSchema.d.ts.map +1 -1
  127. package/build/types/utils/schema/generateTypesFromSchema.d.ts.map +1 -1
  128. package/build/types/utils/schema/generateVersionedTypesFromSchema.d.ts +4 -7
  129. package/build/types/utils/schema/generateVersionedTypesFromSchema.d.ts.map +1 -1
  130. package/build/types/utils/schema/generateVersionedZodFromSchema.d.ts +3 -7
  131. package/build/types/utils/schema/generateVersionedZodFromSchema.d.ts.map +1 -1
  132. package/build/types/utils/schema/generateVersionsFromSchema.d.ts +3 -3
  133. package/build/types/utils/schema/generateVersionsFromSchema.d.ts.map +1 -1
  134. package/build/types/utils/schema/loadSchemaModule.d.ts +14 -0
  135. package/build/types/utils/schema/loadSchemaModule.d.ts.map +1 -0
  136. package/build/types/utils/schema/resolveSchemaChain.d.ts +29 -8
  137. package/build/types/utils/schema/resolveSchemaChain.d.ts.map +1 -1
  138. package/build/types/utils/schema/runtimeSchema.d.ts +0 -32
  139. package/build/types/utils/schema/runtimeSchema.d.ts.map +1 -1
  140. package/build/types/utils/schema/writeAllSdkFiles.d.ts +8 -0
  141. package/build/types/utils/schema/writeAllSdkFiles.d.ts.map +1 -0
  142. package/build/types/utils/steps/convertStepsToIr.d.ts +3 -3
  143. package/build/types/utils/steps/convertStepsToIr.d.ts.map +1 -1
  144. package/package.json +3 -3
  145. package/build/esm/commands/schema/schemaGenTypesHandler.js +0 -147
  146. package/build/esm/commands/schema/schemaGenTypesHandler.js.map +0 -1
  147. package/build/types/commands/schema/schemaGenTypesHandler.d.ts +0 -8
  148. package/build/types/commands/schema/schemaGenTypesHandler.d.ts.map +0 -1
@@ -0,0 +1,85 @@
1
+ /*
2
+ * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
18
+ import { buildPrefixRewriteFetch } from "../assetDeployHandler.js";
19
+ describe("buildPrefixRewriteFetch", () => {
20
+ const originalFetch = globalThis.fetch;
21
+ let fetchSpy;
22
+ beforeEach(() => {
23
+ fetchSpy = vi.fn(() => Promise.resolve(new Response(null, {
24
+ status: 204
25
+ })));
26
+ globalThis.fetch = fetchSpy;
27
+ });
28
+ afterEach(() => {
29
+ globalThis.fetch = originalFetch;
30
+ });
31
+ function calledUrl() {
32
+ const arg = fetchSpy.mock.calls[0][0];
33
+ return arg.url;
34
+ }
35
+ it("rewrites /api/foo to /api/gotham/foo", async () => {
36
+ const wrapped = buildPrefixRewriteFetch("/api/gotham");
37
+ await wrapped("https://stack.example.com/api/foo");
38
+ expect(calledUrl()).toBe("https://stack.example.com/api/gotham/foo");
39
+ });
40
+ it("rewrites bare /api to /api/gotham", async () => {
41
+ const wrapped = buildPrefixRewriteFetch("/api/gotham");
42
+ await wrapped("https://stack.example.com/api");
43
+ expect(calledUrl()).toBe("https://stack.example.com/api/gotham");
44
+ });
45
+ it("preserves query strings on rewritten requests", async () => {
46
+ const wrapped = buildPrefixRewriteFetch("/api/gotham");
47
+ await wrapped("https://stack.example.com/api/foo?x=1&y=2");
48
+ expect(calledUrl()).toBe("https://stack.example.com/api/gotham/foo?x=1&y=2");
49
+ });
50
+ it("does not rewrite paths that only share the /api prefix string", async () => {
51
+ const wrapped = buildPrefixRewriteFetch("/api/gotham");
52
+ await wrapped("https://stack.example.com/apiother/foo");
53
+ expect(calledUrl()).toBe("https://stack.example.com/apiother/foo");
54
+ });
55
+ it("does not rewrite non-/api paths", async () => {
56
+ const wrapped = buildPrefixRewriteFetch("/api/gotham");
57
+ await wrapped("https://stack.example.com/healthz");
58
+ expect(calledUrl()).toBe("https://stack.example.com/healthz");
59
+ });
60
+ it("forwards method and headers from the original request", async () => {
61
+ const wrapped = buildPrefixRewriteFetch("/api/gotham");
62
+ await wrapped("https://stack.example.com/api/foo", {
63
+ method: "POST",
64
+ headers: {
65
+ "x-custom": "value"
66
+ },
67
+ body: JSON.stringify({
68
+ hello: "world"
69
+ })
70
+ });
71
+ const req = fetchSpy.mock.calls[0][0];
72
+ expect(req.method).toBe("POST");
73
+ expect(req.headers.get("x-custom")).toBe("value");
74
+ await expect(req.text()).resolves.toBe(JSON.stringify({
75
+ hello: "world"
76
+ }));
77
+ });
78
+ it("throws on an unsupported prefix", () => {
79
+ expect(() => buildPrefixRewriteFetch("/api/other")).toThrow(/Unsupported first-party prefix/);
80
+ });
81
+ it("throws on a prefix missing the leading slash", () => {
82
+ expect(() => buildPrefixRewriteFetch("api/gotham")).toThrow(/Unsupported first-party prefix/);
83
+ });
84
+ });
85
+ //# sourceMappingURL=buildPrefixRewriteFetch.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildPrefixRewriteFetch.test.js","names":["afterEach","beforeEach","describe","expect","it","vi","buildPrefixRewriteFetch","originalFetch","globalThis","fetch","fetchSpy","fn","Promise","resolve","Response","status","calledUrl","arg","mock","calls","url","wrapped","toBe","method","headers","body","JSON","stringify","hello","req","get","text","resolves","toThrow"],"sources":["buildPrefixRewriteFetch.test.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 { afterEach, beforeEach, describe, expect, it, vi } from \"vitest\";\nimport { buildPrefixRewriteFetch } from \"../assetDeployHandler.js\";\n\ndescribe(\"buildPrefixRewriteFetch\", () => {\n const originalFetch = globalThis.fetch;\n let fetchSpy: ReturnType<typeof vi.fn>;\n\n beforeEach(() => {\n fetchSpy = vi.fn(() => Promise.resolve(new Response(null, { status: 204 })));\n globalThis.fetch = fetchSpy as unknown as typeof globalThis.fetch;\n });\n\n afterEach(() => {\n globalThis.fetch = originalFetch;\n });\n\n function calledUrl(): string {\n const arg = fetchSpy.mock.calls[0]![0] as Request;\n return arg.url;\n }\n\n it(\"rewrites /api/foo to /api/gotham/foo\", async () => {\n const wrapped = buildPrefixRewriteFetch(\"/api/gotham\");\n await wrapped(\"https://stack.example.com/api/foo\");\n expect(calledUrl()).toBe(\"https://stack.example.com/api/gotham/foo\");\n });\n\n it(\"rewrites bare /api to /api/gotham\", async () => {\n const wrapped = buildPrefixRewriteFetch(\"/api/gotham\");\n await wrapped(\"https://stack.example.com/api\");\n expect(calledUrl()).toBe(\"https://stack.example.com/api/gotham\");\n });\n\n it(\"preserves query strings on rewritten requests\", async () => {\n const wrapped = buildPrefixRewriteFetch(\"/api/gotham\");\n await wrapped(\"https://stack.example.com/api/foo?x=1&y=2\");\n expect(calledUrl()).toBe(\"https://stack.example.com/api/gotham/foo?x=1&y=2\");\n });\n\n it(\"does not rewrite paths that only share the /api prefix string\", async () => {\n const wrapped = buildPrefixRewriteFetch(\"/api/gotham\");\n await wrapped(\"https://stack.example.com/apiother/foo\");\n expect(calledUrl()).toBe(\"https://stack.example.com/apiother/foo\");\n });\n\n it(\"does not rewrite non-/api paths\", async () => {\n const wrapped = buildPrefixRewriteFetch(\"/api/gotham\");\n await wrapped(\"https://stack.example.com/healthz\");\n expect(calledUrl()).toBe(\"https://stack.example.com/healthz\");\n });\n\n it(\"forwards method and headers from the original request\", async () => {\n const wrapped = buildPrefixRewriteFetch(\"/api/gotham\");\n await wrapped(\"https://stack.example.com/api/foo\", {\n method: \"POST\",\n headers: { \"x-custom\": \"value\" },\n body: JSON.stringify({ hello: \"world\" }),\n });\n const req = fetchSpy.mock.calls[0]![0] as Request;\n expect(req.method).toBe(\"POST\");\n expect(req.headers.get(\"x-custom\")).toBe(\"value\");\n await expect(req.text()).resolves.toBe(JSON.stringify({ hello: \"world\" }));\n });\n\n it(\"throws on an unsupported prefix\", () => {\n expect(() => buildPrefixRewriteFetch(\"/api/other\")).toThrow(\n /Unsupported first-party prefix/,\n );\n });\n\n it(\"throws on a prefix missing the leading slash\", () => {\n expect(() => buildPrefixRewriteFetch(\"api/gotham\")).toThrow(\n /Unsupported first-party prefix/,\n );\n });\n});\n"],"mappings":"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","ignoreList":[]}
@@ -20,6 +20,37 @@ import { CommanderError } from "commander";
20
20
  import { consola } from "consola";
21
21
  import { readFileSync } from "fs";
22
22
  import { resolve } from "path";
23
+ const DEFAULT_API_PREFIX = "/api";
24
+
25
+ /**
26
+ * The set of API prefixes that `--first-party-prefix` is allowed to rewrite to.
27
+ * Only `/api/gotham` is supported today; expand this list as new gateways are added.
28
+ */
29
+ export const ALLOWED_FIRST_PARTY_PREFIXES = ["/api/gotham"];
30
+
31
+ /**
32
+ * Builds a fetch wrapper that rewrites the OSDK client's `/api/...` requests
33
+ * to a different prefix (e.g. `/api/gotham`). Used for stacks where the
34
+ * endpoint is served behind a different gateway path instead
35
+ * of the default `/api` route.
36
+ *
37
+ * Throws if `prefix` is not one of {@link ALLOWED_FIRST_PARTY_PREFIXES}.
38
+ */
39
+ export function buildPrefixRewriteFetch(prefix) {
40
+ if (!ALLOWED_FIRST_PARTY_PREFIXES.includes(prefix)) {
41
+ throw new Error(`Unsupported first-party prefix '${prefix}'. Allowed values: ${ALLOWED_FIRST_PARTY_PREFIXES.join(", ")}`);
42
+ }
43
+ return (input, init) => {
44
+ const req = new Request(input, init);
45
+ const url = new URL(req.url);
46
+ if (url.pathname !== DEFAULT_API_PREFIX && !url.pathname.startsWith(`${DEFAULT_API_PREFIX}/`)) {
47
+ return globalThis.fetch(req);
48
+ }
49
+ url.pathname = prefix + url.pathname.slice(DEFAULT_API_PREFIX.length);
50
+ return globalThis.fetch(new Request(url, req));
51
+ };
52
+ }
53
+
23
54
  /** Useful for manually deploying a document type during development to test schema changes. */
24
55
  export async function assetDeployHandler(options) {
25
56
  try {
@@ -27,7 +58,11 @@ export async function assetDeployHandler(options) {
27
58
  consola.info(`Reading asset file from: ${assetPath}`);
28
59
  const assetContent = readFileSync(assetPath, "utf8");
29
60
  const asset = JSON.parse(assetContent);
30
- const osdkClient = createPlatformClient(options.baseUrl, () => Promise.resolve(options.auth));
61
+ const fetchFn = options.firstPartyPrefix != null ? buildPrefixRewriteFetch(options.firstPartyPrefix) : undefined;
62
+ if (fetchFn != null) {
63
+ consola.info(`Rewriting OSDK '${DEFAULT_API_PREFIX}' -> '${options.firstPartyPrefix}'`);
64
+ }
65
+ const osdkClient = createPlatformClient(options.baseUrl, () => Promise.resolve(options.auth), undefined, fetchFn);
31
66
  const request = {
32
67
  requestBody: {
33
68
  name: asset.documentTypeName,
@@ -1 +1 @@
1
- {"version":3,"file":"assetDeployHandler.js","names":["createPlatformClient","PalantirApiError","DocumentTypes","CommanderError","consola","readFileSync","resolve","assetDeployHandler","options","assetPath","input","info","assetContent","asset","JSON","parse","osdkClient","baseUrl","Promise","auth","request","requestBody","name","documentTypeName","ontologyRid","schema","documentStorageType","yjs","fileSystemType","version","schemaVersion","result","createFirstParty","preview","success","error","message","errorName","errorCode","details","filter","Boolean","join"],"sources":["assetDeployHandler.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 { CreateFirstPartyDocumentTypeRequest } from \"@osdk/foundry.pack\";\nimport { DocumentTypes } from \"@osdk/foundry.pack\";\nimport { CommanderError } from \"commander\";\nimport { consola } from \"consola\";\nimport { readFileSync } from \"fs\";\nimport { resolve } from \"path\";\nimport type { DocumentTypeAsset } from \"../types.js\";\n\ninterface AssetDeployOptions {\n readonly input: string;\n readonly baseUrl: string;\n readonly auth: string;\n readonly ontologyRid: string;\n}\n\n/** Useful for manually deploying a document type during development to test schema changes. */\nexport async function assetDeployHandler(options: AssetDeployOptions): Promise<void> {\n try {\n const assetPath = resolve(options.input);\n\n consola.info(`Reading asset file from: ${assetPath}`);\n\n const assetContent = readFileSync(assetPath, \"utf8\");\n const asset = JSON.parse(assetContent) as DocumentTypeAsset;\n\n const osdkClient = createPlatformClient(\n options.baseUrl,\n () => Promise.resolve(options.auth),\n );\n\n const request: CreateFirstPartyDocumentTypeRequest = {\n requestBody: {\n name: asset.documentTypeName,\n ontologyRid: options.ontologyRid,\n schema: asset.documentStorageType.yjs,\n fileSystemType: asset.fileSystemType,\n version: asset.schemaVersion,\n },\n };\n\n consola.info(\"Creating first-party document type\", request);\n\n const result = await DocumentTypes.createFirstParty(osdkClient, request, { preview: true });\n\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 } else {\n consola.error(\"❌ Error during first-party deploy:\", error);\n }\n throw new CommanderError(1, \"ERRASSETDEPLOY\", \"Error deploying document type from asset\");\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;AAErE,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,cAAc,QAAQ,WAAW;AAC1C,SAASC,OAAO,QAAQ,SAAS;AACjC,SAASC,YAAY,QAAQ,IAAI;AACjC,SAASC,OAAO,QAAQ,MAAM;AAU9B;AACA,OAAO,eAAeC,kBAAkBA,CAACC,OAA2B,EAAiB;EACnF,IAAI;IACF,MAAMC,SAAS,GAAGH,OAAO,CAACE,OAAO,CAACE,KAAK,CAAC;IAExCN,OAAO,CAACO,IAAI,CAAC,4BAA4BF,SAAS,EAAE,CAAC;IAErD,MAAMG,YAAY,GAAGP,YAAY,CAACI,SAAS,EAAE,MAAM,CAAC;IACpD,MAAMI,KAAK,GAAGC,IAAI,CAACC,KAAK,CAACH,YAAY,CAAsB;IAE3D,MAAMI,UAAU,GAAGhB,oBAAoB,CACrCQ,OAAO,CAACS,OAAO,EACf,MAAMC,OAAO,CAACZ,OAAO,CAACE,OAAO,CAACW,IAAI,CACpC,CAAC;IAED,MAAMC,OAA4C,GAAG;MACnDC,WAAW,EAAE;QACXC,IAAI,EAAET,KAAK,CAACU,gBAAgB;QAC5BC,WAAW,EAAEhB,OAAO,CAACgB,WAAW;QAChCC,MAAM,EAAEZ,KAAK,CAACa,mBAAmB,CAACC,GAAG;QACrCC,cAAc,EAAEf,KAAK,CAACe,cAAc;QACpCC,OAAO,EAAEhB,KAAK,CAACiB;MACjB;IACF,CAAC;IAED1B,OAAO,CAACO,IAAI,CAAC,oCAAoC,EAAES,OAAO,CAAC;IAE3D,MAAMW,MAAM,GAAG,MAAM7B,aAAa,CAAC8B,gBAAgB,CAAChB,UAAU,EAAEI,OAAO,EAAE;MAAEa,OAAO,EAAE;IAAK,CAAC,CAAC;IAE3F7B,OAAO,CAAC8B,OAAO,CAAC,gDAAgD,EAAEH,MAAM,CAAC;EAC3E,CAAC,CAAC,OAAOI,KAAK,EAAE;IACd,IAAIA,KAAK,YAAYlC,gBAAgB,EAAE;MACrC,MAAM;QAAEmC,OAAO;QAAEC,SAAS;QAAEC;MAAU,CAAC,GAAGH,KAAK;MAC/C,MAAMI,OAAO,GAAG,CAACF,SAAS,EAAEC,SAAS,CAAC,CAACE,MAAM,CAACC,OAAO,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC;MAChEtC,OAAO,CAAC+B,KAAK,CACX,sCAAsCC,OAAO,GAAGG,OAAO,GAAG,KAAKA,OAAO,GAAG,GAAG,EAAE,EAChF,CAAC;IACH,CAAC,MAAM;MACLnC,OAAO,CAAC+B,KAAK,CAAC,oCAAoC,EAAEA,KAAK,CAAC;IAC5D;IACA,MAAM,IAAIhC,cAAc,CAAC,CAAC,EAAE,gBAAgB,EAAE,0CAA0C,CAAC;EAC3F;AACF","ignoreList":[]}
1
+ {"version":3,"file":"assetDeployHandler.js","names":["createPlatformClient","PalantirApiError","DocumentTypes","CommanderError","consola","readFileSync","resolve","DEFAULT_API_PREFIX","ALLOWED_FIRST_PARTY_PREFIXES","buildPrefixRewriteFetch","prefix","includes","Error","join","input","init","req","Request","url","URL","pathname","startsWith","globalThis","fetch","slice","length","assetDeployHandler","options","assetPath","info","assetContent","asset","JSON","parse","fetchFn","firstPartyPrefix","undefined","osdkClient","baseUrl","Promise","auth","request","requestBody","name","documentTypeName","ontologyRid","schema","documentStorageType","yjs","fileSystemType","version","schemaVersion","result","createFirstParty","preview","success","error","message","errorName","errorCode","details","filter","Boolean"],"sources":["assetDeployHandler.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 { CreateFirstPartyDocumentTypeRequest } from \"@osdk/foundry.pack\";\nimport { DocumentTypes } from \"@osdk/foundry.pack\";\nimport { CommanderError } from \"commander\";\nimport { consola } from \"consola\";\nimport { readFileSync } from \"fs\";\nimport { resolve } from \"path\";\nimport type { DocumentTypeAsset } from \"../types.js\";\n\ninterface AssetDeployOptions {\n readonly input: string;\n readonly baseUrl: string;\n readonly auth: string;\n readonly ontologyRid: string;\n readonly firstPartyPrefix?: string;\n}\n\nconst DEFAULT_API_PREFIX = \"/api\";\n\n/**\n * The set of API prefixes that `--first-party-prefix` is allowed to rewrite to.\n * Only `/api/gotham` is supported today; expand this list as new gateways are added.\n */\nexport const ALLOWED_FIRST_PARTY_PREFIXES = [\"/api/gotham\"] as const;\n\n/**\n * Builds a fetch wrapper that rewrites the OSDK client's `/api/...` requests\n * to a different prefix (e.g. `/api/gotham`). Used for stacks where the\n * endpoint is served behind a different gateway path instead\n * of the default `/api` route.\n *\n * Throws if `prefix` is not one of {@link ALLOWED_FIRST_PARTY_PREFIXES}.\n */\nexport function buildPrefixRewriteFetch(prefix: string): typeof globalThis.fetch {\n if (!(ALLOWED_FIRST_PARTY_PREFIXES as readonly string[]).includes(prefix)) {\n throw new Error(\n `Unsupported first-party prefix '${prefix}'. Allowed values: ${\n ALLOWED_FIRST_PARTY_PREFIXES.join(\", \")\n }`,\n );\n }\n return (input, init) => {\n const req = new Request(input, init);\n const url = new URL(req.url);\n if (\n url.pathname !== DEFAULT_API_PREFIX\n && !url.pathname.startsWith(`${DEFAULT_API_PREFIX}/`)\n ) {\n return globalThis.fetch(req);\n }\n url.pathname = prefix + url.pathname.slice(DEFAULT_API_PREFIX.length);\n return globalThis.fetch(new Request(url, req));\n };\n}\n\n/** Useful for manually deploying a document type during development to test schema changes. */\nexport async function assetDeployHandler(options: AssetDeployOptions): Promise<void> {\n try {\n const assetPath = resolve(options.input);\n\n consola.info(`Reading asset file from: ${assetPath}`);\n\n const assetContent = readFileSync(assetPath, \"utf8\");\n const asset = JSON.parse(assetContent) as DocumentTypeAsset;\n\n const fetchFn = options.firstPartyPrefix != null\n ? buildPrefixRewriteFetch(options.firstPartyPrefix)\n : undefined;\n if (fetchFn != null) {\n consola.info(`Rewriting OSDK '${DEFAULT_API_PREFIX}' -> '${options.firstPartyPrefix}'`);\n }\n\n const osdkClient = createPlatformClient(\n options.baseUrl,\n () => Promise.resolve(options.auth),\n undefined,\n fetchFn,\n );\n\n const request: CreateFirstPartyDocumentTypeRequest = {\n requestBody: {\n name: asset.documentTypeName,\n ontologyRid: options.ontologyRid,\n schema: asset.documentStorageType.yjs,\n fileSystemType: asset.fileSystemType,\n version: asset.schemaVersion,\n },\n };\n\n consola.info(\"Creating first-party document type\", request);\n\n const result = await DocumentTypes.createFirstParty(osdkClient, request, { preview: true });\n\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 } else {\n consola.error(\"❌ Error during first-party deploy:\", error);\n }\n throw new CommanderError(1, \"ERRASSETDEPLOY\", \"Error deploying document type from asset\");\n }\n}\n"],"mappings":"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","ignoreList":[]}
@@ -17,6 +17,6 @@
17
17
  import { assetDeployHandler } from "./assetDeployHandler.js";
18
18
  export function registerAssetCommands(program) {
19
19
  const assetCmd = program.command("asset").description("Asset-based document type commands");
20
- assetCmd.command("deploy").description("Deploy a document type to a Foundry stack using an asset JSON file").requiredOption("-i, --input <file>", "Path to asset JSON file (output of 'ir asset')").requiredOption("-b, --base-url <url>", "Base URL for Foundry API").requiredOption("-a, --auth <token>", "Authentication token for Foundry API").requiredOption("-o, --ontology-rid <rid>", "Target ontology RID").action(assetDeployHandler);
20
+ assetCmd.command("deploy").description("Deploy a document type to a Foundry stack using an asset JSON file").requiredOption("-i, --input <file>", "Path to asset JSON file (output of 'ir asset')").requiredOption("-b, --base-url <url>", "Base URL for Foundry API").requiredOption("-a, --auth <token>", "Authentication token for Foundry API").requiredOption("-o, --ontology-rid <rid>", "Target ontology RID").option("--first-party-prefix <path>", "Override the API prefix used for first-party deploy (e.g. /api/gotham). Defaults to /api.").action(assetDeployHandler);
21
21
  }
22
22
  //# sourceMappingURL=registerAssetCommands.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"registerAssetCommands.js","names":["assetDeployHandler","registerAssetCommands","program","assetCmd","command","description","requiredOption","action"],"sources":["registerAssetCommands.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { Command } from \"commander\";\nimport { assetDeployHandler } from \"./assetDeployHandler.js\";\n\nexport function registerAssetCommands(program: Command): void {\n const assetCmd = program\n .command(\"asset\")\n .description(\"Asset-based document type commands\");\n\n assetCmd\n .command(\"deploy\")\n .description(\"Deploy a document type to a Foundry stack using an asset JSON file\")\n .requiredOption(\"-i, --input <file>\", \"Path to asset JSON file (output of 'ir asset')\")\n .requiredOption(\"-b, --base-url <url>\", \"Base URL for Foundry API\")\n .requiredOption(\"-a, --auth <token>\", \"Authentication token for Foundry API\")\n .requiredOption(\"-o, --ontology-rid <rid>\", \"Target ontology RID\")\n .action(assetDeployHandler);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,kBAAkB,QAAQ,yBAAyB;AAE5D,OAAO,SAASC,qBAAqBA,CAACC,OAAgB,EAAQ;EAC5D,MAAMC,QAAQ,GAAGD,OAAO,CACrBE,OAAO,CAAC,OAAO,CAAC,CAChBC,WAAW,CAAC,oCAAoC,CAAC;EAEpDF,QAAQ,CACLC,OAAO,CAAC,QAAQ,CAAC,CACjBC,WAAW,CAAC,oEAAoE,CAAC,CACjFC,cAAc,CAAC,oBAAoB,EAAE,gDAAgD,CAAC,CACtFA,cAAc,CAAC,sBAAsB,EAAE,0BAA0B,CAAC,CAClEA,cAAc,CAAC,oBAAoB,EAAE,sCAAsC,CAAC,CAC5EA,cAAc,CAAC,0BAA0B,EAAE,qBAAqB,CAAC,CACjEC,MAAM,CAACP,kBAAkB,CAAC;AAC/B","ignoreList":[]}
1
+ {"version":3,"file":"registerAssetCommands.js","names":["assetDeployHandler","registerAssetCommands","program","assetCmd","command","description","requiredOption","option","action"],"sources":["registerAssetCommands.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { Command } from \"commander\";\nimport { assetDeployHandler } from \"./assetDeployHandler.js\";\n\nexport function registerAssetCommands(program: Command): void {\n const assetCmd = program\n .command(\"asset\")\n .description(\"Asset-based document type commands\");\n\n assetCmd\n .command(\"deploy\")\n .description(\"Deploy a document type to a Foundry stack using an asset JSON file\")\n .requiredOption(\"-i, --input <file>\", \"Path to asset JSON file (output of 'ir asset')\")\n .requiredOption(\"-b, --base-url <url>\", \"Base URL for Foundry API\")\n .requiredOption(\"-a, --auth <token>\", \"Authentication token for Foundry API\")\n .requiredOption(\"-o, --ontology-rid <rid>\", \"Target ontology RID\")\n .option(\n \"--first-party-prefix <path>\",\n \"Override the API prefix used for first-party deploy (e.g. /api/gotham). Defaults to /api.\",\n )\n .action(assetDeployHandler);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,kBAAkB,QAAQ,yBAAyB;AAE5D,OAAO,SAASC,qBAAqBA,CAACC,OAAgB,EAAQ;EAC5D,MAAMC,QAAQ,GAAGD,OAAO,CACrBE,OAAO,CAAC,OAAO,CAAC,CAChBC,WAAW,CAAC,oCAAoC,CAAC;EAEpDF,QAAQ,CACLC,OAAO,CAAC,QAAQ,CAAC,CACjBC,WAAW,CAAC,oEAAoE,CAAC,CACjFC,cAAc,CAAC,oBAAoB,EAAE,gDAAgD,CAAC,CACtFA,cAAc,CAAC,sBAAsB,EAAE,0BAA0B,CAAC,CAClEA,cAAc,CAAC,oBAAoB,EAAE,sCAAsC,CAAC,CAC5EA,cAAc,CAAC,0BAA0B,EAAE,qBAAqB,CAAC,CACjEC,MAAM,CACL,6BAA6B,EAC7B,2FACF,CAAC,CACAC,MAAM,CAACR,kBAAkB,CAAC;AAC/B","ignoreList":[]}
@@ -0,0 +1,49 @@
1
+ /*
2
+ * Copyright 2026 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { consola } from "consola";
18
+ import fs from "fs-extra";
19
+ import path from "path";
20
+ import { resolveMinVersion } from "../../utils/schema/resolveSchemaChain.js";
21
+ import { parseMinVersion, writeAllSdkFiles } from "../../utils/schema/writeAllSdkFiles.js";
22
+ export async function irGenTypesHandler(options) {
23
+ const {
24
+ schema: schemaPath,
25
+ output: outputDir
26
+ } = options;
27
+ const inputPath = path.resolve(schemaPath);
28
+ if (!(await fs.pathExists(inputPath))) {
29
+ throw new Error(`Input file not found: ${inputPath}`);
30
+ }
31
+ consola.info(`Loading IR chain from: ${inputPath}`);
32
+ const payload = await fs.readJson(inputPath);
33
+ if (!Array.isArray(payload.chain) || payload.chain.length === 0) {
34
+ throw new Error(`Invalid IR chain payload at ${inputPath}: missing non-empty 'chain' array`);
35
+ }
36
+ const minSupportedVersion = parseMinVersion(options.minVersion);
37
+ const {
38
+ latestVersion,
39
+ minVersion
40
+ } = resolveMinVersion(payload.chain, minSupportedVersion);
41
+ const resolved = {
42
+ chain: payload.chain,
43
+ latestVersion,
44
+ minVersion
45
+ };
46
+ const resolvedOutputDir = path.resolve(outputDir);
47
+ await writeAllSdkFiles(resolved, resolvedOutputDir, minSupportedVersion);
48
+ }
49
+ //# sourceMappingURL=irGenTypesHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"irGenTypesHandler.js","names":["consola","fs","path","resolveMinVersion","parseMinVersion","writeAllSdkFiles","irGenTypesHandler","options","schema","schemaPath","output","outputDir","inputPath","resolve","pathExists","Error","info","payload","readJson","Array","isArray","chain","length","minSupportedVersion","minVersion","latestVersion","resolved","resolvedOutputDir"],"sources":["irGenTypesHandler.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 { resolveMinVersion, type VersionedIrEntry } from \"../../utils/schema/resolveSchemaChain.js\";\nimport { parseMinVersion, writeAllSdkFiles } from \"../../utils/schema/writeAllSdkFiles.js\";\n\ninterface IrGenTypesOptions {\n schema: string;\n output: string;\n minVersion?: string;\n}\n\ninterface IrChainPayload {\n __comment?: string;\n latestVersion: number;\n chain: VersionedIrEntry[];\n}\n\nexport async function irGenTypesHandler(options: IrGenTypesOptions): Promise<void> {\n const { schema: schemaPath, output: outputDir } = options;\n\n const inputPath = path.resolve(schemaPath);\n if (!(await fs.pathExists(inputPath))) {\n throw new Error(`Input file not found: ${inputPath}`);\n }\n\n consola.info(`Loading IR chain from: ${inputPath}`);\n const payload = (await fs.readJson(inputPath)) as IrChainPayload;\n\n if (!Array.isArray(payload.chain) || payload.chain.length === 0) {\n throw new Error(`Invalid IR chain payload at ${inputPath}: missing non-empty 'chain' array`);\n }\n\n const minSupportedVersion = parseMinVersion(options.minVersion);\n const { latestVersion, minVersion } = resolveMinVersion(payload.chain, minSupportedVersion);\n const resolved = { chain: payload.chain, latestVersion, minVersion };\n\n const resolvedOutputDir = path.resolve(outputDir);\n await writeAllSdkFiles(resolved, resolvedOutputDir, minSupportedVersion);\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,iBAAiB,QAA+B,0CAA0C;AACnG,SAASC,eAAe,EAAEC,gBAAgB,QAAQ,wCAAwC;AAc1F,OAAO,eAAeC,iBAAiBA,CAACC,OAA0B,EAAiB;EACjF,MAAM;IAAEC,MAAM,EAAEC,UAAU;IAAEC,MAAM,EAAEC;EAAU,CAAC,GAAGJ,OAAO;EAEzD,MAAMK,SAAS,GAAGV,IAAI,CAACW,OAAO,CAACJ,UAAU,CAAC;EAC1C,IAAI,EAAE,MAAMR,EAAE,CAACa,UAAU,CAACF,SAAS,CAAC,CAAC,EAAE;IACrC,MAAM,IAAIG,KAAK,CAAC,yBAAyBH,SAAS,EAAE,CAAC;EACvD;EAEAZ,OAAO,CAACgB,IAAI,CAAC,0BAA0BJ,SAAS,EAAE,CAAC;EACnD,MAAMK,OAAO,GAAI,MAAMhB,EAAE,CAACiB,QAAQ,CAACN,SAAS,CAAoB;EAEhE,IAAI,CAACO,KAAK,CAACC,OAAO,CAACH,OAAO,CAACI,KAAK,CAAC,IAAIJ,OAAO,CAACI,KAAK,CAACC,MAAM,KAAK,CAAC,EAAE;IAC/D,MAAM,IAAIP,KAAK,CAAC,+BAA+BH,SAAS,mCAAmC,CAAC;EAC9F;EAEA,MAAMW,mBAAmB,GAAGnB,eAAe,CAACG,OAAO,CAACiB,UAAU,CAAC;EAC/D,MAAM;IAAEC,aAAa;IAAED;EAAW,CAAC,GAAGrB,iBAAiB,CAACc,OAAO,CAACI,KAAK,EAAEE,mBAAmB,CAAC;EAC3F,MAAMG,QAAQ,GAAG;IAAEL,KAAK,EAAEJ,OAAO,CAACI,KAAK;IAAEI,aAAa;IAAED;EAAW,CAAC;EAEpE,MAAMG,iBAAiB,GAAGzB,IAAI,CAACW,OAAO,CAACF,SAAS,CAAC;EACjD,MAAMN,gBAAgB,CAACqB,QAAQ,EAAEC,iBAAiB,EAAEJ,mBAAmB,CAAC;AAC1E","ignoreList":[]}
@@ -17,9 +17,11 @@
17
17
  import { irDeployHandler } from "./irDeployHandler.js";
18
18
  import { irGenAssetHandler } from "./irGenAssetHandler.js";
19
19
  import { irGenModelsHandler } from "./irGenModelsHandler.js";
20
+ import { irGenTypesHandler } from "./irGenTypesHandler.js";
20
21
  import { irGenZodHandler } from "./irGenZodHandler.js";
21
22
  export function registerIrCommands(program) {
22
23
  const irCmd = program.command("ir").description("IR (Intermediate Representation) based generation commands");
24
+ irCmd.command("gen-types").description("Generate versioned SDK files (types, schemas, internal/, models.ts, versions.ts, versionedDocRef.ts, index.ts) from a versioned IR chain JSON").requiredOption("-s, --schema <file>", "Path to versioned IR chain JSON file").requiredOption("-o, --output <dir>", "Output directory for generated SDK files").option("--min-version <version>", "Minimum supported version").action(irGenTypesHandler);
23
25
  irCmd.command("zod").description("Generate Zod schemas from IR document schema definitions").requiredOption("-s, --schema <file>", "Path to schema JSON file").requiredOption("-o, --output <file>", "Output file path for generated Zod schemas").option("-t, --type-import-path <path>", "Path to import types from (enables satisfies operators)").action(irGenZodHandler);
24
26
  irCmd.command("models").description("Generate Model constants from IR document schema definitions").requiredOption("-s, --schema <file>", "Path to schema JSON file").requiredOption("-o, --output <file>", "Output file path for generated Model constants").option("-t, --type-import-path <path>", "Path to import types from", "./types.js").option("--schema-import-path <path>", "Path to import schemas from", "./schema.js").action(irGenModelsHandler);
25
27
  irCmd.command("deploy").description("Create a document type on a Foundry stack using an IR document schema").requiredOption("-i, --ir <file>", "Path to IR JSON file").requiredOption("-b, --base-url <url>", "Base URL for Foundry API").requiredOption("-a, --auth <token>", "Authentication token for Foundry API").requiredOption("-p, --parent-folder <rid>", "Parent folder RID for the document type").requiredOption("-f, --file-system-type <type>", "File system type for the document type (ARTIFACTS or COMPASS)").action(irDeployHandler);
@@ -1 +1 @@
1
- {"version":3,"file":"registerIrCommands.js","names":["irDeployHandler","irGenAssetHandler","irGenModelsHandler","irGenZodHandler","registerIrCommands","program","irCmd","command","description","requiredOption","option","action"],"sources":["registerIrCommands.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { Command } from \"commander\";\nimport { irDeployHandler } from \"./irDeployHandler.js\";\nimport { irGenAssetHandler } from \"./irGenAssetHandler.js\";\nimport { irGenModelsHandler } from \"./irGenModelsHandler.js\";\nimport { irGenZodHandler } from \"./irGenZodHandler.js\";\n\nexport function registerIrCommands(program: Command): void {\n const irCmd = program\n .command(\"ir\")\n .description(\"IR (Intermediate Representation) based generation commands\");\n\n irCmd\n .command(\"zod\")\n .description(\"Generate Zod schemas from IR document schema definitions\")\n .requiredOption(\"-s, --schema <file>\", \"Path to schema JSON file\")\n .requiredOption(\"-o, --output <file>\", \"Output file path for generated Zod schemas\")\n .option(\n \"-t, --type-import-path <path>\",\n \"Path to import types from (enables satisfies operators)\",\n )\n .action(irGenZodHandler);\n\n irCmd\n .command(\"models\")\n .description(\"Generate Model constants from IR document schema definitions\")\n .requiredOption(\"-s, --schema <file>\", \"Path to schema JSON file\")\n .requiredOption(\"-o, --output <file>\", \"Output file path for generated Model constants\")\n .option(\n \"-t, --type-import-path <path>\",\n \"Path to import types from\",\n \"./types.js\",\n )\n .option(\n \"--schema-import-path <path>\",\n \"Path to import schemas from\",\n \"./schema.js\",\n )\n .action(irGenModelsHandler);\n\n irCmd\n .command(\"deploy\")\n .description(\"Create a document type on a Foundry stack using an IR document schema\")\n .requiredOption(\"-i, --ir <file>\", \"Path to IR JSON file\")\n .requiredOption(\"-b, --base-url <url>\", \"Base URL for Foundry API\")\n .requiredOption(\"-a, --auth <token>\", \"Authentication token for Foundry API\")\n .requiredOption(\"-p, --parent-folder <rid>\", \"Parent folder RID for the document type\")\n .requiredOption(\n \"-f, --file-system-type <type>\",\n \"File system type for the document type (ARTIFACTS or COMPASS)\",\n )\n .action(irDeployHandler);\n\n irCmd\n .command(\"asset\")\n .description(\n \"Generate document type asset JSON from IR schema (advanced — most users should use 'ir deploy' instead)\",\n )\n .requiredOption(\"-i, --ir <file>\", \"Path to IR JSON file\")\n .requiredOption(\"-o, --output <file>\", \"Output file path for asset JSON\")\n .option(\n \"-f, --file-system-type <type>\",\n \"File system type (ARTIFACTS or COMPASS)\",\n \"ARTIFACTS\",\n )\n .action(irGenAssetHandler);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,eAAe,QAAQ,sBAAsB;AACtD,SAASC,iBAAiB,QAAQ,wBAAwB;AAC1D,SAASC,kBAAkB,QAAQ,yBAAyB;AAC5D,SAASC,eAAe,QAAQ,sBAAsB;AAEtD,OAAO,SAASC,kBAAkBA,CAACC,OAAgB,EAAQ;EACzD,MAAMC,KAAK,GAAGD,OAAO,CAClBE,OAAO,CAAC,IAAI,CAAC,CACbC,WAAW,CAAC,4DAA4D,CAAC;EAE5EF,KAAK,CACFC,OAAO,CAAC,KAAK,CAAC,CACdC,WAAW,CAAC,0DAA0D,CAAC,CACvEC,cAAc,CAAC,qBAAqB,EAAE,0BAA0B,CAAC,CACjEA,cAAc,CAAC,qBAAqB,EAAE,4CAA4C,CAAC,CACnFC,MAAM,CACL,+BAA+B,EAC/B,yDACF,CAAC,CACAC,MAAM,CAACR,eAAe,CAAC;EAE1BG,KAAK,CACFC,OAAO,CAAC,QAAQ,CAAC,CACjBC,WAAW,CAAC,8DAA8D,CAAC,CAC3EC,cAAc,CAAC,qBAAqB,EAAE,0BAA0B,CAAC,CACjEA,cAAc,CAAC,qBAAqB,EAAE,gDAAgD,CAAC,CACvFC,MAAM,CACL,+BAA+B,EAC/B,2BAA2B,EAC3B,YACF,CAAC,CACAA,MAAM,CACL,6BAA6B,EAC7B,6BAA6B,EAC7B,aACF,CAAC,CACAC,MAAM,CAACT,kBAAkB,CAAC;EAE7BI,KAAK,CACFC,OAAO,CAAC,QAAQ,CAAC,CACjBC,WAAW,CAAC,uEAAuE,CAAC,CACpFC,cAAc,CAAC,iBAAiB,EAAE,sBAAsB,CAAC,CACzDA,cAAc,CAAC,sBAAsB,EAAE,0BAA0B,CAAC,CAClEA,cAAc,CAAC,oBAAoB,EAAE,sCAAsC,CAAC,CAC5EA,cAAc,CAAC,2BAA2B,EAAE,yCAAyC,CAAC,CACtFA,cAAc,CACb,+BAA+B,EAC/B,+DACF,CAAC,CACAE,MAAM,CAACX,eAAe,CAAC;EAE1BM,KAAK,CACFC,OAAO,CAAC,OAAO,CAAC,CAChBC,WAAW,CACV,yGACF,CAAC,CACAC,cAAc,CAAC,iBAAiB,EAAE,sBAAsB,CAAC,CACzDA,cAAc,CAAC,qBAAqB,EAAE,iCAAiC,CAAC,CACxEC,MAAM,CACL,+BAA+B,EAC/B,yCAAyC,EACzC,WACF,CAAC,CACAC,MAAM,CAACV,iBAAiB,CAAC;AAC9B","ignoreList":[]}
1
+ {"version":3,"file":"registerIrCommands.js","names":["irDeployHandler","irGenAssetHandler","irGenModelsHandler","irGenTypesHandler","irGenZodHandler","registerIrCommands","program","irCmd","command","description","requiredOption","option","action"],"sources":["registerIrCommands.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { Command } from \"commander\";\nimport { irDeployHandler } from \"./irDeployHandler.js\";\nimport { irGenAssetHandler } from \"./irGenAssetHandler.js\";\nimport { irGenModelsHandler } from \"./irGenModelsHandler.js\";\nimport { irGenTypesHandler } from \"./irGenTypesHandler.js\";\nimport { irGenZodHandler } from \"./irGenZodHandler.js\";\n\nexport function registerIrCommands(program: Command): void {\n const irCmd = program\n .command(\"ir\")\n .description(\"IR (Intermediate Representation) based generation commands\");\n\n irCmd\n .command(\"gen-types\")\n .description(\n \"Generate versioned SDK files (types, schemas, internal/, models.ts, versions.ts, versionedDocRef.ts, index.ts) from a versioned IR chain JSON\",\n )\n .requiredOption(\"-s, --schema <file>\", \"Path to versioned IR chain JSON file\")\n .requiredOption(\"-o, --output <dir>\", \"Output directory for generated SDK files\")\n .option(\"--min-version <version>\", \"Minimum supported version\")\n .action(irGenTypesHandler);\n\n irCmd\n .command(\"zod\")\n .description(\"Generate Zod schemas from IR document schema definitions\")\n .requiredOption(\"-s, --schema <file>\", \"Path to schema JSON file\")\n .requiredOption(\"-o, --output <file>\", \"Output file path for generated Zod schemas\")\n .option(\n \"-t, --type-import-path <path>\",\n \"Path to import types from (enables satisfies operators)\",\n )\n .action(irGenZodHandler);\n\n irCmd\n .command(\"models\")\n .description(\"Generate Model constants from IR document schema definitions\")\n .requiredOption(\"-s, --schema <file>\", \"Path to schema JSON file\")\n .requiredOption(\"-o, --output <file>\", \"Output file path for generated Model constants\")\n .option(\n \"-t, --type-import-path <path>\",\n \"Path to import types from\",\n \"./types.js\",\n )\n .option(\n \"--schema-import-path <path>\",\n \"Path to import schemas from\",\n \"./schema.js\",\n )\n .action(irGenModelsHandler);\n\n irCmd\n .command(\"deploy\")\n .description(\"Create a document type on a Foundry stack using an IR document schema\")\n .requiredOption(\"-i, --ir <file>\", \"Path to IR JSON file\")\n .requiredOption(\"-b, --base-url <url>\", \"Base URL for Foundry API\")\n .requiredOption(\"-a, --auth <token>\", \"Authentication token for Foundry API\")\n .requiredOption(\"-p, --parent-folder <rid>\", \"Parent folder RID for the document type\")\n .requiredOption(\n \"-f, --file-system-type <type>\",\n \"File system type for the document type (ARTIFACTS or COMPASS)\",\n )\n .action(irDeployHandler);\n\n irCmd\n .command(\"asset\")\n .description(\n \"Generate document type asset JSON from IR schema (advanced — most users should use 'ir deploy' instead)\",\n )\n .requiredOption(\"-i, --ir <file>\", \"Path to IR JSON file\")\n .requiredOption(\"-o, --output <file>\", \"Output file path for asset JSON\")\n .option(\n \"-f, --file-system-type <type>\",\n \"File system type (ARTIFACTS or COMPASS)\",\n \"ARTIFACTS\",\n )\n .action(irGenAssetHandler);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,eAAe,QAAQ,sBAAsB;AACtD,SAASC,iBAAiB,QAAQ,wBAAwB;AAC1D,SAASC,kBAAkB,QAAQ,yBAAyB;AAC5D,SAASC,iBAAiB,QAAQ,wBAAwB;AAC1D,SAASC,eAAe,QAAQ,sBAAsB;AAEtD,OAAO,SAASC,kBAAkBA,CAACC,OAAgB,EAAQ;EACzD,MAAMC,KAAK,GAAGD,OAAO,CAClBE,OAAO,CAAC,IAAI,CAAC,CACbC,WAAW,CAAC,4DAA4D,CAAC;EAE5EF,KAAK,CACFC,OAAO,CAAC,WAAW,CAAC,CACpBC,WAAW,CACV,+IACF,CAAC,CACAC,cAAc,CAAC,qBAAqB,EAAE,sCAAsC,CAAC,CAC7EA,cAAc,CAAC,oBAAoB,EAAE,0CAA0C,CAAC,CAChFC,MAAM,CAAC,yBAAyB,EAAE,2BAA2B,CAAC,CAC9DC,MAAM,CAACT,iBAAiB,CAAC;EAE5BI,KAAK,CACFC,OAAO,CAAC,KAAK,CAAC,CACdC,WAAW,CAAC,0DAA0D,CAAC,CACvEC,cAAc,CAAC,qBAAqB,EAAE,0BAA0B,CAAC,CACjEA,cAAc,CAAC,qBAAqB,EAAE,4CAA4C,CAAC,CACnFC,MAAM,CACL,+BAA+B,EAC/B,yDACF,CAAC,CACAC,MAAM,CAACR,eAAe,CAAC;EAE1BG,KAAK,CACFC,OAAO,CAAC,QAAQ,CAAC,CACjBC,WAAW,CAAC,8DAA8D,CAAC,CAC3EC,cAAc,CAAC,qBAAqB,EAAE,0BAA0B,CAAC,CACjEA,cAAc,CAAC,qBAAqB,EAAE,gDAAgD,CAAC,CACvFC,MAAM,CACL,+BAA+B,EAC/B,2BAA2B,EAC3B,YACF,CAAC,CACAA,MAAM,CACL,6BAA6B,EAC7B,6BAA6B,EAC7B,aACF,CAAC,CACAC,MAAM,CAACV,kBAAkB,CAAC;EAE7BK,KAAK,CACFC,OAAO,CAAC,QAAQ,CAAC,CACjBC,WAAW,CAAC,uEAAuE,CAAC,CACpFC,cAAc,CAAC,iBAAiB,EAAE,sBAAsB,CAAC,CACzDA,cAAc,CAAC,sBAAsB,EAAE,0BAA0B,CAAC,CAClEA,cAAc,CAAC,oBAAoB,EAAE,sCAAsC,CAAC,CAC5EA,cAAc,CAAC,2BAA2B,EAAE,yCAAyC,CAAC,CACtFA,cAAc,CACb,+BAA+B,EAC/B,+DACF,CAAC,CACAE,MAAM,CAACZ,eAAe,CAAC;EAE1BO,KAAK,CACFC,OAAO,CAAC,OAAO,CAAC,CAChBC,WAAW,CACV,yGACF,CAAC,CACAC,cAAc,CAAC,iBAAiB,EAAE,sBAAsB,CAAC,CACzDA,cAAc,CAAC,qBAAqB,EAAE,iCAAiC,CAAC,CACxEC,MAAM,CACL,+BAA+B,EAC/B,yCAAyC,EACzC,WACF,CAAC,CACAC,MAAM,CAACX,iBAAiB,CAAC;AAC9B","ignoreList":[]}
@@ -14,11 +14,11 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import { schemaGenTypesHandler } from "./schemaGenTypesHandler.js";
17
+ import { schemaIrHandler } from "./schemaIrHandler.js";
18
18
  import { schemaToYamlHandler } from "./schemaToYamlHandler.js";
19
19
  export function registerSchemaCommands(program) {
20
20
  const schemaCmd = program.command("schema").description("Commands for working with TypeScript schema definitions");
21
21
  schemaCmd.command("yaml").description("Convert TypeScript schema to YAML migration steps").requiredOption("-i, --input <file>", "Input TypeScript schema file").requiredOption("-o, --output <file>", "Output YAML file").action(schemaToYamlHandler);
22
- schemaCmd.command("gen-types").description("Generate versioned TypeScript types from a schema module").requiredOption("-i, --input <file>", "Input TypeScript/JavaScript schema module").requiredOption("-o, --output <dir>", "Output directory").option("--min-version <version>", "Minimum supported version").action(schemaGenTypesHandler);
22
+ schemaCmd.command("ir").description("Resolve a TypeScript schema module to a versioned IR chain JSON file").requiredOption("-i, --input <file>", "Input TypeScript/JavaScript schema module").requiredOption("-o, --output <file>", "Output IR chain JSON file").action(schemaIrHandler);
23
23
  }
24
24
  //# sourceMappingURL=registerSchemaCommands.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"registerSchemaCommands.js","names":["schemaGenTypesHandler","schemaToYamlHandler","registerSchemaCommands","program","schemaCmd","command","description","requiredOption","action","option"],"sources":["registerSchemaCommands.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { Command } from \"commander\";\nimport { schemaGenTypesHandler } from \"./schemaGenTypesHandler.js\";\nimport { schemaToYamlHandler } from \"./schemaToYamlHandler.js\";\n\nexport function registerSchemaCommands(program: Command): void {\n const schemaCmd = program\n .command(\"schema\")\n .description(\"Commands for working with TypeScript schema definitions\");\n\n schemaCmd\n .command(\"yaml\")\n .description(\"Convert TypeScript schema to YAML migration steps\")\n .requiredOption(\"-i, --input <file>\", \"Input TypeScript schema file\")\n .requiredOption(\"-o, --output <file>\", \"Output YAML file\")\n .action(schemaToYamlHandler);\n\n schemaCmd\n .command(\"gen-types\")\n .description(\"Generate versioned TypeScript types from a schema module\")\n .requiredOption(\"-i, --input <file>\", \"Input TypeScript/JavaScript schema module\")\n .requiredOption(\"-o, --output <dir>\", \"Output directory\")\n .option(\"--min-version <version>\", \"Minimum supported version\")\n .action(schemaGenTypesHandler);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,qBAAqB,QAAQ,4BAA4B;AAClE,SAASC,mBAAmB,QAAQ,0BAA0B;AAE9D,OAAO,SAASC,sBAAsBA,CAACC,OAAgB,EAAQ;EAC7D,MAAMC,SAAS,GAAGD,OAAO,CACtBE,OAAO,CAAC,QAAQ,CAAC,CACjBC,WAAW,CAAC,yDAAyD,CAAC;EAEzEF,SAAS,CACNC,OAAO,CAAC,MAAM,CAAC,CACfC,WAAW,CAAC,mDAAmD,CAAC,CAChEC,cAAc,CAAC,oBAAoB,EAAE,8BAA8B,CAAC,CACpEA,cAAc,CAAC,qBAAqB,EAAE,kBAAkB,CAAC,CACzDC,MAAM,CAACP,mBAAmB,CAAC;EAE9BG,SAAS,CACNC,OAAO,CAAC,WAAW,CAAC,CACpBC,WAAW,CAAC,0DAA0D,CAAC,CACvEC,cAAc,CAAC,oBAAoB,EAAE,2CAA2C,CAAC,CACjFA,cAAc,CAAC,oBAAoB,EAAE,kBAAkB,CAAC,CACxDE,MAAM,CAAC,yBAAyB,EAAE,2BAA2B,CAAC,CAC9DD,MAAM,CAACR,qBAAqB,CAAC;AAClC","ignoreList":[]}
1
+ {"version":3,"file":"registerSchemaCommands.js","names":["schemaIrHandler","schemaToYamlHandler","registerSchemaCommands","program","schemaCmd","command","description","requiredOption","action"],"sources":["registerSchemaCommands.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { Command } from \"commander\";\nimport { schemaIrHandler } from \"./schemaIrHandler.js\";\nimport { schemaToYamlHandler } from \"./schemaToYamlHandler.js\";\n\nexport function registerSchemaCommands(program: Command): void {\n const schemaCmd = program\n .command(\"schema\")\n .description(\"Commands for working with TypeScript schema definitions\");\n\n schemaCmd\n .command(\"yaml\")\n .description(\"Convert TypeScript schema to YAML migration steps\")\n .requiredOption(\"-i, --input <file>\", \"Input TypeScript schema file\")\n .requiredOption(\"-o, --output <file>\", \"Output YAML file\")\n .action(schemaToYamlHandler);\n\n schemaCmd\n .command(\"ir\")\n .description(\"Resolve a TypeScript schema module to a versioned IR chain JSON file\")\n .requiredOption(\"-i, --input <file>\", \"Input TypeScript/JavaScript schema module\")\n .requiredOption(\"-o, --output <file>\", \"Output IR chain JSON file\")\n .action(schemaIrHandler);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,eAAe,QAAQ,sBAAsB;AACtD,SAASC,mBAAmB,QAAQ,0BAA0B;AAE9D,OAAO,SAASC,sBAAsBA,CAACC,OAAgB,EAAQ;EAC7D,MAAMC,SAAS,GAAGD,OAAO,CACtBE,OAAO,CAAC,QAAQ,CAAC,CACjBC,WAAW,CAAC,yDAAyD,CAAC;EAEzEF,SAAS,CACNC,OAAO,CAAC,MAAM,CAAC,CACfC,WAAW,CAAC,mDAAmD,CAAC,CAChEC,cAAc,CAAC,oBAAoB,EAAE,8BAA8B,CAAC,CACpEA,cAAc,CAAC,qBAAqB,EAAE,kBAAkB,CAAC,CACzDC,MAAM,CAACP,mBAAmB,CAAC;EAE9BG,SAAS,CACNC,OAAO,CAAC,IAAI,CAAC,CACbC,WAAW,CAAC,sEAAsE,CAAC,CACnFC,cAAc,CAAC,oBAAoB,EAAE,2CAA2C,CAAC,CACjFA,cAAc,CAAC,qBAAqB,EAAE,2BAA2B,CAAC,CAClEC,MAAM,CAACR,eAAe,CAAC;AAC5B","ignoreList":[]}
@@ -0,0 +1,56 @@
1
+ /*
2
+ * Copyright 2026 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { consola } from "consola";
18
+ import fs from "fs-extra";
19
+ import path from "path";
20
+ import { GENERATED_JSON_COMMENT } from "../../utils/generatedFileHeader.js";
21
+ import { loadSchemaModule } from "../../utils/schema/loadSchemaModule.js";
22
+ import { resolveSchemaChain } from "../../utils/schema/resolveSchemaChain.js";
23
+ /**
24
+ * Resolve a TypeScript schema module to a versioned IR chain JSON file.
25
+ *
26
+ * The output is a `{ latestVersion, chain }` payload where each entry is
27
+ * `{ version, ir, migrations? }` and `ir` is a single-version
28
+ * `IRealTimeDocumentSchema`. This is the input format for `ir gen-types`.
29
+ *
30
+ * Note: this is distinct from the legacy single-version IR JSON consumed by
31
+ * `ir deploy` / `ir asset` / `ir zod`, which is a bare `IRealTimeDocumentSchema`
32
+ * (no chain, no migrations). Tools that previously read that format should
33
+ * pick the entry matching `latestVersion` from `chain` and use its `ir` field.
34
+ */
35
+ export async function schemaIrHandler(options) {
36
+ const {
37
+ input,
38
+ output
39
+ } = options;
40
+ consola.info(`Loading schema from: ${input}`);
41
+ const schema = await loadSchemaModule(input);
42
+ consola.info("Resolving versioned IR chain...");
43
+ const {
44
+ chain,
45
+ latestVersion
46
+ } = resolveSchemaChain(schema);
47
+ const outputPath = path.resolve(output);
48
+ await fs.ensureDir(path.dirname(outputPath));
49
+ await fs.writeFile(outputPath, JSON.stringify({
50
+ __comment: GENERATED_JSON_COMMENT,
51
+ latestVersion,
52
+ chain
53
+ }, null, 2) + "\n", "utf8");
54
+ consola.success(`Wrote IR chain (${chain.length} version(s)) to: ${outputPath}`);
55
+ }
56
+ //# sourceMappingURL=schemaIrHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemaIrHandler.js","names":["consola","fs","path","GENERATED_JSON_COMMENT","loadSchemaModule","resolveSchemaChain","schemaIrHandler","options","input","output","info","schema","chain","latestVersion","outputPath","resolve","ensureDir","dirname","writeFile","JSON","stringify","__comment","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}\n\n/**\n * Resolve a TypeScript schema module to a versioned IR chain JSON file.\n *\n * The output is a `{ latestVersion, chain }` payload where each entry is\n * `{ version, ir, migrations? }` and `ir` is a single-version\n * `IRealTimeDocumentSchema`. This is the input format for `ir gen-types`.\n *\n * Note: this is distinct from the legacy single-version IR JSON consumed by\n * `ir deploy` / `ir asset` / `ir zod`, which is a bare `IRealTimeDocumentSchema`\n * (no chain, no migrations). Tools that previously read that format should\n * pick the entry matching `latestVersion` from `chain` and use its `ir` field.\n */\nexport async function schemaIrHandler(options: SchemaIrOptions): Promise<void> {\n const { input, output } = options;\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(schema);\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 chain,\n };\n await fs.writeFile(outputPath, JSON.stringify(payload, null, 2) + \"\\n\", \"utf8\");\n\n consola.success(`Wrote IR chain (${chain.length} version(s)) to: ${outputPath}`);\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;AAO7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,eAAeA,CAACC,OAAwB,EAAiB;EAC7E,MAAM;IAAEC,KAAK;IAAEC;EAAO,CAAC,GAAGF,OAAO;EAEjCP,OAAO,CAACU,IAAI,CAAC,wBAAwBF,KAAK,EAAE,CAAC;EAC7C,MAAMG,MAAM,GAAG,MAAMP,gBAAgB,CAACI,KAAK,CAAC;EAE5CR,OAAO,CAACU,IAAI,CAAC,iCAAiC,CAAC;EAC/C,MAAM;IAAEE,KAAK;IAAEC;EAAc,CAAC,GAAGR,kBAAkB,CAACM,MAAM,CAAC;EAE3D,MAAMG,UAAU,GAAGZ,IAAI,CAACa,OAAO,CAACN,MAAM,CAAC;EACvC,MAAMR,EAAE,CAACe,SAAS,CAACd,IAAI,CAACe,OAAO,CAACH,UAAU,CAAC,CAAC;EAO5C,MAAMb,EAAE,CAACiB,SAAS,CAACJ,UAAU,EAAEK,IAAI,CAACC,SAAS,CAL7B;IACdC,SAAS,EAAElB,sBAAsB;IACjCU,aAAa;IACbD;EACF,CAAC,EACsD,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC;EAE/EZ,OAAO,CAACsB,OAAO,CAAC,mBAAmBV,KAAK,CAACW,MAAM,oBAAoBT,UAAU,EAAE,CAAC;AAClF","ignoreList":[]}
@@ -20,13 +20,7 @@ export { registerSchemaCommands } from "./commands/schema/registerSchemaCommands
20
20
  export { registerStepsCommands } from "./commands/steps/registerStepsCommands.js";
21
21
  export { generateZodSchemasFromIr } from "./utils/ir/generateZodSchemasFromIr.js";
22
22
  export { convertSchemaToSteps, convertStepsToYamlString } from "./utils/schema/convertSchemaToSteps.js";
23
- export { generateInternalFromSchema } from "./utils/schema/generateInternalFromSchema.js";
24
- export { generateModelMetadataFromSchema } from "./utils/schema/generateModelMetadataFromSchema.js";
25
- export { generateScopeFromSchema } from "./utils/schema/generateScopeFromSchema.js";
26
23
  export { generateTypesFromSchema } from "./utils/schema/generateTypesFromSchema.js";
27
- export { generateVersionedTypesFromSchema } from "./utils/schema/generateVersionedTypesFromSchema.js";
28
- export { generateVersionedZodFromSchema } from "./utils/schema/generateVersionedZodFromSchema.js";
29
- export { generateVersionsFromSchema } from "./utils/schema/generateVersionsFromSchema.js";
30
24
  export { generateZodFromSchema } from "./utils/schema/generateZodFromSchema.js";
31
25
  export { convertRecordDefToIr, convertSchemaToIr, convertStepsToIr, convertTypeToFieldTypeUnion } from "./utils/steps/convertStepsToIr.js";
32
26
  export { generateZodFromStepsSchema } from "./utils/steps/generateZodFromStepsSchema.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["cli","registerIrCommands","registerSchemaCommands","registerStepsCommands","generateZodSchemasFromIr","convertSchemaToSteps","convertStepsToYamlString","generateInternalFromSchema","generateModelMetadataFromSchema","generateScopeFromSchema","generateTypesFromSchema","generateVersionedTypesFromSchema","generateVersionedZodFromSchema","generateVersionsFromSchema","generateZodFromSchema","convertRecordDefToIr","convertSchemaToIr","convertStepsToIr","convertTypeToFieldTypeUnion","generateZodFromStepsSchema"],"sources":["index.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\nexport { cli } from \"./cli.js\";\nexport { registerIrCommands } from \"./commands/ir/registerIrCommands.js\";\nexport { registerSchemaCommands } from \"./commands/schema/registerSchemaCommands.js\";\nexport { registerStepsCommands } from \"./commands/steps/registerStepsCommands.js\";\nexport { generateZodSchemasFromIr } from \"./utils/ir/generateZodSchemasFromIr.js\";\nexport {\n convertSchemaToSteps,\n convertStepsToYamlString,\n} from \"./utils/schema/convertSchemaToSteps.js\";\nexport { generateInternalFromSchema } from \"./utils/schema/generateInternalFromSchema.js\";\nexport {\n generateModelMetadataFromSchema,\n type ModelMetadataOutput,\n} from \"./utils/schema/generateModelMetadataFromSchema.js\";\nexport { generateScopeFromSchema } from \"./utils/schema/generateScopeFromSchema.js\";\nexport { generateTypesFromSchema } from \"./utils/schema/generateTypesFromSchema.js\";\nexport { generateVersionedTypesFromSchema } from \"./utils/schema/generateVersionedTypesFromSchema.js\";\nexport { generateVersionedZodFromSchema } from \"./utils/schema/generateVersionedZodFromSchema.js\";\nexport { generateVersionsFromSchema } from \"./utils/schema/generateVersionsFromSchema.js\";\nexport { generateZodFromSchema } from \"./utils/schema/generateZodFromSchema.js\";\nexport {\n convertRecordDefToIr,\n convertSchemaToIr,\n convertStepsToIr,\n convertTypeToFieldTypeUnion,\n type SchemaMetadata,\n} from \"./utils/steps/convertStepsToIr.js\";\nexport { generateZodFromStepsSchema } from \"./utils/steps/generateZodFromStepsSchema.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,GAAG,QAAQ,UAAU;AAC9B,SAASC,kBAAkB,QAAQ,qCAAqC;AACxE,SAASC,sBAAsB,QAAQ,6CAA6C;AACpF,SAASC,qBAAqB,QAAQ,2CAA2C;AACjF,SAASC,wBAAwB,QAAQ,wCAAwC;AACjF,SACEC,oBAAoB,EACpBC,wBAAwB,QACnB,wCAAwC;AAC/C,SAASC,0BAA0B,QAAQ,8CAA8C;AACzF,SACEC,+BAA+B,QAE1B,mDAAmD;AAC1D,SAASC,uBAAuB,QAAQ,2CAA2C;AACnF,SAASC,uBAAuB,QAAQ,2CAA2C;AACnF,SAASC,gCAAgC,QAAQ,oDAAoD;AACrG,SAASC,8BAA8B,QAAQ,kDAAkD;AACjG,SAASC,0BAA0B,QAAQ,8CAA8C;AACzF,SAASC,qBAAqB,QAAQ,yCAAyC;AAC/E,SACEC,oBAAoB,EACpBC,iBAAiB,EACjBC,gBAAgB,EAChBC,2BAA2B,QAEtB,mCAAmC;AAC1C,SAASC,0BAA0B,QAAQ,6CAA6C","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["cli","registerIrCommands","registerSchemaCommands","registerStepsCommands","generateZodSchemasFromIr","convertSchemaToSteps","convertStepsToYamlString","generateTypesFromSchema","generateZodFromSchema","convertRecordDefToIr","convertSchemaToIr","convertStepsToIr","convertTypeToFieldTypeUnion","generateZodFromStepsSchema"],"sources":["index.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\nexport { cli } from \"./cli.js\";\nexport { registerIrCommands } from \"./commands/ir/registerIrCommands.js\";\nexport { registerSchemaCommands } from \"./commands/schema/registerSchemaCommands.js\";\nexport { registerStepsCommands } from \"./commands/steps/registerStepsCommands.js\";\nexport { generateZodSchemasFromIr } from \"./utils/ir/generateZodSchemasFromIr.js\";\nexport {\n convertSchemaToSteps,\n convertStepsToYamlString,\n} from \"./utils/schema/convertSchemaToSteps.js\";\nexport { type ModelMetadataOutput } from \"./utils/schema/generateModelMetadataFromSchema.js\";\nexport { generateTypesFromSchema } from \"./utils/schema/generateTypesFromSchema.js\";\nexport { generateZodFromSchema } from \"./utils/schema/generateZodFromSchema.js\";\nexport {\n convertRecordDefToIr,\n convertSchemaToIr,\n convertStepsToIr,\n convertTypeToFieldTypeUnion,\n type SchemaMetadata,\n} from \"./utils/steps/convertStepsToIr.js\";\nexport { generateZodFromStepsSchema } from \"./utils/steps/generateZodFromStepsSchema.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,GAAG,QAAQ,UAAU;AAC9B,SAASC,kBAAkB,QAAQ,qCAAqC;AACxE,SAASC,sBAAsB,QAAQ,6CAA6C;AACpF,SAASC,qBAAqB,QAAQ,2CAA2C;AACjF,SAASC,wBAAwB,QAAQ,wCAAwC;AACjF,SACEC,oBAAoB,EACpBC,wBAAwB,QACnB,wCAAwC;AAE/C,SAASC,uBAAuB,QAAQ,2CAA2C;AACnF,SAASC,qBAAqB,QAAQ,yCAAyC;AAC/E,SACEC,oBAAoB,EACpBC,iBAAiB,EACjBC,gBAAgB,EAChBC,2BAA2B,QAEtB,mCAAmC;AAC1C,SAASC,0BAA0B,QAAQ,6CAA6C","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- /* Generated by @palantir/pack.document-schema.type-gen@0.9.0 */
1
+ /* Generated by @palantir/pack.document-schema.type-gen@0.10.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.9.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.10.0 */\n\nimport type {\n DocumentSchema,\n RecordModel,\n UnionModel,\n} from '@palantir/pack.document-schema.model-types';\nimport { Metadata } from '@palantir/pack.document-schema.model-types';\nimport type { Animal, AnimalCat, AnimalDog, Cat, Dog } from './types.js';\nimport {\n AnimalCatSchema,\n AnimalDogSchema,\n AnimalSchema,\n CatSchema,\n DogSchema,\n} from './schema.js';\n\nexport interface CatModel extends RecordModel<Cat, typeof CatSchema> {}\nexport const CatModel: CatModel = {\n __type: {} as Cat,\n zodSchema: CatSchema,\n [Metadata]: {\n name: 'Cat',\n },\n};\n\nexport interface DogModel extends RecordModel<Dog, typeof DogSchema> {}\nexport const DogModel: DogModel = {\n __type: {} as Dog,\n zodSchema: DogSchema,\n [Metadata]: {\n name: 'Dog',\n },\n};\n\nexport interface AnimalModel extends UnionModel<Animal, typeof AnimalSchema> {}\nexport const AnimalModel: AnimalModel = {\n __type: {} as Animal,\n zodSchema: AnimalSchema,\n [Metadata]: {\n discriminant: 'kind',\n name: 'Animal',\n },\n};\n\nexport interface AnimalCatModel extends UnionModel<\n AnimalCat,\n typeof AnimalCatSchema\n> {}\nexport const AnimalCatModel: AnimalCatModel = {\n __type: {} as AnimalCat,\n zodSchema: AnimalCatSchema,\n [Metadata]: {\n discriminant: 'kind',\n name: 'AnimalCat',\n },\n};\n\nexport interface AnimalDogModel extends UnionModel<\n AnimalDog,\n typeof AnimalDogSchema\n> {}\nexport const AnimalDogModel: AnimalDogModel = {\n __type: {} as AnimalDog,\n zodSchema: AnimalDogSchema,\n [Metadata]: {\n discriminant: 'kind',\n name: 'AnimalDog',\n },\n};\n\nexport const DocumentModel = {\n Cat: CatModel,\n Dog: DogModel,\n Animal: AnimalModel,\n AnimalCat: AnimalCatModel,\n AnimalDog: AnimalDogModel,\n [Metadata]: {\n version: 1,\n },\n} as const satisfies DocumentSchema;\n\nexport type DocumentModel = typeof DocumentModel;\n"],"mappings":"AAAA;;AAOA,SAASA,QAAQ,QAAQ,4CAA4C;AAErE,SACEC,eAAe,EACfC,eAAe,EACfC,YAAY,EACZC,SAAS,EACTC,SAAS,QACJ,aAAa;AAGpB,OAAO,MAAMC,QAAkB,GAAG;EAChCC,MAAM,EAAE,CAAC,CAAQ;EACjBC,SAAS,EAAEJ,SAAS;EACpB,CAACJ,QAAQ,GAAG;IACVS,IAAI,EAAE;EACR;AACF,CAAC;AAGD,OAAO,MAAMC,QAAkB,GAAG;EAChCH,MAAM,EAAE,CAAC,CAAQ;EACjBC,SAAS,EAAEH,SAAS;EACpB,CAACL,QAAQ,GAAG;IACVS,IAAI,EAAE;EACR;AACF,CAAC;AAGD,OAAO,MAAME,WAAwB,GAAG;EACtCJ,MAAM,EAAE,CAAC,CAAW;EACpBC,SAAS,EAAEL,YAAY;EACvB,CAACH,QAAQ,GAAG;IACVY,YAAY,EAAE,MAAM;IACpBH,IAAI,EAAE;EACR;AACF,CAAC;AAMD,OAAO,MAAMI,cAA8B,GAAG;EAC5CN,MAAM,EAAE,CAAC,CAAc;EACvBC,SAAS,EAAEP,eAAe;EAC1B,CAACD,QAAQ,GAAG;IACVY,YAAY,EAAE,MAAM;IACpBH,IAAI,EAAE;EACR;AACF,CAAC;AAMD,OAAO,MAAMK,cAA8B,GAAG;EAC5CP,MAAM,EAAE,CAAC,CAAc;EACvBC,SAAS,EAAEN,eAAe;EAC1B,CAACF,QAAQ,GAAG;IACVY,YAAY,EAAE,MAAM;IACpBH,IAAI,EAAE;EACR;AACF,CAAC;AAED,OAAO,MAAMM,aAAa,GAAG;EAC3BC,GAAG,EAAEV,QAAQ;EACbW,GAAG,EAAEP,QAAQ;EACbQ,MAAM,EAAEP,WAAW;EACnBQ,SAAS,EAAEN,cAAc;EACzBO,SAAS,EAAEN,cAAc;EACzB,CAACd,QAAQ,GAAG;IACVqB,OAAO,EAAE;EACX;AACF,CAAmC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- /* Generated by @palantir/pack.document-schema.type-gen@0.9.0 */
1
+ /* Generated by @palantir/pack.document-schema.type-gen@0.10.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.9.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.10.0 */\n\nimport type {\n DocumentSchema,\n RecordModel,\n UnionModel,\n} from '@palantir/pack.document-schema.model-types';\nimport { Metadata } from '@palantir/pack.document-schema.model-types';\nimport type { Event } from './types.js';\nimport { EventSchema } from './schema.js';\n\nexport interface EventModel extends RecordModel<Event, typeof EventSchema> {}\nexport const EventModel: EventModel = {\n __type: {} as Event,\n zodSchema: EventSchema,\n [Metadata]: {\n externalRefFieldTypes: {\n documentRef: 'docRef',\n userRef: 'userRef',\n },\n name: 'Event',\n },\n};\n\nexport const DocumentModel = {\n Event: EventModel,\n [Metadata]: {\n version: 1,\n },\n} as const satisfies DocumentSchema;\n\nexport type DocumentModel = typeof DocumentModel;\n"],"mappings":"AAAA;;AAOA,SAASA,QAAQ,QAAQ,4CAA4C;AAErE,SAASC,WAAW,QAAQ,aAAa;AAGzC,OAAO,MAAMC,UAAsB,GAAG;EACpCC,MAAM,EAAE,CAAC,CAAU;EACnBC,SAAS,EAAEH,WAAW;EACtB,CAACD,QAAQ,GAAG;IACVK,qBAAqB,EAAE;MACrBC,WAAW,EAAE,QAAQ;MACrBC,OAAO,EAAE;IACX,CAAC;IACDC,IAAI,EAAE;EACR;AACF,CAAC;AAED,OAAO,MAAMC,aAAa,GAAG;EAC3BC,KAAK,EAAER,UAAU;EACjB,CAACF,QAAQ,GAAG;IACVW,OAAO,EAAE;EACX;AACF,CAAmC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- /* Generated by @palantir/pack.document-schema.type-gen@0.9.0 */
1
+ /* Generated by @palantir/pack.document-schema.type-gen@0.10.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.9.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.10.0 */\n\nimport type {\n DocumentSchema,\n RecordModel,\n UnionModel,\n} from '@palantir/pack.document-schema.model-types';\nimport { Metadata } from '@palantir/pack.document-schema.model-types';\nimport type { Person } from './types.js';\nimport { PersonSchema } from './schema.js';\n\nexport interface PersonModel extends RecordModel<Person, typeof PersonSchema> {}\nexport const PersonModel: PersonModel = {\n __type: {} as Person,\n zodSchema: PersonSchema,\n [Metadata]: {\n name: 'Person',\n },\n};\n\nexport const DocumentModel = {\n Person: PersonModel,\n [Metadata]: {\n version: 1,\n },\n} as const satisfies DocumentSchema;\n\nexport type DocumentModel = typeof DocumentModel;\n"],"mappings":"AAAA;;AAOA,SAASA,QAAQ,QAAQ,4CAA4C;AAErE,SAASC,YAAY,QAAQ,aAAa;AAG1C,OAAO,MAAMC,WAAwB,GAAG;EACtCC,MAAM,EAAE,CAAC,CAAW;EACpBC,SAAS,EAAEH,YAAY;EACvB,CAACD,QAAQ,GAAG;IACVK,IAAI,EAAE;EACR;AACF,CAAC;AAED,OAAO,MAAMC,aAAa,GAAG;EAC3BC,MAAM,EAAEL,WAAW;EACnB,CAACF,QAAQ,GAAG;IACVQ,OAAO,EAAE;EACX;AACF,CAAmC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- /* Generated by @palantir/pack.document-schema.type-gen@0.9.0 */
1
+ /* Generated by @palantir/pack.document-schema.type-gen@0.10.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.9.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.10.0 */\n\nimport type {\n DocumentSchema,\n RecordModel,\n UnionModel,\n} from '@palantir/pack.document-schema.model-types';\nimport { Metadata } from '@palantir/pack.document-schema.model-types';\nimport type {\n Node,\n NodeObject,\n NodeTextBox,\n ObjectNode,\n TextBox,\n} from './types.js';\nimport {\n NodeObjectSchema,\n NodeSchema,\n NodeTextBoxSchema,\n ObjectNodeSchema,\n TextBoxSchema,\n} from './schema.js';\n\nexport interface ObjectNodeModel extends RecordModel<\n ObjectNode,\n typeof ObjectNodeSchema\n> {}\nexport const ObjectNodeModel: ObjectNodeModel = {\n __type: {} as ObjectNode,\n zodSchema: ObjectNodeSchema,\n [Metadata]: {\n name: 'ObjectNode',\n },\n};\n\nexport interface TextBoxModel extends RecordModel<\n TextBox,\n typeof TextBoxSchema\n> {}\nexport const TextBoxModel: TextBoxModel = {\n __type: {} as TextBox,\n zodSchema: TextBoxSchema,\n [Metadata]: {\n name: 'TextBox',\n },\n};\n\nexport interface NodeModel extends UnionModel<Node, typeof NodeSchema> {}\nexport const NodeModel: NodeModel = {\n __type: {} as Node,\n zodSchema: NodeSchema,\n [Metadata]: {\n discriminant: 'type',\n name: 'Node',\n },\n};\n\nexport interface NodeObjectModel extends UnionModel<\n NodeObject,\n typeof NodeObjectSchema\n> {}\nexport const NodeObjectModel: NodeObjectModel = {\n __type: {} as NodeObject,\n zodSchema: NodeObjectSchema,\n [Metadata]: {\n discriminant: 'type',\n name: 'NodeObject',\n },\n};\n\nexport interface NodeTextBoxModel extends UnionModel<\n NodeTextBox,\n typeof NodeTextBoxSchema\n> {}\nexport const NodeTextBoxModel: NodeTextBoxModel = {\n __type: {} as NodeTextBox,\n zodSchema: NodeTextBoxSchema,\n [Metadata]: {\n discriminant: 'type',\n name: 'NodeTextBox',\n },\n};\n\nexport const DocumentModel = {\n ObjectNode: ObjectNodeModel,\n TextBox: TextBoxModel,\n Node: NodeModel,\n NodeObject: NodeObjectModel,\n NodeTextBox: NodeTextBoxModel,\n [Metadata]: {\n version: 1,\n },\n} as const satisfies DocumentSchema;\n\nexport type DocumentModel = typeof DocumentModel;\n"],"mappings":"AAAA;;AAOA,SAASA,QAAQ,QAAQ,4CAA4C;AAQrE,SACEC,gBAAgB,EAChBC,UAAU,EACVC,iBAAiB,EACjBC,gBAAgB,EAChBC,aAAa,QACR,aAAa;AAMpB,OAAO,MAAMC,eAAgC,GAAG;EAC9CC,MAAM,EAAE,CAAC,CAAe;EACxBC,SAAS,EAAEJ,gBAAgB;EAC3B,CAACJ,QAAQ,GAAG;IACVS,IAAI,EAAE;EACR;AACF,CAAC;AAMD,OAAO,MAAMC,YAA0B,GAAG;EACxCH,MAAM,EAAE,CAAC,CAAY;EACrBC,SAAS,EAAEH,aAAa;EACxB,CAACL,QAAQ,GAAG;IACVS,IAAI,EAAE;EACR;AACF,CAAC;AAGD,OAAO,MAAME,SAAoB,GAAG;EAClCJ,MAAM,EAAE,CAAC,CAAS;EAClBC,SAAS,EAAEN,UAAU;EACrB,CAACF,QAAQ,GAAG;IACVY,YAAY,EAAE,MAAM;IACpBH,IAAI,EAAE;EACR;AACF,CAAC;AAMD,OAAO,MAAMI,eAAgC,GAAG;EAC9CN,MAAM,EAAE,CAAC,CAAe;EACxBC,SAAS,EAAEP,gBAAgB;EAC3B,CAACD,QAAQ,GAAG;IACVY,YAAY,EAAE,MAAM;IACpBH,IAAI,EAAE;EACR;AACF,CAAC;AAMD,OAAO,MAAMK,gBAAkC,GAAG;EAChDP,MAAM,EAAE,CAAC,CAAgB;EACzBC,SAAS,EAAEL,iBAAiB;EAC5B,CAACH,QAAQ,GAAG;IACVY,YAAY,EAAE,MAAM;IACpBH,IAAI,EAAE;EACR;AACF,CAAC;AAED,OAAO,MAAMM,aAAa,GAAG;EAC3BC,UAAU,EAAEV,eAAe;EAC3BW,OAAO,EAAEP,YAAY;EACrBQ,IAAI,EAAEP,SAAS;EACfQ,UAAU,EAAEN,eAAe;EAC3BO,WAAW,EAAEN,gBAAgB;EAC7B,CAACd,QAAQ,GAAG;IACVqB,OAAO,EAAE;EACX;AACF,CAAmC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- /* Generated by @palantir/pack.document-schema.type-gen@0.9.0 */
1
+ /* Generated by @palantir/pack.document-schema.type-gen@0.10.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.9.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.10.0 */\n\nimport { z } from 'zod';\n\nexport const ContainerSchema = z.object({\n tags: z.array(z.string()),\n metadata: z.record(z.string(), z.unknown()),\n});\n"],"mappings":"AAAA;;AAEA,SAASA,CAAC,QAAQ,KAAK;AAEvB,OAAO,MAAMC,eAAe,GAAGD,CAAC,CAACE,MAAM,CAAC;EACtCC,IAAI,EAAEH,CAAC,CAACI,KAAK,CAACJ,CAAC,CAACK,MAAM,CAAC,CAAC,CAAC;EACzBC,QAAQ,EAAEN,CAAC,CAACO,MAAM,CAACP,CAAC,CAACK,MAAM,CAAC,CAAC,EAAEL,CAAC,CAACQ,OAAO,CAAC,CAAC;AAC5C,CAAC,CAAC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- /* Generated by @palantir/pack.document-schema.type-gen@0.9.0 */
1
+ /* Generated by @palantir/pack.document-schema.type-gen@0.10.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.9.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.10.0 */\n\nimport { z } from 'zod';\n\nexport const FeatureSchema = z.object({\n enabled: z.boolean(),\n isPublic: z.boolean().optional(),\n flags: z.array(z.boolean()),\n});\n"],"mappings":"AAAA;;AAEA,SAASA,CAAC,QAAQ,KAAK;AAEvB,OAAO,MAAMC,aAAa,GAAGD,CAAC,CAACE,MAAM,CAAC;EACpCC,OAAO,EAAEH,CAAC,CAACI,OAAO,CAAC,CAAC;EACpBC,QAAQ,EAAEL,CAAC,CAACI,OAAO,CAAC,CAAC,CAACE,QAAQ,CAAC,CAAC;EAChCC,KAAK,EAAEP,CAAC,CAACQ,KAAK,CAACR,CAAC,CAACI,OAAO,CAAC,CAAC;AAC5B,CAAC,CAAC","ignoreList":[]}