@osdk/generator 2.1.0-beta.28 → 2.1.0-beta.29

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/generator
2
2
 
3
+ ## 2.1.0-beta.29
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [f1145ff]
8
+ - @osdk/api@2.1.0-beta.29
9
+ - @osdk/generator-converters@2.1.0-beta.29
10
+
3
11
  ## 2.1.0-beta.28
4
12
 
5
13
  ### Patch Changes
@@ -69,7 +69,7 @@ var EnhancedBase = class extends AbstractImportable {
69
69
  };
70
70
  function extractNamespace(fqApiName) {
71
71
  const last = fqApiName.lastIndexOf(".");
72
- if (last === -1) return [void 0, fqApiName];
72
+ if (last === -1) return [undefined, fqApiName];
73
73
  return [fqApiName.slice(0, last), fqApiName.slice(last + 1)];
74
74
  }
75
75
 
@@ -101,7 +101,7 @@ var EnhancedAction = class extends EnhancedBase {
101
101
 
102
102
  // src/util/deleteUndefineds.ts
103
103
  function deleteUndefineds(obj) {
104
- return Object.fromEntries(Object.entries(obj).filter(([, value]) => value !== void 0));
104
+ return Object.fromEntries(Object.entries(obj).filter(([, value]) => value !== undefined));
105
105
  }
106
106
 
107
107
  // src/GenerateContext/EnhancedInterfaceType.ts
@@ -390,7 +390,7 @@ async function generatePerActionDataFiles({
390
390
  ${entries.map(([key, value]) => {
391
391
  return `"${key}": {
392
392
  ${stringify(value, {
393
- description: (value2, d) => value2 ? d(value2) : void 0,
393
+ description: (value2, d) => value2 ? d(value2) : undefined,
394
394
  // trick to remove undefineds
395
395
  type: (type) => {
396
396
  if (typeof type === "string") {
@@ -407,7 +407,7 @@ async function generatePerActionDataFiles({
407
407
  } else if (type.type === "struct") {
408
408
  return `ActionMetadata.DataType.Struct<${JSON.stringify(type.struct)}>`;
409
409
  }
410
- return void 0;
410
+ return undefined;
411
411
  }
412
412
  })}
413
413
  }`;
@@ -473,12 +473,12 @@ async function generatePerActionDataFiles({
473
473
  signatures: ${action.shortApiName}.Signatures;
474
474
  },
475
475
  ${stringify(fullActionDef, {
476
- "description": () => void 0,
477
- "displayName": () => void 0,
478
- "modifiedEntities": () => void 0,
479
- "parameters": () => void 0,
480
- "rid": () => void 0,
481
- "status": () => void 0
476
+ "description": () => undefined,
477
+ "displayName": () => undefined,
478
+ "modifiedEntities": () => undefined,
479
+ "parameters": () => undefined,
480
+ "rid": () => undefined,
481
+ "status": () => undefined
482
482
  })}
483
483
  osdkMetadata: typeof $osdkMetadata;
484
484
  }
@@ -488,12 +488,12 @@ async function generatePerActionDataFiles({
488
488
  return ` export const ${action.shortApiName}: ${action.shortApiName} =
489
489
  {
490
490
  ${stringify(fullActionDef, {
491
- "description": () => void 0,
492
- "displayName": () => void 0,
493
- "modifiedEntities": () => void 0,
494
- "parameters": () => void 0,
495
- "rid": () => void 0,
496
- "status": () => void 0
491
+ "description": () => undefined,
492
+ "displayName": () => undefined,
493
+ "modifiedEntities": () => undefined,
494
+ "parameters": () => undefined,
495
+ "rid": () => undefined,
496
+ "status": () => undefined
497
497
  })},
498
498
  osdkMetadata: $osdkMetadata
499
499
  }
@@ -530,7 +530,7 @@ async function generatePerActionDataFiles({
530
530
  }
531
531
  }
532
532
  }
533
- const imports = getObjectImports(referencedObjectDefs, void 0, currentFilePath, true);
533
+ const imports = getObjectImports(referencedObjectDefs, undefined, currentFilePath, true);
534
534
  await fs2.writeFile(path8__namespace.default.join(rootOutDir, currentFilePath), await formatTs(`
535
535
  import type {
536
536
  ActionDefinition,
@@ -595,7 +595,7 @@ function extractReferencedObjectsFromActionParameter(actionParameter) {
595
595
  case "integer":
596
596
  case "long":
597
597
  case "timestamp":
598
- return void 0;
598
+ return undefined;
599
599
  }
600
600
  }
601
601
 
@@ -849,9 +849,9 @@ function __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(interfaceDef, ontology,
849
849
  }
850
850
  for (const apiName of Object.keys(parent.properties)) {
851
851
  if (definition.properties[apiName] != null) {
852
- !fastDeepEqual__default.default(definition.properties[apiName], parent.properties[apiName]) ? process.env.NODE_ENV !== "production" ? invariant__default.default(false, `Interface ${definition.apiName} redefines property '${apiName}' from parent '${parent.apiName}' but the properties do not match`) : invariant__default.default(false) : void 0;
852
+ !fastDeepEqual__default.default(definition.properties[apiName], parent.properties[apiName]) ? process.env.NODE_ENV !== "production" ? invariant__default.default(false, `Interface ${definition.apiName} redefines property '${apiName}' from parent '${parent.apiName}' but the properties do not match`) : invariant__default.default(false) : undefined;
853
853
  } else if (mergedProperties[apiName] != null) {
854
- !fastDeepEqual__default.default(mergedProperties[apiName], parent.properties[apiName]) ? process.env.NODE_ENV !== "production" ? invariant__default.default(false, `Some interface defines a conflicting property '${apiName}' that does not match property from parent '${parent.apiName}'`) : invariant__default.default(false) : void 0;
854
+ !fastDeepEqual__default.default(mergedProperties[apiName], parent.properties[apiName]) ? process.env.NODE_ENV !== "production" ? invariant__default.default(false, `Some interface defines a conflicting property '${apiName}' that does not match property from parent '${parent.apiName}'`) : invariant__default.default(false) : undefined;
855
855
  }
856
856
  mergedProperties[apiName] = parent.properties[apiName];
857
857
  }
@@ -1117,9 +1117,9 @@ async function generateV2QueryFile(fs2, outDir, relOutDir, query, importExt, ont
1117
1117
  signature: ${query.shortApiName}.Signature;
1118
1118
  },
1119
1119
  ${stringify(baseProps, {
1120
- "description": () => void 0,
1121
- "displayName": () => void 0,
1122
- "rid": () => void 0
1120
+ "description": () => undefined,
1121
+ "displayName": () => undefined,
1122
+ "rid": () => undefined
1123
1123
  })},
1124
1124
  osdkMetadata: typeof $osdkMetadata;
1125
1125
  }
@@ -1127,9 +1127,9 @@ async function generateV2QueryFile(fs2, outDir, relOutDir, query, importExt, ont
1127
1127
 
1128
1128
  export const ${query.shortApiName}: ${query.definitionIdentifier} = {
1129
1129
  ${stringify(baseProps, {
1130
- "description": () => void 0,
1131
- "displayName": () => void 0,
1132
- "rid": () => void 0
1130
+ "description": () => undefined,
1131
+ "displayName": () => undefined,
1132
+ "rid": () => undefined
1133
1133
  })},
1134
1134
  osdkMetadata: $osdkMetadata
1135
1135
  };
@@ -1374,7 +1374,7 @@ function getPackageJsonContents(name, version, dependencyVersions) {
1374
1374
  };
1375
1375
  }
1376
1376
  async function writeJson(minimalFs, filePath, body) {
1377
- return void await minimalFs.writeFile(filePath, JSON.stringify(body, void 0, 2) + "\n");
1377
+ return void await minimalFs.writeFile(filePath, JSON.stringify(body, undefined, 2) + "\n");
1378
1378
  }
1379
1379
 
1380
1380
  exports.__UNSTABLE_generateClientSdkPackage = generateClientSdkPackage;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/GenerateContext/EnhancedBase.ts","../../src/GenerateContext/EnhancedAction.ts","../../src/util/deleteUndefineds.ts","../../src/GenerateContext/EnhancedInterfaceType.ts","../../src/GenerateContext/EnhancedObjectType.ts","../../src/GenerateContext/EnhancedQuery.ts","../../src/GenerateContext/EnhancedSharedPropertyType.ts","../../src/GenerateContext/ForeignType.ts","../../src/GenerateContext/EnhancedOntologyDefinition.ts","../../src/GenerateContext/enhanceOntology.ts","../../src/shared/sanitizeMetadata.ts","../../src/util/verifyOutDir.ts","../../src/util/test/formatTs.ts","../../src/v2.0/generateMetadata.ts","../../src/shared/getObjectImports.ts","../../src/util/stringify.ts","../../src/util/stringUnionFrom.ts","../../src/v2.0/getDescriptionIfPresent.ts","../../src/v2.0/generatePerActionDataFiles.ts","../../src/shared/propertyJsdoc.ts","../../src/v2.0/wireObjectTypeV2ToSdkObjectConstV2.ts","../../src/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.ts","../../src/v2.0/generatePerInterfaceDataFiles.ts","../../src/v2.0/generatePerObjectDataFiles.ts","../../src/shared/getObjectTypesFromQueryDataType.ts","../../src/shared/getObjectTypeApiNamesFromQuery.ts","../../src/v2.0/generatePerQueryDataFiles.ts","../../src/v2.0/generateRootIndexTsFile.ts","../../src/v2.0/generateClientSdkVersionTwoPointZero.ts","../../src/generateClientSdkPackage.ts"],"names":["path","__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition","wireObjectTypeFullMetadataToSdkObjectMetadata","fs","format","value","wireActionTypeV2ToSdkActionMetadata","object","forInternalUse","definition","fastDeepEqual","invariant","wireQueryTypeV2ToSdkQueryDefinitionNoParams","wireQueryDataTypeToQueryDataTypeDefinition","paramToDef","x","path8"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBO,IAAM,qBAAN,MAAyB;AAAA;AAAA;AAAA;AAAA;AAAA,EAM9B,WAAY,CAAA,MAAA,EAAQ,WAAa,EAAA,QAAA,EAAU,UAAU,IAAM,EAAA;AACzD,IAAA,IAAA,CAAK,OAAU,GAAA,MAAA,CAAA;AACf,IAAA,IAAA,CAAK,WAAc,GAAA,WAAA,CAAA;AACnB,IAAA,CAAC,KAAK,YAAc,EAAA,IAAA,CAAK,YAAY,CAAI,GAAA,gBAAA,CAAiB,KAAK,WAAW,CAAA,CAAA;AAC1E,IAAM,MAAA;AAAA,MACJ,SAAA;AAAA,KACE,GAAA,MAAA,CAAA;AACJ,IAAK,IAAA,CAAA,UAAA,GAAa,UAAU,CAAG,EAAA,QAAQ,IAAI,IAAK,CAAA,YAAY,CAAG,EAAA,SAAS,CAAK,CAAA,GAAA,QAAA,CAAA;AAC7E,IAAA,IAAA,CAAK,mBAAmB,IAAK,CAAA,YAAA,CAAA;AAAA,GAC/B;AAAA,EACA,qBAAqB,CAAY,QAAA,KAAA;AAC/B,IAAA,IAAI,IAAK,CAAA,UAAA,CAAW,UAAW,CAAA,GAAG,CAAG,EAAA;AACnC,MAAA,MAAM,MAAc,GAAAA,gBAAA,CAAA,QAAA,CAAcA,gBAAQ,CAAA,OAAA,CAAA,QAAQ,CAAG,EAAA,IAAA,CAAK,UAAU,CAAA,CAAE,KAAW,CAAAA,gBAAA,CAAA,GAAG,CAAE,CAAA,IAAA,CAAK,GAAG,CAAA,CAAA;AAC9F,MAA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ACT,uBAAyB,EAAA,uBAAA;AAAA,KAC3B;AAAA,IACA,gBAAkB,EAAA;AAAA,MAChB,GAAG,IAAK,CAAA,gBAAA;AAAA,KACV;AAAA,GACF,CAAA;AACF,CAAA;AACO,SAAS,sBAAA,CAAuB,IAAM,EAAA,OAAA,EAAS,kBAAoB,EAAA;AACxE,EAAA,MAAM,SAAY,GAAA,eAAA,CAAA;AAClB,EAAA,MAAM,cAAiB,GAAA,iBAAA,CAAA;AACvB,EAAO,OAAA;AAAA,IACL,IAAA;AAAA,IACA,OAAA;AAAA,IACA,IAAA,EAAM,GAAG,cAAc,CAAA,SAAA,CAAA;AAAA,IACvB,MAAA,EAAQ,GAAG,SAAS,CAAA,SAAA,CAAA;AAAA,IACpB,OAAS,EAAA;AAAA,MACP,GAAK,EAAA;AAAA,QACH,MAAA,EAAQ,GAAG,SAAS,CAAA,SAAA,CAAA;AAAA,QACpB,OAAA,EAAS,GAAG,cAAc,CAAA,SAAA,CAAA;AAAA,OAC5B;AAAA,KACF;AAAA,IACA,OAAS,EAAA;AAAA,MACP,OAAS,EAAA,CAAA,OAAA,EAAU,SAAS,CAAA,yBAAA,EAA4B,cAAc,CAAA,cAAA,CAAA;AAAA,MACtE,KAAO,EAAA,2BAAA;AAAA,KACT;AAAA,IACA,GAAG,4BAA4B,kBAAkB,CAAA;AAAA,IACjD,KAAO,EAAA,CAAC,SAAW,EAAA,WAAA,EAAa,sBAAsB,CAAA;AAAA,GACxD,CAAA;AACF,CAAA;AACA,eAAe,SAAA,CAAU,SAAW,EAAA,QAAA,EAAU,IAAM,EAAA;AAGlD,EAAO,OAAA,KAAM,MAAM,SAAA,CAAU,SAAU,CAAA,QAAA,EAAU,IAAK,CAAA,SAAA,CAAU,IAAM,EAAA,KAAA,CAAA,EAAW,CAAC,CAAA,GAAI,IAAI,CAAA,CAAA;AAC5F","file":"index.cjs","sourcesContent":["/*\n * Copyright 2024 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 path from \"node:path\";\nexport class AbstractImportable {\n /**\n * Either a path relative to the ourDir (e.g. \"./ontology/objects/foo.js\") or a normal\n * module import (e.g. \"@something/foo\")/\n */\n\n constructor(common, fullApiName, basePath, isLocal = true) {\n this._common = common;\n this.fullApiName = fullApiName;\n [this.apiNamespace, this.shortApiName] = extractNamespace(this.fullApiName);\n const {\n importExt\n } = common;\n this.importPath = isLocal ? `${basePath}/${this.shortApiName}${importExt}` : basePath;\n this.uniqueImportName = this.shortApiName;\n }\n getImportPathRelTo = filePath => {\n if (this.importPath.startsWith(\".\")) {\n const result = path.relative(path.dirname(filePath), this.importPath).split(path.sep).join(\"/\");\n if (result.startsWith(\".\")) {\n return result;\n } else {\n return `./${result}`;\n }\n } else {\n return this.importPath;\n }\n };\n}\nexport class EnhancedBase extends AbstractImportable {\n constructor(common, raw, fullApiName, basePath) {\n super(common, fullApiName, basePath);\n this.raw = raw;\n }\n}\nexport function extractNamespace(fqApiName) {\n const last = fqApiName.lastIndexOf(\".\");\n if (last === -1) return [undefined, fqApiName];\n return [fqApiName.slice(0, last), fqApiName.slice(last + 1)];\n}","/*\n * Copyright 2024 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 { EnhancedBase } from \"./EnhancedBase.js\";\nexport class EnhancedAction extends EnhancedBase {\n constructor(common, raw) {\n super(common, raw, raw.apiName, \"./ontology/actions\");\n this.raw = raw;\n }\n get description() {\n return this.raw.description;\n }\n get parameters() {\n return this.raw.parameters;\n }\n get operations() {\n return this.raw.operations;\n }\n get paramsIdentifier() {\n return `${this.shortApiName}.Params`;\n }\n get definitionIdentifier() {\n return `${this.shortApiName}.Definition`;\n }\n get definitionParamsIdentifier() {\n return `${this.shortApiName}.ParamsDefinition`;\n }\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function deleteUndefineds(obj) {\n return Object.fromEntries(Object.entries(obj).filter(([, value]) => value !== undefined));\n}","/*\n * Copyright 2024 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 { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition } from \"@osdk/generator-converters\";\nimport { deleteUndefineds } from \"../util/deleteUndefineds.js\";\nimport { EnhancedBase } from \"./EnhancedBase.js\";\nexport class EnhancedInterfaceType extends EnhancedBase {\n constructor(common, raw) {\n super(common, raw, raw.apiName, \"./ontology/interfaces\");\n this.raw = raw;\n }\n getDefinitionIdentifier(v2) {\n return v2 ? this.shortApiName : `${this.shortApiName}Def`;\n }\n getImportedDefinitionIdentifier(v2) {\n return this.getDefinitionIdentifier(v2);\n }\n get properties() {\n return this.raw.properties;\n }\n getCleanedUpDefinition(v2) {\n return deleteUndefineds(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(this.raw, v2));\n }\n}","/*\n * Copyright 2024 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 { wireObjectTypeFullMetadataToSdkObjectMetadata } from \"@osdk/generator-converters\";\nimport { deleteUndefineds } from \"../util/deleteUndefineds.js\";\nimport { EnhancedBase } from \"./EnhancedBase.js\";\nexport class EnhancedObjectType extends EnhancedBase {\n constructor(common, raw) {\n super(common, raw, raw.objectType.apiName, \"./ontology/objects\");\n this.raw = raw;\n }\n getDefinitionIdentifier(v2) {\n return v2 ? `${this.shortApiName}` : `${this.shortApiName}Def`;\n }\n getImportedDefinitionIdentifier(v2) {\n return this.getDefinitionIdentifier(v2);\n }\n getCleanedUpDefinition(v2) {\n return deleteUndefineds(wireObjectTypeFullMetadataToSdkObjectMetadata(this.raw, v2));\n }\n}","/*\n * Copyright 2024 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 { EnhancedBase } from \"./EnhancedBase.js\";\nexport class EnhancedQuery extends EnhancedBase {\n constructor(common, raw) {\n super(common, raw, raw.apiName, \"./ontology/queries\");\n this.raw = raw;\n }\n get description() {\n return this.raw.description;\n }\n get parameters() {\n return this.raw.parameters;\n }\n get output() {\n return this.raw.output;\n }\n get paramsIdentifier() {\n return `${this.shortApiName}.Parameters`;\n }\n get definitionIdentifier() {\n return `${this.shortApiName}`;\n }\n get definitionParamsIdentifier() {\n return `${this.definitionIdentifier}$Params`;\n }\n}","/*\n * Copyright 2024 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 { EnhancedBase } from \"./EnhancedBase.js\";\nexport class EnhancedSharedPropertyType extends EnhancedBase {\n constructor(common, raw) {\n super(common, raw, raw.apiName, \"./ontology/interfaces\");\n this.raw = raw;\n }\n}","/*\n * Copyright 2024 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 { AbstractImportable } from \"./EnhancedBase.js\";\nexport class ForeignType extends AbstractImportable {\n constructor(_common, apiNamespace, shortApiName, destinationPackage) {\n super(_common, apiNamespace ? `${apiNamespace}.${shortApiName}` : shortApiName, destinationPackage, false);\n this._common = _common;\n }\n getImportedDefinitionIdentifier(v2) {\n return `$Imported$${this.apiNamespace?.replace(/\\./g, \"$\")}$${this.shortApiName}`;\n }\n getDefinitionIdentifier(v2) {\n return this.uniqueImportName;\n }\n}","/*\n * Copyright 2024 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 { EnhancedAction } from \"./EnhancedAction.js\";\nimport { extractNamespace } from \"./EnhancedBase.js\";\nimport { EnhancedInterfaceType } from \"./EnhancedInterfaceType.js\";\nimport { EnhancedObjectType } from \"./EnhancedObjectType.js\";\nimport { EnhancedQuery } from \"./EnhancedQuery.js\";\nimport { EnhancedSharedPropertyType } from \"./EnhancedSharedPropertyType.js\";\nimport { ForeignType } from \"./ForeignType.js\";\nexport class EnhancedOntologyDefinition {\n #foreignTypes = {};\n constructor(raw, importExt, externalObjects, externalInterfaces, externalSpts) {\n this.common = {\n enhancedOntology: this,\n importExt\n };\n this.raw = raw;\n this.ontology = raw.ontology;\n this.objectTypes = remap(raw.objectTypes, this.common, EnhancedObjectType, externalObjects);\n this.actionTypes = remap(raw.actionTypes, this.common, EnhancedAction);\n this.queryTypes = remap(raw.queryTypes, this.common, EnhancedQuery);\n this.interfaceTypes = remap(raw.interfaceTypes, this.common, EnhancedInterfaceType, externalInterfaces);\n this.sharedPropertyTypes = remap(raw.sharedPropertyTypes, this.common, EnhancedSharedPropertyType, externalSpts);\n }\n #createRequireType = type => {\n return (fullApiName, localOnly) => {\n const ret = this[type][fullApiName];\n if (!ret) {\n const [apiNamespace, shortApiName] = extractNamespace(fullApiName);\n throw new Error(`Unable to find ${type}: No entry for '${fullApiName}`);\n }\n return ret;\n };\n };\n requireObjectType = this.#createRequireType(\"objectTypes\");\n requireInterfaceType = this.#createRequireType(\"interfaceTypes\");\n requireActionType = this.#createRequireType(\"actionTypes\");\n requireQueryType = this.#createRequireType(\"queryTypes\");\n requireSharedPropertyType = this.#createRequireType(\"sharedPropertyTypes\");\n}\nfunction remap(r, common, Constructor, externalMap) {\n const entries = [];\n for (const [fullApiName, v] of Object.entries(r ?? {})) {\n if (externalMap?.has(fullApiName)) {\n // skip it, we handle it below\n } else {\n entries.push([fullApiName, new Constructor(common, v)]);\n }\n }\n if (externalMap) {\n for (const [fullApiName, destPackage] of externalMap) {\n const [apiNamespace, shortApiName] = extractNamespace(fullApiName);\n // I think this check should be required but the ontology manager / dev console doesn't enforce it right now\n // if (apiNamespace === undefined) {\n // throw new Error(\n // `Cannot reference an external type (${fullApiName}) that is missing a namespace`,\n // );\n // }\n entries.push([fullApiName, new ForeignType(common, apiNamespace, shortApiName, destPackage)]);\n }\n }\n return Object.fromEntries(entries.sort((a, b) => a[0].localeCompare(b[0])));\n}","/*\n * Copyright 2024 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 { EnhancedOntologyDefinition } from \"./EnhancedOntologyDefinition.js\";\nexport function enhanceOntology({\n sanitized,\n importExt,\n externalObjects,\n externalInterfaces,\n externalSpts\n}) {\n return new EnhancedOntologyDefinition(sanitized, importExt, externalObjects, externalInterfaces, externalSpts);\n}","/*\n * Copyright 2023 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 * @internal\n */\n\n/**\n * @internal\n */\n\n/**\n * @internal\n */\nexport function sanitizeMetadata(ontology) {\n return {\n ...ontology,\n actionTypes: Object.fromEntries(Object.values(ontology.actionTypes).map(actionType => {\n return [camelize(actionType.apiName), {\n ...actionType,\n apiName: camelize(actionType.apiName)\n }];\n }))\n };\n}\nfunction camelize(name) {\n return name.replace(/-./g, segment => segment[1].toUpperCase());\n}","/*\n * Copyright 2023 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 * Verify that the target outDir does not yet exist OR is empty.\n *\n * Re-generating an ontology on top of itself is not supported and may leave old\n * files around or refuse to update files with new contents in some cases.\n */\nexport async function verifyOutDir(outDir, fs) {\n // if outDir exists and is not empty, we cannot proceed with the generation\n try {\n const contents = await fs.readdir(outDir);\n if (contents.length !== 0) {\n throw new Error(`outDir ${outDir} is not empty, please delete its contents and try again`);\n }\n } catch (e) {\n if (e.code === \"ENOENT\") {\n // acceptable, we'll create the directory ourselves\n } else {\n throw e;\n }\n }\n}","/*\n * Copyright 2023 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 { format } from \"prettier\";\nexport function formatTs(contents) {\n try {\n return format(contents, {\n parser: \"typescript\",\n singleQuote: true,\n trailingComma: \"all\",\n tabWidth: 2,\n printWidth: 120\n });\n } catch (e) {\n console.error(\"Failed to format file\", e);\n console.log(contents);\n return contents;\n }\n}","/*\n * Copyright 2023 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 path from \"path\";\nimport { formatTs } from \"../util/test/formatTs.js\";\n\n// BEGIN: THIS IS GENERATED CODE. DO NOT EDIT.\nconst ExpectedOsdkVersion = \"2.1.0\";\n// END: THIS IS GENERATED CODE. DO NOT EDIT.\n\nexport async function generateOntologyMetadataFile({\n fs,\n outDir,\n ontology,\n ontologyApiNamespace\n}, userAgent) {\n await fs.writeFile(path.join(outDir, \"OntologyMetadata.ts\"), await formatTs(`\n export type $ExpectedClientVersion = \"${ExpectedOsdkVersion}\";\n export const $osdkMetadata = { extraUserAgent: \"${userAgent}\" };\n ${ontologyApiNamespace == null ? `\n export const $ontologyRid = \"${ontology.ontology.rid}\";\n ` : \"\"}\n `));\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function getObjectImports(objects, curApiName, currentFilePath, v2) {\n return Array.from(objects).filter(obj => obj.fullApiName !== curApiName).map(obj => {\n const defId = obj.getDefinitionIdentifier(v2);\n const importedId = obj.getImportedDefinitionIdentifier(v2);\n const nameOrAlias = defId === importedId ? defId : `${defId} as ${importedId}`;\n return `import type { ${nameOrAlias} } from \"${obj.getImportPathRelTo(\"./\" + currentFilePath)}\";`;\n }).join(\"\\n\");\n}","/*\n * Copyright 2023 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 * A function for changing the stringified key/value pairs of an object.\n *\n * @param value The value of the key/value pair.\n * @param defaultValueFormatter The function that would be called if this customizer wasn't used\n * @param key The key of the key/value pair.\n * @param defaultKeyFormatter The function that would be called if this customizer wasn't used\n *\n * @returns A string, a tuple of strings, or undefined.\n * If a string is returned, it will be used as the value of the key/value pair.\n * If a tuple of strings is returned, the first string will be used as the key of the key/value pair\n * and the second string will be used as the value of the key/value pair.\n * If undefined is returned, the pair will be removed\n */\n\nconst defaultCustomizer = (value, defaultValueFormatter, key, defaultKeyFormatter) => {\n return [defaultKeyFormatter(key), defaultValueFormatter(value)];\n};\nexport function stringify(obj, customizer = {}, separator = \",\\n\") {\n const defaultKeyFormatter = key => `${JSON.stringify(key)}`;\n const entries = [];\n const sortedKeys = Object.keys(obj).sort((a, b) => a.localeCompare(b));\n for (const key of sortedKeys) {\n const value = obj[key];\n const res = (customizer[key] ?? customizer[\"*\"] ?? defaultCustomizer)(value, value => JSON.stringify(value, null, 2), key, defaultKeyFormatter);\n if (res) {\n if (typeof res === \"string\") {\n entries.push(`${defaultKeyFormatter(key)}: ${res}`);\n } else {\n entries.push(`${res[0]}: ${res[1]}`);\n }\n }\n }\n return entries.join(separator);\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function stringUnionFrom(values) {\n if (values.length === 0) {\n return \"never\";\n } else {\n return values.map(v => `\"${v}\"`).join(\"|\");\n }\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function getDescriptionIfPresent(description, includeNewline) {\n if (description) {\n return `/**\n * ${description}\n */${includeNewline ? \"\\n\" : \"\"}`;\n }\n return \"\";\n}","/*\n * Copyright 2023 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 { wireActionTypeV2ToSdkActionMetadata } from \"@osdk/generator-converters\";\nimport path from \"node:path\";\nimport { getObjectImports } from \"../shared/getObjectImports.js\";\nimport { deleteUndefineds } from \"../util/deleteUndefineds.js\";\nimport { stringify } from \"../util/stringify.js\";\nimport { stringUnionFrom } from \"../util/stringUnionFrom.js\";\nimport { formatTs } from \"../util/test/formatTs.js\";\nimport { getDescriptionIfPresent } from \"./getDescriptionIfPresent.js\";\nexport async function generatePerActionDataFiles({\n sanitizedOntology: ontology,\n fs,\n outDir: rootOutDir,\n importExt = \"\",\n ontology: enhancedOntology,\n forInternalUse = false\n}) {\n const outDir = path.join(rootOutDir, \"ontology\", \"actions\");\n await fs.mkdir(outDir, {\n recursive: true\n });\n await Promise.all(Object.values(enhancedOntology.actionTypes).map(async action => {\n const currentFilePath = path.join(\"ontology\", \"actions\", `${action.shortApiName}.ts`);\n const uniqueApiNamesArray = extractReferencedObjectsFromAction(action.raw);\n const uniqueApiNames = new Set(uniqueApiNamesArray);\n const uniqueApiNamesString = stringUnionFrom([...uniqueApiNames]);\n const fullActionDef = deleteUndefineds(wireActionTypeV2ToSdkActionMetadata(action.raw));\n function createParamsDef() {\n const entries = Object.entries(fullActionDef.parameters ?? {});\n entries.sort((a, b) => a[0].localeCompare(b[0]));\n if (entries.length === 0) {\n return `// Represents the definition of the parameters for the action\n export type ParamsDefinition = Record<string, never>;`;\n }\n return `// Represents the definition of the parameters for the action\n export type ParamsDefinition = {\n ${entries.map(([key, value]) => {\n return `\"${key}\": {\n ${stringify(value, {\n description: (value, d) => value ? d(value) : undefined,\n // trick to remove undefineds\n type: type => {\n if (typeof type === \"string\") {\n return JSON.stringify(type);\n } else if (type.type === \"object\") {\n const obj = enhancedOntology.requireObjectType(type.object);\n return `ActionMetadata.DataType.Object<${obj.getImportedDefinitionIdentifier(true)}>`;\n } else if (type.type === \"objectSet\") {\n const obj = enhancedOntology.requireObjectType(type.objectSet);\n return `ActionMetadata.DataType.ObjectSet<${obj.getImportedDefinitionIdentifier(true)}>`;\n } else if (type.type === \"interface\") {\n const obj = enhancedOntology.requireInterfaceType(type.interface);\n return `ActionMetadata.DataType.Interface<${obj.getImportedDefinitionIdentifier(true)}>`;\n } else if (type.type === \"struct\") {\n return `ActionMetadata.DataType.Struct<${JSON.stringify(type.struct)}>`;\n }\n return undefined;\n }\n })}\n }`;\n }).join(\";\\n\")}\n }`;\n }\n function getActionParamType(input) {\n if (typeof input === \"string\") {\n return `ActionParam.PrimitiveType<${JSON.stringify(input)}>`;\n } else if (input.type === \"object\") {\n return `ActionParam.ObjectType<${enhancedOntology.requireObjectType(input.object).getImportedDefinitionIdentifier(true)}>`;\n } else if (input.type === \"objectSet\") {\n return `ActionParam.ObjectSetType<${enhancedOntology.requireObjectType(input.objectSet).getImportedDefinitionIdentifier(true)}>`;\n } else if (input.type === \"interface\") {\n return `ActionParam.InterfaceType<${enhancedOntology.requireInterfaceType(input.interface).getImportedDefinitionIdentifier(true)}>`;\n } else if (input.type === \"struct\") {\n return `ActionParam.StructType<${JSON.stringify(input.struct)}>`;\n }\n }\n function createV2Types() {\n const oldParamsIdentifier = `${action.shortApiName}$Params`;\n const jsDocBlock = [\"/**\"];\n if (action.description != null) {\n jsDocBlock.push(`* ${action.description}`);\n }\n // the params must be a `type` to align properly with the `ActionDefinition` interface\n // this way we can generate a strict type for the function itself and reference it from the Action Definition\n return `\n \n export namespace ${action.shortApiName}{\n ${createParamsDef()}\n\n ${getDescriptionIfPresent(action.description)}\n export interface Params {\n ${stringify(fullActionDef.parameters, {\n \"*\": (ogValue, _, ogKey) => {\n const key = `${getDescriptionIfPresent(ogValue.description)}\n readonly \"${ogKey}\"${ogValue.nullable ? \"?\" : \"\"}`;\n const value = ogValue.multiplicity ? `ReadonlyArray<${getActionParamType(ogValue.type)}>` : `${getActionParamType(ogValue.type)}`;\n jsDocBlock.push(`* @param {${getActionParamType(ogValue.type)}} ${ogValue.nullable ? `[${ogKey}]` : ogKey} ${ogValue.description ?? \"\"} `);\n return [key, value];\n }\n })}\n }\n\n // Represents a fqn of the action\n export interface Signatures {\n ${getDescriptionIfPresent(action.description)}\n applyAction<P extends ${action.paramsIdentifier}, OP extends ApplyActionOptions>(args: P, options?: OP): Promise<ActionReturnTypeForOptions<OP>>;\n \n batchApplyAction<P extends ReadonlyArray<${action.paramsIdentifier}>, OP extends ApplyBatchActionOptions>(args: P, options?: OP): Promise<ActionReturnTypeForOptions<OP>>;\n }\n \n }\n\n \n ${jsDocBlock.join(\"\\n\")}\n */\n export interface ${action.shortApiName} extends ActionDefinition<${action.shortApiName}.Signatures> {\n __DefinitionMetadata?: {\n ${stringify(fullActionDef, {\n \"parameters\": () => action.definitionParamsIdentifier\n })}\n \n signatures: ${action.shortApiName}.Signatures;\n },\n ${stringify(fullActionDef, {\n \"description\": () => undefined,\n \"displayName\": () => undefined,\n \"modifiedEntities\": () => undefined,\n \"parameters\": () => undefined,\n \"rid\": () => undefined,\n \"status\": () => undefined\n })}\n osdkMetadata: typeof $osdkMetadata;\n }\n `;\n }\n function createV2Object() {\n return ` export const ${action.shortApiName}: ${action.shortApiName} = \n {\n ${stringify(fullActionDef, {\n \"description\": () => undefined,\n \"displayName\": () => undefined,\n \"modifiedEntities\": () => undefined,\n \"parameters\": () => undefined,\n \"rid\": () => undefined,\n \"status\": () => undefined\n })},\n osdkMetadata: $osdkMetadata\n }\n `;\n }\n const referencedObjectDefs = new Set();\n for (const p of Object.values(action.parameters)) {\n if (p.dataType.type === \"object\" || p.dataType.type === \"objectSet\") {\n if (p.dataType.objectApiName) {\n referencedObjectDefs.add(enhancedOntology.requireObjectType(p.dataType.objectApiName));\n }\n if (p.dataType.objectTypeApiName) {\n referencedObjectDefs.add(enhancedOntology.requireObjectType(p.dataType.objectTypeApiName));\n }\n }\n if (p.dataType.type === \"interfaceObject\") {\n if (p.dataType.interfaceTypeApiName) {\n referencedObjectDefs.add(enhancedOntology.requireInterfaceType(p.dataType.interfaceTypeApiName));\n }\n }\n if (p.dataType.type === \"array\") {\n if (p.dataType.subType.type === \"object\" || p.dataType.subType.type === \"objectSet\") {\n if (p.dataType.subType.objectApiName) {\n referencedObjectDefs.add(enhancedOntology.requireObjectType(p.dataType.subType.objectApiName));\n }\n if (p.dataType.subType.objectTypeApiName) {\n referencedObjectDefs.add(enhancedOntology.requireObjectType(p.dataType.subType.objectTypeApiName));\n }\n }\n if (p.dataType.subType.type === \"interfaceObject\") {\n if (p.dataType.subType.interfaceTypeApiName) {\n referencedObjectDefs.add(enhancedOntology.requireInterfaceType(p.dataType.subType.interfaceTypeApiName));\n }\n }\n }\n }\n const imports = getObjectImports(referencedObjectDefs, undefined, currentFilePath, true);\n await fs.writeFile(path.join(rootOutDir, currentFilePath), await formatTs(`\n import type {\n ActionDefinition,\n ActionMetadata,\n ActionParam,\n ActionReturnTypeForOptions,\n ApplyActionOptions,\n ApplyBatchActionOptions,\n } from \"${forInternalUse ? \"@osdk/api\" : \"@osdk/client\"}\";\n import { $osdkMetadata} from \"../../OntologyMetadata${importExt}\";\n ${imports}\n\n \n ${createV2Types()}\n\n ${createV2Object()}\n `));\n }));\n const indexFileRelPath = path.join(\"ontology\", \"actions.ts\");\n await fs.writeFile(path.join(rootOutDir, indexFileRelPath), await formatTs(`\n ${Object.values(enhancedOntology.actionTypes).map(action => {\n const exportConstLine = `export {${action.shortApiName} } from \"${action.getImportPathRelTo(indexFileRelPath)}\";`;\n return exportConstLine;\n }).join(\"\\n\")}\n ${Object.keys(ontology.actionTypes).length === 0 ? \"export {};\" : \"\"}\n `));\n}\nfunction extractReferencedObjectsFromAction(actionType) {\n const referencedObjectsInParameters = Object.values(actionType.parameters).flatMap(({\n dataType\n }) => {\n const objectTypeReference = extractReferencedObjectsFromActionParameter(dataType);\n return objectTypeReference ? [objectTypeReference] : [];\n });\n const referenceObjectsInEdits = actionType.operations.flatMap(value => {\n switch (value.type) {\n case \"createObject\":\n return [value.objectTypeApiName];\n case \"modifyObject\":\n return [value.objectTypeApiName];\n case \"deleteObject\":\n case \"createLink\":\n case \"deleteLink\":\n default:\n return [];\n }\n });\n return [...referenceObjectsInEdits, ...referencedObjectsInParameters];\n}\nfunction extractReferencedObjectsFromActionParameter(actionParameter) {\n switch (actionParameter.type) {\n case \"objectSet\":\n case \"object\":\n return actionParameter.objectTypeApiName;\n case \"array\":\n return extractReferencedObjectsFromActionParameter(actionParameter.subType);\n case \"string\":\n case \"boolean\":\n case \"attachment\":\n case \"date\":\n case \"double\":\n case \"integer\":\n case \"long\":\n case \"timestamp\":\n return undefined;\n }\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function propertyJsdoc(property, {\n isInherited,\n apiName\n}) {\n let ret = `/**\\n`;\n const renderDisplayName = property.displayName && property.displayName !== apiName;\n if (isInherited || renderDisplayName || property.description) {\n if (isInherited) {\n ret += ` * (inherited from parent)\\n`;\n }\n if (renderDisplayName) {\n ret += ` * display name: '${property.displayName}'${property.description ? \",\" : \"\"}\\n`;\n }\n if (property.description) {\n ret += ` * description: ${property.description}\\n`;\n }\n } else {\n ret += ` * (no ontology metadata)\\n`;\n }\n ret += ` */\\n`;\n return ret;\n}","/*\n * Copyright 2023 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 { wireObjectTypeFullMetadataToSdkObjectMetadata } from \"@osdk/generator-converters\";\nimport { EnhancedObjectType } from \"../GenerateContext/EnhancedObjectType.js\";\nimport { ForeignType } from \"../GenerateContext/ForeignType.js\";\nimport { getObjectImports } from \"../shared/getObjectImports.js\";\nimport { propertyJsdoc } from \"../shared/propertyJsdoc.js\";\nimport { deleteUndefineds } from \"../util/deleteUndefineds.js\";\nimport { stringify } from \"../util/stringify.js\";\n\n/** @internal */\nexport function wireObjectTypeV2ToSdkObjectConstV2(wireObject, {\n ontology,\n forInternalUse\n}, currentFilePath) {\n const object = ontology.requireObjectType(wireObject.objectType.apiName, true);\n if (object instanceof ForeignType) {\n throw new Error(\"Should not be generating types for an external type\");\n }\n const uniqueLinkTargetTypes = new Set(wireObject.linkTypes.map(a => ontology.requireObjectType(a.objectTypeApiName, false)));\n const definition = deleteUndefineds(wireObjectTypeFullMetadataToSdkObjectMetadata(object.raw, true));\n const objectDefIdentifier = object.getDefinitionIdentifier(true);\n const objectSetIdentifier = `${object.shortApiName}.ObjectSet`;\n const propertyKeysIdentifier = `${object.shortApiName}.PropertyKeys`;\n // const osdkObjectPropsIdentifier = `OsdkObjectProps$${objectDefIdentifier}`;\n const osdkObjectPropsIdentifier = `${object.shortApiName}.Props`;\n const osdkObjectStrictPropsIdentifier = `${object.shortApiName}.StrictProps`;\n const osdkObjectLinksIdentifier = `${object.shortApiName}.Links`;\n const osdkObjectIdentifier = `${object.shortApiName}.OsdkObject`;\n const identifiers = {\n objectDefIdentifier: `${object.shortApiName}`,\n osdkObjectLinksIdentifier,\n osdkObjectPropsIdentifier,\n osdkObjectStrictPropsIdentifier,\n objectSetIdentifier,\n osdkObjectIdentifier,\n propertyKeysIdentifier\n };\n function getV2Types(object, forInternalUse = false) {\n return `import type {\n PropertyKeys as $PropertyKeys, \n ObjectTypeDefinition as $ObjectTypeDefinition,\n ObjectMetadata as $ObjectMetadata,\n } from \"${forInternalUse ? \"@osdk/api\" : \"@osdk/client\"}\";\n import type {\n ObjectSet as $ObjectSet, \n Osdk as $Osdk,\n OsdkObject as $OsdkObject,\n PropertyValueWireToClient as $PropType,\n SingleLinkAccessor as $SingleLinkAccessor,\n } from \"${forInternalUse ? \"@osdk/api\" : \"@osdk/client\"}\";\n\n\n export namespace ${object.shortApiName} {\n\n ${createPropertyKeys(object)}\n\n\n ${createLinks(ontology, object, \"Links\")}\n\n ${createProps(object, \"Props\", false)}\n ${createProps(object, \"StrictProps\", true)}\n\n ${createObjectSet(object, identifiers)}\n \n ${createOsdkObject(object, \"OsdkInstance\", identifiers)}\n } \n\n\n\n ${createDefinition(object, ontology, object.shortApiName, identifiers)}\n `;\n }\n const imports = getObjectImports(uniqueLinkTargetTypes, definition.apiName, currentFilePath, true);\n return `${imports}${getV2Types(object, forInternalUse)}\n\n export const ${object.shortApiName}: ${objectDefIdentifier}\n = {\n type: \"${object instanceof EnhancedObjectType ? \"object\" : \"interface\"}\",\n apiName: \"${object.fullApiName}\",\n osdkMetadata: $osdkMetadata, \n };`;\n}\nexport function createOsdkObject(object, identifier, {\n osdkObjectPropsIdentifier,\n objectDefIdentifier,\n osdkObjectStrictPropsIdentifier,\n osdkObjectLinksIdentifier\n}) {\n const definition = object.getCleanedUpDefinition(true);\n return `\n export type ${identifier}<\n OPTIONS extends never | \"$rid\" = never,\n K extends keyof ${osdkObjectPropsIdentifier}= keyof ${osdkObjectPropsIdentifier},\n > \n = $Osdk.Instance<\n ${objectDefIdentifier}, \n OPTIONS,\n K\n >;\n \n\n /** @deprecated use ${identifier} */\n export type OsdkObject<\n OPTIONS extends never | \"$rid\" = never,\n K extends keyof ${osdkObjectPropsIdentifier}= keyof ${osdkObjectPropsIdentifier},\n > = ${identifier}<OPTIONS, K>;\n ;\n `;\n}\nexport function createObjectSet(object, {\n objectDefIdentifier,\n objectSetIdentifier,\n propertyKeysIdentifier,\n osdkObjectIdentifier\n}) {\n return `\nexport interface ObjectSet extends \n$ObjectSet<${objectDefIdentifier},\n\n${objectSetIdentifier}\n>\n{\n\n}\n`;\n}\nfunction maybeStripNamespace(type, q) {\n if (type.apiNamespace && q.startsWith(`${type.apiNamespace}.`)) {\n return q.slice(type.apiNamespace.length + 1);\n } else {\n return q;\n }\n}\nexport function createProps(type, identifier, strict) {\n if (identifier === \"StrictProps\") {\n return `export type StrictProps = Props`;\n }\n const definition = type.getCleanedUpDefinition(true);\n return `export interface ${identifier} {\n${stringify(definition.properties, {\n \"*\": (propertyDefinition, _, apiName) => {\n return [`readonly \"${maybeStripNamespace(type, apiName)}\"${\n // after we convert everything over we can do this:\n // !strict || propertyDefinition.nullable ? \"?\" : \"\"\n \"\"}`, (typeof propertyDefinition.type === \"object\" ? `${remapStructType(propertyDefinition.type)}` : `$PropType[${JSON.stringify(propertyDefinition.type)}]`) + `${propertyDefinition.multiplicity ? \"[]\" : \"\"}${propertyDefinition.nullable || !strict && !(definition.type === \"object\" && definition.primaryKeyApiName === apiName) ? `| undefined` : \"\"}`];\n }\n })}\n }`;\n}\nexport function createDefinition(object, ontology, identifier, {\n objectDefIdentifier,\n objectSetIdentifier,\n osdkObjectPropsIdentifier,\n osdkObjectStrictPropsIdentifier,\n osdkObjectLinksIdentifier\n}) {\n const definition = object.getCleanedUpDefinition(true);\n return `\n export interface ${identifier} extends ${object instanceof EnhancedObjectType ? `$ObjectTypeDefinition` : `$InterfaceDefinition`} {\n osdkMetadata: typeof $osdkMetadata;\n type: \"${object instanceof EnhancedObjectType ? \"object\" : \"interface\"}\";\n apiName: \"${object.fullApiName}\";\n __DefinitionMetadata?: {\n objectSet: ${objectSetIdentifier};\n props: ${osdkObjectPropsIdentifier};\n linksType: ${osdkObjectLinksIdentifier};\n strictProps: ${osdkObjectStrictPropsIdentifier};\n ${stringify(definition, {\n links: _value => `{\n ${stringify(definition.links, {\n \"*\": definition => `$ObjectMetadata.Link<${ontology.requireObjectType(definition.targetType).getImportedDefinitionIdentifier(true)}, ${definition.multiplicity}>`\n })}\n }`,\n properties: _value => `{\n ${stringify(definition.properties, {\n \"*\": (propertyDefinition, _, apiName) => [`${propertyJsdoc(propertyDefinition, {\n apiName\n })}\"${maybeStripNamespace(object, apiName)}\"`, `$PropertyDef<${JSON.stringify(propertyDefinition.type)}, \"${propertyDefinition.nullable ? \"nullable\" : \"non-nullable\"}\", \"${propertyDefinition.multiplicity ? \"array\" : \"single\"}\">`]\n })}\n }`\n })}\n } \n}\n `;\n}\nexport function createLinks(ontology, object, identifier) {\n const definition = object.getCleanedUpDefinition(true);\n return `\n ${Object.keys(definition.links).length === 0 ? `export type ${identifier} = {};` : `\n export interface ${identifier} {\n${stringify(definition.links, {\n \"*\": (definition, _, key) => {\n const linkTarget = ontology.requireObjectType(definition.targetType).getImportedDefinitionIdentifier(true);\n return [`readonly ${key}`, `${definition.multiplicity ? `${linkTarget}.ObjectSet` : `$SingleLinkAccessor<${linkTarget}>`}\n `];\n }\n })}\n }\n `}`;\n}\nexport function createPropertyKeys(type) {\n const properties = Object.keys(type.getCleanedUpDefinition(true).properties);\n return `export type PropertyKeys = ${properties.length === 0 ? \"never\" : properties.map(a => maybeStripNamespace(type, a)).map(a => `\"${a}\"`).join(\"|\")};`;\n}\nfunction remapStructType(structType) {\n let output = `{`;\n Object.entries(structType).map(([key, value]) => output += `${key}:$PropType[${JSON.stringify(value)}]|undefined;`);\n output += \"}\";\n return output;\n}","/*\n * Copyright 2023 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 { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition } from \"@osdk/generator-converters\";\nimport fastDeepEqual from \"fast-deep-equal\";\nimport invariant from \"tiny-invariant\";\nimport { extractNamespace } from \"../GenerateContext/EnhancedBase.js\";\nimport { EnhancedInterfaceType } from \"../GenerateContext/EnhancedInterfaceType.js\";\nimport { deleteUndefineds } from \"../util/deleteUndefineds.js\";\nimport { stringify } from \"../util/stringify.js\";\nimport { createDefinition, createObjectSet, createOsdkObject, createPropertyKeys, createProps } from \"./wireObjectTypeV2ToSdkObjectConstV2.js\";\n\n/** @internal */\nexport function __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(interfaceDef, ontology, v2 = false, forInternalUse = false) {\n const definition = deleteUndefineds(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(interfaceDef.raw, v2));\n const objectDefIdentifier = interfaceDef.getDefinitionIdentifier(v2);\n const parents = definition.implements?.map(p => {\n const parent = ontology.requireInterfaceType(p, true);\n if (parent instanceof EnhancedInterfaceType) {\n const it = deleteUndefineds(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(parent.raw, v2));\n return it;\n }\n }) ?? [];\n const mergedProperties = {\n ...definition.properties\n };\n for (const parent of parents) {\n if (parent == null) {\n // came from a foreign type and we cannot merge properties yet\n // so if they weren't listed on the interface its over\n continue;\n }\n for (const apiName of Object.keys(parent.properties)) {\n if (definition.properties[apiName] != null) {\n !fastDeepEqual(definition.properties[apiName], parent.properties[apiName]) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Interface ${definition.apiName} redefines property '${apiName}' from parent '${parent.apiName}' but the properties do not match`) : invariant(false) : void 0;\n } else if (mergedProperties[apiName] != null) {\n !fastDeepEqual(mergedProperties[apiName], parent.properties[apiName]) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Some interface defines a conflicting property '${apiName}' that does not match property from parent '${parent.apiName}'`) : invariant(false) : void 0;\n }\n mergedProperties[apiName] = parent.properties[apiName];\n }\n }\n definition.properties = mergedProperties;\n const objectSetIdentifier = `${interfaceDef.shortApiName}.ObjectSet`;\n const propertyKeysIdentifier = `${interfaceDef.shortApiName}.PropertyKeys`;\n // const osdkObjectPropsIdentifier = `OsdkObjectProps$${objectDefIdentifier}`;\n const osdkObjectPropsIdentifier = `${interfaceDef.shortApiName}.Props`;\n const osdkObjectStrictPropsIdentifier = `${interfaceDef.shortApiName}.StrictProps`;\n const osdkObjectLinksIdentifier = `OsdkObjectLinks$${objectDefIdentifier}`;\n const osdkObjectIdentifier = `${interfaceDef.shortApiName}.OsdkObject`;\n const ids = {\n objectDefIdentifier: interfaceDef.shortApiName,\n osdkObjectLinksIdentifier,\n osdkObjectPropsIdentifier,\n osdkObjectStrictPropsIdentifier,\n objectSetIdentifier,\n osdkObjectIdentifier,\n propertyKeysIdentifier\n };\n if (interfaceDef.apiNamespace) {\n const badProperties = Object.keys(definition.properties).filter(apiName => extractNamespace(apiName)[0] == null);\n if (badProperties.length > 0) {\n throw new Error(`Interfaces with fully qualified api names MUST NOT have any properties with an unqualified api name. Interface: ${interfaceDef.fullApiName}, properties: ${badProperties.join(\", \")}`);\n }\n }\n function getV2Types(forInternalUse = false) {\n return `import type {\n InterfaceDefinition as $InterfaceDefinition,\n ObjectSet as $ObjectSet, \n Osdk as $Osdk,\n PropertyValueWireToClient as $PropType,\n } from \"${forInternalUse ? \"@osdk/api\" : \"@osdk/client\"}\";\n \n ${Object.keys(definition.links).length === 0 ? `export type ${osdkObjectLinksIdentifier} = {};` : `\n export interface ${osdkObjectLinksIdentifier} {\n${stringify(definition.links, {\n \"*\": definition => {\n const linkTarget = ontology.requireObjectType(definition.targetType).getImportedDefinitionIdentifier(v2);\n return `${definition.multiplicity ? `${linkTarget}[\"objectSet\"]` : `SingleLinkAccessor<${linkTarget}>`}\n `;\n }\n })}\n }\n `}\n\n export namespace ${interfaceDef.shortApiName} {\n\n ${createPropertyKeys(interfaceDef)}\n\n\n ${createProps(interfaceDef, \"Props\", false)}\n ${createProps(interfaceDef, \"StrictProps\", true)}\n\n\n ${createObjectSet(interfaceDef, ids)}\n\n ${createOsdkObject(interfaceDef, \"OsdkInstance\", ids)}\n \n } \n\n ${createDefinition(interfaceDef, ontology, interfaceDef.shortApiName, ids)}\n\n`;\n }\n\n // FIXME: We need to fill in the imports\n // if we want links to work\n const imports = [];\n definition;\n return `${imports.join(\"\\n\")}\n ${v2 ? getV2Types(forInternalUse) : \"\"}\n\n export const ${interfaceDef.shortApiName}: ${interfaceDef.shortApiName} = {\n type: \"interface\",\n apiName: \"${interfaceDef.fullApiName}\",\n osdkMetadata: $osdkMetadata,\n };`;\n}","/*\n * Copyright 2023 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 path from \"node:path\";\nimport { EnhancedInterfaceType } from \"../GenerateContext/EnhancedInterfaceType.js\";\nimport { ForeignType } from \"../GenerateContext/ForeignType.js\";\nimport { formatTs } from \"../util/test/formatTs.js\";\nimport { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst } from \"./UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.js\";\n\n/** @internal */\nexport async function generatePerInterfaceDataFiles({\n fs,\n outDir,\n ontology,\n importExt,\n forInternalUse\n}) {\n const interfacesDir = path.join(outDir, \"ontology\", \"interfaces\");\n await fs.mkdir(interfacesDir, {\n recursive: true\n });\n for (const obj of Object.values(ontology.interfaceTypes)) {\n if (obj instanceof ForeignType) continue;\n await fs.writeFile(path.join(interfacesDir, `${obj.shortApiName}.ts`), await formatTs(`\n import type { PropertyDef as $PropertyDef } from \"${forInternalUse ? \"@osdk/api\" : \"@osdk/client\"}\";\n import { $osdkMetadata } from \"../../OntologyMetadata${importExt}\";\n ${__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(obj, ontology, true, forInternalUse)}\n `));\n }\n await fs.writeFile(interfacesDir + \".ts\", await formatTs(`\n ${Object.values(ontology.interfaceTypes).filter(i => i instanceof EnhancedInterfaceType).map(interfaceType => `export {${interfaceType.shortApiName}} from \"./interfaces/${interfaceType.shortApiName}${importExt}\";`).join(\"\\n\")}\n ${Object.keys(ontology.interfaceTypes).length === 0 ? \"export {}\" : \"\"}\n `));\n}","/*\n * Copyright 2023 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 path from \"node:path\";\nimport { EnhancedObjectType } from \"../GenerateContext/EnhancedObjectType.js\";\nimport { ForeignType } from \"../GenerateContext/ForeignType.js\";\nimport { formatTs } from \"../util/test/formatTs.js\";\nimport { wireObjectTypeV2ToSdkObjectConstV2 } from \"./wireObjectTypeV2ToSdkObjectConstV2.js\";\nexport async function generatePerObjectDataFiles(ctx) {\n const {\n fs,\n outDir,\n ontology,\n importExt\n } = ctx;\n await fs.mkdir(path.join(outDir, \"ontology\", \"objects\"), {\n recursive: true\n });\n for (const obj of Object.values(ontology.objectTypes)) {\n if (obj instanceof ForeignType) continue;\n const relPath = path.join(\".\", \"ontology\", `objects`, `${obj.shortApiName}.ts`);\n const outFilePath = path.join(outDir, relPath);\n await fs.writeFile(outFilePath, await formatTs(`\n import type { PropertyDef as $PropertyDef } from \"${ctx.forInternalUse ? \"@osdk/api\" : \"@osdk/client\"}\";\n import { $osdkMetadata } from \"../../OntologyMetadata${importExt}\";\n import type { $ExpectedClientVersion } from \"../../OntologyMetadata${importExt}\";\n ${wireObjectTypeV2ToSdkObjectConstV2(obj.raw, ctx, relPath)}\n `));\n }\n await fs.writeFile(path.join(outDir, \"ontology\", \"objects.ts\"), await formatTs(`\n ${Object.values(ctx.ontology.objectTypes).filter(o => o instanceof EnhancedObjectType).map(objType => `export {${objType.shortApiName}} from \"./objects/${objType.shortApiName}${importExt}\";`).join(\"\\n\")}\n ${Object.keys(ontology.objectTypes).length === 0 ? \"export {};\" : \"\"}\n `));\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function getObjectTypesFromQueryDataType(dataType, types) {\n switch (dataType.type) {\n case \"array\":\n case \"set\":\n getObjectTypesFromQueryDataType(dataType.subType, types);\n return;\n case \"object\":\n types.add(dataType.objectTypeApiName);\n return;\n case \"objectSet\":\n types.add(dataType.objectTypeApiName);\n return;\n case \"struct\":\n for (const prop of Object.values(dataType.fields)) {\n getObjectTypesFromQueryDataType(prop.fieldType, types);\n }\n return;\n case \"union\":\n for (const type of dataType.unionTypes) {\n getObjectTypesFromQueryDataType(type, types);\n }\n return;\n case \"attachment\":\n case \"boolean\":\n case \"date\":\n case \"double\":\n case \"float\":\n case \"integer\":\n case \"long\":\n case \"null\":\n case \"string\":\n case \"threeDimensionalAggregation\":\n case \"timestamp\":\n case \"twoDimensionalAggregation\":\n case \"unsupported\":\n /* complete no-op */\n return;\n default:\n const _ = dataType;\n throw new Error(`Cannot find object types from unsupported QueryDataType ${dataType.type}`);\n }\n}","/*\n * Copyright 2024 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 { getObjectTypesFromQueryDataType } from \"./getObjectTypesFromQueryDataType.js\";\nexport function getObjectTypeApiNamesFromQuery(query) {\n const types = new Set();\n for (const {\n dataType\n } of Object.values(query.parameters)) {\n getObjectTypesFromQueryDataType(dataType, types);\n }\n getObjectTypesFromQueryDataType(query.output, types);\n return Array.from(types);\n}","/*\n * Copyright 2023 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 { wireQueryDataTypeToQueryDataTypeDefinition, wireQueryParameterV2ToQueryParameterDefinition as paramToDef, wireQueryTypeV2ToSdkQueryDefinitionNoParams } from \"@osdk/generator-converters\";\nimport path from \"node:path\";\nimport { getObjectImports } from \"../shared/getObjectImports.js\";\nimport { getObjectTypeApiNamesFromQuery } from \"../shared/getObjectTypeApiNamesFromQuery.js\";\nimport { deleteUndefineds } from \"../util/deleteUndefineds.js\";\nimport { stringify } from \"../util/stringify.js\";\nimport { formatTs } from \"../util/test/formatTs.js\";\nimport { getDescriptionIfPresent } from \"./getDescriptionIfPresent.js\";\nexport async function generatePerQueryDataFilesV2({\n fs,\n outDir: rootOutDir,\n ontology,\n importExt = \"\",\n forInternalUse = false\n}, v2) {\n const relOutDir = path.join(\".\", \"ontology\", \"queries\");\n const outDir = path.join(rootOutDir, \"ontology\", \"queries\");\n await fs.mkdir(outDir, {\n recursive: true\n });\n await Promise.all(Object.values(ontology.queryTypes).map(async query => {\n await generateV2QueryFile(fs, outDir, relOutDir, query, importExt, ontology, forInternalUse);\n }));\n const indexFilePath = `${outDir}.ts`;\n await fs.writeFile(indexFilePath, await formatTs(`\n ${Object.values(ontology.queryTypes).map(query => `export {${query.shortApiName}} from \"${query.getImportPathRelTo(relOutDir)}\";`).join(\"\\n\")}\n ${Object.keys(ontology.queryTypes).length === 0 ? \"export {};\" : \"\"}\n `));\n}\nasync function generateV2QueryFile(fs, outDir, relOutDir, query, importExt, ontology, forInternalUse) {\n const relFilePath = path.join(relOutDir, `${query.shortApiName}.ts`);\n const objectTypes = getObjectTypeApiNamesFromQuery(query);\n const objectTypeObjects = new Set(objectTypes.map(o => ontology.requireObjectType(o)));\n const importObjects = getObjectImports(objectTypeObjects, \"\", relFilePath, true);\n const baseProps = deleteUndefineds(wireQueryTypeV2ToSdkQueryDefinitionNoParams(query.raw));\n const outputBase = deleteUndefineds(wireQueryDataTypeToQueryDataTypeDefinition(query.output));\n const referencedObjectTypes = objectTypes.length > 0 ? objectTypes.map(apiNameObj => `\"${apiNameObj}\"`).join(\"|\") : \"never\";\n await fs.writeFile(path.join(outDir, `${query.shortApiName}.ts`), await formatTs(`\n import type { QueryDefinition , QueryParam, QueryResult, VersionBound} from \"${forInternalUse ? \"@osdk/api\" : \"@osdk/client\"}\";\n import type { $ExpectedClientVersion } from \"../../OntologyMetadata${importExt}\";\n import { $osdkMetadata} from \"../../OntologyMetadata${importExt}\";\n ${importObjects}\n\n export namespace ${query.shortApiName} {\n export interface Signature {\n ${getDescriptionIfPresent(query.description)}\n (${Object.keys(query.parameters).length > 0 ? `query: ${query.paramsIdentifier}` : \"\"}): Promise<${query.shortApiName}.ReturnType>\n }\n\n ${Object.keys(query.parameters).length > 0 ? `\n export interface Parameters {\n ${stringify(query.parameters, {\n \"*\": (parameter, formatter, apiName) => {\n const q = paramToDef(parameter);\n return [`\n ${queryParamJsDoc(paramToDef(parameter), {\n apiName\n })}readonly \"${apiName}\"${q.nullable ? \"?\" : \"\"}`, `${getQueryParamType(ontology, q, \"Param\")}`];\n }\n })}\n }` : \"\"}\n\n ${query.output.type === \"struct\" ? `\n export interface ReturnType \n ${getQueryParamType(ontology, paramToDef({\n dataType: query.output\n }), \"Result\")}\n ` : `\n export type ReturnType = ${getQueryParamType(ontology, paramToDef({\n dataType: query.output\n }), \"Result\")}\n `}\n }\n \n \n export interface ${query.shortApiName} extends QueryDefinition<\n ${query.shortApiName}.Signature\n >, VersionBound<$ExpectedClientVersion>{\n __DefinitionMetadata?: {\n ${stringify(baseProps)}\n parameters: {\n ${parameterDefsForType(ontology, query)}\n };\n output: {\n ${stringify(outputBase)},\n ${getLineFor__OsdkTargetType(ontology, query.output)}\n };\n signature: ${query.shortApiName}.Signature;\n }, \n ${stringify(baseProps, {\n \"description\": () => undefined,\n \"displayName\": () => undefined,\n \"rid\": () => undefined\n })}, \n osdkMetadata: typeof $osdkMetadata;\n }\n\n\n export const ${query.shortApiName}: ${query.definitionIdentifier} = {\n ${stringify(baseProps, {\n \"description\": () => undefined,\n \"displayName\": () => undefined,\n \"rid\": () => undefined\n })},\n osdkMetadata: $osdkMetadata\n };\n `));\n}\nfunction parametersForConst(query) {\n return stringify(query.parameters, {\n \"*\": (parameter, formatter) => formatter(deleteUndefineds(paramToDef(parameter)))\n });\n}\nfunction parameterDefsForType(ontology, query) {\n return stringify(query.parameters, {\n \"*\": (parameter, valueFormatter, apiName) => [`${queryParamJsDoc(paramToDef(parameter), {\n apiName\n })} ${apiName}`, ` {\n ${stringify(deleteUndefineds(paramToDef(parameter)))},\n ${getLineFor__OsdkTargetType(ontology, parameter.dataType)}\n }`]\n });\n}\nfunction getLineFor__OsdkTargetType(ontology, qdt) {\n if (qdt.type === \"object\" || qdt.type === \"objectSet\") {\n return `__OsdkTargetType?: ${ontology.requireObjectType(qdt.objectTypeApiName).getImportedDefinitionIdentifier(true)}`;\n }\n return \"\";\n}\nexport function queryParamJsDoc(param, {\n apiName\n}) {\n let ret = `/**\\n`;\n if (param.description) {\n if (param.description) {\n ret += ` * description: ${param.description}\\n`;\n }\n } else {\n ret += ` * (no ontology metadata)\\n`;\n }\n ret += ` */\\n`;\n return ret;\n}\nexport function getQueryParamType(enhancedOntology, input, type) {\n let inner = `unknown /* ${input.type} */`;\n switch (input.type) {\n case \"date\":\n inner = `Query${type}.PrimitiveType<${JSON.stringify(\"datetime\")}>`;\n break;\n case \"attachment\":\n case \"boolean\":\n case \"double\":\n case \"float\":\n case \"integer\":\n case \"long\":\n case \"string\":\n case \"threeDimensionalAggregation\":\n case \"timestamp\":\n case \"twoDimensionalAggregation\":\n inner = `Query${type}.PrimitiveType<${JSON.stringify(input.type)}>`;\n break;\n case \"struct\":\n inner = `{\n ${stringify(input.struct, {\n \"*\": (p, formatter, apiName) => {\n return [`\n ${type === \"Param\" ? \"readonly \" : \"\"}\"${apiName}\"${p.nullable ? \"?\" : \"\"}`, `${getQueryParamType(enhancedOntology, p, type)}`];\n }\n })}\n }`;\n break;\n case \"object\":\n inner = `Query${type}.ObjectType<${enhancedOntology.requireObjectType(input.object).getImportedDefinitionIdentifier(true)}>`;\n break;\n case \"objectSet\":\n inner = `Query${type}.ObjectSetType<${enhancedOntology.requireObjectType(input.objectSet).getImportedDefinitionIdentifier(true)}>`;\n break;\n case \"set\":\n inner = `${type === \"Param\" ? \"Readonly\" : \"\"}Set<${getQueryParamType(enhancedOntology, input.set, type)}>`;\n break;\n case \"union\":\n inner = input.union.map(u => getQueryParamType(enhancedOntology, u, type)).join(\" | \");\n break;\n }\n if (input.multiplicity && type === \"Param\") {\n return `ReadonlyArray<${inner}>`;\n } else if (input.multiplicity) {\n return `Array<${inner}>`;\n }\n return inner;\n}","/*\n * Copyright 2023 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 path from \"node:path\";\nimport { ForeignType } from \"../GenerateContext/ForeignType.js\";\nimport { formatTs } from \"../util/test/formatTs.js\";\nexport async function generateRootIndexTsFile({\n fs,\n outDir,\n importExt,\n ontologyApiNamespace,\n ontology\n}) {\n await fs.writeFile(path.join(outDir, \"index.ts\"), await formatTs(`export {${helper(ontology.actionTypes)}} from \"./ontology/actions${importExt}\";\n export * as $Actions from \"./ontology/actions${importExt}\";\n export {${helper(ontology.interfaceTypes)}} from \"./ontology/interfaces${importExt}\";\n export * as $Interfaces from \"./ontology/interfaces${importExt}\";\n export {${helper(ontology.objectTypes)}} from \"./ontology/objects${importExt}\";\n export * as $Objects from \"./ontology/objects${importExt}\";\n export {${helper(ontology.queryTypes)}} from \"./ontology/queries${importExt}\";\n export * as $Queries from \"./ontology/queries${importExt}\";\n export { $osdkMetadata } from \"./OntologyMetadata${importExt}\";\n ${ontologyApiNamespace == null ? `export { $ontologyRid } from \"./OntologyMetadata${importExt}\";` : ``}\n `));\n}\nfunction helper(x) {\n return Object.values(x).filter(x => !(x instanceof ForeignType)).map(a => a.shortApiName).join(\", \");\n}","/*\n * Copyright 2023 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 { enhanceOntology } from \"../GenerateContext/enhanceOntology.js\";\nimport { sanitizeMetadata } from \"../shared/sanitizeMetadata.js\";\nimport { verifyOutDir } from \"../util/verifyOutDir.js\";\nimport { generateOntologyMetadataFile } from \"./generateMetadata.js\";\nimport { generatePerActionDataFiles } from \"./generatePerActionDataFiles.js\";\nimport { generatePerInterfaceDataFiles } from \"./generatePerInterfaceDataFiles.js\";\nimport { generatePerObjectDataFiles } from \"./generatePerObjectDataFiles.js\";\nimport { generatePerQueryDataFilesV2 } from \"./generatePerQueryDataFiles.js\";\nimport { generateRootIndexTsFile } from \"./generateRootIndexTsFile.js\";\nexport async function generateClientSdkVersionTwoPointZero(ontology, userAgent, fs, outDir, packageType = \"commonjs\", externalObjects = new Map(), externalInterfaces = new Map(), externalSpts = new Map(), forInternalUse = false) {\n const importExt = \".js\"; // turns out you can always use the extension\n\n // Structurally, we need to have multiple ontologies read in\n // with one per package.\n\n await verifyOutDir(outDir, fs);\n const sanitizedOntology = sanitizeMetadata(ontology);\n await fs.mkdir(outDir, {\n recursive: true\n });\n const enhancedOntology = enhanceOntology({\n sanitized: sanitizedOntology,\n importExt,\n externalObjects,\n externalInterfaces,\n externalSpts\n });\n const ctx = {\n sanitizedOntology,\n ontology: enhancedOntology,\n importExt,\n fs,\n outDir,\n forInternalUse\n };\n await generateRootIndexTsFile(ctx);\n await generateOntologyMetadataFile(ctx, userAgent);\n await generatePerObjectDataFiles(ctx);\n await generatePerInterfaceDataFiles(ctx);\n await generatePerActionDataFiles(ctx);\n await generatePerQueryDataFilesV2(ctx, true);\n}","/*\n * Copyright 2024 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 { generateClientSdkVersionTwoPointZero } from \"./v2.0/generateClientSdkVersionTwoPointZero.js\";\nexport async function generateClientSdkPackage(packageName, packageVersion, sdkVersion, baseOutDir, ontology, minimalFs, dependencyVersions, cliVersion, externalObjects = new Map(), externalInterfaces = new Map()) {\n if (!packageName) throw new Error(\"Package name is required\");\n if (sdkVersion === \"1.1\") {\n throw new Error(\"This generator version does not support generating v1 sdks\");\n }\n for (const packageType of [\"module\", \"commonjs\"]) {\n const outDir = path.join(baseOutDir, \"dist\", packageType);\n await generateClientSdkVersionTwoPointZero(ontology, `typescript-sdk/${packageVersion} osdk-cli/${cliVersion}`, minimalFs, outDir, packageType, externalObjects, externalInterfaces);\n await fs.promises.mkdir(outDir, {\n recursive: true\n });\n await writeJson(minimalFs, path.join(outDir, \"package.json\"), {\n type: packageType\n });\n await writeJson(minimalFs, path.join(outDir, `tsconfig.json`), {\n compilerOptions: getTsCompilerOptions(packageType)\n });\n }\n await writeJson(minimalFs, path.join(baseOutDir, \"package.json\"), getPackageJsonContents(packageName, packageVersion, dependencyVersions));\n\n // we need to shim for the node10 resolver\n await minimalFs.mkdir(path.join(baseOutDir, \"ontology\"), {\n recursive: true\n });\n await minimalFs.writeFile(path.join(baseOutDir, \"ontology\", \"objects.js\"), `module.exports = require(\"../../dist/module/ontology/objects\")`);\n await minimalFs.writeFile(path.join(baseOutDir, \"ontology\", \"objects.d.ts\"), `export * from \"../dist/module/ontology/objects\"`);\n}\nfunction getTsCompilerOptions(packageType) {\n const commonTsconfig = {\n importHelpers: true,\n declaration: true,\n isolatedModules: true,\n esModuleInterop: true,\n forceConsistentCasingInFileNames: true,\n strict: true,\n skipLibCheck: true\n };\n const compilerOptions = packageType === \"commonjs\" ? {\n ...commonTsconfig,\n module: \"commonjs\",\n target: \"es2018\"\n } : {\n ...commonTsconfig,\n module: \"NodeNext\",\n target: \"ES2020\"\n };\n return compilerOptions;\n}\nexport function getExpectedDependencies({\n osdkApiVersion,\n osdkClientVersion\n}) {\n return {\n devDependencies: {\n \"@osdk/api\": osdkApiVersion\n },\n peerDependencies: {\n \"@osdk/api\": osdkApiVersion,\n \"@osdk/client\": osdkClientVersion\n }\n };\n}\nfunction getExpectedDependenciesFull(dependencyVersions) {\n const {\n typescriptVersion,\n tslibVersion,\n areTheTypesWrongVersion\n } = dependencyVersions;\n const base = getExpectedDependencies(dependencyVersions);\n return {\n devDependencies: {\n ...base.devDependencies,\n \"typescript\": typescriptVersion,\n \"tslib\": tslibVersion,\n \"@arethetypeswrong/cli\": areTheTypesWrongVersion\n },\n peerDependencies: {\n ...base.peerDependencies\n }\n };\n}\nexport function getPackageJsonContents(name, version, dependencyVersions) {\n const esmPrefix = \"./dist/module\";\n const commonjsPrefix = \"./dist/commonjs\";\n return {\n name,\n version,\n main: `${commonjsPrefix}/index.js`,\n module: `${esmPrefix}/index.js`,\n exports: {\n \".\": {\n import: `${esmPrefix}/index.js`,\n require: `${commonjsPrefix}/index.js`\n }\n },\n scripts: {\n prepack: `tsc -p ${esmPrefix}/tsconfig.json && tsc -p ${commonjsPrefix}/tsconfig.json`,\n check: \"npm exec attw $(npm pack)\"\n },\n ...getExpectedDependenciesFull(dependencyVersions),\n files: [\"**/*.js\", \"**/*.d.ts\", \"dist/**/package.json\"]\n };\n}\nasync function writeJson(minimalFs, filePath, body) {\n // consola.info(`Writing ${filePath}`);\n // consola.debug(`Writing ${filePath} with body`, body);\n return void (await minimalFs.writeFile(filePath, JSON.stringify(body, undefined, 2) + \"\\n\"));\n}"]}
1
+ {"version":3,"sources":["../../src/GenerateContext/EnhancedBase.ts","../../src/GenerateContext/EnhancedAction.ts","../../src/util/deleteUndefineds.ts","../../src/GenerateContext/EnhancedInterfaceType.ts","../../src/GenerateContext/EnhancedObjectType.ts","../../src/GenerateContext/EnhancedQuery.ts","../../src/GenerateContext/EnhancedSharedPropertyType.ts","../../src/GenerateContext/ForeignType.ts","../../src/GenerateContext/EnhancedOntologyDefinition.ts","../../src/GenerateContext/enhanceOntology.ts","../../src/shared/sanitizeMetadata.ts","../../src/util/verifyOutDir.ts","../../src/util/test/formatTs.ts","../../src/v2.0/generateMetadata.ts","../../src/shared/getObjectImports.ts","../../src/util/stringify.ts","../../src/util/stringUnionFrom.ts","../../src/v2.0/getDescriptionIfPresent.ts","../../src/v2.0/generatePerActionDataFiles.ts","../../src/shared/propertyJsdoc.ts","../../src/v2.0/wireObjectTypeV2ToSdkObjectConstV2.ts","../../src/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.ts","../../src/v2.0/generatePerInterfaceDataFiles.ts","../../src/v2.0/generatePerObjectDataFiles.ts","../../src/shared/getObjectTypesFromQueryDataType.ts","../../src/shared/getObjectTypeApiNamesFromQuery.ts","../../src/v2.0/generatePerQueryDataFiles.ts","../../src/v2.0/generateRootIndexTsFile.ts","../../src/v2.0/generateClientSdkVersionTwoPointZero.ts","../../src/generateClientSdkPackage.ts"],"names":["path","__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition","wireObjectTypeFullMetadataToSdkObjectMetadata","fs","format","value","wireActionTypeV2ToSdkActionMetadata","object","forInternalUse","definition","fastDeepEqual","invariant","wireQueryTypeV2ToSdkQueryDefinitionNoParams","wireQueryDataTypeToQueryDataTypeDefinition","paramToDef","x","path8"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBO,IAAM,qBAAN,MAAyB;AAAA;AAAA;AAAA;AAAA;AAAA,EAM9B,WAAY,CAAA,MAAA,EAAQ,WAAa,EAAA,QAAA,EAAU,UAAU,IAAM,EAAA;AACzD,IAAA,IAAA,CAAK,OAAU,GAAA,MAAA;AACf,IAAA,IAAA,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\n * Copyright 2024 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 path from \"node:path\";\nexport class AbstractImportable {\n /**\n * Either a path relative to the ourDir (e.g. \"./ontology/objects/foo.js\") or a normal\n * module import (e.g. \"@something/foo\")/\n */\n\n constructor(common, fullApiName, basePath, isLocal = true) {\n this._common = common;\n this.fullApiName = fullApiName;\n [this.apiNamespace, this.shortApiName] = extractNamespace(this.fullApiName);\n const {\n importExt\n } = common;\n this.importPath = isLocal ? `${basePath}/${this.shortApiName}${importExt}` : basePath;\n this.uniqueImportName = this.shortApiName;\n }\n getImportPathRelTo = filePath => {\n if (this.importPath.startsWith(\".\")) {\n const result = path.relative(path.dirname(filePath), this.importPath).split(path.sep).join(\"/\");\n if (result.startsWith(\".\")) {\n return result;\n } else {\n return `./${result}`;\n }\n } else {\n return this.importPath;\n }\n };\n}\nexport class EnhancedBase extends AbstractImportable {\n constructor(common, raw, fullApiName, basePath) {\n super(common, fullApiName, basePath);\n this.raw = raw;\n }\n}\nexport function extractNamespace(fqApiName) {\n const last = fqApiName.lastIndexOf(\".\");\n if (last === -1) return [undefined, fqApiName];\n return [fqApiName.slice(0, last), fqApiName.slice(last + 1)];\n}","/*\n * Copyright 2024 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 { EnhancedBase } from \"./EnhancedBase.js\";\nexport class EnhancedAction extends EnhancedBase {\n constructor(common, raw) {\n super(common, raw, raw.apiName, \"./ontology/actions\");\n this.raw = raw;\n }\n get description() {\n return this.raw.description;\n }\n get parameters() {\n return this.raw.parameters;\n }\n get operations() {\n return this.raw.operations;\n }\n get paramsIdentifier() {\n return `${this.shortApiName}.Params`;\n }\n get definitionIdentifier() {\n return `${this.shortApiName}.Definition`;\n }\n get definitionParamsIdentifier() {\n return `${this.shortApiName}.ParamsDefinition`;\n }\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function deleteUndefineds(obj) {\n return Object.fromEntries(Object.entries(obj).filter(([, value]) => value !== undefined));\n}","/*\n * Copyright 2024 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 { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition } from \"@osdk/generator-converters\";\nimport { deleteUndefineds } from \"../util/deleteUndefineds.js\";\nimport { EnhancedBase } from \"./EnhancedBase.js\";\nexport class EnhancedInterfaceType extends EnhancedBase {\n constructor(common, raw) {\n super(common, raw, raw.apiName, \"./ontology/interfaces\");\n this.raw = raw;\n }\n getDefinitionIdentifier(v2) {\n return v2 ? this.shortApiName : `${this.shortApiName}Def`;\n }\n getImportedDefinitionIdentifier(v2) {\n return this.getDefinitionIdentifier(v2);\n }\n get properties() {\n return this.raw.properties;\n }\n getCleanedUpDefinition(v2) {\n return deleteUndefineds(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(this.raw, v2));\n }\n}","/*\n * Copyright 2024 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 { wireObjectTypeFullMetadataToSdkObjectMetadata } from \"@osdk/generator-converters\";\nimport { deleteUndefineds } from \"../util/deleteUndefineds.js\";\nimport { EnhancedBase } from \"./EnhancedBase.js\";\nexport class EnhancedObjectType extends EnhancedBase {\n constructor(common, raw) {\n super(common, raw, raw.objectType.apiName, \"./ontology/objects\");\n this.raw = raw;\n }\n getDefinitionIdentifier(v2) {\n return v2 ? `${this.shortApiName}` : `${this.shortApiName}Def`;\n }\n getImportedDefinitionIdentifier(v2) {\n return this.getDefinitionIdentifier(v2);\n }\n getCleanedUpDefinition(v2) {\n return deleteUndefineds(wireObjectTypeFullMetadataToSdkObjectMetadata(this.raw, v2));\n }\n}","/*\n * Copyright 2024 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 { EnhancedBase } from \"./EnhancedBase.js\";\nexport class EnhancedQuery extends EnhancedBase {\n constructor(common, raw) {\n super(common, raw, raw.apiName, \"./ontology/queries\");\n this.raw = raw;\n }\n get description() {\n return this.raw.description;\n }\n get parameters() {\n return this.raw.parameters;\n }\n get output() {\n return this.raw.output;\n }\n get paramsIdentifier() {\n return `${this.shortApiName}.Parameters`;\n }\n get definitionIdentifier() {\n return `${this.shortApiName}`;\n }\n get definitionParamsIdentifier() {\n return `${this.definitionIdentifier}$Params`;\n }\n}","/*\n * Copyright 2024 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 { EnhancedBase } from \"./EnhancedBase.js\";\nexport class EnhancedSharedPropertyType extends EnhancedBase {\n constructor(common, raw) {\n super(common, raw, raw.apiName, \"./ontology/interfaces\");\n this.raw = raw;\n }\n}","/*\n * Copyright 2024 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 { AbstractImportable } from \"./EnhancedBase.js\";\nexport class ForeignType extends AbstractImportable {\n constructor(_common, apiNamespace, shortApiName, destinationPackage) {\n super(_common, apiNamespace ? `${apiNamespace}.${shortApiName}` : shortApiName, destinationPackage, false);\n this._common = _common;\n }\n getImportedDefinitionIdentifier(v2) {\n return `$Imported$${this.apiNamespace?.replace(/\\./g, \"$\")}$${this.shortApiName}`;\n }\n getDefinitionIdentifier(v2) {\n return this.uniqueImportName;\n }\n}","/*\n * Copyright 2024 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 { EnhancedAction } from \"./EnhancedAction.js\";\nimport { extractNamespace } from \"./EnhancedBase.js\";\nimport { EnhancedInterfaceType } from \"./EnhancedInterfaceType.js\";\nimport { EnhancedObjectType } from \"./EnhancedObjectType.js\";\nimport { EnhancedQuery } from \"./EnhancedQuery.js\";\nimport { EnhancedSharedPropertyType } from \"./EnhancedSharedPropertyType.js\";\nimport { ForeignType } from \"./ForeignType.js\";\nexport class EnhancedOntologyDefinition {\n #foreignTypes = {};\n constructor(raw, importExt, externalObjects, externalInterfaces, externalSpts) {\n this.common = {\n enhancedOntology: this,\n importExt\n };\n this.raw = raw;\n this.ontology = raw.ontology;\n this.objectTypes = remap(raw.objectTypes, this.common, EnhancedObjectType, externalObjects);\n this.actionTypes = remap(raw.actionTypes, this.common, EnhancedAction);\n this.queryTypes = remap(raw.queryTypes, this.common, EnhancedQuery);\n this.interfaceTypes = remap(raw.interfaceTypes, this.common, EnhancedInterfaceType, externalInterfaces);\n this.sharedPropertyTypes = remap(raw.sharedPropertyTypes, this.common, EnhancedSharedPropertyType, externalSpts);\n }\n #createRequireType = type => {\n return (fullApiName, localOnly) => {\n const ret = this[type][fullApiName];\n if (!ret) {\n const [apiNamespace, shortApiName] = extractNamespace(fullApiName);\n throw new Error(`Unable to find ${type}: No entry for '${fullApiName}`);\n }\n return ret;\n };\n };\n requireObjectType = this.#createRequireType(\"objectTypes\");\n requireInterfaceType = this.#createRequireType(\"interfaceTypes\");\n requireActionType = this.#createRequireType(\"actionTypes\");\n requireQueryType = this.#createRequireType(\"queryTypes\");\n requireSharedPropertyType = this.#createRequireType(\"sharedPropertyTypes\");\n}\nfunction remap(r, common, Constructor, externalMap) {\n const entries = [];\n for (const [fullApiName, v] of Object.entries(r ?? {})) {\n if (externalMap?.has(fullApiName)) {\n // skip it, we handle it below\n } else {\n entries.push([fullApiName, new Constructor(common, v)]);\n }\n }\n if (externalMap) {\n for (const [fullApiName, destPackage] of externalMap) {\n const [apiNamespace, shortApiName] = extractNamespace(fullApiName);\n // I think this check should be required but the ontology manager / dev console doesn't enforce it right now\n // if (apiNamespace === undefined) {\n // throw new Error(\n // `Cannot reference an external type (${fullApiName}) that is missing a namespace`,\n // );\n // }\n entries.push([fullApiName, new ForeignType(common, apiNamespace, shortApiName, destPackage)]);\n }\n }\n return Object.fromEntries(entries.sort((a, b) => a[0].localeCompare(b[0])));\n}","/*\n * Copyright 2024 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 { EnhancedOntologyDefinition } from \"./EnhancedOntologyDefinition.js\";\nexport function enhanceOntology({\n sanitized,\n importExt,\n externalObjects,\n externalInterfaces,\n externalSpts\n}) {\n return new EnhancedOntologyDefinition(sanitized, importExt, externalObjects, externalInterfaces, externalSpts);\n}","/*\n * Copyright 2023 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 * @internal\n */\n\n/**\n * @internal\n */\n\n/**\n * @internal\n */\nexport function sanitizeMetadata(ontology) {\n return {\n ...ontology,\n actionTypes: Object.fromEntries(Object.values(ontology.actionTypes).map(actionType => {\n return [camelize(actionType.apiName), {\n ...actionType,\n apiName: camelize(actionType.apiName)\n }];\n }))\n };\n}\nfunction camelize(name) {\n return name.replace(/-./g, segment => segment[1].toUpperCase());\n}","/*\n * Copyright 2023 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 * Verify that the target outDir does not yet exist OR is empty.\n *\n * Re-generating an ontology on top of itself is not supported and may leave old\n * files around or refuse to update files with new contents in some cases.\n */\nexport async function verifyOutDir(outDir, fs) {\n // if outDir exists and is not empty, we cannot proceed with the generation\n try {\n const contents = await fs.readdir(outDir);\n if (contents.length !== 0) {\n throw new Error(`outDir ${outDir} is not empty, please delete its contents and try again`);\n }\n } catch (e) {\n if (e.code === \"ENOENT\") {\n // acceptable, we'll create the directory ourselves\n } else {\n throw e;\n }\n }\n}","/*\n * Copyright 2023 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 { format } from \"prettier\";\nexport function formatTs(contents) {\n try {\n return format(contents, {\n parser: \"typescript\",\n singleQuote: true,\n trailingComma: \"all\",\n tabWidth: 2,\n printWidth: 120\n });\n } catch (e) {\n console.error(\"Failed to format file\", e);\n console.log(contents);\n return contents;\n }\n}","/*\n * Copyright 2023 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 path from \"path\";\nimport { formatTs } from \"../util/test/formatTs.js\";\n\n// BEGIN: THIS IS GENERATED CODE. DO NOT EDIT.\nconst ExpectedOsdkVersion = \"2.1.0\";\n// END: THIS IS GENERATED CODE. DO NOT EDIT.\n\nexport async function generateOntologyMetadataFile({\n fs,\n outDir,\n ontology,\n ontologyApiNamespace\n}, userAgent) {\n await fs.writeFile(path.join(outDir, \"OntologyMetadata.ts\"), await formatTs(`\n export type $ExpectedClientVersion = \"${ExpectedOsdkVersion}\";\n export const $osdkMetadata = { extraUserAgent: \"${userAgent}\" };\n ${ontologyApiNamespace == null ? `\n export const $ontologyRid = \"${ontology.ontology.rid}\";\n ` : \"\"}\n `));\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function getObjectImports(objects, curApiName, currentFilePath, v2) {\n return Array.from(objects).filter(obj => obj.fullApiName !== curApiName).map(obj => {\n const defId = obj.getDefinitionIdentifier(v2);\n const importedId = obj.getImportedDefinitionIdentifier(v2);\n const nameOrAlias = defId === importedId ? defId : `${defId} as ${importedId}`;\n return `import type { ${nameOrAlias} } from \"${obj.getImportPathRelTo(\"./\" + currentFilePath)}\";`;\n }).join(\"\\n\");\n}","/*\n * Copyright 2023 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 * A function for changing the stringified key/value pairs of an object.\n *\n * @param value The value of the key/value pair.\n * @param defaultValueFormatter The function that would be called if this customizer wasn't used\n * @param key The key of the key/value pair.\n * @param defaultKeyFormatter The function that would be called if this customizer wasn't used\n *\n * @returns A string, a tuple of strings, or undefined.\n * If a string is returned, it will be used as the value of the key/value pair.\n * If a tuple of strings is returned, the first string will be used as the key of the key/value pair\n * and the second string will be used as the value of the key/value pair.\n * If undefined is returned, the pair will be removed\n */\n\nconst defaultCustomizer = (value, defaultValueFormatter, key, defaultKeyFormatter) => {\n return [defaultKeyFormatter(key), defaultValueFormatter(value)];\n};\nexport function stringify(obj, customizer = {}, separator = \",\\n\") {\n const defaultKeyFormatter = key => `${JSON.stringify(key)}`;\n const entries = [];\n const sortedKeys = Object.keys(obj).sort((a, b) => a.localeCompare(b));\n for (const key of sortedKeys) {\n const value = obj[key];\n const res = (customizer[key] ?? customizer[\"*\"] ?? defaultCustomizer)(value, value => JSON.stringify(value, null, 2), key, defaultKeyFormatter);\n if (res) {\n if (typeof res === \"string\") {\n entries.push(`${defaultKeyFormatter(key)}: ${res}`);\n } else {\n entries.push(`${res[0]}: ${res[1]}`);\n }\n }\n }\n return entries.join(separator);\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function stringUnionFrom(values) {\n if (values.length === 0) {\n return \"never\";\n } else {\n return values.map(v => `\"${v}\"`).join(\"|\");\n }\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function getDescriptionIfPresent(description, includeNewline) {\n if (description) {\n return `/**\n * ${description}\n */${includeNewline ? \"\\n\" : \"\"}`;\n }\n return \"\";\n}","/*\n * Copyright 2023 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 { wireActionTypeV2ToSdkActionMetadata } from \"@osdk/generator-converters\";\nimport path from \"node:path\";\nimport { getObjectImports } from \"../shared/getObjectImports.js\";\nimport { deleteUndefineds } from \"../util/deleteUndefineds.js\";\nimport { stringify } from \"../util/stringify.js\";\nimport { stringUnionFrom } from \"../util/stringUnionFrom.js\";\nimport { formatTs } from \"../util/test/formatTs.js\";\nimport { getDescriptionIfPresent } from \"./getDescriptionIfPresent.js\";\nexport async function generatePerActionDataFiles({\n sanitizedOntology: ontology,\n fs,\n outDir: rootOutDir,\n importExt = \"\",\n ontology: enhancedOntology,\n forInternalUse = false\n}) {\n const outDir = path.join(rootOutDir, \"ontology\", \"actions\");\n await fs.mkdir(outDir, {\n recursive: true\n });\n await Promise.all(Object.values(enhancedOntology.actionTypes).map(async action => {\n const currentFilePath = path.join(\"ontology\", \"actions\", `${action.shortApiName}.ts`);\n const uniqueApiNamesArray = extractReferencedObjectsFromAction(action.raw);\n const uniqueApiNames = new Set(uniqueApiNamesArray);\n const uniqueApiNamesString = stringUnionFrom([...uniqueApiNames]);\n const fullActionDef = deleteUndefineds(wireActionTypeV2ToSdkActionMetadata(action.raw));\n function createParamsDef() {\n const entries = Object.entries(fullActionDef.parameters ?? {});\n entries.sort((a, b) => a[0].localeCompare(b[0]));\n if (entries.length === 0) {\n return `// Represents the definition of the parameters for the action\n export type ParamsDefinition = Record<string, never>;`;\n }\n return `// Represents the definition of the parameters for the action\n export type ParamsDefinition = {\n ${entries.map(([key, value]) => {\n return `\"${key}\": {\n ${stringify(value, {\n description: (value, d) => value ? d(value) : undefined,\n // trick to remove undefineds\n type: type => {\n if (typeof type === \"string\") {\n return JSON.stringify(type);\n } else if (type.type === \"object\") {\n const obj = enhancedOntology.requireObjectType(type.object);\n return `ActionMetadata.DataType.Object<${obj.getImportedDefinitionIdentifier(true)}>`;\n } else if (type.type === \"objectSet\") {\n const obj = enhancedOntology.requireObjectType(type.objectSet);\n return `ActionMetadata.DataType.ObjectSet<${obj.getImportedDefinitionIdentifier(true)}>`;\n } else if (type.type === \"interface\") {\n const obj = enhancedOntology.requireInterfaceType(type.interface);\n return `ActionMetadata.DataType.Interface<${obj.getImportedDefinitionIdentifier(true)}>`;\n } else if (type.type === \"struct\") {\n return `ActionMetadata.DataType.Struct<${JSON.stringify(type.struct)}>`;\n }\n return undefined;\n }\n })}\n }`;\n }).join(\";\\n\")}\n }`;\n }\n function getActionParamType(input) {\n if (typeof input === \"string\") {\n return `ActionParam.PrimitiveType<${JSON.stringify(input)}>`;\n } else if (input.type === \"object\") {\n return `ActionParam.ObjectType<${enhancedOntology.requireObjectType(input.object).getImportedDefinitionIdentifier(true)}>`;\n } else if (input.type === \"objectSet\") {\n return `ActionParam.ObjectSetType<${enhancedOntology.requireObjectType(input.objectSet).getImportedDefinitionIdentifier(true)}>`;\n } else if (input.type === \"interface\") {\n return `ActionParam.InterfaceType<${enhancedOntology.requireInterfaceType(input.interface).getImportedDefinitionIdentifier(true)}>`;\n } else if (input.type === \"struct\") {\n return `ActionParam.StructType<${JSON.stringify(input.struct)}>`;\n }\n }\n function createV2Types() {\n const oldParamsIdentifier = `${action.shortApiName}$Params`;\n const jsDocBlock = [\"/**\"];\n if (action.description != null) {\n jsDocBlock.push(`* ${action.description}`);\n }\n // the params must be a `type` to align properly with the `ActionDefinition` interface\n // this way we can generate a strict type for the function itself and reference it from the Action Definition\n return `\n \n export namespace ${action.shortApiName}{\n ${createParamsDef()}\n\n ${getDescriptionIfPresent(action.description)}\n export interface Params {\n ${stringify(fullActionDef.parameters, {\n \"*\": (ogValue, _, ogKey) => {\n const key = `${getDescriptionIfPresent(ogValue.description)}\n readonly \"${ogKey}\"${ogValue.nullable ? \"?\" : \"\"}`;\n const value = ogValue.multiplicity ? `ReadonlyArray<${getActionParamType(ogValue.type)}>` : `${getActionParamType(ogValue.type)}`;\n jsDocBlock.push(`* @param {${getActionParamType(ogValue.type)}} ${ogValue.nullable ? `[${ogKey}]` : ogKey} ${ogValue.description ?? \"\"} `);\n return [key, value];\n }\n })}\n }\n\n // Represents a fqn of the action\n export interface Signatures {\n ${getDescriptionIfPresent(action.description)}\n applyAction<P extends ${action.paramsIdentifier}, OP extends ApplyActionOptions>(args: P, options?: OP): Promise<ActionReturnTypeForOptions<OP>>;\n \n batchApplyAction<P extends ReadonlyArray<${action.paramsIdentifier}>, OP extends ApplyBatchActionOptions>(args: P, options?: OP): Promise<ActionReturnTypeForOptions<OP>>;\n }\n \n }\n\n \n ${jsDocBlock.join(\"\\n\")}\n */\n export interface ${action.shortApiName} extends ActionDefinition<${action.shortApiName}.Signatures> {\n __DefinitionMetadata?: {\n ${stringify(fullActionDef, {\n \"parameters\": () => action.definitionParamsIdentifier\n })}\n \n signatures: ${action.shortApiName}.Signatures;\n },\n ${stringify(fullActionDef, {\n \"description\": () => undefined,\n \"displayName\": () => undefined,\n \"modifiedEntities\": () => undefined,\n \"parameters\": () => undefined,\n \"rid\": () => undefined,\n \"status\": () => undefined\n })}\n osdkMetadata: typeof $osdkMetadata;\n }\n `;\n }\n function createV2Object() {\n return ` export const ${action.shortApiName}: ${action.shortApiName} = \n {\n ${stringify(fullActionDef, {\n \"description\": () => undefined,\n \"displayName\": () => undefined,\n \"modifiedEntities\": () => undefined,\n \"parameters\": () => undefined,\n \"rid\": () => undefined,\n \"status\": () => undefined\n })},\n osdkMetadata: $osdkMetadata\n }\n `;\n }\n const referencedObjectDefs = new Set();\n for (const p of Object.values(action.parameters)) {\n if (p.dataType.type === \"object\" || p.dataType.type === \"objectSet\") {\n if (p.dataType.objectApiName) {\n referencedObjectDefs.add(enhancedOntology.requireObjectType(p.dataType.objectApiName));\n }\n if (p.dataType.objectTypeApiName) {\n referencedObjectDefs.add(enhancedOntology.requireObjectType(p.dataType.objectTypeApiName));\n }\n }\n if (p.dataType.type === \"interfaceObject\") {\n if (p.dataType.interfaceTypeApiName) {\n referencedObjectDefs.add(enhancedOntology.requireInterfaceType(p.dataType.interfaceTypeApiName));\n }\n }\n if (p.dataType.type === \"array\") {\n if (p.dataType.subType.type === \"object\" || p.dataType.subType.type === \"objectSet\") {\n if (p.dataType.subType.objectApiName) {\n referencedObjectDefs.add(enhancedOntology.requireObjectType(p.dataType.subType.objectApiName));\n }\n if (p.dataType.subType.objectTypeApiName) {\n referencedObjectDefs.add(enhancedOntology.requireObjectType(p.dataType.subType.objectTypeApiName));\n }\n }\n if (p.dataType.subType.type === \"interfaceObject\") {\n if (p.dataType.subType.interfaceTypeApiName) {\n referencedObjectDefs.add(enhancedOntology.requireInterfaceType(p.dataType.subType.interfaceTypeApiName));\n }\n }\n }\n }\n const imports = getObjectImports(referencedObjectDefs, undefined, currentFilePath, true);\n await fs.writeFile(path.join(rootOutDir, currentFilePath), await formatTs(`\n import type {\n ActionDefinition,\n ActionMetadata,\n ActionParam,\n ActionReturnTypeForOptions,\n ApplyActionOptions,\n ApplyBatchActionOptions,\n } from \"${forInternalUse ? \"@osdk/api\" : \"@osdk/client\"}\";\n import { $osdkMetadata} from \"../../OntologyMetadata${importExt}\";\n ${imports}\n\n \n ${createV2Types()}\n\n ${createV2Object()}\n `));\n }));\n const indexFileRelPath = path.join(\"ontology\", \"actions.ts\");\n await fs.writeFile(path.join(rootOutDir, indexFileRelPath), await formatTs(`\n ${Object.values(enhancedOntology.actionTypes).map(action => {\n const exportConstLine = `export {${action.shortApiName} } from \"${action.getImportPathRelTo(indexFileRelPath)}\";`;\n return exportConstLine;\n }).join(\"\\n\")}\n ${Object.keys(ontology.actionTypes).length === 0 ? \"export {};\" : \"\"}\n `));\n}\nfunction extractReferencedObjectsFromAction(actionType) {\n const referencedObjectsInParameters = Object.values(actionType.parameters).flatMap(({\n dataType\n }) => {\n const objectTypeReference = extractReferencedObjectsFromActionParameter(dataType);\n return objectTypeReference ? [objectTypeReference] : [];\n });\n const referenceObjectsInEdits = actionType.operations.flatMap(value => {\n switch (value.type) {\n case \"createObject\":\n return [value.objectTypeApiName];\n case \"modifyObject\":\n return [value.objectTypeApiName];\n case \"deleteObject\":\n case \"createLink\":\n case \"deleteLink\":\n default:\n return [];\n }\n });\n return [...referenceObjectsInEdits, ...referencedObjectsInParameters];\n}\nfunction extractReferencedObjectsFromActionParameter(actionParameter) {\n switch (actionParameter.type) {\n case \"objectSet\":\n case \"object\":\n return actionParameter.objectTypeApiName;\n case \"array\":\n return extractReferencedObjectsFromActionParameter(actionParameter.subType);\n case \"string\":\n case \"boolean\":\n case \"attachment\":\n case \"date\":\n case \"double\":\n case \"integer\":\n case \"long\":\n case \"timestamp\":\n return undefined;\n }\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function propertyJsdoc(property, {\n isInherited,\n apiName\n}) {\n let ret = `/**\\n`;\n const renderDisplayName = property.displayName && property.displayName !== apiName;\n if (isInherited || renderDisplayName || property.description) {\n if (isInherited) {\n ret += ` * (inherited from parent)\\n`;\n }\n if (renderDisplayName) {\n ret += ` * display name: '${property.displayName}'${property.description ? \",\" : \"\"}\\n`;\n }\n if (property.description) {\n ret += ` * description: ${property.description}\\n`;\n }\n } else {\n ret += ` * (no ontology metadata)\\n`;\n }\n ret += ` */\\n`;\n return ret;\n}","/*\n * Copyright 2023 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 { wireObjectTypeFullMetadataToSdkObjectMetadata } from \"@osdk/generator-converters\";\nimport { EnhancedObjectType } from \"../GenerateContext/EnhancedObjectType.js\";\nimport { ForeignType } from \"../GenerateContext/ForeignType.js\";\nimport { getObjectImports } from \"../shared/getObjectImports.js\";\nimport { propertyJsdoc } from \"../shared/propertyJsdoc.js\";\nimport { deleteUndefineds } from \"../util/deleteUndefineds.js\";\nimport { stringify } from \"../util/stringify.js\";\n\n/** @internal */\nexport function wireObjectTypeV2ToSdkObjectConstV2(wireObject, {\n ontology,\n forInternalUse\n}, currentFilePath) {\n const object = ontology.requireObjectType(wireObject.objectType.apiName, true);\n if (object instanceof ForeignType) {\n throw new Error(\"Should not be generating types for an external type\");\n }\n const uniqueLinkTargetTypes = new Set(wireObject.linkTypes.map(a => ontology.requireObjectType(a.objectTypeApiName, false)));\n const definition = deleteUndefineds(wireObjectTypeFullMetadataToSdkObjectMetadata(object.raw, true));\n const objectDefIdentifier = object.getDefinitionIdentifier(true);\n const objectSetIdentifier = `${object.shortApiName}.ObjectSet`;\n const propertyKeysIdentifier = `${object.shortApiName}.PropertyKeys`;\n // const osdkObjectPropsIdentifier = `OsdkObjectProps$${objectDefIdentifier}`;\n const osdkObjectPropsIdentifier = `${object.shortApiName}.Props`;\n const osdkObjectStrictPropsIdentifier = `${object.shortApiName}.StrictProps`;\n const osdkObjectLinksIdentifier = `${object.shortApiName}.Links`;\n const osdkObjectIdentifier = `${object.shortApiName}.OsdkObject`;\n const identifiers = {\n objectDefIdentifier: `${object.shortApiName}`,\n osdkObjectLinksIdentifier,\n osdkObjectPropsIdentifier,\n osdkObjectStrictPropsIdentifier,\n objectSetIdentifier,\n osdkObjectIdentifier,\n propertyKeysIdentifier\n };\n function getV2Types(object, forInternalUse = false) {\n return `import type {\n PropertyKeys as $PropertyKeys, \n ObjectTypeDefinition as $ObjectTypeDefinition,\n ObjectMetadata as $ObjectMetadata,\n } from \"${forInternalUse ? \"@osdk/api\" : \"@osdk/client\"}\";\n import type {\n ObjectSet as $ObjectSet, \n Osdk as $Osdk,\n OsdkObject as $OsdkObject,\n PropertyValueWireToClient as $PropType,\n SingleLinkAccessor as $SingleLinkAccessor,\n } from \"${forInternalUse ? \"@osdk/api\" : \"@osdk/client\"}\";\n\n\n export namespace ${object.shortApiName} {\n\n ${createPropertyKeys(object)}\n\n\n ${createLinks(ontology, object, \"Links\")}\n\n ${createProps(object, \"Props\", false)}\n ${createProps(object, \"StrictProps\", true)}\n\n ${createObjectSet(object, identifiers)}\n \n ${createOsdkObject(object, \"OsdkInstance\", identifiers)}\n } \n\n\n\n ${createDefinition(object, ontology, object.shortApiName, identifiers)}\n `;\n }\n const imports = getObjectImports(uniqueLinkTargetTypes, definition.apiName, currentFilePath, true);\n return `${imports}${getV2Types(object, forInternalUse)}\n\n export const ${object.shortApiName}: ${objectDefIdentifier}\n = {\n type: \"${object instanceof EnhancedObjectType ? \"object\" : \"interface\"}\",\n apiName: \"${object.fullApiName}\",\n osdkMetadata: $osdkMetadata, \n };`;\n}\nexport function createOsdkObject(object, identifier, {\n osdkObjectPropsIdentifier,\n objectDefIdentifier,\n osdkObjectStrictPropsIdentifier,\n osdkObjectLinksIdentifier\n}) {\n const definition = object.getCleanedUpDefinition(true);\n return `\n export type ${identifier}<\n OPTIONS extends never | \"$rid\" = never,\n K extends keyof ${osdkObjectPropsIdentifier}= keyof ${osdkObjectPropsIdentifier},\n > \n = $Osdk.Instance<\n ${objectDefIdentifier}, \n OPTIONS,\n K\n >;\n \n\n /** @deprecated use ${identifier} */\n export type OsdkObject<\n OPTIONS extends never | \"$rid\" = never,\n K extends keyof ${osdkObjectPropsIdentifier}= keyof ${osdkObjectPropsIdentifier},\n > = ${identifier}<OPTIONS, K>;\n ;\n `;\n}\nexport function createObjectSet(object, {\n objectDefIdentifier,\n objectSetIdentifier,\n propertyKeysIdentifier,\n osdkObjectIdentifier\n}) {\n return `\nexport interface ObjectSet extends \n$ObjectSet<${objectDefIdentifier},\n\n${objectSetIdentifier}\n>\n{\n\n}\n`;\n}\nfunction maybeStripNamespace(type, q) {\n if (type.apiNamespace && q.startsWith(`${type.apiNamespace}.`)) {\n return q.slice(type.apiNamespace.length + 1);\n } else {\n return q;\n }\n}\nexport function createProps(type, identifier, strict) {\n if (identifier === \"StrictProps\") {\n return `export type StrictProps = Props`;\n }\n const definition = type.getCleanedUpDefinition(true);\n return `export interface ${identifier} {\n${stringify(definition.properties, {\n \"*\": (propertyDefinition, _, apiName) => {\n return [`readonly \"${maybeStripNamespace(type, apiName)}\"${\n // after we convert everything over we can do this:\n // !strict || propertyDefinition.nullable ? \"?\" : \"\"\n \"\"}`, (typeof propertyDefinition.type === \"object\" ? `${remapStructType(propertyDefinition.type)}` : `$PropType[${JSON.stringify(propertyDefinition.type)}]`) + `${propertyDefinition.multiplicity ? \"[]\" : \"\"}${propertyDefinition.nullable || !strict && !(definition.type === \"object\" && definition.primaryKeyApiName === apiName) ? `| undefined` : \"\"}`];\n }\n })}\n }`;\n}\nexport function createDefinition(object, ontology, identifier, {\n objectDefIdentifier,\n objectSetIdentifier,\n osdkObjectPropsIdentifier,\n osdkObjectStrictPropsIdentifier,\n osdkObjectLinksIdentifier\n}) {\n const definition = object.getCleanedUpDefinition(true);\n return `\n export interface ${identifier} extends ${object instanceof EnhancedObjectType ? `$ObjectTypeDefinition` : `$InterfaceDefinition`} {\n osdkMetadata: typeof $osdkMetadata;\n type: \"${object instanceof EnhancedObjectType ? \"object\" : \"interface\"}\";\n apiName: \"${object.fullApiName}\";\n __DefinitionMetadata?: {\n objectSet: ${objectSetIdentifier};\n props: ${osdkObjectPropsIdentifier};\n linksType: ${osdkObjectLinksIdentifier};\n strictProps: ${osdkObjectStrictPropsIdentifier};\n ${stringify(definition, {\n links: _value => `{\n ${stringify(definition.links, {\n \"*\": definition => `$ObjectMetadata.Link<${ontology.requireObjectType(definition.targetType).getImportedDefinitionIdentifier(true)}, ${definition.multiplicity}>`\n })}\n }`,\n properties: _value => `{\n ${stringify(definition.properties, {\n \"*\": (propertyDefinition, _, apiName) => [`${propertyJsdoc(propertyDefinition, {\n apiName\n })}\"${maybeStripNamespace(object, apiName)}\"`, `$PropertyDef<${JSON.stringify(propertyDefinition.type)}, \"${propertyDefinition.nullable ? \"nullable\" : \"non-nullable\"}\", \"${propertyDefinition.multiplicity ? \"array\" : \"single\"}\">`]\n })}\n }`\n })}\n } \n}\n `;\n}\nexport function createLinks(ontology, object, identifier) {\n const definition = object.getCleanedUpDefinition(true);\n return `\n ${Object.keys(definition.links).length === 0 ? `export type ${identifier} = {};` : `\n export interface ${identifier} {\n${stringify(definition.links, {\n \"*\": (definition, _, key) => {\n const linkTarget = ontology.requireObjectType(definition.targetType).getImportedDefinitionIdentifier(true);\n return [`readonly ${key}`, `${definition.multiplicity ? `${linkTarget}.ObjectSet` : `$SingleLinkAccessor<${linkTarget}>`}\n `];\n }\n })}\n }\n `}`;\n}\nexport function createPropertyKeys(type) {\n const properties = Object.keys(type.getCleanedUpDefinition(true).properties);\n return `export type PropertyKeys = ${properties.length === 0 ? \"never\" : properties.map(a => maybeStripNamespace(type, a)).map(a => `\"${a}\"`).join(\"|\")};`;\n}\nfunction remapStructType(structType) {\n let output = `{`;\n Object.entries(structType).map(([key, value]) => output += `${key}:$PropType[${JSON.stringify(value)}]|undefined;`);\n output += \"}\";\n return output;\n}","/*\n * Copyright 2023 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 { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition } from \"@osdk/generator-converters\";\nimport fastDeepEqual from \"fast-deep-equal\";\nimport invariant from \"tiny-invariant\";\nimport { extractNamespace } from \"../GenerateContext/EnhancedBase.js\";\nimport { EnhancedInterfaceType } from \"../GenerateContext/EnhancedInterfaceType.js\";\nimport { deleteUndefineds } from \"../util/deleteUndefineds.js\";\nimport { stringify } from \"../util/stringify.js\";\nimport { createDefinition, createObjectSet, createOsdkObject, createPropertyKeys, createProps } from \"./wireObjectTypeV2ToSdkObjectConstV2.js\";\n\n/** @internal */\nexport function __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(interfaceDef, ontology, v2 = false, forInternalUse = false) {\n const definition = deleteUndefineds(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(interfaceDef.raw, v2));\n const objectDefIdentifier = interfaceDef.getDefinitionIdentifier(v2);\n const parents = definition.implements?.map(p => {\n const parent = ontology.requireInterfaceType(p, true);\n if (parent instanceof EnhancedInterfaceType) {\n const it = deleteUndefineds(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(parent.raw, v2));\n return it;\n }\n }) ?? [];\n const mergedProperties = {\n ...definition.properties\n };\n for (const parent of parents) {\n if (parent == null) {\n // came from a foreign type and we cannot merge properties yet\n // so if they weren't listed on the interface its over\n continue;\n }\n for (const apiName of Object.keys(parent.properties)) {\n if (definition.properties[apiName] != null) {\n !fastDeepEqual(definition.properties[apiName], parent.properties[apiName]) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Interface ${definition.apiName} redefines property '${apiName}' from parent '${parent.apiName}' but the properties do not match`) : invariant(false) : void 0;\n } else if (mergedProperties[apiName] != null) {\n !fastDeepEqual(mergedProperties[apiName], parent.properties[apiName]) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Some interface defines a conflicting property '${apiName}' that does not match property from parent '${parent.apiName}'`) : invariant(false) : void 0;\n }\n mergedProperties[apiName] = parent.properties[apiName];\n }\n }\n definition.properties = mergedProperties;\n const objectSetIdentifier = `${interfaceDef.shortApiName}.ObjectSet`;\n const propertyKeysIdentifier = `${interfaceDef.shortApiName}.PropertyKeys`;\n // const osdkObjectPropsIdentifier = `OsdkObjectProps$${objectDefIdentifier}`;\n const osdkObjectPropsIdentifier = `${interfaceDef.shortApiName}.Props`;\n const osdkObjectStrictPropsIdentifier = `${interfaceDef.shortApiName}.StrictProps`;\n const osdkObjectLinksIdentifier = `OsdkObjectLinks$${objectDefIdentifier}`;\n const osdkObjectIdentifier = `${interfaceDef.shortApiName}.OsdkObject`;\n const ids = {\n objectDefIdentifier: interfaceDef.shortApiName,\n osdkObjectLinksIdentifier,\n osdkObjectPropsIdentifier,\n osdkObjectStrictPropsIdentifier,\n objectSetIdentifier,\n osdkObjectIdentifier,\n propertyKeysIdentifier\n };\n if (interfaceDef.apiNamespace) {\n const badProperties = Object.keys(definition.properties).filter(apiName => extractNamespace(apiName)[0] == null);\n if (badProperties.length > 0) {\n throw new Error(`Interfaces with fully qualified api names MUST NOT have any properties with an unqualified api name. Interface: ${interfaceDef.fullApiName}, properties: ${badProperties.join(\", \")}`);\n }\n }\n function getV2Types(forInternalUse = false) {\n return `import type {\n InterfaceDefinition as $InterfaceDefinition,\n ObjectSet as $ObjectSet, \n Osdk as $Osdk,\n PropertyValueWireToClient as $PropType,\n } from \"${forInternalUse ? \"@osdk/api\" : \"@osdk/client\"}\";\n \n ${Object.keys(definition.links).length === 0 ? `export type ${osdkObjectLinksIdentifier} = {};` : `\n export interface ${osdkObjectLinksIdentifier} {\n${stringify(definition.links, {\n \"*\": definition => {\n const linkTarget = ontology.requireObjectType(definition.targetType).getImportedDefinitionIdentifier(v2);\n return `${definition.multiplicity ? `${linkTarget}[\"objectSet\"]` : `SingleLinkAccessor<${linkTarget}>`}\n `;\n }\n })}\n }\n `}\n\n export namespace ${interfaceDef.shortApiName} {\n\n ${createPropertyKeys(interfaceDef)}\n\n\n ${createProps(interfaceDef, \"Props\", false)}\n ${createProps(interfaceDef, \"StrictProps\", true)}\n\n\n ${createObjectSet(interfaceDef, ids)}\n\n ${createOsdkObject(interfaceDef, \"OsdkInstance\", ids)}\n \n } \n\n ${createDefinition(interfaceDef, ontology, interfaceDef.shortApiName, ids)}\n\n`;\n }\n\n // FIXME: We need to fill in the imports\n // if we want links to work\n const imports = [];\n definition;\n return `${imports.join(\"\\n\")}\n ${v2 ? getV2Types(forInternalUse) : \"\"}\n\n export const ${interfaceDef.shortApiName}: ${interfaceDef.shortApiName} = {\n type: \"interface\",\n apiName: \"${interfaceDef.fullApiName}\",\n osdkMetadata: $osdkMetadata,\n };`;\n}","/*\n * Copyright 2023 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 path from \"node:path\";\nimport { EnhancedInterfaceType } from \"../GenerateContext/EnhancedInterfaceType.js\";\nimport { ForeignType } from \"../GenerateContext/ForeignType.js\";\nimport { formatTs } from \"../util/test/formatTs.js\";\nimport { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst } from \"./UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.js\";\n\n/** @internal */\nexport async function generatePerInterfaceDataFiles({\n fs,\n outDir,\n ontology,\n importExt,\n forInternalUse\n}) {\n const interfacesDir = path.join(outDir, \"ontology\", \"interfaces\");\n await fs.mkdir(interfacesDir, {\n recursive: true\n });\n for (const obj of Object.values(ontology.interfaceTypes)) {\n if (obj instanceof ForeignType) continue;\n await fs.writeFile(path.join(interfacesDir, `${obj.shortApiName}.ts`), await formatTs(`\n import type { PropertyDef as $PropertyDef } from \"${forInternalUse ? \"@osdk/api\" : \"@osdk/client\"}\";\n import { $osdkMetadata } from \"../../OntologyMetadata${importExt}\";\n ${__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(obj, ontology, true, forInternalUse)}\n `));\n }\n await fs.writeFile(interfacesDir + \".ts\", await formatTs(`\n ${Object.values(ontology.interfaceTypes).filter(i => i instanceof EnhancedInterfaceType).map(interfaceType => `export {${interfaceType.shortApiName}} from \"./interfaces/${interfaceType.shortApiName}${importExt}\";`).join(\"\\n\")}\n ${Object.keys(ontology.interfaceTypes).length === 0 ? \"export {}\" : \"\"}\n `));\n}","/*\n * Copyright 2023 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 path from \"node:path\";\nimport { EnhancedObjectType } from \"../GenerateContext/EnhancedObjectType.js\";\nimport { ForeignType } from \"../GenerateContext/ForeignType.js\";\nimport { formatTs } from \"../util/test/formatTs.js\";\nimport { wireObjectTypeV2ToSdkObjectConstV2 } from \"./wireObjectTypeV2ToSdkObjectConstV2.js\";\nexport async function generatePerObjectDataFiles(ctx) {\n const {\n fs,\n outDir,\n ontology,\n importExt\n } = ctx;\n await fs.mkdir(path.join(outDir, \"ontology\", \"objects\"), {\n recursive: true\n });\n for (const obj of Object.values(ontology.objectTypes)) {\n if (obj instanceof ForeignType) continue;\n const relPath = path.join(\".\", \"ontology\", `objects`, `${obj.shortApiName}.ts`);\n const outFilePath = path.join(outDir, relPath);\n await fs.writeFile(outFilePath, await formatTs(`\n import type { PropertyDef as $PropertyDef } from \"${ctx.forInternalUse ? \"@osdk/api\" : \"@osdk/client\"}\";\n import { $osdkMetadata } from \"../../OntologyMetadata${importExt}\";\n import type { $ExpectedClientVersion } from \"../../OntologyMetadata${importExt}\";\n ${wireObjectTypeV2ToSdkObjectConstV2(obj.raw, ctx, relPath)}\n `));\n }\n await fs.writeFile(path.join(outDir, \"ontology\", \"objects.ts\"), await formatTs(`\n ${Object.values(ctx.ontology.objectTypes).filter(o => o instanceof EnhancedObjectType).map(objType => `export {${objType.shortApiName}} from \"./objects/${objType.shortApiName}${importExt}\";`).join(\"\\n\")}\n ${Object.keys(ontology.objectTypes).length === 0 ? \"export {};\" : \"\"}\n `));\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function getObjectTypesFromQueryDataType(dataType, types) {\n switch (dataType.type) {\n case \"array\":\n case \"set\":\n getObjectTypesFromQueryDataType(dataType.subType, types);\n return;\n case \"object\":\n types.add(dataType.objectTypeApiName);\n return;\n case \"objectSet\":\n types.add(dataType.objectTypeApiName);\n return;\n case \"struct\":\n for (const prop of Object.values(dataType.fields)) {\n getObjectTypesFromQueryDataType(prop.fieldType, types);\n }\n return;\n case \"union\":\n for (const type of dataType.unionTypes) {\n getObjectTypesFromQueryDataType(type, types);\n }\n return;\n case \"attachment\":\n case \"boolean\":\n case \"date\":\n case \"double\":\n case \"float\":\n case \"integer\":\n case \"long\":\n case \"null\":\n case \"string\":\n case \"threeDimensionalAggregation\":\n case \"timestamp\":\n case \"twoDimensionalAggregation\":\n case \"unsupported\":\n /* complete no-op */\n return;\n default:\n const _ = dataType;\n throw new Error(`Cannot find object types from unsupported QueryDataType ${dataType.type}`);\n }\n}","/*\n * Copyright 2024 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 { getObjectTypesFromQueryDataType } from \"./getObjectTypesFromQueryDataType.js\";\nexport function getObjectTypeApiNamesFromQuery(query) {\n const types = new Set();\n for (const {\n dataType\n } of Object.values(query.parameters)) {\n getObjectTypesFromQueryDataType(dataType, types);\n }\n getObjectTypesFromQueryDataType(query.output, types);\n return Array.from(types);\n}","/*\n * Copyright 2023 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 { wireQueryDataTypeToQueryDataTypeDefinition, wireQueryParameterV2ToQueryParameterDefinition as paramToDef, wireQueryTypeV2ToSdkQueryDefinitionNoParams } from \"@osdk/generator-converters\";\nimport path from \"node:path\";\nimport { getObjectImports } from \"../shared/getObjectImports.js\";\nimport { getObjectTypeApiNamesFromQuery } from \"../shared/getObjectTypeApiNamesFromQuery.js\";\nimport { deleteUndefineds } from \"../util/deleteUndefineds.js\";\nimport { stringify } from \"../util/stringify.js\";\nimport { formatTs } from \"../util/test/formatTs.js\";\nimport { getDescriptionIfPresent } from \"./getDescriptionIfPresent.js\";\nexport async function generatePerQueryDataFilesV2({\n fs,\n outDir: rootOutDir,\n ontology,\n importExt = \"\",\n forInternalUse = false\n}, v2) {\n const relOutDir = path.join(\".\", \"ontology\", \"queries\");\n const outDir = path.join(rootOutDir, \"ontology\", \"queries\");\n await fs.mkdir(outDir, {\n recursive: true\n });\n await Promise.all(Object.values(ontology.queryTypes).map(async query => {\n await generateV2QueryFile(fs, outDir, relOutDir, query, importExt, ontology, forInternalUse);\n }));\n const indexFilePath = `${outDir}.ts`;\n await fs.writeFile(indexFilePath, await formatTs(`\n ${Object.values(ontology.queryTypes).map(query => `export {${query.shortApiName}} from \"${query.getImportPathRelTo(relOutDir)}\";`).join(\"\\n\")}\n ${Object.keys(ontology.queryTypes).length === 0 ? \"export {};\" : \"\"}\n `));\n}\nasync function generateV2QueryFile(fs, outDir, relOutDir, query, importExt, ontology, forInternalUse) {\n const relFilePath = path.join(relOutDir, `${query.shortApiName}.ts`);\n const objectTypes = getObjectTypeApiNamesFromQuery(query);\n const objectTypeObjects = new Set(objectTypes.map(o => ontology.requireObjectType(o)));\n const importObjects = getObjectImports(objectTypeObjects, \"\", relFilePath, true);\n const baseProps = deleteUndefineds(wireQueryTypeV2ToSdkQueryDefinitionNoParams(query.raw));\n const outputBase = deleteUndefineds(wireQueryDataTypeToQueryDataTypeDefinition(query.output));\n const referencedObjectTypes = objectTypes.length > 0 ? objectTypes.map(apiNameObj => `\"${apiNameObj}\"`).join(\"|\") : \"never\";\n await fs.writeFile(path.join(outDir, `${query.shortApiName}.ts`), await formatTs(`\n import type { QueryDefinition , QueryParam, QueryResult, VersionBound} from \"${forInternalUse ? \"@osdk/api\" : \"@osdk/client\"}\";\n import type { $ExpectedClientVersion } from \"../../OntologyMetadata${importExt}\";\n import { $osdkMetadata} from \"../../OntologyMetadata${importExt}\";\n ${importObjects}\n\n export namespace ${query.shortApiName} {\n export interface Signature {\n ${getDescriptionIfPresent(query.description)}\n (${Object.keys(query.parameters).length > 0 ? `query: ${query.paramsIdentifier}` : \"\"}): Promise<${query.shortApiName}.ReturnType>\n }\n\n ${Object.keys(query.parameters).length > 0 ? `\n export interface Parameters {\n ${stringify(query.parameters, {\n \"*\": (parameter, formatter, apiName) => {\n const q = paramToDef(parameter);\n return [`\n ${queryParamJsDoc(paramToDef(parameter), {\n apiName\n })}readonly \"${apiName}\"${q.nullable ? \"?\" : \"\"}`, `${getQueryParamType(ontology, q, \"Param\")}`];\n }\n })}\n }` : \"\"}\n\n ${query.output.type === \"struct\" ? `\n export interface ReturnType \n ${getQueryParamType(ontology, paramToDef({\n dataType: query.output\n }), \"Result\")}\n ` : `\n export type ReturnType = ${getQueryParamType(ontology, paramToDef({\n dataType: query.output\n }), \"Result\")}\n `}\n }\n \n \n export interface ${query.shortApiName} extends QueryDefinition<\n ${query.shortApiName}.Signature\n >, VersionBound<$ExpectedClientVersion>{\n __DefinitionMetadata?: {\n ${stringify(baseProps)}\n parameters: {\n ${parameterDefsForType(ontology, query)}\n };\n output: {\n ${stringify(outputBase)},\n ${getLineFor__OsdkTargetType(ontology, query.output)}\n };\n signature: ${query.shortApiName}.Signature;\n }, \n ${stringify(baseProps, {\n \"description\": () => undefined,\n \"displayName\": () => undefined,\n \"rid\": () => undefined\n })}, \n osdkMetadata: typeof $osdkMetadata;\n }\n\n\n export const ${query.shortApiName}: ${query.definitionIdentifier} = {\n ${stringify(baseProps, {\n \"description\": () => undefined,\n \"displayName\": () => undefined,\n \"rid\": () => undefined\n })},\n osdkMetadata: $osdkMetadata\n };\n `));\n}\nfunction parametersForConst(query) {\n return stringify(query.parameters, {\n \"*\": (parameter, formatter) => formatter(deleteUndefineds(paramToDef(parameter)))\n });\n}\nfunction parameterDefsForType(ontology, query) {\n return stringify(query.parameters, {\n \"*\": (parameter, valueFormatter, apiName) => [`${queryParamJsDoc(paramToDef(parameter), {\n apiName\n })} ${apiName}`, ` {\n ${stringify(deleteUndefineds(paramToDef(parameter)))},\n ${getLineFor__OsdkTargetType(ontology, parameter.dataType)}\n }`]\n });\n}\nfunction getLineFor__OsdkTargetType(ontology, qdt) {\n if (qdt.type === \"object\" || qdt.type === \"objectSet\") {\n return `__OsdkTargetType?: ${ontology.requireObjectType(qdt.objectTypeApiName).getImportedDefinitionIdentifier(true)}`;\n }\n return \"\";\n}\nexport function queryParamJsDoc(param, {\n apiName\n}) {\n let ret = `/**\\n`;\n if (param.description) {\n if (param.description) {\n ret += ` * description: ${param.description}\\n`;\n }\n } else {\n ret += ` * (no ontology metadata)\\n`;\n }\n ret += ` */\\n`;\n return ret;\n}\nexport function getQueryParamType(enhancedOntology, input, type) {\n let inner = `unknown /* ${input.type} */`;\n switch (input.type) {\n case \"date\":\n inner = `Query${type}.PrimitiveType<${JSON.stringify(\"datetime\")}>`;\n break;\n case \"attachment\":\n case \"boolean\":\n case \"double\":\n case \"float\":\n case \"integer\":\n case \"long\":\n case \"string\":\n case \"threeDimensionalAggregation\":\n case \"timestamp\":\n case \"twoDimensionalAggregation\":\n inner = `Query${type}.PrimitiveType<${JSON.stringify(input.type)}>`;\n break;\n case \"struct\":\n inner = `{\n ${stringify(input.struct, {\n \"*\": (p, formatter, apiName) => {\n return [`\n ${type === \"Param\" ? \"readonly \" : \"\"}\"${apiName}\"${p.nullable ? \"?\" : \"\"}`, `${getQueryParamType(enhancedOntology, p, type)}`];\n }\n })}\n }`;\n break;\n case \"object\":\n inner = `Query${type}.ObjectType<${enhancedOntology.requireObjectType(input.object).getImportedDefinitionIdentifier(true)}>`;\n break;\n case \"objectSet\":\n inner = `Query${type}.ObjectSetType<${enhancedOntology.requireObjectType(input.objectSet).getImportedDefinitionIdentifier(true)}>`;\n break;\n case \"set\":\n inner = `${type === \"Param\" ? \"Readonly\" : \"\"}Set<${getQueryParamType(enhancedOntology, input.set, type)}>`;\n break;\n case \"union\":\n inner = input.union.map(u => getQueryParamType(enhancedOntology, u, type)).join(\" | \");\n break;\n }\n if (input.multiplicity && type === \"Param\") {\n return `ReadonlyArray<${inner}>`;\n } else if (input.multiplicity) {\n return `Array<${inner}>`;\n }\n return inner;\n}","/*\n * Copyright 2023 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 path from \"node:path\";\nimport { ForeignType } from \"../GenerateContext/ForeignType.js\";\nimport { formatTs } from \"../util/test/formatTs.js\";\nexport async function generateRootIndexTsFile({\n fs,\n outDir,\n importExt,\n ontologyApiNamespace,\n ontology\n}) {\n await fs.writeFile(path.join(outDir, \"index.ts\"), await formatTs(`export {${helper(ontology.actionTypes)}} from \"./ontology/actions${importExt}\";\n export * as $Actions from \"./ontology/actions${importExt}\";\n export {${helper(ontology.interfaceTypes)}} from \"./ontology/interfaces${importExt}\";\n export * as $Interfaces from \"./ontology/interfaces${importExt}\";\n export {${helper(ontology.objectTypes)}} from \"./ontology/objects${importExt}\";\n export * as $Objects from \"./ontology/objects${importExt}\";\n export {${helper(ontology.queryTypes)}} from \"./ontology/queries${importExt}\";\n export * as $Queries from \"./ontology/queries${importExt}\";\n export { $osdkMetadata } from \"./OntologyMetadata${importExt}\";\n ${ontologyApiNamespace == null ? `export { $ontologyRid } from \"./OntologyMetadata${importExt}\";` : ``}\n `));\n}\nfunction helper(x) {\n return Object.values(x).filter(x => !(x instanceof ForeignType)).map(a => a.shortApiName).join(\", \");\n}","/*\n * Copyright 2023 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 { enhanceOntology } from \"../GenerateContext/enhanceOntology.js\";\nimport { sanitizeMetadata } from \"../shared/sanitizeMetadata.js\";\nimport { verifyOutDir } from \"../util/verifyOutDir.js\";\nimport { generateOntologyMetadataFile } from \"./generateMetadata.js\";\nimport { generatePerActionDataFiles } from \"./generatePerActionDataFiles.js\";\nimport { generatePerInterfaceDataFiles } from \"./generatePerInterfaceDataFiles.js\";\nimport { generatePerObjectDataFiles } from \"./generatePerObjectDataFiles.js\";\nimport { generatePerQueryDataFilesV2 } from \"./generatePerQueryDataFiles.js\";\nimport { generateRootIndexTsFile } from \"./generateRootIndexTsFile.js\";\nexport async function generateClientSdkVersionTwoPointZero(ontology, userAgent, fs, outDir, packageType = \"commonjs\", externalObjects = new Map(), externalInterfaces = new Map(), externalSpts = new Map(), forInternalUse = false) {\n const importExt = \".js\"; // turns out you can always use the extension\n\n // Structurally, we need to have multiple ontologies read in\n // with one per package.\n\n await verifyOutDir(outDir, fs);\n const sanitizedOntology = sanitizeMetadata(ontology);\n await fs.mkdir(outDir, {\n recursive: true\n });\n const enhancedOntology = enhanceOntology({\n sanitized: sanitizedOntology,\n importExt,\n externalObjects,\n externalInterfaces,\n externalSpts\n });\n const ctx = {\n sanitizedOntology,\n ontology: enhancedOntology,\n importExt,\n fs,\n outDir,\n forInternalUse\n };\n await generateRootIndexTsFile(ctx);\n await generateOntologyMetadataFile(ctx, userAgent);\n await generatePerObjectDataFiles(ctx);\n await generatePerInterfaceDataFiles(ctx);\n await generatePerActionDataFiles(ctx);\n await generatePerQueryDataFilesV2(ctx, true);\n}","/*\n * Copyright 2024 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 { generateClientSdkVersionTwoPointZero } from \"./v2.0/generateClientSdkVersionTwoPointZero.js\";\nexport async function generateClientSdkPackage(packageName, packageVersion, sdkVersion, baseOutDir, ontology, minimalFs, dependencyVersions, cliVersion, externalObjects = new Map(), externalInterfaces = new Map()) {\n if (!packageName) throw new Error(\"Package name is required\");\n if (sdkVersion === \"1.1\") {\n throw new Error(\"This generator version does not support generating v1 sdks\");\n }\n for (const packageType of [\"module\", \"commonjs\"]) {\n const outDir = path.join(baseOutDir, \"dist\", packageType);\n await generateClientSdkVersionTwoPointZero(ontology, `typescript-sdk/${packageVersion} osdk-cli/${cliVersion}`, minimalFs, outDir, packageType, externalObjects, externalInterfaces);\n await fs.promises.mkdir(outDir, {\n recursive: true\n });\n await writeJson(minimalFs, path.join(outDir, \"package.json\"), {\n type: packageType\n });\n await writeJson(minimalFs, path.join(outDir, `tsconfig.json`), {\n compilerOptions: getTsCompilerOptions(packageType)\n });\n }\n await writeJson(minimalFs, path.join(baseOutDir, \"package.json\"), getPackageJsonContents(packageName, packageVersion, dependencyVersions));\n\n // we need to shim for the node10 resolver\n await minimalFs.mkdir(path.join(baseOutDir, \"ontology\"), {\n recursive: true\n });\n await minimalFs.writeFile(path.join(baseOutDir, \"ontology\", \"objects.js\"), `module.exports = require(\"../../dist/module/ontology/objects\")`);\n await minimalFs.writeFile(path.join(baseOutDir, \"ontology\", \"objects.d.ts\"), `export * from \"../dist/module/ontology/objects\"`);\n}\nfunction getTsCompilerOptions(packageType) {\n const commonTsconfig = {\n importHelpers: true,\n declaration: true,\n isolatedModules: true,\n esModuleInterop: true,\n forceConsistentCasingInFileNames: true,\n strict: true,\n skipLibCheck: true\n };\n const compilerOptions = packageType === \"commonjs\" ? {\n ...commonTsconfig,\n module: \"commonjs\",\n target: \"es2018\"\n } : {\n ...commonTsconfig,\n module: \"NodeNext\",\n target: \"ES2020\"\n };\n return compilerOptions;\n}\nexport function getExpectedDependencies({\n osdkApiVersion,\n osdkClientVersion\n}) {\n return {\n devDependencies: {\n \"@osdk/api\": osdkApiVersion\n },\n peerDependencies: {\n \"@osdk/api\": osdkApiVersion,\n \"@osdk/client\": osdkClientVersion\n }\n };\n}\nfunction getExpectedDependenciesFull(dependencyVersions) {\n const {\n typescriptVersion,\n tslibVersion,\n areTheTypesWrongVersion\n } = dependencyVersions;\n const base = getExpectedDependencies(dependencyVersions);\n return {\n devDependencies: {\n ...base.devDependencies,\n \"typescript\": typescriptVersion,\n \"tslib\": tslibVersion,\n \"@arethetypeswrong/cli\": areTheTypesWrongVersion\n },\n peerDependencies: {\n ...base.peerDependencies\n }\n };\n}\nexport function getPackageJsonContents(name, version, dependencyVersions) {\n const esmPrefix = \"./dist/module\";\n const commonjsPrefix = \"./dist/commonjs\";\n return {\n name,\n version,\n main: `${commonjsPrefix}/index.js`,\n module: `${esmPrefix}/index.js`,\n exports: {\n \".\": {\n import: `${esmPrefix}/index.js`,\n require: `${commonjsPrefix}/index.js`\n }\n },\n scripts: {\n prepack: `tsc -p ${esmPrefix}/tsconfig.json && tsc -p ${commonjsPrefix}/tsconfig.json`,\n check: \"npm exec attw $(npm pack)\"\n },\n ...getExpectedDependenciesFull(dependencyVersions),\n files: [\"**/*.js\", \"**/*.d.ts\", \"dist/**/package.json\"]\n };\n}\nasync function writeJson(minimalFs, filePath, body) {\n // consola.info(`Writing ${filePath}`);\n // consola.debug(`Writing ${filePath} with body`, body);\n return void (await minimalFs.writeFile(filePath, JSON.stringify(body, undefined, 2) + \"\\n\"));\n}"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osdk/generator",
3
- "version": "2.1.0-beta.28",
3
+ "version": "2.1.0-beta.29",
4
4
  "description": "",
5
5
  "access": "public",
6
6
  "license": "Apache-2.0",
@@ -34,8 +34,8 @@
34
34
  "fetch-retry": "^6.0.0",
35
35
  "prettier": "^3.0.3",
36
36
  "tiny-invariant": "^1.3.1",
37
- "@osdk/api": "~2.1.0-beta.28",
38
- "@osdk/generator-converters": "~2.1.0-beta.28"
37
+ "@osdk/generator-converters": "~2.1.0-beta.29",
38
+ "@osdk/api": "~2.1.0-beta.29"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@types/node": "^18.0.0",