@osdk/client 2.5.0-beta.1 → 2.5.0-beta.11
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 +149 -3
- package/build/browser/Client.js +1 -1
- package/build/browser/Client.js.map +1 -1
- package/build/browser/MinimalClientContext.js.map +1 -1
- package/build/browser/actions/applyAction.js +4 -0
- package/build/browser/actions/applyAction.js.map +1 -1
- package/build/browser/createClient.js +6 -2
- package/build/browser/createClient.js.map +1 -1
- package/build/browser/createMinimalClient.js +2 -1
- package/build/browser/createMinimalClient.js.map +1 -1
- package/build/browser/fetchMetadata.test.js +11 -0
- package/build/browser/fetchMetadata.test.js.map +1 -1
- package/build/browser/index.js +2 -0
- package/build/browser/index.js.map +1 -1
- package/build/browser/intellisense.test.helpers/orderBySuggestionIsRight.js +8 -1
- package/build/browser/intellisense.test.helpers/orderBySuggestionIsRight.js.map +1 -1
- package/build/browser/intellisense.test.js +14 -4
- package/build/browser/intellisense.test.js.map +1 -1
- package/build/browser/object/Cache.js +1 -1
- package/build/browser/object/Cache.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/SimpleCache.js +1 -1
- package/build/browser/object/SimpleCache.js.map +1 -1
- package/build/browser/object/aggregate.js +2 -0
- package/build/browser/object/aggregate.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.js +1 -0
- package/build/browser/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.js +6 -0
- package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/getDollarLink.js +20 -1
- package/build/browser/object/convertWireToOsdkObjects/getDollarLink.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects.js +4 -0
- package/build/browser/object/convertWireToOsdkObjects.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects.test.js +14 -0
- package/build/browser/object/convertWireToOsdkObjects.test.js.map +1 -1
- package/build/browser/object/fetchPage.js +96 -21
- package/build/browser/object/fetchPage.js.map +1 -1
- package/build/browser/object/fetchPage.test.js +35 -1
- package/build/browser/object/fetchPage.test.js.map +1 -1
- package/build/browser/object/geotimeseriesreference.test.js +0 -2
- package/build/browser/object/geotimeseriesreference.test.js.map +1 -1
- package/build/browser/objectSet/ObjectSet.test.js +6 -0
- package/build/browser/objectSet/ObjectSet.test.js.map +1 -1
- package/build/browser/objectSet/ObjectSetListenerWebsocket.js +31 -9
- package/build/browser/objectSet/ObjectSetListenerWebsocket.js.map +1 -1
- package/build/browser/objectSet/ObjectSetListenerWebsocket.test.js +69 -4
- package/build/browser/objectSet/ObjectSetListenerWebsocket.test.js.map +1 -1
- package/build/browser/objectSet/createObjectSet.js +3 -1
- package/build/browser/objectSet/createObjectSet.js.map +1 -1
- package/build/browser/observable/LinkPayload.js +2 -0
- package/build/browser/observable/LinkPayload.js.map +1 -0
- package/build/browser/observable/ObjectPayload.js.map +1 -1
- package/build/browser/observable/ObjectSetPayload.js +2 -0
- package/build/browser/observable/ObjectSetPayload.js.map +1 -0
- package/build/browser/observable/ObservableClient/ObserveLink.js +17 -0
- package/build/browser/observable/ObservableClient/ObserveLink.js.map +1 -0
- package/build/browser/observable/ObservableClient/common.js +2 -0
- package/build/browser/observable/ObservableClient/common.js.map +1 -0
- package/build/browser/observable/ObservableClient.js +20 -0
- package/build/browser/observable/ObservableClient.js.map +1 -1
- package/build/browser/observable/Unsubscribable.js +2 -0
- package/build/browser/observable/Unsubscribable.js.map +1 -0
- package/build/browser/observable/computeObjectSetCacheKey.js +64 -0
- package/build/browser/observable/computeObjectSetCacheKey.js.map +1 -0
- package/build/browser/observable/internal/AbstractHelper.js +54 -0
- package/build/browser/observable/internal/AbstractHelper.js.map +1 -0
- package/build/browser/observable/internal/BatchContext.js +2 -0
- package/build/browser/observable/internal/BatchContext.js.map +1 -0
- package/build/browser/observable/internal/BulkObjectLoader.js +3 -3
- package/build/browser/observable/internal/BulkObjectLoader.js.map +1 -1
- package/build/browser/observable/internal/CacheKeys.js +65 -25
- package/build/browser/observable/internal/CacheKeys.js.map +1 -1
- package/build/browser/observable/internal/Changes.js +9 -0
- package/build/browser/observable/internal/Changes.js.map +1 -1
- package/build/browser/observable/internal/KnownCacheKey.js +2 -0
- package/build/browser/observable/internal/KnownCacheKey.js.map +1 -0
- package/build/browser/observable/internal/Layer.js +0 -8
- package/build/browser/observable/internal/Layer.js.map +1 -1
- package/build/browser/observable/internal/Layers.js +151 -0
- package/build/browser/observable/internal/Layers.js.map +1 -0
- package/build/browser/observable/internal/ObservableClientImpl.js +62 -3
- package/build/browser/observable/internal/ObservableClientImpl.js.map +1 -1
- package/build/browser/observable/internal/OrderByCanonicalizer.js +1 -37
- package/build/browser/observable/internal/OrderByCanonicalizer.js.map +1 -1
- package/build/browser/observable/internal/Queries.js +40 -0
- package/build/browser/observable/internal/Queries.js.map +1 -0
- package/build/browser/observable/internal/Query.js +63 -5
- package/build/browser/observable/internal/Query.js.map +1 -1
- package/build/browser/observable/internal/QuerySubscription.js +48 -0
- package/build/browser/observable/internal/QuerySubscription.js.map +1 -0
- package/build/browser/observable/internal/Store.invalidation.test.js +646 -0
- package/build/browser/observable/internal/Store.invalidation.test.js.map +1 -0
- package/build/browser/observable/internal/Store.js +89 -308
- package/build/browser/observable/internal/Store.js.map +1 -1
- package/build/browser/observable/internal/Store.test.js +330 -73
- package/build/browser/observable/internal/Store.test.js.map +1 -1
- package/build/browser/observable/internal/SubjectPayload.js +2 -0
- package/build/browser/observable/internal/SubjectPayload.js.map +1 -0
- package/build/browser/observable/internal/Subjects.js +55 -0
- package/build/browser/observable/internal/Subjects.js.map +1 -0
- package/build/browser/observable/internal/UnsubscribableWrapper.js +30 -0
- package/build/browser/observable/internal/UnsubscribableWrapper.js.map +1 -0
- package/build/browser/observable/internal/WeakRefTrie.js +61 -0
- package/build/browser/observable/internal/WeakRefTrie.js.map +1 -0
- package/build/browser/observable/internal/{ActionApplication.js → actions/ActionApplication.js} +2 -2
- package/build/browser/observable/internal/actions/ActionApplication.js.map +1 -0
- package/build/{esm/observable/internal → browser/observable/internal/actions}/OptimisticJob.js +15 -6
- package/build/browser/observable/internal/actions/OptimisticJob.js.map +1 -0
- package/build/browser/observable/internal/base-list/BaseCollectionQuery.js +2 -0
- package/build/browser/observable/internal/base-list/BaseCollectionQuery.js.map +1 -0
- package/build/browser/observable/internal/base-list/BaseListQuery.js +411 -0
- package/build/browser/observable/internal/base-list/BaseListQuery.js.map +1 -0
- package/build/browser/observable/internal/base-list/createCollectionConnectable.js +50 -0
- package/build/browser/observable/internal/base-list/createCollectionConnectable.js.map +1 -0
- package/build/browser/observable/internal/base-list/createCollectionConnectable.test.js +597 -0
- package/build/browser/observable/internal/base-list/createCollectionConnectable.test.js.map +1 -0
- package/build/browser/observable/internal/base-list/removeDuplicates.js +36 -0
- package/build/browser/observable/internal/base-list/removeDuplicates.js.map +1 -0
- package/build/browser/observable/internal/createInitEntry.js +25 -0
- package/build/browser/observable/internal/createInitEntry.js.map +1 -0
- package/build/browser/observable/internal/getObjectTypesThatInvalidate.js +216 -0
- package/build/browser/observable/internal/getObjectTypesThatInvalidate.js.map +1 -0
- package/build/browser/observable/internal/getObjectTypesThatInvalidate.test.js +382 -0
- package/build/browser/observable/internal/getObjectTypesThatInvalidate.test.js.map +1 -0
- package/build/browser/observable/internal/isObjectInstance.js +23 -0
- package/build/browser/observable/internal/isObjectInstance.js.map +1 -0
- package/build/browser/observable/internal/links/LinksHelper.js +37 -0
- package/build/browser/observable/internal/links/LinksHelper.js.map +1 -0
- package/build/browser/observable/internal/links/SpecificLinkCacheKey.js +2 -0
- package/build/browser/observable/internal/links/SpecificLinkCacheKey.js.map +1 -0
- package/build/browser/observable/internal/links/SpecificLinkQuery.js +185 -0
- package/build/browser/observable/internal/links/SpecificLinkQuery.js.map +1 -0
- package/build/browser/observable/internal/list/InterfaceListQuery.js +83 -0
- package/build/browser/observable/internal/list/InterfaceListQuery.js.map +1 -0
- package/build/browser/observable/internal/list/ListCacheKey.js +2 -0
- package/build/browser/observable/internal/list/ListCacheKey.js.map +1 -0
- package/build/browser/observable/internal/list/ListQuery.js +372 -0
- package/build/browser/observable/internal/list/ListQuery.js.map +1 -0
- package/build/browser/observable/internal/list/ListQueryOptions.js +2 -0
- package/build/browser/observable/internal/list/ListQueryOptions.js.map +1 -0
- package/build/browser/observable/internal/list/ListsHelper.js +51 -0
- package/build/browser/observable/internal/list/ListsHelper.js.map +1 -0
- package/build/browser/observable/internal/list/ObjectListQuery.js +48 -0
- package/build/browser/observable/internal/list/ObjectListQuery.js.map +1 -0
- package/build/browser/observable/internal/object/ObjectCacheKey.js +2 -0
- package/build/browser/observable/internal/object/ObjectCacheKey.js.map +1 -0
- package/build/browser/observable/internal/{ObjectQuery.js → object/ObjectQuery.js} +27 -18
- package/build/browser/observable/internal/object/ObjectQuery.js.map +1 -0
- package/build/browser/observable/internal/object/ObjectsHelper.js +48 -0
- package/build/browser/observable/internal/object/ObjectsHelper.js.map +1 -0
- package/build/browser/observable/internal/objectset/ObjectSetCacheKey.js +2 -0
- package/build/browser/observable/internal/objectset/ObjectSetCacheKey.js.map +1 -0
- package/build/browser/observable/internal/objectset/ObjectSetHelper.js +69 -0
- package/build/browser/observable/internal/objectset/ObjectSetHelper.js.map +1 -0
- package/build/browser/observable/internal/objectset/ObjectSetQuery.js +151 -0
- package/build/browser/observable/internal/objectset/ObjectSetQuery.js.map +1 -0
- package/build/browser/observable/internal/objectset/ObjectSetQueryOptions.js +2 -0
- package/build/browser/observable/internal/objectset/ObjectSetQueryOptions.js.map +1 -0
- package/build/browser/observable/internal/sorting/SortingStrategy.js +78 -0
- package/build/browser/observable/internal/sorting/SortingStrategy.js.map +1 -0
- package/build/browser/observable/internal/testUtils/invalidateList.js +23 -0
- package/build/browser/observable/internal/testUtils/invalidateList.js.map +1 -0
- package/build/browser/observable/internal/testUtils/observeLink/expectStandardObserveLink.js +69 -0
- package/build/browser/observable/internal/testUtils/observeLink/expectStandardObserveLink.js.map +1 -0
- package/build/browser/observable/internal/testUtils/observeObject/expectStandardObserveObject.js +56 -0
- package/build/browser/observable/internal/testUtils/observeObject/expectStandardObserveObject.js.map +1 -0
- package/build/browser/observable/internal/testUtils.js +72 -10
- package/build/browser/observable/internal/testUtils.js.map +1 -1
- package/build/browser/ontology/loadActionMetadata.js +3 -1
- package/build/browser/ontology/loadActionMetadata.js.map +1 -1
- package/build/browser/ontology/loadFullObjectMetadata.js +2 -1
- package/build/browser/ontology/loadFullObjectMetadata.js.map +1 -1
- package/build/browser/ontology/loadInterfaceMetadata.js +2 -1
- package/build/browser/ontology/loadInterfaceMetadata.js.map +1 -1
- package/build/browser/public/unstable-do-not-use.js +1 -0
- package/build/browser/public/unstable-do-not-use.js.map +1 -1
- package/build/browser/queries/applyQuery.js +3 -3
- package/build/browser/queries/applyQuery.js.map +1 -1
- package/build/browser/util/UserAgent.js +2 -2
- package/build/browser/util/UserAgent.js.map +1 -1
- package/build/browser/util/exponentialBackoff.js +51 -0
- package/build/browser/util/exponentialBackoff.js.map +1 -0
- package/build/browser/util/exponentialBackoff.test.js +81 -0
- package/build/browser/util/exponentialBackoff.test.js.map +1 -0
- package/build/browser/util/extractObjectOrInterfaceType.js +9 -1
- package/build/browser/util/extractObjectOrInterfaceType.js.map +1 -1
- package/build/browser/util/extractObjectOrInterfaceType.test.js +2 -2
- package/build/browser/util/extractObjectOrInterfaceType.test.js.map +1 -1
- package/build/browser/util/streamutils.js +1 -1
- package/build/browser/util/streamutils.js.map +1 -1
- package/build/cjs/{chunk-URDXPIRU.cjs → chunk-3LPXQHP5.cjs} +116 -77
- package/build/cjs/chunk-3LPXQHP5.cjs.map +1 -0
- package/build/cjs/{chunk-BJYCRD5Y.cjs → chunk-GVGP7T5P.cjs} +375 -237
- package/build/cjs/chunk-GVGP7T5P.cjs.map +1 -0
- package/build/cjs/{createClient-BJo8T7Js.d.cts → createClient-mOlFts15.d.cts} +1 -0
- package/build/cjs/index.cjs +7 -7
- package/build/cjs/index.d.cts +1 -1
- package/build/cjs/public/internal.cjs +8 -8
- package/build/cjs/public/unstable-do-not-use.cjs +1824 -927
- package/build/cjs/public/unstable-do-not-use.cjs.map +1 -1
- package/build/cjs/public/unstable-do-not-use.d.cts +238 -17
- package/build/esm/Client.js +1 -1
- package/build/esm/Client.js.map +1 -1
- package/build/esm/MinimalClientContext.js.map +1 -1
- package/build/esm/actions/applyAction.js +4 -0
- package/build/esm/actions/applyAction.js.map +1 -1
- package/build/esm/createClient.js +6 -2
- package/build/esm/createClient.js.map +1 -1
- package/build/esm/createMinimalClient.js +2 -1
- package/build/esm/createMinimalClient.js.map +1 -1
- package/build/esm/fetchMetadata.test.js +11 -0
- package/build/esm/fetchMetadata.test.js.map +1 -1
- package/build/esm/index.js +2 -0
- package/build/esm/index.js.map +1 -1
- package/build/esm/intellisense.test.helpers/orderBySuggestionIsRight.js +8 -1
- package/build/esm/intellisense.test.helpers/orderBySuggestionIsRight.js.map +1 -1
- package/build/esm/intellisense.test.js +14 -4
- package/build/esm/intellisense.test.js.map +1 -1
- package/build/esm/object/Cache.js +1 -1
- package/build/esm/object/Cache.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/SimpleCache.js +1 -1
- package/build/esm/object/SimpleCache.js.map +1 -1
- package/build/esm/object/aggregate.js +2 -0
- package/build/esm/object/aggregate.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.js +1 -0
- package/build/esm/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.js +6 -0
- package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/getDollarLink.js +20 -1
- package/build/esm/object/convertWireToOsdkObjects/getDollarLink.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects.js +4 -0
- package/build/esm/object/convertWireToOsdkObjects.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects.test.js +14 -0
- package/build/esm/object/convertWireToOsdkObjects.test.js.map +1 -1
- package/build/esm/object/fetchPage.js +96 -21
- package/build/esm/object/fetchPage.js.map +1 -1
- package/build/esm/object/fetchPage.test.js +35 -1
- package/build/esm/object/fetchPage.test.js.map +1 -1
- package/build/esm/object/geotimeseriesreference.test.js +0 -2
- package/build/esm/object/geotimeseriesreference.test.js.map +1 -1
- package/build/esm/objectSet/ObjectSet.test.js +6 -0
- package/build/esm/objectSet/ObjectSet.test.js.map +1 -1
- package/build/esm/objectSet/ObjectSetListenerWebsocket.js +31 -9
- package/build/esm/objectSet/ObjectSetListenerWebsocket.js.map +1 -1
- package/build/esm/objectSet/ObjectSetListenerWebsocket.test.js +69 -4
- package/build/esm/objectSet/ObjectSetListenerWebsocket.test.js.map +1 -1
- package/build/esm/objectSet/createObjectSet.js +3 -1
- package/build/esm/objectSet/createObjectSet.js.map +1 -1
- package/build/esm/observable/LinkPayload.js +2 -0
- package/build/esm/observable/LinkPayload.js.map +1 -0
- package/build/esm/observable/ObjectPayload.js.map +1 -1
- package/build/esm/observable/ObjectSetPayload.js +2 -0
- package/build/esm/observable/ObjectSetPayload.js.map +1 -0
- package/build/esm/observable/ObservableClient/ObserveLink.js +17 -0
- package/build/esm/observable/ObservableClient/ObserveLink.js.map +1 -0
- package/build/esm/observable/ObservableClient/common.js +2 -0
- package/build/esm/observable/ObservableClient/common.js.map +1 -0
- package/build/esm/observable/ObservableClient.js +20 -0
- package/build/esm/observable/ObservableClient.js.map +1 -1
- package/build/esm/observable/Unsubscribable.js +2 -0
- package/build/esm/observable/Unsubscribable.js.map +1 -0
- package/build/esm/observable/computeObjectSetCacheKey.js +64 -0
- package/build/esm/observable/computeObjectSetCacheKey.js.map +1 -0
- package/build/esm/observable/internal/AbstractHelper.js +54 -0
- package/build/esm/observable/internal/AbstractHelper.js.map +1 -0
- package/build/esm/observable/internal/BatchContext.js +2 -0
- package/build/esm/observable/internal/BatchContext.js.map +1 -0
- package/build/esm/observable/internal/BulkObjectLoader.js +3 -3
- package/build/esm/observable/internal/BulkObjectLoader.js.map +1 -1
- package/build/esm/observable/internal/CacheKeys.js +65 -25
- package/build/esm/observable/internal/CacheKeys.js.map +1 -1
- package/build/esm/observable/internal/Changes.js +9 -0
- package/build/esm/observable/internal/Changes.js.map +1 -1
- package/build/esm/observable/internal/KnownCacheKey.js +2 -0
- package/build/esm/observable/internal/KnownCacheKey.js.map +1 -0
- package/build/esm/observable/internal/Layer.js +0 -8
- package/build/esm/observable/internal/Layer.js.map +1 -1
- package/build/esm/observable/internal/Layers.js +151 -0
- package/build/esm/observable/internal/Layers.js.map +1 -0
- package/build/esm/observable/internal/ObservableClientImpl.js +62 -3
- package/build/esm/observable/internal/ObservableClientImpl.js.map +1 -1
- package/build/esm/observable/internal/OrderByCanonicalizer.js +1 -37
- package/build/esm/observable/internal/OrderByCanonicalizer.js.map +1 -1
- package/build/esm/observable/internal/Queries.js +40 -0
- package/build/esm/observable/internal/Queries.js.map +1 -0
- package/build/esm/observable/internal/Query.js +63 -5
- package/build/esm/observable/internal/Query.js.map +1 -1
- package/build/esm/observable/internal/QuerySubscription.js +48 -0
- package/build/esm/observable/internal/QuerySubscription.js.map +1 -0
- package/build/esm/observable/internal/Store.invalidation.test.js +646 -0
- package/build/esm/observable/internal/Store.invalidation.test.js.map +1 -0
- package/build/esm/observable/internal/Store.js +89 -308
- package/build/esm/observable/internal/Store.js.map +1 -1
- package/build/esm/observable/internal/Store.test.js +330 -73
- package/build/esm/observable/internal/Store.test.js.map +1 -1
- package/build/esm/observable/internal/SubjectPayload.js +2 -0
- package/build/esm/observable/internal/SubjectPayload.js.map +1 -0
- package/build/esm/observable/internal/Subjects.js +55 -0
- package/build/esm/observable/internal/Subjects.js.map +1 -0
- package/build/esm/observable/internal/UnsubscribableWrapper.js +30 -0
- package/build/esm/observable/internal/UnsubscribableWrapper.js.map +1 -0
- package/build/esm/observable/internal/WeakRefTrie.js +61 -0
- package/build/esm/observable/internal/WeakRefTrie.js.map +1 -0
- package/build/esm/observable/internal/{ActionApplication.js → actions/ActionApplication.js} +2 -2
- package/build/esm/observable/internal/actions/ActionApplication.js.map +1 -0
- package/build/{browser/observable/internal → esm/observable/internal/actions}/OptimisticJob.js +15 -6
- package/build/esm/observable/internal/actions/OptimisticJob.js.map +1 -0
- package/build/esm/observable/internal/base-list/BaseCollectionQuery.js +2 -0
- package/build/esm/observable/internal/base-list/BaseCollectionQuery.js.map +1 -0
- package/build/esm/observable/internal/base-list/BaseListQuery.js +411 -0
- package/build/esm/observable/internal/base-list/BaseListQuery.js.map +1 -0
- package/build/esm/observable/internal/base-list/createCollectionConnectable.js +50 -0
- package/build/esm/observable/internal/base-list/createCollectionConnectable.js.map +1 -0
- package/build/esm/observable/internal/base-list/createCollectionConnectable.test.js +597 -0
- package/build/esm/observable/internal/base-list/createCollectionConnectable.test.js.map +1 -0
- package/build/esm/observable/internal/base-list/removeDuplicates.js +36 -0
- package/build/esm/observable/internal/base-list/removeDuplicates.js.map +1 -0
- package/build/esm/observable/internal/createInitEntry.js +25 -0
- package/build/esm/observable/internal/createInitEntry.js.map +1 -0
- package/build/esm/observable/internal/getObjectTypesThatInvalidate.js +216 -0
- package/build/esm/observable/internal/getObjectTypesThatInvalidate.js.map +1 -0
- package/build/esm/observable/internal/getObjectTypesThatInvalidate.test.js +382 -0
- package/build/esm/observable/internal/getObjectTypesThatInvalidate.test.js.map +1 -0
- package/build/esm/observable/internal/isObjectInstance.js +23 -0
- package/build/esm/observable/internal/isObjectInstance.js.map +1 -0
- package/build/esm/observable/internal/links/LinksHelper.js +37 -0
- package/build/esm/observable/internal/links/LinksHelper.js.map +1 -0
- package/build/esm/observable/internal/links/SpecificLinkCacheKey.js +2 -0
- package/build/esm/observable/internal/links/SpecificLinkCacheKey.js.map +1 -0
- package/build/esm/observable/internal/links/SpecificLinkQuery.js +185 -0
- package/build/esm/observable/internal/links/SpecificLinkQuery.js.map +1 -0
- package/build/esm/observable/internal/list/InterfaceListQuery.js +83 -0
- package/build/esm/observable/internal/list/InterfaceListQuery.js.map +1 -0
- package/build/esm/observable/internal/list/ListCacheKey.js +2 -0
- package/build/esm/observable/internal/list/ListCacheKey.js.map +1 -0
- package/build/esm/observable/internal/list/ListQuery.js +372 -0
- package/build/esm/observable/internal/list/ListQuery.js.map +1 -0
- package/build/esm/observable/internal/list/ListQueryOptions.js +2 -0
- package/build/esm/observable/internal/list/ListQueryOptions.js.map +1 -0
- package/build/esm/observable/internal/list/ListsHelper.js +51 -0
- package/build/esm/observable/internal/list/ListsHelper.js.map +1 -0
- package/build/esm/observable/internal/list/ObjectListQuery.js +48 -0
- package/build/esm/observable/internal/list/ObjectListQuery.js.map +1 -0
- package/build/esm/observable/internal/object/ObjectCacheKey.js +2 -0
- package/build/esm/observable/internal/object/ObjectCacheKey.js.map +1 -0
- package/build/esm/observable/internal/{ObjectQuery.js → object/ObjectQuery.js} +27 -18
- package/build/esm/observable/internal/object/ObjectQuery.js.map +1 -0
- package/build/esm/observable/internal/object/ObjectsHelper.js +48 -0
- package/build/esm/observable/internal/object/ObjectsHelper.js.map +1 -0
- package/build/esm/observable/internal/objectset/ObjectSetCacheKey.js +2 -0
- package/build/esm/observable/internal/objectset/ObjectSetCacheKey.js.map +1 -0
- package/build/esm/observable/internal/objectset/ObjectSetHelper.js +69 -0
- package/build/esm/observable/internal/objectset/ObjectSetHelper.js.map +1 -0
- package/build/esm/observable/internal/objectset/ObjectSetQuery.js +151 -0
- package/build/esm/observable/internal/objectset/ObjectSetQuery.js.map +1 -0
- package/build/esm/observable/internal/objectset/ObjectSetQueryOptions.js +2 -0
- package/build/esm/observable/internal/objectset/ObjectSetQueryOptions.js.map +1 -0
- package/build/esm/observable/internal/sorting/SortingStrategy.js +78 -0
- package/build/esm/observable/internal/sorting/SortingStrategy.js.map +1 -0
- package/build/esm/observable/internal/testUtils/invalidateList.js +23 -0
- package/build/esm/observable/internal/testUtils/invalidateList.js.map +1 -0
- package/build/esm/observable/internal/testUtils/observeLink/expectStandardObserveLink.js +69 -0
- package/build/esm/observable/internal/testUtils/observeLink/expectStandardObserveLink.js.map +1 -0
- package/build/esm/observable/internal/testUtils/observeObject/expectStandardObserveObject.js +56 -0
- package/build/esm/observable/internal/testUtils/observeObject/expectStandardObserveObject.js.map +1 -0
- package/build/esm/observable/internal/testUtils.js +72 -10
- package/build/esm/observable/internal/testUtils.js.map +1 -1
- package/build/esm/ontology/loadActionMetadata.js +3 -1
- package/build/esm/ontology/loadActionMetadata.js.map +1 -1
- package/build/esm/ontology/loadFullObjectMetadata.js +2 -1
- package/build/esm/ontology/loadFullObjectMetadata.js.map +1 -1
- package/build/esm/ontology/loadInterfaceMetadata.js +2 -1
- package/build/esm/ontology/loadInterfaceMetadata.js.map +1 -1
- package/build/esm/public/unstable-do-not-use.js +1 -0
- package/build/esm/public/unstable-do-not-use.js.map +1 -1
- package/build/esm/queries/applyQuery.js +3 -3
- package/build/esm/queries/applyQuery.js.map +1 -1
- package/build/esm/util/UserAgent.js +2 -2
- package/build/esm/util/UserAgent.js.map +1 -1
- package/build/esm/util/exponentialBackoff.js +51 -0
- package/build/esm/util/exponentialBackoff.js.map +1 -0
- package/build/esm/util/exponentialBackoff.test.js +81 -0
- package/build/esm/util/exponentialBackoff.test.js.map +1 -0
- package/build/esm/util/extractObjectOrInterfaceType.js +9 -1
- package/build/esm/util/extractObjectOrInterfaceType.js.map +1 -1
- package/build/esm/util/extractObjectOrInterfaceType.test.js +2 -2
- package/build/esm/util/extractObjectOrInterfaceType.test.js.map +1 -1
- package/build/esm/util/streamutils.js +1 -1
- package/build/esm/util/streamutils.js.map +1 -1
- package/build/types/Client.d.ts +1 -1
- package/build/types/MinimalClientContext.d.ts +1 -0
- package/build/types/MinimalClientContext.d.ts.map +1 -1
- package/build/types/actions/applyAction.d.ts.map +1 -1
- package/build/types/createClient.d.ts +1 -0
- package/build/types/createClient.d.ts.map +1 -1
- package/build/types/index.d.ts +1 -1
- package/build/types/index.d.ts.map +1 -1
- package/build/types/object/fetchPage.d.ts.map +1 -1
- package/build/types/observable/LinkPayload.d.ts +9 -0
- package/build/types/observable/LinkPayload.d.ts.map +1 -0
- package/build/types/observable/ObjectPayload.d.ts +4 -0
- package/build/types/observable/ObjectPayload.d.ts.map +1 -1
- package/build/types/observable/ObjectSetPayload.d.ts +5 -0
- package/build/types/observable/ObjectSetPayload.d.ts.map +1 -0
- package/build/types/observable/ObservableClient/ObserveLink.d.ts +32 -0
- package/build/types/observable/ObservableClient/ObserveLink.d.ts.map +1 -0
- package/build/types/observable/ObservableClient/common.d.ts +67 -0
- package/build/types/observable/ObservableClient/common.d.ts.map +1 -0
- package/build/types/observable/ObservableClient.d.ts +136 -16
- package/build/types/observable/ObservableClient.d.ts.map +1 -1
- package/build/types/observable/Unsubscribable.d.ts +3 -0
- package/build/types/observable/Unsubscribable.d.ts.map +1 -0
- package/build/types/observable/computeObjectSetCacheKey.d.ts +16 -0
- package/build/types/observable/computeObjectSetCacheKey.d.ts.map +1 -0
- package/build/types/observable/internal/AbstractHelper.d.ts +17 -0
- package/build/types/observable/internal/AbstractHelper.d.ts.map +1 -0
- package/build/types/observable/internal/BatchContext.d.ts +11 -0
- package/build/types/observable/internal/BatchContext.d.ts.map +1 -0
- package/build/types/observable/internal/BulkObjectLoader.d.ts.map +1 -1
- package/build/types/observable/internal/CacheKeys.d.ts +12 -6
- package/build/types/observable/internal/CacheKeys.d.ts.map +1 -1
- package/build/types/observable/internal/Changes.d.ts +10 -5
- package/build/types/observable/internal/Changes.d.ts.map +1 -1
- package/build/types/observable/internal/KnownCacheKey.d.ts +5 -0
- package/build/types/observable/internal/KnownCacheKey.d.ts.map +1 -0
- package/build/types/observable/internal/Layer.d.ts +6 -7
- package/build/types/observable/internal/Layer.d.ts.map +1 -1
- package/build/types/observable/internal/Layers.d.ts +26 -0
- package/build/types/observable/internal/Layers.d.ts.map +1 -0
- package/build/types/observable/internal/OrderByCanonicalizer.d.ts +0 -7
- package/build/types/observable/internal/OrderByCanonicalizer.d.ts.map +1 -1
- package/build/types/observable/internal/Queries.d.ts +9 -0
- package/build/types/observable/internal/Queries.d.ts.map +1 -0
- package/build/types/observable/internal/Query.d.ts +23 -6
- package/build/types/observable/internal/Query.d.ts.map +1 -1
- package/build/types/observable/internal/QuerySubscription.d.ts +1 -0
- package/build/types/observable/internal/QuerySubscription.d.ts.map +1 -0
- package/build/types/observable/internal/Store.d.ts +43 -51
- package/build/types/observable/internal/Store.d.ts.map +1 -1
- package/build/types/observable/internal/Store.invalidation.test.d.ts +1 -0
- package/build/types/observable/internal/Store.invalidation.test.d.ts.map +1 -0
- package/build/types/observable/internal/Store.test.d.ts +4 -1
- package/build/types/observable/internal/Store.test.d.ts.map +1 -1
- package/build/types/observable/internal/SubjectPayload.d.ts +5 -0
- package/build/types/observable/internal/SubjectPayload.d.ts.map +1 -0
- package/build/types/observable/internal/Subjects.d.ts +16 -0
- package/build/types/observable/internal/Subjects.d.ts.map +1 -0
- package/build/types/observable/internal/UnsubscribableWrapper.d.ts +1 -0
- package/build/types/observable/internal/UnsubscribableWrapper.d.ts.map +1 -0
- package/build/types/observable/internal/WeakRefTrie.d.ts +13 -0
- package/build/types/observable/internal/WeakRefTrie.d.ts.map +1 -0
- package/build/types/observable/internal/{ActionApplication.d.ts → actions/ActionApplication.d.ts} +2 -2
- package/build/types/observable/internal/{ActionApplication.d.ts.map → actions/ActionApplication.d.ts.map} +1 -1
- package/build/types/observable/internal/{OptimisticJob.d.ts → actions/OptimisticJob.d.ts} +4 -4
- package/build/types/observable/internal/actions/OptimisticJob.d.ts.map +1 -0
- package/build/types/observable/internal/base-list/BaseCollectionQuery.d.ts +64 -0
- package/build/types/observable/internal/base-list/BaseCollectionQuery.d.ts.map +1 -0
- package/build/types/observable/internal/base-list/BaseListQuery.d.ts +145 -0
- package/build/types/observable/internal/base-list/BaseListQuery.d.ts.map +1 -0
- package/build/types/observable/internal/base-list/createCollectionConnectable.d.ts +39 -0
- package/build/types/observable/internal/base-list/createCollectionConnectable.d.ts.map +1 -0
- package/build/types/observable/internal/base-list/createCollectionConnectable.test.d.ts +1 -0
- package/build/types/observable/internal/base-list/createCollectionConnectable.test.d.ts.map +1 -0
- package/build/types/observable/internal/base-list/removeDuplicates.d.ts +11 -0
- package/build/types/observable/internal/base-list/removeDuplicates.d.ts.map +1 -0
- package/build/types/observable/internal/createInitEntry.d.ts +3 -0
- package/build/types/observable/internal/createInitEntry.d.ts.map +1 -0
- package/build/types/observable/internal/getObjectTypesThatInvalidate.d.ts +9 -0
- package/build/types/observable/internal/getObjectTypesThatInvalidate.d.ts.map +1 -0
- package/build/types/observable/internal/getObjectTypesThatInvalidate.test.d.ts +1 -0
- package/build/types/observable/internal/getObjectTypesThatInvalidate.test.d.ts.map +1 -0
- package/build/types/observable/internal/isObjectInstance.d.ts +5 -0
- package/build/types/observable/internal/isObjectInstance.d.ts.map +1 -0
- package/build/types/observable/internal/links/LinksHelper.d.ts +31 -0
- package/build/types/observable/internal/links/LinksHelper.d.ts.map +1 -0
- package/build/types/observable/internal/links/SpecificLinkCacheKey.d.ts +17 -0
- package/build/types/observable/internal/links/SpecificLinkCacheKey.d.ts.map +1 -0
- package/build/types/observable/internal/links/SpecificLinkQuery.d.ts +47 -0
- package/build/types/observable/internal/links/SpecificLinkQuery.d.ts.map +1 -0
- package/build/types/observable/internal/list/InterfaceListQuery.d.ts +18 -0
- package/build/types/observable/internal/list/InterfaceListQuery.d.ts.map +1 -0
- package/build/types/observable/internal/list/ListCacheKey.d.ts +7 -0
- package/build/types/observable/internal/list/ListCacheKey.d.ts.map +1 -0
- package/build/types/observable/internal/list/ListQuery.d.ts +106 -0
- package/build/types/observable/internal/list/ListQuery.d.ts.map +1 -0
- package/build/types/observable/internal/list/ListQueryOptions.d.ts +4 -0
- package/build/types/observable/internal/list/ListQueryOptions.d.ts.map +1 -0
- package/build/types/observable/internal/list/ListsHelper.d.ts +19 -0
- package/build/types/observable/internal/list/ListsHelper.d.ts.map +1 -0
- package/build/types/observable/internal/list/ObjectListQuery.d.ts +18 -0
- package/build/types/observable/internal/list/ObjectListQuery.d.ts.map +1 -0
- package/build/types/observable/internal/object/ObjectCacheKey.d.ts +5 -0
- package/build/types/observable/internal/object/ObjectCacheKey.d.ts.map +1 -0
- package/build/types/observable/internal/{ObjectQuery.d.ts → object/ObjectQuery.d.ts} +11 -9
- package/build/types/observable/internal/object/ObjectQuery.d.ts.map +1 -0
- package/build/types/observable/internal/object/ObjectsHelper.d.ts +11 -0
- package/build/types/observable/internal/object/ObjectsHelper.d.ts.map +1 -0
- package/build/types/observable/internal/objectset/ObjectSetCacheKey.d.ts +16 -0
- package/build/types/observable/internal/objectset/ObjectSetCacheKey.d.ts.map +1 -0
- package/build/types/observable/internal/objectset/ObjectSetHelper.d.ts +19 -0
- package/build/types/observable/internal/objectset/ObjectSetHelper.d.ts.map +1 -0
- package/build/types/observable/internal/objectset/ObjectSetQuery.d.ts +34 -0
- package/build/types/observable/internal/objectset/ObjectSetQuery.d.ts.map +1 -0
- package/build/types/observable/internal/objectset/ObjectSetQueryOptions.d.ts +18 -0
- package/build/types/observable/internal/objectset/ObjectSetQueryOptions.d.ts.map +1 -0
- package/build/types/observable/internal/sorting/SortingStrategy.d.ts +41 -0
- package/build/types/observable/internal/sorting/SortingStrategy.d.ts.map +1 -0
- package/build/types/observable/internal/testUtils/invalidateList.d.ts +9 -0
- package/build/types/observable/internal/testUtils/invalidateList.d.ts.map +1 -0
- package/build/types/observable/internal/testUtils/observeLink/expectStandardObserveLink.d.ts +46 -0
- package/build/types/observable/internal/testUtils/observeLink/expectStandardObserveLink.d.ts.map +1 -0
- package/build/types/observable/internal/testUtils/observeObject/expectStandardObserveObject.d.ts +26 -0
- package/build/types/observable/internal/testUtils/observeObject/expectStandardObserveObject.d.ts.map +1 -0
- package/build/types/observable/internal/testUtils.d.ts +26 -4
- package/build/types/observable/internal/testUtils.d.ts.map +1 -1
- package/build/types/public/unstable-do-not-use.d.ts +5 -2
- package/build/types/public/unstable-do-not-use.d.ts.map +1 -1
- package/build/types/util/exponentialBackoff.d.ts +14 -0
- package/build/types/util/exponentialBackoff.d.ts.map +1 -0
- package/build/types/util/exponentialBackoff.test.d.ts +1 -0
- package/build/types/util/exponentialBackoff.test.d.ts.map +1 -0
- package/package.json +25 -25
- package/build/browser/observable/internal/ActionApplication.js.map +0 -1
- package/build/browser/observable/internal/ListQuery.js +0 -618
- package/build/browser/observable/internal/ListQuery.js.map +0 -1
- package/build/browser/observable/internal/ObjectQuery.js.map +0 -1
- package/build/browser/observable/internal/OptimisticJob.js.map +0 -1
- package/build/cjs/chunk-BJYCRD5Y.cjs.map +0 -1
- package/build/cjs/chunk-URDXPIRU.cjs.map +0 -1
- package/build/esm/observable/internal/ActionApplication.js.map +0 -1
- package/build/esm/observable/internal/ListQuery.js +0 -618
- package/build/esm/observable/internal/ListQuery.js.map +0 -1
- package/build/esm/observable/internal/ObjectQuery.js.map +0 -1
- package/build/esm/observable/internal/OptimisticJob.js.map +0 -1
- package/build/types/observable/internal/ListQuery.d.ts +0 -88
- package/build/types/observable/internal/ListQuery.d.ts.map +0 -1
- package/build/types/observable/internal/ObjectQuery.d.ts.map +0 -1
- package/build/types/observable/internal/OptimisticJob.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applyQuery.js","names":["OntologiesV2","invariant","createObjectSet","hydrateAttachmentFromRidInternal","addUserAgentAndRequestContextHeaders","augmentRequestContext","createObjectSpecifierFromInterfaceSpecifier","createObjectSpecifierFromPrimaryKey","toDataValueQueries","applyQuery","client","query","params","qd","ontologyProvider","getQueryDefinition","apiName","isFixedVersion","version","undefined","response","Queries","execute","finalMethodCall","ontologyRid","parameters","remapQueryParams","objectOutputDefs","getRequiredDefinitions","output","remappedResponse","remapQueryResponse","value","paramTypes","parameterMap","key","Object","entries","responseDataType","responseValue","definitions","nullable","Error","multiplicity","withoutMultiplicity","i","length","type","set","def","get","object","createQueryObjectResponse","interface","createQueryInterfaceResponse","objectSet","objectSets","objectType","reference","subtype","struct","requiresConversion","map","Array","isArray","process","env","NODE_ENV","entry","keyType","getObjectSpecifier","valueType","result","groups","push","subResult","subKey","dataType","Map","objectDef","getObjectDefinition","interfaceDef","getInterfaceDefinition","types","allDefs","Promise","all","defs","structValues","values","some","primaryKey","objectTypeApiName","$apiName","$title","$objectType","$primaryKey","$objectSpecifier","interfaceSpecifier","primaryKeyValue"],"sources":["applyQuery.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n AllowedBucketKeyTypes,\n AllowedBucketTypes,\n CompileTimeMetadata,\n InterfaceDefinition,\n ObjectOrInterfaceDefinition,\n ObjectTypeDefinition,\n OsdkBase,\n PrimaryKeyType,\n QueryDataTypeDefinition,\n QueryDefinition,\n QueryParameterDefinition,\n} from \"@osdk/api\";\nimport type { DataValue } from \"@osdk/foundry.ontologies\";\nimport * as OntologiesV2 from \"@osdk/foundry.ontologies\";\nimport invariant from \"tiny-invariant\";\nimport type { MinimalClient } from \"../MinimalClientContext.js\";\nimport { createObjectSet } from \"../objectSet/createObjectSet.js\";\nimport { hydrateAttachmentFromRidInternal } from \"../public-utils/hydrateAttachmentFromRid.js\";\nimport { addUserAgentAndRequestContextHeaders } from \"../util/addUserAgentAndRequestContextHeaders.js\";\nimport { augmentRequestContext } from \"../util/augmentRequestContext.js\";\nimport {\n createObjectSpecifierFromInterfaceSpecifier,\n createObjectSpecifierFromPrimaryKey,\n} from \"../util/objectSpecifierUtils.js\";\nimport { toDataValueQueries } from \"../util/toDataValueQueries.js\";\nimport type { QueryParameterType, QueryReturnType } from \"./types.js\";\n\nexport async function applyQuery<\n QD extends QueryDefinition<any>,\n P extends QueryParameterType<CompileTimeMetadata<QD>[\"parameters\"]>,\n>(\n client: MinimalClient,\n query: QD,\n params?: P,\n): Promise<\n QueryReturnType<CompileTimeMetadata<QD>[\"output\"]>\n> {\n const qd = await client.ontologyProvider.getQueryDefinition(\n query.apiName,\n query.isFixedVersion ? query.version : undefined,\n );\n\n const response = await OntologiesV2.Queries.execute(\n addUserAgentAndRequestContextHeaders(\n augmentRequestContext(client, _ => ({ finalMethodCall: \"applyQuery\" })),\n query,\n ),\n await client.ontologyRid,\n query.apiName,\n {\n parameters: params\n ? await remapQueryParams(\n params as { [parameterId: string]: any },\n client,\n qd.parameters,\n )\n : {},\n },\n { version: qd.version },\n );\n const objectOutputDefs = await getRequiredDefinitions(qd.output, client);\n const remappedResponse = await remapQueryResponse(\n client,\n qd.output,\n response.value,\n objectOutputDefs,\n );\n return remappedResponse as QueryReturnType<CompileTimeMetadata<QD>[\"output\"]>;\n}\n\nasync function remapQueryParams(\n params: { [parameterId: string]: any },\n client: MinimalClient,\n paramTypes: Record<string, QueryParameterDefinition<any>>,\n): Promise<{ [parameterId: string]: any }> {\n const parameterMap: { [parameterName: string]: unknown } = {};\n for (const [key, value] of Object.entries(params)) {\n parameterMap[key] = await toDataValueQueries(\n value,\n client,\n paramTypes[key],\n );\n }\n return parameterMap;\n}\n\nasync function remapQueryResponse<\n Q extends ObjectTypeDefinition,\n T extends QueryDataTypeDefinition<Q | never>,\n>(\n client: MinimalClient,\n responseDataType: T,\n responseValue: DataValue,\n definitions: Map<string, ObjectOrInterfaceDefinition>,\n): Promise<QueryReturnType<T>> {\n // handle null responses\n if (responseValue == null) {\n if (responseDataType.nullable) {\n return undefined as unknown as QueryReturnType<typeof responseDataType>;\n } else {\n throw new Error(\"Got null response when nullable was not allowed\");\n }\n }\n\n if (\n responseDataType.multiplicity != null\n && responseDataType.multiplicity\n ) {\n const withoutMultiplicity = { ...responseDataType, multiplicity: false };\n for (let i = 0; i < responseValue.length; i++) {\n responseValue[i] = await remapQueryResponse(\n client,\n withoutMultiplicity,\n responseValue[i],\n definitions,\n );\n }\n return responseValue as QueryReturnType<typeof responseDataType>;\n }\n\n switch (responseDataType.type) {\n case \"union\": {\n throw new Error(\"Union return types are not yet supported\");\n }\n\n case \"set\": {\n for (let i = 0; i < responseValue.length; i++) {\n responseValue[i] = await remapQueryResponse(\n client,\n responseDataType.set,\n responseValue[i],\n definitions,\n );\n }\n\n return responseValue as QueryReturnType<typeof responseDataType>;\n }\n\n case \"attachment\": {\n return hydrateAttachmentFromRidInternal(\n client,\n responseValue,\n ) as QueryReturnType<\n typeof responseDataType\n >;\n }\n case \"object\": {\n const def = definitions.get(responseDataType.object);\n if (!def || def.type !== \"object\") {\n throw new Error(\n `Missing definition for ${responseDataType.object}`,\n );\n }\n return createQueryObjectResponse(\n responseValue,\n def,\n ) as QueryReturnType<\n typeof responseDataType\n >;\n }\n\n case \"interface\": {\n const def = definitions.get(responseDataType.interface);\n if (!def || def.type !== \"interface\") {\n throw new Error(\n `Missing definition for ${responseDataType.interface}`,\n );\n }\n\n return createQueryInterfaceResponse(\n responseValue,\n def,\n ) as QueryReturnType<\n typeof responseDataType\n >;\n }\n\n case \"objectSet\": {\n const def = definitions.get(responseDataType.objectSet);\n if (!def) {\n throw new Error(\n `Missing definition for ${responseDataType.objectSet}`,\n );\n }\n if (typeof responseValue === \"string\") {\n return createObjectSet(def, client, {\n type: \"intersect\",\n objectSets: [\n { type: \"base\", objectType: responseDataType.objectSet },\n { type: \"reference\", reference: responseValue },\n ],\n }) as QueryReturnType<typeof responseDataType>;\n }\n\n return createObjectSet(\n def,\n client,\n responseValue,\n ) as QueryReturnType<\n typeof responseDataType\n >;\n }\n case \"struct\": {\n // figure out what keys need to be fixed up\n for (const [key, subtype] of Object.entries(responseDataType.struct)) {\n if (requiresConversion(subtype)) {\n responseValue[key] = await remapQueryResponse(\n client,\n subtype,\n responseValue[key],\n definitions,\n );\n }\n }\n\n return responseValue as QueryReturnType<typeof responseDataType>;\n }\n\n case \"map\": {\n const map = {} as any;\n\n invariant(Array.isArray(responseValue), \"Expected array entry\");\n for (const entry of responseValue) {\n invariant(entry.key, \"Expected key\");\n invariant(entry.value, \"Expected value\");\n const key = responseDataType.keyType.type === \"object\"\n ? getObjectSpecifier(\n entry.key,\n responseDataType.keyType.object,\n definitions,\n )\n : entry.key;\n const value = await remapQueryResponse(\n client,\n responseDataType.valueType,\n entry.value,\n definitions,\n );\n map[key] = value;\n }\n return map;\n }\n\n case \"twoDimensionalAggregation\": {\n const result: {\n key: AllowedBucketKeyTypes;\n value: AllowedBucketTypes;\n }[] = [];\n for (const { key, value } of responseValue.groups) {\n result.push({ key, value });\n }\n return result as QueryReturnType<typeof responseDataType>;\n }\n\n case \"threeDimensionalAggregation\": {\n const result: {\n key: AllowedBucketKeyTypes;\n groups: { key: AllowedBucketKeyTypes; value: AllowedBucketTypes }[];\n }[] = [];\n for (const { key, groups } of responseValue.groups) {\n const subResult: { key: any; value: any }[] = [];\n for (const { key: subKey, value } of groups) {\n subResult.push({ key: subKey, value });\n }\n result.push({ key, groups: subResult });\n }\n return result as QueryReturnType<typeof responseDataType>;\n }\n }\n\n return responseValue as QueryReturnType<typeof responseDataType>;\n}\n\nasync function getRequiredDefinitions(\n dataType: QueryDataTypeDefinition,\n client: MinimalClient,\n): Promise<Map<string, ObjectOrInterfaceDefinition>> {\n const result = new Map<string, ObjectOrInterfaceDefinition>();\n switch (dataType.type) {\n case \"objectSet\": {\n const objectDef = await client.ontologyProvider.getObjectDefinition(\n dataType.objectSet,\n );\n result.set(dataType.objectSet, objectDef);\n break;\n }\n case \"object\": {\n const objectDef = await client.ontologyProvider.getObjectDefinition(\n dataType.object,\n );\n result.set(dataType.object, objectDef);\n break;\n }\n\n case \"interface\": {\n const interfaceDef = await client.ontologyProvider.getInterfaceDefinition(\n dataType.interface,\n );\n result.set(dataType.interface, interfaceDef);\n break;\n }\n\n case \"set\": {\n return getRequiredDefinitions(dataType.set, client);\n }\n\n case \"map\": {\n const types = [dataType.keyType, dataType.valueType];\n\n const allDefs = await Promise.all(\n types.map(value => getRequiredDefinitions(value, client)),\n );\n\n for (const defs of allDefs) {\n for (const [type, objectDef] of defs) {\n result.set(type, objectDef);\n }\n }\n break;\n }\n\n case \"struct\": {\n const structValues = Object.values(dataType.struct);\n\n const allDefs = await Promise.all(\n structValues.map(value => getRequiredDefinitions(value, client)),\n );\n\n for (const defs of allDefs) {\n for (const [type, objectDef] of defs) {\n result.set(type, objectDef);\n }\n }\n break;\n }\n case \"attachment\":\n case \"boolean\":\n case \"date\":\n case \"double\":\n case \"float\":\n case \"integer\":\n case \"long\":\n case \"string\":\n case \"threeDimensionalAggregation\":\n case \"timestamp\":\n case \"twoDimensionalAggregation\":\n case \"union\":\n break;\n }\n\n return result;\n}\nfunction requiresConversion(dataType: QueryDataTypeDefinition) {\n switch (dataType.type) {\n case \"boolean\":\n case \"date\":\n case \"double\":\n case \"float\":\n case \"integer\":\n case \"long\":\n case \"string\":\n case \"timestamp\":\n return false;\n\n case \"union\":\n return true;\n\n case \"struct\":\n return Object.values(dataType.struct).some(requiresConversion);\n\n case \"set\":\n return requiresConversion(dataType.set);\n\n case \"attachment\":\n case \"objectSet\":\n case \"twoDimensionalAggregation\":\n case \"threeDimensionalAggregation\":\n case \"object\":\n return true;\n\n default:\n return false;\n }\n}\n\nfunction getObjectSpecifier(\n primaryKey: any,\n objectTypeApiName: string,\n definitions: Map<string, ObjectOrInterfaceDefinition>,\n): string {\n const def = definitions.get(objectTypeApiName);\n if (!def || def.type !== \"object\") {\n throw new Error(\n `Missing definition for ${objectTypeApiName}`,\n );\n }\n return createObjectSpecifierFromPrimaryKey(\n def,\n primaryKey,\n );\n}\n\nexport function createQueryObjectResponse<\n Q extends ObjectTypeDefinition,\n>(\n primaryKey: PrimaryKeyType<Q>,\n objectDef: Q,\n): OsdkBase<Q> {\n return {\n $apiName: objectDef.apiName,\n $title: undefined,\n $objectType: objectDef.apiName,\n $primaryKey: primaryKey,\n $objectSpecifier: createObjectSpecifierFromPrimaryKey(\n objectDef,\n primaryKey,\n ),\n };\n}\n\nexport function createQueryInterfaceResponse<\n Q extends InterfaceDefinition,\n>(\n interfaceSpecifier: {\n objectTypeApiName: string;\n primaryKeyValue: PrimaryKeyType<Q>;\n },\n interfaceDef: Q,\n): OsdkBase<Q> {\n return {\n $apiName: interfaceDef.apiName,\n $title: undefined,\n $objectType: interfaceSpecifier.objectTypeApiName,\n $primaryKey: interfaceSpecifier.primaryKeyValue,\n $objectSpecifier: createObjectSpecifierFromInterfaceSpecifier(\n interfaceDef,\n interfaceSpecifier,\n ),\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgBA,OAAO,KAAKA,YAAY,MAAM,0BAA0B;AACxD,OAAOC,SAAS,MAAM,gBAAgB;AAEtC,SAASC,eAAe,QAAQ,iCAAiC;AACjE,SAASC,gCAAgC,QAAQ,6CAA6C;AAC9F,SAASC,oCAAoC,QAAQ,iDAAiD;AACtG,SAASC,qBAAqB,QAAQ,kCAAkC;AACxE,SACEC,2CAA2C,EAC3CC,mCAAmC,QAC9B,iCAAiC;AACxC,SAASC,kBAAkB,QAAQ,+BAA+B;AAGlE,OAAO,eAAeC,UAAUA,CAI9BC,MAAqB,EACrBC,KAAS,EACTC,MAAU,EAGV;EACA,MAAMC,EAAE,GAAG,MAAMH,MAAM,CAACI,gBAAgB,CAACC,kBAAkB,CACzDJ,KAAK,CAACK,OAAO,EACbL,KAAK,CAACM,cAAc,GAAGN,KAAK,CAACO,OAAO,GAAGC,SACzC,CAAC;EAED,MA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AO;IAC9BgF,WAAW,EAAEL,UAAU;IACvBM,gBAAgB,EAAE1F,mCAAmC,CACnDwE,SAAS,EACTY,UACF;EACF,CAAC;AACH;AAEA,OAAO,SAASrC,4BAA4BA,CAG1C4C,kBAGC,EACDjB,YAAe,EACF;EACb,OAAO;IACLY,QAAQ,EAAEZ,YAAY,CAACjE,OAAO;IAC9B8E,MAAM,EAAE3E,SAAS;IACjB4E,WAAW,EAAEG,kBAAkB,CAACN,iBAAiB;IACjDI,WAAW,EAAEE,kBAAkB,CAACC,eAAe;IAC/CF,gBAAgB,EAAE3F,2CAA2C,CAC3D2E,YAAY,EACZiB,kBACF;EACF,CAAC;AACH","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"applyQuery.js","names":["OntologiesV2","invariant","createObjectSet","hydrateAttachmentFromRidInternal","addUserAgentAndRequestContextHeaders","augmentRequestContext","createObjectSpecifierFromInterfaceSpecifier","createObjectSpecifierFromPrimaryKey","toDataValueQueries","applyQuery","client","query","params","qd","ontologyProvider","getQueryDefinition","apiName","isFixedVersion","version","undefined","response","Queries","execute","finalMethodCall","ontologyRid","parameters","remapQueryParams","objectOutputDefs","getRequiredDefinitions","output","remappedResponse","remapQueryResponse","value","paramTypes","parameterMap","key","Object","entries","responseDataType","responseValue","definitions","nullable","Error","multiplicity","withoutMultiplicity","i","length","type","set","def","get","object","createQueryObjectResponse","interface","createQueryInterfaceResponse","objectSet","objectSets","objectType","reference","subtype","struct","requiresConversion","map","Array","isArray","process","env","NODE_ENV","entry","keyType","getObjectSpecifier","valueType","result","groups","push","subResult","subKey","dataType","Map","objectDef","getObjectDefinition","interfaceDef","getInterfaceDefinition","types","allDefs","Promise","all","defs","structValues","values","some","primaryKey","objectTypeApiName","$apiName","$title","$objectType","$primaryKey","$objectSpecifier","interfaceSpecifier","primaryKeyValue"],"sources":["applyQuery.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n AllowedBucketKeyTypes,\n AllowedBucketTypes,\n CompileTimeMetadata,\n InterfaceDefinition,\n ObjectOrInterfaceDefinition,\n ObjectTypeDefinition,\n OsdkBase,\n PrimaryKeyType,\n QueryDataTypeDefinition,\n QueryDefinition,\n QueryParameterDefinition,\n} from \"@osdk/api\";\nimport type { DataValue } from \"@osdk/foundry.ontologies\";\nimport * as OntologiesV2 from \"@osdk/foundry.ontologies\";\nimport invariant from \"tiny-invariant\";\nimport type { MinimalClient } from \"../MinimalClientContext.js\";\nimport { createObjectSet } from \"../objectSet/createObjectSet.js\";\nimport { hydrateAttachmentFromRidInternal } from \"../public-utils/hydrateAttachmentFromRid.js\";\nimport { addUserAgentAndRequestContextHeaders } from \"../util/addUserAgentAndRequestContextHeaders.js\";\nimport { augmentRequestContext } from \"../util/augmentRequestContext.js\";\nimport {\n createObjectSpecifierFromInterfaceSpecifier,\n createObjectSpecifierFromPrimaryKey,\n} from \"../util/objectSpecifierUtils.js\";\nimport { toDataValueQueries } from \"../util/toDataValueQueries.js\";\nimport type { QueryParameterType, QueryReturnType } from \"./types.js\";\n\nexport async function applyQuery<\n QD extends QueryDefinition<any>,\n P extends QueryParameterType<CompileTimeMetadata<QD>[\"parameters\"]>,\n>(\n client: MinimalClient,\n query: QD,\n params?: P,\n): Promise<\n QueryReturnType<CompileTimeMetadata<QD>[\"output\"]>\n> {\n const qd = await client.ontologyProvider.getQueryDefinition(\n query.apiName,\n query.isFixedVersion ? query.version : undefined,\n );\n\n const response = await OntologiesV2.Queries.execute(\n addUserAgentAndRequestContextHeaders(\n augmentRequestContext(client, _ => ({ finalMethodCall: \"applyQuery\" })),\n query,\n ),\n await client.ontologyRid,\n query.apiName,\n {\n parameters: params\n ? await remapQueryParams(\n params as { [parameterId: string]: any },\n client,\n qd.parameters,\n )\n : {},\n },\n { version: query.isFixedVersion ? query.version : undefined },\n );\n const objectOutputDefs = await getRequiredDefinitions(qd.output, client);\n const remappedResponse = await remapQueryResponse(\n client,\n qd.output,\n response.value,\n objectOutputDefs,\n );\n return remappedResponse as QueryReturnType<CompileTimeMetadata<QD>[\"output\"]>;\n}\n\nasync function remapQueryParams(\n params: { [parameterId: string]: any },\n client: MinimalClient,\n paramTypes: Record<string, QueryParameterDefinition<any>>,\n): Promise<{ [parameterId: string]: any }> {\n const parameterMap: { [parameterName: string]: unknown } = {};\n for (const [key, value] of Object.entries(params)) {\n parameterMap[key] = await toDataValueQueries(\n value,\n client,\n paramTypes[key],\n );\n }\n return parameterMap;\n}\n\nasync function remapQueryResponse<\n Q extends ObjectTypeDefinition,\n T extends QueryDataTypeDefinition<Q | never>,\n>(\n client: MinimalClient,\n responseDataType: T,\n responseValue: DataValue,\n definitions: Map<string, ObjectOrInterfaceDefinition>,\n): Promise<QueryReturnType<T>> {\n // handle null responses\n if (responseValue == null) {\n if (responseDataType.nullable) {\n return undefined as unknown as QueryReturnType<typeof responseDataType>;\n } else {\n throw new Error(\"Got null response when nullable was not allowed\");\n }\n }\n\n if (\n responseDataType.multiplicity != null\n && responseDataType.multiplicity\n ) {\n const withoutMultiplicity = { ...responseDataType, multiplicity: false };\n for (let i = 0; i < responseValue.length; i++) {\n responseValue[i] = await remapQueryResponse(\n client,\n withoutMultiplicity,\n responseValue[i],\n definitions,\n );\n }\n return responseValue as QueryReturnType<typeof responseDataType>;\n }\n\n switch (responseDataType.type) {\n case \"union\": {\n throw new Error(\"Union return types are not yet supported\");\n }\n\n case \"set\": {\n for (let i = 0; i < responseValue.length; i++) {\n responseValue[i] = await remapQueryResponse(\n client,\n responseDataType.set,\n responseValue[i],\n definitions,\n );\n }\n\n return responseValue as QueryReturnType<typeof responseDataType>;\n }\n\n case \"attachment\": {\n return hydrateAttachmentFromRidInternal(\n client,\n responseValue,\n ) as QueryReturnType<\n typeof responseDataType\n >;\n }\n case \"object\": {\n const def = definitions.get(responseDataType.object);\n if (!def || def.type !== \"object\") {\n throw new Error(\n `Missing definition for ${responseDataType.object}`,\n );\n }\n return createQueryObjectResponse(\n responseValue,\n def,\n ) as QueryReturnType<\n typeof responseDataType\n >;\n }\n\n case \"interface\": {\n const def = definitions.get(responseDataType.interface);\n if (!def || def.type !== \"interface\") {\n throw new Error(\n `Missing definition for ${responseDataType.interface}`,\n );\n }\n\n return createQueryInterfaceResponse(\n responseValue,\n def,\n ) as QueryReturnType<\n typeof responseDataType\n >;\n }\n\n case \"objectSet\": {\n const def = definitions.get(responseDataType.objectSet);\n if (!def) {\n throw new Error(\n `Missing definition for ${responseDataType.objectSet}`,\n );\n }\n if (typeof responseValue === \"string\") {\n return createObjectSet(def, client, {\n type: \"intersect\",\n objectSets: [\n { type: \"base\", objectType: responseDataType.objectSet },\n { type: \"reference\", reference: responseValue },\n ],\n }) as QueryReturnType<typeof responseDataType>;\n }\n\n return createObjectSet(\n def,\n client,\n responseValue,\n ) as QueryReturnType<\n typeof responseDataType\n >;\n }\n case \"struct\": {\n // figure out what keys need to be fixed up\n for (const [key, subtype] of Object.entries(responseDataType.struct)) {\n if (requiresConversion(subtype)) {\n responseValue[key] = await remapQueryResponse(\n client,\n subtype,\n responseValue[key],\n definitions,\n );\n }\n }\n\n return responseValue as QueryReturnType<typeof responseDataType>;\n }\n\n case \"map\": {\n const map = {} as any;\n\n invariant(Array.isArray(responseValue), \"Expected array entry\");\n for (const entry of responseValue) {\n invariant(entry.key != null, \"Expected key\");\n invariant(entry.value != null, \"Expected value\");\n const key = responseDataType.keyType.type === \"object\"\n ? getObjectSpecifier(\n entry.key,\n responseDataType.keyType.object,\n definitions,\n )\n : entry.key;\n const value = await remapQueryResponse(\n client,\n responseDataType.valueType,\n entry.value,\n definitions,\n );\n map[key] = value;\n }\n return map;\n }\n\n case \"twoDimensionalAggregation\": {\n const result: {\n key: AllowedBucketKeyTypes;\n value: AllowedBucketTypes;\n }[] = [];\n for (const { key, value } of responseValue.groups) {\n result.push({ key, value });\n }\n return result as QueryReturnType<typeof responseDataType>;\n }\n\n case \"threeDimensionalAggregation\": {\n const result: {\n key: AllowedBucketKeyTypes;\n groups: { key: AllowedBucketKeyTypes; value: AllowedBucketTypes }[];\n }[] = [];\n for (const { key, groups } of responseValue.groups) {\n const subResult: { key: any; value: any }[] = [];\n for (const { key: subKey, value } of groups) {\n subResult.push({ key: subKey, value });\n }\n result.push({ key, groups: subResult });\n }\n return result as QueryReturnType<typeof responseDataType>;\n }\n }\n\n return responseValue as QueryReturnType<typeof responseDataType>;\n}\n\nasync function getRequiredDefinitions(\n dataType: QueryDataTypeDefinition,\n client: MinimalClient,\n): Promise<Map<string, ObjectOrInterfaceDefinition>> {\n const result = new Map<string, ObjectOrInterfaceDefinition>();\n switch (dataType.type) {\n case \"objectSet\": {\n const objectDef = await client.ontologyProvider.getObjectDefinition(\n dataType.objectSet,\n );\n result.set(dataType.objectSet, objectDef);\n break;\n }\n case \"object\": {\n const objectDef = await client.ontologyProvider.getObjectDefinition(\n dataType.object,\n );\n result.set(dataType.object, objectDef);\n break;\n }\n\n case \"interface\": {\n const interfaceDef = await client.ontologyProvider.getInterfaceDefinition(\n dataType.interface,\n );\n result.set(dataType.interface, interfaceDef);\n break;\n }\n\n case \"set\": {\n return getRequiredDefinitions(dataType.set, client);\n }\n\n case \"map\": {\n const types = [dataType.keyType, dataType.valueType];\n\n const allDefs = await Promise.all(\n types.map(value => getRequiredDefinitions(value, client)),\n );\n\n for (const defs of allDefs) {\n for (const [type, objectDef] of defs) {\n result.set(type, objectDef);\n }\n }\n break;\n }\n\n case \"struct\": {\n const structValues = Object.values(dataType.struct);\n\n const allDefs = await Promise.all(\n structValues.map(value => getRequiredDefinitions(value, client)),\n );\n\n for (const defs of allDefs) {\n for (const [type, objectDef] of defs) {\n result.set(type, objectDef);\n }\n }\n break;\n }\n case \"attachment\":\n case \"boolean\":\n case \"date\":\n case \"double\":\n case \"float\":\n case \"integer\":\n case \"long\":\n case \"string\":\n case \"threeDimensionalAggregation\":\n case \"timestamp\":\n case \"twoDimensionalAggregation\":\n case \"union\":\n break;\n }\n\n return result;\n}\nfunction requiresConversion(dataType: QueryDataTypeDefinition) {\n switch (dataType.type) {\n case \"boolean\":\n case \"date\":\n case \"double\":\n case \"float\":\n case \"integer\":\n case \"long\":\n case \"string\":\n case \"timestamp\":\n return false;\n\n case \"union\":\n return true;\n\n case \"struct\":\n return Object.values(dataType.struct).some(requiresConversion);\n\n case \"set\":\n return requiresConversion(dataType.set);\n\n case \"attachment\":\n case \"objectSet\":\n case \"twoDimensionalAggregation\":\n case \"threeDimensionalAggregation\":\n case \"object\":\n return true;\n\n default:\n return false;\n }\n}\n\nfunction getObjectSpecifier(\n primaryKey: any,\n objectTypeApiName: string,\n definitions: Map<string, ObjectOrInterfaceDefinition>,\n): string {\n const def = definitions.get(objectTypeApiName);\n if (!def || def.type !== \"object\") {\n throw new Error(\n `Missing definition for ${objectTypeApiName}`,\n );\n }\n return createObjectSpecifierFromPrimaryKey(\n def,\n primaryKey,\n );\n}\n\nexport function createQueryObjectResponse<\n Q extends ObjectTypeDefinition,\n>(\n primaryKey: PrimaryKeyType<Q>,\n objectDef: Q,\n): OsdkBase<Q> {\n return {\n $apiName: objectDef.apiName,\n $title: undefined,\n $objectType: objectDef.apiName,\n $primaryKey: primaryKey,\n $objectSpecifier: createObjectSpecifierFromPrimaryKey(\n objectDef,\n primaryKey,\n ),\n };\n}\n\nexport function createQueryInterfaceResponse<\n Q extends InterfaceDefinition,\n>(\n interfaceSpecifier: {\n objectTypeApiName: string;\n primaryKeyValue: PrimaryKeyType<Q>;\n },\n interfaceDef: Q,\n): OsdkBase<Q> {\n return {\n $apiName: interfaceDef.apiName,\n $title: undefined,\n $objectType: interfaceSpecifier.objectTypeApiName,\n $primaryKey: interfaceSpecifier.primaryKeyValue,\n $objectSpecifier: createObjectSpecifierFromInterfaceSpecifier(\n interfaceDef,\n interfaceSpecifier,\n ),\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgBA,OAAO,KAAKA,YAAY,MAAM,0BAA0B;AACxD,OAAOC,SAAS,MAAM,gBAAgB;AAEtC,SAASC,eAAe,QAAQ,iCAAiC;AACjE,SAASC,gCAAgC,QAAQ,6CAA6C;AAC9F,SAASC,oCAAoC,QAAQ,iDAAiD;AACtG,SAASC,qBAAqB,QAAQ,kCAAkC;AACxE,SACEC,2CAA2C,EAC3CC,mCAAmC,QAC9B,iCAAiC;AACxC,SAASC,kBAAkB,QAAQ,+BAA+B;AAGlE,OAAO,eAAeC,UAAUA,CAI9BC,MAAqB,EACrBC,KAAS,EACTC,MAAU,EAGV;EACA,MAAMC,EAAE,GAAG,MAAMH,MAAM,CAACI,gBAAgB,CAACC,kBAAkB,CACzDJ,KAAK,CAACK,OAAO,EACbL,KAAK,CAACM,cAAc,GAAGN,KAAK,CAACO,OAAO,GAAGC,SACzC,CAAC;EAED,MAAMC,QAAQ,GAAG,MAAMpB,YAAY,CAACqB,OAAO,CAACC,OAAO,CACjDlB,oCAAoC,CAClCC,qBAAqB,CAACK,MAAM,EAAE,OAAM;IAAEa,eAAe,EAAE;EAAa,CAAC,CAAC,CAAC,EACvEZ,KACF,CAAC,EACD,MAAMD,MAAM,CAACc,WAAW,EACxBb,KAAK,CAACK,OAAO,EACb;IACES,UAAU,EAAEb,MAAM,GACd,MAAMc,gBAAgB,CACtBd,MAAM,EACNF,MAAM,EACNG,EAAE,CAACY,UACL,CAAC,GACC,CAAC;EACP,CAAC,EACD;IAAEP,OAAO,EAAEP,KAAK,CAACM,cAAc,GAAGN,KAAK,CAACO,OAAO,GAAGC;EAAU,CAC9D,CAAC;EACD,MAAMQ,gBAAgB,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AC;AACH","ignoreList":[]}
|
|
@@ -14,6 +14,6 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
export const USER_AGENT = `osdk-client/${"2.5.0-beta.
|
|
18
|
-
export const OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.5.0-beta.
|
|
17
|
+
export const USER_AGENT = `osdk-client/${"2.5.0-beta.11"}`;
|
|
18
|
+
export const OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.5.0-beta.11"}`;
|
|
19
19
|
//# sourceMappingURL=UserAgent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserAgent.js","names":["USER_AGENT","OBSERVABLE_USER_AGENT"],"sources":["UserAgent.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const USER_AGENT: string = `osdk-client/${process.env.PACKAGE_VERSION}`;\nexport const OBSERVABLE_USER_AGENT: string =\n `osdk-observable-client/${process.env.PACKAGE_VERSION}`;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMA,UAAkB,GAAG
|
|
1
|
+
{"version":3,"file":"UserAgent.js","names":["USER_AGENT","OBSERVABLE_USER_AGENT"],"sources":["UserAgent.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const USER_AGENT: string = `osdk-client/${process.env.PACKAGE_VERSION}`;\nexport const OBSERVABLE_USER_AGENT: string =\n `osdk-observable-client/${process.env.PACKAGE_VERSION}`;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMA,UAAkB,GAAG,gCAA4C;AAC9E,OAAO,MAAMC,qBAA6B,GACxC,2CAAuD","ignoreList":[]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
const DEFAULT_OPTIONS = {
|
|
18
|
+
initialDelayMs: 1000,
|
|
19
|
+
maxDelayMs: 60000,
|
|
20
|
+
multiplier: 2,
|
|
21
|
+
jitterFactor: 0.3
|
|
22
|
+
};
|
|
23
|
+
export class ExponentialBackoff {
|
|
24
|
+
attempt = 0;
|
|
25
|
+
constructor(options = {}) {
|
|
26
|
+
this.options = {
|
|
27
|
+
...DEFAULT_OPTIONS,
|
|
28
|
+
...options
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
calculateDelay() {
|
|
32
|
+
const {
|
|
33
|
+
initialDelayMs,
|
|
34
|
+
maxDelayMs,
|
|
35
|
+
multiplier,
|
|
36
|
+
jitterFactor
|
|
37
|
+
} = this.options;
|
|
38
|
+
const baseDelay = Math.min(initialDelayMs * Math.pow(multiplier, this.attempt), maxDelayMs);
|
|
39
|
+
const jitter = baseDelay * jitterFactor * (Math.random() * 2 - 1);
|
|
40
|
+
const delayWithJitter = Math.max(0, baseDelay + jitter);
|
|
41
|
+
this.attempt++;
|
|
42
|
+
return Math.round(delayWithJitter);
|
|
43
|
+
}
|
|
44
|
+
reset() {
|
|
45
|
+
this.attempt = 0;
|
|
46
|
+
}
|
|
47
|
+
getAttempt() {
|
|
48
|
+
return this.attempt;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=exponentialBackoff.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exponentialBackoff.js","names":["DEFAULT_OPTIONS","initialDelayMs","maxDelayMs","multiplier","jitterFactor","ExponentialBackoff","attempt","constructor","options","calculateDelay","baseDelay","Math","min","pow","jitter","random","delayWithJitter","max","round","reset","getAttempt"],"sources":["exponentialBackoff.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport interface ExponentialBackoffOptions {\n initialDelayMs?: number;\n maxDelayMs?: number;\n multiplier?: number;\n jitterFactor?: number;\n}\n\nconst DEFAULT_OPTIONS: Required<ExponentialBackoffOptions> = {\n initialDelayMs: 1000,\n maxDelayMs: 60000,\n multiplier: 2,\n jitterFactor: 0.3,\n};\n\nexport class ExponentialBackoff {\n private attempt = 0;\n private readonly options: Required<ExponentialBackoffOptions>;\n\n constructor(options: ExponentialBackoffOptions = {}) {\n this.options = { ...DEFAULT_OPTIONS, ...options };\n }\n\n calculateDelay(): number {\n const { initialDelayMs, maxDelayMs, multiplier, jitterFactor } =\n this.options;\n\n const baseDelay = Math.min(\n initialDelayMs * Math.pow(multiplier, this.attempt),\n maxDelayMs,\n );\n\n const jitter = baseDelay * jitterFactor * (Math.random() * 2 - 1);\n const delayWithJitter = Math.max(0, baseDelay + jitter);\n\n this.attempt++;\n\n return Math.round(delayWithJitter);\n }\n\n reset(): void {\n this.attempt = 0;\n }\n\n getAttempt(): number {\n return this.attempt;\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASA,MAAMA,eAAoD,GAAG;EAC3DC,cAAc,EAAE,IAAI;EACpBC,UAAU,EAAE,KAAK;EACjBC,UAAU,EAAE,CAAC;EACbC,YAAY,EAAE;AAChB,CAAC;AAED,OAAO,MAAMC,kBAAkB,CAAC;EACtBC,OAAO,GAAG,CAAC;EAGnBC,WAAWA,CAACC,OAAkC,GAAG,CAAC,CAAC,EAAE;IACnD,IAAI,CAACA,OAAO,GAAG;MAAE,GAAGR,eAAe;MAAE,GAAGQ;IAAQ,CAAC;EACnD;EAEAC,cAAcA,CAAA,EAAW;IACvB,MAAM;MAAER,cAAc;MAAEC,UAAU;MAAEC,UAAU;MAAEC;IAAa,CAAC,GAC5D,IAAI,CAACI,OAAO;IAEd,MAAME,SAAS,GAAGC,IAAI,CAACC,GAAG,CACxBX,cAAc,GAAGU,IAAI,CAACE,GAAG,CAACV,UAAU,EAAE,IAAI,CAACG,OAAO,CAAC,EACnDJ,UACF,CAAC;IAED,MAAMY,MAAM,GAAGJ,SAAS,GAAGN,YAAY,IAAIO,IAAI,CAACI,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACjE,MAAMC,eAAe,GAAGL,IAAI,CAACM,GAAG,CAAC,CAAC,EAAEP,SAAS,GAAGI,MAAM,CAAC;IAEvD,IAAI,CAACR,OAAO,EAAE;IAEd,OAAOK,IAAI,CAACO,KAAK,CAACF,eAAe,CAAC;EACpC;EAEAG,KAAKA,CAAA,EAAS;IACZ,IAAI,CAACb,OAAO,GAAG,CAAC;EAClB;EAEAc,UAAUA,CAAA,EAAW;IACnB,OAAO,IAAI,CAACd,OAAO;EACrB;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { describe, expect, it } from "vitest";
|
|
18
|
+
import { ExponentialBackoff } from "./exponentialBackoff.js";
|
|
19
|
+
describe("ExponentialBackoff", () => {
|
|
20
|
+
it("should exponentially increase delay", () => {
|
|
21
|
+
const backoff = new ExponentialBackoff({
|
|
22
|
+
initialDelayMs: 1000,
|
|
23
|
+
multiplier: 2,
|
|
24
|
+
jitterFactor: 0
|
|
25
|
+
});
|
|
26
|
+
expect(backoff.calculateDelay()).toBe(1000); // 1000 * 2^0
|
|
27
|
+
expect(backoff.calculateDelay()).toBe(2000); // 1000 * 2^1
|
|
28
|
+
expect(backoff.calculateDelay()).toBe(4000); // 1000 * 2^2
|
|
29
|
+
expect(backoff.calculateDelay()).toBe(8000); // 1000 * 2^3
|
|
30
|
+
});
|
|
31
|
+
it("should respect max delay", () => {
|
|
32
|
+
const backoff = new ExponentialBackoff({
|
|
33
|
+
initialDelayMs: 1000,
|
|
34
|
+
maxDelayMs: 5000,
|
|
35
|
+
multiplier: 2,
|
|
36
|
+
jitterFactor: 0
|
|
37
|
+
});
|
|
38
|
+
expect(backoff.calculateDelay()).toBe(1000);
|
|
39
|
+
expect(backoff.calculateDelay()).toBe(2000);
|
|
40
|
+
expect(backoff.calculateDelay()).toBe(4000);
|
|
41
|
+
expect(backoff.calculateDelay()).toBe(5000); // capped at max
|
|
42
|
+
expect(backoff.calculateDelay()).toBe(5000); // still capped
|
|
43
|
+
});
|
|
44
|
+
it("should add jitter", () => {
|
|
45
|
+
new ExponentialBackoff({
|
|
46
|
+
initialDelayMs: 1000,
|
|
47
|
+
jitterFactor: 0.5
|
|
48
|
+
});
|
|
49
|
+
const delays = new Set();
|
|
50
|
+
for (let i = 0; i < 10; i++) {
|
|
51
|
+
const b = new ExponentialBackoff({
|
|
52
|
+
initialDelayMs: 1000,
|
|
53
|
+
jitterFactor: 0.5
|
|
54
|
+
});
|
|
55
|
+
delays.add(b.calculateDelay());
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// With jitter, we should get different values
|
|
59
|
+
expect(delays.size).toBeGreaterThan(1);
|
|
60
|
+
|
|
61
|
+
// All values should be within jitter range
|
|
62
|
+
for (const delay of delays) {
|
|
63
|
+
expect(delay).toBeGreaterThanOrEqual(500); // 1000 - (1000 * 0.5)
|
|
64
|
+
expect(delay).toBeLessThanOrEqual(1500); // 1000 + (1000 * 0.5)
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
it("should reset attempt counter", () => {
|
|
68
|
+
const backoff = new ExponentialBackoff({
|
|
69
|
+
initialDelayMs: 1000,
|
|
70
|
+
multiplier: 2,
|
|
71
|
+
jitterFactor: 0
|
|
72
|
+
});
|
|
73
|
+
expect(backoff.calculateDelay()).toBe(1000);
|
|
74
|
+
expect(backoff.calculateDelay()).toBe(2000);
|
|
75
|
+
expect(backoff.getAttempt()).toBe(2);
|
|
76
|
+
backoff.reset();
|
|
77
|
+
expect(backoff.getAttempt()).toBe(0);
|
|
78
|
+
expect(backoff.calculateDelay()).toBe(1000); // back to initial
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
//# sourceMappingURL=exponentialBackoff.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exponentialBackoff.test.js","names":["describe","expect","it","ExponentialBackoff","backoff","initialDelayMs","multiplier","jitterFactor","calculateDelay","toBe","maxDelayMs","delays","Set","i","b","add","size","toBeGreaterThan","delay","toBeGreaterThanOrEqual","toBeLessThanOrEqual","getAttempt","reset"],"sources":["exponentialBackoff.test.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { describe, expect, it } from \"vitest\";\nimport { ExponentialBackoff } from \"./exponentialBackoff.js\";\n\ndescribe(\"ExponentialBackoff\", () => {\n it(\"should exponentially increase delay\", () => {\n const backoff = new ExponentialBackoff({\n initialDelayMs: 1000,\n multiplier: 2,\n jitterFactor: 0,\n });\n\n expect(backoff.calculateDelay()).toBe(1000); // 1000 * 2^0\n expect(backoff.calculateDelay()).toBe(2000); // 1000 * 2^1\n expect(backoff.calculateDelay()).toBe(4000); // 1000 * 2^2\n expect(backoff.calculateDelay()).toBe(8000); // 1000 * 2^3\n });\n\n it(\"should respect max delay\", () => {\n const backoff = new ExponentialBackoff({\n initialDelayMs: 1000,\n maxDelayMs: 5000,\n multiplier: 2,\n jitterFactor: 0,\n });\n\n expect(backoff.calculateDelay()).toBe(1000);\n expect(backoff.calculateDelay()).toBe(2000);\n expect(backoff.calculateDelay()).toBe(4000);\n expect(backoff.calculateDelay()).toBe(5000); // capped at max\n expect(backoff.calculateDelay()).toBe(5000); // still capped\n });\n\n it(\"should add jitter\", () => {\n const backoff = new ExponentialBackoff({\n initialDelayMs: 1000,\n jitterFactor: 0.5,\n });\n\n const delays = new Set<number>();\n for (let i = 0; i < 10; i++) {\n const b = new ExponentialBackoff({\n initialDelayMs: 1000,\n jitterFactor: 0.5,\n });\n delays.add(b.calculateDelay());\n }\n\n // With jitter, we should get different values\n expect(delays.size).toBeGreaterThan(1);\n\n // All values should be within jitter range\n for (const delay of delays) {\n expect(delay).toBeGreaterThanOrEqual(500); // 1000 - (1000 * 0.5)\n expect(delay).toBeLessThanOrEqual(1500); // 1000 + (1000 * 0.5)\n }\n });\n\n it(\"should reset attempt counter\", () => {\n const backoff = new ExponentialBackoff({\n initialDelayMs: 1000,\n multiplier: 2,\n jitterFactor: 0,\n });\n\n expect(backoff.calculateDelay()).toBe(1000);\n expect(backoff.calculateDelay()).toBe(2000);\n expect(backoff.getAttempt()).toBe(2);\n\n backoff.reset();\n expect(backoff.getAttempt()).toBe(0);\n expect(backoff.calculateDelay()).toBe(1000); // back to initial\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAC7C,SAASC,kBAAkB,QAAQ,yBAAyB;AAE5DH,QAAQ,CAAC,oBAAoB,EAAE,MAAM;EACnCE,EAAE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,KAAK,CAAC,CAAC;IACfrB,MAAM,CAACG,OAAO,CAACiB,UAAU,CAAC,CAAC,CAAC,CAACZ,IAAI,CAAC,CAAC,CAAC;IACpCR,MAAM,CAACG,OAAO,CAACI,cAAc,CAAC,CAAC,CAAC,CAACC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;EAC/C,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -59,6 +59,14 @@ export async function extractObjectOrInterfaceType(clientCtx, objectSet) {
|
|
|
59
59
|
case "nearestNeighbors":
|
|
60
60
|
return extractObjectOrInterfaceType(clientCtx, objectSet.objectSet);
|
|
61
61
|
case "intersect":
|
|
62
|
+
{
|
|
63
|
+
const objectSets = objectSet.objectSets;
|
|
64
|
+
const objectSetTypes = await Promise.all(objectSets.map(os => extractObjectOrInterfaceType(clientCtx, os)));
|
|
65
|
+
const filteredObjectTypes = objectSetTypes.filter(Boolean);
|
|
66
|
+
const firstInterfaceType = filteredObjectTypes.find(val => val?.type === "interface");
|
|
67
|
+
!firstInterfaceType ? process.env.NODE_ENV !== "production" ? invariant(false, `Missing interface type in intersect objectset scope'`) : invariant(false) : void 0;
|
|
68
|
+
return firstInterfaceType;
|
|
69
|
+
}
|
|
62
70
|
case "subtract":
|
|
63
71
|
case "union":
|
|
64
72
|
const objectSets = objectSet.objectSets;
|
|
@@ -67,7 +75,7 @@ export async function extractObjectOrInterfaceType(clientCtx, objectSet) {
|
|
|
67
75
|
const firstObjectType = filteredObjectTypes[0];
|
|
68
76
|
!filteredObjectTypes.every(val => {
|
|
69
77
|
return val?.apiName === firstObjectType?.apiName && val?.type === firstObjectType?.type;
|
|
70
|
-
}) ? process.env.NODE_ENV !== "production" ? invariant(false, "Can only have one object type when doing
|
|
78
|
+
}) ? process.env.NODE_ENV !== "production" ? invariant(false, "Can only have one object type when doing subtract, union") : invariant(false) : void 0;
|
|
71
79
|
return filteredObjectTypes[0];
|
|
72
80
|
case "static":
|
|
73
81
|
case "reference":
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractObjectOrInterfaceType.js","names":["invariant","extractObjectOrInterfaceType","clientCtx","objectSet","type","def","undefined","objOrInterfaceDef","ontologyProvider","getObjectDefinition","apiName","getInterfaceDefinition","linkDef","links","link","process","env","NODE_ENV","targetType","targetTypeApiName","objectType","interfaceType","objectSets","objectSetTypes","Promise","all","map","os","filteredObjectTypes","filter","Boolean","
|
|
1
|
+
{"version":3,"file":"extractObjectOrInterfaceType.js","names":["invariant","extractObjectOrInterfaceType","clientCtx","objectSet","type","def","undefined","objOrInterfaceDef","ontologyProvider","getObjectDefinition","apiName","getInterfaceDefinition","linkDef","links","link","process","env","NODE_ENV","targetType","targetTypeApiName","objectType","interfaceType","objectSets","objectSetTypes","Promise","all","map","os","filteredObjectTypes","filter","Boolean","firstInterfaceType","find","val","firstObjectType","every","interfaceLink"],"sources":["extractObjectOrInterfaceType.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 { ObjectOrInterfaceDefinition } from \"@osdk/api\";\nimport type { ObjectSet } from \"@osdk/foundry.ontologies\";\nimport invariant from \"tiny-invariant\";\nimport type { MinimalClient } from \"../MinimalClientContext.js\";\n\n/* @internal\n* Returns the resultant interface or object type of the object set\n*/\nexport async function extractObjectOrInterfaceType(\n clientCtx: MinimalClient,\n objectSet: ObjectSet,\n): Promise<\n ObjectOrInterfaceDefinition | undefined\n> {\n switch (objectSet.type) {\n case \"searchAround\": {\n const def = await extractObjectOrInterfaceType(\n clientCtx,\n objectSet.objectSet,\n );\n if (def === undefined) {\n return undefined;\n }\n const objOrInterfaceDef = def.type === \"object\"\n ? await clientCtx.ontologyProvider.getObjectDefinition(\n def.apiName,\n )\n : await clientCtx.ontologyProvider.getInterfaceDefinition(\n def.apiName,\n );\n const linkDef = objOrInterfaceDef.links[objectSet.link];\n invariant(linkDef, `Missing link definition for '${objectSet.link}'`);\n\n return objOrInterfaceDef.type === \"object\"\n ? {\n apiName: objOrInterfaceDef.links[objectSet.link].targetType,\n type: \"object\",\n }\n : {\n apiName: objOrInterfaceDef.links[objectSet.link].targetTypeApiName,\n type: objOrInterfaceDef.links[objectSet.link].targetType,\n };\n }\n case \"withProperties\": {\n return extractObjectOrInterfaceType(\n clientCtx,\n objectSet.objectSet,\n );\n }\n case \"methodInput\":\n return undefined;\n case \"base\":\n return { type: \"object\", apiName: objectSet.objectType };\n case \"interfaceBase\":\n return { type: \"interface\", apiName: objectSet.interfaceType };\n case \"filter\":\n case \"asBaseObjectTypes\":\n case \"asType\":\n case \"nearestNeighbors\":\n return extractObjectOrInterfaceType(\n clientCtx,\n objectSet.objectSet,\n );\n case \"intersect\": {\n const objectSets = objectSet.objectSets;\n const objectSetTypes = await Promise.all(\n objectSets.map((os) =>\n extractObjectOrInterfaceType(\n clientCtx,\n os,\n )\n ),\n );\n\n const filteredObjectTypes = objectSetTypes.filter(Boolean);\n const firstInterfaceType = filteredObjectTypes.find(val =>\n val?.type === \"interface\"\n );\n\n invariant(\n firstInterfaceType,\n `Missing interface type in intersect objectset scope'`,\n );\n return firstInterfaceType;\n }\n case \"subtract\":\n case \"union\":\n const objectSets = objectSet.objectSets;\n const objectSetTypes = await Promise.all(\n objectSets.map((os) =>\n extractObjectOrInterfaceType(\n clientCtx,\n os,\n )\n ),\n );\n\n const filteredObjectTypes = objectSetTypes.filter(Boolean);\n const firstObjectType = filteredObjectTypes[0];\n invariant(\n filteredObjectTypes.every(val => {\n return val?.apiName === firstObjectType?.apiName\n && val?.type === firstObjectType?.type;\n }),\n \"Can only have one object type when doing subtract, union\",\n );\n\n return filteredObjectTypes[0];\n case \"static\":\n case \"reference\":\n // Static and reference object sets are always intersected with a base object set, so we can just return undefined.\n return undefined;\n case \"interfaceLinkSearchAround\":\n const def = await extractObjectOrInterfaceType(\n clientCtx,\n objectSet.objectSet,\n );\n if (def === undefined) {\n return undefined;\n }\n const objOrInterfaceDef = def.type === \"object\"\n ? await clientCtx.ontologyProvider.getObjectDefinition(\n def.apiName,\n )\n : await clientCtx.ontologyProvider.getInterfaceDefinition(\n def.apiName,\n );\n const linkDef = objOrInterfaceDef.links[objectSet.interfaceLink];\n invariant(\n linkDef,\n `Missing link definition for '${objectSet.interfaceLink}'`,\n );\n return objOrInterfaceDef.type === \"object\"\n ? {\n apiName: objOrInterfaceDef.links[objectSet.interfaceLink].targetType,\n type: \"object\",\n }\n : {\n apiName:\n objOrInterfaceDef.links[objectSet.interfaceLink].targetTypeApiName,\n type: objOrInterfaceDef.links[objectSet.interfaceLink].targetType,\n };\n // We don't have to worry about new object sets being added and doing a runtime break and breaking people since the OSDK is always constructing these.\n default:\n const _: never = objectSet;\n invariant(\n false,\n `Unsupported object set type for deriving object or interface type,`,\n );\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,OAAOA,SAAS,MAAM,gBAAgB;AAGtC;AACA;AACA;AACA,OAAO,eAAeC,4BAA4BA,CAChDC,SAAwB,EACxBC,SAAoB,EAGpB;EACA,QAAQA,SAAS,CAACC,IAAI;IACpB,KAAK,cAAc;MAAE;QACnB,MAAMC,GAAG,GAAG,MAAMJ,4BAA4B,CAC5CC,SAAS,EACTC,SAAS,CAACA,SACZ,CAAC;QACD,IAAIE,GAAG,KAAKC,SAAS,EAAE;UACrB,OAAOA,SAAS;QAClB;QACA,MAAMC,iBAAiB,GAAGF,GAAG,CAACD,IAAI,KAAK,QAAQ,GAC3C,MAAMF,SAAS,CAACM,gBAAgB,C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A4B,CAC5CC,SAAS,EACTC,SAAS,CAACA,SACZ,CAAC;MACD,IAAIE,GAAG,KAAKC,SAAS,EAAE;QACrB,OAAOA,SAAS;MAClB;MACA,MAAMC,iBAAiB,GAAGF,GAAG,CAACD,IAAI,KAAK,QAAQ,GAC3C,MAAMF,SAAS,CAACM,gBAAgB,CAACC,mBAAmB,CACpDJ,GAAG,CAACK,OACN,CAAC,GACC,MAAMR,SAAS,CAACM,gBAAgB,CAACG,sBAAsB,CACvDN,GAAG,CAACK,OACN,CAAC;MACH,MAAME,OAAO,GAAGL,iBAAiB,CAACM,KAAK,CAACV,SAAS,CAACiC,aAAa,CAAC;MAChE,CACExB,OAAO,GAAAG,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBADTjB,SAAS,QAEP,gCAAgCG,SAAS,CAACiC,aAAa,GAAG,IAF5DpC,SAAS;MAIT,OAAOO,iBAAiB,CAACH,IAAI,KAAK,QAAQ,GACtC;QACAM,OAAO,EAAEH,iBAAiB,CAACM,KAAK,CAACV,SAAS,CAACiC,aAAa,CAAC,CAAClB,UAAU;QACpEd,IAAI,EAAE;MACR,CAAC,GACC;QACAM,OAAO,EACLH,iBAAiB,CAACM,KAAK,CAACV,SAAS,CAACiC,aAAa,CAAC,CAACjB,iBAAiB;QACpEf,IAAI,EAAEG,iBAAiB,CAACM,KAAK,CAACV,SAAS,CAACiC,aAAa,CAAC,CAAClB;MACzD,CAAC;IACL;IACA;MAEEH,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAAjB,SAAS,QAEP,oEAAoE,IAFtEA,SAAS;EAIb;AACF","ignoreList":[]}
|
|
@@ -117,7 +117,7 @@ describe("extractRdpDefinition", () => {
|
|
|
117
117
|
});
|
|
118
118
|
it("throes with intersect, subtract, or union having different child object types", async () => {
|
|
119
119
|
await expect(extractObjectOrInterfaceType(mockClientCtx, {
|
|
120
|
-
type: "
|
|
120
|
+
type: "union",
|
|
121
121
|
objectSets: [{
|
|
122
122
|
type: "interfaceLinkSearchAround",
|
|
123
123
|
objectSet: {
|
|
@@ -129,7 +129,7 @@ describe("extractRdpDefinition", () => {
|
|
|
129
129
|
type: "interfaceBase",
|
|
130
130
|
interfaceType: "interface1"
|
|
131
131
|
}]
|
|
132
|
-
})).rejects.toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Can only have one object type when doing
|
|
132
|
+
})).rejects.toThrowErrorMatchingInlineSnapshot(`[Error: Invariant failed: Can only have one object type when doing subtract, union]`);
|
|
133
133
|
});
|
|
134
134
|
});
|
|
135
135
|
//# sourceMappingURL=extractObjectOrInterfaceType.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractObjectOrInterfaceType.test.js","names":["describe","expect","it","extractObjectOrInterfaceType","mockClientCtx","ontologyProvider","getObjectDefinition","objectType","links","testLink1","targetType","testLink2","properties","testProperty","type","Error","getInterfaceDefinition","interfaceType","linkToInterface2","targetTypeApiName","multiplicity","linkToInterface1","objectSetInterfaceToInterface","objectSet","interfaceLink","result","toEqual","apiName","objectSets","rejects","toThrowErrorMatchingInlineSnapshot"],"sources":["extractObjectOrInterfaceType.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 { InterfaceMetadata, ObjectMetadata } from \"@osdk/api\";\nimport type { ObjectSet } from \"@osdk/foundry.ontologies\";\nimport { describe, expect, it } from \"vitest\";\nimport type { MinimalClient } from \"../MinimalClientContext.js\";\nimport { extractObjectOrInterfaceType } from \"./extractObjectOrInterfaceType.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 getInterfaceDefinition: (interfaceType: string) => {\n if (interfaceType === \"interface1\") {\n return {\n links: {\n linkToInterface2: {\n targetType: \"interface\",\n targetTypeApiName: \"interface2\",\n multiplicity: false,\n } satisfies InterfaceMetadata.Link<any, any>,\n },\n };\n } else if (interfaceType === \"interface1\") {\n return {\n links: {\n linkToInterface1: {\n targetType: \"interface\",\n targetTypeApiName: \"interface1\",\n multiplicity: false,\n } satisfies InterfaceMetadata.Link<any, any>,\n },\n };\n } else {\n throw new Error(`Missing definition for '${interfaceType}'`);\n }\n },\n } as any,\n } as MinimalClient;\n\n const objectSetInterfaceToInterface: ObjectSet = {\n type: \"interfaceLinkSearchAround\",\n objectSet: {\n type: \"interfaceBase\",\n interfaceType: \"interface1\",\n },\n interfaceLink: \"linkToInterface2\",\n };\n\n it(\"handles 'withProperties' object set type\", async () => {\n const result = await extractObjectOrInterfaceType(\n mockClientCtx,\n objectSetInterfaceToInterface,\n );\n\n expect(result).toEqual({ apiName: \"interface2\", type: \"interface\" });\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: \"interfaceLinkSearchAround\",\n objectSet: {\n type: \"interfaceBase\",\n interfaceType: \"interface1\",\n },\n interfaceLink: \"linkToInterface2\",\n },\n { type: \"static\", \"objects\": [\"object1\", \"object2\"] },\n { type: \"reference\", \"reference\": \"rid.os.1234\" },\n ],\n };\n\n const result = await extractObjectOrInterfaceType(\n mockClientCtx,\n intersectionObjectSet,\n );\n\n expect(result).toEqual({ apiName: \"interface2\", type: \"interface\" });\n });\n\n it(\"throes with intersect, subtract, or union having different child object types\", async () => {\n const intersectionObjectSet: ObjectSet = {\n type: \"
|
|
1
|
+
{"version":3,"file":"extractObjectOrInterfaceType.test.js","names":["describe","expect","it","extractObjectOrInterfaceType","mockClientCtx","ontologyProvider","getObjectDefinition","objectType","links","testLink1","targetType","testLink2","properties","testProperty","type","Error","getInterfaceDefinition","interfaceType","linkToInterface2","targetTypeApiName","multiplicity","linkToInterface1","objectSetInterfaceToInterface","objectSet","interfaceLink","result","toEqual","apiName","objectSets","rejects","toThrowErrorMatchingInlineSnapshot"],"sources":["extractObjectOrInterfaceType.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 { InterfaceMetadata, ObjectMetadata } from \"@osdk/api\";\nimport type { ObjectSet } from \"@osdk/foundry.ontologies\";\nimport { describe, expect, it } from \"vitest\";\nimport type { MinimalClient } from \"../MinimalClientContext.js\";\nimport { extractObjectOrInterfaceType } from \"./extractObjectOrInterfaceType.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 getInterfaceDefinition: (interfaceType: string) => {\n if (interfaceType === \"interface1\") {\n return {\n links: {\n linkToInterface2: {\n targetType: \"interface\",\n targetTypeApiName: \"interface2\",\n multiplicity: false,\n } satisfies InterfaceMetadata.Link<any, any>,\n },\n };\n } else if (interfaceType === \"interface1\") {\n return {\n links: {\n linkToInterface1: {\n targetType: \"interface\",\n targetTypeApiName: \"interface1\",\n multiplicity: false,\n } satisfies InterfaceMetadata.Link<any, any>,\n },\n };\n } else {\n throw new Error(`Missing definition for '${interfaceType}'`);\n }\n },\n } as any,\n } as MinimalClient;\n\n const objectSetInterfaceToInterface: ObjectSet = {\n type: \"interfaceLinkSearchAround\",\n objectSet: {\n type: \"interfaceBase\",\n interfaceType: \"interface1\",\n },\n interfaceLink: \"linkToInterface2\",\n };\n\n it(\"handles 'withProperties' object set type\", async () => {\n const result = await extractObjectOrInterfaceType(\n mockClientCtx,\n objectSetInterfaceToInterface,\n );\n\n expect(result).toEqual({ apiName: \"interface2\", type: \"interface\" });\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: \"interfaceLinkSearchAround\",\n objectSet: {\n type: \"interfaceBase\",\n interfaceType: \"interface1\",\n },\n interfaceLink: \"linkToInterface2\",\n },\n { type: \"static\", \"objects\": [\"object1\", \"object2\"] },\n { type: \"reference\", \"reference\": \"rid.os.1234\" },\n ],\n };\n\n const result = await extractObjectOrInterfaceType(\n mockClientCtx,\n intersectionObjectSet,\n );\n\n expect(result).toEqual({ apiName: \"interface2\", type: \"interface\" });\n });\n\n it(\"throes with intersect, subtract, or union having different child object types\", async () => {\n const intersectionObjectSet: ObjectSet = {\n type: \"union\",\n objectSets: [\n {\n type: \"interfaceLinkSearchAround\",\n objectSet: {\n type: \"interfaceBase\",\n interfaceType: \"interface1\",\n },\n interfaceLink: \"linkToInterface2\",\n },\n { type: \"interfaceBase\", interfaceType: \"interface1\" },\n ],\n };\n\n await expect(\n extractObjectOrInterfaceType(mockClientCtx, intersectionObjectSet),\n ).rejects.toThrowErrorMatchingInlineSnapshot(\n `[Error: Invariant failed: Can only have one object type when doing subtract, union]`,\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,4BAA4B,QAAQ,mCAAmC;AAEhFH,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,EAAE;gBACZC,IAAI,EAAE;cACR;YACF;UACF,CAAC;QACH,CAAC,MAAM;UACL,MAAM,IAAIC,KAAK,CAAC,2B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AAC;QACDO,aAAa,EAAE;MACjB,CAAC,EACD;QAAEV,IAAI,EAAE,QAAQ;QAAE,SAAS,EAAE,CAAC,SAAS,EAAE,SAAS;MAAE,CAAC,EACrD;QAAEA,IAAI,EAAE,WAAW;QAAE,WAAW,EAAE;MAAc,CAAC;IAErD,CAKA,CAAC;IAEDb,MAAM,CAACwB,MAAM,CAAC,CAACC,OAAO,CAAC;MAAEC,OAAO,EAAE,YAAY;MAAEb,IAAI,EAAE;IAAY,CAAC,CAAC;EACtE,CAAC,CAAC;EAEFZ,EAAE,CAAC,+EAA+E,EAAE,YAAY;IAgB9F,MAAMD,MAAM,CACVE,4BAA4B,CAACC,aAAa,EAhBH;MACvCU,IAAI,EAAE,OAAO;MACbc,UAAU,EAAE,CACV;QACEd,IAAI,EAAE,2BAA2B;QACjCS,SAAS,EAAE;UACTT,IAAI,EAAE,eAAe;UACrBG,aAAa,EAAE;QACjB,CAAC;QACDO,aAAa,EAAE;MACjB,CAAC,EACD;QAAEV,IAAI,EAAE,eAAe;QAAEG,aAAa,EAAE;MAAa,CAAC;IAE1D,CAGmE,CACnE,CAAC,CAACY,OAAO,CAACC,kCAAkC,CAC1C,qFACF,CAAC;EACH,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -23,7 +23,7 @@ export async function* parseStreamedResponse(asyncIterable) {
|
|
|
23
23
|
let parsedStart = false;
|
|
24
24
|
let prevChunks = [];
|
|
25
25
|
let openBracesCount = 0;
|
|
26
|
-
for await (
|
|
26
|
+
for await (const chunk of asyncIterable) {
|
|
27
27
|
// on the first chunk, skip the expected START_TOKEN if we see it
|
|
28
28
|
let i = 0;
|
|
29
29
|
if (!parsedStart) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streamutils.js","names":["START_TOKEN","Uint8Array","OBJECT_OPEN_CHAR_CODE","OBJECT_CLOSE_CHAR_CODE","parseStreamedResponse","asyncIterable","utf8decoder","TextDecoder","parsedStart","prevChunks","openBracesCount","chunk","i","startsWith","length","j","c","combineAndParse","subarray","push","a","b","prev","curr","str","decode","stream","JSON","parse","iterateReadableStream","readableStream","res","read","done","value"],"sources":["streamutils.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst START_TOKEN = new Uint8Array([123, 34, 100, 97, 116, 97, 34, 58, 91]); // `{\"data\":[`\nconst OBJECT_OPEN_CHAR_CODE = 123; // '{'\nconst OBJECT_CLOSE_CHAR_CODE = 125; // '}'\n\nexport async function* parseStreamedResponse(\n asyncIterable: AsyncIterable<Uint8Array>,\n): AsyncGenerator<any, void, unknown> {\n const utf8decoder = new TextDecoder(\"utf-8\");\n\n let parsedStart = false;\n let prevChunks: Uint8Array[] = [];\n let openBracesCount = 0;\n\n for await (
|
|
1
|
+
{"version":3,"file":"streamutils.js","names":["START_TOKEN","Uint8Array","OBJECT_OPEN_CHAR_CODE","OBJECT_CLOSE_CHAR_CODE","parseStreamedResponse","asyncIterable","utf8decoder","TextDecoder","parsedStart","prevChunks","openBracesCount","chunk","i","startsWith","length","j","c","combineAndParse","subarray","push","a","b","prev","curr","str","decode","stream","JSON","parse","iterateReadableStream","readableStream","res","read","done","value"],"sources":["streamutils.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst START_TOKEN = new Uint8Array([123, 34, 100, 97, 116, 97, 34, 58, 91]); // `{\"data\":[`\nconst OBJECT_OPEN_CHAR_CODE = 123; // '{'\nconst OBJECT_CLOSE_CHAR_CODE = 125; // '}'\n\nexport async function* parseStreamedResponse(\n asyncIterable: AsyncIterable<Uint8Array>,\n): AsyncGenerator<any, void, unknown> {\n const utf8decoder = new TextDecoder(\"utf-8\");\n\n let parsedStart = false;\n let prevChunks: Uint8Array[] = [];\n let openBracesCount = 0;\n\n for await (const chunk of asyncIterable) {\n // on the first chunk, skip the expected START_TOKEN if we see it\n let i = 0;\n if (!parsedStart) {\n parsedStart = true;\n if (startsWith(chunk, START_TOKEN)) {\n i = START_TOKEN.length;\n }\n }\n\n for (; i < chunk.length; i++) {\n // if we aren't currently parsing an object, skip until we find the next object start\n while (\n openBracesCount === 0 && chunk[i] !== OBJECT_OPEN_CHAR_CODE\n && i < chunk.length\n ) {\n i++;\n }\n\n // iterate through the chunk looking for the end of the current top level object\n let j = i;\n for (; j < chunk.length; j++) {\n const c = chunk[j];\n if (c === OBJECT_OPEN_CHAR_CODE) {\n openBracesCount++;\n } else if (c === OBJECT_CLOSE_CHAR_CODE) {\n openBracesCount--;\n\n // found a complete top level object, emit it\n if (0 === openBracesCount) {\n yield combineAndParse(\n utf8decoder,\n prevChunks,\n chunk.subarray(i, j + 1),\n );\n\n // if there was a prevChunk, we've consumed it now\n prevChunks = [];\n\n // advance the start index to the final '}' of the current object,\n // which lets us start seeking the beginning of the next object\n i = j;\n break;\n }\n }\n }\n\n // if we reached the end of our chunk before finding the end of the object\n // store off the relevant remainder of our current chunk and go grab the next one\n if (j === chunk.length) {\n prevChunks.push(chunk.subarray(i));\n break;\n }\n }\n }\n}\n\nfunction startsWith(a: Uint8Array, b: Uint8Array) {\n if (a.length < b.length) {\n return false;\n }\n\n for (let i = 0; i < b.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction combineAndParse(\n utf8decoder: TextDecoder,\n prev: Uint8Array[],\n curr: Uint8Array,\n) {\n let str = \"\";\n for (const chunk of prev) {\n str += utf8decoder.decode(chunk, { stream: true });\n }\n str += utf8decoder.decode(curr);\n\n return JSON.parse(str);\n}\n\nexport async function* iterateReadableStream(\n readableStream: ReadableStreamDefaultReader<Uint8Array>,\n): AsyncGenerator<Uint8Array, void, unknown> {\n let res = await readableStream.read();\n while (!res.done) {\n yield res.value;\n res = await readableStream.read();\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMA,WAAW,GAAG,IAAIC,UAAU,CAAC,CAAC,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;AAC7E,MAAMC,qBAAqB,GAAG,GAAG,CAAC,CAAC;AACnC,MAAMC,sBAAsB,GAAG,GAAG,CAAC,CAAC;;AAEpC,OAAO,gBAAgBC,qBAAqBA,CAC1CC,aAAwC,EACJ;EACpC,MAAMC,WAAW,GAAG,IAAIC,WAAW,CAAC,OAAO,CAAC;EAE5C,IAAIC,WAAW,GAAG,KAAK;EACvB,IAAIC,UAAwB,GAAG,EAAE;EACjC,IAAIC,eAAe,GAAG,CAAC;EAEvB,WAAW,MAAMC,KAAK,IAAIN,aAAa,EAAE;IACvC;IACA,IAAIO,CAAC,GAAG,CAAC;IACT,IAAI,CAACJ,WAAW,EAAE;MAChBA,WAAW,GAAG,IAAI;MAClB,IAAIK,UAAU,CAACF,KAAK,EAAEX,WAAW,CAAC,EAAE;QAClCY,CAAC,GAAGZ,WAAW,CAACc,MAAM;MACxB;IACF;IAEA,OAAOF,CAAC,GAAGD,KAAK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ACF;EAEA,OAAO,IAAI;AACb;AAEA,SAASK,eAAeA,CACtBX,WAAwB,EACxBgB,IAAkB,EAClBC,IAAgB,EAChB;EACA,IAAIC,GAAG,GAAG,EAAE;EACZ,KAAK,MAAMb,KAAK,IAAIW,IAAI,EAAE;IACxBE,GAAG,IAAIlB,WAAW,CAACmB,MAAM,CAACd,KAAK,EAAE;MAAEe,MAAM,EAAE;IAAK,CAAC,CAAC;EACpD;EACAF,GAAG,IAAIlB,WAAW,CAACmB,MAAM,CAACF,IAAI,CAAC;EAE/B,OAAOI,IAAI,CAACC,KAAK,CAACJ,GAAG,CAAC;AACxB;AAEA,OAAO,gBAAgBK,qBAAqBA,CAC1CC,cAAuD,EACZ;EAC3C,IAAIC,GAAG,GAAG,MAAMD,cAAc,CAACE,IAAI,CAAC,CAAC;EACrC,OAAO,CAACD,GAAG,CAACE,IAAI,EAAE;IAChB,MAAMF,GAAG,CAACG,KAAK;IACfH,GAAG,GAAG,MAAMD,cAAc,CAACE,IAAI,CAAC,CAAC;EACnC;AACF","ignoreList":[]}
|
package/build/types/Client.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export interface Client extends SharedClient, OldSharedClient {
|
|
|
16
16
|
<Q extends Experiment<"2.0.8"> | Experiment<"2.1.0"> | Experiment<"2.2.0">>(experiment: Q): ExperimentFns<Q>;
|
|
17
17
|
fetchMetadata<Q extends (ObjectTypeDefinition | InterfaceDefinition | ActionDefinition<any> | QueryDefinition<any>)>(o: Q): Promise<Q extends ObjectTypeDefinition ? ObjectMetadata : Q extends InterfaceDefinition ? InterfaceMetadata : Q extends ActionDefinition<any> ? ActionMetadata : Q extends QueryDefinition<any> ? QueryMetadata : never>;
|
|
18
18
|
}
|
|
19
|
-
declare const MaxOsdkVersion = "2.
|
|
19
|
+
declare const MaxOsdkVersion = "2.5.0";
|
|
20
20
|
export type MaxOsdkVersion = typeof MaxOsdkVersion;
|
|
21
21
|
declare const ErrorMessage: unique symbol;
|
|
22
22
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAgBA,cAAc,cAAc,WAAY;AACxC,cAAc,2BAA2B,sBAAuB;AAMhE,cAAc,wBAAwB,gCAAiC;AAEvE,cAAcA;AAEd,YAAY,iBAAiB,CAAE,IAAG;WAAY;AAAY;AAE1D,YAAY,iBAAiB;CAC3B;AACD;AAED,iBAAiB,sBAAsB,oBAAoB;CACzD,sBAAsB;CACtB,kBAAkB;CAClB,SAAS;CACT;CAQA,gBAAgB;CAChB,gBAAgB;AACjB;AAED,YAAY,sBAAsB;CAChC,UAAU;CACV,UAAU;AACX;AAED,iBAAiB,sBAAsB;CACrC,sBAAsB;AACvB","names":["tag: unique symbol"],"sources":["../../src/MinimalClientContext.ts"],"version":3,"file":"MinimalClientContext.d.ts"}
|
|
1
|
+
{"mappings":"AAgBA,cAAc,cAAc,WAAY;AACxC,cAAc,2BAA2B,sBAAuB;AAMhE,cAAc,wBAAwB,gCAAiC;AAEvE,cAAcA;AAEd,YAAY,iBAAiB,CAAE,IAAG;WAAY;AAAY;AAE1D,YAAY,iBAAiB;CAC3B;AACD;AAED,iBAAiB,sBAAsB,oBAAoB;CACzD,sBAAsB;CACtB,kBAAkB;CAClB,SAAS;CACT;CACA;CAQA,gBAAgB;CAChB,gBAAgB;AACjB;AAED,YAAY,sBAAsB;CAChC,UAAU;CACV,UAAU;AACX;AAED,iBAAiB,sBAAsB;CACrC,sBAAsB;AACvB","names":["tag: unique symbol"],"sources":["../../src/MinimalClientContext.ts"],"version":3,"file":"MinimalClientContext.d.ts"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAgBA,cACE,kBACA,oBACA,gBACA,aACA,4BACA,oBACA,yBACA,uBAAuB,2BACvB,6BACK,WAAY;AACnB,cACE,4BAEA,iCACK,0BAA2B;AAElC,cAAc,qBAAqB,4BAA6B;AAGhE,cAAc,YAAY,iBAAkB;AAC5C,cAAc,qBAAqB,0BAA2B;AAC9D,cAAc,iBAAiB,sBAAuB;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BACnD,qBAAqB,0BAA0B,IAAI;CACvD,WAAW,UAAU,qBACnB,0BAA0B,IAAI,mBAC1B,0BACF;EAEJC,QAAQ,eACRC,QAAQ,IACRC,aAAa,GACbC,UAAS,KACR,QACD,2BAA2B;AA6G7B,OAAO,iBAAS,oBACdC,UAAU,4BAA4B,6BACrC","names":["args: A","options?: OP","client: MinimalClient","action: AD","parameters?: P","options: Op","response: SyncApplyActionResponseV2 | BatchApplyActionResponseV2"],"sources":["../../../src/actions/applyAction.ts"],"version":3,"file":"applyAction.d.ts"}
|
|
@@ -2,5 +2,6 @@ import type { Logger } from "@osdk/api";
|
|
|
2
2
|
import { type Client } from "./Client.js";
|
|
3
3
|
export declare const createClient: (baseUrl: string, ontologyRid: string | Promise<string>, tokenProvider: () => Promise<string>, options?: {
|
|
4
4
|
logger?: Logger
|
|
5
|
+
branch?: string
|
|
5
6
|
} | undefined, fetchFn?: typeof fetch | undefined) => Client;
|
|
6
7
|
export declare const createClientWithTransaction: (transactionRid: string, ...args: Parameters<typeof createClient>) => Client;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAgBA,cAIE,cASK,WAAY;AAkBnB,cAAiC,cAAc,aAAc;
|
|
1
|
+
{"mappings":"AAgBA,cAIE,cASK,WAAY;AAkBnB,cAAiC,cAAc,aAAc;AAsQ7D,OAAO,cAAMA,eACXC,iBACAC,sBAAsB,iBACtBC,qBAAqB,iBACrBC,UAAU;CACR,SAAS;CACT;AACD,eACDC,iBAAiB,sBACd;AAML,OAAO,cAAMC,8BACXC,wBACA,GAAG,MAAM,kBAAkB,kBACxB","names":["createClient: (\n baseUrl: string,\n ontologyRid: string | Promise<string>,\n tokenProvider: () => Promise<string>,\n options?: {\n logger?: Logger;\n branch?: string;\n } | undefined,\n fetchFn?: typeof fetch | undefined,\n) => Client","baseUrl: string","ontologyRid: string | Promise<string>","tokenProvider: () => Promise<string>","options?: {\n logger?: Logger;\n branch?: string;\n } | undefined","fetchFn?: typeof fetch | undefined","createClientWithTransaction: (\n transactionRid: string,\n ...args: Parameters<typeof createClient>\n) => Client","transactionRid: string"],"sources":["../../src/createClient.ts"],"version":3,"file":"createClient.d.ts"}
|
package/build/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type { ActionDefinition, ActionEditResponse, ActionMetadata, ActionParam, ActionReturnTypeForOptions, ActionValidationResponse, ApplyActionOptions, ApplyBatchActionOptions, Attachment, CompileTimeMetadata, InterfaceDefinition, InterfaceMetadata, Logger, ObjectMetadata, ObjectSet, ObjectSpecifier, ObjectTypeDefinition, Osdk, OsdkObject, OsdkObjectCreatePropertyType, OsdkObjectPropertyType, PageResult, PropertyDef, PropertyKeys, PropertyValueWireToClient, QueryDefinition, QueryParam, QueryResult, Range, Result, SingleLinkAccessor, ThreeDimensionalAggregation, TwoDimensionalAggregation, VersionBound, WhereClause } from "@osdk/api";
|
|
2
1
|
export { isOk, NULL_VALUE } from "@osdk/api";
|
|
2
|
+
export type { ActionDefinition, ActionEditResponse, ActionMetadata, ActionParam, ActionReturnTypeForOptions, ActionValidationResponse, ApplyActionOptions, ApplyBatchActionOptions, Attachment, CompileTimeMetadata, InterfaceDefinition, InterfaceMetadata, Logger, ObjectMetadata, ObjectSet, ObjectSpecifier, ObjectTypeDefinition, Osdk, OsdkObject, OsdkObjectCreatePropertyType, OsdkObjectPropertyType, PageResult, PropertyDef, PropertyKeys, PropertyValueWireToClient, QueryDefinition, QueryParam, QueryResult, Range, Result, SingleLinkAccessor, ThreeDimensionalAggregation, TwoDimensionalAggregation, VersionBound, WhereClause } from "@osdk/api";
|
|
3
3
|
export { PalantirApiError } from "@osdk/shared.net.errors";
|
|
4
4
|
export { ActionValidationError } from "./actions/ActionValidationError.js";
|
|
5
5
|
export type { Client } from "./Client.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":"AAkBA,SAAS,MAAM,kBAAkB;AACjC,cACE,kBACA,oBACA,gBACA,aACA,4BACA,0BACA,oBACA,yBACA,YACA,qBACA,qBACA,mBACA,QACA,gBACA,WACA,iBACA,sBACA,MACA,YACA,8BACA,wBACA,YACA,aACA,cACA,2BACA,iBACA,YACA,aACA,OACA,QACA,oBACA,6BACA,2BACA,cACA,mBACK;AACP,SAAS,wBAAwB;AAEjC,SAAS,6BAA6B;AACtC,cAAc,cAAc;AAC5B,SAAS,oBAAoB;AAC7B,SAAS,4BAA4B;AACrC,cAAc,sBAAsB;AACpC,SAAS,8BAA8B;AACvC,cAAc,qBAAqB;AAEnC,SACE,aACA,wBACA,wBACK;AAEP,SAAS,2CAA2C","names":[],"sources":["../../src/index.ts"],"version":3,"file":"index.d.ts"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAgBA,cACE,SAMA,
|
|
1
|
+
{"mappings":"AAgBA,cACE,SAMA,6BAGA,oBAEK,WAAY;AAkBnB,OAAO,iBAAS;CACd,UAAU;CACV,UAAU,aAAa;EAEvBA,MAAM,GACN,GAAG,YAAY,MACd,QAAQ,GAAG","names":["type: Q"],"sources":["../../../src/object/fetchPage.ts"],"version":3,"file":"fetchPage.d.ts"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { InterfaceHolder } from "../object/convertWireToOsdkObjects/InterfaceHolder.js";
|
|
2
|
+
import type { ObjectHolder } from "../object/convertWireToOsdkObjects/ObjectHolder.js";
|
|
3
|
+
import type { ObserveLinkCallbackArgs } from "./ObservableClient.js";
|
|
4
|
+
/**
|
|
5
|
+
* Internal type to keep the generic insanity down internal to the observable code
|
|
6
|
+
*/
|
|
7
|
+
export interface SpecificLinkPayload extends Omit<ObserveLinkCallbackArgs<any>, "resolvedList"> {
|
|
8
|
+
resolvedList: Array<ObjectHolder | InterfaceHolder>;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAgBA,cAAc,uBAAuB,uDAAwD;AAC7F,cAAc,oBAAoB,oDAAqD;AACvF,cAAc,+BAA+B,uBAAwB;;;;AAKrE,iBAAiB,4BACP,KAAK,8BAA8B,gBAC7C;CACE,cAAc,MAAM,eAAe;AACpC","names":[],"sources":["../../../src/observable/LinkPayload.ts"],"version":3,"file":"LinkPayload.d.ts"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import type { ObjectTypeDefinition, Osdk } from "@osdk/api";
|
|
1
2
|
import type { ObjectHolder } from "../object/convertWireToOsdkObjects/ObjectHolder.js";
|
|
2
3
|
import type { ObserveObjectArgs } from "./ObservableClient.js";
|
|
3
4
|
export interface ObjectPayload extends Omit<ObserveObjectArgs<any>, "object"> {
|
|
4
5
|
object: ObjectHolder | undefined;
|
|
5
6
|
}
|
|
7
|
+
export interface TypedObjectPayload<T extends ObjectTypeDefinition> extends ObjectPayload {
|
|
8
|
+
object: ObjectHolder<Osdk.Instance<T>> & Osdk.Instance<T> | undefined;
|
|
9
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAgBA,cAAc,oBAAoB,oDAAqD;AACvF,cAAc,yBAAyB,uBAAwB;AAE/D,iBAAiB,sBAAsB,KAAK,wBAAwB,UAAU;CAC5E,QAAQ;AACT","names":[],"sources":["../../../src/observable/ObjectPayload.ts"],"version":3,"file":"ObjectPayload.d.ts"}
|
|
1
|
+
{"mappings":"AAgBA,cAAc,sBAAsB,YAAY,WAAY;AAC5D,cAAc,oBAAoB,oDAAqD;AACvF,cAAc,yBAAyB,uBAAwB;AAE/D,iBAAiB,sBAAsB,KAAK,wBAAwB,UAAU;CAC5E,QAAQ;AACT;AAED,iBAAiB,mBAAmB,UAAU,8BACpC,cACV;CACE,QAAQ,aAAa,KAAK,SAAS,MAAM,KAAK,SAAS;AACxD","names":[],"sources":["../../../src/observable/ObjectPayload.ts"],"version":3,"file":"ObjectPayload.d.ts"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAgBA,cAAc,iBAAiB,WAAY;AAC3C,cAAc,6BAA6B,6CAA8C;AAEzF,iBAAiB,yBAAyB,sBAAsB;CAC9D,WAAW;AACZ","names":[],"sources":["../../../src/observable/ObjectSetPayload.ts"],"version":3,"file":"ObjectSetPayload.d.ts"}
|