@osdk/maker-import 0.4.0 → 0.4.1-beta.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @osdk/maker-import
2
2
 
3
+ ## 0.4.1-beta.0
4
+
5
+ ### Patch Changes
6
+
7
+ - 60aff19: Bump `@osdk/foundry.*` and `@osdk/internal.foundry.*` catalog entries from `2.57.0` to `2.61.0`. Includes type-fixups for the new `applyScenario` / `scenarioReference` discriminated-union variants and the now-required `QueryParameterV2.required` field.
8
+ - @osdk/maker@0.29.1-beta.0
9
+ - @osdk/client.unstable@2.23.1-beta.2
10
+
3
11
  ## 0.4.0
4
12
 
5
13
  ### Patch Changes
@@ -21,7 +21,7 @@ import yargs from "yargs";
21
21
  import { hideBin } from "yargs/helpers";
22
22
  import { writeImportedOntology } from "../generate/writeImportedOntology.js";
23
23
  export default async function main(args = process.argv) {
24
- const commandLineOpts = await yargs(hideBin(args)).version("0.4.0" ?? "").wrap(Math.min(150, yargs().terminalWidth())).strict().help().options({
24
+ const commandLineOpts = await yargs(hideBin(args)).version("0.4.1-beta.0" ?? "").wrap(Math.min(150, yargs().terminalWidth())).strict().help().options({
25
25
  input: {
26
26
  alias: "i",
27
27
  describe: "Path to OntologyFullMetadata JSON file",
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","names":["consola","fs","path","yargs","hideBin","writeImportedOntology","main","args","process","argv","commandLineOpts","version","wrap","Math","min","terminalWidth","strict","help","options","input","alias","describe","type","demandOption","coerce","resolve","output","default","parseAsync","info","jsonContent","readFile","metadata","JSON","parse","success"],"sources":["main.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 { consola } from \"consola\";\nimport * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\nimport yargs from \"yargs\";\nimport { hideBin } from \"yargs/helpers\";\nimport { writeImportedOntology } from \"../generate/writeImportedOntology.js\";\n\nexport default async function main(\n args: string[] = process.argv,\n): Promise<void> {\n const commandLineOpts = await yargs(hideBin(args))\n .version(process.env.PACKAGE_VERSION ?? \"\")\n .wrap(Math.min(150, yargs().terminalWidth()))\n .strict()\n .help()\n .options({\n input: {\n alias: \"i\",\n describe: \"Path to OntologyFullMetadata JSON file\",\n type: \"string\",\n demandOption: true,\n coerce: path.resolve,\n },\n output: {\n alias: \"o\",\n describe: \"Output directory for generated TypeScript files\",\n type: \"string\",\n default: \"./generated-imports\",\n coerce: path.resolve,\n },\n })\n .parseAsync();\n\n consola.info(`Reading OntologyFullMetadata from ${commandLineOpts.input}`);\n\n const jsonContent = await fs.readFile(commandLineOpts.input, \"utf-8\");\n const metadata = JSON.parse(jsonContent);\n\n consola.info(`Writing generated imports to ${commandLineOpts.output}`);\n\n writeImportedOntology(metadata, commandLineOpts.output);\n\n consola.success(`Generated import files in ${commandLineOpts.output}`);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,OAAO,QAAQ,SAAS;AACjC,OAAO,KAAKC,EAAE,MAAM,kBAAkB;AACtC,OAAO,KAAKC,IAAI,MAAM,WAAW;AACjC,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,OAAO,QAAQ,eAAe;AACvC,SAASC,qBAAqB,QAAQ,sCAAsC;AAE5E,eAAe,eAAeC,IAAIA,CAChCC,IAAc,GAAGC,OAAO,CAACC,IAAI,EACd;EACf,MAAMC,eAAe,GAAG,MAAMP,KAAK,CAACC,OAAO,CAACG,IAAI,CAAC,CAAC,CAC/CI,OAAO,CAAC,WAA+B,EAAE,CAAC,CAC1CC,IAAI,CAACC,IAAI,CAACC,GAAG,CAAC,GAAG,EAAEX,KAAK,CAAC,CAAC,CAACY,aAAa,CAAC,CAAC,CAAC,CAAC,CAC5CC,MAAM,CAAC,CAAC,CACRC,IAAI,CAAC,CAAC,CACNC,OAAO,CAAC;IACPC,KAAK,EAAE;MACLC,KAAK,EAAE,GAAG;MACVC,QAAQ,EAAE,wCAAwC;MAClDC,IAAI,EAAE,QAAQ;MACdC,YAAY,EAAE,IAAI;MAClBC,MAAM,EAAEtB,IAAI,CAACuB;IACf,CAAC;IACDC,MAAM,EAAE;MACNN,KAAK,EAAE,GAAG;MACVC,QAAQ,EAAE,iDAAiD;MAC3DC,IAAI,EAAE,QAAQ;MACdK,OAAO,EAAE,qBAAqB;MAC9BH,MAAM,EAAEtB,IAAI,CAACuB;IACf;EACF,CAAC,CAAC,CACDG,UAAU,CAAC,CAAC;EAEf5B,OAAO,CAAC6B,IAAI,CAAC,qCAAqCnB,eAAe,CAACS,KAAK,EAAE,CAAC;EAE1E,MAAMW,WAAW,GAAG,MAAM7B,EAAE,CAAC8B,QAAQ,CAACrB,eAAe,CAACS,KAAK,EAAE,OAAO,CAAC;EACrE,MAAMa,QAAQ,GAAGC,IAAI,CAACC,KAAK,CAACJ,WAAW,CAAC;EAExC9B,OAAO,CAAC6B,IAAI,CAAC,gCAAgCnB,eAAe,CAACgB,MAAM,EAAE,CAAC;EAEtErB,qBAAqB,CAAC2B,QAAQ,EAAEtB,eAAe,CAACgB,MAAM,CAAC;EAEvD1B,OAAO,CAACmC,OAAO,CAAC,6BAA6BzB,eAAe,CAACgB,MAAM,EAAE,CAAC;AACxE","ignoreList":[]}
1
+ {"version":3,"file":"main.js","names":["consola","fs","path","yargs","hideBin","writeImportedOntology","main","args","process","argv","commandLineOpts","version","wrap","Math","min","terminalWidth","strict","help","options","input","alias","describe","type","demandOption","coerce","resolve","output","default","parseAsync","info","jsonContent","readFile","metadata","JSON","parse","success"],"sources":["main.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 { consola } from \"consola\";\nimport * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\nimport yargs from \"yargs\";\nimport { hideBin } from \"yargs/helpers\";\nimport { writeImportedOntology } from \"../generate/writeImportedOntology.js\";\n\nexport default async function main(\n args: string[] = process.argv,\n): Promise<void> {\n const commandLineOpts = await yargs(hideBin(args))\n .version(process.env.PACKAGE_VERSION ?? \"\")\n .wrap(Math.min(150, yargs().terminalWidth()))\n .strict()\n .help()\n .options({\n input: {\n alias: \"i\",\n describe: \"Path to OntologyFullMetadata JSON file\",\n type: \"string\",\n demandOption: true,\n coerce: path.resolve,\n },\n output: {\n alias: \"o\",\n describe: \"Output directory for generated TypeScript files\",\n type: \"string\",\n default: \"./generated-imports\",\n coerce: path.resolve,\n },\n })\n .parseAsync();\n\n consola.info(`Reading OntologyFullMetadata from ${commandLineOpts.input}`);\n\n const jsonContent = await fs.readFile(commandLineOpts.input, \"utf-8\");\n const metadata = JSON.parse(jsonContent);\n\n consola.info(`Writing generated imports to ${commandLineOpts.output}`);\n\n writeImportedOntology(metadata, commandLineOpts.output);\n\n consola.success(`Generated import files in ${commandLineOpts.output}`);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,OAAO,QAAQ,SAAS;AACjC,OAAO,KA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,CAAC2B,QAAQ,EAAEtB,eAAe,CAACgB,MAAM,CAAC;EAEvD1B,OAAO,CAACmC,OAAO,CAAC,6BAA6BzB,eAAe,CAACgB,MAAM,EAAE,CAAC;AACxE","ignoreList":[]}
@@ -599,7 +599,7 @@ export const ${varName}: ${typeName} = wrapWithProxy(${varName}_base);
599
599
 
600
600
  // src/cli/main.ts
601
601
  async function main(args = process.argv) {
602
- const commandLineOpts = await yargs__default.default(helpers.hideBin(args)).version("0.4.0").wrap(Math.min(150, yargs__default.default().terminalWidth())).strict().help().options({
602
+ const commandLineOpts = await yargs__default.default(helpers.hideBin(args)).version("0.4.1-beta.0").wrap(Math.min(150, yargs__default.default().terminalWidth())).strict().help().options({
603
603
  input: {
604
604
  alias: "i",
605
605
  describe: "Path to OntologyFullMetadata JSON file",
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/generate/mapActionParameterType.ts","../../src/generate/utils.ts","../../src/generate/convertActionType.ts","../../src/generate/mapPropertyType.ts","../../src/generate/convertSharedPropertyType.ts","../../src/generate/convertInterfaceType.ts","../../src/generate/convertObjectType.ts","../../src/generate/writeImportedOntology.ts","../../src/cli/main.ts"],"names":["consola","OntologyEntityTypeEnum","path","fs","yargs","hideBin","path2","fs2"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,IAAM,kBAAA,GAAqB;AAAA,EACzB,MAAA,EAAQ,QAAA;AAAA,EACR,OAAA,EAAS,SAAA;AAAA,EACT,OAAA,EAAS,SAAA;AAAA,EACT,MAAA,EAAQ,QAAA;AAAA,EACR,IAAA,EAAM,MAAA;AAAA,EACN,IAAA,EAAM,MAAA;AAAA,EACN,SAAA,EAAW,WAAA;AAAA,EACX,UAAA,EAAY,YAAA;AAAA,EACZ,OAAA,EAAS,SAAA;AAAA,EACT,OAAA,EAAS,SAAA;AAAA,EACT,QAAA,EAAU,UAAA;AAAA,EACV,cAAA,EAAgB,gBAAA;AAAA,EAChB,OAAA,EAAS;AACX,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AA,qBAAA,CAAsB,QAAA,EAAU,gBAAgB,MAAM,CAAA;AACtD,EAAAA,eAAAA,CAAQ,OAAA,CAAQ,CAAA,0BAAA,EAA6B,eAAA,CAAgB,MAAM,CAAA,CAAE,CAAA;AACvE","file":"index.cjs","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 { consola } from \"consola\";\nconst SIMPLE_PARAM_TYPES = {\n string: \"string\",\n integer: \"integer\",\n boolean: \"boolean\",\n double: \"double\",\n long: \"long\",\n date: \"date\",\n timestamp: \"timestamp\",\n attachment: \"attachment\",\n marking: \"marking\",\n geohash: \"geohash\",\n geoshape: \"geoshape\",\n mediaReference: \"mediaReference\",\n decimal: \"decimal\"\n};\nconst LIST_VARIANT_MAP = {\n string: \"stringList\",\n integer: \"integerList\",\n boolean: \"booleanList\",\n double: \"doubleList\",\n long: \"longList\",\n date: \"dateList\",\n timestamp: \"timestampList\",\n attachment: \"attachmentList\",\n marking: \"markingList\",\n geohash: \"geohashList\",\n geoshape: \"geoshapeList\",\n mediaReference: \"mediaReferenceList\",\n decimal: \"decimalList\"\n};\nfunction mapStructFieldType(fieldType) {\n switch (fieldType.type) {\n case \"boolean\":\n return {\n type: \"boolean\",\n boolean: {}\n };\n case \"integer\":\n return {\n type: \"integer\",\n integer: {}\n };\n case \"long\":\n return {\n type: \"long\",\n long: {}\n };\n case \"double\":\n return {\n type: \"double\",\n double: {}\n };\n case \"string\":\n return {\n type: \"string\",\n string: {}\n };\n case \"timestamp\":\n return {\n type: \"timestamp\",\n timestamp: {}\n };\n case \"date\":\n return {\n type: \"date\",\n date: {}\n };\n case \"object\":\n return {\n type: \"objectReference\",\n objectReference: {\n objectTypeId: fieldType.objectTypeApiName\n }\n };\n default:\n return undefined;\n }\n}\nfunction mapGatewayStructFieldsToIr(dataType) {\n const fields = dataType.fields;\n if (!fields) {\n consola.warn(\"Struct parameter type missing structFieldTypes, skipping\");\n return undefined;\n }\n const structFieldTypes = {};\n for (const field of fields) {\n const irType = mapStructFieldType(field.fieldType);\n if (irType) {\n structFieldTypes[field.name] = irType;\n } else {\n consola.warn(`Skipping struct param field \"${field.name}\": unsupported type \"${field.fieldType.type}\"`);\n }\n }\n return structFieldTypes;\n}\n\n/**\n * Maps a gateway ActionParameterType (discriminated union from OntologyFullMetadata)\n * to a maker ActionParameterType (string primitives or complex objects).\n *\n * Returns undefined for unsupported types (with a warning).\n */\nexport function mapActionParameterType(dataType) {\n const simpleType = SIMPLE_PARAM_TYPES[dataType.type];\n if (simpleType !== undefined) {\n return simpleType;\n }\n switch (dataType.type) {\n case \"object\":\n return {\n type: \"objectReference\",\n objectReference: {\n objectTypeId: dataType.objectTypeApiName\n }\n };\n case \"objectSet\":\n return {\n type: \"objectSetRid\",\n objectSetRid: {\n objectTypeId: dataType.objectTypeApiName ?? \"\"\n }\n };\n case \"interfaceObject\":\n return {\n type: \"interfaceReference\",\n interfaceReference: {\n interfaceTypeRid: dataType.interfaceTypeApiName ?? \"\"\n }\n };\n case \"array\":\n {\n const subType = dataType.subType;\n if (!subType) {\n consola.warn(\"Array parameter type missing subType, skipping\");\n return undefined;\n }\n const listVariant = LIST_VARIANT_MAP[subType.type];\n if (listVariant !== undefined) {\n return listVariant;\n }\n if (subType.type === \"object\") {\n return {\n type: \"objectReferenceList\",\n objectReferenceList: {\n objectTypeId: subType.objectTypeApiName\n }\n };\n }\n if (subType.type === \"interfaceObject\") {\n return {\n type: \"interfaceReferenceList\",\n interfaceReferenceList: {\n interfaceTypeRid: subType.interfaceTypeApiName ?? \"\"\n }\n };\n }\n if (subType.type === \"struct\") {\n const structFields = mapGatewayStructFieldsToIr(subType);\n if (!structFields) return undefined;\n return {\n type: \"structList\",\n structList: {\n structFieldTypes: structFields\n }\n };\n }\n consola.warn(`Skipping array parameter with unsupported subType: ${subType.type}`);\n return undefined;\n }\n case \"struct\":\n {\n const structFields = mapGatewayStructFieldsToIr(dataType);\n if (!structFields) return undefined;\n return {\n type: \"struct\",\n struct: {\n structFieldTypes: structFields\n }\n };\n }\n case \"vector\":\n consola.warn(\"Skipping vector parameter type: no maker equivalent\");\n return undefined;\n case \"objectType\":\n return \"objectTypeReference\";\n default:\n consola.warn(`Skipping unknown parameter type: ${dataType.type}`);\n return undefined;\n }\n}","/*\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\n/**\n * Strips namespace prefix from an apiName.\n * \"com.example.Employee\" -> \"Employee\"\n * \"Employee\" -> \"Employee\"\n */\nexport function withoutNamespace(apiName) {\n const lastDot = apiName.lastIndexOf(\".\");\n if (lastDot === -1) {\n return apiName;\n }\n return apiName.substring(lastDot + 1);\n}\n\n/**\n * Converts a dot-separated apiName to camelCase, including namespace segments.\n * \"com.example.Employee\" -> \"comExampleEmployee\"\n * \"Employee\" -> \"employee\"\n */\nexport function fullCamel(apiName) {\n return camel(apiName.replace(/\\./g, \"-\"));\n}\n\n/**\n * Converts an apiName to camelCase variable name.\n * \"Employee\" -> \"employee\"\n * \"create-employee\" -> \"createEmployee\"\n */\nexport function camel(str) {\n if (!str) {\n return str;\n }\n let result = str.replace(/[-_]+(.)?/g, (_, c) => c ? c.toUpperCase() : \"\");\n result = result.charAt(0).toLowerCase() + result.slice(1);\n return result;\n}","/*\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 { OntologyEntityTypeEnum } from \"@osdk/maker\";\nimport { consola } from \"consola\";\nimport { mapActionParameterType } from \"./mapActionParameterType.js\";\nimport { withoutNamespace } from \"./utils.js\";\nexport function convertActionType(action) {\n const parameters = [];\n for (const [paramId, paramV2] of Object.entries(action.parameters)) {\n const mappedType = mapActionParameterType(paramV2.dataType);\n if (!mappedType) {\n consola.warn(`Skipping parameter \"${paramId}\" on action \"${action.apiName}\": unsupported type \"${paramV2.dataType.type}\"`);\n continue;\n }\n parameters.push({\n id: paramId,\n displayName: paramV2.displayName ?? paramId,\n type: mappedType,\n validation: {\n required: paramV2.required\n }\n });\n }\n const shortName = withoutNamespace(action.apiName);\n return {\n __type: OntologyEntityTypeEnum.ACTION_TYPE,\n apiName: action.apiName,\n displayName: action.displayName ?? shortName,\n status: mapActionStatus(action.status),\n rules: [],\n parameters\n };\n}\nfunction mapActionStatus(status) {\n switch (status) {\n case \"ACTIVE\":\n return \"active\";\n case \"EXPERIMENTAL\":\n return \"experimental\";\n default:\n return \"active\";\n }\n}","/*\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 { consola } from \"consola\";\n\n/**\n * Result of mapping a gateway ObjectPropertyType to a maker PropertyTypeType.\n * `array` is true when the gateway type was {type: \"array\", subType: X}.\n */\n\n/**\n * Maps a gateway ObjectPropertyType (discriminated union with {type: string})\n * to a maker PropertyTypeType.\n *\n * Returns undefined for unsupported types (with a warning).\n */\nexport function mapPropertyType(dataType) {\n switch (dataType.type) {\n case \"string\":\n return {\n type: \"string\"\n };\n case \"integer\":\n return {\n type: \"integer\"\n };\n case \"boolean\":\n return {\n type: \"boolean\"\n };\n case \"double\":\n return {\n type: \"double\"\n };\n case \"float\":\n return {\n type: \"float\"\n };\n case \"long\":\n return {\n type: \"long\"\n };\n case \"short\":\n return {\n type: \"short\"\n };\n case \"byte\":\n return {\n type: \"byte\"\n };\n case \"date\":\n return {\n type: \"date\"\n };\n case \"timestamp\":\n return {\n type: \"timestamp\"\n };\n case \"decimal\":\n return {\n type: \"decimal\"\n };\n case \"attachment\":\n return {\n type: \"attachment\"\n };\n case \"geopoint\":\n return {\n type: \"geopoint\"\n };\n case \"geoshape\":\n return {\n type: \"geoshape\"\n };\n case \"mediaReference\":\n return {\n type: \"mediaReference\"\n };\n case \"geotimeSeriesReference\":\n return {\n type: \"geotimeSeries\"\n };\n case \"array\":\n {\n const subType = dataType.subType;\n if (!subType) {\n consola.warn(\"Array type missing subType, skipping\");\n return undefined;\n }\n const inner = mapPropertyType(subType);\n if (!inner) {\n return undefined;\n }\n return {\n type: inner.type,\n array: true\n };\n }\n // We don't support structs or markings here. It should have no influence on importing functionality\n default:\n return undefined;\n }\n}","/*\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 { OntologyEntityTypeEnum } from \"@osdk/maker\";\nimport { consola } from \"consola\";\nimport { mapPropertyType } from \"./mapPropertyType.js\";\nimport { withoutNamespace } from \"./utils.js\";\nexport function convertSharedPropertyType(spt) {\n const mapped = mapPropertyType(spt.dataType);\n if (!mapped) {\n consola.warn(`Skipping shared property type \"${spt.apiName}\": unsupported type \"${spt.dataType.type}\"`);\n return undefined;\n }\n return {\n __type: OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE,\n apiName: spt.apiName,\n nonNameSpacedApiName: withoutNamespace(spt.apiName),\n displayName: spt.displayName ?? withoutNamespace(spt.apiName),\n type: mapped.type,\n array: mapped.array,\n description: spt.description\n };\n}","/*\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 { OntologyEntityTypeEnum } from \"@osdk/maker\";\nimport { consola } from \"consola\";\nimport { convertSharedPropertyType } from \"./convertSharedPropertyType.js\";\nimport { mapPropertyType } from \"./mapPropertyType.js\";\nimport { withoutNamespace } from \"./utils.js\";\n\n/**\n * Converts a gateway InterfaceType to a maker InterfaceType.\n *\n * `allInterfaces` is the full map so we can resolve extendsInterfaces references.\n */\nexport function convertInterfaceType(iface, allInterfaces) {\n const shortName = withoutNamespace(iface.apiName);\n\n // propertiesV2 is SPT-only; propertiesV3 also carries inline-defined properties.\n const propertiesV2 = {};\n const propertiesV3 = {};\n for (const [_propApiName, prop] of Object.entries(iface.propertiesV2)) {\n if (prop.type === \"interfaceSharedPropertyType\") {\n const converted = convertSharedPropertyType(prop);\n if (converted) {\n const entry = {\n sharedPropertyType: converted,\n required: true\n };\n propertiesV2[prop.apiName] = entry;\n propertiesV3[withoutNamespace(prop.apiName)] = entry;\n }\n } else if (prop.type === \"interfaceDefinedPropertyType\") {\n const mapped = mapPropertyType(prop.dataType);\n if (mapped) {\n propertiesV3[withoutNamespace(prop.apiName)] = {\n type: mapped.type,\n array: mapped.array,\n displayName: prop.displayName,\n description: prop.description,\n required: prop.requireImplementation\n };\n } else {\n consola.warn(`Skipping interface-defined property \"${prop.apiName}\": unsupported type \"${prop.dataType.type}\"`);\n }\n }\n }\n\n // Resolve extendsInterfaces — recursively convert referenced interfaces\n const extendsInterfaces = [];\n for (const extApiName of iface.extendsInterfaces) {\n const extIface = allInterfaces[extApiName];\n if (extIface) {\n extendsInterfaces.push(convertInterfaceType(extIface, allInterfaces));\n }\n }\n return {\n __type: OntologyEntityTypeEnum.INTERFACE_TYPE,\n apiName: iface.apiName,\n displayMetadata: {\n displayName: iface.displayName ?? shortName,\n description: iface.description ?? shortName\n },\n extendsInterfaces,\n links: [],\n status: {\n type: \"active\",\n active: {}\n },\n propertiesV2,\n propertiesV3,\n searchable: true\n };\n}","/*\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 { OntologyEntityTypeEnum } from \"@osdk/maker\";\nimport { consola } from \"consola\";\nimport { mapPropertyType } from \"./mapPropertyType.js\";\nimport { withoutNamespace } from \"./utils.js\";\nexport function convertObjectType(fullMetadata) {\n const obj = fullMetadata.objectType;\n const properties = [];\n for (const [propApiName, propV2] of Object.entries(obj.properties)) {\n const mapped = mapPropertyType(propV2.dataType);\n if (!mapped) {\n consola.warn(`Skipping property \"${propApiName}\" on object \"${obj.apiName}\": unsupported type \"${propV2.dataType.type}\"`);\n continue;\n }\n const prop = {\n apiName: propApiName,\n displayName: propV2.displayName ?? propApiName,\n type: mapped.type\n };\n if (mapped.array) {\n prop.array = true;\n }\n properties.push(prop);\n }\n const shortName = withoutNamespace(obj.apiName);\n return {\n __type: OntologyEntityTypeEnum.OBJECT_TYPE,\n ridHint: obj.rid,\n apiName: obj.apiName,\n displayName: obj.displayName ?? shortName,\n pluralDisplayName: (obj.displayName ?? shortName) + \"s\",\n primaryKeyPropertyApiName: obj.primaryKey,\n titlePropertyApiName: obj.titleProperty,\n properties,\n description: obj.description,\n visibility: obj.visibility,\n status: mapObjectStatus(obj.status)\n };\n}\nfunction mapObjectStatus(status) {\n switch (status) {\n case \"ACTIVE\":\n return \"active\";\n case \"EXPERIMENTAL\":\n return \"experimental\";\n default:\n return \"active\";\n }\n}","/*\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 { OntologyEntityTypeEnum } from \"@osdk/maker\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { convertActionType } from \"./convertActionType.js\";\nimport { convertInterfaceType } from \"./convertInterfaceType.js\";\nimport { convertObjectType } from \"./convertObjectType.js\";\nimport { convertSharedPropertyType } from \"./convertSharedPropertyType.js\";\nimport { camel, fullCamel, withoutNamespace } from \"./utils.js\";\nconst TYPE_NAME_MAP = {\n [OntologyEntityTypeEnum.OBJECT_TYPE]: \"ObjectType\",\n [OntologyEntityTypeEnum.ACTION_TYPE]: \"ActionType\",\n [OntologyEntityTypeEnum.INTERFACE_TYPE]: \"InterfaceType\",\n [OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE]: \"SharedPropertyType\"\n};\nconst DIR_NAME_MAP = {\n [OntologyEntityTypeEnum.OBJECT_TYPE]: \"object-types\",\n [OntologyEntityTypeEnum.ACTION_TYPE]: \"action-types\",\n [OntologyEntityTypeEnum.INTERFACE_TYPE]: \"interface-types\",\n [OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE]: \"shared-property-types\"\n};\n/**\n * Resolves unique variable/file names for a list of apiNames.\n *\n * First tries the short name (namespace stripped, camelCase).\n * If that collides, all colliding entries are escalated to the full\n * camelCase name (namespace included). Any remaining duplicates get\n * a numeric suffix.\n */\nexport function resolveVarNames(apiNames) {\n const shortNames = apiNames.map(n => camel(withoutNamespace(n)));\n\n // Find which short names appear more than once\n const counts = new Map();\n for (const name of shortNames) {\n counts.set(name, (counts.get(name) ?? 0) + 1);\n }\n\n // Escalate conflicting names to fullCamel\n const resolved = apiNames.map((apiName, i) => {\n if (counts.get(shortNames[i]) > 1) {\n return fullCamel(apiName);\n }\n return shortNames[i];\n });\n\n // Handle any remaining duplicates with numeric suffixes\n const finalNames = [];\n const used = new Map();\n for (const name of resolved) {\n const count = used.get(name) ?? 0;\n finalNames.push(count === 0 ? name : `${name}${count}`);\n used.set(name, count + 1);\n }\n return finalNames;\n}\n\n/**\n * Generates TypeScript files from OntologyFullMetadata, replicating\n * the pattern from maker's writeStaticObjects().\n *\n * Each entity gets its own file with wrapWithProxy, plus an index.ts\n * that re-exports everything.\n */\nexport function writeImportedOntology(metadata, outputDir) {\n const codegenDir = path.resolve(outputDir, \"codegen\");\n\n // Clean and create directories\n for (const dirName of Object.values(DIR_NAME_MAP)) {\n const dirPath = path.join(codegenDir, dirName);\n if (fs.existsSync(dirPath)) {\n fs.rmSync(dirPath, {\n recursive: true,\n force: true\n });\n }\n fs.mkdirSync(dirPath, {\n recursive: true\n });\n }\n\n // Pass 1: Convert all entities\n const entries = [];\n for (const [_apiName, spt] of Object.entries(metadata.sharedPropertyTypes)) {\n const converted = convertSharedPropertyType(spt);\n if (converted) {\n entries.push({\n apiName: converted.apiName,\n entityType: OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE,\n entity: converted\n });\n }\n }\n for (const [_apiName, iface] of Object.entries(metadata.interfaceTypes)) {\n const converted = convertInterfaceType(iface, metadata.interfaceTypes);\n entries.push({\n apiName: converted.apiName,\n entityType: OntologyEntityTypeEnum.INTERFACE_TYPE,\n entity: converted\n });\n }\n for (const [_apiName, objFull] of Object.entries(metadata.objectTypes)) {\n const converted = convertObjectType(objFull);\n entries.push({\n apiName: converted.apiName,\n entityType: OntologyEntityTypeEnum.OBJECT_TYPE,\n entity: converted\n });\n }\n for (const [_apiName, action] of Object.entries(metadata.actionTypes)) {\n const converted = convertActionType(action);\n entries.push({\n apiName: converted.apiName,\n entityType: OntologyEntityTypeEnum.ACTION_TYPE,\n entity: converted\n });\n }\n\n // Pass 2: Resolve unique variable names across all entities\n const varNames = resolveVarNames(entries.map(e => e.apiName));\n\n // Pass 3: Write files with resolved names\n const topLevelExports = [];\n for (let i = 0; i < entries.length; i++) {\n writeEntityFile(codegenDir, entries[i].entityType, entries[i].entity, varNames[i], topLevelExports);\n }\n\n // Write index.ts\n if (topLevelExports.length > 0) {\n const indexContent = topLevelExports.join(\"\\n\") + \"\\n\";\n const indexPath = path.join(outputDir, \"index.ts\");\n fs.writeFileSync(indexPath, indexContent, {\n flag: \"w\"\n });\n }\n}\nfunction writeEntityFile(codegenDir, entityType, entity, varName, topLevelExports) {\n const typeName = TYPE_NAME_MAP[entityType];\n const dirName = DIR_NAME_MAP[entityType];\n const entityJSON = JSON.stringify(entity, null, 2).replace(/(\"__type\"\\s*:\\s*)\"([^\"]*)\"/g, (_, prefix, value) => `${prefix}OntologyEntityTypeEnum.${value}`);\n const content = `import { wrapWithProxy, OntologyEntityTypeEnum } from '@osdk/maker';\nimport type { ${typeName} } from '@osdk/maker';\n\n/** @type {import('@osdk/maker').${typeName}} */\nconst ${varName}_base: ${typeName} = ${entityJSON} as unknown as ${typeName};\n\nexport const ${varName}: ${typeName} = wrapWithProxy(${varName}_base);\n`;\n const filePath = path.join(codegenDir, dirName, `${varName}.ts`);\n fs.writeFileSync(filePath, content, {\n flag: \"w\"\n });\n topLevelExports.push(`export { ${varName} } from \"./codegen/${dirName}/${varName}.js\";`);\n}","/*\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 { consola } from \"consola\";\nimport * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\nimport yargs from \"yargs\";\nimport { hideBin } from \"yargs/helpers\";\nimport { writeImportedOntology } from \"../generate/writeImportedOntology.js\";\nexport default async function main(args = process.argv) {\n const commandLineOpts = await yargs(hideBin(args)).version(process.env.PACKAGE_VERSION ?? \"\").wrap(Math.min(150, yargs().terminalWidth())).strict().help().options({\n input: {\n alias: \"i\",\n describe: \"Path to OntologyFullMetadata JSON file\",\n type: \"string\",\n demandOption: true,\n coerce: path.resolve\n },\n output: {\n alias: \"o\",\n describe: \"Output directory for generated TypeScript files\",\n type: \"string\",\n default: \"./generated-imports\",\n coerce: path.resolve\n }\n }).parseAsync();\n consola.info(`Reading OntologyFullMetadata from ${commandLineOpts.input}`);\n const jsonContent = await fs.readFile(commandLineOpts.input, \"utf-8\");\n const metadata = JSON.parse(jsonContent);\n consola.info(`Writing generated imports to ${commandLineOpts.output}`);\n writeImportedOntology(metadata, commandLineOpts.output);\n consola.success(`Generated import files in ${commandLineOpts.output}`);\n}"]}
1
+ {"version":3,"sources":["../../src/generate/mapActionParameterType.ts","../../src/generate/utils.ts","../../src/generate/convertActionType.ts","../../src/generate/mapPropertyType.ts","../../src/generate/convertSharedPropertyType.ts","../../src/generate/convertInterfaceType.ts","../../src/generate/convertObjectType.ts","../../src/generate/writeImportedOntology.ts","../../src/cli/main.ts"],"names":["consola","OntologyEntityTypeEnum","path","fs","yargs","hideBin","path2","fs2"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,IAAM,kBAAA,GAAqB;AAAA,EACzB,MAAA,EAAQ,QAAA;AAAA,EACR,OAAA,EAAS,SAAA;AAAA,EACT,OAAA,EAAS,SAAA;AAAA,EACT,MAAA,EAAQ,QAAA;AAAA,EACR,IAAA,EAAM,MAAA;AAAA,EACN,IAAA,EAAM,MAAA;AAAA,EACN,SAAA,EAAW,WAAA;AAAA,EACX,UAAA,EAAY,YAAA;AAAA,EACZ,OAAA,EAAS,SAAA;AAAA,EACT,OAAA,EAAS,SAAA;AAAA,EACT,QAAA,EAAU,UAAA;AAAA,EACV,cAAA,EAAgB,gBAAA;AAAA,EAChB,OAAA,EAAS;AACX,CAAA;AACA,IAAM,gBAAA,GAAmB;AAAA,EACvB,MAAA,EAAQ,YAAA;AAAA,EACR,OAAA,EAAS,aAAA;AAAA,EACT,OAAA,EAAS,aAAA;AAAA,EACT,MAAA,EAAQ,YAAA;AAAA,EACR,IAAA,EAAM,UAAA;AAAA,EACN,IAAA,EAAM,UAAA;AAAA,EACN,SAAA,EAAW,eAAA;AAAA,EACX,UAAA,EAAY,gBAAA;AAAA,EACZ,OAAA,EAAS,aAAA;AAAA,EACT,OAAA,EAAS,aAAA;AAAA,EACT,QAAA,EAAU,cAAA;AAAA,EACV,cAAA,EAAgB,oBAAA;AAAA,EAChB,OAAA,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,EAAe,CAAC,EAAE,MAAA,EAAO,CAAE,IAAA,EAAK,CAAE,OAAA,CAAQ;AAAA,IACjK,KAAA,EAAO;AAAA,MACL,KAAA,EAAO,GAAA;AAAA,MACP,QAAA,EAAU,wCAAA;AAAA,MACV,IAAA,EAAM,QAAA;AAAA,MACN,YAAA,EAAc,IAAA;AAAA,MACd,MAAA,EAAaE,eAAA,CAAA;AAAA,KACf;AAAA,IACA,MAAA,EAAQ;AAAA,MACN,KAAA,EAAO,GAAA;AAAA,MACP,QAAA,EAAU,iDAAA;AAAA,MACV,IAAA,EAAM,QAAA;AAAA,MACN,OAAA,EAAS,qBAAA;AAAA,MACT,MAAA,EAAaA,eAAA,CAAA;AAAA;AACf,GACD,EAAE,UAAA,EAAW;AACd,EAAAN,eAAAA,CAAQ,IAAA,CAAK,CAAA,kCAAA,EAAqC,eAAA,CAAgB,KAAK,CAAA,CAAE,CAAA;AACzE,EAAA,MAAM,WAAA,GAAc,MAASO,cAAA,CAAA,QAAA,CAAS,eAAA,CAAgB,OAAO,OAAO,CAAA;AACpE,EAAA,MAAM,QAAA,GAAW,IAAA,CAAK,KAAA,CAAM,WAAW,CAAA;AACvC,EAAAP,eAAAA,CAAQ,IAAA,CAAK,CAAA,6BAAA,EAAgC,eAAA,CAAgB,MAAM,CAAA,CAAE,CAAA;AACrE,EAAA,qBAAA,CAAsB,QAAA,EAAU,gBAAgB,MAAM,CAAA;AACtD,EAAAA,eAAAA,CAAQ,OAAA,CAAQ,CAAA,0BAAA,EAA6B,eAAA,CAAgB,MAAM,CAAA,CAAE,CAAA;AACvE","file":"index.cjs","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 { consola } from \"consola\";\nconst SIMPLE_PARAM_TYPES = {\n string: \"string\",\n integer: \"integer\",\n boolean: \"boolean\",\n double: \"double\",\n long: \"long\",\n date: \"date\",\n timestamp: \"timestamp\",\n attachment: \"attachment\",\n marking: \"marking\",\n geohash: \"geohash\",\n geoshape: \"geoshape\",\n mediaReference: \"mediaReference\",\n decimal: \"decimal\"\n};\nconst LIST_VARIANT_MAP = {\n string: \"stringList\",\n integer: \"integerList\",\n boolean: \"booleanList\",\n double: \"doubleList\",\n long: \"longList\",\n date: \"dateList\",\n timestamp: \"timestampList\",\n attachment: \"attachmentList\",\n marking: \"markingList\",\n geohash: \"geohashList\",\n geoshape: \"geoshapeList\",\n mediaReference: \"mediaReferenceList\",\n decimal: \"decimalList\"\n};\nfunction mapStructFieldType(fieldType) {\n switch (fieldType.type) {\n case \"boolean\":\n return {\n type: \"boolean\",\n boolean: {}\n };\n case \"integer\":\n return {\n type: \"integer\",\n integer: {}\n };\n case \"long\":\n return {\n type: \"long\",\n long: {}\n };\n case \"double\":\n return {\n type: \"double\",\n double: {}\n };\n case \"string\":\n return {\n type: \"string\",\n string: {}\n };\n case \"timestamp\":\n return {\n type: \"timestamp\",\n timestamp: {}\n };\n case \"date\":\n return {\n type: \"date\",\n date: {}\n };\n case \"object\":\n return {\n type: \"objectReference\",\n objectReference: {\n objectTypeId: fieldType.objectTypeApiName\n }\n };\n default:\n return undefined;\n }\n}\nfunction mapGatewayStructFieldsToIr(dataType) {\n const fields = dataType.fields;\n if (!fields) {\n consola.warn(\"Struct parameter type missing structFieldTypes, skipping\");\n return undefined;\n }\n const structFieldTypes = {};\n for (const field of fields) {\n const irType = mapStructFieldType(field.fieldType);\n if (irType) {\n structFieldTypes[field.name] = irType;\n } else {\n consola.warn(`Skipping struct param field \"${field.name}\": unsupported type \"${field.fieldType.type}\"`);\n }\n }\n return structFieldTypes;\n}\n\n/**\n * Maps a gateway ActionParameterType (discriminated union from OntologyFullMetadata)\n * to a maker ActionParameterType (string primitives or complex objects).\n *\n * Returns undefined for unsupported types (with a warning).\n */\nexport function mapActionParameterType(dataType) {\n const simpleType = SIMPLE_PARAM_TYPES[dataType.type];\n if (simpleType !== undefined) {\n return simpleType;\n }\n switch (dataType.type) {\n case \"object\":\n return {\n type: \"objectReference\",\n objectReference: {\n objectTypeId: dataType.objectTypeApiName\n }\n };\n case \"objectSet\":\n return {\n type: \"objectSetRid\",\n objectSetRid: {\n objectTypeId: dataType.objectTypeApiName ?? \"\"\n }\n };\n case \"interfaceObject\":\n return {\n type: \"interfaceReference\",\n interfaceReference: {\n interfaceTypeRid: dataType.interfaceTypeApiName ?? \"\"\n }\n };\n case \"array\":\n {\n const subType = dataType.subType;\n if (!subType) {\n consola.warn(\"Array parameter type missing subType, skipping\");\n return undefined;\n }\n const listVariant = LIST_VARIANT_MAP[subType.type];\n if (listVariant !== undefined) {\n return listVariant;\n }\n if (subType.type === \"object\") {\n return {\n type: \"objectReferenceList\",\n objectReferenceList: {\n objectTypeId: subType.objectTypeApiName\n }\n };\n }\n if (subType.type === \"interfaceObject\") {\n return {\n type: \"interfaceReferenceList\",\n interfaceReferenceList: {\n interfaceTypeRid: subType.interfaceTypeApiName ?? \"\"\n }\n };\n }\n if (subType.type === \"struct\") {\n const structFields = mapGatewayStructFieldsToIr(subType);\n if (!structFields) return undefined;\n return {\n type: \"structList\",\n structList: {\n structFieldTypes: structFields\n }\n };\n }\n consola.warn(`Skipping array parameter with unsupported subType: ${subType.type}`);\n return undefined;\n }\n case \"struct\":\n {\n const structFields = mapGatewayStructFieldsToIr(dataType);\n if (!structFields) return undefined;\n return {\n type: \"struct\",\n struct: {\n structFieldTypes: structFields\n }\n };\n }\n case \"vector\":\n consola.warn(\"Skipping vector parameter type: no maker equivalent\");\n return undefined;\n case \"objectType\":\n return \"objectTypeReference\";\n default:\n consola.warn(`Skipping unknown parameter type: ${dataType.type}`);\n return undefined;\n }\n}","/*\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\n/**\n * Strips namespace prefix from an apiName.\n * \"com.example.Employee\" -> \"Employee\"\n * \"Employee\" -> \"Employee\"\n */\nexport function withoutNamespace(apiName) {\n const lastDot = apiName.lastIndexOf(\".\");\n if (lastDot === -1) {\n return apiName;\n }\n return apiName.substring(lastDot + 1);\n}\n\n/**\n * Converts a dot-separated apiName to camelCase, including namespace segments.\n * \"com.example.Employee\" -> \"comExampleEmployee\"\n * \"Employee\" -> \"employee\"\n */\nexport function fullCamel(apiName) {\n return camel(apiName.replace(/\\./g, \"-\"));\n}\n\n/**\n * Converts an apiName to camelCase variable name.\n * \"Employee\" -> \"employee\"\n * \"create-employee\" -> \"createEmployee\"\n */\nexport function camel(str) {\n if (!str) {\n return str;\n }\n let result = str.replace(/[-_]+(.)?/g, (_, c) => c ? c.toUpperCase() : \"\");\n result = result.charAt(0).toLowerCase() + result.slice(1);\n return result;\n}","/*\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 { OntologyEntityTypeEnum } from \"@osdk/maker\";\nimport { consola } from \"consola\";\nimport { mapActionParameterType } from \"./mapActionParameterType.js\";\nimport { withoutNamespace } from \"./utils.js\";\nexport function convertActionType(action) {\n const parameters = [];\n for (const [paramId, paramV2] of Object.entries(action.parameters)) {\n const mappedType = mapActionParameterType(paramV2.dataType);\n if (!mappedType) {\n consola.warn(`Skipping parameter \"${paramId}\" on action \"${action.apiName}\": unsupported type \"${paramV2.dataType.type}\"`);\n continue;\n }\n parameters.push({\n id: paramId,\n displayName: paramV2.displayName ?? paramId,\n type: mappedType,\n validation: {\n required: paramV2.required\n }\n });\n }\n const shortName = withoutNamespace(action.apiName);\n return {\n __type: OntologyEntityTypeEnum.ACTION_TYPE,\n apiName: action.apiName,\n displayName: action.displayName ?? shortName,\n status: mapActionStatus(action.status),\n rules: [],\n parameters\n };\n}\nfunction mapActionStatus(status) {\n switch (status) {\n case \"ACTIVE\":\n return \"active\";\n case \"EXPERIMENTAL\":\n return \"experimental\";\n default:\n return \"active\";\n }\n}","/*\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 { consola } from \"consola\";\n\n/**\n * Result of mapping a gateway ObjectPropertyType to a maker PropertyTypeType.\n * `array` is true when the gateway type was {type: \"array\", subType: X}.\n */\n\n/**\n * Maps a gateway ObjectPropertyType (discriminated union with {type: string})\n * to a maker PropertyTypeType.\n *\n * Returns undefined for unsupported types (with a warning).\n */\nexport function mapPropertyType(dataType) {\n switch (dataType.type) {\n case \"string\":\n return {\n type: \"string\"\n };\n case \"integer\":\n return {\n type: \"integer\"\n };\n case \"boolean\":\n return {\n type: \"boolean\"\n };\n case \"double\":\n return {\n type: \"double\"\n };\n case \"float\":\n return {\n type: \"float\"\n };\n case \"long\":\n return {\n type: \"long\"\n };\n case \"short\":\n return {\n type: \"short\"\n };\n case \"byte\":\n return {\n type: \"byte\"\n };\n case \"date\":\n return {\n type: \"date\"\n };\n case \"timestamp\":\n return {\n type: \"timestamp\"\n };\n case \"decimal\":\n return {\n type: \"decimal\"\n };\n case \"attachment\":\n return {\n type: \"attachment\"\n };\n case \"geopoint\":\n return {\n type: \"geopoint\"\n };\n case \"geoshape\":\n return {\n type: \"geoshape\"\n };\n case \"mediaReference\":\n return {\n type: \"mediaReference\"\n };\n case \"geotimeSeriesReference\":\n return {\n type: \"geotimeSeries\"\n };\n case \"array\":\n {\n const subType = dataType.subType;\n if (!subType) {\n consola.warn(\"Array type missing subType, skipping\");\n return undefined;\n }\n const inner = mapPropertyType(subType);\n if (!inner) {\n return undefined;\n }\n return {\n type: inner.type,\n array: true\n };\n }\n // We don't support structs or markings here. It should have no influence on importing functionality\n default:\n return undefined;\n }\n}","/*\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 { OntologyEntityTypeEnum } from \"@osdk/maker\";\nimport { consola } from \"consola\";\nimport { mapPropertyType } from \"./mapPropertyType.js\";\nimport { withoutNamespace } from \"./utils.js\";\nexport function convertSharedPropertyType(spt) {\n const mapped = mapPropertyType(spt.dataType);\n if (!mapped) {\n consola.warn(`Skipping shared property type \"${spt.apiName}\": unsupported type \"${spt.dataType.type}\"`);\n return undefined;\n }\n return {\n __type: OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE,\n apiName: spt.apiName,\n nonNameSpacedApiName: withoutNamespace(spt.apiName),\n displayName: spt.displayName ?? withoutNamespace(spt.apiName),\n type: mapped.type,\n array: mapped.array,\n description: spt.description\n };\n}","/*\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 { OntologyEntityTypeEnum } from \"@osdk/maker\";\nimport { consola } from \"consola\";\nimport { convertSharedPropertyType } from \"./convertSharedPropertyType.js\";\nimport { mapPropertyType } from \"./mapPropertyType.js\";\nimport { withoutNamespace } from \"./utils.js\";\n\n/**\n * Converts a gateway InterfaceType to a maker InterfaceType.\n *\n * `allInterfaces` is the full map so we can resolve extendsInterfaces references.\n */\nexport function convertInterfaceType(iface, allInterfaces) {\n const shortName = withoutNamespace(iface.apiName);\n\n // propertiesV2 is SPT-only; propertiesV3 also carries inline-defined properties.\n const propertiesV2 = {};\n const propertiesV3 = {};\n for (const [_propApiName, prop] of Object.entries(iface.propertiesV2)) {\n if (prop.type === \"interfaceSharedPropertyType\") {\n const converted = convertSharedPropertyType(prop);\n if (converted) {\n const entry = {\n sharedPropertyType: converted,\n required: true\n };\n propertiesV2[prop.apiName] = entry;\n propertiesV3[withoutNamespace(prop.apiName)] = entry;\n }\n } else if (prop.type === \"interfaceDefinedPropertyType\") {\n const mapped = mapPropertyType(prop.dataType);\n if (mapped) {\n propertiesV3[withoutNamespace(prop.apiName)] = {\n type: mapped.type,\n array: mapped.array,\n displayName: prop.displayName,\n description: prop.description,\n required: prop.requireImplementation\n };\n } else {\n consola.warn(`Skipping interface-defined property \"${prop.apiName}\": unsupported type \"${prop.dataType.type}\"`);\n }\n }\n }\n\n // Resolve extendsInterfaces — recursively convert referenced interfaces\n const extendsInterfaces = [];\n for (const extApiName of iface.extendsInterfaces) {\n const extIface = allInterfaces[extApiName];\n if (extIface) {\n extendsInterfaces.push(convertInterfaceType(extIface, allInterfaces));\n }\n }\n return {\n __type: OntologyEntityTypeEnum.INTERFACE_TYPE,\n apiName: iface.apiName,\n displayMetadata: {\n displayName: iface.displayName ?? shortName,\n description: iface.description ?? shortName\n },\n extendsInterfaces,\n links: [],\n status: {\n type: \"active\",\n active: {}\n },\n propertiesV2,\n propertiesV3,\n searchable: true\n };\n}","/*\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 { OntologyEntityTypeEnum } from \"@osdk/maker\";\nimport { consola } from \"consola\";\nimport { mapPropertyType } from \"./mapPropertyType.js\";\nimport { withoutNamespace } from \"./utils.js\";\nexport function convertObjectType(fullMetadata) {\n const obj = fullMetadata.objectType;\n const properties = [];\n for (const [propApiName, propV2] of Object.entries(obj.properties)) {\n const mapped = mapPropertyType(propV2.dataType);\n if (!mapped) {\n consola.warn(`Skipping property \"${propApiName}\" on object \"${obj.apiName}\": unsupported type \"${propV2.dataType.type}\"`);\n continue;\n }\n const prop = {\n apiName: propApiName,\n displayName: propV2.displayName ?? propApiName,\n type: mapped.type\n };\n if (mapped.array) {\n prop.array = true;\n }\n properties.push(prop);\n }\n const shortName = withoutNamespace(obj.apiName);\n return {\n __type: OntologyEntityTypeEnum.OBJECT_TYPE,\n ridHint: obj.rid,\n apiName: obj.apiName,\n displayName: obj.displayName ?? shortName,\n pluralDisplayName: (obj.displayName ?? shortName) + \"s\",\n primaryKeyPropertyApiName: obj.primaryKey,\n titlePropertyApiName: obj.titleProperty,\n properties,\n description: obj.description,\n visibility: obj.visibility,\n status: mapObjectStatus(obj.status)\n };\n}\nfunction mapObjectStatus(status) {\n switch (status) {\n case \"ACTIVE\":\n return \"active\";\n case \"EXPERIMENTAL\":\n return \"experimental\";\n default:\n return \"active\";\n }\n}","/*\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 { OntologyEntityTypeEnum } from \"@osdk/maker\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { convertActionType } from \"./convertActionType.js\";\nimport { convertInterfaceType } from \"./convertInterfaceType.js\";\nimport { convertObjectType } from \"./convertObjectType.js\";\nimport { convertSharedPropertyType } from \"./convertSharedPropertyType.js\";\nimport { camel, fullCamel, withoutNamespace } from \"./utils.js\";\nconst TYPE_NAME_MAP = {\n [OntologyEntityTypeEnum.OBJECT_TYPE]: \"ObjectType\",\n [OntologyEntityTypeEnum.ACTION_TYPE]: \"ActionType\",\n [OntologyEntityTypeEnum.INTERFACE_TYPE]: \"InterfaceType\",\n [OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE]: \"SharedPropertyType\"\n};\nconst DIR_NAME_MAP = {\n [OntologyEntityTypeEnum.OBJECT_TYPE]: \"object-types\",\n [OntologyEntityTypeEnum.ACTION_TYPE]: \"action-types\",\n [OntologyEntityTypeEnum.INTERFACE_TYPE]: \"interface-types\",\n [OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE]: \"shared-property-types\"\n};\n/**\n * Resolves unique variable/file names for a list of apiNames.\n *\n * First tries the short name (namespace stripped, camelCase).\n * If that collides, all colliding entries are escalated to the full\n * camelCase name (namespace included). Any remaining duplicates get\n * a numeric suffix.\n */\nexport function resolveVarNames(apiNames) {\n const shortNames = apiNames.map(n => camel(withoutNamespace(n)));\n\n // Find which short names appear more than once\n const counts = new Map();\n for (const name of shortNames) {\n counts.set(name, (counts.get(name) ?? 0) + 1);\n }\n\n // Escalate conflicting names to fullCamel\n const resolved = apiNames.map((apiName, i) => {\n if (counts.get(shortNames[i]) > 1) {\n return fullCamel(apiName);\n }\n return shortNames[i];\n });\n\n // Handle any remaining duplicates with numeric suffixes\n const finalNames = [];\n const used = new Map();\n for (const name of resolved) {\n const count = used.get(name) ?? 0;\n finalNames.push(count === 0 ? name : `${name}${count}`);\n used.set(name, count + 1);\n }\n return finalNames;\n}\n\n/**\n * Generates TypeScript files from OntologyFullMetadata, replicating\n * the pattern from maker's writeStaticObjects().\n *\n * Each entity gets its own file with wrapWithProxy, plus an index.ts\n * that re-exports everything.\n */\nexport function writeImportedOntology(metadata, outputDir) {\n const codegenDir = path.resolve(outputDir, \"codegen\");\n\n // Clean and create directories\n for (const dirName of Object.values(DIR_NAME_MAP)) {\n const dirPath = path.join(codegenDir, dirName);\n if (fs.existsSync(dirPath)) {\n fs.rmSync(dirPath, {\n recursive: true,\n force: true\n });\n }\n fs.mkdirSync(dirPath, {\n recursive: true\n });\n }\n\n // Pass 1: Convert all entities\n const entries = [];\n for (const [_apiName, spt] of Object.entries(metadata.sharedPropertyTypes)) {\n const converted = convertSharedPropertyType(spt);\n if (converted) {\n entries.push({\n apiName: converted.apiName,\n entityType: OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE,\n entity: converted\n });\n }\n }\n for (const [_apiName, iface] of Object.entries(metadata.interfaceTypes)) {\n const converted = convertInterfaceType(iface, metadata.interfaceTypes);\n entries.push({\n apiName: converted.apiName,\n entityType: OntologyEntityTypeEnum.INTERFACE_TYPE,\n entity: converted\n });\n }\n for (const [_apiName, objFull] of Object.entries(metadata.objectTypes)) {\n const converted = convertObjectType(objFull);\n entries.push({\n apiName: converted.apiName,\n entityType: OntologyEntityTypeEnum.OBJECT_TYPE,\n entity: converted\n });\n }\n for (const [_apiName, action] of Object.entries(metadata.actionTypes)) {\n const converted = convertActionType(action);\n entries.push({\n apiName: converted.apiName,\n entityType: OntologyEntityTypeEnum.ACTION_TYPE,\n entity: converted\n });\n }\n\n // Pass 2: Resolve unique variable names across all entities\n const varNames = resolveVarNames(entries.map(e => e.apiName));\n\n // Pass 3: Write files with resolved names\n const topLevelExports = [];\n for (let i = 0; i < entries.length; i++) {\n writeEntityFile(codegenDir, entries[i].entityType, entries[i].entity, varNames[i], topLevelExports);\n }\n\n // Write index.ts\n if (topLevelExports.length > 0) {\n const indexContent = topLevelExports.join(\"\\n\") + \"\\n\";\n const indexPath = path.join(outputDir, \"index.ts\");\n fs.writeFileSync(indexPath, indexContent, {\n flag: \"w\"\n });\n }\n}\nfunction writeEntityFile(codegenDir, entityType, entity, varName, topLevelExports) {\n const typeName = TYPE_NAME_MAP[entityType];\n const dirName = DIR_NAME_MAP[entityType];\n const entityJSON = JSON.stringify(entity, null, 2).replace(/(\"__type\"\\s*:\\s*)\"([^\"]*)\"/g, (_, prefix, value) => `${prefix}OntologyEntityTypeEnum.${value}`);\n const content = `import { wrapWithProxy, OntologyEntityTypeEnum } from '@osdk/maker';\nimport type { ${typeName} } from '@osdk/maker';\n\n/** @type {import('@osdk/maker').${typeName}} */\nconst ${varName}_base: ${typeName} = ${entityJSON} as unknown as ${typeName};\n\nexport const ${varName}: ${typeName} = wrapWithProxy(${varName}_base);\n`;\n const filePath = path.join(codegenDir, dirName, `${varName}.ts`);\n fs.writeFileSync(filePath, content, {\n flag: \"w\"\n });\n topLevelExports.push(`export { ${varName} } from \"./codegen/${dirName}/${varName}.js\";`);\n}","/*\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 { consola } from \"consola\";\nimport * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\nimport yargs from \"yargs\";\nimport { hideBin } from \"yargs/helpers\";\nimport { writeImportedOntology } from \"../generate/writeImportedOntology.js\";\nexport default async function main(args = process.argv) {\n const commandLineOpts = await yargs(hideBin(args)).version(process.env.PACKAGE_VERSION ?? \"\").wrap(Math.min(150, yargs().terminalWidth())).strict().help().options({\n input: {\n alias: \"i\",\n describe: \"Path to OntologyFullMetadata JSON file\",\n type: \"string\",\n demandOption: true,\n coerce: path.resolve\n },\n output: {\n alias: \"o\",\n describe: \"Output directory for generated TypeScript files\",\n type: \"string\",\n default: \"./generated-imports\",\n coerce: path.resolve\n }\n }).parseAsync();\n consola.info(`Reading OntologyFullMetadata from ${commandLineOpts.input}`);\n const jsonContent = await fs.readFile(commandLineOpts.input, \"utf-8\");\n const metadata = JSON.parse(jsonContent);\n consola.info(`Writing generated imports to ${commandLineOpts.output}`);\n writeImportedOntology(metadata, commandLineOpts.output);\n consola.success(`Generated import files in ${commandLineOpts.output}`);\n}"]}
@@ -21,7 +21,7 @@ import yargs from "yargs";
21
21
  import { hideBin } from "yargs/helpers";
22
22
  import { writeImportedOntology } from "../generate/writeImportedOntology.js";
23
23
  export default async function main(args = process.argv) {
24
- const commandLineOpts = await yargs(hideBin(args)).version("0.4.0" ?? "").wrap(Math.min(150, yargs().terminalWidth())).strict().help().options({
24
+ const commandLineOpts = await yargs(hideBin(args)).version("0.4.1-beta.0" ?? "").wrap(Math.min(150, yargs().terminalWidth())).strict().help().options({
25
25
  input: {
26
26
  alias: "i",
27
27
  describe: "Path to OntologyFullMetadata JSON file",
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","names":["consola","fs","path","yargs","hideBin","writeImportedOntology","main","args","process","argv","commandLineOpts","version","wrap","Math","min","terminalWidth","strict","help","options","input","alias","describe","type","demandOption","coerce","resolve","output","default","parseAsync","info","jsonContent","readFile","metadata","JSON","parse","success"],"sources":["main.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 { consola } from \"consola\";\nimport * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\nimport yargs from \"yargs\";\nimport { hideBin } from \"yargs/helpers\";\nimport { writeImportedOntology } from \"../generate/writeImportedOntology.js\";\n\nexport default async function main(\n args: string[] = process.argv,\n): Promise<void> {\n const commandLineOpts = await yargs(hideBin(args))\n .version(process.env.PACKAGE_VERSION ?? \"\")\n .wrap(Math.min(150, yargs().terminalWidth()))\n .strict()\n .help()\n .options({\n input: {\n alias: \"i\",\n describe: \"Path to OntologyFullMetadata JSON file\",\n type: \"string\",\n demandOption: true,\n coerce: path.resolve,\n },\n output: {\n alias: \"o\",\n describe: \"Output directory for generated TypeScript files\",\n type: \"string\",\n default: \"./generated-imports\",\n coerce: path.resolve,\n },\n })\n .parseAsync();\n\n consola.info(`Reading OntologyFullMetadata from ${commandLineOpts.input}`);\n\n const jsonContent = await fs.readFile(commandLineOpts.input, \"utf-8\");\n const metadata = JSON.parse(jsonContent);\n\n consola.info(`Writing generated imports to ${commandLineOpts.output}`);\n\n writeImportedOntology(metadata, commandLineOpts.output);\n\n consola.success(`Generated import files in ${commandLineOpts.output}`);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,OAAO,QAAQ,SAAS;AACjC,OAAO,KAAKC,EAAE,MAAM,kBAAkB;AACtC,OAAO,KAAKC,IAAI,MAAM,WAAW;AACjC,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,OAAO,QAAQ,eAAe;AACvC,SAASC,qBAAqB,QAAQ,sCAAsC;AAE5E,eAAe,eAAeC,IAAIA,CAChCC,IAAc,GAAGC,OAAO,CAACC,IAAI,EACd;EACf,MAAMC,eAAe,GAAG,MAAMP,KAAK,CAACC,OAAO,CAACG,IAAI,CAAC,CAAC,CAC/CI,OAAO,CAAC,WAA+B,EAAE,CAAC,CAC1CC,IAAI,CAACC,IAAI,CAACC,GAAG,CAAC,GAAG,EAAEX,KAAK,CAAC,CAAC,CAACY,aAAa,CAAC,CAAC,CAAC,CAAC,CAC5CC,MAAM,CAAC,CAAC,CACRC,IAAI,CAAC,CAAC,CACNC,OAAO,CAAC;IACPC,KAAK,EAAE;MACLC,KAAK,EAAE,GAAG;MACVC,QAAQ,EAAE,wCAAwC;MAClDC,IAAI,EAAE,QAAQ;MACdC,YAAY,EAAE,IAAI;MAClBC,MAAM,EAAEtB,IAAI,CAACuB;IACf,CAAC;IACDC,MAAM,EAAE;MACNN,KAAK,EAAE,GAAG;MACVC,QAAQ,EAAE,iDAAiD;MAC3DC,IAAI,EAAE,QAAQ;MACdK,OAAO,EAAE,qBAAqB;MAC9BH,MAAM,EAAEtB,IAAI,CAACuB;IACf;EACF,CAAC,CAAC,CACDG,UAAU,CAAC,CAAC;EAEf5B,OAAO,CAAC6B,IAAI,CAAC,qCAAqCnB,eAAe,CAACS,KAAK,EAAE,CAAC;EAE1E,MAAMW,WAAW,GAAG,MAAM7B,EAAE,CAAC8B,QAAQ,CAACrB,eAAe,CAACS,KAAK,EAAE,OAAO,CAAC;EACrE,MAAMa,QAAQ,GAAGC,IAAI,CAACC,KAAK,CAACJ,WAAW,CAAC;EAExC9B,OAAO,CAAC6B,IAAI,CAAC,gCAAgCnB,eAAe,CAACgB,MAAM,EAAE,CAAC;EAEtErB,qBAAqB,CAAC2B,QAAQ,EAAEtB,eAAe,CAACgB,MAAM,CAAC;EAEvD1B,OAAO,CAACmC,OAAO,CAAC,6BAA6BzB,eAAe,CAACgB,MAAM,EAAE,CAAC;AACxE","ignoreList":[]}
1
+ {"version":3,"file":"main.js","names":["consola","fs","path","yargs","hideBin","writeImportedOntology","main","args","process","argv","commandLineOpts","version","wrap","Math","min","terminalWidth","strict","help","options","input","alias","describe","type","demandOption","coerce","resolve","output","default","parseAsync","info","jsonContent","readFile","metadata","JSON","parse","success"],"sources":["main.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 { consola } from \"consola\";\nimport * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\nimport yargs from \"yargs\";\nimport { hideBin } from \"yargs/helpers\";\nimport { writeImportedOntology } from \"../generate/writeImportedOntology.js\";\n\nexport default async function main(\n args: string[] = process.argv,\n): Promise<void> {\n const commandLineOpts = await yargs(hideBin(args))\n .version(process.env.PACKAGE_VERSION ?? \"\")\n .wrap(Math.min(150, yargs().terminalWidth()))\n .strict()\n .help()\n .options({\n input: {\n alias: \"i\",\n describe: \"Path to OntologyFullMetadata JSON file\",\n type: \"string\",\n demandOption: true,\n coerce: path.resolve,\n },\n output: {\n alias: \"o\",\n describe: \"Output directory for generated TypeScript files\",\n type: \"string\",\n default: \"./generated-imports\",\n coerce: path.resolve,\n },\n })\n .parseAsync();\n\n consola.info(`Reading OntologyFullMetadata from ${commandLineOpts.input}`);\n\n const jsonContent = await fs.readFile(commandLineOpts.input, \"utf-8\");\n const metadata = JSON.parse(jsonContent);\n\n consola.info(`Writing generated imports to ${commandLineOpts.output}`);\n\n writeImportedOntology(metadata, commandLineOpts.output);\n\n consola.success(`Generated import files in ${commandLineOpts.output}`);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,OAAO,QAAQ,SAAS;AACjC,OAAO,KAAKC,EAAE,MAAM,kBAAkB;AACtC,OAAO,KAAKC,IAAI,MAAM,WAAW;AACjC,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,OAAO,QAAQ,eAAe;AACvC,SAASC,qBAAqB,QAAQ,sCAAsC;AAE5E,eAAe,eAAeC,IAAIA,CAChCC,IAAc,GAAGC,OAAO,CAACC,IAAI,EACd;EACf,MAAMC,eAAe,GAAG,MAAMP,KAAK,CAACC,OAAO,CAACG,IAAI,CAAC,CAAC,CAC/CI,OAAO,CAAC,kBAA+B,EAAE,CAAC,CAC1CC,IAAI,CAACC,IAAI,CAACC,GAAG,CAAC,GAAG,EAAEX,KAAK,CAAC,CAAC,CAACY,aAAa,CAAC,CAAC,CAAC,CAAC,CAC5CC,MAAM,CAAC,CAAC,CACRC,IAAI,CAAC,CAAC,CACNC,OAAO,CAAC;IACPC,KAAK,EAAE;MACLC,KAAK,EAAE,GAAG;MACVC,QAAQ,EAAE,wCAAwC;MAClDC,IAAI,EAAE,QAAQ;MACdC,YAAY,EAAE,IAAI;MAClBC,MAAM,EAAEtB,IAAI,CAACuB;IACf,CAAC;IACDC,MAAM,EAAE;MACNN,KAAK,EAAE,GAAG;MACVC,QAAQ,EAAE,iDAAiD;MAC3DC,IAAI,EAAE,QAAQ;MACdK,OAAO,EAAE,qBAAqB;MAC9BH,MAAM,EAAEtB,IAAI,CAACuB;IACf;EACF,CAAC,CAAC,CACDG,UAAU,CAAC,CAAC;EAEf5B,OAAO,CAAC6B,IAAI,CAAC,qCAAqCnB,eAAe,CAACS,KAAK,EAAE,CAAC;EAE1E,MAAMW,WAAW,GAAG,MAAM7B,EAAE,CAAC8B,QAAQ,CAACrB,eAAe,CAACS,KAAK,EAAE,OAAO,CAAC;EACrE,MAAMa,QAAQ,GAAGC,IAAI,CAACC,KAAK,CAACJ,WAAW,CAAC;EAExC9B,OAAO,CAAC6B,IAAI,CAAC,gCAAgCnB,eAAe,CAACgB,MAAM,EAAE,CAAC;EAEtErB,qBAAqB,CAAC2B,QAAQ,EAAEtB,eAAe,CAACgB,MAAM,CAAC;EAEvD1B,OAAO,CAACmC,OAAO,CAAC,6BAA6BzB,eAAe,CAACgB,MAAM,EAAE,CAAC;AACxE","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osdk/maker-import",
3
- "version": "0.4.0",
3
+ "version": "0.4.1-beta.0",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -27,19 +27,19 @@
27
27
  }
28
28
  },
29
29
  "dependencies": {
30
- "@osdk/foundry.ontologies": "2.57.0",
30
+ "@osdk/foundry.ontologies": "2.61.0",
31
31
  "consola": "^3.4.2",
32
32
  "yargs": "^17.7.2",
33
- "@osdk/client.unstable": "~2.23.0",
34
- "@osdk/maker": "~0.29.0"
33
+ "@osdk/client.unstable": "~2.23.1-beta.2",
34
+ "@osdk/maker": "~0.29.1-beta.0"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/node": "^20.19.13",
38
38
  "@types/yargs": "^17.0.33",
39
39
  "typescript": "~5.5.4",
40
40
  "vitest": "^3.2.4",
41
- "@osdk/monorepo.api-extractor": "~0.7.0",
42
- "@osdk/monorepo.tsconfig": "~0.7.0"
41
+ "@osdk/monorepo.tsconfig": "~0.7.0",
42
+ "@osdk/monorepo.api-extractor": "~0.7.0"
43
43
  },
44
44
  "publishConfig": {
45
45
  "access": "public"