@osdk/generator 2.0.2-rc.0 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/build/browser/GenerateContext/EnhanceCommon.d.ts +0 -2
  3. package/build/browser/GenerateContext/EnhanceCommon.d.ts.map +1 -1
  4. package/build/browser/GenerateContext/EnhancedBase.d.ts +1 -3
  5. package/build/browser/GenerateContext/EnhancedBase.d.ts.map +1 -1
  6. package/build/browser/GenerateContext/EnhancedBase.js +2 -11
  7. package/build/browser/GenerateContext/EnhancedBase.js.map +1 -1
  8. package/build/browser/GenerateContext/EnhancedOntologyDefinition.d.ts +4 -4
  9. package/build/browser/GenerateContext/EnhancedOntologyDefinition.d.ts.map +1 -1
  10. package/build/browser/GenerateContext/EnhancedOntologyDefinition.js +27 -21
  11. package/build/browser/GenerateContext/EnhancedOntologyDefinition.js.map +1 -1
  12. package/build/browser/GenerateContext/ForeignType.d.ts +1 -2
  13. package/build/browser/GenerateContext/ForeignType.d.ts.map +1 -1
  14. package/build/browser/GenerateContext/ForeignType.js +5 -11
  15. package/build/browser/GenerateContext/ForeignType.js.map +1 -1
  16. package/build/browser/GenerateContext/enhanceOntology.d.ts +7 -1
  17. package/build/browser/GenerateContext/enhanceOntology.d.ts.map +1 -1
  18. package/build/browser/GenerateContext/enhanceOntology.js +8 -2
  19. package/build/browser/GenerateContext/enhanceOntology.js.map +1 -1
  20. package/build/browser/generateClientSdkPackage.d.ts +1 -1
  21. package/build/browser/generateClientSdkPackage.d.ts.map +1 -1
  22. package/build/browser/generateClientSdkPackage.js +2 -2
  23. package/build/browser/generateClientSdkPackage.js.map +1 -1
  24. package/build/browser/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.js +19 -6
  25. package/build/browser/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.js.map +1 -1
  26. package/build/browser/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.js +40 -6
  27. package/build/browser/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.js.map +1 -1
  28. package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.d.ts +1 -1
  29. package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.d.ts.map +1 -1
  30. package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.js +16 -80
  31. package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.js.map +1 -1
  32. package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.test.js +121 -52
  33. package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.test.js.map +1 -1
  34. package/build/browser/v2.0/generatePerActionDataFiles.test.js +14 -2
  35. package/build/browser/v2.0/generatePerActionDataFiles.test.js.map +1 -1
  36. package/build/browser/v2.0/generatePerInterfaceDataFiles.d.ts +2 -0
  37. package/build/browser/v2.0/generatePerInterfaceDataFiles.d.ts.map +1 -0
  38. package/build/browser/v2.0/generatePerInterfaceDataFiles.js +45 -0
  39. package/build/browser/v2.0/generatePerInterfaceDataFiles.js.map +1 -0
  40. package/build/browser/v2.0/generatePerObjectDataFiles.d.ts +3 -0
  41. package/build/browser/v2.0/generatePerObjectDataFiles.d.ts.map +1 -0
  42. package/build/browser/v2.0/generatePerObjectDataFiles.js +47 -0
  43. package/build/browser/v2.0/generatePerObjectDataFiles.js.map +1 -0
  44. package/build/browser/v2.0/generatePerQueryDataFiles.d.ts.map +1 -1
  45. package/build/browser/v2.0/generatePerQueryDataFiles.js +1 -1
  46. package/build/browser/v2.0/generatePerQueryDataFiles.js.map +1 -1
  47. package/build/browser/v2.0/generatePerQueryDataFiles.test.js +9 -3
  48. package/build/browser/v2.0/generatePerQueryDataFiles.test.js.map +1 -1
  49. package/build/browser/v2.0/generateRootIndexTsFile.d.ts +3 -0
  50. package/build/browser/v2.0/generateRootIndexTsFile.d.ts.map +1 -0
  51. package/build/browser/v2.0/generateRootIndexTsFile.js +40 -0
  52. package/build/browser/v2.0/generateRootIndexTsFile.js.map +1 -0
  53. package/build/browser/v2.0/wireObjectTypeV2ToSdkObjectConstV2.d.ts.map +1 -1
  54. package/build/browser/v2.0/wireObjectTypeV2ToSdkObjectConstV2.js +19 -9
  55. package/build/browser/v2.0/wireObjectTypeV2ToSdkObjectConstV2.js.map +1 -1
  56. package/build/esm/GenerateContext/EnhanceCommon.d.ts +0 -2
  57. package/build/esm/GenerateContext/EnhanceCommon.d.ts.map +1 -1
  58. package/build/esm/GenerateContext/EnhancedBase.d.ts +1 -3
  59. package/build/esm/GenerateContext/EnhancedBase.d.ts.map +1 -1
  60. package/build/esm/GenerateContext/EnhancedBase.js +2 -11
  61. package/build/esm/GenerateContext/EnhancedBase.js.map +1 -1
  62. package/build/esm/GenerateContext/EnhancedOntologyDefinition.d.ts +4 -4
  63. package/build/esm/GenerateContext/EnhancedOntologyDefinition.d.ts.map +1 -1
  64. package/build/esm/GenerateContext/EnhancedOntologyDefinition.js +27 -21
  65. package/build/esm/GenerateContext/EnhancedOntologyDefinition.js.map +1 -1
  66. package/build/esm/GenerateContext/ForeignType.d.ts +1 -2
  67. package/build/esm/GenerateContext/ForeignType.d.ts.map +1 -1
  68. package/build/esm/GenerateContext/ForeignType.js +5 -11
  69. package/build/esm/GenerateContext/ForeignType.js.map +1 -1
  70. package/build/esm/GenerateContext/enhanceOntology.d.ts +7 -1
  71. package/build/esm/GenerateContext/enhanceOntology.d.ts.map +1 -1
  72. package/build/esm/GenerateContext/enhanceOntology.js +8 -2
  73. package/build/esm/GenerateContext/enhanceOntology.js.map +1 -1
  74. package/build/esm/generateClientSdkPackage.d.ts +1 -1
  75. package/build/esm/generateClientSdkPackage.d.ts.map +1 -1
  76. package/build/esm/generateClientSdkPackage.js +2 -2
  77. package/build/esm/generateClientSdkPackage.js.map +1 -1
  78. package/build/esm/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.js +19 -6
  79. package/build/esm/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.js.map +1 -1
  80. package/build/esm/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.js +40 -6
  81. package/build/esm/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.js.map +1 -1
  82. package/build/esm/v2.0/generateClientSdkVersionTwoPointZero.d.ts +1 -1
  83. package/build/esm/v2.0/generateClientSdkVersionTwoPointZero.d.ts.map +1 -1
  84. package/build/esm/v2.0/generateClientSdkVersionTwoPointZero.js +16 -80
  85. package/build/esm/v2.0/generateClientSdkVersionTwoPointZero.js.map +1 -1
  86. package/build/esm/v2.0/generateClientSdkVersionTwoPointZero.test.js +121 -52
  87. package/build/esm/v2.0/generateClientSdkVersionTwoPointZero.test.js.map +1 -1
  88. package/build/esm/v2.0/generatePerActionDataFiles.test.js +14 -2
  89. package/build/esm/v2.0/generatePerActionDataFiles.test.js.map +1 -1
  90. package/build/esm/v2.0/generatePerInterfaceDataFiles.d.ts +2 -0
  91. package/build/esm/v2.0/generatePerInterfaceDataFiles.d.ts.map +1 -0
  92. package/build/esm/v2.0/generatePerInterfaceDataFiles.js +45 -0
  93. package/build/esm/v2.0/generatePerInterfaceDataFiles.js.map +1 -0
  94. package/build/esm/v2.0/generatePerObjectDataFiles.d.ts +3 -0
  95. package/build/esm/v2.0/generatePerObjectDataFiles.d.ts.map +1 -0
  96. package/build/esm/v2.0/generatePerObjectDataFiles.js +47 -0
  97. package/build/esm/v2.0/generatePerObjectDataFiles.js.map +1 -0
  98. package/build/esm/v2.0/generatePerQueryDataFiles.d.ts.map +1 -1
  99. package/build/esm/v2.0/generatePerQueryDataFiles.js +1 -1
  100. package/build/esm/v2.0/generatePerQueryDataFiles.js.map +1 -1
  101. package/build/esm/v2.0/generatePerQueryDataFiles.test.js +9 -3
  102. package/build/esm/v2.0/generatePerQueryDataFiles.test.js.map +1 -1
  103. package/build/esm/v2.0/generateRootIndexTsFile.d.ts +3 -0
  104. package/build/esm/v2.0/generateRootIndexTsFile.d.ts.map +1 -0
  105. package/build/esm/v2.0/generateRootIndexTsFile.js +40 -0
  106. package/build/esm/v2.0/generateRootIndexTsFile.js.map +1 -0
  107. package/build/esm/v2.0/wireObjectTypeV2ToSdkObjectConstV2.d.ts.map +1 -1
  108. package/build/esm/v2.0/wireObjectTypeV2ToSdkObjectConstV2.js +19 -9
  109. package/build/esm/v2.0/wireObjectTypeV2ToSdkObjectConstV2.js.map +1 -1
  110. package/package.json +3 -3
@@ -0,0 +1,45 @@
1
+ /*
2
+ * Copyright 2023 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import path from "node:path";
17
+ import { EnhancedInterfaceType } from "../GenerateContext/EnhancedInterfaceType.js";
18
+ import { ForeignType } from "../GenerateContext/ForeignType.js";
19
+ import { formatTs } from "../util/test/formatTs.js";
20
+ import { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst } from "./UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.js";
21
+ /** @internal */
22
+ export async function generatePerInterfaceDataFiles({
23
+ fs,
24
+ outDir,
25
+ ontology,
26
+ importExt
27
+ }) {
28
+ const interfacesDir = path.join(outDir, "ontology", "interfaces");
29
+ await fs.mkdir(interfacesDir, {
30
+ recursive: true
31
+ });
32
+ for (const obj of Object.values(ontology.interfaceTypes)) {
33
+ if (obj instanceof ForeignType) continue;
34
+ await fs.writeFile(path.join(interfacesDir, `${obj.shortApiName}.ts`), await formatTs(`
35
+ import type { PropertyDef as $PropertyDef } from "@osdk/api";
36
+ import { $osdkMetadata } from "../../OntologyMetadata${importExt}";
37
+ ${__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(obj, ontology, true)}
38
+ `));
39
+ }
40
+ await fs.writeFile(interfacesDir + ".ts", await formatTs(`
41
+ ${Object.values(ontology.interfaceTypes).filter(i => i instanceof EnhancedInterfaceType).map(interfaceType => `export {${interfaceType.shortApiName}} from "./interfaces/${interfaceType.shortApiName}${importExt}";`).join("\n")}
42
+ ${Object.keys(ontology.interfaceTypes).length === 0 ? "export {}" : ""}
43
+ `));
44
+ }
45
+ //# sourceMappingURL=generatePerInterfaceDataFiles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generatePerInterfaceDataFiles.js","names":["path","EnhancedInterfaceType","ForeignType","formatTs","__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst","generatePerInterfaceDataFiles","fs","outDir","ontology","importExt","interfacesDir","join","mkdir","recursive","obj","Object","values","interfaceTypes","writeFile","shortApiName","filter","i","map","interfaceType","keys","length"],"sources":["generatePerInterfaceDataFiles.js"],"sourcesContent":["/*\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 */\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/** @internal */\nexport async function generatePerInterfaceDataFiles({ fs, outDir, ontology, importExt }) {\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)\n continue;\n await fs.writeFile(path.join(interfacesDir, `${obj.shortApiName}.ts`), await formatTs(`\n import type { PropertyDef as $PropertyDef } from \"@osdk/api\";\n import { $osdkMetadata } from \"../../OntologyMetadata${importExt}\";\n ${__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(obj, ontology, true)}\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\n ? \"export {}\"\n : \"\"}\n `));\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,WAAW;AAC5B,SAASC,qBAAqB,QAAQ,6CAA6C;AACnF,SAASC,WAAW,QAAQ,mCAAmC;AAC/D,SAASC,QAAQ,QAAQ,0BAA0B;AACnD,SAASC,8CAA8C,QAAQ,mDAAmD;AAClH;AACA,OAAO,eAAeC,6BAA6BA,CAAC;EAAEC,EAAE;EAAEC,MAAM;EAAEC,QAAQ;EAAEC;AAAU,CAAC,EAAE;EACrF,MAAMC,aAAa,GAAGV,IAAI,CAACW,IAAI,CAACJ,MAAM,EAAE,UAAU,EAAE,YAAY,CAAC;EACjE,MAAMD,EAAE,CAACM,KAAK,CAACF,aAAa,EAAE;IAC1BG,SAAS,EAAE;EACf,CAAC,CAAC;EACF,KAAK,MAAMC,GAAG,IAAIC,MAAM,CAACC,MAAM,CAACR,QAAQ,CAACS,cAAc,CAAC,EAAE;IACtD,IAAIH,GAAG,YAAYZ,WAAW,EAC1B;IACJ,MAAMI,EAAE,CAACY,SAAS,CAAClB,IAAI,CAACW,IAAI,CAACD,aAAa,EAAE,GAAGI,GAAG,CAACK,YAAY,KAAK,CAAC,EAAE,MAAMhB,QAAQ,CAAC;AAC9F;AACA,+DAA+DM,SAAS;AACxE,QAAQL,8CAA8C,CAACU,GAAG,EAAEN,QAAQ,EAAE,IAAI,CAAC;AAC3E,KAAK,CAAC,CAAC;EACH;EACA,MAAMF,EAAE,CAACY,SAAS,CAACR,aAAa,GAAG,KAAK,EAAE,MAAMP,QAAQ,CAAC;AAC7D,MAAMY,MAAM,CAACC,MAAM,CAACR,QAAQ,CAACS,cAAc,CAAC,CAACG,MAAM,CAACC,CAAC,IAAIA,CAAC,YAAYpB,qBAAqB,CAAC,CAACqB,GAAG,CAACC,aAAa,IAAI,WAAWA,aAAa,CAACJ,YAAY,wBAAwBI,aAAa,CAACJ,YAAY,GAAGV,SAAS,IAAI,CAAC,CAACE,IAAI,CAAC,IAAI,CAAC;AACrO,MAAMI,MAAM,CAACS,IAAI,CAAChB,QAAQ,CAACS,cAAc,CAAC,CAACQ,MAAM,KAAK,CAAC,GAC7C,WAAW,GACX,EAAE;AACZ,KAAK,CAAC,CAAC;AACP","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ import type { GenerateContext } from "../GenerateContext/GenerateContext.js";
2
+ export declare function generatePerObjectDataFiles(ctx: GenerateContext): Promise<void>;
3
+ //# sourceMappingURL=generatePerObjectDataFiles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generatePerObjectDataFiles.d.ts","sourceRoot":"","sources":["../../../src/v2.0/generatePerObjectDataFiles.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAM7E,wBAAsB,0BAA0B,CAC9C,GAAG,EAAE,eAAe,iBA2CrB"}
@@ -0,0 +1,47 @@
1
+ /*
2
+ * Copyright 2023 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import path from "node:path";
17
+ import { EnhancedObjectType } from "../GenerateContext/EnhancedObjectType.js";
18
+ import { ForeignType } from "../GenerateContext/ForeignType.js";
19
+ import { formatTs } from "../util/test/formatTs.js";
20
+ import { wireObjectTypeV2ToSdkObjectConstV2 } from "./wireObjectTypeV2ToSdkObjectConstV2.js";
21
+ export async function generatePerObjectDataFiles(ctx) {
22
+ const {
23
+ fs,
24
+ outDir,
25
+ ontology,
26
+ importExt
27
+ } = ctx;
28
+ await fs.mkdir(path.join(outDir, "ontology", "objects"), {
29
+ recursive: true
30
+ });
31
+ for (const obj of Object.values(ontology.objectTypes)) {
32
+ if (obj instanceof ForeignType) continue;
33
+ const relPath = path.join(".", "ontology", `objects`, `${obj.shortApiName}.ts`);
34
+ const outFilePath = path.join(outDir, relPath);
35
+ await fs.writeFile(outFilePath, await formatTs(`
36
+ import type { PropertyDef as $PropertyDef } from "@osdk/api";
37
+ import { $osdkMetadata } from "../../OntologyMetadata${importExt}";
38
+ import type { $ExpectedClientVersion } from "../../OntologyMetadata${importExt}";
39
+ ${wireObjectTypeV2ToSdkObjectConstV2(obj.raw, ctx, relPath)}
40
+ `));
41
+ }
42
+ await fs.writeFile(path.join(outDir, "ontology", "objects.ts"), await formatTs(`
43
+ ${Object.values(ctx.ontology.objectTypes).filter(o => o instanceof EnhancedObjectType).map(objType => `export {${objType.shortApiName}} from "./objects/${objType.shortApiName}${importExt}";`).join("\n")}
44
+ ${Object.keys(ontology.objectTypes).length === 0 ? "export {};" : ""}
45
+ `));
46
+ }
47
+ //# sourceMappingURL=generatePerObjectDataFiles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generatePerObjectDataFiles.js","names":["path","EnhancedObjectType","ForeignType","formatTs","wireObjectTypeV2ToSdkObjectConstV2","generatePerObjectDataFiles","ctx","fs","outDir","ontology","importExt","mkdir","join","recursive","obj","Object","values","objectTypes","relPath","shortApiName","outFilePath","writeFile","raw","filter","o","map","objType","keys","length"],"sources":["generatePerObjectDataFiles.js"],"sourcesContent":["/*\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 */\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 { fs, outDir, ontology, importExt, } = ctx;\n await fs.mkdir(path.join(outDir, \"ontology\", \"objects\"), { recursive: true });\n for (const obj of Object.values(ontology.objectTypes)) {\n if (obj instanceof ForeignType)\n 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 \"@osdk/api\";\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"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,WAAW;AAC5B,SAASC,kBAAkB,QAAQ,0CAA0C;AAC7E,SAASC,WAAW,QAAQ,mCAAmC;AAC/D,SAASC,QAAQ,QAAQ,0BAA0B;AACnD,SAASC,kCAAkC,QAAS,yCAAyC;AAC7F,OAAO,eAAeC,0BAA0BA,CAACC,GAAG,EAAE;EAClD,MAAM;IAAEC,EAAE;IAAEC,MAAM;IAAEC,QAAQ;IAAEC;EAAW,CAAC,GAAGJ,GAAG;EAChD,MAAMC,EAAE,CAACI,KAAK,CAACX,IAAI,CAACY,IAAI,CAACJ,MAAM,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE;IAAEK,SAAS,EAAE;EAAK,CAAC,CAAC;EAC7E,KAAK,MAAMC,GAAG,IAAIC,MAAM,CAACC,MAAM,CAACP,QAAQ,CAACQ,WAAW,CAAC,EAAE;IACnD,IAAIH,GAAG,YAAYZ,WAAW,EAC1B;IACJ,MAAMgB,OAAO,GAAGlB,IAAI,CAACY,IAAI,CAAC,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,GAAGE,GAAG,CAACK,YAAY,KAAK,CAAC;IAC/E,MAAMC,WAAW,GAAGpB,IAAI,CAACY,IAAI,CAACJ,MAAM,EAAEU,OAAO,CAAC;IAC9C,MAAMX,EAAE,CAACc,SAAS,CAACD,WAAW,EAAE,MAAMjB,QAAQ,CAAC;AACvD;AACA,+DAA+DO,SAAS;AACxE,6EAA6EA,SAAS;AACtF,UAAUN,kCAAkC,CAACU,GAAG,CAACQ,GAAG,EAAEhB,GAAG,EAAEY,OAAO,CAAC;AACnE,OAAO,CAAC,CAAC;EACL;EACA,MAAMX,EAAE,CAACc,SAAS,CAACrB,IAAI,CAACY,IAAI,CAACJ,MAAM,EAAE,UAAU,EAAE,YAAY,CAAC,EAAE,MAAML,QAAQ,CAAC;AACnF,MAAMY,MAAM,CAACC,MAAM,CAACV,GAAG,CAACG,QAAQ,CAACQ,WAAW,CAAC,CAACM,MAAM,CAACC,CAAC,IAAIA,CAAC,YAAYvB,kBAAkB,CAAC,CAACwB,GAAG,CAACC,OAAO,IAAI,WAAWA,OAAO,CAACP,YAAY,qBAAqBO,OAAO,CAACP,YAAY,GAAGT,SAAS,IAAI,CAAC,CAACE,IAAI,CAAC,IAAI,CAAC;AAC9M,MAAMG,MAAM,CAACY,IAAI,CAAClB,QAAQ,CAACQ,WAAW,CAAC,CAACW,MAAM,KAAK,CAAC,GAAG,YAAY,GAAG,EAAE;AACxE,KAAK,CAAC,CAAC;AACP","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"generatePerQueryDataFiles.d.ts","sourceRoot":"","sources":["../../../src/v2.0/generatePerQueryDataFiles.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAQ1D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,kDAAkD,CAAC;AAEnG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAS7E,wBAAsB,2BAA2B,CAC/C,EACE,EAAE,EACF,MAAM,EAAE,UAAU,EAClB,QAAQ,EACR,SAAc,GACf,EAAE,IAAI,CACL,eAAe,EACb,IAAI,GACJ,QAAQ,GACR,WAAW,GACX,UAAU,CACb,EACD,EAAE,EAAE,OAAO,iBA+BZ;AAkKD,wBAAgB,eAAe,CAC7B,KAAK,EAAE,wBAAwB,CAAC,GAAG,CAAC,EACpC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,UAcjC;AAED,wBAAgB,iBAAiB,CAC/B,gBAAgB,EAAE,0BAA0B,EAC5C,KAAK,EAAE,wBAAwB,EAC/B,IAAI,EAAE,OAAO,GAAG,QAAQ,GACvB,MAAM,CAuDR"}
1
+ {"version":3,"file":"generatePerQueryDataFiles.d.ts","sourceRoot":"","sources":["../../../src/v2.0/generatePerQueryDataFiles.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAQ1D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,kDAAkD,CAAC;AAEnG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAS7E,wBAAsB,2BAA2B,CAC/C,EACE,EAAE,EACF,MAAM,EAAE,UAAU,EAClB,QAAQ,EACR,SAAc,GACf,EAAE,IAAI,CACL,eAAe,EACb,IAAI,GACJ,QAAQ,GACR,WAAW,GACX,UAAU,CACb,EACD,EAAE,EAAE,OAAO,iBAiCZ;AAkKD,wBAAgB,eAAe,CAC7B,KAAK,EAAE,wBAAwB,CAAC,GAAG,CAAC,EACpC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,UAcjC;AAED,wBAAgB,iBAAiB,CAC/B,gBAAgB,EAAE,0BAA0B,EAC5C,KAAK,EAAE,wBAAwB,EAC/B,IAAI,EAAE,OAAO,GAAG,QAAQ,GACvB,MAAM,CAuDR"}
@@ -36,7 +36,7 @@ export async function generatePerQueryDataFilesV2({
36
36
  await generateV2QueryFile(fs, outDir, relOutDir, query, importExt, ontology);
37
37
  }));
38
38
  await fs.writeFile(`${outDir}.ts`, await formatTs(`
39
- ${Object.values(ontology.queryTypes).map(query => `export * from "${query.getImportPathRelTo(relOutDir)}";`).join("\n")}
39
+ ${Object.values(ontology.queryTypes).map(query => `export {${query.shortApiName}} from "${query.getImportPathRelTo(relOutDir)}";`).join("\n")}
40
40
  ${Object.keys(ontology.queryTypes).length === 0 ? "export {};" : ""}
41
41
  `));
42
42
  }
@@ -1 +1 @@
1
- {"version":3,"file":"generatePerQueryDataFiles.js","names":["wireQueryDataTypeToQueryDataTypeDefinition","wireQueryParameterV2ToQueryParameterDefinition","paramToDef","wireQueryTypeV2ToSdkQueryDefinitionNoParams","path","getObjectImports","getObjectTypeApiNamesFromQuery","deleteUndefineds","stringify","formatTs","getDescriptionIfPresent","generatePerQueryDataFilesV2","fs","outDir","rootOutDir","ontology","importExt","relOutDir","join","mkdir","recursive","Promise","all","Object","values","queryTypes","map","query","generateV2QueryFile","writeFile","getImportPathRelTo","keys","length","relFilePath","shortApiName","objectTypes","objectTypeObjects","Set","o","requireObjectType","importObjects","baseProps","raw","outputBase","output","apiNameObj","description","parameters","paramsIdentifier","getQueryParamType","dataType","*","parameter","formatter","apiName","q","queryParamJsDoc","nullable","parameterDefsForType","getLineFor__OsdkTargetType","undefined","displayName","rid","definitionIdentifier","parametersForConst","valueFormatter","qdt","type","objectTypeApiName","getImportedDefinitionIdentifier","param","ret","enhancedOntology","input","inner","JSON","object","objectSet","set","union","u","multiplicity"],"sources":["generatePerQueryDataFiles.js"],"sourcesContent":["/*\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 */\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({ fs, outDir: rootOutDir, ontology, importExt = \"\", }, v2) {\n const relOutDir = path.join(\".\", \"ontology\", \"queries\");\n const outDir = path.join(rootOutDir, \"ontology\", \"queries\");\n await fs.mkdir(outDir, { recursive: true });\n await Promise.all(Object.values(ontology.queryTypes).map(async (query) => {\n await generateV2QueryFile(fs, outDir, relOutDir, query, importExt, ontology);\n }));\n const indexFilePath = `${outDir}.ts`;\n await fs.writeFile(indexFilePath, await formatTs(`\n ${Object.values(ontology.queryTypes).map(query => `export * from \"${query.getImportPathRelTo(relOutDir)}\";`)\n .join(\"\\n\")}\n ${Object.keys(ontology.queryTypes).length === 0 ? \"export {};\" : \"\"}\n `));\n}\nasync function generateV2QueryFile(fs, outDir, relOutDir, query, importExt, ontology) {\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\n ? objectTypes.map(apiNameObj => `\"${apiNameObj}\"`).join(\"|\")\n : \"never\";\n await fs.writeFile(path.join(outDir, `${query.shortApiName}.ts`), await formatTs(`\n import type { QueryDefinition , VersionBound} from \"@osdk/api\";\n import type { QueryParam, QueryResult } from \"@osdk/api\";\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\n ? `query: ${query.paramsIdentifier}`\n : \"\"}): Promise<${getQueryParamType(ontology, paramToDef({ dataType: query.output }), \"Result\")}>\n }\n\n ${Object.keys(query.parameters).length > 0\n ? `\n export interface Parameters {\n ${stringify(query.parameters, {\n \"*\": (parameter, formatter, apiName) => {\n const q = paramToDef(parameter);\n return [\n `\n ${queryParamJsDoc(paramToDef(parameter), { apiName })}readonly \"${apiName}\"${q.nullable ? \"?\" : \"\"}`,\n `${getQueryParamType(ontology, q, \"Param\")}`,\n ];\n },\n })}\n }\n \n `\n : \"\"}\n\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) => [\n `${queryParamJsDoc(paramToDef(parameter), { apiName })} ${apiName}`,\n ` {\n ${stringify(deleteUndefineds(paramToDef(parameter)))},\n ${getLineFor__OsdkTargetType(ontology, parameter.dataType)}\n }`,\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, { apiName }) {\n let ret = `/**\\n`;\n if (param.description) {\n if (param.description) {\n ret += ` * description: ${param.description}\\n`;\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 \"struct\":\n case \"threeDimensionalAggregation\":\n case \"timestamp\":\n case \"twoDimensionalAggregation\":\n inner = `Query${type}.PrimitiveType<${JSON.stringify(input.type)}>`;\n break;\n case \"object\":\n inner = `Query${type}.ObjectType<${enhancedOntology.requireObjectType(input.object)\n .getImportedDefinitionIdentifier(true)}>`;\n break;\n case \"objectSet\":\n inner = `Query${type}.ObjectSetType<${enhancedOntology.requireObjectType(input.objectSet)\n .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 }\n else if (input.multiplicity) {\n return `Array<${inner}>`;\n }\n return inner;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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AAK,GAAG,QAAQP,IAAI,eAAeK,gBAAgB,CAACjC,iBAAiB,CAACkC,KAAK,CAACG,MAAM,CAAC,CAC9EP,+BAA+B,CAAC,IAAI,CAAC,GAAG;MAC7C;IACJ,KAAK,WAAW;MACZK,KAAK,GAAG,QAAQP,IAAI,kBAAkBK,gBAAgB,CAACjC,iBAAiB,CAACkC,KAAK,CAACI,SAAS,CAAC,CACpFR,+BAA+B,CAAC,IAAI,CAAC,GAAG;MAC7C;IACJ,KAAK,KAAK;MACNK,KAAK,GAAG,GAAGP,IAAI,KAAK,OAAO,GAAG,UAAU,GAAG,EAAE,OAAOlB,iBAAiB,CAACuB,gBAAgB,EAAEC,KAAK,CAACK,GAAG,EAAEX,IAAI,CAAC,GAAG;MAC3G;IACJ,KAAK,OAAO;MACRO,KAAK,GAAGD,KAAK,CAACM,KAAK,CAACrD,GAAG,CAAEsD,CAAC,IAAK/B,iBAAiB,CAACuB,gBAAgB,EAAEQ,CAAC,EAAEb,IAAI,CAAC,CAAC,CAACjD,IAAI,CAAC,KAAK,CAAC;MACxF;EACR;EACA,IAAIuD,KAAK,CAACQ,YAAY,IAAId,IAAI,KAAK,OAAO,EAAE;IACxC,OAAO,iBAAiBO,KAAK,GAAG;EACpC,CAAC,MACI,IAAID,KAAK,CAACQ,YAAY,EAAE;IACzB,OAAO,SAASP,KAAK,GAAG;EAC5B;EACA,OAAOA,KAAK;AAChB","ignoreList":[]}
1
+ {"version":3,"file":"generatePerQueryDataFiles.js","names":["wireQueryDataTypeToQueryDataTypeDefinition","wireQueryParameterV2ToQueryParameterDefinition","paramToDef","wireQueryTypeV2ToSdkQueryDefinitionNoParams","path","getObjectImports","getObjectTypeApiNamesFromQuery","deleteUndefineds","stringify","formatTs","getDescriptionIfPresent","generatePerQueryDataFilesV2","fs","outDir","rootOutDir","ontology","importExt","relOutDir","join","mkdir","recursive","Promise","all","Object","values","queryTypes","map","query","generateV2QueryFile","writeFile","shortApiName","getImportPathRelTo","keys","length","relFilePath","objectTypes","objectTypeObjects","Set","o","requireObjectType","importObjects","baseProps","raw","outputBase","output","apiNameObj","description","parameters","paramsIdentifier","getQueryParamType","dataType","*","parameter","formatter","apiName","q","queryParamJsDoc","nullable","parameterDefsForType","getLineFor__OsdkTargetType","undefined","displayName","rid","definitionIdentifier","parametersForConst","valueFormatter","qdt","type","objectTypeApiName","getImportedDefinitionIdentifier","param","ret","enhancedOntology","input","inner","JSON","object","objectSet","set","union","u","multiplicity"],"sources":["generatePerQueryDataFiles.js"],"sourcesContent":["/*\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 */\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({ fs, outDir: rootOutDir, ontology, importExt = \"\", }, v2) {\n const relOutDir = path.join(\".\", \"ontology\", \"queries\");\n const outDir = path.join(rootOutDir, \"ontology\", \"queries\");\n await fs.mkdir(outDir, { recursive: true });\n await Promise.all(Object.values(ontology.queryTypes).map(async (query) => {\n await generateV2QueryFile(fs, outDir, relOutDir, query, importExt, ontology);\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)}\";`)\n .join(\"\\n\")}\n ${Object.keys(ontology.queryTypes).length === 0 ? \"export {};\" : \"\"}\n `));\n}\nasync function generateV2QueryFile(fs, outDir, relOutDir, query, importExt, ontology) {\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\n ? objectTypes.map(apiNameObj => `\"${apiNameObj}\"`).join(\"|\")\n : \"never\";\n await fs.writeFile(path.join(outDir, `${query.shortApiName}.ts`), await formatTs(`\n import type { QueryDefinition , VersionBound} from \"@osdk/api\";\n import type { QueryParam, QueryResult } from \"@osdk/api\";\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\n ? `query: ${query.paramsIdentifier}`\n : \"\"}): Promise<${getQueryParamType(ontology, paramToDef({ dataType: query.output }), \"Result\")}>\n }\n\n ${Object.keys(query.parameters).length > 0\n ? `\n export interface Parameters {\n ${stringify(query.parameters, {\n \"*\": (parameter, formatter, apiName) => {\n const q = paramToDef(parameter);\n return [\n `\n ${queryParamJsDoc(paramToDef(parameter), { apiName })}readonly \"${apiName}\"${q.nullable ? \"?\" : \"\"}`,\n `${getQueryParamType(ontology, q, \"Param\")}`,\n ];\n },\n })}\n }\n \n `\n : \"\"}\n\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) => [\n `${queryParamJsDoc(paramToDef(parameter), { apiName })} ${apiName}`,\n ` {\n ${stringify(deleteUndefineds(paramToDef(parameter)))},\n ${getLineFor__OsdkTargetType(ontology, parameter.dataType)}\n }`,\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, { apiName }) {\n let ret = `/**\\n`;\n if (param.description) {\n if (param.description) {\n ret += ` * description: ${param.description}\\n`;\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 \"struct\":\n case \"threeDimensionalAggregation\":\n case \"timestamp\":\n case \"twoDimensionalAggregation\":\n inner = `Query${type}.PrimitiveType<${JSON.stringify(input.type)}>`;\n break;\n case \"object\":\n inner = `Query${type}.ObjectType<${enhancedOntology.requireObjectType(input.object)\n .getImportedDefinitionIdentifier(true)}>`;\n break;\n case \"objectSet\":\n inner = `Query${type}.ObjectSetType<${enhancedOntology.requireObjectType(input.objectSet)\n .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 }\n else if (input.multiplicity) {\n return `Array<${inner}>`;\n }\n return inner;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,0CAA0C,EAAEC,8CAA8C,IAAIC,UAAU,EAAEC,2CAA2C,QAAS,4BAA4B;AACnM,OAAOC,IAAI,MAAM,WAAW;AAC5B,SAASC,gBAAgB,QAAQ,+BAA+B;AAChE,SAASC,8BAA8B,QAAQ,6CAA6C;AAC5F,SAASC,gBAAgB,QAAQ,6BAA6B;AAC9D,SAASC,SAAS,QAAQ,sBAAsB;AAChD,SAASC,QAAQ,QAAQ,0BAA0B;AACnD,SAASC,uBAAuB,QAAQ,8BAA8B;AACtE,OAAO,eAAeC,2BAA2BA,CAAC;EAAEC,EAAE;EAAEC,MAAM,EAAEC,UAAU;EAAEC,QAAQ;EAAEC,SAAS,GAAG;A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AACK,GAAG,EAAEX,IAAI,CAAC,GAAG;MAC3G;IACJ,KAAK,OAAO;MACRO,KAAK,GAAGD,KAAK,CAACM,KAAK,CAACrD,GAAG,CAAEsD,CAAC,IAAK/B,iBAAiB,CAACuB,gBAAgB,EAAEQ,CAAC,EAAEb,IAAI,CAAC,CAAC,CAACjD,IAAI,CAAC,KAAK,CAAC;MACxF;EACR;EACA,IAAIuD,KAAK,CAACQ,YAAY,IAAId,IAAI,KAAK,OAAO,EAAE;IACxC,OAAO,iBAAiBO,KAAK,GAAG;EACpC,CAAC,MACI,IAAID,KAAK,CAACQ,YAAY,EAAE;IACzB,OAAO,SAASP,KAAK,GAAG;EAC5B;EACA,OAAOA,KAAK;AAChB","ignoreList":[]}
@@ -24,14 +24,20 @@ describe("generatePerQueryDataFiles", () => {
24
24
  const helper = createMockMinimalFiles();
25
25
  await generatePerQueryDataFilesV2({
26
26
  fs: helper.minimalFiles,
27
- ontology: enhanceOntology(TodoWireOntology, undefined, new Map(), ".js"),
27
+ ontology: enhanceOntology({
28
+ sanitized: TodoWireOntology,
29
+ importExt: ".js",
30
+ externalObjects: new Map(),
31
+ externalInterfaces: new Map(),
32
+ externalSpts: new Map()
33
+ }),
28
34
  outDir: "/foo",
29
35
  importExt: ".js"
30
36
  }, true);
31
37
  expect(helper.getFiles()).toMatchInlineSnapshot(`
32
38
  {
33
- "/foo/ontology/queries.ts": "export * from './queries/getCount.js';
34
- export * from './queries/returnsTodo.js';
39
+ "/foo/ontology/queries.ts": "export { getCount } from './queries/getCount.js';
40
+ export { returnsTodo } from './queries/returnsTodo.js';
35
41
  ",
36
42
  "/foo/ontology/queries/getCount.ts": "import type { QueryDefinition, VersionBound } from '@osdk/api';
37
43
  import type { QueryParam, QueryResult } from '@osdk/api';
@@ -1 +1 @@
1
- {"version":3,"file":"generatePerQueryDataFiles.test.js","names":["ts","describe","expect","it","enhanceOntology","createMockMinimalFiles","TodoWireOntology","generatePerQueryDataFilesV2","helper","fs","minimalFiles","ontology","undefined","Map","outDir","importExt","getFiles","toMatchInlineSnapshot","writeFile","rootFileNames","Object","keys","console","log","files","forEach","fileName","version","servicesHost","getScriptFileNames","getScriptVersion","toString","getScriptSnapshot","ScriptSnapshot","fromString","getCurrentDirectory","getCompilationSettings","getDefaultLibFileName","options","getDefaultLibFilePath","fileExists","path","readFile","readDirectory","extensions","exclude","include","depth","sys","directoryExists","getDirectories","langServices","createLanguageService","q","getDocCommentTemplateAtPosition","createDocumentRegistry"],"sources":["generatePerQueryDataFiles.test.js"],"sourcesContent":["/*\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 */\nimport * as ts from \"typescript\";\nimport { describe, expect, it } from \"vitest\";\nimport { enhanceOntology } from \"../GenerateContext/enhanceOntology.js\";\nimport { createMockMinimalFiles } from \"../util/test/createMockMinimalFiles.js\";\nimport { TodoWireOntology } from \"../util/test/TodoWireOntology.js\";\nimport { generatePerQueryDataFilesV2 } from \"./generatePerQueryDataFiles.js\";\ndescribe(\"generatePerQueryDataFiles\", () => {\n it(\"is stable v2\", async () => {\n const helper = createMockMinimalFiles();\n const BASE_PATH = \"/foo\";\n await generatePerQueryDataFilesV2({\n fs: helper.minimalFiles,\n ontology: enhanceOntology(TodoWireOntology, undefined, new Map(), \".js\"),\n outDir: BASE_PATH,\n importExt: \".js\",\n }, true);\n expect(helper.getFiles()).toMatchInlineSnapshot(`\n {\n \"/foo/ontology/queries.ts\": \"export * from './queries/getCount.js';\n export * from './queries/returnsTodo.js';\n \",\n \"/foo/ontology/queries/getCount.ts\": \"import type { QueryDefinition, VersionBound } from '@osdk/api';\n import type { QueryParam, QueryResult } from '@osdk/api';\n import type { $ExpectedClientVersion } from '../../OntologyMetadata.js';\n import { $osdkMetadata } from '../../OntologyMetadata.js';\n\n export namespace getCount {\n export interface Signature {\n (query: getCount.Parameters): Promise<QueryResult.PrimitiveType<'integer'>>;\n }\n\n export interface Parameters {\n /**\n * (no ontology metadata)\n */\n readonly completed: QueryParam.PrimitiveType<'boolean'>;\n }\n }\n\n export interface getCount extends QueryDefinition<getCount.Signature>, VersionBound<$ExpectedClientVersion> {\n __DefinitionMetadata?: {\n apiName: 'getCount';\n rid: 'rid.query.1';\n type: 'query';\n version: '0';\n parameters: {\n /**\n * (no ontology metadata)\n */\n completed: {\n nullable: false;\n type: 'boolean';\n };\n };\n output: {\n nullable: false;\n type: 'integer';\n };\n signature: getCount.Signature;\n };\n apiName: 'getCount';\n type: 'query';\n version: '0';\n osdkMetadata: typeof $osdkMetadata;\n }\n\n export const getCount: getCount = {\n apiName: 'getCount',\n type: 'query',\n version: '0',\n osdkMetadata: $osdkMetadata,\n };\n \",\n \"/foo/ontology/queries/returnsTodo.ts\": \"import type { QueryDefinition, VersionBound } from '@osdk/api';\n import type { QueryParam, QueryResult } from '@osdk/api';\n import type { $ExpectedClientVersion } from '../../OntologyMetadata.js';\n import { $osdkMetadata } from '../../OntologyMetadata.js';\n import type { Todo } from '../objects/Todo.js';\n\n export namespace returnsTodo {\n export interface Signature {\n (query: returnsTodo.Parameters): Promise<QueryResult.ObjectType<Todo>>;\n }\n\n export interface Parameters {\n /**\n * description: Random desc so we test jsdoc\n */\n readonly someTodo: QueryParam.ObjectType<Todo>;\n }\n }\n\n export interface returnsTodo extends QueryDefinition<returnsTodo.Signature>, VersionBound<$ExpectedClientVersion> {\n __DefinitionMetadata?: {\n apiName: 'returnsTodo';\n rid: 'rid.query.2';\n type: 'query';\n version: '0';\n parameters: {\n /**\n * description: Random desc so we test jsdoc\n */\n someTodo: {\n description: 'Random desc so we test jsdoc';\n nullable: false;\n object: 'Todo';\n type: 'object';\n __OsdkTargetType?: Todo;\n };\n };\n output: {\n nullable: false;\n object: 'Todo';\n type: 'object';\n __OsdkTargetType?: Todo;\n };\n signature: returnsTodo.Signature;\n };\n apiName: 'returnsTodo';\n type: 'query';\n version: '0';\n osdkMetadata: typeof $osdkMetadata;\n }\n\n export const returnsTodo: returnsTodo = {\n apiName: 'returnsTodo',\n type: 'query',\n version: '0',\n osdkMetadata: $osdkMetadata,\n };\n \",\n }\n `);\n await helper.minimalFiles.writeFile(\"/bar/test.ts\", `\n import {returnsTodo} from \"/foo/ontology/queries/returnsTodo.ts\";\n\n returnsTodo({someTodo:/*marker*/})\n `);\n const rootFileNames = Object.keys(helper.getFiles());\n console.log(rootFileNames);\n const files = {};\n // initialize the list of files\n rootFileNames.forEach(fileName => {\n files[fileName] = { version: 0 };\n });\n const servicesHost = {\n getScriptFileNames: () => Object.keys(helper.getFiles()),\n getScriptVersion: fileName => files[fileName] && files[fileName].version.toString(),\n getScriptSnapshot: fileName => {\n if (!helper.getFiles()[fileName]) {\n return undefined;\n }\n return ts.ScriptSnapshot.fromString(helper.getFiles()[fileName]);\n },\n getCurrentDirectory: () => \"/bar\",\n getCompilationSettings: () => ({}),\n getDefaultLibFileName: options => ts.getDefaultLibFilePath(options),\n fileExists: (path) => {\n console.log(path);\n return helper.getFiles()[path] !== undefined;\n },\n readFile: (path) => {\n console.log(\"readFile: \", path);\n return helper.getFiles()[path];\n },\n readDirectory: (path, extensions, exclude, include, depth) => {\n console.log(\"readDirectory\", path);\n return ts.sys.readDirectory(path, extensions, exclude, include, depth);\n },\n directoryExists: ts.sys.directoryExists,\n getDirectories: ts.sys.getDirectories,\n };\n const langServices = ts.createLanguageService(servicesHost);\n const q = langServices.getDocCommentTemplateAtPosition(\"/bar/test.ts\", 1);\n console.log(q);\n ts.createDocumentRegistry();\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,KAAKA,EAAE,MAAM,YAAY;AAChC,SAASC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAC7C,SAASC,eAAe,QAAQ,uCAAuC;AACvE,SAASC,sBAAsB,QAAQ,wCAAwC;AAC/E,SAASC,gBAAgB,QAAQ,kCAAkC;AACnE,SAASC,2BAA2B,QAAQ,gCAAgC;AAC5EN,QAAQ,CAAC,2BAA2B,EAAE,MAAM;EACxCE,EAAE,CAAC,cAAc,EAAE,YAAY;IAC3B,MAAMK,MAAM,GAAGH,sBAAsB,CAAC,CAAC;IAEvC,MAAME,2BAA2B,CAAC;MAC9BE,EAAE,EAAED,MAAM,CAACE,YAAY;MACvBC,QAAQ,EAAEP,eAAe,CAACE,gBAAgB,EAAEM,SAAS,EAAE,IAAIC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC;MACxEC,MAAM,EAJQ,MAIG;MACjBC,SAAS,EAAE;IACf,CAAC,EAAE,IAAI,CAAC;IACRb,MAAM,CAACM,MAAM,CAACQ,QAAQ,CAAC,CAAC,CAAC,CAACC,qBAAqB,CAAC;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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,CAAC,CAAC,CAACyB,IAAI,CAAC,KAAK7B,SAAS;MAChD,CAAC;MACD8B,QAAQ,EAAGD,IAAI,IAAK;QAChBnB,OAAO,CAACC,GAAG,CAAC,YAAY,EAAEkB,IAAI,CAAC;QAC/B,OAAOjC,MAAM,CAACQ,QAAQ,CAAC,CAAC,CAACyB,IAAI,CAAC;MAClC,CAAC;MACDE,aAAa,EAAEA,CAACF,IAAI,EAAEG,UAAU,EAAEC,OAAO,EAAEC,OAAO,EAAEC,KAAK,KAAK;QAC1DzB,OAAO,CAACC,GAAG,CAAC,eAAe,EAAEkB,IAAI,CAAC;QAClC,OAAOzC,EAAE,CAACgD,GAAG,CAACL,aAAa,CAACF,IAAI,EAAEG,UAAU,EAAEC,OAAO,EAAEC,OAAO,EAAEC,KAAK,CAAC;MAC1E,CAAC;MACDE,eAAe,EAAEjD,EAAE,CAACgD,GAAG,CAACC,eAAe;MACvCC,cAAc,EAAElD,EAAE,CAACgD,GAAG,CAACE;IAC3B,CAAC;IACD,MAAMC,YAAY,GAAGnD,EAAE,CAACoD,qBAAqB,CAACxB,YAAY,CAAC;IAC3D,MAAMyB,CAAC,GAAGF,YAAY,CAACG,+BAA+B,CAAC,cAAc,EAAE,CAAC,CAAC;IACzEhC,OAAO,CAACC,GAAG,CAAC8B,CAAC,CAAC;IACdrD,EAAE,CAACuD,sBAAsB,CAAC,CAAC;EAC/B,CAAC,CAAC;AACN,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"generatePerQueryDataFiles.test.js","names":["ts","describe","expect","it","enhanceOntology","createMockMinimalFiles","TodoWireOntology","generatePerQueryDataFilesV2","helper","fs","minimalFiles","ontology","sanitized","importExt","externalObjects","Map","externalInterfaces","externalSpts","outDir","getFiles","toMatchInlineSnapshot","writeFile","rootFileNames","Object","keys","console","log","files","forEach","fileName","version","servicesHost","getScriptFileNames","getScriptVersion","toString","getScriptSnapshot","undefined","ScriptSnapshot","fromString","getCurrentDirectory","getCompilationSettings","getDefaultLibFileName","options","getDefaultLibFilePath","fileExists","path","readFile","readDirectory","extensions","exclude","include","depth","sys","directoryExists","getDirectories","langServices","createLanguageService","q","getDocCommentTemplateAtPosition","createDocumentRegistry"],"sources":["generatePerQueryDataFiles.test.js"],"sourcesContent":["/*\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 */\nimport * as ts from \"typescript\";\nimport { describe, expect, it } from \"vitest\";\nimport { enhanceOntology } from \"../GenerateContext/enhanceOntology.js\";\nimport { createMockMinimalFiles } from \"../util/test/createMockMinimalFiles.js\";\nimport { TodoWireOntology } from \"../util/test/TodoWireOntology.js\";\nimport { generatePerQueryDataFilesV2 } from \"./generatePerQueryDataFiles.js\";\ndescribe(\"generatePerQueryDataFiles\", () => {\n it(\"is stable v2\", async () => {\n const helper = createMockMinimalFiles();\n const BASE_PATH = \"/foo\";\n await generatePerQueryDataFilesV2({\n fs: helper.minimalFiles,\n ontology: enhanceOntology({\n sanitized: TodoWireOntology,\n importExt: \".js\",\n externalObjects: new Map(),\n externalInterfaces: new Map(),\n externalSpts: new Map(),\n }),\n outDir: BASE_PATH,\n importExt: \".js\",\n }, true);\n expect(helper.getFiles()).toMatchInlineSnapshot(`\n {\n \"/foo/ontology/queries.ts\": \"export { getCount } from './queries/getCount.js';\n export { returnsTodo } from './queries/returnsTodo.js';\n \",\n \"/foo/ontology/queries/getCount.ts\": \"import type { QueryDefinition, VersionBound } from '@osdk/api';\n import type { QueryParam, QueryResult } from '@osdk/api';\n import type { $ExpectedClientVersion } from '../../OntologyMetadata.js';\n import { $osdkMetadata } from '../../OntologyMetadata.js';\n\n export namespace getCount {\n export interface Signature {\n (query: getCount.Parameters): Promise<QueryResult.PrimitiveType<'integer'>>;\n }\n\n export interface Parameters {\n /**\n * (no ontology metadata)\n */\n readonly completed: QueryParam.PrimitiveType<'boolean'>;\n }\n }\n\n export interface getCount extends QueryDefinition<getCount.Signature>, VersionBound<$ExpectedClientVersion> {\n __DefinitionMetadata?: {\n apiName: 'getCount';\n rid: 'rid.query.1';\n type: 'query';\n version: '0';\n parameters: {\n /**\n * (no ontology metadata)\n */\n completed: {\n nullable: false;\n type: 'boolean';\n };\n };\n output: {\n nullable: false;\n type: 'integer';\n };\n signature: getCount.Signature;\n };\n apiName: 'getCount';\n type: 'query';\n version: '0';\n osdkMetadata: typeof $osdkMetadata;\n }\n\n export const getCount: getCount = {\n apiName: 'getCount',\n type: 'query',\n version: '0',\n osdkMetadata: $osdkMetadata,\n };\n \",\n \"/foo/ontology/queries/returnsTodo.ts\": \"import type { QueryDefinition, VersionBound } from '@osdk/api';\n import type { QueryParam, QueryResult } from '@osdk/api';\n import type { $ExpectedClientVersion } from '../../OntologyMetadata.js';\n import { $osdkMetadata } from '../../OntologyMetadata.js';\n import type { Todo } from '../objects/Todo.js';\n\n export namespace returnsTodo {\n export interface Signature {\n (query: returnsTodo.Parameters): Promise<QueryResult.ObjectType<Todo>>;\n }\n\n export interface Parameters {\n /**\n * description: Random desc so we test jsdoc\n */\n readonly someTodo: QueryParam.ObjectType<Todo>;\n }\n }\n\n export interface returnsTodo extends QueryDefinition<returnsTodo.Signature>, VersionBound<$ExpectedClientVersion> {\n __DefinitionMetadata?: {\n apiName: 'returnsTodo';\n rid: 'rid.query.2';\n type: 'query';\n version: '0';\n parameters: {\n /**\n * description: Random desc so we test jsdoc\n */\n someTodo: {\n description: 'Random desc so we test jsdoc';\n nullable: false;\n object: 'Todo';\n type: 'object';\n __OsdkTargetType?: Todo;\n };\n };\n output: {\n nullable: false;\n object: 'Todo';\n type: 'object';\n __OsdkTargetType?: Todo;\n };\n signature: returnsTodo.Signature;\n };\n apiName: 'returnsTodo';\n type: 'query';\n version: '0';\n osdkMetadata: typeof $osdkMetadata;\n }\n\n export const returnsTodo: returnsTodo = {\n apiName: 'returnsTodo',\n type: 'query',\n version: '0',\n osdkMetadata: $osdkMetadata,\n };\n \",\n }\n `);\n await helper.minimalFiles.writeFile(\"/bar/test.ts\", `\n import {returnsTodo} from \"/foo/ontology/queries/returnsTodo.ts\";\n\n returnsTodo({someTodo:/*marker*/})\n `);\n const rootFileNames = Object.keys(helper.getFiles());\n console.log(rootFileNames);\n const files = {};\n // initialize the list of files\n rootFileNames.forEach(fileName => {\n files[fileName] = { version: 0 };\n });\n const servicesHost = {\n getScriptFileNames: () => Object.keys(helper.getFiles()),\n getScriptVersion: fileName => files[fileName] && files[fileName].version.toString(),\n getScriptSnapshot: fileName => {\n if (!helper.getFiles()[fileName]) {\n return undefined;\n }\n return ts.ScriptSnapshot.fromString(helper.getFiles()[fileName]);\n },\n getCurrentDirectory: () => \"/bar\",\n getCompilationSettings: () => ({}),\n getDefaultLibFileName: options => ts.getDefaultLibFilePath(options),\n fileExists: (path) => {\n console.log(path);\n return helper.getFiles()[path] !== undefined;\n },\n readFile: (path) => {\n console.log(\"readFile: \", path);\n return helper.getFiles()[path];\n },\n readDirectory: (path, extensions, exclude, include, depth) => {\n console.log(\"readDirectory\", path);\n return ts.sys.readDirectory(path, extensions, exclude, include, depth);\n },\n directoryExists: ts.sys.directoryExists,\n getDirectories: ts.sys.getDirectories,\n };\n const langServices = ts.createLanguageService(servicesHost);\n const q = langServices.getDocCommentTemplateAtPosition(\"/bar/test.ts\", 1);\n console.log(q);\n ts.createDocumentRegistry();\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,KAAKA,EAAE,MAAM,YAAY;AAChC,SAASC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAC7C,SAASC,eAAe,QAAQ,uCAAuC;AACvE,SAASC,sBAAsB,QAAQ,wCAAwC;AAC/E,SAASC,gBAAgB,QAAQ,kCAAkC;AACnE,SAASC,2BAA2B,QAAQ,gCAAgC;AAC5EN,QAAQ,CAAC,2BAA2B,EAAE,MAAM;EACxCE,EAAE,CAAC,cAAc,EAAE,YAAY;IAC3B,MAAMK,MAAM,GAAGH,sBAAsB,CAAC,CAAC;IAEvC,MAAME,2BAA2B,CAAC;MAC9BE,EAAE,EAAED,MAAM,CAACE,YAAY;MACvBC,QAAQ,EAAEP,eAAe,CAAC;QACtBQ,SAAS,EAAEN,gBAAgB;QAC3BO,SAAS,EAAE,KAAK;QAChBC,eAAe,EAAE,IAAIC,GAAG,CAAC,CAAC;QAC1BC,kBAAkB,EAAE,IAAID,GAAG,CAAC,CAAC;QAC7BE,YAAY,EAAE,IAAIF,GAAG,CAAC;MAC1B,CAAC,CAAC;MACFG,MAAM,EAVQ,MAUG;MACjBL,SAAS,EAAE;IACf,CAAC,EAAE,IAAI,CAAC;IACRX,MAAM,CAACM,MAAM,CAACW,QAAQ,CAAC,CAAC,CAAC,CAACC,qBAAqB,CAAC;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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QACjB,OAAOrC,MAAM,CAACW,QAAQ,CAAC,CAAC,CAAC0B,IAAI,CAAC,KAAKT,SAAS;MAChD,CAAC;MACDU,QAAQ,EAAGD,IAAI,IAAK;QAChBpB,OAAO,CAACC,GAAG,CAAC,YAAY,EAAEmB,IAAI,CAAC;QAC/B,OAAOrC,MAAM,CAACW,QAAQ,CAAC,CAAC,CAAC0B,IAAI,CAAC;MAClC,CAAC;MACDE,aAAa,EAAEA,CAACF,IAAI,EAAEG,UAAU,EAAEC,OAAO,EAAEC,OAAO,EAAEC,KAAK,KAAK;QAC1D1B,OAAO,CAACC,GAAG,CAAC,eAAe,EAAEmB,IAAI,CAAC;QAClC,OAAO7C,EAAE,CAACoD,GAAG,CAACL,aAAa,CAACF,IAAI,EAAEG,UAAU,EAAEC,OAAO,EAAEC,OAAO,EAAEC,KAAK,CAAC;MAC1E,CAAC;MACDE,eAAe,EAAErD,EAAE,CAACoD,GAAG,CAACC,eAAe;MACvCC,cAAc,EAAEtD,EAAE,CAACoD,GAAG,CAACE;IAC3B,CAAC;IACD,MAAMC,YAAY,GAAGvD,EAAE,CAACwD,qBAAqB,CAACzB,YAAY,CAAC;IAC3D,MAAM0B,CAAC,GAAGF,YAAY,CAACG,+BAA+B,CAAC,cAAc,EAAE,CAAC,CAAC;IACzEjC,OAAO,CAACC,GAAG,CAAC+B,CAAC,CAAC;IACdzD,EAAE,CAAC2D,sBAAsB,CAAC,CAAC;EAC/B,CAAC,CAAC;AACN,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ import type { GenerateContext } from "../GenerateContext/GenerateContext.js";
2
+ export declare function generateRootIndexTsFile({ fs, outDir, importExt, ontologyApiNamespace, ontology }: GenerateContext): Promise<void>;
3
+ //# sourceMappingURL=generateRootIndexTsFile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateRootIndexTsFile.d.ts","sourceRoot":"","sources":["../../../src/v2.0/generateRootIndexTsFile.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAG7E,wBAAsB,uBAAuB,CAC3C,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,oBAAoB,EAAE,QAAQ,EAAE,EAAE,eAAe,iBA6B3E"}
@@ -0,0 +1,40 @@
1
+ /*
2
+ * Copyright 2023 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import path from "node:path";
17
+ import { ForeignType } from "../GenerateContext/ForeignType.js";
18
+ import { formatTs } from "../util/test/formatTs.js";
19
+ export async function generateRootIndexTsFile({
20
+ fs,
21
+ outDir,
22
+ importExt,
23
+ ontologyApiNamespace,
24
+ ontology
25
+ }) {
26
+ fs.writeFile(path.join(outDir, "index.ts"), await formatTs(`export {${helper(ontology.actionTypes)}} from "./ontology/actions${importExt}";
27
+ export * as $Actions from "./ontology/actions${importExt}";
28
+ export {${helper(ontology.interfaceTypes)}} from "./ontology/interfaces${importExt}";
29
+ export * as $Interfaces from "./ontology/interfaces${importExt}";
30
+ export {${helper(ontology.objectTypes)}} from "./ontology/objects${importExt}";
31
+ export * as $Objects from "./ontology/objects${importExt}";
32
+ export {${helper(ontology.queryTypes)}} from "./ontology/queries${importExt}";
33
+ export * as $Queries from "./ontology/queries${importExt}";
34
+ ${ontologyApiNamespace == null ? `export { $ontologyRid } from "./OntologyMetadata${importExt}";` : ``}
35
+ `));
36
+ }
37
+ function helper(x) {
38
+ return Object.values(x).filter(x => !(x instanceof ForeignType)).map(a => a.shortApiName).join(", ");
39
+ }
40
+ //# sourceMappingURL=generateRootIndexTsFile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateRootIndexTsFile.js","names":["path","ForeignType","formatTs","generateRootIndexTsFile","fs","outDir","importExt","ontologyApiNamespace","ontology","writeFile","join","helper","actionTypes","interfaceTypes","objectTypes","queryTypes","x","Object","values","filter","map","a","shortApiName"],"sources":["generateRootIndexTsFile.js"],"sourcesContent":["/*\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 */\nimport path from \"node:path\";\nimport { ForeignType } from \"../GenerateContext/ForeignType.js\";\nimport { formatTs } from \"../util/test/formatTs.js\";\nexport async function generateRootIndexTsFile({ fs, outDir, importExt, ontologyApiNamespace, ontology }) {\n 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 ${ontologyApiNamespace == null\n ? `export { $ontologyRid } from \"./OntologyMetadata${importExt}\";`\n : ``}\n `));\n}\nfunction helper(x) {\n return Object.values(x).filter(x => !(x instanceof ForeignType)).map(a => a.shortApiName).join(\", \");\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,WAAW;AAC5B,SAASC,WAAW,QAAQ,mCAAmC;AAC/D,SAASC,QAAQ,QAAQ,0BAA0B;AACnD,OAAO,eAAeC,uBAAuBA,CAAC;EAAEC,EAAE;EAAEC,MAAM;EAAEC,SAAS;EAAEC,oBAAoB;EAAEC;AAAS,CAAC,EAAE;EACrGJ,EAAE,CAACK,SAAS,CAACT,IAAI,CAACU,IAAI,CAACL,MAAM,EAAE,UAAU,CAAC,EAAE,MAAMH,QAAQ,CAAC,WAAWS,MAAM,CAACH,QAAQ,CAACI,WAAW,CAAC,6BAA6BN,SAAS;AAC5I,uDAAuDA,SAAS;AAChE,kBAAkBK,MAAM,CAACH,QAAQ,CAACK,cAAc,CAAC,gCAAgCP,SAAS;AAC1F,6DAA6DA,SAAS;AACtE,kBAAkBK,MAAM,CAACH,QAAQ,CAACM,WAAW,CAAC,6BAA6BR,SAAS;AACpF,uDAAuDA,SAAS;AAChE,kBAAkBK,MAAM,CAACH,QAAQ,CAACO,UAAU,CAAC,6BAA6BT,SAAS;AACnF,uDAAuDA,SAAS;AAChE,UAAUC,oBAAoB,IAAI,IAAI,GAC5B,mDAAmDD,SAAS,IAAI,GAChE,EAAE;AACZ,KAAK,CAAC,CAAC;AACP;AACA,SAASK,MAAMA,CAACK,CAAC,EAAE;EACf,OAAOC,MAAM,CAACC,MAAM,CAACF,CAAC,CAAC,CAACG,MAAM,CAACH,CAAC,IAAI,EAAEA,CAAC,YAAYf,WAAW,CAAC,CAAC,CAACmB,GAAG,CAACC,CAAC,IAAIA,CAAC,CAACC,YAAY,CAAC,CAACZ,IAAI,CAAC,IAAI,CAAC;AACxG","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"wireObjectTypeV2ToSdkObjectConstV2.d.ts","sourceRoot":"","sources":["../../../src/v2.0/wireObjectTypeV2ToSdkObjectConstV2.ts"],"names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,CAChC,IAAI,EAAE,kBAAkB,GAAG,qBAAqB,UAOjD"}
1
+ {"version":3,"file":"wireObjectTypeV2ToSdkObjectConstV2.d.ts","sourceRoot":"","sources":["../../../src/v2.0/wireObjectTypeV2ToSdkObjectConstV2.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AACzF,OAAO,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AAC9E,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,kDAAkD,CAAC;AAQnG,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,UAE/D;AAwGD,MAAM,WAAW,WAAY,SAC3B,MAAM,CACF,sBAAsB,GACtB,wBAAwB,GACxB,2BAA2B,GAC3B,qBAAqB,GACrB,2BAA2B,GAC3B,iCAAiC,GACjC,qBAAqB,EACvB,MAAM,CACP;CACD;AAEF,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,kBAAkB,GAAG,qBAAqB,EAClD,UAAU,EAAE,MAAM,EAClB,EACE,yBAAyB,EACzB,mBAAmB,EACnB,+BAA+B,EAC/B,yBAAyB,GAC1B,EAAE,WAAW,UAsBf;AAED,wBAAgB,eAAe,CAC7B,MAAM,EAAE,kBAAkB,GAAG,qBAAqB,EAClD,EACE,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,EACtB,oBAAoB,GACrB,EAAE,WAAW,UAYf;AAeD,wBAAgB,WAAW,CACzB,IAAI,EAAE,qBAAqB,GAAG,kBAAkB,EAChD,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,OAAO,UAoBhB;AAED,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,kBAAkB,GAAG,qBAAqB,EAClD,QAAQ,EAAE,0BAA0B,EACpC,UAAU,EAAE,MAAM,EAClB,EACE,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,EACzB,+BAA+B,EAC/B,yBAAyB,GAC1B,EAAE,WAAW,UAmDf;AAED,wBAAgB,WAAW,CACzB,QAAQ,EAAE,0BAA0B,EACpC,MAAM,EAAE,kBAAkB,GAAG,qBAAqB,EAClD,UAAU,EAAE,MAAM,UAiCnB;AAED,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,kBAAkB,GAAG,qBAAqB,UAOjD"}
@@ -15,6 +15,7 @@
15
15
  */
16
16
  import { wireObjectTypeFullMetadataToSdkObjectMetadata } from "@osdk/generator-converters";
17
17
  import { EnhancedObjectType } from "../GenerateContext/EnhancedObjectType.js";
18
+ import { ForeignType } from "../GenerateContext/ForeignType.js";
18
19
  import { getObjectImports } from "../shared/getObjectImports.js";
19
20
  import { propertyJsdoc } from "../shared/propertyJsdoc.js";
20
21
  import { deleteUndefineds } from "../util/deleteUndefineds.js";
@@ -27,6 +28,9 @@ export function wireObjectTypeV2ToSdkObjectConstV2(wireObject, {
27
28
  ontology
28
29
  }, currentFilePath) {
29
30
  const object = ontology.requireObjectType(wireObject.objectType.apiName, true);
31
+ if (object instanceof ForeignType) {
32
+ throw new Error("Should not be generating types for an external type");
33
+ }
30
34
  const uniqueLinkTargetTypes = new Set(wireObject.linkTypes.map(a => ontology.requireObjectType(a.objectTypeApiName, false)));
31
35
  const definition = deleteUndefineds(wireObjectTypeFullMetadataToSdkObjectMetadata(object.raw, true));
32
36
  const objectDefIdentifier = object.getDefinitionIdentifier(true);
@@ -47,7 +51,7 @@ export function wireObjectTypeV2ToSdkObjectConstV2(wireObject, {
47
51
  propertyKeysIdentifier
48
52
  };
49
53
  const imports = getObjectImports(uniqueLinkTargetTypes, definition.apiName, currentFilePath, true);
50
- return `${imports}${function () {
54
+ return `${imports}${function (object) {
51
55
  return `import type {
52
56
  PropertyKeys as $PropertyKeys,
53
57
  ObjectTypeDefinition as $ObjectTypeDefinition,
@@ -74,14 +78,14 @@ export function wireObjectTypeV2ToSdkObjectConstV2(wireObject, {
74
78
 
75
79
  ${createObjectSet(object, identifiers)}
76
80
 
77
- ${createOsdkObject(object, "OsdkObject", identifiers)}
81
+ ${createOsdkObject(object, "OsdkInstance", identifiers)}
78
82
  }
79
83
 
80
84
 
81
85
 
82
86
  ${createDefinition(object, ontology, object.shortApiName, identifiers)}
83
87
  `;
84
- }()}
88
+ }(object)}
85
89
 
86
90
  export const ${object.shortApiName}: ${objectDefIdentifier}
87
91
  = {
@@ -98,16 +102,22 @@ export function createOsdkObject(object, identifier, {
98
102
  }) {
99
103
  object.getCleanedUpDefinition(true);
100
104
  return `
101
- export type ${identifier}<
105
+ export type ${identifier}<
102
106
  OPTIONS extends never | "$notStrict" | "$rid" = never,
103
107
  K extends keyof ${osdkObjectPropsIdentifier}= keyof ${osdkObjectPropsIdentifier},
104
-
105
- >
106
- = $Osdk<
108
+ >
109
+ = $Osdk.Instance<
107
110
  ${objectDefIdentifier},
108
- K | OPTIONS
109
- >
111
+ OPTIONS,
112
+ K
113
+ >;
110
114
 
115
+
116
+ /** @deprecated use ${identifier} */
117
+ export type OsdkObject<
118
+ OPTIONS extends never | "$notStrict" | "$rid" = never,
119
+ K extends keyof ${osdkObjectPropsIdentifier}= keyof ${osdkObjectPropsIdentifier},
120
+ > = ${identifier}<OPTIONS, K>;
111
121
  ;
112
122
  `;
113
123
  }
@@ -1 +1 @@
1
- {"version":3,"file":"wireObjectTypeV2ToSdkObjectConstV2.js","names":["wireObjectTypeFullMetadataToSdkObjectMetadata","EnhancedObjectType","getObjectImports","propertyJsdoc","deleteUndefineds","stringify","getObjectDefIdentifier","name","v2","wireObjectTypeV2ToSdkObjectConstV2","wireObject","ontology","currentFilePath","object","requireObjectType","objectType","apiName","uniqueLinkTargetTypes","Set","linkTypes","map","a","objectTypeApiName","definition","raw","objectDefIdentifier","getDefinitionIdentifier","objectSetIdentifier","shortApiName","propertyKeysIdentifier","osdkObjectPropsIdentifier","osdkObjectStrictPropsIdentifier","osdkObjectLinksIdentifier","osdkObjectIdentifier","identifiers","imports","createPropertyKeys","createLinks","createProps","createObjectSet","createOsdkObject","createDefinition","fullApiName","identifier","getCleanedUpDefinition","maybeStripNamespace","type","q","apiNamespace","startsWith","slice","length","strict","properties","*","propertyDefinition","_","JSON","multiplicity","nullable","links","targetType","getImportedDefinitionIdentifier","Object","keys","key","linkTarget","join"],"sources":["wireObjectTypeV2ToSdkObjectConstV2.js"],"sourcesContent":["/*\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 */\nimport { wireObjectTypeFullMetadataToSdkObjectMetadata } from \"@osdk/generator-converters\";\nimport { EnhancedObjectType } from \"../GenerateContext/EnhancedObjectType.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\";\nexport function getObjectDefIdentifier(name, v2) {\n return v2 ? name : `${name}Def`;\n}\n/** @internal */\nexport function wireObjectTypeV2ToSdkObjectConstV2(wireObject, { ontology }, currentFilePath) {\n const object = ontology.requireObjectType(wireObject.objectType.apiName, true);\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() {\n return `import type {\n PropertyKeys as $PropertyKeys, \n ObjectTypeDefinition as $ObjectTypeDefinition,\n ObjectMetadata as $ObjectMetadata,\n } from \"@osdk/api\";\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 \"@osdk/api\";\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, \"OsdkObject\", 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()}\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, { osdkObjectPropsIdentifier, objectDefIdentifier, osdkObjectStrictPropsIdentifier, osdkObjectLinksIdentifier, }) {\n const definition = object.getCleanedUpDefinition(true);\n return `\n export type ${identifier}<\n OPTIONS extends never | \"$notStrict\" | \"$rid\" = never,\n K extends keyof ${osdkObjectPropsIdentifier}= keyof ${osdkObjectPropsIdentifier},\n\n > \n = $Osdk<\n ${objectDefIdentifier}, \n K | OPTIONS\n > \n \n ;\n `;\n}\nexport function createObjectSet(object, { objectDefIdentifier, objectSetIdentifier, propertyKeysIdentifier, osdkObjectIdentifier, }) {\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 }\n else {\n return q;\n }\n}\nexport function createProps(type, identifier, strict) {\n const definition = type.getCleanedUpDefinition(true);\n return `export interface ${identifier} {\n${stringify(definition.properties, {\n \"*\": (propertyDefinition, _, apiName) => {\n return [\n `readonly \"${maybeStripNamespace(type, apiName)}\"${\n // after we convert everything over we can do this:\n // !strict || propertyDefinition.nullable ? \"?\" : \"\"\n \"\"}`,\n `$PropType[${JSON.stringify(propertyDefinition.type)}]${propertyDefinition.multiplicity ? \"[]\" : \"\"}${propertyDefinition.nullable || !strict ? `| undefined` : \"\"}`,\n ];\n },\n })}\n }`;\n}\nexport function createDefinition(object, ontology, identifier, { objectDefIdentifier, objectSetIdentifier, osdkObjectPropsIdentifier, osdkObjectStrictPropsIdentifier, osdkObjectLinksIdentifier, }) {\n const definition = object.getCleanedUpDefinition(true);\n return `\n export interface ${identifier} extends ${object instanceof EnhancedObjectType\n ? `$ObjectTypeDefinition`\n : `$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)\n .getImportedDefinitionIdentifier(true)}, ${definition.multiplicity}>`,\n })}\n }`,\n properties: (_value) => (`{\n ${stringify(definition.properties, {\n \"*\": (propertyDefinition, _, apiName) => [\n `${propertyJsdoc(propertyDefinition, { apiName })}\"${maybeStripNamespace(object, apiName)}\"`,\n `$PropertyDef<\"${propertyDefinition.type}\", \"${propertyDefinition.nullable ? \"nullable\" : \"non-nullable\"}\", \"${propertyDefinition.multiplicity ? \"array\" : \"single\"}\">`,\n ],\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\n ? `export type ${identifier} = {};`\n : `\n export interface ${identifier} {\n${stringify(definition.links, {\n \"*\": (definition, _, key) => {\n const linkTarget = ontology.requireObjectType(definition.targetType)\n .getImportedDefinitionIdentifier(true);\n return [\n `readonly ${key}`,\n `${definition.multiplicity\n ? `${linkTarget}.ObjectSet`\n : `$SingleLinkAccessor<${linkTarget}>`}\n `,\n ];\n },\n })}\n }\n `}`;\n}\nexport function createPropertyKeys(type) {\n return `export type PropertyKeys = ${Object.keys(type.getCleanedUpDefinition(true).properties).map((a) => maybeStripNamespace(type, a)).map(a => `\"${a}\"`).join(\"|\")};`;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,6CAA6C,QAAQ,4BAA4B;AAC1F,SAASC,kBAAkB,QAAQ,0CAA0C;AAC7E,SAASC,gBAAgB,QAAQ,+BAA+B;AAChE,SAASC,aAAa,QAAQ,4BAA4B;AAC1D,SAASC,gBAAgB,QAAQ,6BAA6B;AAC9D,SAASC,SAAS,QAAQ,sBAAsB;AAChD,OAAO,SAASC,sBAAsBA,CAACC,IAAI,EAAEC,EAAE,EAAE;EAC7C,OAAOA,EAAE,GAAGD,IAAI,GAAG,GAAGA,IAAI,KAAK;AACnC;AACA;AACA,O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EAAE8B,UAAU,EAAE;EACtD,MAAMpB,UAAU,GAAGV,MAAM,CAAC+B,sBAAsB,CAAC,IAAI,CAAC;EACtD,OAAO;AACX,MAAMmB,MAAM,CAACC,IAAI,CAACzC,UAAU,CAACqC,KAAK,CAAC,CAACT,MAAM,KAAK,CAAC,GACtC,eAAeR,UAAU,QAAQ,GACjC;AACV,2BAA2BA,UAAU;AACrC,EAAEtC,SAAS,CAACkB,UAAU,CAACqC,KAAK,EAAE;IAClB,GAAG,EAAEN,CAAC/B,UAAU,EAAEiC,CAAC,EAAES,GAAG,KAAK;MACzB,MAAMC,UAAU,GAAGvD,QAAQ,CAACG,iBAAiB,CAACS,UAAU,CAACsC,UAAU,CAAC,CAC/DC,+BAA+B,CAAC,IAAI,CAAC;MAC1C,OAAO,CACH,YAAYG,GAAG,EAAE,EACjB,GAAG1C,UAAU,CAACmC,YAAY,GACpB,GAAGQ,UAAU,YAAY,GACzB,uBAAuBA,UAAU,GAAG;AAC9D,WAAW,CACM;IACL;EACJ,CAAC,CAAC;AACV;AACA,KAAK,EAAE;AACP;AACA,OAAO,SAAS9B,kBAAkBA,CAACU,IAAI,EAAE;EACrC,OAAO,8BAA8BiB,MAAM,CAACC,IAAI,CAAClB,IAAI,CAACF,sBAAsB,CAAC,IAAI,CAAC,CAACS,UAAU,CAAC,CAACjC,GAAG,CAAEC,CAAC,IAAKwB,mBAAmB,CAACC,IAAI,EAAEzB,CAAC,CAAC,CAAC,CAACD,GAAG,CAACC,CAAC,IAAI,IAAIA,CAAC,GAAG,CAAC,CAAC8C,IAAI,CAAC,GAAG,CAAC,GAAG;AAC3K","ignoreList":[]}
1
+ {"version":3,"file":"wireObjectTypeV2ToSdkObjectConstV2.js","names":["wireObjectTypeFullMetadataToSdkObjectMetadata","EnhancedObjectType","ForeignType","getObjectImports","propertyJsdoc","deleteUndefineds","stringify","getObjectDefIdentifier","name","v2","wireObjectTypeV2ToSdkObjectConstV2","wireObject","ontology","currentFilePath","object","requireObjectType","objectType","apiName","Error","uniqueLinkTargetTypes","Set","linkTypes","map","a","objectTypeApiName","definition","raw","objectDefIdentifier","getDefinitionIdentifier","objectSetIdentifier","shortApiName","propertyKeysIdentifier","osdkObjectPropsIdentifier","osdkObjectStrictPropsIdentifier","osdkObjectLinksIdentifier","osdkObjectIdentifier","identifiers","imports","createPropertyKeys","createLinks","createProps","createObjectSet","createOsdkObject","createDefinition","fullApiName","identifier","getCleanedUpDefinition","maybeStripNamespace","type","q","apiNamespace","startsWith","slice","length","strict","properties","*","propertyDefinition","_","JSON","multiplicity","nullable","links","targetType","getImportedDefinitionIdentifier","Object","keys","key","linkTarget","join"],"sources":["wireObjectTypeV2ToSdkObjectConstV2.js"],"sourcesContent":["/*\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 */\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\";\nexport function getObjectDefIdentifier(name, v2) {\n return v2 ? name : `${name}Def`;\n}\n/** @internal */\nexport function wireObjectTypeV2ToSdkObjectConstV2(wireObject, { ontology }, 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) {\n return `import type {\n PropertyKeys as $PropertyKeys, \n ObjectTypeDefinition as $ObjectTypeDefinition,\n ObjectMetadata as $ObjectMetadata,\n } from \"@osdk/api\";\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 \"@osdk/api\";\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)}\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, { osdkObjectPropsIdentifier, objectDefIdentifier, osdkObjectStrictPropsIdentifier, osdkObjectLinksIdentifier, }) {\n const definition = object.getCleanedUpDefinition(true);\n return `\n export type ${identifier}<\n OPTIONS extends never | \"$notStrict\" | \"$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 | \"$notStrict\" | \"$rid\" = never,\n K extends keyof ${osdkObjectPropsIdentifier}= keyof ${osdkObjectPropsIdentifier},\n > = ${identifier}<OPTIONS, K>;\n ;\n `;\n}\nexport function createObjectSet(object, { objectDefIdentifier, objectSetIdentifier, propertyKeysIdentifier, osdkObjectIdentifier, }) {\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 }\n else {\n return q;\n }\n}\nexport function createProps(type, identifier, strict) {\n const definition = type.getCleanedUpDefinition(true);\n return `export interface ${identifier} {\n${stringify(definition.properties, {\n \"*\": (propertyDefinition, _, apiName) => {\n return [\n `readonly \"${maybeStripNamespace(type, apiName)}\"${\n // after we convert everything over we can do this:\n // !strict || propertyDefinition.nullable ? \"?\" : \"\"\n \"\"}`,\n `$PropType[${JSON.stringify(propertyDefinition.type)}]${propertyDefinition.multiplicity ? \"[]\" : \"\"}${propertyDefinition.nullable || !strict ? `| undefined` : \"\"}`,\n ];\n },\n })}\n }`;\n}\nexport function createDefinition(object, ontology, identifier, { objectDefIdentifier, objectSetIdentifier, osdkObjectPropsIdentifier, osdkObjectStrictPropsIdentifier, osdkObjectLinksIdentifier, }) {\n const definition = object.getCleanedUpDefinition(true);\n return `\n export interface ${identifier} extends ${object instanceof EnhancedObjectType\n ? `$ObjectTypeDefinition`\n : `$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)\n .getImportedDefinitionIdentifier(true)}, ${definition.multiplicity}>`,\n })}\n }`,\n properties: (_value) => (`{\n ${stringify(definition.properties, {\n \"*\": (propertyDefinition, _, apiName) => [\n `${propertyJsdoc(propertyDefinition, { apiName })}\"${maybeStripNamespace(object, apiName)}\"`,\n `$PropertyDef<\"${propertyDefinition.type}\", \"${propertyDefinition.nullable ? \"nullable\" : \"non-nullable\"}\", \"${propertyDefinition.multiplicity ? \"array\" : \"single\"}\">`,\n ],\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\n ? `export type ${identifier} = {};`\n : `\n export interface ${identifier} {\n${stringify(definition.links, {\n \"*\": (definition, _, key) => {\n const linkTarget = ontology.requireObjectType(definition.targetType)\n .getImportedDefinitionIdentifier(true);\n return [\n `readonly ${key}`,\n `${definition.multiplicity\n ? `${linkTarget}.ObjectSet`\n : `$SingleLinkAccessor<${linkTarget}>`}\n `,\n ];\n },\n })}\n }\n `}`;\n}\nexport function createPropertyKeys(type) {\n return `export type PropertyKeys = ${Object.keys(type.getCleanedUpDefinition(true).properties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,OAAO,CACH,YAAYG,GAAG,EAAE,EACjB,GAAG1C,UAAU,CAACmC,YAAY,GACpB,GAAGQ,UAAU,YAAY,GACzB,uBAAuBA,UAAU,GAAG;AAC9D,WAAW,CACM;IACL;EACJ,CAAC,CAAC;AACV;AACA,KAAK,EAAE;AACP;AACA,OAAO,SAAS9B,kBAAkBA,CAACU,IAAI,EAAE;EACrC,OAAO,8BAA8BiB,MAAM,CAACC,IAAI,CAAClB,IAAI,CAACF,sBAAsB,CAAC,IAAI,CAAC,CAACS,UAAU,CAAC,CAACjC,GAAG,CAAEC,CAAC,IAAKwB,mBAAmB,CAACC,IAAI,EAAEzB,CAAC,CAAC,CAAC,CAACD,GAAG,CAACC,CAAC,IAAI,IAAIA,CAAC,GAAG,CAAC,CAAC8C,IAAI,CAAC,GAAG,CAAC,GAAG;AAC3K","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osdk/generator",
3
- "version": "2.0.2-rc.0",
3
+ "version": "2.0.2",
4
4
  "description": "",
5
5
  "access": "public",
6
6
  "license": "Apache-2.0",
@@ -23,8 +23,8 @@
23
23
  "fetch-retry": "^6.0.0",
24
24
  "prettier": "^3.0.3",
25
25
  "tiny-invariant": "^1.3.1",
26
- "@osdk/generator-converters": "~2.0.2-rc.0",
27
- "@osdk/api": "~2.0.2-rc.0",
26
+ "@osdk/api": "~2.0.2",
27
+ "@osdk/generator-converters": "~2.0.2",
28
28
  "@osdk/internal.foundry.core": "~0.2.1"
29
29
  },
30
30
  "devDependencies": {