@osdk/maker-import 0.41.0 → 0.42.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,11 @@
1
1
  # @osdk/maker-import
2
2
 
3
+ ## 0.42.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 47cf6a2: Preserve interface links on import
8
+
3
9
  ## 0.41.0
4
10
 
5
11
  ### 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.41.0" ?? "").wrap(Math.min(150, yargs().terminalWidth())).strict().help().options({
24
+ const commandLineOpts = await yargs(hideBin(args)).version("0.42.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",
@@ -74,8 +74,9 @@ export function convertInterfaceType(iface, allInterfaces) {
74
74
  description: iface.description ?? ""
75
75
  },
76
76
  extendsInterfaces,
77
- links: [],
77
+ links: Object.values(iface.links).map(convertInterfaceLinkType),
78
78
  actionTypeConstraints: [],
79
+ // these don't exist on the gateway type
79
80
  status: {
80
81
  type: "active",
81
82
  active: {}
@@ -85,4 +86,23 @@ export function convertInterfaceType(iface, allInterfaces) {
85
86
  searchable: true
86
87
  };
87
88
  }
89
+ function convertInterfaceLinkType(link) {
90
+ const destination = link.linkedEntityApiName;
91
+ return {
92
+ cardinality: link.cardinality === "ONE" ? "SINGLE" : "MANY",
93
+ linkedEntityTypeId: destination.type === "interfaceTypeApiName" ? {
94
+ type: "interfaceType",
95
+ interfaceType: destination.apiName
96
+ } : {
97
+ type: "objectType",
98
+ objectType: destination.apiName
99
+ },
100
+ metadata: {
101
+ apiName: link.apiName,
102
+ displayName: link.displayName,
103
+ description: link.description ?? ""
104
+ },
105
+ required: link.required
106
+ };
107
+ }
88
108
  //# sourceMappingURL=convertInterfaceType.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"convertInterfaceType.js","names":["OntologyEntityTypeEnum","consola","convertSharedPropertyType","mapPropertyType","withoutNamespace","convertInterfaceType","iface","allInterfaces","shortName","apiName","propertiesV2","propertiesV3","_propApiName","prop","Object","entries","type","converted","entry","sharedPropertyType","required","mapped","dataType","array","displayName","description","requireImplementation","warn","extendsInterfaces","extApiName","extIface","push","__type","INTERFACE_TYPE","displayMetadata","links","actionTypeConstraints","status","active","searchable"],"sources":["convertInterfaceType.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 Ontologies from \"@osdk/foundry.ontologies\";\nimport type {\n InterfacePropertyType,\n InterfaceType,\n SharedPropertyType,\n} from \"@osdk/maker\";\nimport { OntologyEntityTypeEnum } from \"@osdk/maker\";\nimport { consola } from \"consola\";\n\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(\n iface: Ontologies.InterfaceType,\n allInterfaces: Record<string, Ontologies.InterfaceType>,\n): InterfaceType {\n const shortName = withoutNamespace(iface.apiName);\n\n // propertiesV2 is SPT-only; propertiesV3 also carries inline-defined properties.\n const propertiesV2: Record<\n string,\n { sharedPropertyType: SharedPropertyType; required: boolean }\n > = {};\n const propertiesV3: Record<string, InterfacePropertyType> = {};\n\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: prop.required,\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(\n `Skipping interface-defined property \"${prop.apiName}\": unsupported type \"${prop.dataType.type}\"`,\n );\n }\n }\n }\n\n // Resolve extendsInterfaces — recursively convert referenced interfaces\n const extendsInterfaces: Array<InterfaceType> = [];\n for (const extApiName of iface.extendsInterfaces) {\n const extIface = allInterfaces[extApiName];\n if (extIface) {\n extendsInterfaces.push(convertInterfaceType(extIface, allInterfaces));\n }\n }\n\n return {\n __type: OntologyEntityTypeEnum.INTERFACE_TYPE,\n apiName: iface.apiName,\n displayMetadata: {\n displayName: iface.displayName ?? shortName,\n description: iface.description ?? \"\",\n },\n extendsInterfaces,\n links: [],\n actionTypeConstraints: [],\n status: { type: \"active\", active: {} },\n propertiesV2,\n propertiesV3,\n searchable: true,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA,SAASA,sBAAsB,QAAQ,aAAa;AACpD,SAASC,OAAO,QAAQ,SAAS;AAEjC,SAASC,yBAAyB,QAAQ,gCAAgC;AAC1E,SAASC,eAAe,QAAQ,sBAAsB;AACtD,SAASC,gBAAgB,QAAQ,YAAY;;AAE7C;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,oBA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;IACF;EACF;;EAEA;EACA,MAAMY,iBAAuC,GAAG,EAAE;EAClD,KAAK,MAAMC,UAAU,IAAIvB,KAAK,CAACsB,iBAAiB,EAAE;IAChD,MAAME,QAAQ,GAAGvB,aAAa,CAACsB,UAAU,CAAC;IAC1C,IAAIC,QAAQ,EAAE;MACZF,iBAAiB,CAACG,IAAI,CAAC1B,oBAAoB,CAACyB,QAAQ,EAAEvB,aAAa,CAAC,CAAC;IACvE;EACF;EAEA,OAAO;IACLyB,MAAM,EAAEhC,sBAAsB,CAACiC,cAAc;IAC7CxB,OAAO,EAAEH,KAAK,CAACG,OAAO;IACtByB,eAAe,EAAE;MACfV,WAAW,EAAElB,KAAK,CAACkB,WAAW,IAAIhB,SAAS;MAC3CiB,WAAW,EAAEnB,KAAK,CAACmB,WAAW,IAAI;IACpC,CAAC;IACDG,iBAAiB;IACjBO,KAAK,EAAE,EAAE;IACTC,qBAAqB,EAAE,EAAE;IACzBC,MAAM,EAAE;MAAErB,IAAI,EAAE,QAAQ;MAAEsB,MAAM,EAAE,CAAC;IAAE,CAAC;IACtC5B,YAAY;IACZC,YAAY;IACZ4B,UAAU,EAAE;EACd,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"convertInterfaceType.js","names":["OntologyEntityTypeEnum","consola","convertSharedPropertyType","mapPropertyType","withoutNamespace","convertInterfaceType","iface","allInterfaces","shortName","apiName","propertiesV2","propertiesV3","_propApiName","prop","Object","entries","type","converted","entry","sharedPropertyType","required","mapped","dataType","array","displayName","description","requireImplementation","warn","extendsInterfaces","extApiName","extIface","push","__type","INTERFACE_TYPE","displayMetadata","links","values","map","convertInterfaceLinkType","actionTypeConstraints","status","active","searchable","link","destination","linkedEntityApiName","cardinality","linkedEntityTypeId","interfaceType","objectType","metadata"],"sources":["convertInterfaceType.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 Ontologies from \"@osdk/foundry.ontologies\";\nimport type {\n InterfacePropertyType,\n InterfaceType,\n SharedPropertyType,\n} from \"@osdk/maker\";\nimport { OntologyEntityTypeEnum } from \"@osdk/maker\";\nimport { consola } from \"consola\";\n\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(\n iface: Ontologies.InterfaceType,\n allInterfaces: Record<string, Ontologies.InterfaceType>,\n): InterfaceType {\n const shortName = withoutNamespace(iface.apiName);\n\n // propertiesV2 is SPT-only; propertiesV3 also carries inline-defined properties.\n const propertiesV2: Record<\n string,\n { sharedPropertyType: SharedPropertyType; required: boolean }\n > = {};\n const propertiesV3: Record<string, InterfacePropertyType> = {};\n\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: prop.required,\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(\n `Skipping interface-defined property \"${prop.apiName}\": unsupported type \"${prop.dataType.type}\"`,\n );\n }\n }\n }\n\n // Resolve extendsInterfaces — recursively convert referenced interfaces\n const extendsInterfaces: Array<InterfaceType> = [];\n for (const extApiName of iface.extendsInterfaces) {\n const extIface = allInterfaces[extApiName];\n if (extIface) {\n extendsInterfaces.push(convertInterfaceType(extIface, allInterfaces));\n }\n }\n\n return {\n __type: OntologyEntityTypeEnum.INTERFACE_TYPE,\n apiName: iface.apiName,\n displayMetadata: {\n displayName: iface.displayName ?? shortName,\n description: iface.description ?? \"\",\n },\n extendsInterfaces,\n links: Object.values(iface.links).map(convertInterfaceLinkType),\n actionTypeConstraints: [], // these don't exist on the gateway type\n status: { type: \"active\", active: {} },\n propertiesV2,\n propertiesV3,\n searchable: true,\n };\n}\n\nfunction convertInterfaceLinkType(\n link: Ontologies.InterfaceLinkType,\n): InterfaceType[\"links\"][number] {\n const destination = link.linkedEntityApiName;\n return {\n cardinality: link.cardinality === \"ONE\" ? \"SINGLE\" : \"MANY\",\n linkedEntityTypeId:\n destination.type === \"interfaceTypeApiName\"\n ? { type: \"interfaceType\", interfaceType: destination.apiName }\n : { type: \"objectType\", objectType: destination.apiName },\n metadata: {\n apiName: link.apiName,\n displayName: link.displayName,\n description: link.description ?? \"\",\n },\n required: link.required,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA,SAASA,sBAAsB,QAAQ,aAAa;AACpD,SAASC,OAAO,QAAQ,SAAS;AAEjC,SAASC,yBAAyB,QAAQ,gCAAgC;AAC1E,SAASC,eAAe,QAAQ,sBAAsB;AACtD,SAASC,gBAAgB,QAAQ,YAAY;;AAE7C;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,oBAAoBA,CAClCC,KAA+B,EAC/BC,aAAuD,EACxC;EACf,MAAMC,SAAS,GAAGJ,gBAAgB,CAACE,KAAK,CAACG,OAAO,CAAC;;EAEjD;EACA,MAAMC,YAGL,GAAG,C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IACnC,CAAC;IACDL,QAAQ,EAAEuB,IAAI,CAACvB;EACjB,CAAC;AACH","ignoreList":[]}
@@ -429,8 +429,9 @@ function convertInterfaceType(iface, allInterfaces) {
429
429
  description: iface.description ?? ""
430
430
  },
431
431
  extendsInterfaces,
432
- links: [],
432
+ links: Object.values(iface.links).map(convertInterfaceLinkType),
433
433
  actionTypeConstraints: [],
434
+ // these don't exist on the gateway type
434
435
  status: {
435
436
  type: "active",
436
437
  active: {}
@@ -440,6 +441,25 @@ function convertInterfaceType(iface, allInterfaces) {
440
441
  searchable: true
441
442
  };
442
443
  }
444
+ function convertInterfaceLinkType(link) {
445
+ const destination = link.linkedEntityApiName;
446
+ return {
447
+ cardinality: link.cardinality === "ONE" ? "SINGLE" : "MANY",
448
+ linkedEntityTypeId: destination.type === "interfaceTypeApiName" ? {
449
+ type: "interfaceType",
450
+ interfaceType: destination.apiName
451
+ } : {
452
+ type: "objectType",
453
+ objectType: destination.apiName
454
+ },
455
+ metadata: {
456
+ apiName: link.apiName,
457
+ displayName: link.displayName,
458
+ description: link.description ?? ""
459
+ },
460
+ required: link.required
461
+ };
462
+ }
443
463
  function convertObjectType(fullMetadata) {
444
464
  const obj = fullMetadata.objectType;
445
465
  const properties = [];
@@ -618,7 +638,7 @@ export const ${varName}: ${typeName} = wrapWithProxy(${varName}_base);
618
638
 
619
639
  // src/cli/main.ts
620
640
  async function main(args = process.argv) {
621
- const commandLineOpts = await yargs__default.default(helpers.hideBin(args)).version("0.41.0").wrap(Math.min(150, yargs__default.default().terminalWidth())).strict().help().options({
641
+ const commandLineOpts = await yargs__default.default(helpers.hideBin(args)).version("0.42.0").wrap(Math.min(150, yargs__default.default().terminalWidth())).strict().help().options({
622
642
  input: {
623
643
  alias: "i",
624
644
  describe: "Path to OntologyFullMetadata JSON file",
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/generate/mapActionParameterType.ts","../../src/generate/convertActionType.ts","../../src/generate/mapPropertyType.ts","../../src/generate/utils.ts","../../src/generate/convertSharedPropertyType.ts","../../src/generate/convertInterfaceType.ts","../../src/generate/convertObjectType.ts","../../src/generate/writeImportedOntology.ts","../../src/cli/main.ts"],"names":["consola","extractAllowedValuesFromActionParameterType","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,EAAS;AACX,CAAA;AACA,SAAS,mBAAmB,SAAA,EAAW;AACrC,EAAA,QAAQ,UAAU,IAAA;AAAM,IACtB,KAAK,SAAA;AACH,MAAA,OAAO;AAAA,QACL,IAAA,EAAM,SAAA;AAAA,QACN,SAAS;AAAC,OACZ;AAAA,IACF,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,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,EAAAP,eAAAA,CAAQ,IAAA,CAAK,CAAA,kCAAA,EAAqC,eAAA,CAAgB,KAAK,CAAA,CAAE,CAAA;AACzE,EAAA,MAAM,WAAA,GAAc,MAASQ,cAAA,CAAA,QAAA,CAAS,eAAA,CAAgB,OAAO,OAAO,CAAA;AACpE,EAAA,MAAM,QAAA,GAAW,IAAA,CAAK,KAAA,CAAM,WAAW,CAAA;AACvC,EAAAR,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\nimport { extractAllowedValuesFromActionParameterType, OntologyEntityTypeEnum } from \"@osdk/maker\";\nimport { consola } from \"consola\";\nimport { mapActionParameterType } from \"./mapActionParameterType.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 description: paramV2.description,\n type: mappedType,\n validation: {\n allowedValues: extractAllowedValuesFromActionParameterType(mappedType),\n required: paramV2.required\n }\n });\n }\n return {\n __type: OntologyEntityTypeEnum.ACTION_TYPE,\n apiName: action.apiName,\n displayName: action.displayName ?? action.apiName,\n description: action.description,\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\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(/\\./gu, \"-\"));\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(/[-_]+(.)?/gu, (_, 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 { 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: prop.required\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 ?? \"\"\n },\n extendsInterfaces,\n links: [],\n actionTypeConstraints: [],\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 const sharedPropertyTypeApiNameByPropertyApiName = new Map(Object.entries(fullMetadata.sharedPropertyTypeMapping).map(([sharedPropertyTypeApiName, propertyApiName]) => [propertyApiName, sharedPropertyTypeApiName]));\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 sharedPropertyTypeApiName = sharedPropertyTypeApiNameByPropertyApiName.get(propApiName);\n // Imported property shapes only need the SPT API name.\n const sharedPropertyType = sharedPropertyTypeApiName ? {\n __type: OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE,\n apiName: sharedPropertyTypeApiName,\n nonNameSpacedApiName: withoutNamespace(sharedPropertyTypeApiName),\n type: mapped.type,\n array: mapped.array\n } : undefined;\n const prop = {\n apiName: propApiName,\n displayName: propV2.displayName ?? propApiName,\n description: propV2.description,\n type: mapped.type,\n sharedPropertyType\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 * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { OntologyEntityTypeEnum } from \"@osdk/maker\";\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};\nexport function convertOntologyFullMetadata(metadata) {\n const result = {\n [OntologyEntityTypeEnum.OBJECT_TYPE]: {},\n [OntologyEntityTypeEnum.ACTION_TYPE]: {},\n [OntologyEntityTypeEnum.LINK_TYPE]: {},\n [OntologyEntityTypeEnum.INTERFACE_TYPE]: {},\n [OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE]: {},\n [OntologyEntityTypeEnum.VALUE_TYPE]: {}\n };\n for (const spt of Object.values(metadata.sharedPropertyTypes)) {\n const converted = convertSharedPropertyType(spt);\n if (converted) {\n result[OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE][converted.apiName] = converted;\n }\n }\n for (const iface of Object.values(metadata.interfaceTypes)) {\n const converted = convertInterfaceType(iface, metadata.interfaceTypes);\n result[OntologyEntityTypeEnum.INTERFACE_TYPE][converted.apiName] = converted;\n }\n for (const objectType of Object.values(metadata.objectTypes)) {\n const converted = convertObjectType(objectType);\n result[OntologyEntityTypeEnum.OBJECT_TYPE][converted.apiName] = converted;\n }\n for (const action of Object.values(metadata.actionTypes)) {\n const converted = convertActionType(action);\n result[OntologyEntityTypeEnum.ACTION_TYPE][converted.apiName] = converted;\n }\n return result;\n}\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 const convertedOntology = convertOntologyFullMetadata(metadata);\n for (const entityType of [OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE, OntologyEntityTypeEnum.INTERFACE_TYPE, OntologyEntityTypeEnum.OBJECT_TYPE, OntologyEntityTypeEnum.ACTION_TYPE]) {\n for (const entity of Object.values(convertedOntology[entityType])) {\n entries.push({\n apiName: entity.apiName,\n entityType,\n entity\n });\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*)\"([^\"]*)\"/gu, (_, 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 * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\nimport { consola } from \"consola\";\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/convertActionType.ts","../../src/generate/mapPropertyType.ts","../../src/generate/utils.ts","../../src/generate/convertSharedPropertyType.ts","../../src/generate/convertInterfaceType.ts","../../src/generate/convertObjectType.ts","../../src/generate/writeImportedOntology.ts","../../src/cli/main.ts"],"names":["consola","extractAllowedValuesFromActionParameterType","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,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ACA,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,EAAAP,eAAAA,CAAQ,IAAA,CAAK,CAAA,kCAAA,EAAqC,eAAA,CAAgB,KAAK,CAAA,CAAE,CAAA;AACzE,EAAA,MAAM,WAAA,GAAc,MAASQ,cAAA,CAAA,QAAA,CAAS,eAAA,CAAgB,OAAO,OAAO,CAAA;AACpE,EAAA,MAAM,QAAA,GAAW,IAAA,CAAK,KAAA,CAAM,WAAW,CAAA;AACvC,EAAAR,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\nimport { extractAllowedValuesFromActionParameterType, OntologyEntityTypeEnum } from \"@osdk/maker\";\nimport { consola } from \"consola\";\nimport { mapActionParameterType } from \"./mapActionParameterType.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 description: paramV2.description,\n type: mappedType,\n validation: {\n allowedValues: extractAllowedValuesFromActionParameterType(mappedType),\n required: paramV2.required\n }\n });\n }\n return {\n __type: OntologyEntityTypeEnum.ACTION_TYPE,\n apiName: action.apiName,\n displayName: action.displayName ?? action.apiName,\n description: action.description,\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\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(/\\./gu, \"-\"));\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(/[-_]+(.)?/gu, (_, 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 { 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: prop.required\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 ?? \"\"\n },\n extendsInterfaces,\n links: Object.values(iface.links).map(convertInterfaceLinkType),\n actionTypeConstraints: [],\n // these don't exist on the gateway type\n status: {\n type: \"active\",\n active: {}\n },\n propertiesV2,\n propertiesV3,\n searchable: true\n };\n}\nfunction convertInterfaceLinkType(link) {\n const destination = link.linkedEntityApiName;\n return {\n cardinality: link.cardinality === \"ONE\" ? \"SINGLE\" : \"MANY\",\n linkedEntityTypeId: destination.type === \"interfaceTypeApiName\" ? {\n type: \"interfaceType\",\n interfaceType: destination.apiName\n } : {\n type: \"objectType\",\n objectType: destination.apiName\n },\n metadata: {\n apiName: link.apiName,\n displayName: link.displayName,\n description: link.description ?? \"\"\n },\n required: link.required\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 const sharedPropertyTypeApiNameByPropertyApiName = new Map(Object.entries(fullMetadata.sharedPropertyTypeMapping).map(([sharedPropertyTypeApiName, propertyApiName]) => [propertyApiName, sharedPropertyTypeApiName]));\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 sharedPropertyTypeApiName = sharedPropertyTypeApiNameByPropertyApiName.get(propApiName);\n // Imported property shapes only need the SPT API name.\n const sharedPropertyType = sharedPropertyTypeApiName ? {\n __type: OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE,\n apiName: sharedPropertyTypeApiName,\n nonNameSpacedApiName: withoutNamespace(sharedPropertyTypeApiName),\n type: mapped.type,\n array: mapped.array\n } : undefined;\n const prop = {\n apiName: propApiName,\n displayName: propV2.displayName ?? propApiName,\n description: propV2.description,\n type: mapped.type,\n sharedPropertyType\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 * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { OntologyEntityTypeEnum } from \"@osdk/maker\";\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};\nexport function convertOntologyFullMetadata(metadata) {\n const result = {\n [OntologyEntityTypeEnum.OBJECT_TYPE]: {},\n [OntologyEntityTypeEnum.ACTION_TYPE]: {},\n [OntologyEntityTypeEnum.LINK_TYPE]: {},\n [OntologyEntityTypeEnum.INTERFACE_TYPE]: {},\n [OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE]: {},\n [OntologyEntityTypeEnum.VALUE_TYPE]: {}\n };\n for (const spt of Object.values(metadata.sharedPropertyTypes)) {\n const converted = convertSharedPropertyType(spt);\n if (converted) {\n result[OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE][converted.apiName] = converted;\n }\n }\n for (const iface of Object.values(metadata.interfaceTypes)) {\n const converted = convertInterfaceType(iface, metadata.interfaceTypes);\n result[OntologyEntityTypeEnum.INTERFACE_TYPE][converted.apiName] = converted;\n }\n for (const objectType of Object.values(metadata.objectTypes)) {\n const converted = convertObjectType(objectType);\n result[OntologyEntityTypeEnum.OBJECT_TYPE][converted.apiName] = converted;\n }\n for (const action of Object.values(metadata.actionTypes)) {\n const converted = convertActionType(action);\n result[OntologyEntityTypeEnum.ACTION_TYPE][converted.apiName] = converted;\n }\n return result;\n}\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 const convertedOntology = convertOntologyFullMetadata(metadata);\n for (const entityType of [OntologyEntityTypeEnum.SHARED_PROPERTY_TYPE, OntologyEntityTypeEnum.INTERFACE_TYPE, OntologyEntityTypeEnum.OBJECT_TYPE, OntologyEntityTypeEnum.ACTION_TYPE]) {\n for (const entity of Object.values(convertedOntology[entityType])) {\n entries.push({\n apiName: entity.apiName,\n entityType,\n entity\n });\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*)\"([^\"]*)\"/gu, (_, 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 * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\nimport { consola } from \"consola\";\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.41.0" ?? "").wrap(Math.min(150, yargs().terminalWidth())).strict().help().options({
24
+ const commandLineOpts = await yargs(hideBin(args)).version("0.42.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",
@@ -74,8 +74,9 @@ export function convertInterfaceType(iface, allInterfaces) {
74
74
  description: iface.description ?? ""
75
75
  },
76
76
  extendsInterfaces,
77
- links: [],
77
+ links: Object.values(iface.links).map(convertInterfaceLinkType),
78
78
  actionTypeConstraints: [],
79
+ // these don't exist on the gateway type
79
80
  status: {
80
81
  type: "active",
81
82
  active: {}
@@ -85,4 +86,23 @@ export function convertInterfaceType(iface, allInterfaces) {
85
86
  searchable: true
86
87
  };
87
88
  }
89
+ function convertInterfaceLinkType(link) {
90
+ const destination = link.linkedEntityApiName;
91
+ return {
92
+ cardinality: link.cardinality === "ONE" ? "SINGLE" : "MANY",
93
+ linkedEntityTypeId: destination.type === "interfaceTypeApiName" ? {
94
+ type: "interfaceType",
95
+ interfaceType: destination.apiName
96
+ } : {
97
+ type: "objectType",
98
+ objectType: destination.apiName
99
+ },
100
+ metadata: {
101
+ apiName: link.apiName,
102
+ displayName: link.displayName,
103
+ description: link.description ?? ""
104
+ },
105
+ required: link.required
106
+ };
107
+ }
88
108
  //# sourceMappingURL=convertInterfaceType.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"convertInterfaceType.js","names":["OntologyEntityTypeEnum","consola","convertSharedPropertyType","mapPropertyType","withoutNamespace","convertInterfaceType","iface","allInterfaces","shortName","apiName","propertiesV2","propertiesV3","_propApiName","prop","Object","entries","type","converted","entry","sharedPropertyType","required","mapped","dataType","array","displayName","description","requireImplementation","warn","extendsInterfaces","extApiName","extIface","push","__type","INTERFACE_TYPE","displayMetadata","links","actionTypeConstraints","status","active","searchable"],"sources":["convertInterfaceType.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 Ontologies from \"@osdk/foundry.ontologies\";\nimport type {\n InterfacePropertyType,\n InterfaceType,\n SharedPropertyType,\n} from \"@osdk/maker\";\nimport { OntologyEntityTypeEnum } from \"@osdk/maker\";\nimport { consola } from \"consola\";\n\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(\n iface: Ontologies.InterfaceType,\n allInterfaces: Record<string, Ontologies.InterfaceType>,\n): InterfaceType {\n const shortName = withoutNamespace(iface.apiName);\n\n // propertiesV2 is SPT-only; propertiesV3 also carries inline-defined properties.\n const propertiesV2: Record<\n string,\n { sharedPropertyType: SharedPropertyType; required: boolean }\n > = {};\n const propertiesV3: Record<string, InterfacePropertyType> = {};\n\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: prop.required,\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(\n `Skipping interface-defined property \"${prop.apiName}\": unsupported type \"${prop.dataType.type}\"`,\n );\n }\n }\n }\n\n // Resolve extendsInterfaces — recursively convert referenced interfaces\n const extendsInterfaces: Array<InterfaceType> = [];\n for (const extApiName of iface.extendsInterfaces) {\n const extIface = allInterfaces[extApiName];\n if (extIface) {\n extendsInterfaces.push(convertInterfaceType(extIface, allInterfaces));\n }\n }\n\n return {\n __type: OntologyEntityTypeEnum.INTERFACE_TYPE,\n apiName: iface.apiName,\n displayMetadata: {\n displayName: iface.displayName ?? shortName,\n description: iface.description ?? \"\",\n },\n extendsInterfaces,\n links: [],\n actionTypeConstraints: [],\n status: { type: \"active\", active: {} },\n propertiesV2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CO,IAAI,EAAEK,MAAM,CAACL,IAAI;UACjBO,KAAK,EAAEF,MAAM,CAACE,KAAK;UACnBC,WAAW,EAAEX,IAAI,CAACW,WAAW;UAC7BC,WAAW,EAAEZ,IAAI,CAACY,WAAW;UAC7BL,QAAQ,EAAEP,IAAI,CAACa;QACjB,CAAC;MACH,CAAC,MAAM;QACLzB,OAAO,CAAC0B,IAAI,CACV,wCAAwCd,IAAI,CAACJ,OAAO,wBAAwBI,IAAI,CAACS,QAAQ,CAACN,IAAI,GAChG,CAAC;MACH;IACF;EACF;;EAEA;EACA,MAAMY,iBAAuC,GAAG,EAAE;EAClD,KAAK,MAAMC,UAAU,IAAIvB,KAAK,CAACsB,iBAAiB,EAAE;IAChD,MAAME,QAAQ,GAAGvB,aAAa,CAACsB,UAAU,CAAC;IAC1C,IAAIC,QAAQ,EAAE;MACZF,iBAAiB,CAACG,IAAI,CAAC1B,oBAAoB,CAACyB,QAAQ,EAAEvB,aAAa,CAAC,CAAC;IACvE;EACF;EAEA,OAAO;IACLyB,MAAM,EAAEhC,sBAAsB,CAACiC,cAAc;IAC7CxB,OAAO,EAAEH,KAAK,CAACG,OAAO;IACtByB,eAAe,EAAE;MACfV,WAAW,EAAElB,KAAK,CAACkB,WAAW,IAAIhB,SAAS;MAC3CiB,WAAW,EAAEnB,KAAK,CAACmB,WAAW,IAAI;IACpC,CAAC;IACDG,iBAAiB;IACjBO,KAAK,EAAE,EAAE;IACTC,qBAAqB,EAAE,EAAE;IACzBC,MAAM,EAAE;MAAErB,IAAI,EAAE,QAAQ;MAAEsB,MAAM,EAAE,CAAC;IAAE,CAAC;IACtC5B,YAAY;IACZC,YAAY;IACZ4B,UAAU,EAAE;EACd,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"convertInterfaceType.js","names":["OntologyEntityTypeEnum","consola","convertSharedPropertyType","mapPropertyType","withoutNamespace","convertInterfaceType","iface","allInterfaces","shortName","apiName","propertiesV2","propertiesV3","_propApiName","prop","Object","entries","type","converted","entry","sharedPropertyType","required","mapped","dataType","array","displayName","description","requireImplementation","warn","extendsInterfaces","extApiName","extIface","push","__type","INTERFACE_TYPE","displayMetadata","links","values","map","convertInterfaceLinkType","actionTypeConstraints","status","active","searchable","link","destination","linkedEntityApiName","cardinality","linkedEntityTypeId","interfaceType","objectType","metadata"],"sources":["convertInterfaceType.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 Ontologies from \"@osdk/foundry.ontologies\";\nimport type {\n InterfacePropertyType,\n InterfaceType,\n SharedPropertyType,\n} from \"@osdk/maker\";\nimport { OntologyEntityTypeEnum } from \"@osdk/maker\";\nimport { consola } from \"consola\";\n\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(\n iface: Ontologies.InterfaceType,\n allInterfaces: Record<string, Ontologies.InterfaceType>,\n): InterfaceType {\n const shortName = withoutNamespace(iface.apiName);\n\n // propertiesV2 is SPT-only; propertiesV3 also carries inline-defined properties.\n const propertiesV2: Record<\n string,\n { sharedPropertyType: SharedPropertyType; required: boolean }\n > = {};\n const propertiesV3: Record<string, InterfacePropertyType> = {};\n\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: prop.required,\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(\n `Skipping interface-defined property \"${prop.apiName}\": unsupported type \"${prop.dataType.type}\"`,\n );\n }\n }\n }\n\n // Resolve extendsInterfaces — recursively convert referenced interfaces\n const extendsInterfaces: Array<InterfaceType> = [];\n for (const extApiName of iface.extendsInterfaces) {\n const extIface = allInterfaces[extApiName];\n if (extIface) {\n extendsInterfaces.push(convertInterfaceType(extIface, allInterfaces));\n }\n }\n\n return {\n __type: OntologyEntityTypeEnum.INTERFACE_TYPE,\n apiName: iface.apiName,\n displayMetadata: {\n displayName: iface.displayName ?? shortName,\n description: iface.description ?? \"\",\n },\n extendsInterfaces,\n links: Object.values(iface.links).map(convertInterfaceLinkType),\n actionTypeConstraints: [], // these don't exist on the gateway type\n status: { type: \"active\", active: {} },\n propertiesV2,\n propertiesV3,\n searchable: true,\n };\n}\n\nfunction convertInterfaceLinkType(\n link: Ontologies.InterfaceLinkType,\n): InterfaceType[\"links\"][number] {\n const destination = link.linkedEntityApiName;\n return {\n cardinality: link.cardinality === \"ONE\" ? \"SINGLE\" : \"MANY\",\n linkedEntityTypeId:\n destination.type === \"interfaceTypeApiName\"\n ? { type: \"interfaceType\", interfaceType: destination.apiName }\n : { type: \"objectType\", objectType: destination.apiName },\n metadata: {\n apiName: link.apiName,\n displayName: link.displayName,\n description: link.description ?? \"\",\n },\n required: link.required,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA,SAASA,sBAAsB,QAAQ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IAAI,KAAK,sBAAsB,GACvC;MAAEA,IAAI,EAAE,eAAe;MAAEgC,aAAa,EAAEJ,WAAW,CAACnC;IAAQ,CAAC,GAC7D;MAAEO,IAAI,EAAE,YAAY;MAAEiC,UAAU,EAAEL,WAAW,CAACnC;IAAQ,CAAC;IAC7DyC,QAAQ,EAAE;MACRzC,OAAO,EAAEkC,IAAI,CAAClC,OAAO;MACrBe,WAAW,EAAEmB,IAAI,CAACnB,WAAW;MAC7BC,WAAW,EAAEkB,IAAI,CAAClB,WAAW,IAAI;IACnC,CAAC;IACDL,QAAQ,EAAEuB,IAAI,CAACvB;EACjB,CAAC;AACH","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osdk/maker-import",
3
- "version": "0.41.0",
3
+ "version": "0.42.0",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -30,7 +30,7 @@
30
30
  "@osdk/foundry.ontologies": "2.78.0",
31
31
  "consola": "^3.4.2",
32
32
  "yargs": "^17.7.2",
33
- "@osdk/client.unstable": "~2.74.0",
33
+ "@osdk/client.unstable": "~2.75.0",
34
34
  "@osdk/maker": "~0.75.0"
35
35
  },
36
36
  "devDependencies": {
@@ -38,8 +38,8 @@
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"