@osdk/client 2.2.0-rc.24 → 2.2.0-rc.25
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 +11 -0
- package/build/browser/derivedProperties/derivedPropertyRuntimeMetadata.js +2 -0
- package/build/browser/derivedProperties/derivedPropertyRuntimeMetadata.js.map +1 -0
- package/build/browser/intellisense.test.helpers/orderBySuggestionIsRight.js +30 -0
- package/build/browser/intellisense.test.helpers/orderBySuggestionIsRight.js.map +1 -0
- package/build/browser/intellisense.test.js +22 -0
- package/build/browser/intellisense.test.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.js +20 -8
- package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects.js.map +1 -1
- package/build/browser/objectSet/ObjectSet.test.js +7 -0
- package/build/browser/objectSet/ObjectSet.test.js.map +1 -1
- package/build/browser/tsserver.js +1 -0
- package/build/browser/tsserver.js.map +1 -1
- package/build/browser/util/UserAgent.js +1 -1
- package/build/browser/util/extractRdpDefinition.js +13 -2
- package/build/browser/util/extractRdpDefinition.js.map +1 -1
- package/build/browser/util/extractRdpDefinition.test.js +87 -5
- package/build/browser/util/extractRdpDefinition.test.js.map +1 -1
- package/build/cjs/{chunk-GTDO4U7H.cjs → chunk-5JZGGCIW.cjs} +14 -14
- package/build/cjs/{chunk-GTDO4U7H.cjs.map → chunk-5JZGGCIW.cjs.map} +1 -1
- package/build/cjs/{chunk-W5PFESFR.cjs → chunk-HDAQ6JIR.cjs} +15 -4
- package/build/cjs/chunk-HDAQ6JIR.cjs.map +1 -0
- package/build/cjs/index.cjs +63 -53
- package/build/cjs/index.cjs.map +1 -1
- package/build/cjs/public/internal.cjs +8 -8
- package/build/cjs/public/unstable-do-not-use.cjs +8 -8
- package/build/esm/derivedProperties/derivedPropertyRuntimeMetadata.js +2 -0
- package/build/esm/derivedProperties/derivedPropertyRuntimeMetadata.js.map +1 -0
- package/build/esm/intellisense.test.helpers/orderBySuggestionIsRight.js +30 -0
- package/build/esm/intellisense.test.helpers/orderBySuggestionIsRight.js.map +1 -0
- package/build/esm/intellisense.test.js +22 -0
- package/build/esm/intellisense.test.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/createOsdkObject.js +20 -8
- package/build/esm/object/convertWireToOsdkObjects/createOsdkObject.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects.js.map +1 -1
- package/build/esm/objectSet/ObjectSet.test.js +7 -0
- package/build/esm/objectSet/ObjectSet.test.js.map +1 -1
- package/build/esm/tsserver.js +1 -0
- package/build/esm/tsserver.js.map +1 -1
- package/build/esm/util/UserAgent.js +1 -1
- package/build/esm/util/extractRdpDefinition.js +13 -2
- package/build/esm/util/extractRdpDefinition.js.map +1 -1
- package/build/esm/util/extractRdpDefinition.test.js +87 -5
- package/build/esm/util/extractRdpDefinition.test.js.map +1 -1
- package/build/types/derivedProperties/derivedPropertyRuntimeMetadata.d.ts +6 -0
- package/build/types/derivedProperties/derivedPropertyRuntimeMetadata.d.ts.map +1 -0
- package/build/types/intellisense.test.helpers/orderBySuggestionIsRight.d.ts +1 -0
- package/build/types/intellisense.test.helpers/orderBySuggestionIsRight.d.ts.map +1 -0
- package/build/types/object/convertWireToOsdkObjects.d.ts +5 -4
- package/build/types/object/convertWireToOsdkObjects.d.ts.map +1 -1
- package/build/types/tsserver.d.ts +1 -0
- package/build/types/tsserver.d.ts.map +1 -1
- package/build/types/util/extractRdpDefinition.d.ts +2 -2
- package/build/types/util/extractRdpDefinition.d.ts.map +1 -1
- package/package.json +8 -8
- package/build/cjs/chunk-W5PFESFR.cjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractRdpDefinition.test.js","names":["describe","expect","it","extractRdpDefinition","mockClientCtx","ontologyProvider","getObjectDefinition","objectType","links","testLink1","targetType","testLink2","properties","testProperty","type","Error","objectSetWithRdps","objectSet","link","derivedProperties","myRdp","operation","selectedPropertyApiName","result","toMatchInlineSnapshot","rdp1","limit","rdp2","objectSets","rejects","toThrowErrorMatchingInlineSnapshot"],"sources":["extractRdpDefinition.test.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { ObjectMetadata } from \"@osdk/api\";\nimport type { ObjectSet } from \"@osdk/foundry.ontologies\";\nimport { describe, expect, it } from \"vitest\";\nimport type { MinimalClient } from \"../MinimalClientContext.js\";\nimport { extractRdpDefinition } from \"./extractRdpDefinition.js\";\n\ndescribe(\"extractRdpDefinition\", () => {\n const mockClientCtx = {\n ontologyProvider: {\n getObjectDefinition: (objectType: string) => {\n if (objectType === \"BaseType\") {\n return {\n links: {\n testLink1: {\n targetType: \"SecondType\",\n \"multiplicity\": \"many\",\n } satisfies ObjectMetadata.Link<any, any>,\n },\n };\n } else if (objectType === \"SecondType\") {\n return {\n links: {\n testLink2: {\n targetType: \"ThirdType\",\n \"multiplicity\": \"many\",\n } satisfies ObjectMetadata.Link<any, any>,\n },\n };\n } else if (objectType === \"ThirdType\") {\n return {\n properties: {\n testProperty: {\n type: \"attachment\",\n } satisfies ObjectMetadata.Property,\n },\n };\n } else {\n throw new Error(`Missing definition for '${objectType}'`);\n }\n },\n } as any,\n } as MinimalClient;\n\n const objectSetWithRdps: ObjectSet = {\n type: \"withProperties\",\n objectSet: {\n type: \"searchAround\",\n objectSet: { type: \"base\", objectType: \"BaseType\" },\n link: \"testLink1\",\n },\n derivedProperties: {\n myRdp: {\n type: \"selection\",\n objectSet: {\n type: \"searchAround\",\n objectSet: { type: \"methodInput\" },\n link: \"testLink2\",\n },\n operation: { type: \"get\", selectedPropertyApiName: \"testProperty\" },\n },\n },\n };\n\n it(\"handles 'withProperties' object set type\", async () => {\n const result = await extractRdpDefinition(\n mockClientCtx,\n objectSetWithRdps,\n );\n\n expect(result).toMatchInlineSnapshot(\n `\n {\n \"myRdp\": {\n \"type\": \"attachment\",\n },\n }\n `,\n );\n });\n\n it(\"combines definitions from multiple derived properties\", async () => {\n const nestedObjectSet: ObjectSet = {\n type: \"withProperties\",\n objectSet: objectSetWithRdps,\n derivedProperties: {\n rdp1: {\n type: \"selection\",\n objectSet: {\n type: \"searchAround\",\n objectSet: { type: \"methodInput\" },\n link: \"testLink2\",\n },\n operation: {\n type: \"collectList\",\n selectedPropertyApiName: \"testProperty\",\n limit: 100,\n },\n },\n rdp2: {\n type: \"selection\",\n objectSet: {\n type: \"searchAround\",\n objectSet: { type: \"methodInput\" },\n link: \"testLink2\",\n },\n operation: {\n type: \"collectSet\",\n selectedPropertyApiName: \"testProperty\",\n limit: 100,\n },\n },\n },\n };\n\n const result = await extractRdpDefinition(\n mockClientCtx,\n nestedObjectSet,\n );\n\n expect(result).toMatchInlineSnapshot(`\n {\n \"myRdp\": {\n \"type\": \"attachment\",\n },\n \"rdp1\": {\n \"type\": \"attachment\",\n },\n \"rdp2\": {\n \"type\": \"attachment\",\n },\n }\n `);\n });\n\n it(\"handles `intersection` object set type and nested static and reference object sets\", async () => {\n const intersectionObjectSet: ObjectSet = {\n type: \"intersect\",\n objectSets: [\n {\n type: \"searchAround\",\n objectSet: { type: \"base\", objectType: \"BaseType\" },\n link: \"testLink1\",\n },\n { type: \"static\", \"objects\": [\"object1\", \"object2\"] },\n { type: \"reference\", \"reference\": \"rid.os.1234\" },\n ],\n };\n\n const RdpWithIntersectionBaseObjectSet: ObjectSet = {\n type: \"withProperties\",\n objectSet: intersectionObjectSet,\n derivedProperties: {\n myRdp: {\n type: \"selection\",\n objectSet: {\n type: \"searchAround\",\n objectSet: { type: \"methodInput\" },\n link: \"testLink2\",\n },\n operation: {\n type: \"get\",\n selectedPropertyApiName: \"testProperty\",\n },\n },\n },\n };\n\n const result = await extractRdpDefinition(\n mockClientCtx,\n RdpWithIntersectionBaseObjectSet,\n );\n\n expect(result).toMatchInlineSnapshot(\n `\n {\n \"myRdp\": {\n \"type\": \"attachment\",\n },\n }\n `,\n );\n });\n\n it(\"throws with intersect, subtract, or union having nested RDPs\", async () => {\n const intersectionObjectSetWithNestedRdps: ObjectSet = {\n type: \"intersect\",\n objectSets: [objectSetWithRdps, {\n type: \"base\",\n objectType: \"ThirdType\",\n }],\n };\n\n await expect(\n extractRdpDefinition(mockClientCtx, intersectionObjectSetWithNestedRdps),\n ).rejects.toThrowErrorMatchingInlineSnapshot(\n `[Error: Invariant failed: Object sets combined using intersect, subtract, or union must not contain any derived property definitions]`,\n );\n });\n\n it(\"throes with intersect, subtract, or union having different child object types\", async () => {\n const intersectionObjectSet: ObjectSet = {\n type: \"intersect\",\n objectSets: [\n {\n type: \"searchAround\",\n objectSet: { type: \"base\", objectType: \"BaseType\" },\n link: \"testLink1\",\n },\n { type: \"base\", objectType: \"BaseType\" },\n ],\n };\n\n const RdpWithIntersectionBaseObjectSet: ObjectSet = {\n type: \"withProperties\",\n objectSet: intersectionObjectSet,\n derivedProperties: {\n myRdp: {\n type: \"selection\",\n objectSet: {\n type: \"searchAround\",\n objectSet: { type: \"methodInput\" },\n link: \"testLink2\",\n },\n operation: {\n type: \"get\",\n selectedPropertyApiName: \"testProperty\",\n },\n },\n },\n };\n\n await expect(\n extractRdpDefinition(mockClientCtx, RdpWithIntersectionBaseObjectSet),\n ).rejects.toThrowErrorMatchingInlineSnapshot(\n `[Error: Invariant failed: All object sets in an intersect, subtract, or union must have the same child object type]`,\n );\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,QAAQ,EAA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;QACvCH,IAAI,EAAE,WAAW;QACjBc,UAAU,EAAE,CACV;UACEd,IAAI,EAAE,cAAc;UACpBG,SAAS,EAAE;YAAEH,IAAI,EAAE,MAAM;YAAEP,UAAU,EAAE;UAAW,CAAC;UACnDW,IAAI,EAAE;QACR,CAAC,EACD;UAAEJ,IAAI,EAAE,MAAM;UAAEP,UAAU,EAAE;QAAW,CAAC;MAE5C,CAIkC;MAChCY,iBAAiB,EAAE;QACjBC,KAAK,EAAE;UACLN,IAAI,EAAE,WAAW;UACjBG,SAAS,EAAE;YACTH,IAAI,EAAE,cAAc;YACpBG,SAAS,EAAE;cAAEH,IAAI,EAAE;YAAc,CAAC;YAClCI,IAAI,EAAE;UACR,CAAC;UACDG,SAAS,EAAE;YACTP,IAAI,EAAE,KAAK;YACXQ,uBAAuB,EAAE;UAC3B;QACF;MACF;IACF,CAGsE,CACtE,CAAC,CAACO,OAAO,CAACC,kCAAkC,CAC1C,qHACF,CAAC;EACH,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"extractRdpDefinition.test.js","names":["describe","expect","it","extractRdpDefinition","mockClientCtx","ontologyProvider","getObjectDefinition","objectType","links","testLink1","targetType","testLink2","properties","testProperty","type","Error","objectSetWithRdps","objectSet","link","derivedProperties","myRdp","operation","selectedPropertyApiName","result","toMatchInlineSnapshot","rdp1","limit","rdp2","objectSets","rejects","toThrowErrorMatchingInlineSnapshot"],"sources":["extractRdpDefinition.test.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { ObjectMetadata } from \"@osdk/api\";\nimport type { ObjectSet } from \"@osdk/foundry.ontologies\";\nimport { describe, expect, it } from \"vitest\";\nimport type { MinimalClient } from \"../MinimalClientContext.js\";\nimport { extractRdpDefinition } from \"./extractRdpDefinition.js\";\n\ndescribe(\"extractRdpDefinition\", () => {\n const mockClientCtx = {\n ontologyProvider: {\n getObjectDefinition: (objectType: string) => {\n if (objectType === \"BaseType\") {\n return {\n links: {\n testLink1: {\n targetType: \"SecondType\",\n \"multiplicity\": \"many\",\n } satisfies ObjectMetadata.Link<any, any>,\n },\n };\n } else if (objectType === \"SecondType\") {\n return {\n links: {\n testLink2: {\n targetType: \"ThirdType\",\n \"multiplicity\": \"many\",\n } satisfies ObjectMetadata.Link<any, any>,\n },\n };\n } else if (objectType === \"ThirdType\") {\n return {\n properties: {\n testProperty: {\n type: \"attachment\",\n } satisfies ObjectMetadata.Property,\n },\n };\n } else {\n throw new Error(`Missing definition for '${objectType}'`);\n }\n },\n } as any,\n } as MinimalClient;\n\n const objectSetWithRdps: ObjectSet = {\n type: \"withProperties\",\n objectSet: {\n type: \"searchAround\",\n objectSet: { type: \"base\", objectType: \"BaseType\" },\n link: \"testLink1\",\n },\n derivedProperties: {\n myRdp: {\n type: \"selection\",\n objectSet: {\n type: \"searchAround\",\n objectSet: { type: \"methodInput\" },\n link: \"testLink2\",\n },\n operation: { type: \"get\", selectedPropertyApiName: \"testProperty\" },\n },\n },\n };\n\n it(\"handles 'withProperties' object set type\", async () => {\n const result = await extractRdpDefinition(\n mockClientCtx,\n objectSetWithRdps,\n );\n\n expect(result).toMatchInlineSnapshot(\n `\n {\n \"myRdp\": {\n \"definition\": {\n \"objectSet\": {\n \"link\": \"testLink2\",\n \"objectSet\": {\n \"type\": \"methodInput\",\n },\n \"type\": \"searchAround\",\n },\n \"operation\": {\n \"selectedPropertyApiName\": \"testProperty\",\n \"type\": \"get\",\n },\n \"type\": \"selection\",\n },\n \"selectedOrCollectedPropertyType\": {\n \"type\": \"attachment\",\n },\n },\n }\n `,\n );\n });\n\n it(\"combines definitions from multiple derived properties\", async () => {\n const nestedObjectSet: ObjectSet = {\n type: \"withProperties\",\n objectSet: objectSetWithRdps,\n derivedProperties: {\n rdp1: {\n type: \"selection\",\n objectSet: {\n type: \"searchAround\",\n objectSet: { type: \"methodInput\" },\n link: \"testLink2\",\n },\n operation: {\n type: \"collectList\",\n selectedPropertyApiName: \"testProperty\",\n limit: 100,\n },\n },\n rdp2: {\n type: \"selection\",\n objectSet: {\n type: \"searchAround\",\n objectSet: { type: \"methodInput\" },\n link: \"testLink2\",\n },\n operation: {\n type: \"collectSet\",\n selectedPropertyApiName: \"testProperty\",\n limit: 100,\n },\n },\n },\n };\n\n const result = await extractRdpDefinition(\n mockClientCtx,\n nestedObjectSet,\n );\n\n expect(result).toMatchInlineSnapshot(`\n {\n \"myRdp\": {\n \"definition\": {\n \"objectSet\": {\n \"link\": \"testLink2\",\n \"objectSet\": {\n \"type\": \"methodInput\",\n },\n \"type\": \"searchAround\",\n },\n \"operation\": {\n \"selectedPropertyApiName\": \"testProperty\",\n \"type\": \"get\",\n },\n \"type\": \"selection\",\n },\n \"selectedOrCollectedPropertyType\": {\n \"type\": \"attachment\",\n },\n },\n \"rdp1\": {\n \"definition\": {\n \"objectSet\": {\n \"link\": \"testLink2\",\n \"objectSet\": {\n \"type\": \"methodInput\",\n },\n \"type\": \"searchAround\",\n },\n \"operation\": {\n \"limit\": 100,\n \"selectedPropertyApiName\": \"testProperty\",\n \"type\": \"collectList\",\n },\n \"type\": \"selection\",\n },\n \"selectedOrCollectedPropertyType\": {\n \"type\": \"attachment\",\n },\n },\n \"rdp2\": {\n \"definition\": {\n \"objectSet\": {\n \"link\": \"testLink2\",\n \"objectSet\": {\n \"type\": \"methodInput\",\n },\n \"type\": \"searchAround\",\n },\n \"operation\": {\n \"limit\": 100,\n \"selectedPropertyApiName\": \"testProperty\",\n \"type\": \"collectSet\",\n },\n \"type\": \"selection\",\n },\n \"selectedOrCollectedPropertyType\": {\n \"type\": \"attachment\",\n },\n },\n }\n `);\n });\n\n it(\"handles `intersection` object set type and nested static and reference object sets\", async () => {\n const intersectionObjectSet: ObjectSet = {\n type: \"intersect\",\n objectSets: [\n {\n type: \"searchAround\",\n objectSet: { type: \"base\", objectType: \"BaseType\" },\n link: \"testLink1\",\n },\n { type: \"static\", \"objects\": [\"object1\", \"object2\"] },\n { type: \"reference\", \"reference\": \"rid.os.1234\" },\n ],\n };\n\n const RdpWithIntersectionBaseObjectSet: ObjectSet = {\n type: \"withProperties\",\n objectSet: intersectionObjectSet,\n derivedProperties: {\n myRdp: {\n type: \"selection\",\n objectSet: {\n type: \"searchAround\",\n objectSet: { type: \"methodInput\" },\n link: \"testLink2\",\n },\n operation: {\n type: \"get\",\n selectedPropertyApiName: \"testProperty\",\n },\n },\n },\n };\n\n const result = await extractRdpDefinition(\n mockClientCtx,\n RdpWithIntersectionBaseObjectSet,\n );\n\n expect(result).toMatchInlineSnapshot(\n `\n {\n \"myRdp\": {\n \"definition\": {\n \"objectSet\": {\n \"link\": \"testLink2\",\n \"objectSet\": {\n \"type\": \"methodInput\",\n },\n \"type\": \"searchAround\",\n },\n \"operation\": {\n \"selectedPropertyApiName\": \"testProperty\",\n \"type\": \"get\",\n },\n \"type\": \"selection\",\n },\n \"selectedOrCollectedPropertyType\": {\n \"type\": \"attachment\",\n },\n },\n }\n `,\n );\n });\n\n it(\"throws with intersect, subtract, or union having nested RDPs\", async () => {\n const intersectionObjectSetWithNestedRdps: ObjectSet = {\n type: \"intersect\",\n objectSets: [objectSetWithRdps, {\n type: \"base\",\n objectType: \"ThirdType\",\n }],\n };\n\n await expect(\n extractRdpDefinition(mockClientCtx, intersectionObjectSetWithNestedRdps),\n ).rejects.toThrowErrorMatchingInlineSnapshot(\n `[Error: Invariant failed: Object sets combined using intersect, subtract, or union must not contain any derived property definitions]`,\n );\n });\n\n it(\"throes with intersect, subtract, or union having different child object types\", async () => {\n const intersectionObjectSet: ObjectSet = {\n type: \"intersect\",\n objectSets: [\n {\n type: \"searchAround\",\n objectSet: { type: \"base\", objectType: \"BaseType\" },\n link: \"testLink1\",\n },\n { type: \"base\", objectType: \"BaseType\" },\n ],\n };\n\n const RdpWithIntersectionBaseObjectSet: ObjectSet = {\n type: \"withProperties\",\n objectSet: intersectionObjectSet,\n derivedProperties: {\n myRdp: {\n type: \"selection\",\n objectSet: {\n type: \"searchAround\",\n objectSet: { type: \"methodInput\" },\n link: \"testLink2\",\n },\n operation: {\n type: \"get\",\n selectedPropertyApiName: \"testProperty\",\n },\n },\n },\n };\n\n await expect(\n extractRdpDefinition(mockClientCtx, RdpWithIntersectionBaseObjectSet),\n ).rejects.toThrowErrorMatchingInlineSnapshot(\n `[Error: Invariant failed: All object sets in an intersect, subtract, or union must have the same child object type]`,\n );\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAE7C,SAASC,oBAAoB,QAAQ,2BAA2B;AAEhEH,QAAQ,CAAC,sBAAsB,EAAE,MAAM;EACrC,MAAMI,aAAa,GAAG;IACpBC,gBAAgB,EAAE;MAChBC,mBAAmB,EAAGC,UAAkB,IAAK;QAC3C,IAAIA,UAAU,KAAK,UAAU,EAAE;UAC7B,OAAO;YACLC,KAAK,EAAE;cACLC,SAAS,EAAE;gBACTC,UAAU,EAAE,YAAY;gBACxB,cAAc,EAAE;cAClB;YACF;UACF,CAAC;QACH,CAAC,MAAM,IAAIH,UAAU,KAAK,YAAY,EAAE;UACtC,OAAO;YACLC,KAAK,EAAE;cACLG,SAAS,EAAE;gBACTD,UAAU,EAAE,WAAW;gBACvB,cAAc,EAAE;cAClB;YACF;UACF,CAAC;QACH,CAAC,MAAM,IAAIH,UAAU,KAAK,WAAW,EAAE;UACrC,OAAO;YACLK,UAAU,EAAE;cACVC,YAAY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;UAAEP,UAAU,EAAE;QAAW,CAAC;MAE5C,CAIkC;MAChCY,iBAAiB,EAAE;QACjBC,KAAK,EAAE;UACLN,IAAI,EAAE,WAAW;UACjBG,SAAS,EAAE;YACTH,IAAI,EAAE,cAAc;YACpBG,SAAS,EAAE;cAAEH,IAAI,EAAE;YAAc,CAAC;YAClCI,IAAI,EAAE;UACR,CAAC;UACDG,SAAS,EAAE;YACTP,IAAI,EAAE,KAAK;YACXQ,uBAAuB,EAAE;UAC3B;QACF;MACF;IACF,CAGsE,CACtE,CAAC,CAACO,OAAO,CAACC,kCAAkC,CAC1C,qHACF,CAAC;EACH,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkHDAQ6JIR_cjs = require('./chunk-HDAQ6JIR.cjs');
|
|
4
4
|
var shared_net_errors = require('@osdk/shared.net.errors');
|
|
5
5
|
var invariant5 = require('tiny-invariant');
|
|
6
6
|
var api = require('@osdk/api');
|
|
@@ -13,16 +13,16 @@ var WebSocket__default = /*#__PURE__*/_interopDefault(WebSocket);
|
|
|
13
13
|
|
|
14
14
|
// src/public-utils/hydrateAttachmentFromRid.ts
|
|
15
15
|
function hydrateAttachmentFromRid(client, rid) {
|
|
16
|
-
return hydrateAttachmentFromRidInternal(client[
|
|
16
|
+
return hydrateAttachmentFromRidInternal(client[chunkHDAQ6JIR_cjs.additionalContext], rid);
|
|
17
17
|
}
|
|
18
18
|
function hydrateAttachmentFromRidInternal(client, rid) {
|
|
19
19
|
return {
|
|
20
20
|
rid,
|
|
21
21
|
async fetchContents() {
|
|
22
|
-
return
|
|
22
|
+
return chunkHDAQ6JIR_cjs.Attachment_exports.read(client, rid);
|
|
23
23
|
},
|
|
24
24
|
async fetchMetadata() {
|
|
25
|
-
const r = await
|
|
25
|
+
const r = await chunkHDAQ6JIR_cjs.Attachment_exports.get(client, rid);
|
|
26
26
|
return {
|
|
27
27
|
...r,
|
|
28
28
|
sizeBytes: Number(r.sizeBytes)
|
|
@@ -98,7 +98,7 @@ var MinimalLogger = class _MinimalLogger extends BaseLogger {
|
|
|
98
98
|
}
|
|
99
99
|
};
|
|
100
100
|
async function fetchSingle(client, objectType, args, objectSet) {
|
|
101
|
-
const result = await
|
|
101
|
+
const result = await chunkHDAQ6JIR_cjs.fetchPage(client, objectType, {
|
|
102
102
|
...args,
|
|
103
103
|
$pageSize: 1
|
|
104
104
|
}, objectSet);
|
|
@@ -468,15 +468,15 @@ function convertRange(range) {
|
|
|
468
468
|
}
|
|
469
469
|
|
|
470
470
|
// src/object/aggregate.ts
|
|
471
|
-
async function aggregate(clientCtx, objectType, objectSet =
|
|
472
|
-
|
|
471
|
+
async function aggregate(clientCtx, objectType, objectSet = chunkHDAQ6JIR_cjs.resolveBaseObjectSetType(objectType), req) {
|
|
472
|
+
chunkHDAQ6JIR_cjs.resolveBaseObjectSetType(objectType);
|
|
473
473
|
const body = {
|
|
474
474
|
aggregation: modernToLegacyAggregationClause(req.$select),
|
|
475
475
|
groupBy: []};
|
|
476
476
|
if (req.$groupBy) {
|
|
477
477
|
body.groupBy = modernToLegacyGroupByClause(req.$groupBy);
|
|
478
478
|
}
|
|
479
|
-
const result = await
|
|
479
|
+
const result = await chunkHDAQ6JIR_cjs.OntologyObjectSet_exports.aggregate(chunkHDAQ6JIR_cjs.addUserAgentAndRequestContextHeaders(clientCtx, objectType), await clientCtx.ontologyRid, {
|
|
480
480
|
objectSet,
|
|
481
481
|
groupBy: body.groupBy,
|
|
482
482
|
aggregation: body.aggregation
|
|
@@ -955,15 +955,15 @@ function getWireObjectSet(objectSet) {
|
|
|
955
955
|
return objectSetDefinitions.get(objectSet);
|
|
956
956
|
}
|
|
957
957
|
var objectSetDefinitions = /* @__PURE__ */ new WeakMap();
|
|
958
|
-
function createObjectSet(objectType, clientCtx, objectSet =
|
|
958
|
+
function createObjectSet(objectType, clientCtx, objectSet = chunkHDAQ6JIR_cjs.resolveBaseObjectSetType(objectType)) {
|
|
959
959
|
const base = {
|
|
960
960
|
aggregate: aggregate.bind(globalThis, augmentRequestContext(clientCtx, (_) => ({
|
|
961
961
|
finalMethodCall: "aggregate"
|
|
962
962
|
})), objectType, objectSet),
|
|
963
|
-
fetchPage:
|
|
963
|
+
fetchPage: chunkHDAQ6JIR_cjs.fetchPageInternal.bind(globalThis, augmentRequestContext(clientCtx, (_) => ({
|
|
964
964
|
finalMethodCall: "fetchPage"
|
|
965
965
|
})), objectType, objectSet),
|
|
966
|
-
fetchPageWithErrors:
|
|
966
|
+
fetchPageWithErrors: chunkHDAQ6JIR_cjs.fetchPageWithErrorsInternal.bind(globalThis, augmentRequestContext(clientCtx, (_) => ({
|
|
967
967
|
finalMethodCall: "fetchPageWithErrors"
|
|
968
968
|
})), objectType, objectSet),
|
|
969
969
|
where: (clause) => {
|
|
@@ -997,7 +997,7 @@ function createObjectSet(objectType, clientCtx, objectSet = chunkW5PFESFR_cjs.re
|
|
|
997
997
|
asyncIter: async function* (args) {
|
|
998
998
|
let $nextPageToken = void 0;
|
|
999
999
|
do {
|
|
1000
|
-
const result = await
|
|
1000
|
+
const result = await chunkHDAQ6JIR_cjs.fetchPageInternal(augmentRequestContext(clientCtx, (_) => ({
|
|
1001
1001
|
finalMethodCall: "asyncIter"
|
|
1002
1002
|
})), objectType, objectSet, {
|
|
1003
1003
|
...args,
|
|
@@ -1083,5 +1083,5 @@ exports.hydrateAttachmentFromRid = hydrateAttachmentFromRid;
|
|
|
1083
1083
|
exports.hydrateAttachmentFromRidInternal = hydrateAttachmentFromRidInternal;
|
|
1084
1084
|
exports.isObjectSet = isObjectSet;
|
|
1085
1085
|
exports.isWireObjectSet = isWireObjectSet;
|
|
1086
|
-
//# sourceMappingURL=chunk-
|
|
1087
|
-
//# sourceMappingURL=chunk-
|
|
1086
|
+
//# sourceMappingURL=chunk-5JZGGCIW.cjs.map
|
|
1087
|
+
//# sourceMappingURL=chunk-5JZGGCIW.cjs.map
|