@osdk/generator 2.2.0-beta.20 → 2.2.0-beta.22
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 +24 -0
- package/build/browser/GenerateContext/GenerateContext.js.map +1 -1
- package/build/browser/util/test/TodoWireOntology.js +2 -2
- package/build/browser/util/test/TodoWireOntology.js.map +1 -1
- package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.js +3 -2
- package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.js.map +1 -1
- package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.test.js +396 -12
- package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.test.js.map +1 -1
- package/build/browser/v2.0/generatePerQueryDataFiles.js +6 -8
- package/build/browser/v2.0/generatePerQueryDataFiles.js.map +1 -1
- package/build/browser/v2.0/generatePerQueryDataFiles.test.js +16 -8
- package/build/browser/v2.0/generatePerQueryDataFiles.test.js.map +1 -1
- package/build/cjs/index.cjs +9 -5
- package/build/cjs/index.cjs.map +1 -1
- package/build/cjs/index.d.cts +1 -1
- package/build/esm/GenerateContext/GenerateContext.js.map +1 -1
- package/build/esm/util/test/TodoWireOntology.js +2 -2
- package/build/esm/util/test/TodoWireOntology.js.map +1 -1
- package/build/esm/v2.0/generateClientSdkVersionTwoPointZero.js +3 -2
- package/build/esm/v2.0/generateClientSdkVersionTwoPointZero.js.map +1 -1
- package/build/esm/v2.0/generateClientSdkVersionTwoPointZero.test.js +396 -12
- package/build/esm/v2.0/generateClientSdkVersionTwoPointZero.test.js.map +1 -1
- package/build/esm/v2.0/generatePerQueryDataFiles.js +6 -8
- package/build/esm/v2.0/generatePerQueryDataFiles.js.map +1 -1
- package/build/esm/v2.0/generatePerQueryDataFiles.test.js +16 -8
- package/build/esm/v2.0/generatePerQueryDataFiles.test.js.map +1 -1
- package/build/types/GenerateContext/GenerateContext.d.ts +1 -0
- package/build/types/GenerateContext/GenerateContext.d.ts.map +1 -1
- package/build/types/v2.0/generateClientSdkVersionTwoPointZero.d.ts +1 -1
- package/build/types/v2.0/generateClientSdkVersionTwoPointZero.d.ts.map +1 -1
- package/build/types/v2.0/generatePerQueryDataFiles.d.ts +1 -1
- package/build/types/v2.0/generatePerQueryDataFiles.d.ts.map +1 -1
- package/package.json +4 -4
package/build/cjs/index.d.cts
CHANGED
|
@@ -26,6 +26,6 @@ declare function getExpectedDependencies({ osdkApiVersion, osdkClientVersion, }:
|
|
|
26
26
|
peerDependencies: Record<string, string>;
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
-
declare function generateClientSdkVersionTwoPointZero(ontology: WireOntologyDefinition, userAgent: string, fs: MinimalFs, outDir: string, packageType?: "module" | "commonjs", externalObjects?: Map<string, string>, externalInterfaces?: Map<string, string>, externalSpts?: Map<string, string>, forInternalUse?: boolean): Promise<void>;
|
|
29
|
+
declare function generateClientSdkVersionTwoPointZero(ontology: WireOntologyDefinition, userAgent: string, fs: MinimalFs, outDir: string, packageType?: "module" | "commonjs", externalObjects?: Map<string, string>, externalInterfaces?: Map<string, string>, externalSpts?: Map<string, string>, forInternalUse?: boolean, fixedVersionQueryTypes?: string[]): Promise<void>;
|
|
30
30
|
|
|
31
31
|
export { type MinimalFs, type WireOntologyDefinition, generateClientSdkPackage as __UNSTABLE_generateClientSdkPackage, generateClientSdkVersionTwoPointZero, getExpectedDependencies };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenerateContext.js","names":[],"sources":["GenerateContext.ts"],"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 type { MinimalFs } from \"../MinimalFs.js\";\nimport type { WireOntologyDefinition } from \"../WireOntologyDefinition.js\";\nimport type { EnhancedOntologyDefinition } from \"./EnhancedOntologyDefinition.js\";\n\nexport interface GenerateContext {\n sanitizedOntology: WireOntologyDefinition;\n ontology: EnhancedOntologyDefinition;\n\n importExt?: string;\n fs: MinimalFs;\n\n outDir: string;\n
|
|
1
|
+
{"version":3,"file":"GenerateContext.js","names":[],"sources":["GenerateContext.ts"],"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 type { MinimalFs } from \"../MinimalFs.js\";\nimport type { WireOntologyDefinition } from \"../WireOntologyDefinition.js\";\nimport type { EnhancedOntologyDefinition } from \"./EnhancedOntologyDefinition.js\";\n\nexport interface GenerateContext {\n sanitizedOntology: WireOntologyDefinition;\n ontology: EnhancedOntologyDefinition;\n\n importExt?: string;\n fs: MinimalFs;\n\n outDir: string;\n fixedVersionQueryTypes: string[];\n ontologyApiNamespace?: string | undefined;\n apiNamespacePackageMap?: Map<string, string>;\n forInternalUse?: boolean;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -180,7 +180,7 @@ export const TodoWireOntology = {
|
|
|
180
180
|
}
|
|
181
181
|
},
|
|
182
182
|
rid: "rid.query.1",
|
|
183
|
-
version: "0"
|
|
183
|
+
version: "1.1.0"
|
|
184
184
|
},
|
|
185
185
|
"returnsTodo": {
|
|
186
186
|
apiName: "returnsTodo",
|
|
@@ -200,7 +200,7 @@ export const TodoWireOntology = {
|
|
|
200
200
|
}
|
|
201
201
|
},
|
|
202
202
|
rid: "rid.query.2",
|
|
203
|
-
version: "0"
|
|
203
|
+
version: "3.2.0"
|
|
204
204
|
}
|
|
205
205
|
},
|
|
206
206
|
interfaceTypes: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TodoWireOntology.js","names":["TodoWireOntology","ontology","rid","apiName","displayName","description","actionTypes","parameters","object","dataType","type","objectApiName","objectTypeApiName","required","operations","status","objectTypes","Todo","objectType","primaryKey","pluralDisplayName","icon","name","color","titleProperty","properties","id","body","complete","linkTypes","cardinality","foreignKeyPropertyApiName","linkTypeRid","implementsInterfaces","implementsInterfaces2","sharedPropertyTypeMapping","Person","email","queryTypes","output","completed","version","someTodo","interfaceTypes","SomeInterface","extendsInterfaces","links","implementedByObjectTypes","allProperties","allExtendsInterfaces","allLinks","sharedPropertyTypes","SomeProperty"],"sources":["TodoWireOntology.ts"],"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 */\n\nimport type { WireOntologyDefinition } from \"../../WireOntologyDefinition.js\";\n\nexport const TodoWireOntology: WireOntologyDefinition = {\n ontology: {\n rid: \"ridHere\",\n apiName: \"OntologyApiName\",\n displayName: \"\",\n description: \"\",\n },\n actionTypes: {\n \"markTodoCompleted\": {\n apiName: \"markTodoCompleted\",\n description: \"An action which takes different types of parameters\",\n parameters: {\n object: {\n displayName: \"markTodoCompleted\",\n description: \"A Todo to mark completed\",\n dataType: {\n type: \"object\",\n objectApiName: \"Todo\",\n objectTypeApiName: \"Todo\",\n },\n required: false,\n },\n },\n rid: \"ri.ontology.main.action-type.9f84017d-cf17-4fa8-84c3-8e01e5d594f2\",\n operations: [{\n type: \"modifyObject\",\n objectTypeApiName: \"Todo\",\n }],\n status: \"ACTIVE\",\n },\n \"deleteTodos\": {\n apiName: \"deleteTodos\",\n description: \"An action which takes in an array of objects\",\n parameters: {\n object: {\n displayName: \"deleteTodos\",\n description: \"Todo(s) to be deleted\",\n \"dataType\": {\n \"type\": \"array\",\n\n \"subType\": {\n \"type\": \"object\",\n \"objectApiName\": \"Todo\",\n \"objectTypeApiName\": \"Todo\",\n },\n },\n required: false,\n },\n },\n rid: \"ri.ontology.main.action-type.8f94017d-cf17-4fa8-84c3-8e01e5d594f2\",\n operations: [{\n type: \"deleteObject\",\n objectTypeApiName: \"Todo\",\n }],\n status: \"ACTIVE\",\n },\n },\n objectTypes: {\n Todo: {\n objectType: {\n apiName: \"Todo\",\n primaryKey: \"id\",\n displayName: \"AwesomeTodoDisplayname\",\n pluralDisplayName: \"AwesomeTodoDisplayNames\",\n icon: { type: \"blueprint\", name: \"document\", color: \"blue\" },\n description: \"Its a todo item.\",\n titleProperty: \"body\",\n properties: {\n id: {\n dataType: {\n type: \"integer\",\n },\n rid: \"rid\",\n },\n body: {\n dataType: {\n type: \"string\",\n },\n description: \"The text of the todo\",\n displayName: \"Body\",\n rid: \"rid\",\n },\n complete: {\n dataType: {\n type: \"boolean\",\n },\n rid: \"rid\",\n },\n },\n status: \"ACTIVE\",\n rid: \"ridForTodo\",\n },\n linkTypes: [{\n apiName: \"Assignee\",\n cardinality: \"ONE\",\n displayName: \"Assignee\",\n objectTypeApiName: \"Person\",\n status: \"ACTIVE\",\n foreignKeyPropertyApiName: \"email\",\n linkTypeRid: \"\",\n }],\n implementsInterfaces: [\"SomeInterface\"],\n implementsInterfaces2: {\n \"SomeInterface\": {\n properties: {\n \"SomeProperty\": \"body\",\n },\n },\n },\n sharedPropertyTypeMapping: {},\n },\n Person: {\n objectType: {\n apiName: \"Person\",\n primaryKey: \"email\",\n displayName: \"Person\",\n pluralDisplayName: \"Persons\",\n icon: { type: \"blueprint\", name: \"document\", color: \"blue\" },\n description: \"A person\",\n titleProperty: \"email\",\n properties: {\n email: {\n dataType: {\n type: \"string\",\n },\n rid: \"rid\",\n },\n },\n\n rid: \"ridForPerson\",\n status: \"ACTIVE\",\n },\n linkTypes: [{\n apiName: \"Todos\",\n cardinality: \"MANY\",\n displayName: \"Todos\",\n objectTypeApiName: \"Todo\",\n status: \"ACTIVE\",\n foreignKeyPropertyApiName: \"id\",\n linkTypeRid: \"\",\n }],\n implementsInterfaces: [],\n implementsInterfaces2: {},\n sharedPropertyTypeMapping: {},\n },\n },\n queryTypes: {\n \"getCount\": {\n apiName: \"getCount\",\n output: {\n type: \"integer\",\n },\n parameters: {\n completed: { dataType: { type: \"boolean\" } },\n },\n rid: \"rid.query.1\",\n version: \"0\",\n },\n \"returnsTodo\": {\n apiName: \"returnsTodo\",\n output: {\n type: \"object\",\n objectApiName: \"Todo\",\n objectTypeApiName: \"Todo\",\n },\n parameters: {\n someTodo: {\n description: \"Random desc so we test jsdoc\",\n dataType: {\n type: \"object\",\n objectApiName: \"Todo\",\n objectTypeApiName: \"Todo\",\n },\n },\n },\n rid: \"rid.query.2\",\n version: \"0\",\n },\n },\n interfaceTypes: {\n SomeInterface: {\n apiName: \"SomeInterface\",\n description: \"Some interface\",\n properties: {\n \"SomeProperty\": {\n apiName: \"SomeProperty\",\n description: \"Some property\",\n displayName: \"Sum Property\",\n dataType: {\n type: \"string\",\n },\n rid: \"idk2\",\n required: false,\n },\n },\n rid: \"idk\",\n displayName: \"Sum Interface\",\n extendsInterfaces: [],\n links: {},\n implementedByObjectTypes: [],\n allProperties: {\n \"SomeProperty\": {\n apiName: \"SomeProperty\",\n description: \"Some property\",\n displayName: \"Sum Property\",\n dataType: {\n type: \"string\",\n },\n rid: \"idk2\",\n required: false,\n },\n },\n allExtendsInterfaces: [],\n allLinks: {},\n },\n },\n sharedPropertyTypes: {\n SomeProperty: {\n apiName: \"SomeProperty\",\n description: \"Some property\",\n displayName: \"Sum Property\",\n dataType: {\n type: \"string\",\n },\n rid: \"idk2\",\n },\n },\n} as const satisfies WireOntologyDefinition;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,OAAO,MAAMA,gBAAwC,GAAG;EACtDC,QAAQ,EAAE;IACRC,GAAG,EAAE,SAAS;IACdC,OAAO,EAAE,iBAAiB;IAC1BC,WAAW,EAAE,EAAE;IACfC,WAAW,EAAE;EACf,CAAC;EACDC,WAAW,EAAE;IACX,mBAAmB,EAAE;MACnBH,OAAO,EAAE,mBAAmB;MAC5BE,WAAW,EAAE,qDAAqD;MAClEE,UAAU,EAAE;QACVC,MAAM,EAAE;UACNJ,WAAW,EAAE,mBAAmB;UAChCC,WAAW,EAAE,0BAA0B;UACvCI,QAAQ,EAAE;YACRC,IAAI,EAAE,QAAQ;YACdC,aAAa,EAAE,MAAM;YACrBC,iBAAiB,EAAE;UACrB,CAAC;UACDC,QAAQ,EAAE;QACZ;MACF,CAAC;MACDX,GAAG,EAAE,mEAAmE;MACxEY,UAAU,EAAE,CAAC;QACXJ,IAAI,EAAE,cAAc;QACpBE,iBAAiB,EAAE;MACrB,CAAC,CAAC;MACFG,MAAM,EAAE;IACV,CAAC;IACD,aAAa,EAAE;MACbZ,OAAO,EAAE,aAAa;MACtBE,WAAW,EAAE,8CAA8C;MAC3DE,UAAU,EAAE;QACVC,MAAM,EAAE;UACNJ,WAAW,EAAE,aAAa;UAC1BC,WAAW,EAAE,uBAAuB;UACpC,UAAU,EAAE;YACV,MAAM,EAAE,OAAO;YAEf,SAAS,EAAE;cACT,MAAM,EAAE,QAAQ;cAChB,eAAe,EAAE,MAAM;cACvB,mBAAmB,EAAE;YACvB;UACF,CAAC;UACDQ,QAAQ,EAAE;QACZ;MACF,CAAC;MACDX,GAAG,EAAE,mEAAmE;MACxEY,UAAU,EAAE,C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,"file":"TodoWireOntology.js","names":["TodoWireOntology","ontology","rid","apiName","displayName","description","actionTypes","parameters","object","dataType","type","objectApiName","objectTypeApiName","required","operations","status","objectTypes","Todo","objectType","primaryKey","pluralDisplayName","icon","name","color","titleProperty","properties","id","body","complete","linkTypes","cardinality","foreignKeyPropertyApiName","linkTypeRid","implementsInterfaces","implementsInterfaces2","sharedPropertyTypeMapping","Person","email","queryTypes","output","completed","version","someTodo","interfaceTypes","SomeInterface","extendsInterfaces","links","implementedByObjectTypes","allProperties","allExtendsInterfaces","allLinks","sharedPropertyTypes","SomeProperty"],"sources":["TodoWireOntology.ts"],"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 */\n\nimport type { WireOntologyDefinition } from \"../../WireOntologyDefinition.js\";\n\nexport const TodoWireOntology: WireOntologyDefinition = {\n ontology: {\n rid: \"ridHere\",\n apiName: \"OntologyApiName\",\n displayName: \"\",\n description: \"\",\n },\n actionTypes: {\n \"markTodoCompleted\": {\n apiName: \"markTodoCompleted\",\n description: \"An action which takes different types of parameters\",\n parameters: {\n object: {\n displayName: \"markTodoCompleted\",\n description: \"A Todo to mark completed\",\n dataType: {\n type: \"object\",\n objectApiName: \"Todo\",\n objectTypeApiName: \"Todo\",\n },\n required: false,\n },\n },\n rid: \"ri.ontology.main.action-type.9f84017d-cf17-4fa8-84c3-8e01e5d594f2\",\n operations: [{\n type: \"modifyObject\",\n objectTypeApiName: \"Todo\",\n }],\n status: \"ACTIVE\",\n },\n \"deleteTodos\": {\n apiName: \"deleteTodos\",\n description: \"An action which takes in an array of objects\",\n parameters: {\n object: {\n displayName: \"deleteTodos\",\n description: \"Todo(s) to be deleted\",\n \"dataType\": {\n \"type\": \"array\",\n\n \"subType\": {\n \"type\": \"object\",\n \"objectApiName\": \"Todo\",\n \"objectTypeApiName\": \"Todo\",\n },\n },\n required: false,\n },\n },\n rid: \"ri.ontology.main.action-type.8f94017d-cf17-4fa8-84c3-8e01e5d594f2\",\n operations: [{\n type: \"deleteObject\",\n objectTypeApiName: \"Todo\",\n }],\n status: \"ACTIVE\",\n },\n },\n objectTypes: {\n Todo: {\n objectType: {\n apiName: \"Todo\",\n primaryKey: \"id\",\n displayName: \"AwesomeTodoDisplayname\",\n pluralDisplayName: \"AwesomeTodoDisplayNames\",\n icon: { type: \"blueprint\", name: \"document\", color: \"blue\" },\n description: \"Its a todo item.\",\n titleProperty: \"body\",\n properties: {\n id: {\n dataType: {\n type: \"integer\",\n },\n rid: \"rid\",\n },\n body: {\n dataType: {\n type: \"string\",\n },\n description: \"The text of the todo\",\n displayName: \"Body\",\n rid: \"rid\",\n },\n complete: {\n dataType: {\n type: \"boolean\",\n },\n rid: \"rid\",\n },\n },\n status: \"ACTIVE\",\n rid: \"ridForTodo\",\n },\n linkTypes: [{\n apiName: \"Assignee\",\n cardinality: \"ONE\",\n displayName: \"Assignee\",\n objectTypeApiName: \"Person\",\n status: \"ACTIVE\",\n foreignKeyPropertyApiName: \"email\",\n linkTypeRid: \"\",\n }],\n implementsInterfaces: [\"SomeInterface\"],\n implementsInterfaces2: {\n \"SomeInterface\": {\n properties: {\n \"SomeProperty\": \"body\",\n },\n },\n },\n sharedPropertyTypeMapping: {},\n },\n Person: {\n objectType: {\n apiName: \"Person\",\n primaryKey: \"email\",\n displayName: \"Person\",\n pluralDisplayName: \"Persons\",\n icon: { type: \"blueprint\", name: \"document\", color: \"blue\" },\n description: \"A person\",\n titleProperty: \"email\",\n properties: {\n email: {\n dataType: {\n type: \"string\",\n },\n rid: \"rid\",\n },\n },\n\n rid: \"ridForPerson\",\n status: \"ACTIVE\",\n },\n linkTypes: [{\n apiName: \"Todos\",\n cardinality: \"MANY\",\n displayName: \"Todos\",\n objectTypeApiName: \"Todo\",\n status: \"ACTIVE\",\n foreignKeyPropertyApiName: \"id\",\n linkTypeRid: \"\",\n }],\n implementsInterfaces: [],\n implementsInterfaces2: {},\n sharedPropertyTypeMapping: {},\n },\n },\n queryTypes: {\n \"getCount\": {\n apiName: \"getCount\",\n output: {\n type: \"integer\",\n },\n parameters: {\n completed: { dataType: { type: \"boolean\" } },\n },\n rid: \"rid.query.1\",\n version: \"1.1.0\",\n },\n \"returnsTodo\": {\n apiName: \"returnsTodo\",\n output: {\n type: \"object\",\n objectApiName: \"Todo\",\n objectTypeApiName: \"Todo\",\n },\n parameters: {\n someTodo: {\n description: \"Random desc so we test jsdoc\",\n dataType: {\n type: \"object\",\n objectApiName: \"Todo\",\n objectTypeApiName: \"Todo\",\n },\n },\n },\n rid: \"rid.query.2\",\n version: \"3.2.0\",\n },\n },\n interfaceTypes: {\n SomeInterface: {\n apiName: \"SomeInterface\",\n description: \"Some interface\",\n properties: {\n \"SomeProperty\": {\n apiName: \"SomeProperty\",\n description: \"Some property\",\n displayName: \"Sum Property\",\n dataType: {\n type: \"string\",\n },\n rid: \"idk2\",\n required: false,\n },\n },\n rid: \"idk\",\n displayName: \"Sum Interface\",\n extendsInterfaces: [],\n links: {},\n implementedByObjectTypes: [],\n allProperties: {\n \"SomeProperty\": {\n apiName: \"SomeProperty\",\n description: \"Some property\",\n displayName: \"Sum Property\",\n dataType: {\n type: \"string\",\n },\n rid: \"idk2\",\n required: false,\n },\n },\n allExtendsInterfaces: [],\n allLinks: {},\n },\n },\n sharedPropertyTypes: {\n SomeProperty: {\n apiName: \"SomeProperty\",\n description: \"Some property\",\n displayName: \"Sum Property\",\n dataType: {\n type: \"string\",\n },\n rid: \"idk2\",\n },\n },\n} as const satisfies WireOntologyDefinition;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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QACF;MACF,CAAC;MACDV,GAAG,EAAE,aAAa;MAClBuC,OAAO,EAAE;IACX;EACF,CAAC;EACDE,cAAc,EAAE;IACdC,aAAa,EAAE;MACbzC,OAAO,EAAE,eAAe;MACxBE,WAAW,EAAE,gBAAgB;MAC7BoB,UAAU,EAAE;QACV,cAAc,EAAE;UACdtB,OAAO,EAAE,cAAc;UACvBE,WAAW,EAAE,eAAe;UAC5BD,WAAW,EAAE,cAAc;UAC3BK,QAAQ,EAAE;YACRC,IAAI,EAAE;UACR,CAAC;UACDR,GAAG,EAAE,MAAM;UACXW,QAAQ,EAAE;QACZ;MACF,CAAC;MACDX,GAAG,EAAE,KAAK;MACVE,WAAW,EAAE,eAAe;MAC5ByC,iBAAiB,EAAE,EAAE;MACrBC,KAAK,EAAE,CAAC,CAAC;MACTC,wBAAwB,EAAE,EAAE;MAC5BC,aAAa,EAAE;QACb,cAAc,EAAE;UACd7C,OAAO,EAAE,cAAc;UACvBE,WAAW,EAAE,eAAe;UAC5BD,WAAW,EAAE,cAAc;UAC3BK,QAAQ,EAAE;YACRC,IAAI,EAAE;UACR,CAAC;UACDR,GAAG,EAAE,MAAM;UACXW,QAAQ,EAAE;QACZ;MACF,CAAC;MACDoC,oBAAoB,EAAE,EAAE;MACxBC,QAAQ,EAAE,CAAC;IACb;EACF,CAAC;EACDC,mBAAmB,EAAE;IACnBC,YAAY,EAAE;MACZjD,OAAO,EAAE,cAAc;MACvBE,WAAW,EAAE,eAAe;MAC5BD,WAAW,EAAE,cAAc;MAC3BK,QAAQ,EAAE;QACRC,IAAI,EAAE;MACR,CAAC;MACDR,GAAG,EAAE;IACP;EACF;AACF,CAA2C","ignoreList":[]}
|
|
@@ -23,7 +23,7 @@ import { generatePerInterfaceDataFiles } from "./generatePerInterfaceDataFiles.j
|
|
|
23
23
|
import { generatePerObjectDataFiles } from "./generatePerObjectDataFiles.js";
|
|
24
24
|
import { generatePerQueryDataFilesV2 } from "./generatePerQueryDataFiles.js";
|
|
25
25
|
import { generateRootIndexTsFile } from "./generateRootIndexTsFile.js";
|
|
26
|
-
export async function generateClientSdkVersionTwoPointZero(ontology, userAgent, fs, outDir, packageType = "commonjs", externalObjects = new Map(), externalInterfaces = new Map(), externalSpts = new Map(), forInternalUse = false) {
|
|
26
|
+
export async function generateClientSdkVersionTwoPointZero(ontology, userAgent, fs, outDir, packageType = "commonjs", externalObjects = new Map(), externalInterfaces = new Map(), externalSpts = new Map(), forInternalUse = false, fixedVersionQueryTypes = []) {
|
|
27
27
|
const importExt = ".js"; // turns out you can always use the extension
|
|
28
28
|
|
|
29
29
|
// Structurally, we need to have multiple ontologies read in
|
|
@@ -47,7 +47,8 @@ export async function generateClientSdkVersionTwoPointZero(ontology, userAgent,
|
|
|
47
47
|
importExt,
|
|
48
48
|
fs,
|
|
49
49
|
outDir,
|
|
50
|
-
forInternalUse
|
|
50
|
+
forInternalUse,
|
|
51
|
+
fixedVersionQueryTypes
|
|
51
52
|
};
|
|
52
53
|
await generateRootIndexTsFile(ctx);
|
|
53
54
|
await generateOntologyMetadataFile(ctx, userAgent);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateClientSdkVersionTwoPointZero.js","names":["enhanceOntology","sanitizeMetadata","verifyOutDir","generateOntologyMetadataFile","generatePerActionDataFiles","generatePerInterfaceDataFiles","generatePerObjectDataFiles","generatePerQueryDataFilesV2","generateRootIndexTsFile","generateClientSdkVersionTwoPointZero","ontology","userAgent","fs","outDir","packageType","externalObjects","Map","externalInterfaces","externalSpts","forInternalUse","importExt","sanitizedOntology","mkdir","recursive","enhancedOntology","sanitized","ctx"],"sources":["generateClientSdkVersionTwoPointZero.ts"],"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 */\n\nimport { enhanceOntology } from \"../GenerateContext/enhanceOntology.js\";\nimport type { GenerateContext } from \"../GenerateContext/GenerateContext.js\";\nimport type { MinimalFs } from \"../MinimalFs.js\";\nimport { sanitizeMetadata } from \"../shared/sanitizeMetadata.js\";\nimport { verifyOutDir } from \"../util/verifyOutDir.js\";\nimport type { WireOntologyDefinition } from \"../WireOntologyDefinition.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\";\n\nexport async function generateClientSdkVersionTwoPointZero(\n ontology: WireOntologyDefinition,\n userAgent: string,\n fs: MinimalFs,\n outDir: string,\n packageType: \"module\" | \"commonjs\" = \"commonjs\",\n externalObjects: Map<string, string> = new Map(),\n externalInterfaces: Map<string, string> = new Map(),\n externalSpts: Map<string, string> = new Map(),\n forInternalUse: boolean = false,\n): Promise<void> {\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\n const sanitizedOntology = sanitizeMetadata(ontology);\n\n await fs.mkdir(outDir, { recursive: true });\n const enhancedOntology = enhanceOntology({\n sanitized: sanitizedOntology,\n importExt,\n externalObjects,\n externalInterfaces,\n externalSpts,\n });\n\n const ctx: GenerateContext = {\n sanitizedOntology,\n ontology: enhancedOntology,\n importExt,\n fs,\n outDir,\n forInternalUse,\n };\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"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,eAAe,QAAQ,uCAAuC;AAGvE,SAASC,gBAAgB,QAAQ,+BAA+B;AAChE,SAASC,YAAY,QAAQ,yBAAyB;AAEtD,SAASC,4BAA4B,QAAQ,uBAAuB;AACpE,SAASC,0BAA0B,QAAQ,iCAAiC;AAC5E,SAASC,6BAA6B,QAAQ,oCAAoC;AAClF,SAASC,0BAA0B,QAAQ,iCAAiC;AAC5E,SAASC,2BAA2B,QAAQ,gCAAgC;AAC5E,SAASC,uBAAuB,QAAQ,8BAA8B;AAEtE,OAAO,eAAeC,oCAAoCA,CACxDC,QAAgC,EAChCC,SAAiB,EACjBC,EAAa,EACbC,MAAc,EACdC,WAAkC,GAAG,UAAU,EAC/CC,eAAoC,GAAG,IAAIC,GAAG,CAAC,CAAC,EAChDC,kBAAuC,GAAG,IAAID,GAAG,CAAC,CAAC,EACnDE,YAAiC,GAAG,IAAIF,GAAG,CAAC,CAAC,EAC7CG,cAAuB,GAAG,KAAK,
|
|
1
|
+
{"version":3,"file":"generateClientSdkVersionTwoPointZero.js","names":["enhanceOntology","sanitizeMetadata","verifyOutDir","generateOntologyMetadataFile","generatePerActionDataFiles","generatePerInterfaceDataFiles","generatePerObjectDataFiles","generatePerQueryDataFilesV2","generateRootIndexTsFile","generateClientSdkVersionTwoPointZero","ontology","userAgent","fs","outDir","packageType","externalObjects","Map","externalInterfaces","externalSpts","forInternalUse","fixedVersionQueryTypes","importExt","sanitizedOntology","mkdir","recursive","enhancedOntology","sanitized","ctx"],"sources":["generateClientSdkVersionTwoPointZero.ts"],"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 */\n\nimport { enhanceOntology } from \"../GenerateContext/enhanceOntology.js\";\nimport type { GenerateContext } from \"../GenerateContext/GenerateContext.js\";\nimport type { MinimalFs } from \"../MinimalFs.js\";\nimport { sanitizeMetadata } from \"../shared/sanitizeMetadata.js\";\nimport { verifyOutDir } from \"../util/verifyOutDir.js\";\nimport type { WireOntologyDefinition } from \"../WireOntologyDefinition.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\";\n\nexport async function generateClientSdkVersionTwoPointZero(\n ontology: WireOntologyDefinition,\n userAgent: string,\n fs: MinimalFs,\n outDir: string,\n packageType: \"module\" | \"commonjs\" = \"commonjs\",\n externalObjects: Map<string, string> = new Map(),\n externalInterfaces: Map<string, string> = new Map(),\n externalSpts: Map<string, string> = new Map(),\n forInternalUse: boolean = false,\n fixedVersionQueryTypes: string[] = [],\n): Promise<void> {\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\n const sanitizedOntology = sanitizeMetadata(ontology);\n\n await fs.mkdir(outDir, { recursive: true });\n const enhancedOntology = enhanceOntology({\n sanitized: sanitizedOntology,\n importExt,\n externalObjects,\n externalInterfaces,\n externalSpts,\n });\n\n const ctx: GenerateContext = {\n sanitizedOntology,\n ontology: enhancedOntology,\n importExt,\n fs,\n outDir,\n forInternalUse,\n fixedVersionQueryTypes,\n };\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"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,eAAe,QAAQ,uCAAuC;AAGvE,SAASC,gBAAgB,QAAQ,+BAA+B;AAChE,SAASC,YAAY,QAAQ,yBAAyB;AAEtD,SAASC,4BAA4B,QAAQ,uBAAuB;AACpE,SAASC,0BAA0B,QAAQ,iCAAiC;AAC5E,SAASC,6BAA6B,QAAQ,oCAAoC;AAClF,SAASC,0BAA0B,QAAQ,iCAAiC;AAC5E,SAASC,2BAA2B,QAAQ,gCAAgC;AAC5E,SAASC,uBAAuB,QAAQ,8BAA8B;AAEtE,OAAO,eAAeC,oCAAoCA,CACxDC,QAAgC,EAChCC,SAAiB,EACjBC,EAAa,EACbC,MAAc,EACdC,WAAkC,GAAG,UAAU,EAC/CC,eAAoC,GAAG,IAAIC,GAAG,CAAC,CAAC,EAChDC,kBAAuC,GAAG,IAAID,GAAG,CAAC,CAAC,EACnDE,YAAiC,GAAG,IAAIF,GAAG,CAAC,CAAC,EAC7CG,cAAuB,GAAG,KAAK,EAC/BC,sBAAgC,GAAG,EAAE,EACtB;EACf,MAAMC,SAAS,GAAG,KAAK,CAAC,CAAC;;EAEzB;EACA;;EAEA,MAAMnB,YAAY,CAACW,MAAM,EAAED,EAAE,CAAC;EAE9B,MAAMU,iBAAiB,GAAGrB,gBAAgB,CAACS,QAAQ,CAAC;EAEpD,MAAME,EAAE,CAACW,KAAK,CAACV,MAAM,EAAE;IAAEW,SAAS,EAAE;EAAK,CAAC,CAAC;EAC3C,MAAMC,gBAAgB,GAAGzB,eAAe,CAAC;IACvC0B,SAAS,EAAEJ,iBAAiB;IAC5BD,SAAS;IACTN,eAAe;IACfE,kBAAkB;IAClBC;EACF,CAAC,CAAC;EAEF,MAAMS,GAAoB,GAAG;IAC3BL,iBAAiB;IACjBZ,QAAQ,EAAEe,gBAAgB;IAC1BJ,SAAS;IACTT,EAAE;IACFC,MAAM;IACNM,cAAc;IACdC;EACF,CAAC;EAED,MAAMZ,uBAAuB,CAACmB,GAAG,CAAC;EAClC,MAAMxB,4BAA4B,CAACwB,GAAG,EAAEhB,SAAS,CAAC;EAClD,MAAML,0BAA0B,CAACqB,GAAG,CAAC;EACrC,MAAMtB,6BAA6B,CAACsB,GAAG,CAAC;EACxC,MAAMvB,0BAA0B,CAACuB,GAAG,CAAC;EACrC,MAAMpB,2BAA2B,CAACoB,GAAG,EAAE,IAAI,CAAC;AAC9C","ignoreList":[]}
|
|
@@ -905,7 +905,8 @@ describe("generator", () => {
|
|
|
905
905
|
apiName: 'getCount';
|
|
906
906
|
rid: 'rid.query.1';
|
|
907
907
|
type: 'query';
|
|
908
|
-
version: '0';
|
|
908
|
+
version: '1.1.0';
|
|
909
|
+
isFixedVersion: false;
|
|
909
910
|
parameters: {
|
|
910
911
|
/**
|
|
911
912
|
* (no ontology metadata)
|
|
@@ -923,14 +924,15 @@ describe("generator", () => {
|
|
|
923
924
|
};
|
|
924
925
|
apiName: 'getCount';
|
|
925
926
|
type: 'query';
|
|
926
|
-
version: '0';
|
|
927
|
+
version: '1.1.0';
|
|
927
928
|
osdkMetadata: typeof $osdkMetadata;
|
|
928
929
|
}
|
|
929
930
|
|
|
930
931
|
export const getCount: getCount = {
|
|
931
932
|
apiName: 'getCount',
|
|
932
933
|
type: 'query',
|
|
933
|
-
version: '0',
|
|
934
|
+
version: '1.1.0',
|
|
935
|
+
isFixedVersion: false,
|
|
934
936
|
osdkMetadata: $osdkMetadata,
|
|
935
937
|
};
|
|
936
938
|
",
|
|
@@ -959,7 +961,8 @@ describe("generator", () => {
|
|
|
959
961
|
apiName: 'returnsTodo';
|
|
960
962
|
rid: 'rid.query.2';
|
|
961
963
|
type: 'query';
|
|
962
|
-
version: '0';
|
|
964
|
+
version: '3.2.0';
|
|
965
|
+
isFixedVersion: false;
|
|
963
966
|
parameters: {
|
|
964
967
|
/**
|
|
965
968
|
* description: Random desc so we test jsdoc
|
|
@@ -982,14 +985,15 @@ describe("generator", () => {
|
|
|
982
985
|
};
|
|
983
986
|
apiName: 'returnsTodo';
|
|
984
987
|
type: 'query';
|
|
985
|
-
version: '0';
|
|
988
|
+
version: '3.2.0';
|
|
986
989
|
osdkMetadata: typeof $osdkMetadata;
|
|
987
990
|
}
|
|
988
991
|
|
|
989
992
|
export const returnsTodo: returnsTodo = {
|
|
990
993
|
apiName: 'returnsTodo',
|
|
991
994
|
type: 'query',
|
|
992
|
-
version: '0',
|
|
995
|
+
version: '3.2.0',
|
|
996
|
+
isFixedVersion: false,
|
|
993
997
|
osdkMetadata: $osdkMetadata,
|
|
994
998
|
};
|
|
995
999
|
",
|
|
@@ -1505,7 +1509,8 @@ describe("generator", () => {
|
|
|
1505
1509
|
apiName: 'foo.bar.getCount';
|
|
1506
1510
|
rid: 'rid.query.1';
|
|
1507
1511
|
type: 'query';
|
|
1508
|
-
version: '0';
|
|
1512
|
+
version: '1.1.0';
|
|
1513
|
+
isFixedVersion: false;
|
|
1509
1514
|
parameters: {
|
|
1510
1515
|
/**
|
|
1511
1516
|
* (no ontology metadata)
|
|
@@ -1523,14 +1528,15 @@ describe("generator", () => {
|
|
|
1523
1528
|
};
|
|
1524
1529
|
apiName: 'foo.bar.getCount';
|
|
1525
1530
|
type: 'query';
|
|
1526
|
-
version: '0';
|
|
1531
|
+
version: '1.1.0';
|
|
1527
1532
|
osdkMetadata: typeof $osdkMetadata;
|
|
1528
1533
|
}
|
|
1529
1534
|
|
|
1530
1535
|
export const getCount: getCount = {
|
|
1531
1536
|
apiName: 'foo.bar.getCount',
|
|
1532
1537
|
type: 'query',
|
|
1533
|
-
version: '0',
|
|
1538
|
+
version: '1.1.0',
|
|
1539
|
+
isFixedVersion: false,
|
|
1534
1540
|
osdkMetadata: $osdkMetadata,
|
|
1535
1541
|
};
|
|
1536
1542
|
",
|
|
@@ -1559,7 +1565,8 @@ describe("generator", () => {
|
|
|
1559
1565
|
apiName: 'foo.bar.returnsTodo';
|
|
1560
1566
|
rid: 'rid.query.2';
|
|
1561
1567
|
type: 'query';
|
|
1562
|
-
version: '0';
|
|
1568
|
+
version: '3.2.0';
|
|
1569
|
+
isFixedVersion: false;
|
|
1563
1570
|
parameters: {
|
|
1564
1571
|
/**
|
|
1565
1572
|
* description: Random desc so we test jsdoc
|
|
@@ -1582,14 +1589,15 @@ describe("generator", () => {
|
|
|
1582
1589
|
};
|
|
1583
1590
|
apiName: 'foo.bar.returnsTodo';
|
|
1584
1591
|
type: 'query';
|
|
1585
|
-
version: '0';
|
|
1592
|
+
version: '3.2.0';
|
|
1586
1593
|
osdkMetadata: typeof $osdkMetadata;
|
|
1587
1594
|
}
|
|
1588
1595
|
|
|
1589
1596
|
export const returnsTodo: returnsTodo = {
|
|
1590
1597
|
apiName: 'foo.bar.returnsTodo',
|
|
1591
1598
|
type: 'query',
|
|
1592
|
-
version: '0',
|
|
1599
|
+
version: '3.2.0',
|
|
1600
|
+
isFixedVersion: false,
|
|
1593
1601
|
osdkMetadata: $osdkMetadata,
|
|
1594
1602
|
};
|
|
1595
1603
|
",
|
|
@@ -1671,6 +1679,7 @@ describe("generator", () => {
|
|
|
1671
1679
|
rid: 'ri.a.b.c';
|
|
1672
1680
|
type: 'query';
|
|
1673
1681
|
version: '0';
|
|
1682
|
+
isFixedVersion: false;
|
|
1674
1683
|
parameters: {
|
|
1675
1684
|
/**
|
|
1676
1685
|
* (no ontology metadata)
|
|
@@ -1700,6 +1709,7 @@ describe("generator", () => {
|
|
|
1700
1709
|
apiName: 'getTask',
|
|
1701
1710
|
type: 'query',
|
|
1702
1711
|
version: '0',
|
|
1712
|
+
isFixedVersion: false,
|
|
1703
1713
|
osdkMetadata: $osdkMetadata,
|
|
1704
1714
|
};
|
|
1705
1715
|
"
|
|
@@ -1890,6 +1900,380 @@ describe("generator", () => {
|
|
|
1890
1900
|
`);
|
|
1891
1901
|
});
|
|
1892
1902
|
});
|
|
1903
|
+
describe("queries with versions", () => {
|
|
1904
|
+
it("can generate properly when queries have versions and optionally have fixed versions", async () => {
|
|
1905
|
+
await generateClientSdkVersionTwoPointZero({
|
|
1906
|
+
ontology: TodoWireOntology.ontology,
|
|
1907
|
+
actionTypes: {},
|
|
1908
|
+
interfaceTypes: {},
|
|
1909
|
+
objectTypes: TodoWireOntology.objectTypes,
|
|
1910
|
+
queryTypes: {
|
|
1911
|
+
"getCount:1.1.0": {
|
|
1912
|
+
...TodoWireOntology.queryTypes.getCount
|
|
1913
|
+
},
|
|
1914
|
+
"returnsTodo:3.2.0": {
|
|
1915
|
+
...TodoWireOntology.queryTypes.returnsTodo,
|
|
1916
|
+
version: "0"
|
|
1917
|
+
}
|
|
1918
|
+
},
|
|
1919
|
+
sharedPropertyTypes: {}
|
|
1920
|
+
}, "typescript-sdk/0.0.0 osdk-cli/0.0.0", helper.minimalFiles, BASE_PATH, "module", new Map(), new Map(), new Map(), false, ["getCount"]);
|
|
1921
|
+
expect(tweakedFilesForSnapshotConsistency(helper.getFiles())).toMatchInlineSnapshot(`
|
|
1922
|
+
{
|
|
1923
|
+
"/foo/OntologyMetadata.ts": "export type $ExpectedClientVersion = 'PLACEHOLDER';
|
|
1924
|
+
export const $osdkMetadata = { extraUserAgent: 'typescript-sdk/0.0.0 osdk-cli/0.0.0' };
|
|
1925
|
+
|
|
1926
|
+
export const $ontologyRid = 'ridHere';
|
|
1927
|
+
",
|
|
1928
|
+
"/foo/index.ts": "export {} from './ontology/actions.js';
|
|
1929
|
+
export * as $Actions from './ontology/actions.js';
|
|
1930
|
+
export {} from './ontology/interfaces.js';
|
|
1931
|
+
export * as $Interfaces from './ontology/interfaces.js';
|
|
1932
|
+
export { Person, Todo } from './ontology/objects.js';
|
|
1933
|
+
export * as $Objects from './ontology/objects.js';
|
|
1934
|
+
export { getCount, returnsTodo } from './ontology/queries.js';
|
|
1935
|
+
export * as $Queries from './ontology/queries.js';
|
|
1936
|
+
export { $osdkMetadata } from './OntologyMetadata.js';
|
|
1937
|
+
export { $ontologyRid } from './OntologyMetadata.js';
|
|
1938
|
+
",
|
|
1939
|
+
"/foo/ontology/actions.ts": "export {};
|
|
1940
|
+
",
|
|
1941
|
+
"/foo/ontology/interfaces.ts": "export {};
|
|
1942
|
+
",
|
|
1943
|
+
"/foo/ontology/objects.ts": "export { Person } from './objects/Person.js';
|
|
1944
|
+
export { Todo } from './objects/Todo.js';
|
|
1945
|
+
",
|
|
1946
|
+
"/foo/ontology/objects/Person.ts": "import type { PropertyDef as $PropertyDef } from '@osdk/client';
|
|
1947
|
+
import { $osdkMetadata } from '../../OntologyMetadata.js';
|
|
1948
|
+
import type { $ExpectedClientVersion } from '../../OntologyMetadata.js';
|
|
1949
|
+
import type { Todo } from './Todo.js';
|
|
1950
|
+
import type {
|
|
1951
|
+
PropertyKeys as $PropertyKeys,
|
|
1952
|
+
ObjectTypeDefinition as $ObjectTypeDefinition,
|
|
1953
|
+
ObjectMetadata as $ObjectMetadata,
|
|
1954
|
+
} from '@osdk/client';
|
|
1955
|
+
import type {
|
|
1956
|
+
ObjectSet as $ObjectSet,
|
|
1957
|
+
Osdk as $Osdk,
|
|
1958
|
+
OsdkObject as $OsdkObject,
|
|
1959
|
+
PropertyValueWireToClient as $PropType,
|
|
1960
|
+
SingleLinkAccessor as $SingleLinkAccessor,
|
|
1961
|
+
} from '@osdk/client';
|
|
1962
|
+
|
|
1963
|
+
export namespace Person {
|
|
1964
|
+
export type PropertyKeys = 'email';
|
|
1965
|
+
|
|
1966
|
+
export interface Links {
|
|
1967
|
+
readonly Todos: Todo.ObjectSet;
|
|
1968
|
+
}
|
|
1969
|
+
|
|
1970
|
+
export interface Props {
|
|
1971
|
+
/**
|
|
1972
|
+
* (no ontology metadata)
|
|
1973
|
+
*/
|
|
1974
|
+
readonly email: $PropType['string'];
|
|
1975
|
+
}
|
|
1976
|
+
export type StrictProps = Props;
|
|
1977
|
+
|
|
1978
|
+
export interface ObjectSet extends $ObjectSet<Person, Person.ObjectSet> {}
|
|
1979
|
+
|
|
1980
|
+
export type OsdkInstance<
|
|
1981
|
+
OPTIONS extends never | '$rid' = never,
|
|
1982
|
+
K extends keyof Person.Props = keyof Person.Props,
|
|
1983
|
+
> = $Osdk.Instance<Person, OPTIONS, K>;
|
|
1984
|
+
|
|
1985
|
+
/** @deprecated use OsdkInstance */
|
|
1986
|
+
export type OsdkObject<
|
|
1987
|
+
OPTIONS extends never | '$rid' = never,
|
|
1988
|
+
K extends keyof Person.Props = keyof Person.Props,
|
|
1989
|
+
> = OsdkInstance<OPTIONS, K>;
|
|
1990
|
+
}
|
|
1991
|
+
|
|
1992
|
+
export interface Person extends $ObjectTypeDefinition {
|
|
1993
|
+
osdkMetadata: typeof $osdkMetadata;
|
|
1994
|
+
type: 'object';
|
|
1995
|
+
apiName: 'Person';
|
|
1996
|
+
__DefinitionMetadata?: {
|
|
1997
|
+
objectSet: Person.ObjectSet;
|
|
1998
|
+
props: Person.Props;
|
|
1999
|
+
linksType: Person.Links;
|
|
2000
|
+
strictProps: Person.StrictProps;
|
|
2001
|
+
apiName: 'Person';
|
|
2002
|
+
description: 'A person';
|
|
2003
|
+
displayName: 'Person';
|
|
2004
|
+
icon: {
|
|
2005
|
+
type: 'blueprint';
|
|
2006
|
+
name: 'document';
|
|
2007
|
+
color: 'blue';
|
|
2008
|
+
};
|
|
2009
|
+
implements: [];
|
|
2010
|
+
interfaceMap: {};
|
|
2011
|
+
inverseInterfaceMap: {};
|
|
2012
|
+
links: {
|
|
2013
|
+
Todos: $ObjectMetadata.Link<Todo, true>;
|
|
2014
|
+
};
|
|
2015
|
+
pluralDisplayName: 'Persons';
|
|
2016
|
+
primaryKeyApiName: 'email';
|
|
2017
|
+
primaryKeyType: 'string';
|
|
2018
|
+
properties: {
|
|
2019
|
+
/**
|
|
2020
|
+
* (no ontology metadata)
|
|
2021
|
+
*/
|
|
2022
|
+
email: $PropertyDef<'string', 'non-nullable', 'single'>;
|
|
2023
|
+
};
|
|
2024
|
+
rid: 'ridForPerson';
|
|
2025
|
+
status: 'ACTIVE';
|
|
2026
|
+
titleProperty: 'email';
|
|
2027
|
+
type: 'object';
|
|
2028
|
+
};
|
|
2029
|
+
}
|
|
2030
|
+
|
|
2031
|
+
export const Person: Person = {
|
|
2032
|
+
type: 'object',
|
|
2033
|
+
apiName: 'Person',
|
|
2034
|
+
osdkMetadata: $osdkMetadata,
|
|
2035
|
+
};
|
|
2036
|
+
",
|
|
2037
|
+
"/foo/ontology/objects/Todo.ts": "import type { PropertyDef as $PropertyDef } from '@osdk/client';
|
|
2038
|
+
import { $osdkMetadata } from '../../OntologyMetadata.js';
|
|
2039
|
+
import type { $ExpectedClientVersion } from '../../OntologyMetadata.js';
|
|
2040
|
+
import type { Person } from './Person.js';
|
|
2041
|
+
import type {
|
|
2042
|
+
PropertyKeys as $PropertyKeys,
|
|
2043
|
+
ObjectTypeDefinition as $ObjectTypeDefinition,
|
|
2044
|
+
ObjectMetadata as $ObjectMetadata,
|
|
2045
|
+
} from '@osdk/client';
|
|
2046
|
+
import type {
|
|
2047
|
+
ObjectSet as $ObjectSet,
|
|
2048
|
+
Osdk as $Osdk,
|
|
2049
|
+
OsdkObject as $OsdkObject,
|
|
2050
|
+
PropertyValueWireToClient as $PropType,
|
|
2051
|
+
SingleLinkAccessor as $SingleLinkAccessor,
|
|
2052
|
+
} from '@osdk/client';
|
|
2053
|
+
|
|
2054
|
+
export namespace Todo {
|
|
2055
|
+
export type PropertyKeys = 'id' | 'body' | 'complete';
|
|
2056
|
+
|
|
2057
|
+
export interface Links {
|
|
2058
|
+
readonly Assignee: $SingleLinkAccessor<Person>;
|
|
2059
|
+
}
|
|
2060
|
+
|
|
2061
|
+
export interface Props {
|
|
2062
|
+
/**
|
|
2063
|
+
* display name: 'Body',
|
|
2064
|
+
* description: The text of the todo
|
|
2065
|
+
*/
|
|
2066
|
+
readonly body: $PropType['string'] | undefined;
|
|
2067
|
+
/**
|
|
2068
|
+
* (no ontology metadata)
|
|
2069
|
+
*/
|
|
2070
|
+
readonly complete: $PropType['boolean'] | undefined;
|
|
2071
|
+
/**
|
|
2072
|
+
* (no ontology metadata)
|
|
2073
|
+
*/
|
|
2074
|
+
readonly id: $PropType['integer'];
|
|
2075
|
+
}
|
|
2076
|
+
export type StrictProps = Props;
|
|
2077
|
+
|
|
2078
|
+
export interface ObjectSet extends $ObjectSet<Todo, Todo.ObjectSet> {}
|
|
2079
|
+
|
|
2080
|
+
export type OsdkInstance<
|
|
2081
|
+
OPTIONS extends never | '$rid' = never,
|
|
2082
|
+
K extends keyof Todo.Props = keyof Todo.Props,
|
|
2083
|
+
> = $Osdk.Instance<Todo, OPTIONS, K>;
|
|
2084
|
+
|
|
2085
|
+
/** @deprecated use OsdkInstance */
|
|
2086
|
+
export type OsdkObject<
|
|
2087
|
+
OPTIONS extends never | '$rid' = never,
|
|
2088
|
+
K extends keyof Todo.Props = keyof Todo.Props,
|
|
2089
|
+
> = OsdkInstance<OPTIONS, K>;
|
|
2090
|
+
}
|
|
2091
|
+
|
|
2092
|
+
export interface Todo extends $ObjectTypeDefinition {
|
|
2093
|
+
osdkMetadata: typeof $osdkMetadata;
|
|
2094
|
+
type: 'object';
|
|
2095
|
+
apiName: 'Todo';
|
|
2096
|
+
__DefinitionMetadata?: {
|
|
2097
|
+
objectSet: Todo.ObjectSet;
|
|
2098
|
+
props: Todo.Props;
|
|
2099
|
+
linksType: Todo.Links;
|
|
2100
|
+
strictProps: Todo.StrictProps;
|
|
2101
|
+
apiName: 'Todo';
|
|
2102
|
+
description: 'Its a todo item.';
|
|
2103
|
+
displayName: 'AwesomeTodoDisplayname';
|
|
2104
|
+
icon: {
|
|
2105
|
+
type: 'blueprint';
|
|
2106
|
+
name: 'document';
|
|
2107
|
+
color: 'blue';
|
|
2108
|
+
};
|
|
2109
|
+
implements: ['SomeInterface'];
|
|
2110
|
+
interfaceMap: {
|
|
2111
|
+
SomeInterface: {
|
|
2112
|
+
SomeProperty: 'body';
|
|
2113
|
+
};
|
|
2114
|
+
};
|
|
2115
|
+
inverseInterfaceMap: {
|
|
2116
|
+
SomeInterface: {
|
|
2117
|
+
body: 'SomeProperty';
|
|
2118
|
+
};
|
|
2119
|
+
};
|
|
2120
|
+
links: {
|
|
2121
|
+
Assignee: $ObjectMetadata.Link<Person, false>;
|
|
2122
|
+
};
|
|
2123
|
+
pluralDisplayName: 'AwesomeTodoDisplayNames';
|
|
2124
|
+
primaryKeyApiName: 'id';
|
|
2125
|
+
primaryKeyType: 'integer';
|
|
2126
|
+
properties: {
|
|
2127
|
+
/**
|
|
2128
|
+
* display name: 'Body',
|
|
2129
|
+
* description: The text of the todo
|
|
2130
|
+
*/
|
|
2131
|
+
body: $PropertyDef<'string', 'nullable', 'single'>;
|
|
2132
|
+
/**
|
|
2133
|
+
* (no ontology metadata)
|
|
2134
|
+
*/
|
|
2135
|
+
complete: $PropertyDef<'boolean', 'nullable', 'single'>;
|
|
2136
|
+
/**
|
|
2137
|
+
* (no ontology metadata)
|
|
2138
|
+
*/
|
|
2139
|
+
id: $PropertyDef<'integer', 'non-nullable', 'single'>;
|
|
2140
|
+
};
|
|
2141
|
+
rid: 'ridForTodo';
|
|
2142
|
+
status: 'ACTIVE';
|
|
2143
|
+
titleProperty: 'body';
|
|
2144
|
+
type: 'object';
|
|
2145
|
+
};
|
|
2146
|
+
}
|
|
2147
|
+
|
|
2148
|
+
export const Todo: Todo = {
|
|
2149
|
+
type: 'object',
|
|
2150
|
+
apiName: 'Todo',
|
|
2151
|
+
osdkMetadata: $osdkMetadata,
|
|
2152
|
+
};
|
|
2153
|
+
",
|
|
2154
|
+
"/foo/ontology/queries.ts": "export { getCount } from './queries/getCount.js';
|
|
2155
|
+
export { returnsTodo } from './queries/returnsTodo.js';
|
|
2156
|
+
",
|
|
2157
|
+
"/foo/ontology/queries/getCount.ts": "import type { ObjectSpecifier, QueryDefinition, QueryParam, QueryResult, VersionBound } from '@osdk/client';
|
|
2158
|
+
import type { $ExpectedClientVersion } from '../../OntologyMetadata.js';
|
|
2159
|
+
import { $osdkMetadata } from '../../OntologyMetadata.js';
|
|
2160
|
+
|
|
2161
|
+
export namespace getCount {
|
|
2162
|
+
export interface Signature {
|
|
2163
|
+
(query: getCount.Parameters): Promise<getCount.ReturnType>;
|
|
2164
|
+
}
|
|
2165
|
+
|
|
2166
|
+
export interface Parameters {
|
|
2167
|
+
/**
|
|
2168
|
+
* (no ontology metadata)
|
|
2169
|
+
*/
|
|
2170
|
+
readonly completed: QueryParam.PrimitiveType<'boolean'>;
|
|
2171
|
+
}
|
|
2172
|
+
|
|
2173
|
+
export type ReturnType = QueryResult.PrimitiveType<'integer'>;
|
|
2174
|
+
}
|
|
2175
|
+
|
|
2176
|
+
export interface getCount extends QueryDefinition<getCount.Signature>, VersionBound<$ExpectedClientVersion> {
|
|
2177
|
+
__DefinitionMetadata?: {
|
|
2178
|
+
apiName: 'getCount';
|
|
2179
|
+
rid: 'rid.query.1';
|
|
2180
|
+
type: 'query';
|
|
2181
|
+
version: '1.1.0';
|
|
2182
|
+
isFixedVersion: true;
|
|
2183
|
+
parameters: {
|
|
2184
|
+
/**
|
|
2185
|
+
* (no ontology metadata)
|
|
2186
|
+
*/
|
|
2187
|
+
completed: {
|
|
2188
|
+
nullable: false;
|
|
2189
|
+
type: 'boolean';
|
|
2190
|
+
};
|
|
2191
|
+
};
|
|
2192
|
+
output: {
|
|
2193
|
+
nullable: false;
|
|
2194
|
+
type: 'integer';
|
|
2195
|
+
};
|
|
2196
|
+
signature: getCount.Signature;
|
|
2197
|
+
};
|
|
2198
|
+
apiName: 'getCount';
|
|
2199
|
+
type: 'query';
|
|
2200
|
+
version: '1.1.0';
|
|
2201
|
+
osdkMetadata: typeof $osdkMetadata;
|
|
2202
|
+
}
|
|
2203
|
+
|
|
2204
|
+
export const getCount: getCount = {
|
|
2205
|
+
apiName: 'getCount',
|
|
2206
|
+
type: 'query',
|
|
2207
|
+
version: '1.1.0',
|
|
2208
|
+
isFixedVersion: true,
|
|
2209
|
+
osdkMetadata: $osdkMetadata,
|
|
2210
|
+
};
|
|
2211
|
+
",
|
|
2212
|
+
"/foo/ontology/queries/returnsTodo.ts": "import type { ObjectSpecifier, QueryDefinition, QueryParam, QueryResult, VersionBound } from '@osdk/client';
|
|
2213
|
+
import type { $ExpectedClientVersion } from '../../OntologyMetadata.js';
|
|
2214
|
+
import { $osdkMetadata } from '../../OntologyMetadata.js';
|
|
2215
|
+
import type { Todo } from '../objects/Todo.js';
|
|
2216
|
+
|
|
2217
|
+
export namespace returnsTodo {
|
|
2218
|
+
export interface Signature {
|
|
2219
|
+
(query: returnsTodo.Parameters): Promise<returnsTodo.ReturnType>;
|
|
2220
|
+
}
|
|
2221
|
+
|
|
2222
|
+
export interface Parameters {
|
|
2223
|
+
/**
|
|
2224
|
+
* description: Random desc so we test jsdoc
|
|
2225
|
+
*/
|
|
2226
|
+
readonly someTodo: QueryParam.ObjectType<Todo>;
|
|
2227
|
+
}
|
|
2228
|
+
|
|
2229
|
+
export type ReturnType = QueryResult.ObjectType<Todo>;
|
|
2230
|
+
}
|
|
2231
|
+
|
|
2232
|
+
export interface returnsTodo extends QueryDefinition<returnsTodo.Signature>, VersionBound<$ExpectedClientVersion> {
|
|
2233
|
+
__DefinitionMetadata?: {
|
|
2234
|
+
apiName: 'returnsTodo';
|
|
2235
|
+
rid: 'rid.query.2';
|
|
2236
|
+
type: 'query';
|
|
2237
|
+
version: '0';
|
|
2238
|
+
isFixedVersion: false;
|
|
2239
|
+
parameters: {
|
|
2240
|
+
/**
|
|
2241
|
+
* description: Random desc so we test jsdoc
|
|
2242
|
+
*/
|
|
2243
|
+
someTodo: {
|
|
2244
|
+
description: 'Random desc so we test jsdoc';
|
|
2245
|
+
nullable: false;
|
|
2246
|
+
object: 'Todo';
|
|
2247
|
+
type: 'object';
|
|
2248
|
+
__OsdkTargetType?: Todo;
|
|
2249
|
+
};
|
|
2250
|
+
};
|
|
2251
|
+
output: {
|
|
2252
|
+
nullable: false;
|
|
2253
|
+
object: 'Todo';
|
|
2254
|
+
type: 'object';
|
|
2255
|
+
__OsdkTargetType?: Todo;
|
|
2256
|
+
};
|
|
2257
|
+
signature: returnsTodo.Signature;
|
|
2258
|
+
};
|
|
2259
|
+
apiName: 'returnsTodo';
|
|
2260
|
+
type: 'query';
|
|
2261
|
+
version: '0';
|
|
2262
|
+
osdkMetadata: typeof $osdkMetadata;
|
|
2263
|
+
}
|
|
2264
|
+
|
|
2265
|
+
export const returnsTodo: returnsTodo = {
|
|
2266
|
+
apiName: 'returnsTodo',
|
|
2267
|
+
type: 'query',
|
|
2268
|
+
version: '0',
|
|
2269
|
+
isFixedVersion: false,
|
|
2270
|
+
osdkMetadata: $osdkMetadata,
|
|
2271
|
+
};
|
|
2272
|
+
",
|
|
2273
|
+
}
|
|
2274
|
+
`);
|
|
2275
|
+
});
|
|
2276
|
+
});
|
|
1893
2277
|
it("can generate an sdk package that is entirely a library", async () => {
|
|
1894
2278
|
const mockConsola = vi.spyOn(consola, "info");
|
|
1895
2279
|
await expect(generateClientSdkVersionTwoPointZero(referencedOntology, "", helper.minimalFiles, BASE_PATH, "module")).resolves.toMatchInlineSnapshot(`undefined`);
|