@palantir/pack.document-schema.type-gen 0.0.1 → 0.0.2
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.
- package/build/esm/commands/ir/irDeployHandler.js.map +1 -1
- package/build/esm/commands/ir/irGenModelsHandler.js.map +1 -1
- package/build/esm/commands/ir/irGenZodHandler.js.map +1 -1
- package/build/esm/lib/pack-docschema-api/pack-docschema-api/documentTypeRid.js +2 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-api/documentTypeRid.js.map +1 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-api/fieldKey.js +2 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-api/fieldKey.js.map +1 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-api/index.js +24 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-api/index.js.map +1 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-api/interfaceTypeRid.js +2 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-api/interfaceTypeRid.js.map +1 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-api/modelTypeKey.js +2 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-api/modelTypeKey.js.map +1 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-api/objectTypeRid.js +2 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-api/objectTypeRid.js.map +1 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-api/schemaVersion.js +2 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-api/schemaVersion.js.map +1 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-api/unionVariantKey.js +2 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-api/unionVariantKey.js.map +1 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-ir/fieldDef.js +2 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-ir/fieldDef.js.map +1 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-ir/fieldTypeCollection.js +2 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-ir/fieldTypeCollection.js.map +1 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-ir/fieldTypeMap.js +2 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-ir/fieldTypeMap.js.map +1 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-ir/fieldTypeUnion.js +79 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-ir/fieldTypeUnion.js.map +1 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-ir/fieldValueDatetime.js +2 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-ir/fieldValueDatetime.js.map +1 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-ir/fieldValueDocumentRef.js +2 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-ir/fieldValueDocumentRef.js.map +1 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-ir/fieldValueDouble.js +2 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-ir/fieldValueDouble.js.map +1 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-ir/fieldValueInteger.js +2 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-ir/fieldValueInteger.js.map +1 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-ir/fieldValueMediaRef.js +2 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-ir/fieldValueMediaRef.js.map +1 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-ir/fieldValueModelRef.js +2 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-ir/fieldValueModelRef.js.map +1 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-ir/fieldValueObjectRef.js +2 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-ir/fieldValueObjectRef.js.map +1 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-ir/fieldValueString.js +2 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-ir/fieldValueString.js.map +1 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-ir/fieldValueText.js +2 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-ir/fieldValueText.js.map +1 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-ir/fieldValueUnion.js +177 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-ir/fieldValueUnion.js.map +1 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-ir/fieldValueUnmanagedJson.js +2 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-ir/fieldValueUnmanagedJson.js.map +1 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-ir/fieldValueUserRef.js +2 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-ir/fieldValueUserRef.js.map +1 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-ir/index.js +38 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-ir/index.js.map +1 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-ir/modelDef.js +51 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-ir/modelDef.js.map +1 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-ir/realTimeDocumentSchema.js +2 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-ir/realTimeDocumentSchema.js.map +1 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-ir/recordDef.js +2 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-ir/recordDef.js.map +1 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-ir/schemaMeta.js +2 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-ir/schemaMeta.js.map +1 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-ir/unionDef.js +2 -0
- package/build/esm/lib/pack-docschema-api/pack-docschema-ir/unionDef.js.map +1 -0
- package/build/esm/utils/ir/__tests__/generateZodSchemasFromIr.test.js.map +1 -1
- package/build/esm/utils/ir/generateModelsFromIr.js.map +1 -1
- package/build/esm/utils/ir/generateZodSchemasFromIr.js.map +1 -1
- package/build/esm/utils/steps/__tests__/convertStepsToIr.test.js.map +1 -1
- package/build/esm/utils/steps/convertStepsToIr.js +1 -1
- package/build/esm/utils/steps/convertStepsToIr.js.map +1 -1
- package/build/types/lib/pack-docschema-api/pack-docschema-api/documentTypeRid.d.ts +5 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-api/documentTypeRid.d.ts.map +1 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-api/fieldKey.d.ts +5 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-api/fieldKey.d.ts.map +1 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-api/index.d.ts +8 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-api/index.d.ts.map +1 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-api/interfaceTypeRid.d.ts +5 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-api/interfaceTypeRid.d.ts.map +1 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-api/modelTypeKey.d.ts +5 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-api/modelTypeKey.d.ts.map +1 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-api/objectTypeRid.d.ts +5 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-api/objectTypeRid.d.ts.map +1 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-api/schemaVersion.d.ts +5 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-api/schemaVersion.d.ts.map +1 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-api/unionVariantKey.d.ts +5 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-api/unionVariantKey.d.ts.map +1 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-ir/fieldDef.d.ts +12 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-ir/fieldDef.d.ts.map +1 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-ir/fieldTypeCollection.d.ts +6 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-ir/fieldTypeCollection.d.ts.map +1 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-ir/fieldTypeMap.d.ts +7 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-ir/fieldTypeMap.d.ts.map +1 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-ir/fieldTypeUnion.d.ts +49 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-ir/fieldTypeUnion.d.ts.map +1 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-ir/fieldValueDatetime.d.ts +3 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-ir/fieldValueDatetime.d.ts.map +1 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-ir/fieldValueDocumentRef.d.ts +5 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-ir/fieldValueDocumentRef.d.ts.map +1 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-ir/fieldValueDouble.d.ts +6 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-ir/fieldValueDouble.d.ts.map +1 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-ir/fieldValueInteger.d.ts +6 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-ir/fieldValueInteger.d.ts.map +1 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-ir/fieldValueMediaRef.d.ts +3 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-ir/fieldValueMediaRef.d.ts.map +1 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-ir/fieldValueModelRef.d.ts +5 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-ir/fieldValueModelRef.d.ts.map +1 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-ir/fieldValueObjectRef.d.ts +7 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-ir/fieldValueObjectRef.d.ts.map +1 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-ir/fieldValueString.d.ts +6 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-ir/fieldValueString.d.ts.map +1 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-ir/fieldValueText.d.ts +3 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-ir/fieldValueText.d.ts.map +1 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-ir/fieldValueUnion.d.ts +120 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-ir/fieldValueUnion.d.ts.map +1 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-ir/fieldValueUnmanagedJson.d.ts +3 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-ir/fieldValueUnmanagedJson.d.ts.map +1 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-ir/fieldValueUserRef.d.ts +3 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-ir/fieldValueUserRef.d.ts.map +1 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-ir/index.d.ts +22 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-ir/index.d.ts.map +1 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-ir/modelDef.d.ts +30 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-ir/modelDef.d.ts.map +1 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-ir/realTimeDocumentSchema.d.ts +14 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-ir/realTimeDocumentSchema.d.ts.map +1 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-ir/recordDef.d.ts +11 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-ir/recordDef.d.ts.map +1 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-ir/schemaMeta.d.ts +7 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-ir/schemaMeta.d.ts.map +1 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-ir/unionDef.d.ts +15 -0
- package/build/types/lib/pack-docschema-api/pack-docschema-ir/unionDef.d.ts.map +1 -0
- package/build/types/utils/ir/generateModelsFromIr.d.ts +1 -1
- package/build/types/utils/ir/generateModelsFromIr.d.ts.map +1 -1
- package/build/types/utils/ir/generateZodSchemasFromIr.d.ts +1 -1
- package/build/types/utils/ir/generateZodSchemasFromIr.d.ts.map +1 -1
- package/build/types/utils/steps/convertStepsToIr.d.ts +2 -2
- package/build/types/utils/steps/convertStepsToIr.d.ts.map +1 -1
- package/package.json +2 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"irDeployHandler.js","names":["createPlatformClient","DocumentTypes","CommanderError","consola","readFileSync","resolve","irDeployHandler","options","irPath","ir","info","irContent","JSON","parse","osdkClient","baseUrl","Promise","auth","request","name","parentFolderRid","parentFolder","warn","create","error"],"sources":["irDeployHandler.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createPlatformClient } from \"@osdk/client\";\nimport type { CreateDocumentTypeRequest } from \"@osdk/foundry.pack\";\nimport { DocumentTypes } from \"@osdk/foundry.pack\";\nimport
|
|
1
|
+
{"version":3,"file":"irDeployHandler.js","names":["createPlatformClient","DocumentTypes","CommanderError","consola","readFileSync","resolve","irDeployHandler","options","irPath","ir","info","irContent","JSON","parse","osdkClient","baseUrl","Promise","auth","request","name","parentFolderRid","parentFolder","warn","create","error"],"sources":["irDeployHandler.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createPlatformClient } from \"@osdk/client\";\nimport type { CreateDocumentTypeRequest } 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 { IRealTimeDocumentSchema } from \"../../lib/pack-docschema-api/pack-docschema-ir\";\n\ninterface DeployOptions {\n readonly ir: string;\n readonly baseUrl: string;\n readonly auth: string;\n readonly parentFolder: string;\n}\n\nexport async function irDeployHandler(options: DeployOptions): Promise<void> {\n try {\n const irPath = resolve(options.ir);\n\n consola.info(`Reading schema from: ${irPath}`);\n\n const irContent = readFileSync(irPath, \"utf8\");\n\n // TODO: conjureToZod based validation that IR content matches the conjure IR shape\n const ir = JSON.parse(irContent) as IRealTimeDocumentSchema;\n\n const osdkClient = createPlatformClient(\n options.baseUrl,\n () => Promise.resolve(options.auth),\n );\n\n const request: CreateDocumentTypeRequest = {\n name: ir.name,\n parentFolderRid: options.parentFolder,\n };\n\n // PACK BE does not yet support storing schemas...\n consola.warn(\"Creating document type without schema information\", request);\n\n await DocumentTypes.create(osdkClient, request);\n } catch (error) {\n consola.error(\"❌ Error during Deploy:\", error);\n throw new CommanderError(1, \"ERRIRMDEPLOY\", \"Error deploying IR document schema\");\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,oBAAoB,QAAQ,cAAc;AAEnD,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,cAAc,QAAQ,WAAW;AAC1C,SAASC,OAAO,QAAQ,SAAS;AACjC,SAASC,YAAY,QAAQ,IAAI;AACjC,SAASC,OAAO,QAAQ,MAAM;AAU9B,OAAO,eAAeC,eAAeA,CAACC,OAAsB,EAAiB;EAC3E,IAAI;IACF,MAAMC,MAAM,GAAGH,OAAO,CAACE,OAAO,CAACE,EAAE,CAAC;IAElCN,OAAO,CAACO,IAAI,CAAC,wBAAwBF,MAAM,EAAE,CAAC;IAE9C,MAAMG,SAAS,GAAGP,YAAY,CAACI,MAAM,EAAE,MAAM,CAAC;;IAE9C;IACA,MAAMC,EAAE,GAAGG,IAAI,CAACC,KAAK,CAACF,SAAS,CAA4B;IAE3D,MAAMG,UAAU,GAAGd,oBAAoB,CACrCO,OAAO,CAACQ,OAAO,EACf,MAAMC,OAAO,CAACX,OAAO,CAACE,OAAO,CAACU,IAAI,CACpC,CAAC;IAED,MAAMC,OAAkC,GAAG;MACzCC,IAAI,EAAEV,EAAE,CAACU,IAAI;MACbC,eAAe,EAAEb,OAAO,CAACc;IAC3B,CAAC;;IAED;IACAlB,OAAO,CAACmB,IAAI,CAAC,mDAAmD,EAAEJ,OAAO,CAAC;IAE1E,MAAMjB,aAAa,CAACsB,MAAM,CAACT,UAAU,EAAEI,OAAO,CAAC;EACjD,CAAC,CAAC,OAAOM,KAAK,EAAE;IACdrB,OAAO,CAACqB,KAAK,CAAC,wBAAwB,EAAEA,KAAK,CAAC;IAC9C,MAAM,IAAItB,cAAc,CAAC,CAAC,EAAE,cAAc,EAAE,oCAAoC,CAAC;EACnF;AACF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"irGenModelsHandler.js","names":["CommanderError","consola","readFileSync","writeFileSync","resolve","generateModelsFromIr","irGenModelsHandler","options","schemaPath","schema","outputPath","output","info","schemaContent","JSON","parse","primaryModelKeys","length","generatedCode","typeImportPath","schemaImportPath","success","error"],"sources":["irGenModelsHandler.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
|
|
1
|
+
{"version":3,"file":"irGenModelsHandler.js","names":["CommanderError","consola","readFileSync","writeFileSync","resolve","generateModelsFromIr","irGenModelsHandler","options","schemaPath","schema","outputPath","output","info","schemaContent","JSON","parse","primaryModelKeys","length","generatedCode","typeImportPath","schemaImportPath","success","error"],"sources":["irGenModelsHandler.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 { CommanderError } from \"commander\";\nimport { consola } from \"consola\";\nimport { readFileSync, writeFileSync } from \"fs\";\nimport { resolve } from \"path\";\nimport type { IRealTimeDocumentSchema } from \"../../lib/pack-docschema-api/pack-docschema-ir\";\nimport { generateModelsFromIr } from \"../../utils/ir/generateModelsFromIr.js\";\n\ninterface ModelsGenOptions {\n readonly schema: string;\n readonly output: string;\n readonly typeImportPath?: string;\n readonly schemaImportPath?: string;\n}\n\nexport async function irGenModelsHandler(options: ModelsGenOptions): Promise<void> {\n try {\n const schemaPath = resolve(options.schema);\n const outputPath = resolve(options.output);\n\n consola.info(`Reading schema from: ${schemaPath}`);\n\n const schemaContent = readFileSync(schemaPath, \"utf8\");\n\n // TODO: conjureToZod based validation matches conjure ir\n const schema = JSON.parse(schemaContent) as IRealTimeDocumentSchema;\n\n consola.info(`Generating Model constants for ${schema.primaryModelKeys.length} model(s)...`);\n\n const generatedCode = await generateModelsFromIr(schema, {\n typeImportPath: options.typeImportPath,\n schemaImportPath: options.schemaImportPath,\n });\n\n consola.info(`Writing generated Model constants to: ${outputPath}`);\n writeFileSync(outputPath, generatedCode, \"utf8\");\n\n consola.success(\"✅ Model constants generation completed successfully\");\n } catch (error) {\n consola.error(\"❌ Error during Model constants generation:\", error);\n throw new CommanderError(1, \"ERRIRMODELS\", \"Error generating Model constants\");\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,cAAc,QAAQ,WAAW;AAC1C,SAASC,OAAO,QAAQ,SAAS;AACjC,SAASC,YAAY,EAAEC,aAAa,QAAQ,IAAI;AAChD,SAASC,OAAO,QAAQ,MAAM;AAE9B,SAASC,oBAAoB,QAAQ,wCAAwC;AAS7E,OAAO,eAAeC,kBAAkBA,CAACC,OAAyB,EAAiB;EACjF,IAAI;IACF,MAAMC,UAAU,GAAGJ,OAAO,CAACG,OAAO,CAACE,MAAM,CAAC;IAC1C,MAAMC,UAAU,GAAGN,OAAO,CAACG,OAAO,CAACI,MAAM,CAAC;IAE1CV,OAAO,CAACW,IAAI,CAAC,wBAAwBJ,UAAU,EAAE,CAAC;IAElD,MAAMK,aAAa,GAAGX,YAAY,CAACM,UAAU,EAAE,MAAM,CAAC;;IAEtD;IACA,MAAMC,MAAM,GAAGK,IAAI,CAACC,KAAK,CAACF,aAAa,CAA4B;IAEnEZ,OAAO,CAACW,IAAI,CAAC,kCAAkCH,MAAM,CAACO,gBAAgB,CAACC,MAAM,cAAc,CAAC;IAE5F,MAAMC,aAAa,GAAG,MAAMb,oBAAoB,CAACI,MAAM,EAAE;MACvDU,cAAc,EAAEZ,OAAO,CAACY,cAAc;MACtCC,gBAAgB,EAAEb,OAAO,CAACa;IAC5B,CAAC,CAAC;IAEFnB,OAAO,CAACW,IAAI,CAAC,yCAAyCF,UAAU,EAAE,CAAC;IACnEP,aAAa,CAACO,UAAU,EAAEQ,aAAa,EAAE,MAAM,CAAC;IAEhDjB,OAAO,CAACoB,OAAO,CAAC,qDAAqD,CAAC;EACxE,CAAC,CAAC,OAAOC,KAAK,EAAE;IACdrB,OAAO,CAACqB,KAAK,CAAC,4CAA4C,EAAEA,KAAK,CAAC;IAClE,MAAM,IAAItB,cAAc,CAAC,CAAC,EAAE,aAAa,EAAE,kCAAkC,CAAC;EAChF;AACF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"irGenZodHandler.js","names":["CommanderError","consola","readFileSync","writeFileSync","resolve","generateZodSchemasFromIr","irGenZodHandler","options","schemaPath","schema","outputPath","output","info","schemaContent","JSON","parse","primaryModelKeys","length","generatedCode","typeImportPath","success","error"],"sources":["irGenZodHandler.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
|
|
1
|
+
{"version":3,"file":"irGenZodHandler.js","names":["CommanderError","consola","readFileSync","writeFileSync","resolve","generateZodSchemasFromIr","irGenZodHandler","options","schemaPath","schema","outputPath","output","info","schemaContent","JSON","parse","primaryModelKeys","length","generatedCode","typeImportPath","success","error"],"sources":["irGenZodHandler.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 { CommanderError } from \"commander\";\nimport { consola } from \"consola\";\nimport { readFileSync, writeFileSync } from \"fs\";\nimport { resolve } from \"path\";\nimport type { IRealTimeDocumentSchema } from \"../../lib/pack-docschema-api/pack-docschema-ir\";\nimport { generateZodSchemasFromIr } from \"../../utils/ir/generateZodSchemasFromIr.js\";\n\ninterface ZodGenOptions {\n readonly schema: string;\n readonly output: string;\n readonly typeImportPath?: string;\n}\n\nexport async function irGenZodHandler(options: ZodGenOptions): Promise<void> {\n try {\n const schemaPath = resolve(options.schema);\n const outputPath = resolve(options.output);\n\n consola.info(`Reading schema from: ${schemaPath}`);\n\n const schemaContent = readFileSync(schemaPath, \"utf8\");\n\n // TODO: conjureToZod based validation matches conjure ir\n const schema = JSON.parse(schemaContent) as IRealTimeDocumentSchema;\n\n consola.info(`Generating Zod schemas for ${schema.primaryModelKeys.length} model(s)...`);\n\n const generatedCode = await generateZodSchemasFromIr(schema, {\n typeImportPath: options.typeImportPath,\n });\n\n consola.info(`Writing generated Zod schemas to: ${outputPath}`);\n writeFileSync(outputPath, generatedCode, \"utf8\");\n\n consola.success(\"✅ Zod schema generation completed successfully\");\n } catch (error) {\n consola.error(\"❌ Error during Zod schema generation:\", error);\n throw new CommanderError(1, \"ERRIRZOD\", \"Error generating Zod schemas\");\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,cAAc,QAAQ,WAAW;AAC1C,SAASC,OAAO,QAAQ,SAAS;AACjC,SAASC,YAAY,EAAEC,aAAa,QAAQ,IAAI;AAChD,SAASC,OAAO,QAAQ,MAAM;AAE9B,SAASC,wBAAwB,QAAQ,4CAA4C;AAQrF,OAAO,eAAeC,eAAeA,CAACC,OAAsB,EAAiB;EAC3E,IAAI;IACF,MAAMC,UAAU,GAAGJ,OAAO,CAACG,OAAO,CAACE,MAAM,CAAC;IAC1C,MAAMC,UAAU,GAAGN,OAAO,CAACG,OAAO,CAACI,MAAM,CAAC;IAE1CV,OAAO,CAACW,IAAI,CAAC,wBAAwBJ,UAAU,EAAE,CAAC;IAElD,MAAMK,aAAa,GAAGX,YAAY,CAACM,UAAU,EAAE,MAAM,CAAC;;IAEtD;IACA,MAAMC,MAAM,GAAGK,IAAI,CAACC,KAAK,CAACF,aAAa,CAA4B;IAEnEZ,OAAO,CAACW,IAAI,CAAC,8BAA8BH,MAAM,CAACO,gBAAgB,CAACC,MAAM,cAAc,CAAC;IAExF,MAAMC,aAAa,GAAG,MAAMb,wBAAwB,CAACI,MAAM,EAAE;MAC3DU,cAAc,EAAEZ,OAAO,CAACY;IAC1B,CAAC,CAAC;IAEFlB,OAAO,CAACW,IAAI,CAAC,qCAAqCF,UAAU,EAAE,CAAC;IAC/DP,aAAa,CAACO,UAAU,EAAEQ,aAAa,EAAE,MAAM,CAAC;IAEhDjB,OAAO,CAACmB,OAAO,CAAC,gDAAgD,CAAC;EACnE,CAAC,CAAC,OAAOC,KAAK,EAAE;IACdpB,OAAO,CAACoB,KAAK,CAAC,uCAAuC,EAAEA,KAAK,CAAC;IAC7D,MAAM,IAAIrB,cAAc,CAAC,CAAC,EAAE,UAAU,EAAE,8BAA8B,CAAC;EACzE;AACF","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"documentTypeRid.js","names":[],"sources":["documentTypeRid.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 type IDocumentTypeRid = string & {\n __conjure_type?: \"DocumentTypeRid\";\n __conjure_package?: \"com.palantir.pack.docschema.api\";\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fieldKey.js","names":[],"sources":["fieldKey.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 type IFieldKey = string & {\n __conjure_type?: \"FieldKey\";\n __conjure_package?: \"com.palantir.pack.docschema.api\";\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
export * from "./documentTypeRid";
|
|
18
|
+
export * from "./fieldKey";
|
|
19
|
+
export * from "./interfaceTypeRid";
|
|
20
|
+
export * from "./modelTypeKey";
|
|
21
|
+
export * from "./objectTypeRid";
|
|
22
|
+
export * from "./schemaVersion";
|
|
23
|
+
export * from "./unionVariantKey";
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"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 * from \"./documentTypeRid\";\nexport * from \"./fieldKey\";\nexport * from \"./interfaceTypeRid\";\nexport * from \"./modelTypeKey\";\nexport * from \"./objectTypeRid\";\nexport * from \"./schemaVersion\";\nexport * from \"./unionVariantKey\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,cAAc,mBAAmB;AACjC,cAAc,YAAY;AAC1B,cAAc,oBAAoB;AAClC,cAAc,gBAAgB;AAC9B,cAAc,iBAAiB;AAC/B,cAAc,iBAAiB;AAC/B,cAAc,mBAAmB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaceTypeRid.js","names":[],"sources":["interfaceTypeRid.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 type IInterfaceTypeRid = string & {\n __conjure_type?: \"InterfaceTypeRid\";\n __conjure_package?: \"com.palantir.pack.docschema.api\";\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modelTypeKey.js","names":[],"sources":["modelTypeKey.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 type IModelTypeKey = string & {\n __conjure_type?: \"ModelTypeKey\";\n __conjure_package?: \"com.palantir.pack.docschema.api\";\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"objectTypeRid.js","names":[],"sources":["objectTypeRid.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 type IObjectTypeRid = string & {\n __conjure_type?: \"ObjectTypeRid\";\n __conjure_package?: \"com.palantir.pack.docschema.api\";\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemaVersion.js","names":[],"sources":["schemaVersion.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 type ISchemaVersion = number & {\n __conjure_type?: \"SchemaVersion\";\n __conjure_package?: \"com.palantir.pack.docschema.api\";\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unionVariantKey.js","names":[],"sources":["unionVariantKey.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 type IUnionVariantKey = string & {\n __conjure_type?: \"UnionVariantKey\";\n __conjure_package?: \"com.palantir.pack.docschema.api\";\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fieldDef.js","names":[],"sources":["fieldDef.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { IFieldKey } from \"../pack-docschema-api/fieldKey\";\nimport type * as IFieldTypeUnion from \"./fieldTypeUnion\";\nimport type { ISchemaMeta } from \"./schemaMeta\";\nexport interface IFieldDef {\n readonly \"key\": IFieldKey;\n readonly \"name\": string;\n readonly \"description\"?: string | null;\n readonly \"isOptional\"?: boolean | null;\n readonly \"value\": IFieldTypeUnion.IFieldTypeUnion;\n readonly \"meta\": ISchemaMeta;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fieldTypeCollection.js","names":[],"sources":["fieldTypeCollection.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type * as IFieldValueUnion from \"./fieldValueUnion\";\nexport interface IFieldTypeCollection {\n readonly \"allowNullValue\": boolean;\n readonly \"value\": IFieldValueUnion.IFieldValueUnion;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fieldTypeMap.js","names":[],"sources":["fieldTypeMap.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type * as IFieldValueUnion from \"./fieldValueUnion\";\n\nexport interface IFieldTypeMap {\n readonly \"allowNullValue\": boolean;\n readonly \"key\": IFieldValueUnion.IFieldValueUnion;\n readonly \"value\": IFieldValueUnion.IFieldValueUnion;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,79 @@
|
|
|
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
|
+
function isArray(obj) {
|
|
18
|
+
return obj.type === "array";
|
|
19
|
+
}
|
|
20
|
+
function array(obj) {
|
|
21
|
+
return {
|
|
22
|
+
array: obj,
|
|
23
|
+
type: "array"
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function isMap(obj) {
|
|
27
|
+
return obj.type === "map";
|
|
28
|
+
}
|
|
29
|
+
function map(obj) {
|
|
30
|
+
return {
|
|
31
|
+
map: obj,
|
|
32
|
+
type: "map"
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function isSet(obj) {
|
|
36
|
+
return obj.type === "set";
|
|
37
|
+
}
|
|
38
|
+
function set(obj) {
|
|
39
|
+
return {
|
|
40
|
+
set: obj,
|
|
41
|
+
type: "set"
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function isValue(obj) {
|
|
45
|
+
return obj.type === "value";
|
|
46
|
+
}
|
|
47
|
+
function value(obj) {
|
|
48
|
+
return {
|
|
49
|
+
value: obj,
|
|
50
|
+
type: "value"
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function visit(obj, visitor) {
|
|
54
|
+
if (isArray(obj)) {
|
|
55
|
+
return visitor.array(obj.array);
|
|
56
|
+
}
|
|
57
|
+
if (isMap(obj)) {
|
|
58
|
+
return visitor.map(obj.map);
|
|
59
|
+
}
|
|
60
|
+
if (isSet(obj)) {
|
|
61
|
+
return visitor.set(obj.set);
|
|
62
|
+
}
|
|
63
|
+
if (isValue(obj)) {
|
|
64
|
+
return visitor.value(obj.value);
|
|
65
|
+
}
|
|
66
|
+
return visitor.unknown(obj);
|
|
67
|
+
}
|
|
68
|
+
export const IFieldTypeUnion = {
|
|
69
|
+
isArray: isArray,
|
|
70
|
+
array: array,
|
|
71
|
+
isMap: isMap,
|
|
72
|
+
map: map,
|
|
73
|
+
isSet: isSet,
|
|
74
|
+
set: set,
|
|
75
|
+
isValue: isValue,
|
|
76
|
+
value: value,
|
|
77
|
+
visit: visit
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=fieldTypeUnion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fieldTypeUnion.js","names":["isArray","obj","type","array","isMap","map","isSet","set","isValue","value","visit","visitor","unknown","IFieldTypeUnion"],"sources":["fieldTypeUnion.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 { IFieldTypeCollection } from \"./fieldTypeCollection\";\nimport type { IFieldTypeMap } from \"./fieldTypeMap\";\nimport type * as IFieldValueUnion from \"./fieldValueUnion\";\n\nexport interface IFieldTypeUnion_Array {\n readonly \"array\": IFieldTypeCollection;\n readonly \"type\": \"array\";\n}\n\nexport interface IFieldTypeUnion_Map {\n readonly \"map\": IFieldTypeMap;\n readonly \"type\": \"map\";\n}\n\nexport interface IFieldTypeUnion_Set {\n readonly \"set\": IFieldTypeCollection;\n readonly \"type\": \"set\";\n}\n\nexport interface IFieldTypeUnion_Value {\n readonly \"value\": IFieldValueUnion.IFieldValueUnion;\n readonly \"type\": \"value\";\n}\n\nexport type IFieldTypeUnion =\n | IFieldTypeUnion_Array\n | IFieldTypeUnion_Map\n | IFieldTypeUnion_Set\n | IFieldTypeUnion_Value;\n\nexport interface IFieldTypeUnionVisitor<T> {\n readonly \"array\": (obj: IFieldTypeCollection) => T;\n readonly \"map\": (obj: IFieldTypeMap) => T;\n readonly \"set\": (obj: IFieldTypeCollection) => T;\n readonly \"value\": (obj: IFieldValueUnion.IFieldValueUnion) => T;\n readonly \"unknown\": (obj: IFieldTypeUnion) => T;\n}\n\nfunction isArray(obj: IFieldTypeUnion): obj is IFieldTypeUnion_Array {\n return (obj.type === \"array\");\n}\n\nfunction array(obj: IFieldTypeCollection): IFieldTypeUnion_Array {\n return {\n array: obj,\n type: \"array\",\n };\n}\n\nfunction isMap(obj: IFieldTypeUnion): obj is IFieldTypeUnion_Map {\n return (obj.type === \"map\");\n}\n\nfunction map(obj: IFieldTypeMap): IFieldTypeUnion_Map {\n return {\n map: obj,\n type: \"map\",\n };\n}\n\nfunction isSet(obj: IFieldTypeUnion): obj is IFieldTypeUnion_Set {\n return (obj.type === \"set\");\n}\n\nfunction set(obj: IFieldTypeCollection): IFieldTypeUnion_Set {\n return {\n set: obj,\n type: \"set\",\n };\n}\n\nfunction isValue(obj: IFieldTypeUnion): obj is IFieldTypeUnion_Value {\n return (obj.type === \"value\");\n}\n\nfunction value(obj: IFieldValueUnion.IFieldValueUnion): IFieldTypeUnion_Value {\n return {\n value: obj,\n type: \"value\",\n };\n}\n\nfunction visit<T>(obj: IFieldTypeUnion, visitor: IFieldTypeUnionVisitor<T>): T {\n if (isArray(obj)) {\n return visitor.array(obj.array);\n }\n if (isMap(obj)) {\n return visitor.map(obj.map);\n }\n if (isSet(obj)) {\n return visitor.set(obj.set);\n }\n if (isValue(obj)) {\n return visitor.value(obj.value);\n }\n return visitor.unknown(obj);\n}\n\nexport const IFieldTypeUnion: {\n isArray: typeof isArray;\n array: typeof array;\n isMap: typeof isMap;\n map: typeof map;\n isSet: typeof isSet;\n set: typeof set;\n isValue: typeof isValue;\n value: typeof value;\n visit: typeof visit;\n} = {\n isArray: isArray,\n array: array,\n isMap: isMap,\n map: map,\n isSet: isSet,\n set: set,\n isValue: isValue,\n value: value,\n visit: visit,\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAwCA,SAASA,OAAOA,CAACC,GAAoB,EAAgC;EACnE,OAAQA,GAAG,CAACC,IAAI,KAAK,OAAO;AAC9B;AAEA,SAASC,KAAKA,CAACF,GAAyB,EAAyB;EAC/D,OAAO;IACLE,KAAK,EAAEF,GAAG;IACVC,IAAI,EAAE;EACR,CAAC;AACH;AAEA,SAASE,KAAKA,CAACH,GAAoB,EAA8B;EAC/D,OAAQA,GAAG,CAACC,IAAI,KAAK,KAAK;AAC5B;AAEA,SAASG,GAAGA,CAACJ,GAAkB,EAAuB;EACpD,OAAO;IACLI,GAAG,EAAEJ,GAAG;IACRC,IAAI,EAAE;EACR,CAAC;AACH;AAEA,SAASI,KAAKA,CAACL,GAAoB,EAA8B;EAC/D,OAAQA,GAAG,CAACC,IAAI,KAAK,K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["fieldValueDatetime.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 interface IFieldValueDatetime {\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fieldValueDocumentRef.js","names":[],"sources":["fieldValueDocumentRef.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 { IDocumentTypeRid } from \"../pack-docschema-api/documentTypeRid\";\nexport interface IFieldValueDocumentRef {\n readonly \"documentTypeRids\": ReadonlyArray<IDocumentTypeRid>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fieldValueDouble.js","names":[],"sources":["fieldValueDouble.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 interface IFieldValueDouble {\n readonly \"defaultValue\"?: number | \"NaN\" | null;\n readonly \"minValue\"?: number | \"NaN\" | null;\n readonly \"maxValue\"?: number | \"NaN\" | null;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fieldValueInteger.js","names":[],"sources":["fieldValueInteger.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 interface IFieldValueInteger {\n readonly \"defaultValue\"?: number | null;\n readonly \"minValue\"?: number | null;\n readonly \"maxValue\"?: number | null;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fieldValueMediaRef.js","names":[],"sources":["fieldValueMediaRef.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 interface IFieldValueMediaRef {\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fieldValueModelRef.js","names":[],"sources":["fieldValueModelRef.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 { IModelTypeKey } from \"../pack-docschema-api/modelTypeKey\";\nexport interface IFieldValueModelRef {\n readonly \"modelTypes\": ReadonlyArray<IModelTypeKey>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fieldValueObjectRef.js","names":[],"sources":["fieldValueObjectRef.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 { IInterfaceTypeRid } from \"../pack-docschema-api/interfaceTypeRid\";\nimport type { IObjectTypeRid } from \"../pack-docschema-api/objectTypeRid\";\nexport interface IFieldValueObjectRef {\n readonly \"interfaceTypeRids\": ReadonlyArray<IInterfaceTypeRid>;\n readonly \"objectTypeRids\": ReadonlyArray<IObjectTypeRid>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fieldValueString.js","names":[],"sources":["fieldValueString.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 interface IFieldValueString {\n readonly \"defaultValue\"?: string | null;\n readonly \"minLength\"?: number | null;\n readonly \"maxLength\"?: number | null;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fieldValueText.js","names":[],"sources":["fieldValueText.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 interface IFieldValueText {\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,177 @@
|
|
|
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
|
+
function isDatetime(obj) {
|
|
18
|
+
return obj.type === "datetime";
|
|
19
|
+
}
|
|
20
|
+
function datetime(obj) {
|
|
21
|
+
return {
|
|
22
|
+
datetime: obj,
|
|
23
|
+
type: "datetime"
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function isDocRef(obj) {
|
|
27
|
+
return obj.type === "docRef";
|
|
28
|
+
}
|
|
29
|
+
function docRef(obj) {
|
|
30
|
+
return {
|
|
31
|
+
docRef: obj,
|
|
32
|
+
type: "docRef"
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function isDouble(obj) {
|
|
36
|
+
return obj.type === "double";
|
|
37
|
+
}
|
|
38
|
+
function double(obj) {
|
|
39
|
+
return {
|
|
40
|
+
double: obj,
|
|
41
|
+
type: "double"
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function isInteger(obj) {
|
|
45
|
+
return obj.type === "integer";
|
|
46
|
+
}
|
|
47
|
+
function integer(obj) {
|
|
48
|
+
return {
|
|
49
|
+
integer: obj,
|
|
50
|
+
type: "integer"
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function isMediaRef(obj) {
|
|
54
|
+
return obj.type === "mediaRef";
|
|
55
|
+
}
|
|
56
|
+
function mediaRef(obj) {
|
|
57
|
+
return {
|
|
58
|
+
mediaRef: obj,
|
|
59
|
+
type: "mediaRef"
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
function isModelRef(obj) {
|
|
63
|
+
return obj.type === "modelRef";
|
|
64
|
+
}
|
|
65
|
+
function modelRef(obj) {
|
|
66
|
+
return {
|
|
67
|
+
modelRef: obj,
|
|
68
|
+
type: "modelRef"
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function isObject(obj) {
|
|
72
|
+
return obj.type === "object";
|
|
73
|
+
}
|
|
74
|
+
function object(obj) {
|
|
75
|
+
return {
|
|
76
|
+
object: obj,
|
|
77
|
+
type: "object"
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
function isString(obj) {
|
|
81
|
+
return obj.type === "string";
|
|
82
|
+
}
|
|
83
|
+
function string(obj) {
|
|
84
|
+
return {
|
|
85
|
+
string: obj,
|
|
86
|
+
type: "string"
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
function isText(obj) {
|
|
90
|
+
return obj.type === "text";
|
|
91
|
+
}
|
|
92
|
+
function text(obj) {
|
|
93
|
+
return {
|
|
94
|
+
text: obj,
|
|
95
|
+
type: "text"
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
function isUnmanagedJson(obj) {
|
|
99
|
+
return obj.type === "unmanagedJson";
|
|
100
|
+
}
|
|
101
|
+
function unmanagedJson(obj) {
|
|
102
|
+
return {
|
|
103
|
+
unmanagedJson: obj,
|
|
104
|
+
type: "unmanagedJson"
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
function isUserRef(obj) {
|
|
108
|
+
return obj.type === "userRef";
|
|
109
|
+
}
|
|
110
|
+
function userRef(obj) {
|
|
111
|
+
return {
|
|
112
|
+
userRef: obj,
|
|
113
|
+
type: "userRef"
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
function visit(obj, visitor) {
|
|
117
|
+
if (isDatetime(obj)) {
|
|
118
|
+
return visitor.datetime(obj.datetime);
|
|
119
|
+
}
|
|
120
|
+
if (isDocRef(obj)) {
|
|
121
|
+
return visitor.docRef(obj.docRef);
|
|
122
|
+
}
|
|
123
|
+
if (isDouble(obj)) {
|
|
124
|
+
return visitor.double(obj.double);
|
|
125
|
+
}
|
|
126
|
+
if (isInteger(obj)) {
|
|
127
|
+
return visitor.integer(obj.integer);
|
|
128
|
+
}
|
|
129
|
+
if (isMediaRef(obj)) {
|
|
130
|
+
return visitor.mediaRef(obj.mediaRef);
|
|
131
|
+
}
|
|
132
|
+
if (isModelRef(obj)) {
|
|
133
|
+
return visitor.modelRef(obj.modelRef);
|
|
134
|
+
}
|
|
135
|
+
if (isObject(obj)) {
|
|
136
|
+
return visitor.object(obj.object);
|
|
137
|
+
}
|
|
138
|
+
if (isString(obj)) {
|
|
139
|
+
return visitor.string(obj.string);
|
|
140
|
+
}
|
|
141
|
+
if (isText(obj)) {
|
|
142
|
+
return visitor.text(obj.text);
|
|
143
|
+
}
|
|
144
|
+
if (isUnmanagedJson(obj)) {
|
|
145
|
+
return visitor.unmanagedJson(obj.unmanagedJson);
|
|
146
|
+
}
|
|
147
|
+
if (isUserRef(obj)) {
|
|
148
|
+
return visitor.userRef(obj.userRef);
|
|
149
|
+
}
|
|
150
|
+
return visitor.unknown(obj);
|
|
151
|
+
}
|
|
152
|
+
export const IFieldValueUnion = {
|
|
153
|
+
isDatetime: isDatetime,
|
|
154
|
+
datetime: datetime,
|
|
155
|
+
isDocRef: isDocRef,
|
|
156
|
+
docRef: docRef,
|
|
157
|
+
isDouble: isDouble,
|
|
158
|
+
double: double,
|
|
159
|
+
isInteger: isInteger,
|
|
160
|
+
integer: integer,
|
|
161
|
+
isMediaRef: isMediaRef,
|
|
162
|
+
mediaRef: mediaRef,
|
|
163
|
+
isModelRef: isModelRef,
|
|
164
|
+
modelRef: modelRef,
|
|
165
|
+
isObject: isObject,
|
|
166
|
+
object: object,
|
|
167
|
+
isString: isString,
|
|
168
|
+
string: string,
|
|
169
|
+
isText: isText,
|
|
170
|
+
text: text,
|
|
171
|
+
isUnmanagedJson: isUnmanagedJson,
|
|
172
|
+
unmanagedJson: unmanagedJson,
|
|
173
|
+
isUserRef: isUserRef,
|
|
174
|
+
userRef: userRef,
|
|
175
|
+
visit: visit
|
|
176
|
+
};
|
|
177
|
+
//# sourceMappingURL=fieldValueUnion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fieldValueUnion.js","names":["isDatetime","obj","type","datetime","isDocRef","docRef","isDouble","double","isInteger","integer","isMediaRef","mediaRef","isModelRef","modelRef","isObject","object","isString","string","isText","text","isUnmanagedJson","unmanagedJson","isUserRef","userRef","visit","visitor","unknown","IFieldValueUnion"],"sources":["fieldValueUnion.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 { IFieldValueDatetime } from \"./fieldValueDatetime\";\nimport type { IFieldValueDocumentRef } from \"./fieldValueDocumentRef\";\nimport type { IFieldValueDouble } from \"./fieldValueDouble\";\nimport type { IFieldValueInteger } from \"./fieldValueInteger\";\nimport type { IFieldValueMediaRef } from \"./fieldValueMediaRef\";\nimport type { IFieldValueModelRef } from \"./fieldValueModelRef\";\nimport type { IFieldValueObjectRef } from \"./fieldValueObjectRef\";\nimport type { IFieldValueString } from \"./fieldValueString\";\nimport type { IFieldValueText } from \"./fieldValueText\";\nimport type { IFieldValueUnmanagedJson } from \"./fieldValueUnmanagedJson\";\nimport type { IFieldValueUserRef } from \"./fieldValueUserRef\";\n\nexport interface IFieldValueUnion_Datetime {\n readonly \"datetime\": IFieldValueDatetime;\n readonly \"type\": \"datetime\";\n}\n\nexport interface IFieldValueUnion_DocRef {\n readonly \"docRef\": IFieldValueDocumentRef;\n readonly \"type\": \"docRef\";\n}\n\nexport interface IFieldValueUnion_Double {\n readonly \"double\": IFieldValueDouble;\n readonly \"type\": \"double\";\n}\n\nexport interface IFieldValueUnion_Integer {\n readonly \"integer\": IFieldValueInteger;\n readonly \"type\": \"integer\";\n}\n\nexport interface IFieldValueUnion_MediaRef {\n readonly \"mediaRef\": IFieldValueMediaRef;\n readonly \"type\": \"mediaRef\";\n}\n\nexport interface IFieldValueUnion_ModelRef {\n readonly \"modelRef\": IFieldValueModelRef;\n readonly \"type\": \"modelRef\";\n}\n\nexport interface IFieldValueUnion_Object {\n readonly \"object\": IFieldValueObjectRef;\n readonly \"type\": \"object\";\n}\n\nexport interface IFieldValueUnion_String {\n readonly \"string\": IFieldValueString;\n readonly \"type\": \"string\";\n}\n\nexport interface IFieldValueUnion_Text {\n readonly \"text\": IFieldValueText;\n readonly \"type\": \"text\";\n}\n\nexport interface IFieldValueUnion_UnmanagedJson {\n readonly \"unmanagedJson\": IFieldValueUnmanagedJson;\n readonly \"type\": \"unmanagedJson\";\n}\n\nexport interface IFieldValueUnion_UserRef {\n readonly \"userRef\": IFieldValueUserRef;\n readonly \"type\": \"userRef\";\n}\n\nexport type IFieldValueUnion =\n | IFieldValueUnion_Datetime\n | IFieldValueUnion_DocRef\n | IFieldValueUnion_Double\n | IFieldValueUnion_Integer\n | IFieldValueUnion_MediaRef\n | IFieldValueUnion_ModelRef\n | IFieldValueUnion_Object\n | IFieldValueUnion_String\n | IFieldValueUnion_Text\n | IFieldValueUnion_UnmanagedJson\n | IFieldValueUnion_UserRef;\n\nexport interface IFieldValueUnionVisitor<T> {\n readonly \"datetime\": (obj: IFieldValueDatetime) => T;\n readonly \"docRef\": (obj: IFieldValueDocumentRef) => T;\n readonly \"double\": (obj: IFieldValueDouble) => T;\n readonly \"integer\": (obj: IFieldValueInteger) => T;\n readonly \"mediaRef\": (obj: IFieldValueMediaRef) => T;\n readonly \"modelRef\": (obj: IFieldValueModelRef) => T;\n readonly \"object\": (obj: IFieldValueObjectRef) => T;\n readonly \"string\": (obj: IFieldValueString) => T;\n readonly \"text\": (obj: IFieldValueText) => T;\n readonly \"unmanagedJson\": (obj: IFieldValueUnmanagedJson) => T;\n readonly \"userRef\": (obj: IFieldValueUserRef) => T;\n readonly \"unknown\": (obj: IFieldValueUnion) => T;\n}\n\nfunction isDatetime(obj: IFieldValueUnion): obj is IFieldValueUnion_Datetime {\n return (obj.type === \"datetime\");\n}\n\nfunction datetime(obj: IFieldValueDatetime): IFieldValueUnion_Datetime {\n return {\n datetime: obj,\n type: \"datetime\",\n };\n}\n\nfunction isDocRef(obj: IFieldValueUnion): obj is IFieldValueUnion_DocRef {\n return (obj.type === \"docRef\");\n}\n\nfunction docRef(obj: IFieldValueDocumentRef): IFieldValueUnion_DocRef {\n return {\n docRef: obj,\n type: \"docRef\",\n };\n}\n\nfunction isDouble(obj: IFieldValueUnion): obj is IFieldValueUnion_Double {\n return (obj.type === \"double\");\n}\n\nfunction double(obj: IFieldValueDouble): IFieldValueUnion_Double {\n return {\n double: obj,\n type: \"double\",\n };\n}\n\nfunction isInteger(obj: IFieldValueUnion): obj is IFieldValueUnion_Integer {\n return (obj.type === \"integer\");\n}\n\nfunction integer(obj: IFieldValueInteger): IFieldValueUnion_Integer {\n return {\n integer: obj,\n type: \"integer\",\n };\n}\n\nfunction isMediaRef(obj: IFieldValueUnion): obj is IFieldValueUnion_MediaRef {\n return (obj.type === \"mediaRef\");\n}\n\nfunction mediaRef(obj: IFieldValueMediaRef): IFieldValueUnion_MediaRef {\n return {\n mediaRef: obj,\n type: \"mediaRef\",\n };\n}\n\nfunction isModelRef(obj: IFieldValueUnion): obj is IFieldValueUnion_ModelRef {\n return (obj.type === \"modelRef\");\n}\n\nfunction modelRef(obj: IFieldValueModelRef): IFieldValueUnion_ModelRef {\n return {\n modelRef: obj,\n type: \"modelRef\",\n };\n}\n\nfunction isObject(obj: IFieldValueUnion): obj is IFieldValueUnion_Object {\n return (obj.type === \"object\");\n}\n\nfunction object(obj: IFieldValueObjectRef): IFieldValueUnion_Object {\n return {\n object: obj,\n type: \"object\",\n };\n}\n\nfunction isString(obj: IFieldValueUnion): obj is IFieldValueUnion_String {\n return (obj.type === \"string\");\n}\n\nfunction string(obj: IFieldValueString): IFieldValueUnion_String {\n return {\n string: obj,\n type: \"string\",\n };\n}\n\nfunction isText(obj: IFieldValueUnion): obj is IFieldValueUnion_Text {\n return (obj.type === \"text\");\n}\n\nfunction text(obj: IFieldValueText): IFieldValueUnion_Text {\n return {\n text: obj,\n type: \"text\",\n };\n}\n\nfunction isUnmanagedJson(obj: IFieldValueUnion): obj is IFieldValueUnion_UnmanagedJson {\n return (obj.type === \"unmanagedJson\");\n}\n\nfunction unmanagedJson(obj: IFieldValueUnmanagedJson): IFieldValueUnion_UnmanagedJson {\n return {\n unmanagedJson: obj,\n type: \"unmanagedJson\",\n };\n}\n\nfunction isUserRef(obj: IFieldValueUnion): obj is IFieldValueUnion_UserRef {\n return (obj.type === \"userRef\");\n}\n\nfunction userRef(obj: IFieldValueUserRef): IFieldValueUnion_UserRef {\n return {\n userRef: obj,\n type: \"userRef\",\n };\n}\n\nfunction visit<T>(obj: IFieldValueUnion, visitor: IFieldValueUnionVisitor<T>): T {\n if (isDatetime(obj)) {\n return visitor.datetime(obj.datetime);\n }\n if (isDocRef(obj)) {\n return visitor.docRef(obj.docRef);\n }\n if (isDouble(obj)) {\n return visitor.double(obj.double);\n }\n if (isInteger(obj)) {\n return visitor.integer(obj.integer);\n }\n if (isMediaRef(obj)) {\n return visitor.mediaRef(obj.mediaRef);\n }\n if (isModelRef(obj)) {\n return visitor.modelRef(obj.modelRef);\n }\n if (isObject(obj)) {\n return visitor.object(obj.object);\n }\n if (isString(obj)) {\n return visitor.string(obj.string);\n }\n if (isText(obj)) {\n return visitor.text(obj.text);\n }\n if (isUnmanagedJson(obj)) {\n return visitor.unmanagedJson(obj.unmanagedJson);\n }\n if (isUserRef(obj)) {\n return visitor.userRef(obj.userRef);\n }\n return visitor.unknown(obj);\n}\n\nexport const IFieldValueUnion: {\n isDatetime: typeof isDatetime;\n datetime: typeof datetime;\n isDocRef: typeof isDocRef;\n docRef: typeof docRef;\n isDouble: typeof isDouble;\n double: typeof double;\n isInteger: typeof isInteger;\n integer: typeof integer;\n isMediaRef: typeof isMediaRef;\n mediaRef: typeof mediaRef;\n isModelRef: typeof isModelRef;\n modelRef: typeof modelRef;\n isObject: typeof isObject;\n object: typeof object;\n isString: typeof isString;\n string: typeof string;\n isText: typeof isText;\n text: typeof text;\n isUnmanagedJson: typeof isUnmanagedJson;\n unmanagedJson: typeof unmanagedJson;\n isUserRef: typeof isUserRef;\n userRef: typeof userRef;\n visit: typeof visit;\n} = {\n isDatetime: isDatetime,\n datetime: datetime,\n isDocRef: isDocRef,\n docRef: docRef,\n isDouble: isDouble,\n double: double,\n isInteger: isInteger,\n integer: integer,\n isMediaRef: isMediaRef,\n mediaRef: mediaRef,\n isModelRef: isModelRef,\n modelRef: modelRef,\n isObject: isObject,\n object: object,\n isString: isString,\n string: string,\n isText: isText,\n text: text,\n isUnmanagedJson: isUnmanagedJson,\n unmanagedJson: unmanagedJson,\n isUserRef: isUserRef,\n userRef: userRef,\n visit: visit,\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAiGA,SAASA,UAAUA,CAACC,GAAqB,EAAoC;EAC3E,OAAQA,GAAG,CAACC,IAAI,KAAK,UAAU;AACjC;AAEA,SAASC,QAAQA,CAACF,GAAwB,EAA6B;EACrE,OAAO;IACLE,QAAQ,EAAEF,GAAG;IACbC,IAAI,EAAE;EACR,CAAC;AACH;AAEA,SAASE,QAAQA,CAACH,GAAqB,EAAkC;EACvE,OAAQA,GAAG,CAACC,IAAI,KAAK,QAAQ;AAC/B;AAEA,SAASG,MAAMA,CAACJ,GAA2B,EAA2B;EACpE,OAAO;IACLI,MAAM,EAAEJ,GAAG;IACXC,IAAI,EAAE;EACR,CAAC;AACH;AAEA,SAASI,QAAQA,CAACL,GAAqB,EAAkC;EACvE,OAAQA,GAAG,CAACC,IAAI,KAAK,QAAQ;AAC/B;AAEA,SAASK,MAAMA,CAACN,GAAsB,EAA2B;EAC/D,OAAO;IACLM,MAAM,EAAEN,GA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ACT,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fieldValueUnmanagedJson.js","names":[],"sources":["fieldValueUnmanagedJson.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 interface IFieldValueUnmanagedJson {\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fieldValueUserRef.js","names":[],"sources":["fieldValueUserRef.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 interface IFieldValueUserRef {\n}\n"],"mappings":"","ignoreList":[]}
|