@osdk/client 2.1.0-beta.21 → 2.1.0-beta.23
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 +37 -0
- package/build/browser/Client.d.ts.map +1 -1
- package/build/browser/__unstable/ConjureSupport.d.ts +18 -35
- package/build/browser/__unstable/ConjureSupport.d.ts.map +1 -1
- package/build/browser/__unstable/ConjureSupport.js +4 -1
- package/build/browser/__unstable/ConjureSupport.js.map +1 -1
- package/build/browser/actions/actions.test.js +20 -4
- package/build/browser/actions/actions.test.js.map +1 -1
- package/build/browser/actions/applyAction.d.ts +1 -1
- package/build/browser/actions/applyAction.d.ts.map +1 -1
- package/build/browser/createClient.d.ts.map +1 -1
- package/build/browser/createClient.js +2 -0
- package/build/browser/createClient.js.map +1 -1
- package/build/browser/createClient.test.js +1 -1
- package/build/browser/createClient.test.js.map +1 -1
- package/build/browser/createGeotimeSeriesProperty.d.ts.map +1 -1
- package/build/browser/createGeotimeSeriesProperty.js +3 -1
- package/build/browser/createGeotimeSeriesProperty.js.map +1 -1
- package/build/browser/createMediaReferenceProperty.d.ts +14 -0
- package/build/browser/createMediaReferenceProperty.d.ts.map +1 -0
- package/build/browser/createMediaReferenceProperty.js +46 -0
- package/build/browser/createMediaReferenceProperty.js.map +1 -0
- package/build/browser/createTimeseriesProperty.d.ts.map +1 -1
- package/build/browser/intellisense.test.helpers/callsQueryAcceptsObject.js +1 -1
- package/build/browser/intellisense.test.helpers/callsQueryAcceptsObject.js.map +1 -1
- package/build/browser/intellisense.test.js +1 -1
- package/build/browser/intellisense.test.js.map +1 -1
- package/build/browser/object/Cache.test.js +1 -1
- package/build/browser/object/Cache.test.js.map +1 -1
- package/build/browser/object/aggregate.test.js +1 -1
- package/build/browser/object/aggregate.test.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.d.ts +17 -1
- package/build/browser/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.d.ts.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.js +2 -1
- package/build/browser/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.js +10 -1
- package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/getDollarAs.d.ts.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/getDollarAs.js +1 -1
- package/build/browser/object/convertWireToOsdkObjects/getDollarAs.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects.test.js +18 -0
- package/build/browser/object/convertWireToOsdkObjects.test.js.map +1 -1
- package/build/browser/object/media.test.d.ts +2 -0
- package/build/browser/object/media.test.d.ts.map +1 -0
- package/build/browser/object/media.test.js +54 -0
- package/build/browser/object/media.test.js.map +1 -0
- package/build/browser/objectSet/ObjectSetListenerWebsocket.js +9 -7
- package/build/browser/objectSet/ObjectSetListenerWebsocket.js.map +1 -1
- package/build/browser/ontology/OntologyProvider.d.ts.map +1 -1
- package/build/browser/pageRequestAsAsyncIter.d.ts.map +1 -1
- package/build/browser/public-utils/createAndFetchTempObjectSetRid.d.ts +2 -2
- package/build/browser/public-utils/createAndFetchTempObjectSetRid.d.ts.map +1 -1
- package/build/browser/public-utils/createAndFetchTempObjectSetRid.js +1 -1
- package/build/browser/public-utils/createAndFetchTempObjectSetRid.js.map +1 -1
- package/build/browser/public-utils/hydrateAttachmentFromRid.d.ts +1 -1
- package/build/browser/public-utils/hydrateAttachmentFromRid.js +1 -1
- package/build/browser/public-utils/hydrateAttachmentFromRid.js.map +1 -1
- package/build/browser/public-utils/hydrateObjectSetFromRid.d.ts +7 -7
- package/build/browser/public-utils/hydrateObjectSetFromRid.d.ts.map +1 -1
- package/build/browser/public-utils/hydrateObjectSetFromRid.js +5 -5
- package/build/browser/public-utils/hydrateObjectSetFromRid.js.map +1 -1
- package/build/browser/tsserver.d.ts +6 -8
- package/build/browser/tsserver.d.ts.map +1 -1
- package/build/browser/tsserver.js.map +1 -1
- package/build/browser/util/UserAgent.d.ts.map +1 -1
- package/build/browser/util/UserAgent.js +1 -1
- package/build/browser/util/datetimeConverters.d.ts.map +1 -1
- package/build/browser/util/streamutils.d.ts.map +1 -1
- package/build/browser/util/timeseriesUtils.d.ts.map +1 -1
- package/build/esm/Client.d.ts.map +1 -1
- package/build/esm/__unstable/ConjureSupport.d.ts +18 -35
- package/build/esm/__unstable/ConjureSupport.d.ts.map +1 -1
- package/build/esm/__unstable/ConjureSupport.js +4 -1
- package/build/esm/__unstable/ConjureSupport.js.map +1 -1
- package/build/esm/actions/actions.test.js +20 -4
- package/build/esm/actions/actions.test.js.map +1 -1
- package/build/esm/actions/applyAction.d.ts +1 -1
- package/build/esm/actions/applyAction.d.ts.map +1 -1
- package/build/esm/createClient.d.ts.map +1 -1
- package/build/esm/createClient.js +2 -0
- package/build/esm/createClient.js.map +1 -1
- package/build/esm/createClient.test.js +1 -1
- package/build/esm/createClient.test.js.map +1 -1
- package/build/esm/createGeotimeSeriesProperty.d.ts.map +1 -1
- package/build/esm/createGeotimeSeriesProperty.js +3 -1
- package/build/esm/createGeotimeSeriesProperty.js.map +1 -1
- package/build/esm/createMediaReferenceProperty.d.ts +14 -0
- package/build/esm/createMediaReferenceProperty.d.ts.map +1 -0
- package/build/esm/createMediaReferenceProperty.js +46 -0
- package/build/esm/createMediaReferenceProperty.js.map +1 -0
- package/build/esm/createTimeseriesProperty.d.ts.map +1 -1
- package/build/esm/intellisense.test.helpers/callsQueryAcceptsObject.js +1 -1
- package/build/esm/intellisense.test.helpers/callsQueryAcceptsObject.js.map +1 -1
- package/build/esm/intellisense.test.js +1 -1
- package/build/esm/intellisense.test.js.map +1 -1
- package/build/esm/object/Cache.test.js +1 -1
- package/build/esm/object/Cache.test.js.map +1 -1
- package/build/esm/object/aggregate.test.js +1 -1
- package/build/esm/object/aggregate.test.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.d.ts +17 -1
- package/build/esm/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.d.ts.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.js +2 -1
- package/build/esm/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/createOsdkObject.js +10 -1
- package/build/esm/object/convertWireToOsdkObjects/createOsdkObject.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/getDollarAs.d.ts.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/getDollarAs.js +1 -1
- package/build/esm/object/convertWireToOsdkObjects/getDollarAs.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects.test.js +18 -0
- package/build/esm/object/convertWireToOsdkObjects.test.js.map +1 -1
- package/build/esm/object/media.test.d.ts +2 -0
- package/build/esm/object/media.test.d.ts.map +1 -0
- package/build/esm/object/media.test.js +54 -0
- package/build/esm/object/media.test.js.map +1 -0
- package/build/esm/objectSet/ObjectSetListenerWebsocket.js +9 -7
- package/build/esm/objectSet/ObjectSetListenerWebsocket.js.map +1 -1
- package/build/esm/ontology/OntologyProvider.d.ts.map +1 -1
- package/build/esm/pageRequestAsAsyncIter.d.ts.map +1 -1
- package/build/esm/public-utils/createAndFetchTempObjectSetRid.d.ts +2 -2
- package/build/esm/public-utils/createAndFetchTempObjectSetRid.d.ts.map +1 -1
- package/build/esm/public-utils/createAndFetchTempObjectSetRid.js +1 -1
- package/build/esm/public-utils/createAndFetchTempObjectSetRid.js.map +1 -1
- package/build/esm/public-utils/hydrateAttachmentFromRid.d.ts +1 -1
- package/build/esm/public-utils/hydrateAttachmentFromRid.js +1 -1
- package/build/esm/public-utils/hydrateAttachmentFromRid.js.map +1 -1
- package/build/esm/public-utils/hydrateObjectSetFromRid.d.ts +7 -7
- package/build/esm/public-utils/hydrateObjectSetFromRid.d.ts.map +1 -1
- package/build/esm/public-utils/hydrateObjectSetFromRid.js +5 -5
- package/build/esm/public-utils/hydrateObjectSetFromRid.js.map +1 -1
- package/build/esm/tsserver.d.ts +6 -8
- package/build/esm/tsserver.d.ts.map +1 -1
- package/build/esm/tsserver.js.map +1 -1
- package/build/esm/util/UserAgent.d.ts.map +1 -1
- package/build/esm/util/UserAgent.js +1 -1
- package/build/esm/util/datetimeConverters.d.ts.map +1 -1
- package/build/esm/util/streamutils.d.ts.map +1 -1
- package/build/esm/util/timeseriesUtils.d.ts.map +1 -1
- package/package.json +13 -13
- package/build/browser/objectSet/toConjureObjectSet.d.ts +0 -2
- package/build/browser/objectSet/toConjureObjectSet.d.ts.map +0 -1
- package/build/browser/objectSet/toConjureObjectSet.js +0 -167
- package/build/browser/objectSet/toConjureObjectSet.js.map +0 -1
- package/build/esm/objectSet/toConjureObjectSet.d.ts +0 -2
- package/build/esm/objectSet/toConjureObjectSet.d.ts.map +0 -1
- package/build/esm/objectSet/toConjureObjectSet.js +0 -167
- package/build/esm/objectSet/toConjureObjectSet.js.map +0 -1
|
@@ -21,7 +21,7 @@ import { getWireObjectSet } from "../objectSet/createObjectSet.js";
|
|
|
21
21
|
*
|
|
22
22
|
* @param client - An OSDK client.
|
|
23
23
|
* @param objectSet - The object set to fetch a RID for.
|
|
24
|
-
* @returns
|
|
24
|
+
* @returns A promise that resolves to the RID of the temporary object set.
|
|
25
25
|
*/
|
|
26
26
|
export async function createAndFetchTempObjectSetRid(client, objectSet) {
|
|
27
27
|
const response = await OntologyObjectSets.createTemporary(client, await client[additionalContext].ontologyRid, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAndFetchTempObjectSetRid.js","names":["OntologyObjectSets","additionalContext","getWireObjectSet","createAndFetchTempObjectSetRid","client","objectSet","response","createTemporary","ontologyRid","objectSetRid"],"sources":["createAndFetchTempObjectSetRid.js"],"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 */\nimport { OntologyObjectSets } from \"@osdk/internal.foundry.ontologiesv2\";\nimport { additionalContext } from \"../Client.js\";\nimport { getWireObjectSet } from \"../objectSet/createObjectSet.js\";\n/**\n * Fetches a temporary object set RID from the Foundry stack for the given object set.\n *\n * @param client - An OSDK client.\n * @param objectSet - The object set to fetch a RID for.\n * @returns
|
|
1
|
+
{"version":3,"file":"createAndFetchTempObjectSetRid.js","names":["OntologyObjectSets","additionalContext","getWireObjectSet","createAndFetchTempObjectSetRid","client","objectSet","response","createTemporary","ontologyRid","objectSetRid"],"sources":["createAndFetchTempObjectSetRid.js"],"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 */\nimport { OntologyObjectSets } from \"@osdk/internal.foundry.ontologiesv2\";\nimport { additionalContext } from \"../Client.js\";\nimport { getWireObjectSet } from \"../objectSet/createObjectSet.js\";\n/**\n * Fetches a temporary object set RID from the Foundry stack for the given object set.\n *\n * @param client - An OSDK client.\n * @param objectSet - The object set to fetch a RID for.\n * @returns A promise that resolves to the RID of the temporary object set.\n */\nexport async function createAndFetchTempObjectSetRid(client, objectSet) {\n const response = await OntologyObjectSets.createTemporary(client, await client[additionalContext].ontologyRid, {\n objectSet: getWireObjectSet(objectSet),\n });\n return response.objectSetRid;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,kBAAkB,QAAQ,qCAAqC;AACxE,SAASC,iBAAiB,QAAQ,cAAc;AAChD,SAASC,gBAAgB,QAAQ,iCAAiC;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,8BAA8BA,CAACC,MAAM,EAAEC,SAAS,EAAE;EACpE,MAAMC,QAAQ,GAAG,MAAMN,kBAAkB,CAACO,eAAe,CAACH,MAAM,EAAE,MAAMA,MAAM,CAACH,iBAAiB,CAAC,CAACO,WAAW,EAAE;IAC3GH,SAAS,EAAEH,gBAAgB,CAACG,SAAS;EACzC,CAAC,CAAC;EACF,OAAOC,QAAQ,CAACG,YAAY;AAChC","ignoreList":[]}
|
|
@@ -4,7 +4,7 @@ import { type Client } from "../Client.js";
|
|
|
4
4
|
* Helper function to create an attachment type from a rid
|
|
5
5
|
* @param client - An OSDK client.
|
|
6
6
|
* @param rid - The rid of attachment in Foundry.
|
|
7
|
-
* @returns
|
|
7
|
+
* @returns An OSDK attachment object
|
|
8
8
|
*/
|
|
9
9
|
export declare function hydrateAttachmentFromRid(client: Client, rid: string): Attachment;
|
|
10
10
|
//# sourceMappingURL=hydrateAttachmentFromRid.d.ts.map
|
|
@@ -19,7 +19,7 @@ import { additionalContext } from "../Client.js";
|
|
|
19
19
|
* Helper function to create an attachment type from a rid
|
|
20
20
|
* @param client - An OSDK client.
|
|
21
21
|
* @param rid - The rid of attachment in Foundry.
|
|
22
|
-
* @returns
|
|
22
|
+
* @returns An OSDK attachment object
|
|
23
23
|
*/
|
|
24
24
|
export function hydrateAttachmentFromRid(client, rid) {
|
|
25
25
|
return hydrateAttachmentFromRidInternal(client[additionalContext], rid);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hydrateAttachmentFromRid.js","names":["OntologiesV2","additionalContext","hydrateAttachmentFromRid","client","rid","hydrateAttachmentFromRidInternal","fetchContents","Attachments","read","fetchMetadata","r","get","sizeBytes","Number"],"sources":["hydrateAttachmentFromRid.js"],"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 */\nimport * as OntologiesV2 from \"@osdk/internal.foundry.ontologiesv2\";\nimport { additionalContext } from \"../Client.js\";\n/**\n * Helper function to create an attachment type from a rid\n * @param client - An OSDK client.\n * @param rid - The rid of attachment in Foundry.\n * @returns\n */\nexport function hydrateAttachmentFromRid(client, rid) {\n return hydrateAttachmentFromRidInternal(client[additionalContext], rid);\n}\n/** @internal */\nexport function hydrateAttachmentFromRidInternal(client, rid) {\n return {\n rid,\n async fetchContents() {\n return OntologiesV2.Attachments.read(client, rid);\n },\n async fetchMetadata() {\n const r = await OntologiesV2.Attachments.get(client, rid);\n return {\n ...r,\n sizeBytes: Number(r.sizeBytes),\n };\n },\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,KAAKA,YAAY,MAAM,qCAAqC;AACnE,SAASC,iBAAiB,QAAQ,cAAc;AAChD;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,wBAAwBA,CAACC,MAAM,EAAEC,GAAG,EAAE;EAClD,OAAOC,gCAAgC,CAACF,MAAM,CAACF,iBAAiB,CAAC,EAAEG,GAAG,CAAC;AAC3E;AACA;AACA,OAAO,SAASC,gCAAgCA,CAACF,MAAM,EAAEC,GAAG,EAAE;EAC1D,OAAO;IACHA,GAAG;IACH,MAAME,aAAaA,CAAA,EAAG;MAClB,OAAON,YAAY,CAACO,WAAW,CAACC,IAAI,CAACL,MAAM,EAAEC,GAAG,CAAC;IACrD,CAAC;IACD,MAAMK,aAAaA,CAAA,EAAG;MAClB,MAAMC,CAAC,GAAG,MAAMV,YAAY,CAACO,WAAW,CAACI,GAAG,CAACR,MAAM,EAAEC,GAAG,CAAC;MACzD,OAAO;QACH,GAAGM,CAAC;QACJE,SAAS,EAAEC,MAAM,CAACH,CAAC,CAACE,SAAS;MACjC,CAAC;IACL;EACJ,CAAC;AACL","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"hydrateAttachmentFromRid.js","names":["OntologiesV2","additionalContext","hydrateAttachmentFromRid","client","rid","hydrateAttachmentFromRidInternal","fetchContents","Attachments","read","fetchMetadata","r","get","sizeBytes","Number"],"sources":["hydrateAttachmentFromRid.js"],"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 */\nimport * as OntologiesV2 from \"@osdk/internal.foundry.ontologiesv2\";\nimport { additionalContext } from \"../Client.js\";\n/**\n * Helper function to create an attachment type from a rid\n * @param client - An OSDK client.\n * @param rid - The rid of attachment in Foundry.\n * @returns An OSDK attachment object\n */\nexport function hydrateAttachmentFromRid(client, rid) {\n return hydrateAttachmentFromRidInternal(client[additionalContext], rid);\n}\n/** @internal */\nexport function hydrateAttachmentFromRidInternal(client, rid) {\n return {\n rid,\n async fetchContents() {\n return OntologiesV2.Attachments.read(client, rid);\n },\n async fetchMetadata() {\n const r = await OntologiesV2.Attachments.get(client, rid);\n return {\n ...r,\n sizeBytes: Number(r.sizeBytes),\n };\n },\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,KAAKA,YAAY,MAAM,qCAAqC;AACnE,SAASC,iBAAiB,QAAQ,cAAc;AAChD;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,wBAAwBA,CAACC,MAAM,EAAEC,GAAG,EAAE;EAClD,OAAOC,gCAAgC,CAACF,MAAM,CAACF,iBAAiB,CAAC,EAAEG,GAAG,CAAC;AAC3E;AACA;AACA,OAAO,SAASC,gCAAgCA,CAACF,MAAM,EAAEC,GAAG,EAAE;EAC1D,OAAO;IACHA,GAAG;IACH,MAAME,aAAaA,CAAA,EAAG;MAClB,OAAON,YAAY,CAACO,WAAW,CAACC,IAAI,CAACL,MAAM,EAAEC,GAAG,CAAC;IACrD,CAAC;IACD,MAAMK,aAAaA,CAAA,EAAG;MAClB,MAAMC,CAAC,GAAG,MAAMV,YAAY,CAACO,WAAW,CAACI,GAAG,CAACR,MAAM,EAAEC,GAAG,CAAC;MACzD,OAAO;QACH,GAAGM,CAAC;QACJE,SAAS,EAAEC,MAAM,CAACH,CAAC,CAACE,SAAS;MACjC,CAAC;IACL;EACJ,CAAC;AACL","ignoreList":[]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { ObjectOrInterfaceDefinition } from "@osdk/api";
|
|
1
|
+
import type { ObjectOrInterfaceDefinition, ObjectSet } from "@osdk/api";
|
|
2
2
|
import type { Client } from "../Client.js";
|
|
3
3
|
/**
|
|
4
|
-
* Creates an OSDK object set from
|
|
5
|
-
* @param client An OSDK client.
|
|
6
|
-
* @param definition An OSDK object or interface definition.
|
|
7
|
-
* @param rid The RID of
|
|
8
|
-
* @returns
|
|
4
|
+
* Creates an OSDK object set from an object set RID.
|
|
5
|
+
* @param client - An OSDK client.
|
|
6
|
+
* @param definition - An OSDK object or interface definition.
|
|
7
|
+
* @param rid - The RID of an object set.
|
|
8
|
+
* @returns An OSDK object set.
|
|
9
9
|
*/
|
|
10
|
-
export declare function hydrateObjectSetFromRid<T extends ObjectOrInterfaceDefinition>(client: Client, definition: T, rid: string):
|
|
10
|
+
export declare function hydrateObjectSetFromRid<T extends ObjectOrInterfaceDefinition>(client: Client, definition: T, rid: string): ObjectSet<T>;
|
|
11
11
|
//# sourceMappingURL=hydrateObjectSetFromRid.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hydrateObjectSetFromRid.d.ts","sourceRoot":"","sources":["../../../src/public-utils/hydrateObjectSetFromRid.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"hydrateObjectSetFromRid.d.ts","sourceRoot":"","sources":["../../../src/public-utils/hydrateObjectSetFromRid.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,2BAA2B,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACxE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAI3C;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,SAAS,2BAA2B,EAC3E,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,CAAC,EACb,GAAG,EAAE,MAAM,GACV,SAAS,CAAC,CAAC,CAAC,CAkBd"}
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
import { additionalContext } from "../Client.js";
|
|
17
17
|
import { createObjectSet } from "../objectSet/createObjectSet.js";
|
|
18
18
|
/**
|
|
19
|
-
* Creates an OSDK object set from
|
|
20
|
-
* @param client An OSDK client.
|
|
21
|
-
* @param definition An OSDK object or interface definition.
|
|
22
|
-
* @param rid The RID of
|
|
23
|
-
* @returns
|
|
19
|
+
* Creates an OSDK object set from an object set RID.
|
|
20
|
+
* @param client - An OSDK client.
|
|
21
|
+
* @param definition - An OSDK object or interface definition.
|
|
22
|
+
* @param rid - The RID of an object set.
|
|
23
|
+
* @returns An OSDK object set.
|
|
24
24
|
*/
|
|
25
25
|
export function hydrateObjectSetFromRid(client, definition, rid) {
|
|
26
26
|
return createObjectSet(definition, client[additionalContext], {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hydrateObjectSetFromRid.js","names":["additionalContext","createObjectSet","hydrateObjectSetFromRid","client","definition","rid","type","objectSets","objectType","apiName","reference"],"sources":["hydrateObjectSetFromRid.js"],"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 */\nimport { additionalContext } from \"../Client.js\";\nimport { createObjectSet } from \"../objectSet/createObjectSet.js\";\n/**\n * Creates an OSDK object set from
|
|
1
|
+
{"version":3,"file":"hydrateObjectSetFromRid.js","names":["additionalContext","createObjectSet","hydrateObjectSetFromRid","client","definition","rid","type","objectSets","objectType","apiName","reference"],"sources":["hydrateObjectSetFromRid.js"],"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 */\nimport { additionalContext } from \"../Client.js\";\nimport { createObjectSet } from \"../objectSet/createObjectSet.js\";\n/**\n * Creates an OSDK object set from an object set RID.\n * @param client - An OSDK client.\n * @param definition - An OSDK object or interface definition.\n * @param rid - The RID of an object set.\n * @returns An OSDK object set.\n */\nexport function hydrateObjectSetFromRid(client, definition, rid) {\n return createObjectSet(definition, client[additionalContext], {\n type: \"intersect\",\n objectSets: [\n {\n type: \"base\",\n objectType: definition.apiName,\n },\n {\n type: \"reference\",\n reference: rid,\n },\n ],\n });\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,iBAAiB,QAAQ,cAAc;AAChD,SAASC,eAAe,QAAQ,iCAAiC;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,uBAAuBA,CAACC,MAAM,EAAEC,UAAU,EAAEC,GAAG,EAAE;EAC7D,OAAOJ,eAAe,CAACG,UAAU,EAAED,MAAM,CAACH,iBAAiB,CAAC,EAAE;IAC1DM,IAAI,EAAE,WAAW;IACjBC,UAAU,EAAE,CACR;MACID,IAAI,EAAE,MAAM;MACZE,UAAU,EAAEJ,UAAU,CAACK;IAC3B,CAAC,EACD;MACIH,IAAI,EAAE,WAAW;MACjBI,SAAS,EAAEL;IACf,CAAC;EAET,CAAC,CAAC;AACN","ignoreList":[]}
|
|
@@ -2,6 +2,10 @@ import type { Subprocess } from "execa";
|
|
|
2
2
|
import { EventEmitter } from "node:events";
|
|
3
3
|
import { server as s } from "typescript";
|
|
4
4
|
import type { Logger } from "./Logger.js";
|
|
5
|
+
type RequestFn<T extends s.protocol.Request, X extends s.protocol.Response = never> = (args: T["arguments"]) => Promise<{
|
|
6
|
+
req: T;
|
|
7
|
+
resp: X;
|
|
8
|
+
}>;
|
|
5
9
|
declare class TsServerImpl extends EventEmitter<{
|
|
6
10
|
exit: [];
|
|
7
11
|
}> {
|
|
@@ -14,14 +18,8 @@ declare class TsServerImpl extends EventEmitter<{
|
|
|
14
18
|
start(): Promise<this>;
|
|
15
19
|
stop(): void;
|
|
16
20
|
getOneMessage<X>(filter?: (m: unknown) => m is X): Promise<X>;
|
|
17
|
-
sendOpenRequest:
|
|
18
|
-
|
|
19
|
-
resp: never;
|
|
20
|
-
}>;
|
|
21
|
-
sendQuickInfoRequest: (args: s.protocol.FileLocationRequestArgs) => Promise<{
|
|
22
|
-
req: s.protocol.QuickInfoRequest;
|
|
23
|
-
resp: s.protocol.QuickInfoResponse;
|
|
24
|
-
}>;
|
|
21
|
+
sendOpenRequest: RequestFn<s.protocol.OpenRequest>;
|
|
22
|
+
sendQuickInfoRequest: RequestFn<s.protocol.QuickInfoRequest, s.protocol.QuickInfoResponse>;
|
|
25
23
|
}
|
|
26
24
|
export type TsServer = Omit<TsServerImpl, Exclude<keyof EventEmitter, "on" | "addListener" | "off" | "once" | "removeListener" | "removeAllListeners">>;
|
|
27
25
|
export declare function startTsServer(logger: Logger): Promise<TsServer>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tsserver.d.ts","sourceRoot":"","sources":["../../src/tsserver.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGxC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAM3C,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,cAAM,YAAa,SAAQ,YAAY,CAAC;IACtC,IAAI,EAAE,EAAE,CAAC;CACV,CAAC;;gBAMY,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAMhD,IAAI,UAAU;
|
|
1
|
+
{"version":3,"file":"tsserver.d.ts","sourceRoot":"","sources":["../../src/tsserver.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGxC,OAAO,EAAE,YAAY,EAAE,MAAM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AsB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAKrE;AA4BD,wBAAgB,OAAO,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,CAGzD;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAG/D;AAED,wBAAgB,qBAAqB,CACnC,CAAC,EAAE,OAAO,GACT,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,wBAAwB,CAE1C;AACD,wBAAgB,mBAAmB,CACjC,CAAC,EAAE,OAAO,GACT,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,wBAAwB,CAE1C;AACD,wBAAgB,mBAAmB,CACjC,CAAC,EAAE,OAAO,EACV,UAAU,CAAC,EAAE,MAAM,GAClB,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,iBAAiB,CAInC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tsserver.js","names":["execaNode","findUpMultiple","EventEmitter","fs","path","pLocate","pMap","invariant","server","s","TsServerImpl","tsServerPath","nextSeq","subprocess","logger","constructor","start","ipc","serialization","isLevelEnabled","on","req","trace","info","emit","stop","connected","disconnect","getOneMessage","filter","requestFactory","#requestFactory","command","isResponse","args","makeRequest","sendOpenRequest","protocol","CommandTypes","Open","sendQuickInfoRequest","Quickinfo","isQuickInfoResponse","#makeRequest","seq","type","arguments","sendMessage","resp","undefined","startTsServer","getTsServerPath","process","env","NODE_ENV","nodeModuleDirs","cwd","import","meta","url","possibleTsServerPaths","dir","join","c","stat","isFile","e","isEvent","m","isProjectLoadingStart","event","isProjectLoadingEnd","requestSeq","request_seq"],"sources":["tsserver.js"],"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 */\nimport { execaNode } from \"execa\";\nimport { findUpMultiple } from \"find-up\";\nimport { EventEmitter } from \"node:events\";\nimport * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\nimport pLocate from \"p-locate\";\nimport pMap from \"p-map\";\nimport invariant from \"tiny-invariant\";\nimport { server as s } from \"typescript\";\nclass TsServerImpl extends EventEmitter {\n #tsServerPath;\n #nextSeq = 1;\n #subprocess;\n #logger;\n constructor(tsServerPath, logger) {\n super();\n this.#tsServerPath = tsServerPath;\n this.#logger = logger;\n }\n get subprocess() {\n return this.#subprocess;\n }\n async start() {\n this.#subprocess = execaNode({\n ipc: true,\n serialization: \"json\",\n }) `${this.#tsServerPath} --useNodeIpc`;\n if (this.#logger.isLevelEnabled(\"trace\")) {\n this.#subprocess.on(\"message\", (req) => {\n this.#logger.trace({ req }, \"message received\");\n });\n }\n this.#subprocess.on(\"exit\", () => {\n this.#logger.info(\"tsserver exited\");\n this.emit(\"exit\");\n });\n return this;\n }\n stop() {\n if (this.#subprocess?.connected) {\n this.#subprocess?.disconnect();\n }\n }\n async getOneMessage(filter) {\n return await this.subprocess.getOneMessage({ filter });\n }\n #requestFactory = (command, isResponse) => async (args) => {\n return await this.#makeRequest(command, args, isResponse);\n };\n sendOpenRequest = this.#requestFactory(s.protocol.CommandTypes.Open);\n sendQuickInfoRequest = this.#requestFactory(s.protocol.CommandTypes.Quickinfo, isQuickInfoResponse);\n async #makeRequest(command, args, isResponse) {\n const seq = this.#nextSeq++;\n const req = {\n type: \"request\",\n command,\n arguments: args,\n seq,\n };\n this.#logger.trace({ req }, \"requesting\");\n await this.#subprocess?.sendMessage(req);\n if (isResponse) {\n return {\n req,\n resp: await this.#subprocess?.getOneMessage({\n filter: isResponse,\n }),\n };\n }\n return { req, resp: undefined };\n }\n}\nexport async function startTsServer(logger) {\n const tsServerPath = await getTsServerPath();\n invariant(tsServerPath != null);\n return new TsServerImpl(tsServerPath, logger).start();\n}\nasync function getTsServerPath() {\n const nodeModuleDirs = await findUpMultiple(\"node_modules\", {\n cwd: import.meta.url,\n type: \"directory\",\n });\n const possibleTsServerPaths = await pMap(nodeModuleDirs, (dir) => path.join(dir, \"typescript\", \"lib\", \"tsserver.js\"));\n const tsServerPath = await pLocate([\"no\", ...possibleTsServerPaths], async (dir) => {\n try {\n const c = await fs.stat(dir);\n return c.isFile();\n }\n catch (e) {\n return false;\n }\n });\n return tsServerPath;\n}\nexport function isEvent(m) {\n return !!(m && typeof m === \"object\" && \"type\" in m\n && m.type === \"event\");\n}\nexport function isResponse(m) {\n return !!(m && typeof m === \"object\" && \"type\" in m\n && m.type === \"response\");\n}\nexport function isProjectLoadingStart(m) {\n return isEvent(m) && m.event === \"projectLoadingStart\";\n}\nexport function isProjectLoadingEnd(m) {\n return isEvent(m) && m.event === \"projectLoadingFinish\";\n}\nexport function isQuickInfoResponse(m, requestSeq) {\n return isResponse(m)
|
|
1
|
+
{"version":3,"file":"tsserver.js","names":["execaNode","findUpMultiple","EventEmitter","fs","path","pLocate","pMap","invariant","server","s","TsServerImpl","tsServerPath","nextSeq","subprocess","logger","constructor","start","ipc","serialization","isLevelEnabled","on","req","trace","info","emit","stop","connected","disconnect","getOneMessage","filter","requestFactory","#requestFactory","command","isResponse","args","makeRequest","sendOpenRequest","protocol","CommandTypes","Open","sendQuickInfoRequest","Quickinfo","isQuickInfoResponse","#makeRequest","seq","type","arguments","sendMessage","resp","undefined","startTsServer","getTsServerPath","process","env","NODE_ENV","nodeModuleDirs","cwd","import","meta","url","possibleTsServerPaths","dir","join","c","stat","isFile","e","isEvent","m","isProjectLoadingStart","event","isProjectLoadingEnd","requestSeq","request_seq"],"sources":["tsserver.js"],"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 */\nimport { execaNode } from \"execa\";\nimport { findUpMultiple } from \"find-up\";\nimport { EventEmitter } from \"node:events\";\nimport * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\nimport pLocate from \"p-locate\";\nimport pMap from \"p-map\";\nimport invariant from \"tiny-invariant\";\nimport { server as s } from \"typescript\";\nclass TsServerImpl extends EventEmitter {\n #tsServerPath;\n #nextSeq = 1;\n #subprocess;\n #logger;\n constructor(tsServerPath, logger) {\n super();\n this.#tsServerPath = tsServerPath;\n this.#logger = logger;\n }\n get subprocess() {\n return this.#subprocess;\n }\n async start() {\n this.#subprocess = execaNode({\n ipc: true,\n serialization: \"json\",\n }) `${this.#tsServerPath} --useNodeIpc`;\n if (this.#logger.isLevelEnabled(\"trace\")) {\n this.#subprocess.on(\"message\", (req) => {\n this.#logger.trace({ req }, \"message received\");\n });\n }\n this.#subprocess.on(\"exit\", () => {\n this.#logger.info(\"tsserver exited\");\n this.emit(\"exit\");\n });\n return this;\n }\n stop() {\n if (this.#subprocess?.connected) {\n this.#subprocess?.disconnect();\n }\n }\n async getOneMessage(filter) {\n return await this.subprocess.getOneMessage({ filter });\n }\n #requestFactory = (command, isResponse) => async (args) => {\n return await this.#makeRequest(command, args, isResponse);\n };\n sendOpenRequest = this.#requestFactory(s.protocol.CommandTypes.Open);\n sendQuickInfoRequest = this.#requestFactory(s.protocol.CommandTypes.Quickinfo, isQuickInfoResponse);\n async #makeRequest(command, args, isResponse) {\n const seq = this.#nextSeq++;\n const req = {\n type: \"request\",\n command,\n arguments: args,\n seq,\n };\n this.#logger.trace({ req }, \"requesting\");\n await this.#subprocess?.sendMessage(req);\n if (isResponse) {\n return {\n req,\n resp: await this.#subprocess?.getOneMessage({\n filter: isResponse,\n }),\n };\n }\n return { req, resp: undefined };\n }\n}\nexport async function startTsServer(logger) {\n const tsServerPath = await getTsServerPath();\n invariant(tsServerPath != null);\n return new TsServerImpl(tsServerPath, logger).start();\n}\nasync function getTsServerPath() {\n const nodeModuleDirs = await findUpMultiple(\"node_modules\", {\n cwd: import.meta.url,\n type: \"directory\",\n });\n const possibleTsServerPaths = await pMap(nodeModuleDirs, (dir) => path.join(dir, \"typescript\", \"lib\", \"tsserver.js\"));\n const tsServerPath = await pLocate([\"no\", ...possibleTsServerPaths], async (dir) => {\n try {\n const c = await fs.stat(dir);\n return c.isFile();\n }\n catch (e) {\n return false;\n }\n });\n return tsServerPath;\n}\nexport function isEvent(m) {\n return !!(m && typeof m === \"object\" && \"type\" in m\n && m.type === \"event\");\n}\nexport function isResponse(m) {\n return !!(m && typeof m === \"object\" && \"type\" in m\n && m.type === \"response\");\n}\nexport function isProjectLoadingStart(m) {\n return isEvent(m) && m.event === \"projectLoadingStart\";\n}\nexport function isProjectLoadingEnd(m) {\n return isEvent(m) && m.event === \"projectLoadingFinish\";\n}\nexport function isQuickInfoResponse(m, requestSeq) {\n return isResponse(m)\n && m.command === s.protocol.CommandTypes.Quickinfo\n && (requestSeq == null || m.request_seq === requestSeq);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,OAAO;AACjC,SAASC,cAAc,QAAQ,SAAS;AACxC,SAASC,YAAY,QAAQ,aAAa;AAC1C,OAAO,KAAKC,EAAE,MAAM,kBAAkB;AACtC,OAAO,KAAKC,IAAI,MAAM,WAAW;AACjC,OAAOC,OAAO,MAAM,UAAU;AAC9B,OAAOC,IAAI,MAAM,OAAO;AACxB,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C;AACjC;AACA,OAAO,SAASwB,qBAAqBA,CAACD,CAAC,EAAE;EACrC,OAAOD,OAAO,CAACC,CAAC,CAAC,IAAIA,CAAC,CAACE,KAAK,KAAK,qBAAqB;AAC1D;AACA,OAAO,SAASC,mBAAmBA,CAACH,CAAC,EAAE;EACnC,OAAOD,OAAO,CAACC,CAAC,CAAC,IAAIA,CAAC,CAACE,KAAK,KAAK,sBAAsB;AAC3D;AACA,OAAO,SAAS5B,mBAAmBA,CAAC0B,CAAC,EAAEI,UAAU,EAAE;EAC/C,OAAOvC,UAAU,CAACmC,CAAC,CAAC,IACbA,CAAC,CAACpC,OAAO,KAAKvB,CAAC,CAAC4B,QAAQ,CAACC,YAAY,CAACG,SAAS,KAC9C+B,UAAU,IAAI,IAAI,IAAIJ,CAAC,CAACK,WAAW,KAAKD,UAAU,CAAC;AAC/D","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserAgent.d.ts","sourceRoot":"","sources":["../../../src/util/UserAgent.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"UserAgent.d.ts","sourceRoot":"","sources":["../../../src/util/UserAgent.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,UAAU,EAAE,MAAqD,CAAC"}
|
|
@@ -13,5 +13,5 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
export const USER_AGENT = `osdk-client/${"2.1.0-beta.
|
|
16
|
+
export const USER_AGENT = `osdk-client/${"2.1.0-beta.23"}`;
|
|
17
17
|
//# sourceMappingURL=UserAgent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datetimeConverters.d.ts","sourceRoot":"","sources":["../../../src/util/datetimeConverters.ts"],"names":[],"mappings":"AAqBA;;;;;GAKG;AACH,eAAO,MAAM,WAAW,aAAc,MAAM,
|
|
1
|
+
{"version":3,"file":"datetimeConverters.d.ts","sourceRoot":"","sources":["../../../src/util/datetimeConverters.ts"],"names":[],"mappings":"AAqBA;;;;;GAKG;AACH,eAAO,MAAM,WAAW,aAAc,MAAM,KAAG,MAU9C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,SAAU,IAAI,KAAG,MAE7C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,SAAU,IAAI,KAAG,MAEnD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streamutils.d.ts","sourceRoot":"","sources":["../../../src/util/streamutils.ts"],"names":[],"mappings":"AAoBA,wBAAuB,qBAAqB,CAC1C,aAAa,EAAE,aAAa,CAAC,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"streamutils.d.ts","sourceRoot":"","sources":["../../../src/util/streamutils.ts"],"names":[],"mappings":"AAoBA,wBAAuB,qBAAqB,CAC1C,aAAa,EAAE,aAAa,CAAC,UAAU,CAAC,GACvC,cAAc,CAAC,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,CA8DpC;AA8BD,wBAAuB,qBAAqB,CAC1C,cAAc,EAAE,2BAA2B,CAAC,UAAU,CAAC,GACtD,cAAc,CAAC,UAAU,EAAE,IAAI,EAAE,OAAO,CAAC,CAM3C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeseriesUtils.d.ts","sourceRoot":"","sources":["../../../src/util/timeseriesUtils.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAG7D,wBAAgB,YAAY,CAAC,IAAI,EAAE,eAAe,GAAG,SAAS,CAyB7D;AAED,wBAAuB,qBAAqB,CAC1C,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,KAAK,EAEzC,QAAQ,EAAE,QAAQ
|
|
1
|
+
{"version":3,"file":"timeseriesUtils.d.ts","sourceRoot":"","sources":["../../../src/util/timeseriesUtils.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAG7D,wBAAgB,YAAY,CAAC,IAAI,EAAE,eAAe,GAAG,SAAS,CAyB7D;AAED,wBAAuB,qBAAqB,CAC1C,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,KAAK,EAEzC,QAAQ,EAAE,QAAQ,GACjB,cAAc,CACf;IACE,IAAI,EAAE,GAAG,CAAC;IACV,KAAK,EAAE,CAAC,CAAC;CACV,EACD,IAAI,EACJ,OAAO,CACR,CAUA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Client.d.ts","sourceRoot":"","sources":["../../src/Client.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACV,gBAAgB,EAChB,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,SAAS,EACT,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,YAAY,EACb,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EACV,UAAU,EACV,aAAa,EACb,gBAAgB,EACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,YAAY,IAAI,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAEvE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAAI,CAAC,SAAS,YAAY,CAAC,MAAM,CAAC,CAA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CAAC;AAE/B,MAAM,MAAM,cAAc,GAAG,OAAO,cAAc,CAAC;AACnD,QAAA,MAAM,YAAY,EAAE,OAAO,MAA+B,CAAC"}
|
|
@@ -1,55 +1,38 @@
|
|
|
1
|
-
import type { DirectedLinkTypeRid } from "@osdk/client.unstable";
|
|
1
|
+
import type { DirectedLinkTypeRid, Type } from "@osdk/client.unstable";
|
|
2
2
|
import type { MinimalClient } from "../MinimalClientContext.js";
|
|
3
|
-
export
|
|
3
|
+
export interface ObjectPropertyMapping {
|
|
4
4
|
apiName: string;
|
|
5
5
|
id: string;
|
|
6
6
|
propertyIdToApiNameMapping: Record<string, string>;
|
|
7
7
|
propertyApiNameToIdMapping: Record<string, string>;
|
|
8
|
-
|
|
8
|
+
pk: {
|
|
9
|
+
rid: string;
|
|
10
|
+
apiName: string;
|
|
11
|
+
type: Type;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
type ObjectLinkMapping = Record<string, {
|
|
15
|
+
apiName: string;
|
|
16
|
+
directedLinkTypeRid: DirectedLinkTypeRid;
|
|
17
|
+
otherObjectType: string;
|
|
18
|
+
}>;
|
|
9
19
|
export declare class MetadataClient {
|
|
10
20
|
#private;
|
|
11
21
|
constructor(client: MinimalClient);
|
|
12
22
|
forObjectByRid: (key: string) => Promise<{
|
|
13
|
-
getPropertyMapping: () => Promise<
|
|
14
|
-
|
|
15
|
-
id: string;
|
|
16
|
-
propertyIdToApiNameMapping: Record<string, string>;
|
|
17
|
-
propertyApiNameToIdMapping: Record<string, string>;
|
|
18
|
-
pk: {
|
|
19
|
-
rid: string;
|
|
20
|
-
apiName: string;
|
|
21
|
-
type: import("@osdk/client.unstable").Type;
|
|
22
|
-
};
|
|
23
|
-
}>;
|
|
24
|
-
getLinkMapping: () => Promise<Record<string, {
|
|
25
|
-
apiName: string;
|
|
26
|
-
directedLinkTypeRid: DirectedLinkTypeRid;
|
|
27
|
-
otherObjectType: string;
|
|
28
|
-
}>>;
|
|
23
|
+
getPropertyMapping: () => Promise<ObjectPropertyMapping>;
|
|
24
|
+
getLinkMapping: () => Promise<ObjectLinkMapping>;
|
|
29
25
|
getRid: () => string;
|
|
30
26
|
getApiName: () => Promise<string | undefined>;
|
|
31
27
|
}>;
|
|
32
28
|
forObjectByApiName: (key: string) => Promise<{
|
|
33
|
-
getPropertyMapping: () => Promise<
|
|
34
|
-
|
|
35
|
-
id: string;
|
|
36
|
-
propertyIdToApiNameMapping: Record<string, string>;
|
|
37
|
-
propertyApiNameToIdMapping: Record<string, string>;
|
|
38
|
-
pk: {
|
|
39
|
-
rid: string;
|
|
40
|
-
apiName: string;
|
|
41
|
-
type: import("@osdk/client.unstable").Type;
|
|
42
|
-
};
|
|
43
|
-
}>;
|
|
44
|
-
getLinkMapping: () => Promise<Record<string, {
|
|
45
|
-
apiName: string;
|
|
46
|
-
directedLinkTypeRid: DirectedLinkTypeRid;
|
|
47
|
-
otherObjectType: string;
|
|
48
|
-
}>>;
|
|
29
|
+
getPropertyMapping: () => Promise<ObjectPropertyMapping>;
|
|
30
|
+
getLinkMapping: () => Promise<ObjectLinkMapping>;
|
|
49
31
|
getRid: () => string;
|
|
50
32
|
getApiName: () => Promise<string | undefined>;
|
|
51
33
|
}>;
|
|
52
34
|
ontologyVersion: (key: string) => Promise<string>;
|
|
53
35
|
}
|
|
54
36
|
export declare const metadataCacheClient: (key: MinimalClient) => Promise<MetadataClient>;
|
|
37
|
+
export {};
|
|
55
38
|
//# sourceMappingURL=ConjureSupport.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConjureSupport.d.ts","sourceRoot":"","sources":["../../../src/__unstable/ConjureSupport.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACV,mBAAmB,
|
|
1
|
+
{"version":3,"file":"ConjureSupport.d.ts","sourceRoot":"","sources":["../../../src/__unstable/ConjureSupport.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACV,mBAAmB,EAInB,IAAI,EACL,MAAM,uBAAuB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AC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAEyB;CAC3E;AAED,eAAO,MAAM,mBAAmB,EAAE,CAChC,GAAG,EAAE,aAAa,KACf,OAAO,CAAC,cAAc,CAE1B,CAAC"}
|
|
@@ -137,7 +137,10 @@ export class MetadataClient {
|
|
|
137
137
|
loadRedacted: false,
|
|
138
138
|
includeObjectTypeCount: undefined,
|
|
139
139
|
includeObjectTypesWithoutSearchableDatasources: true,
|
|
140
|
-
includeEntityMetadata: undefined
|
|
140
|
+
includeEntityMetadata: undefined,
|
|
141
|
+
actionTypes: [],
|
|
142
|
+
includeTypeGroupEntitiesCount: undefined,
|
|
143
|
+
entityMetadata: undefined
|
|
141
144
|
};
|
|
142
145
|
const entities = await bulkLoadOntologyEntities(this.#ctx, undefined, body);
|
|
143
146
|
!entities.objectTypes[0]?.objectType ? process.env.NODE_ENV !== "production" ? invariant(false, "object type should be loaded") : invariant(false) : void 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConjureSupport.js","names":["bulkLoadOntologyEntities","getLinkTypesForObjectTypes","loadAllOntologies","invariant","createSimpleAsyncCache","createSimpleCache","makeConjureContext","cachedAllOntologies","getOntologyVersionForRid","ctx","ontologyRid","ontologies","process","env","NODE_ENV","currentOntologyVersion","strongMemoSync","fn","Map","get","weakMemoSync","WeakMap","strongMemoAsync","weakMemoAsync","MetadataClient","client","logger","constructor","ontologyProvider","getObjectDefinition","child","mcc","forObjectByRid","rid","Promise","resolve","getPropertyMapping","objectPropertyMapping","bind","getLinkMapping","objectLinkMapping","getRid","getApiName","getConjureObjectType","apiName","forObjectByApiName","objectApiName","objectDef","objectTypeRid","conjureObjectType","createObjectPropertyMapping","linkTypes","includeObjectTypesWithoutSearchableDatasources","loadRedacted","objectTypeBranches","objectTypeVersions","ontologyVersion","ret","l","helper","linkSide","otherObjectType","directedLinkTypeRid","linkTypeRid","definition","type","oneToMany","objectTypeRidManySide","manyToOneLinkMetadata","objectTypeRidOneSide","oneToManyLinkMetadata","manyToMany","objectTypeRidA","objectTypeAToBLinkMetadata","objectTypeRidB","objectTypeBToALinkMetadata","debug","body","datasourceTypes","objectTypes","identifier","versionReference","sharedPropertyTypes","interfaceTypes","typeGroups","includeObjectTypeCount","undefined","includeEntityMetadata","entities","objectType","metadataCacheClient","conjureOT","primaryKeys","length","pkRid","pkProperty","Object","values","propertyTypes","find","a","Error","propertyIdToApiNameMapping","fromEntries","map","property","id","propertyApiNameToIdMapping","pk"],"sources":["ConjureSupport.js"],"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 */\nimport { bulkLoadOntologyEntities, getLinkTypesForObjectTypes, loadAllOntologies, } from \"@osdk/client.unstable\";\nimport invariant from \"tiny-invariant\";\nimport { createSimpleAsyncCache, createSimpleCache, } from \"../object/SimpleCache.js\";\nimport { makeConjureContext } from \"../ontology/makeConjureContext.js\";\nlet cachedAllOntologies;\nasync function getOntologyVersionForRid(ctx, ontologyRid) {\n cachedAllOntologies ??= await loadAllOntologies(ctx, {});\n invariant(cachedAllOntologies.ontologies[ontologyRid], \"ontology should be loaded\");\n return cachedAllOntologies.ontologies[ontologyRid].currentOntologyVersion;\n}\nconst strongMemoSync = (fn) => createSimpleCache(new Map(), fn).get;\nconst weakMemoSync = (fn) => createSimpleCache(new WeakMap(), fn).get; // FIXME\nconst strongMemoAsync = (fn) => createSimpleAsyncCache(\"strong\", fn).get;\nconst weakMemoAsync = (fn) => createSimpleAsyncCache(\"weak\", fn).get;\nexport class MetadataClient {\n #client;\n #ctx;\n #logger;\n constructor(client) {\n this.#client = client;\n this.#ctx = makeConjureContext(client, \"ontology-metadata/api\");\n this.#client.ontologyProvider.getObjectDefinition;\n this.#logger = this.#client.logger?.child({\n mcc: true,\n });\n }\n forObjectByRid = strongMemoAsync(async (rid) => {\n return Promise.resolve({\n getPropertyMapping: this.#objectPropertyMapping.bind(this, rid),\n getLinkMapping: this.#objectLinkMapping.bind(this, rid),\n getRid: () => rid,\n getApiName: async () => (await this.#getConjureObjectType(rid)).apiName,\n });\n });\n forObjectByApiName = strongMemoAsync(async (objectApiName) => {\n const objectDef = await this.#client.ontologyProvider.getObjectDefinition(objectApiName);\n return this.forObjectByRid(objectDef.rid);\n });\n #objectPropertyMapping = strongMemoAsync(async (objectTypeRid) => {\n const conjureObjectType = await this.#getConjureObjectType(objectTypeRid);\n return createObjectPropertyMapping(conjureObjectType);\n });\n #objectLinkMapping = strongMemoAsync(async (objectTypeRid) => {\n const linkTypes = await getLinkTypesForObjectTypes(this.#ctx, {\n includeObjectTypesWithoutSearchableDatasources: true,\n loadRedacted: false,\n objectTypeBranches: {},\n objectTypeVersions: {\n [objectTypeRid]: await this.ontologyVersion(\"\"),\n },\n });\n invariant(linkTypes.linkTypes[objectTypeRid], \"link type should be loaded\");\n // apiName to content\n const ret = {};\n for (const l of linkTypes.linkTypes[objectTypeRid]) {\n const helper = ({ apiName }, linkSide, otherObjectType) => {\n if (apiName) {\n ret[apiName] = {\n apiName,\n directedLinkTypeRid: {\n linkTypeRid: l.rid,\n linkSide,\n },\n otherObjectType,\n };\n }\n };\n if (l.definition.type === \"oneToMany\") {\n const { oneToMany: { objectTypeRidManySide, manyToOneLinkMetadata, objectTypeRidOneSide, oneToManyLinkMetadata, }, } = l.definition;\n if (objectTypeRidManySide === objectTypeRid) {\n helper(manyToOneLinkMetadata, \"TARGET\", objectTypeRidOneSide);\n }\n if (objectTypeRidOneSide === objectTypeRid) {\n helper(oneToManyLinkMetadata, \"SOURCE\", objectTypeRidManySide);\n }\n }\n else if (l.definition.type === \"manyToMany\") {\n const { manyToMany: { objectTypeRidA, objectTypeAToBLinkMetadata, objectTypeRidB, objectTypeBToALinkMetadata, }, } = l.definition;\n if (objectTypeRidA === objectTypeRid) {\n helper(objectTypeAToBLinkMetadata, \"SOURCE\", objectTypeRidB);\n }\n if (objectTypeRidB === objectTypeRid) {\n helper(objectTypeBToALinkMetadata, \"TARGET\", objectTypeRidA);\n }\n }\n }\n return ret;\n });\n #getConjureObjectType = strongMemoAsync(async (objectTypeRid) => {\n this.#logger?.debug(`getConjureObjectType(${objectTypeRid})`);\n const body = {\n datasourceTypes: [],\n objectTypes: [{\n identifier: {\n type: \"objectTypeRid\",\n objectTypeRid: objectTypeRid,\n },\n versionReference: {\n type: \"ontologyVersion\",\n ontologyVersion: await this.ontologyVersion(\"\"),\n },\n }],\n linkTypes: [],\n sharedPropertyTypes: [],\n interfaceTypes: [],\n typeGroups: [],\n loadRedacted: false,\n includeObjectTypeCount: undefined,\n includeObjectTypesWithoutSearchableDatasources: true,\n includeEntityMetadata: undefined,\n };\n const entities = await bulkLoadOntologyEntities(this.#ctx, undefined, body);\n invariant(entities.objectTypes[0]?.objectType, \"object type should be loaded\");\n return entities.objectTypes[0].objectType;\n });\n ontologyVersion = strongMemoAsync(async (_) => getOntologyVersionForRid(this.#ctx, await this.#client.ontologyRid));\n}\nexport const metadataCacheClient = weakMemoAsync((client) => Promise.resolve(new MetadataClient(client)));\nfunction createObjectPropertyMapping(conjureOT) {\n invariant(conjureOT.primaryKeys.length === 1, `only one primary key supported, got ${conjureOT.primaryKeys.length}`);\n const pkRid = conjureOT.primaryKeys[0];\n const pkProperty = Object.values(conjureOT.propertyTypes).find(a => a.rid === pkRid);\n if (!pkProperty) {\n throw new Error(`Could not find PK property by rid: ${pkRid}`);\n }\n const propertyIdToApiNameMapping = Object\n .fromEntries(Object.values(conjureOT.propertyTypes).map(property => {\n return [property.id, property.apiName];\n }));\n const propertyApiNameToIdMapping = Object\n .fromEntries(Object.values(conjureOT.propertyTypes).map(property => {\n return [property.apiName, property.id];\n }));\n return {\n apiName: conjureOT.apiName,\n id: conjureOT.id,\n propertyIdToApiNameMapping,\n propertyApiNameToIdMapping,\n pk: {\n rid: pkRid,\n apiName: pkProperty.apiName,\n type: pkProperty.type,\n },\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,wBAAwB,EAAEC,0BAA0B,EAAEC,iBAAiB,QAAS,uBAAuB;AAChH,OAAOC,SAAS,MAAM,gBAAgB;AACtC,SAASC,sBAAsB,EAAEC,iBAAiB,QAAS,0BAA0B;AACrF,SAASC,kBAAkB,QAAQ,mCAAmC;AACtE,IAAIC,mBAAmB;AACvB,eAAeC,wBAAwBA,CAACC,GAAG,EAAEC,WAAW,EAAE;EACtDH,mBAAmB,KAAK,MAAML,iBAAiB,CAACO,GAAG,EAAE,CAAC,CAAC,CAAC;EACxD,CAAUF,mBAAmB,CAACI,UAAU,CAACD,WAAW,CAAC,GAAAE,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAArDX,SAAS,QAA8C,2BAA2B,IAAlFA,SAAS;EACT,OAAOI,mBAAmB,CAACI,UAAU,CAACD,WAAW,CAAC,CAACK,sBAAsB;AAC7E;AACA,MAAMC,cAAc,GAAIC,EAAE,IAAKZ,iBAAiB,CAAC,IAAIa,GAAG,CAAC,CAAC,EAAED,EAAE,CAAC,CAACE,GAAG;AACnE,MAAMC,YAAY,GAAIH,EAAE,IAAKZ,iBAAiB,CAAC,IAAIgB,OAAO,CAAC,CAAC,EAAEJ,EAAE,CAAC,CAACE,GAAG,CAAC,CAAC;AACvE,MAAMG,eAAe,GAAIL,EAAE,IAAKb,sBAAsB,CAAC,QAAQ,EAAEa,EAAE,CAAC,CAACE,GAAG;AACxE,MAAMI,aAAa,GAAIN,EAAE,IAAKb,sBAAsB,CAAC,MAAM,EAAEa,EAAE,CAAC,CAACE,GAAG;AACp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aAAa,CAAC,CAACM,GAAG,CAACC,QAAQ,IAAI;IACpE,OAAO,CAACA,QAAQ,CAACC,EAAE,EAAED,QAAQ,CAAC7D,OAAO,CAAC;EAC1C,CAAC,CAAC,CAAC;EACH,MAAM+D,0BAA0B,GAAGX,MAAM,CACpCO,WAAW,CAACP,MAAM,CAACC,MAAM,CAACN,SAAS,CAACO,aAAa,CAAC,CAACM,GAAG,CAACC,QAAQ,IAAI;IACpE,OAAO,CAACA,QAAQ,CAAC7D,OAAO,EAAE6D,QAAQ,CAACC,EAAE,CAAC;EAC1C,CAAC,CAAC,CAAC;EACH,OAAO;IACH9D,OAAO,EAAE+C,SAAS,CAAC/C,OAAO;IAC1B8D,EAAE,EAAEf,SAAS,CAACe,EAAE;IAChBJ,0BAA0B;IAC1BK,0BAA0B;IAC1BC,EAAE,EAAE;MACA3E,GAAG,EAAE6D,KAAK;MACVlD,OAAO,EAAEmD,UAAU,CAACnD,OAAO;MAC3BqB,IAAI,EAAE8B,UAAU,CAAC9B;IACrB;EACJ,CAAC;AACL","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ConjureSupport.js","names":["bulkLoadOntologyEntities","getLinkTypesForObjectTypes","loadAllOntologies","invariant","createSimpleAsyncCache","createSimpleCache","makeConjureContext","cachedAllOntologies","getOntologyVersionForRid","ctx","ontologyRid","ontologies","process","env","NODE_ENV","currentOntologyVersion","strongMemoSync","fn","Map","get","weakMemoSync","WeakMap","strongMemoAsync","weakMemoAsync","MetadataClient","client","logger","constructor","ontologyProvider","getObjectDefinition","child","mcc","forObjectByRid","rid","Promise","resolve","getPropertyMapping","objectPropertyMapping","bind","getLinkMapping","objectLinkMapping","getRid","getApiName","getConjureObjectType","apiName","forObjectByApiName","objectApiName","objectDef","objectTypeRid","conjureObjectType","createObjectPropertyMapping","linkTypes","includeObjectTypesWithoutSearchableDatasources","loadRedacted","objectTypeBranches","objectTypeVersions","ontologyVersion","ret","l","helper","linkSide","otherObjectType","directedLinkTypeRid","linkTypeRid","definition","type","oneToMany","objectTypeRidManySide","manyToOneLinkMetadata","objectTypeRidOneSide","oneToManyLinkMetadata","manyToMany","objectTypeRidA","objectTypeAToBLinkMetadata","objectTypeRidB","objectTypeBToALinkMetadata","debug","body","datasourceTypes","objectTypes","identifier","versionReference","sharedPropertyTypes","interfaceTypes","typeGroups","includeObjectTypeCount","undefined","includeEntityMetadata","actionTypes","includeTypeGroupEntitiesCount","entityMetadata","entities","objectType","metadataCacheClient","conjureOT","primaryKeys","length","pkRid","pkProperty","Object","values","propertyTypes","find","a","Error","propertyIdToApiNameMapping","fromEntries","map","property","id","propertyApiNameToIdMapping","pk"],"sources":["ConjureSupport.js"],"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 */\nimport { bulkLoadOntologyEntities, getLinkTypesForObjectTypes, loadAllOntologies, } from \"@osdk/client.unstable\";\nimport invariant from \"tiny-invariant\";\nimport { createSimpleAsyncCache, createSimpleCache, } from \"../object/SimpleCache.js\";\nimport { makeConjureContext } from \"../ontology/makeConjureContext.js\";\nlet cachedAllOntologies;\nasync function getOntologyVersionForRid(ctx, ontologyRid) {\n cachedAllOntologies ??= await loadAllOntologies(ctx, {});\n invariant(cachedAllOntologies.ontologies[ontologyRid], \"ontology should be loaded\");\n return cachedAllOntologies.ontologies[ontologyRid].currentOntologyVersion;\n}\nconst strongMemoSync = (fn) => createSimpleCache(new Map(), fn).get;\nconst weakMemoSync = (fn) => createSimpleCache(new WeakMap(), fn).get; // FIXME\nconst strongMemoAsync = (fn) => createSimpleAsyncCache(\"strong\", fn).get;\nconst weakMemoAsync = (fn) => createSimpleAsyncCache(\"weak\", fn).get;\nexport class MetadataClient {\n #client;\n #ctx;\n #logger;\n constructor(client) {\n this.#client = client;\n this.#ctx = makeConjureContext(client, \"ontology-metadata/api\");\n this.#client.ontologyProvider.getObjectDefinition;\n this.#logger = this.#client.logger?.child({\n mcc: true,\n });\n }\n forObjectByRid = strongMemoAsync(async (rid) => {\n return Promise.resolve({\n getPropertyMapping: this.#objectPropertyMapping.bind(this, rid),\n getLinkMapping: this.#objectLinkMapping.bind(this, rid),\n getRid: () => rid,\n getApiName: async () => (await this.#getConjureObjectType(rid)).apiName,\n });\n });\n forObjectByApiName = strongMemoAsync(async (objectApiName) => {\n const objectDef = await this.#client.ontologyProvider.getObjectDefinition(objectApiName);\n return this.forObjectByRid(objectDef.rid);\n });\n #objectPropertyMapping = strongMemoAsync(async (objectTypeRid) => {\n const conjureObjectType = await this.#getConjureObjectType(objectTypeRid);\n return createObjectPropertyMapping(conjureObjectType);\n });\n #objectLinkMapping = strongMemoAsync(async (objectTypeRid) => {\n const linkTypes = await getLinkTypesForObjectTypes(this.#ctx, {\n includeObjectTypesWithoutSearchableDatasources: true,\n loadRedacted: false,\n objectTypeBranches: {},\n objectTypeVersions: {\n [objectTypeRid]: await this.ontologyVersion(\"\"),\n },\n });\n invariant(linkTypes.linkTypes[objectTypeRid], \"link type should be loaded\");\n // apiName to content\n const ret = {};\n for (const l of linkTypes.linkTypes[objectTypeRid]) {\n const helper = ({ apiName }, linkSide, otherObjectType) => {\n if (apiName) {\n ret[apiName] = {\n apiName,\n directedLinkTypeRid: {\n linkTypeRid: l.rid,\n linkSide,\n },\n otherObjectType,\n };\n }\n };\n if (l.definition.type === \"oneToMany\") {\n const { oneToMany: { objectTypeRidManySide, manyToOneLinkMetadata, objectTypeRidOneSide, oneToManyLinkMetadata, }, } = l.definition;\n if (objectTypeRidManySide === objectTypeRid) {\n helper(manyToOneLinkMetadata, \"TARGET\", objectTypeRidOneSide);\n }\n if (objectTypeRidOneSide === objectTypeRid) {\n helper(oneToManyLinkMetadata, \"SOURCE\", objectTypeRidManySide);\n }\n }\n else if (l.definition.type === \"manyToMany\") {\n const { manyToMany: { objectTypeRidA, objectTypeAToBLinkMetadata, objectTypeRidB, objectTypeBToALinkMetadata, }, } = l.definition;\n if (objectTypeRidA === objectTypeRid) {\n helper(objectTypeAToBLinkMetadata, \"SOURCE\", objectTypeRidB);\n }\n if (objectTypeRidB === objectTypeRid) {\n helper(objectTypeBToALinkMetadata, \"TARGET\", objectTypeRidA);\n }\n }\n }\n return ret;\n });\n #getConjureObjectType = strongMemoAsync(async (objectTypeRid) => {\n this.#logger?.debug(`getConjureObjectType(${objectTypeRid})`);\n const body = {\n datasourceTypes: [],\n objectTypes: [{\n identifier: {\n type: \"objectTypeRid\",\n objectTypeRid: objectTypeRid,\n },\n versionReference: {\n type: \"ontologyVersion\",\n ontologyVersion: await this.ontologyVersion(\"\"),\n },\n }],\n linkTypes: [],\n sharedPropertyTypes: [],\n interfaceTypes: [],\n typeGroups: [],\n loadRedacted: false,\n includeObjectTypeCount: undefined,\n includeObjectTypesWithoutSearchableDatasources: true,\n includeEntityMetadata: undefined,\n actionTypes: [],\n includeTypeGroupEntitiesCount: undefined,\n entityMetadata: undefined,\n };\n const entities = await bulkLoadOntologyEntities(this.#ctx, undefined, body);\n invariant(entities.objectTypes[0]?.objectType, \"object type should be loaded\");\n return entities.objectTypes[0].objectType;\n });\n ontologyVersion = strongMemoAsync(async (_) => getOntologyVersionForRid(this.#ctx, await this.#client.ontologyRid));\n}\nexport const metadataCacheClient = weakMemoAsync((client) => Promise.resolve(new MetadataClient(client)));\nfunction createObjectPropertyMapping(conjureOT) {\n invariant(conjureOT.primaryKeys.length === 1, `only one primary key supported, got ${conjureOT.primaryKeys.length}`);\n const pkRid = conjureOT.primaryKeys[0];\n const pkProperty = Object.values(conjureOT.propertyTypes).find(a => a.rid === pkRid);\n if (!pkProperty) {\n throw new Error(`Could not find PK property by rid: ${pkRid}`);\n }\n const propertyIdToApiNameMapping = Object\n .fromEntries(Object.values(conjureOT.propertyTypes).map(property => {\n return [property.id, property.apiName];\n }));\n const propertyApiNameToIdMapping = Object\n .fromEntries(Object.values(conjureOT.propertyTypes).map(property => {\n return [property.apiName, property.id];\n }));\n return {\n apiName: conjureOT.apiName,\n id: conjureOT.id,\n propertyIdToApiNameMapping,\n propertyApiNameToIdMapping,\n pk: {\n rid: pkRid,\n apiName: pkProperty.apiName,\n type: pkProperty.type,\n },\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,wBAAwB,EAAEC,0BAA0B,EAAEC,iBAAiB,QAAS,uBAAuB;AAChH,OAAOC,SAAS,MAAM,gBAAgB;AACtC,SAASC,sBAAsB,EAAEC,iBAAiB,QAAS,0BAA0B;AACrF,SAASC,kBAAkB,QAAQ,mCAAmC;AACtE,IAAIC,mBAAmB;AACvB,eAAeC,wBAAwBA,CAACC,GAAG,EAAEC,WAAW,EAAE;EACtDH,mBAAmB,KAAK,MAAML,iBAAiB,CAACO,GAAG,EAAE,CAAC,CAAC,CAAC;EACxD,CAAUF,mBAAmB,CAACI,UAAU,CAACD,WAAW,CAAC,GAAAE,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAArDX,SAAS,QAA8C,2BAA2B,IAAlFA,SAAS;EACT,OAAOI,mBAAmB,CAACI,UAAU,CAACD,WAAW,CAAC,CAACK,sBAAsB;AAC7E;AACA,MAAMC,cAAc,GAAIC,EAAE,IAAKZ,iBAAiB,CAAC,IAAIa,GAAG,CAAC,CAAC,EAAED,EAAE,CAAC,CAACE,GAAG;AACnE,MAAMC,YAAY,GAAIH,EAAE,IAAKZ,iBAAiB,CAAC,IAAIgB,OAAO,CAAC,CAAC,EAAEJ,EAAE,CAAC,CAACE,GAAG,CAAC,CAAC;AACvE,MAAMG,eAAe,GAAIL,EAAE,IAAKb,sBAAsB,CAAC,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AACtE,GAAG,KAAKgE,KAAK,CAAC;EACpF,IAAI,CAACC,UAAU,EAAE;IACb,MAAM,IAAIM,KAAK,CAAC,sCAAsCP,KAAK,EAAE,CAAC;EAClE;EACA,MAAMQ,0BAA0B,GAAGN,MAAM,CACpCO,WAAW,CAACP,MAAM,CAACC,MAAM,CAACN,SAAS,CAACO,aAAa,CAAC,CAACM,GAAG,CAACC,QAAQ,IAAI;IACpE,OAAO,CAACA,QAAQ,CAACC,EAAE,EAAED,QAAQ,CAAChE,OAAO,CAAC;EAC1C,CAAC,CAAC,CAAC;EACH,MAAMkE,0BAA0B,GAAGX,MAAM,CACpCO,WAAW,CAACP,MAAM,CAACC,MAAM,CAACN,SAAS,CAACO,aAAa,CAAC,CAACM,GAAG,CAACC,QAAQ,IAAI;IACpE,OAAO,CAACA,QAAQ,CAAChE,OAAO,EAAEgE,QAAQ,CAACC,EAAE,CAAC;EAC1C,CAAC,CAAC,CAAC;EACH,OAAO;IACHjE,OAAO,EAAEkD,SAAS,CAAClD,OAAO;IAC1BiE,EAAE,EAAEf,SAAS,CAACe,EAAE;IAChBJ,0BAA0B;IAC1BK,0BAA0B;IAC1BC,EAAE,EAAE;MACA9E,GAAG,EAAEgE,KAAK;MACVrD,OAAO,EAAEsD,UAAU,CAACtD,OAAO;MAC3BqB,IAAI,EAAEiC,UAAU,CAACjC;IACrB;EACJ,CAAC;AACL","ignoreList":[]}
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { $Actions, $ontologyRid, actionTakesAttachment, createOffice, moveOffice } from "@osdk/client.test.ontology";
|
|
16
|
+
import { $Actions, $ontologyRid, actionTakesAttachment, createOffice, createStructPerson, moveOffice } from "@osdk/client.test.ontology";
|
|
17
17
|
import { apiServer, stubData } from "@osdk/shared.test";
|
|
18
|
-
import { afterAll, beforeAll, describe, expect, expectTypeOf, it } from "vitest";
|
|
18
|
+
import { afterAll, beforeAll, describe, expect, expectTypeOf, it, vi } from "vitest";
|
|
19
19
|
import { createClient } from "../createClient.js";
|
|
20
20
|
import { createAttachmentUpload } from "../object/AttachmentUpload.js";
|
|
21
21
|
import { ActionValidationError } from "./ActionValidationError.js";
|
|
@@ -58,6 +58,7 @@ describe("actions", () => {
|
|
|
58
58
|
"type": "edits",
|
|
59
59
|
}
|
|
60
60
|
`);
|
|
61
|
+
// eslint-disable-next-line @typescript-eslint/no-confusing-void-expression
|
|
61
62
|
const undefinedResult = await client(createOffice).applyAction({
|
|
62
63
|
officeId: "NYC",
|
|
63
64
|
address: "123 Main Street",
|
|
@@ -66,7 +67,8 @@ describe("actions", () => {
|
|
|
66
67
|
expectTypeOf().toEqualTypeOf();
|
|
67
68
|
expect(undefinedResult).toBeUndefined();
|
|
68
69
|
client(createOffice).batchApplyAction;
|
|
69
|
-
|
|
70
|
+
const clientCreateOfficeMock = vi.fn();
|
|
71
|
+
void clientCreateOfficeMock([{
|
|
70
72
|
officeId: "NYC",
|
|
71
73
|
address: "123 Main Street",
|
|
72
74
|
capacity: 100
|
|
@@ -129,6 +131,20 @@ describe("actions", () => {
|
|
|
129
131
|
`);
|
|
130
132
|
}
|
|
131
133
|
});
|
|
134
|
+
it("Accepts structs", async () => {
|
|
135
|
+
client(createStructPerson).applyAction;
|
|
136
|
+
expectTypeOf().toMatchTypeOf();
|
|
137
|
+
const result = await client(createStructPerson).applyAction({
|
|
138
|
+
name: "testMan",
|
|
139
|
+
address: {
|
|
140
|
+
city: "NYC",
|
|
141
|
+
state: "NY",
|
|
142
|
+
zipcode: 12345
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
expectTypeOf().toEqualTypeOf();
|
|
146
|
+
expect(result).toBeUndefined();
|
|
147
|
+
});
|
|
132
148
|
it("Accepts attachments", async () => {
|
|
133
149
|
client(actionTakesAttachment).applyAction;
|
|
134
150
|
expectTypeOf().toMatchTypeOf();
|
|
@@ -345,7 +361,7 @@ describe("ActionResponse remapping", () => {
|
|
|
345
361
|
});
|
|
346
362
|
it("actions are enumerable", async () => {
|
|
347
363
|
const actions = Object.keys($Actions);
|
|
348
|
-
expect(actions).toStrictEqual(["actionTakesAttachment", "actionTakesObjectSet", "createOffice", "createOfficeAndEmployee", "moveOffice", "promoteEmployee", "promoteEmployeeObject"]);
|
|
364
|
+
expect(actions).toStrictEqual(["actionTakesAttachment", "actionTakesObjectSet", "createOffice", "createOfficeAndEmployee", "createStructPerson", "moveOffice", "promoteEmployee", "promoteEmployeeObject"]);
|
|
349
365
|
});
|
|
350
366
|
});
|
|
351
367
|
//# sourceMappingURL=actions.test.js.map
|