@osdk/client 2.4.2 → 2.5.0-beta.10
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 +106 -93
- 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/derivedProperties/createWithPropertiesObjectSet.js +17 -0
- package/build/browser/derivedProperties/createWithPropertiesObjectSet.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 +3 -1
- 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/aggregate.test.js +30 -0
- package/build/browser/object/aggregate.test.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/object/mediaUpload.js +3 -0
- package/build/browser/object/mediaUpload.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/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/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 +6 -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 +54 -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 +45 -4
- 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 +87 -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/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.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/browser/util/toDataValue.js +15 -1
- package/build/browser/util/toDataValue.js.map +1 -1
- package/build/browser/util/toDataValue.test.js +42 -2
- package/build/browser/util/toDataValue.test.js.map +1 -1
- package/build/cjs/{chunk-633AI7EA.cjs → chunk-GVGP7T5P.cjs} +407 -257
- package/build/cjs/chunk-GVGP7T5P.cjs.map +1 -0
- package/build/cjs/{chunk-26WFEZQO.cjs → chunk-YADG7KA6.cjs} +136 -84
- package/build/cjs/chunk-YADG7KA6.cjs.map +1 -0
- package/build/cjs/{createClient-BJo8T7Js.d.cts → createClient-mOlFts15.d.cts} +1 -0
- package/build/cjs/index.cjs +11 -7
- package/build/cjs/index.d.cts +2 -2
- package/build/cjs/public/internal.cjs +8 -8
- package/build/cjs/public/unstable-do-not-use.cjs +1502 -851
- package/build/cjs/public/unstable-do-not-use.cjs.map +1 -1
- package/build/cjs/public/unstable-do-not-use.d.cts +183 -13
- 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/derivedProperties/createWithPropertiesObjectSet.js +17 -0
- package/build/esm/derivedProperties/createWithPropertiesObjectSet.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 +3 -1
- 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/aggregate.test.js +30 -0
- package/build/esm/object/aggregate.test.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/object/mediaUpload.js +3 -0
- package/build/esm/object/mediaUpload.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/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/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 +6 -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 +54 -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 +45 -4
- 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 +87 -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/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.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/esm/util/toDataValue.js +15 -1
- package/build/esm/util/toDataValue.js.map +1 -1
- package/build/esm/util/toDataValue.test.js +42 -2
- package/build/esm/util/toDataValue.test.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/object/mediaUpload.d.ts +2 -1
- package/build/types/object/mediaUpload.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/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 +103 -15
- 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/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 +8 -5
- package/build/types/observable/internal/Changes.d.ts.map +1 -1
- package/build/types/observable/internal/KnownCacheKey.d.ts +4 -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 +41 -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/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 +4 -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 +27 -27
- 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-26WFEZQO.cjs.map +0 -1
- package/build/cjs/chunk-633AI7EA.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
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
var chunkQ7SFCCGT_cjs = require('./chunk-Q7SFCCGT.cjs');
|
|
4
4
|
var shared_net_errors = require('@osdk/shared.net.errors');
|
|
5
|
-
var shared_net_fetch = require('@osdk/shared.net.fetch');
|
|
6
|
-
var invariant8 = require('tiny-invariant');
|
|
7
5
|
var api = require('@osdk/api');
|
|
6
|
+
var invariant5 = require('tiny-invariant');
|
|
7
|
+
var shared_net_fetch = require('@osdk/shared.net.fetch');
|
|
8
8
|
var WebSocket = require('isomorphic-ws');
|
|
9
9
|
|
|
10
10
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var invariant5__default = /*#__PURE__*/_interopDefault(invariant5);
|
|
13
13
|
var WebSocket__default = /*#__PURE__*/_interopDefault(WebSocket);
|
|
14
14
|
|
|
15
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
15
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.30.0/node_modules/@osdk/foundry.ontologies/build/esm/public/Action.js
|
|
16
16
|
var Action_exports = {};
|
|
17
17
|
chunkQ7SFCCGT_cjs.__export(Action_exports, {
|
|
18
18
|
apply: () => apply,
|
|
@@ -89,7 +89,7 @@ function parseUrl(baseUrl, endpointPath) {
|
|
|
89
89
|
return new URL(`api${endpointPath}`, baseUrl);
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
92
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.30.0/node_modules/@osdk/foundry.ontologies/build/esm/public/Action.js
|
|
93
93
|
var _apply = [1, "/v2/ontologies/{0}/actions/{1}/apply", 3];
|
|
94
94
|
function apply($ctx, ...args) {
|
|
95
95
|
return foundryPlatformFetch($ctx, _apply, ...args);
|
|
@@ -103,7 +103,7 @@ function applyBatch($ctx, ...args) {
|
|
|
103
103
|
return foundryPlatformFetch($ctx, _applyBatch, ...args);
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
106
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.30.0/node_modules/@osdk/foundry.ontologies/build/esm/public/ActionTypeV2.js
|
|
107
107
|
var ActionTypeV2_exports = {};
|
|
108
108
|
chunkQ7SFCCGT_cjs.__export(ActionTypeV2_exports, {
|
|
109
109
|
get: () => get,
|
|
@@ -123,7 +123,7 @@ function getByRid($ctx, ...args) {
|
|
|
123
123
|
return foundryPlatformFetch($ctx, _getByRid, ...args);
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
126
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.30.0/node_modules/@osdk/foundry.ontologies/build/esm/public/Attachment.js
|
|
127
127
|
var Attachment_exports = {};
|
|
128
128
|
chunkQ7SFCCGT_cjs.__export(Attachment_exports, {
|
|
129
129
|
get: () => get2,
|
|
@@ -148,7 +148,7 @@ function get2($ctx, ...args) {
|
|
|
148
148
|
return foundryPlatformFetch($ctx, _get2, ...args);
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
151
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.30.0/node_modules/@osdk/foundry.ontologies/build/esm/public/MediaReferenceProperty.js
|
|
152
152
|
var MediaReferenceProperty_exports = {};
|
|
153
153
|
chunkQ7SFCCGT_cjs.__export(MediaReferenceProperty_exports, {
|
|
154
154
|
getMediaContent: () => getMediaContent,
|
|
@@ -173,7 +173,7 @@ function uploadMedia($ctx, ...args) {
|
|
|
173
173
|
return foundryPlatformFetch($ctx, _uploadMedia, ...args);
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
176
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.30.0/node_modules/@osdk/foundry.ontologies/build/esm/public/ObjectTypeV2.js
|
|
177
177
|
var ObjectTypeV2_exports = {};
|
|
178
178
|
chunkQ7SFCCGT_cjs.__export(ObjectTypeV2_exports, {
|
|
179
179
|
get: () => get3,
|
|
@@ -203,7 +203,7 @@ function getOutgoingLinkType($ctx, ...args) {
|
|
|
203
203
|
return foundryPlatformFetch($ctx, _getOutgoingLinkType, ...args);
|
|
204
204
|
}
|
|
205
205
|
|
|
206
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
206
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.30.0/node_modules/@osdk/foundry.ontologies/build/esm/public/OntologyInterface.js
|
|
207
207
|
var OntologyInterface_exports = {};
|
|
208
208
|
chunkQ7SFCCGT_cjs.__export(OntologyInterface_exports, {
|
|
209
209
|
aggregate: () => aggregate,
|
|
@@ -243,7 +243,7 @@ function getOutgoingInterfaceLinkType($ctx, ...args) {
|
|
|
243
243
|
return foundryPlatformFetch($ctx, _getOutgoingInterfaceLinkType, ...args);
|
|
244
244
|
}
|
|
245
245
|
|
|
246
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
246
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.30.0/node_modules/@osdk/foundry.ontologies/build/esm/public/OntologyObjectSet.js
|
|
247
247
|
var OntologyObjectSet_exports = {};
|
|
248
248
|
chunkQ7SFCCGT_cjs.__export(OntologyObjectSet_exports, {
|
|
249
249
|
aggregate: () => aggregate2,
|
|
@@ -278,7 +278,7 @@ function aggregate2($ctx, ...args) {
|
|
|
278
278
|
return foundryPlatformFetch($ctx, _aggregate2, ...args);
|
|
279
279
|
}
|
|
280
280
|
|
|
281
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
281
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.30.0/node_modules/@osdk/foundry.ontologies/build/esm/public/Query.js
|
|
282
282
|
var Query_exports = {};
|
|
283
283
|
chunkQ7SFCCGT_cjs.__export(Query_exports, {
|
|
284
284
|
execute: () => execute
|
|
@@ -288,7 +288,7 @@ function execute($ctx, ...args) {
|
|
|
288
288
|
return foundryPlatformFetch($ctx, _execute, ...args);
|
|
289
289
|
}
|
|
290
290
|
|
|
291
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
291
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.30.0/node_modules/@osdk/foundry.ontologies/build/esm/public/QueryType.js
|
|
292
292
|
var QueryType_exports = {};
|
|
293
293
|
chunkQ7SFCCGT_cjs.__export(QueryType_exports, {
|
|
294
294
|
get: () => get6,
|
|
@@ -303,7 +303,7 @@ function get6($ctx, ...args) {
|
|
|
303
303
|
return foundryPlatformFetch($ctx, _get6, ...args);
|
|
304
304
|
}
|
|
305
305
|
|
|
306
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
306
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.30.0/node_modules/@osdk/foundry.ontologies/build/esm/public/TimeSeriesPropertyV2.js
|
|
307
307
|
var TimeSeriesPropertyV2_exports = {};
|
|
308
308
|
chunkQ7SFCCGT_cjs.__export(TimeSeriesPropertyV2_exports, {
|
|
309
309
|
getFirstPoint: () => getFirstPoint,
|
|
@@ -323,7 +323,7 @@ function streamPoints($ctx, ...args) {
|
|
|
323
323
|
return foundryPlatformFetch($ctx, _streamPoints, ...args);
|
|
324
324
|
}
|
|
325
325
|
|
|
326
|
-
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.
|
|
326
|
+
// ../../node_modules/.pnpm/@osdk+foundry.ontologies@2.30.0/node_modules/@osdk/foundry.ontologies/build/esm/public/TimeSeriesValueBankProperty.js
|
|
327
327
|
var TimeSeriesValueBankProperty_exports = {};
|
|
328
328
|
chunkQ7SFCCGT_cjs.__export(TimeSeriesValueBankProperty_exports, {
|
|
329
329
|
getLatestValue: () => getLatestValue,
|
|
@@ -337,6 +337,187 @@ var _streamValues = [1, "/v2/ontologies/{0}/objects/{1}/{2}/timeseries/{3}/strea
|
|
|
337
337
|
function streamValues($ctx, ...args) {
|
|
338
338
|
return foundryPlatformFetch($ctx, _streamValues, ...args);
|
|
339
339
|
}
|
|
340
|
+
function extractNamespace(fqApiName) {
|
|
341
|
+
const last = fqApiName.lastIndexOf(".");
|
|
342
|
+
if (last === -1) return [void 0, fqApiName];
|
|
343
|
+
return [fqApiName.slice(0, last), fqApiName.slice(last + 1)];
|
|
344
|
+
}
|
|
345
|
+
function modernToLegacyWhereClause(whereClause, objectOrInterface) {
|
|
346
|
+
if ("$and" in whereClause) {
|
|
347
|
+
return {
|
|
348
|
+
type: "and",
|
|
349
|
+
value: whereClause.$and.map((clause) => modernToLegacyWhereClause(clause, objectOrInterface))
|
|
350
|
+
};
|
|
351
|
+
} else if ("$or" in whereClause) {
|
|
352
|
+
return {
|
|
353
|
+
type: "or",
|
|
354
|
+
value: whereClause.$or.map((clause) => modernToLegacyWhereClause(clause, objectOrInterface))
|
|
355
|
+
};
|
|
356
|
+
} else if ("$not" in whereClause) {
|
|
357
|
+
return {
|
|
358
|
+
type: "not",
|
|
359
|
+
value: modernToLegacyWhereClause(whereClause.$not, objectOrInterface)
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
const parts = Object.entries(whereClause);
|
|
363
|
+
if (parts.length === 1) {
|
|
364
|
+
return handleWherePair(parts[0], objectOrInterface);
|
|
365
|
+
}
|
|
366
|
+
return {
|
|
367
|
+
type: "and",
|
|
368
|
+
value: parts.map((v) => handleWherePair(v, objectOrInterface))
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
function makeGeoFilterBbox(bbox, filterType, propertyIdentifier, field) {
|
|
372
|
+
return {
|
|
373
|
+
type: filterType === "$within" ? "withinBoundingBox" : "intersectsBoundingBox",
|
|
374
|
+
/**
|
|
375
|
+
* This is a bit ugly, but did this so that propertyIdentifier only shows up in the return object if its defined,
|
|
376
|
+
* this makes it so we don't need to go update our entire test bed either to include a field which may change in near future.
|
|
377
|
+
* Once we solidify that this is the way forward, I can remove field and clean this up
|
|
378
|
+
*/
|
|
379
|
+
...propertyIdentifier != null && {
|
|
380
|
+
propertyIdentifier
|
|
381
|
+
},
|
|
382
|
+
field,
|
|
383
|
+
value: {
|
|
384
|
+
topLeft: {
|
|
385
|
+
type: "Point",
|
|
386
|
+
coordinates: [bbox[0], bbox[3]]
|
|
387
|
+
},
|
|
388
|
+
bottomRight: {
|
|
389
|
+
type: "Point",
|
|
390
|
+
coordinates: [bbox[2], bbox[1]]
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
function makeGeoFilterPolygon(coordinates, filterType, propertyIdentifier, field) {
|
|
396
|
+
return {
|
|
397
|
+
type: filterType,
|
|
398
|
+
...propertyIdentifier != null && {
|
|
399
|
+
propertyIdentifier
|
|
400
|
+
},
|
|
401
|
+
field,
|
|
402
|
+
value: {
|
|
403
|
+
type: "Polygon",
|
|
404
|
+
coordinates
|
|
405
|
+
}
|
|
406
|
+
};
|
|
407
|
+
}
|
|
408
|
+
function handleWherePair([fieldName, filter], objectOrInterface, structFieldSelector) {
|
|
409
|
+
!(filter != null) ? process.env.NODE_ENV !== "production" ? invariant5__default.default(false, "Defined key values are only allowed when they are not undefined.") : invariant5__default.default(false) : void 0;
|
|
410
|
+
const propertyIdentifier = structFieldSelector != null ? {
|
|
411
|
+
type: "structField",
|
|
412
|
+
...structFieldSelector,
|
|
413
|
+
propertyApiName: fullyQualifyPropName(structFieldSelector.propertyApiName, objectOrInterface)
|
|
414
|
+
} : void 0;
|
|
415
|
+
const field = structFieldSelector == null ? fullyQualifyPropName(fieldName, objectOrInterface) : void 0;
|
|
416
|
+
if (typeof filter === "string" || typeof filter === "number" || typeof filter === "boolean") {
|
|
417
|
+
return {
|
|
418
|
+
type: "eq",
|
|
419
|
+
...propertyIdentifier != null && {
|
|
420
|
+
propertyIdentifier
|
|
421
|
+
},
|
|
422
|
+
field,
|
|
423
|
+
value: filter
|
|
424
|
+
};
|
|
425
|
+
}
|
|
426
|
+
const keysOfFilter = Object.keys(filter);
|
|
427
|
+
const hasDollarSign = keysOfFilter.some((key) => key.startsWith("$"));
|
|
428
|
+
!(!hasDollarSign || keysOfFilter.length === 1) ? process.env.NODE_ENV !== "production" ? invariant5__default.default(false, "A WhereClause Filter with multiple clauses/fields is not allowed. Instead, use an 'or'/'and' clause to combine multiple filters.") : invariant5__default.default(false) : void 0;
|
|
429
|
+
if (!hasDollarSign) {
|
|
430
|
+
const structFilter = Object.entries(filter);
|
|
431
|
+
!(structFilter.length === 1) ? process.env.NODE_ENV !== "production" ? invariant5__default.default(false, "Cannot filter on more than one struct field in the same clause, need to use an and clause") : invariant5__default.default(false) : void 0;
|
|
432
|
+
const structFieldApiName = keysOfFilter[0];
|
|
433
|
+
return handleWherePair(Object.entries(filter)[0], objectOrInterface, {
|
|
434
|
+
propertyApiName: fieldName,
|
|
435
|
+
structFieldApiName
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
const firstKey = keysOfFilter[0];
|
|
439
|
+
!(filter[firstKey] != null) ? process.env.NODE_ENV !== "production" ? invariant5__default.default(false) : invariant5__default.default(false) : void 0;
|
|
440
|
+
if (firstKey === "$ne") {
|
|
441
|
+
return {
|
|
442
|
+
type: "not",
|
|
443
|
+
value: {
|
|
444
|
+
type: "eq",
|
|
445
|
+
...propertyIdentifier != null && {
|
|
446
|
+
propertyIdentifier
|
|
447
|
+
},
|
|
448
|
+
field,
|
|
449
|
+
value: filter[firstKey]
|
|
450
|
+
}
|
|
451
|
+
};
|
|
452
|
+
}
|
|
453
|
+
if (firstKey === "$within") {
|
|
454
|
+
const withinBody = filter[firstKey];
|
|
455
|
+
if (Array.isArray(withinBody)) {
|
|
456
|
+
return makeGeoFilterBbox(withinBody, firstKey, propertyIdentifier, field);
|
|
457
|
+
} else if ("$bbox" in withinBody && withinBody.$bbox != null) {
|
|
458
|
+
return makeGeoFilterBbox(withinBody.$bbox, firstKey, propertyIdentifier, field);
|
|
459
|
+
} else if ("$distance" in withinBody && "$of" in withinBody && withinBody.$distance != null && withinBody.$of != null) {
|
|
460
|
+
return {
|
|
461
|
+
type: "withinDistanceOf",
|
|
462
|
+
...propertyIdentifier != null && {
|
|
463
|
+
propertyIdentifier
|
|
464
|
+
},
|
|
465
|
+
field,
|
|
466
|
+
value: {
|
|
467
|
+
center: Array.isArray(withinBody.$of) ? {
|
|
468
|
+
type: "Point",
|
|
469
|
+
coordinates: withinBody.$of
|
|
470
|
+
} : withinBody.$of,
|
|
471
|
+
distance: {
|
|
472
|
+
value: withinBody.$distance[0],
|
|
473
|
+
unit: api.DistanceUnitMapping[withinBody.$distance[1]]
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
};
|
|
477
|
+
} else {
|
|
478
|
+
const coordinates = "$polygon" in withinBody ? withinBody.$polygon : withinBody.coordinates;
|
|
479
|
+
return makeGeoFilterPolygon(coordinates, "withinPolygon", propertyIdentifier, fieldName);
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
if (firstKey === "$intersects") {
|
|
483
|
+
const intersectsBody = filter[firstKey];
|
|
484
|
+
if (Array.isArray(intersectsBody)) {
|
|
485
|
+
return makeGeoFilterBbox(intersectsBody, firstKey, propertyIdentifier, field);
|
|
486
|
+
} else if ("$bbox" in intersectsBody && intersectsBody.$bbox != null) {
|
|
487
|
+
return makeGeoFilterBbox(intersectsBody.$bbox, firstKey, propertyIdentifier, field);
|
|
488
|
+
} else {
|
|
489
|
+
const coordinates = "$polygon" in intersectsBody ? intersectsBody.$polygon : intersectsBody.coordinates;
|
|
490
|
+
return makeGeoFilterPolygon(coordinates, "intersectsPolygon", propertyIdentifier, field);
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
if (firstKey === "$containsAllTerms" || firstKey === "$containsAnyTerm") {
|
|
494
|
+
return {
|
|
495
|
+
type: firstKey.substring(1),
|
|
496
|
+
...propertyIdentifier != null && {
|
|
497
|
+
propertyIdentifier
|
|
498
|
+
},
|
|
499
|
+
field,
|
|
500
|
+
value: typeof filter[firstKey] === "string" ? filter[firstKey] : filter[firstKey]["term"],
|
|
501
|
+
fuzzy: typeof filter[firstKey] === "string" ? false : filter[firstKey]["fuzzySearch"] ?? false
|
|
502
|
+
};
|
|
503
|
+
}
|
|
504
|
+
return {
|
|
505
|
+
type: firstKey.substring(1),
|
|
506
|
+
...propertyIdentifier != null && {
|
|
507
|
+
propertyIdentifier
|
|
508
|
+
},
|
|
509
|
+
field,
|
|
510
|
+
value: filter[firstKey]
|
|
511
|
+
};
|
|
512
|
+
}
|
|
513
|
+
function fullyQualifyPropName(fieldName, objectOrInterface) {
|
|
514
|
+
if (objectOrInterface.type === "interface") {
|
|
515
|
+
const [objApiNamespace] = extractNamespace(objectOrInterface.apiName);
|
|
516
|
+
const [fieldApiNamespace, fieldShortName] = extractNamespace(fieldName);
|
|
517
|
+
return fieldApiNamespace == null && objApiNamespace != null ? `${objApiNamespace}.${fieldShortName}` : fieldName;
|
|
518
|
+
}
|
|
519
|
+
return fieldName;
|
|
520
|
+
}
|
|
340
521
|
var addUserAgentAndRequestContextHeaders = (client, withMetadata) => ({
|
|
341
522
|
...client,
|
|
342
523
|
fetch: shared_net_fetch.createFetchHeaderMutator(client.fetch, (headers) => {
|
|
@@ -356,7 +537,7 @@ async function extractObjectOrInterfaceType(clientCtx, objectSet) {
|
|
|
356
537
|
}
|
|
357
538
|
const objOrInterfaceDef2 = def2.type === "object" ? await clientCtx.ontologyProvider.getObjectDefinition(def2.apiName) : await clientCtx.ontologyProvider.getInterfaceDefinition(def2.apiName);
|
|
358
539
|
const linkDef2 = objOrInterfaceDef2.links[objectSet.link];
|
|
359
|
-
!linkDef2 ? process.env.NODE_ENV !== "production" ?
|
|
540
|
+
!linkDef2 ? process.env.NODE_ENV !== "production" ? invariant5__default.default(false, `Missing link definition for '${objectSet.link}'`) : invariant5__default.default(false) : void 0;
|
|
360
541
|
return objOrInterfaceDef2.type === "object" ? {
|
|
361
542
|
apiName: objOrInterfaceDef2.links[objectSet.link].targetType,
|
|
362
543
|
type: "object"
|
|
@@ -385,7 +566,14 @@ async function extractObjectOrInterfaceType(clientCtx, objectSet) {
|
|
|
385
566
|
case "asType":
|
|
386
567
|
case "nearestNeighbors":
|
|
387
568
|
return extractObjectOrInterfaceType(clientCtx, objectSet.objectSet);
|
|
388
|
-
case "intersect":
|
|
569
|
+
case "intersect": {
|
|
570
|
+
const objectSets2 = objectSet.objectSets;
|
|
571
|
+
const objectSetTypes2 = await Promise.all(objectSets2.map((os) => extractObjectOrInterfaceType(clientCtx, os)));
|
|
572
|
+
const filteredObjectTypes2 = objectSetTypes2.filter(Boolean);
|
|
573
|
+
const firstInterfaceType = filteredObjectTypes2.find((val) => val?.type === "interface");
|
|
574
|
+
!firstInterfaceType ? process.env.NODE_ENV !== "production" ? invariant5__default.default(false, `Missing interface type in intersect objectset scope'`) : invariant5__default.default(false) : void 0;
|
|
575
|
+
return firstInterfaceType;
|
|
576
|
+
}
|
|
389
577
|
case "subtract":
|
|
390
578
|
case "union":
|
|
391
579
|
const objectSets = objectSet.objectSets;
|
|
@@ -394,7 +582,7 @@ async function extractObjectOrInterfaceType(clientCtx, objectSet) {
|
|
|
394
582
|
const firstObjectType = filteredObjectTypes[0];
|
|
395
583
|
!filteredObjectTypes.every((val) => {
|
|
396
584
|
return val?.apiName === firstObjectType?.apiName && val?.type === firstObjectType?.type;
|
|
397
|
-
}) ? process.env.NODE_ENV !== "production" ?
|
|
585
|
+
}) ? process.env.NODE_ENV !== "production" ? invariant5__default.default(false, "Can only have one object type when doing subtract, union") : invariant5__default.default(false) : void 0;
|
|
398
586
|
return filteredObjectTypes[0];
|
|
399
587
|
case "static":
|
|
400
588
|
case "reference":
|
|
@@ -406,7 +594,7 @@ async function extractObjectOrInterfaceType(clientCtx, objectSet) {
|
|
|
406
594
|
}
|
|
407
595
|
const objOrInterfaceDef = def.type === "object" ? await clientCtx.ontologyProvider.getObjectDefinition(def.apiName) : await clientCtx.ontologyProvider.getInterfaceDefinition(def.apiName);
|
|
408
596
|
const linkDef = objOrInterfaceDef.links[objectSet.interfaceLink];
|
|
409
|
-
!linkDef ? process.env.NODE_ENV !== "production" ?
|
|
597
|
+
!linkDef ? process.env.NODE_ENV !== "production" ? invariant5__default.default(false, `Missing link definition for '${objectSet.interfaceLink}'`) : invariant5__default.default(false) : void 0;
|
|
410
598
|
return objOrInterfaceDef.type === "object" ? {
|
|
411
599
|
apiName: objOrInterfaceDef.links[objectSet.interfaceLink].targetType,
|
|
412
600
|
type: "object"
|
|
@@ -416,7 +604,7 @@ async function extractObjectOrInterfaceType(clientCtx, objectSet) {
|
|
|
416
604
|
};
|
|
417
605
|
// 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.
|
|
418
606
|
default:
|
|
419
|
-
process.env.NODE_ENV !== "production" ?
|
|
607
|
+
process.env.NODE_ENV !== "production" ? invariant5__default.default(false, `Unsupported object set type for deriving object or interface type,`) : invariant5__default.default(false) ;
|
|
420
608
|
}
|
|
421
609
|
}
|
|
422
610
|
async function extractRdpDefinition(clientCtx, objectSet) {
|
|
@@ -436,7 +624,7 @@ async function extractRdpDefinitionInternal(clientCtx, objectSet, methodInputObj
|
|
|
436
624
|
}
|
|
437
625
|
const objDef = await clientCtx.ontologyProvider.getObjectDefinition(childObjectType);
|
|
438
626
|
const linkDef = objDef.links[objectSet.link];
|
|
439
|
-
!linkDef ? process.env.NODE_ENV !== "production" ?
|
|
627
|
+
!linkDef ? process.env.NODE_ENV !== "production" ? invariant5__default.default(false, `Missing link definition for '${objectSet.link}'`) : invariant5__default.default(false) : void 0;
|
|
440
628
|
return {
|
|
441
629
|
definitions: definitions2,
|
|
442
630
|
childObjectType: objDef.links[objectSet.link].targetType
|
|
@@ -522,13 +710,13 @@ async function extractRdpDefinitionInternal(clientCtx, objectSet, methodInputObj
|
|
|
522
710
|
...acc,
|
|
523
711
|
...definitions2
|
|
524
712
|
}), {});
|
|
525
|
-
!(Object.keys(definitions).length === 0) ? process.env.NODE_ENV !== "production" ?
|
|
713
|
+
!(Object.keys(definitions).length === 0) ? process.env.NODE_ENV !== "production" ? invariant5__default.default(false, "Object sets combined using intersect, subtract, or union must not contain any derived property definitions") : invariant5__default.default(false) : void 0;
|
|
526
714
|
const firstValidChildObjectType = objectSetTypes.find(({
|
|
527
715
|
childObjectType
|
|
528
716
|
}) => childObjectType != null)?.childObjectType;
|
|
529
717
|
!objectSetTypes.every(({
|
|
530
718
|
childObjectType
|
|
531
|
-
}) => childObjectType === firstValidChildObjectType || childObjectType == null) ? process.env.NODE_ENV !== "production" ?
|
|
719
|
+
}) => childObjectType === firstValidChildObjectType || childObjectType == null) ? process.env.NODE_ENV !== "production" ? invariant5__default.default(false, "All object sets in an intersect, subtract, or union must have the same child object type") : invariant5__default.default(false) : void 0;
|
|
532
720
|
return {
|
|
533
721
|
definitions: {},
|
|
534
722
|
childObjectType: firstValidChildObjectType
|
|
@@ -540,9 +728,9 @@ async function extractRdpDefinitionInternal(clientCtx, objectSet, methodInputObj
|
|
|
540
728
|
};
|
|
541
729
|
// 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.
|
|
542
730
|
case "interfaceLinkSearchAround":
|
|
543
|
-
process.env.NODE_ENV !== "production" ?
|
|
731
|
+
process.env.NODE_ENV !== "production" ? invariant5__default.default(false, `Unsupported object set type for Runtime Derived Properties`) : invariant5__default.default(false) ;
|
|
544
732
|
default:
|
|
545
|
-
process.env.NODE_ENV !== "production" ?
|
|
733
|
+
process.env.NODE_ENV !== "production" ? invariant5__default.default(false, `Unsupported object set type for Runtime Derived Properties`) : invariant5__default.default(false) ;
|
|
546
734
|
}
|
|
547
735
|
}
|
|
548
736
|
|
|
@@ -591,16 +779,46 @@ function resolveInterfaceObjectSet(objectSet, interfaceTypeApiName, args) {
|
|
|
591
779
|
}]
|
|
592
780
|
} : objectSet;
|
|
593
781
|
}
|
|
782
|
+
async function fetchStaticRidPage(client, rids, args, useSnapshot = false) {
|
|
783
|
+
const requestBody = await applyFetchArgs(args, {
|
|
784
|
+
objectSet: {
|
|
785
|
+
type: "static",
|
|
786
|
+
objects: rids
|
|
787
|
+
},
|
|
788
|
+
select: args?.$select ?? [],
|
|
789
|
+
excludeRid: !args?.$includeRid,
|
|
790
|
+
snapshot: useSnapshot
|
|
791
|
+
}, client, {
|
|
792
|
+
type: "object",
|
|
793
|
+
apiName: ""
|
|
794
|
+
});
|
|
795
|
+
const result = await OntologyObjectSet_exports.loadMultipleObjectTypes(addUserAgentAndRequestContextHeaders(client, {
|
|
796
|
+
osdkMetadata: void 0
|
|
797
|
+
}), await client.ontologyRid, requestBody, {
|
|
798
|
+
preview: true
|
|
799
|
+
});
|
|
800
|
+
return Promise.resolve({
|
|
801
|
+
data: await client.objectFactory2(client, result.data, void 0, {}, !args.$includeRid, args.$select, false, result.interfaceToObjectTypeMappings),
|
|
802
|
+
nextPageToken: result.nextPageToken,
|
|
803
|
+
totalCount: result.totalCount
|
|
804
|
+
});
|
|
805
|
+
}
|
|
594
806
|
async function fetchInterfacePage(client, interfaceType, args, objectSet, useSnapshot = false) {
|
|
595
807
|
if (args.$__UNSTABLE_useOldInterfaceApis) {
|
|
596
|
-
const
|
|
808
|
+
const baseRequestBody = {
|
|
597
809
|
augmentedProperties: {},
|
|
598
810
|
augmentedSharedPropertyTypes: {},
|
|
599
811
|
otherInterfaceTypes: [],
|
|
600
812
|
selectedObjectTypes: [],
|
|
601
|
-
selectedSharedPropertyTypes: args.$select
|
|
813
|
+
selectedSharedPropertyTypes: args.$select ? [...args.$select] : [],
|
|
602
814
|
where: objectSetToSearchJsonV2(objectSet, interfaceType.apiName)
|
|
603
|
-
}
|
|
815
|
+
};
|
|
816
|
+
const requestBody2 = await applyFetchArgs(args, baseRequestBody, client, interfaceType);
|
|
817
|
+
if (requestBody2.selectedSharedPropertyTypes.length > 0) {
|
|
818
|
+
const remapped = remapPropertyNames(interfaceType, requestBody2.selectedSharedPropertyTypes);
|
|
819
|
+
requestBody2.selectedSharedPropertyTypes = Array.from(remapped);
|
|
820
|
+
}
|
|
821
|
+
const result2 = await OntologyInterface_exports.search(addUserAgentAndRequestContextHeaders(client, interfaceType), await client.ontologyRid, interfaceType.apiName, requestBody2, {
|
|
604
822
|
preview: true
|
|
605
823
|
});
|
|
606
824
|
result2.data = await client.objectFactory(
|
|
@@ -614,13 +832,15 @@ async function fetchInterfacePage(client, interfaceType, args, objectSet, useSna
|
|
|
614
832
|
return result2;
|
|
615
833
|
}
|
|
616
834
|
const resolvedInterfaceObjectSet = resolveInterfaceObjectSet(objectSet, interfaceType.apiName, args);
|
|
617
|
-
const
|
|
835
|
+
const requestBody = await buildAndRemapRequestBody(args, {
|
|
618
836
|
objectSet: resolvedInterfaceObjectSet,
|
|
619
|
-
select: args?.$select
|
|
837
|
+
select: args?.$select ? [...args.$select] : [],
|
|
620
838
|
excludeRid: !args?.$includeRid,
|
|
621
839
|
snapshot: useSnapshot
|
|
622
|
-
}
|
|
623
|
-
|
|
840
|
+
}, client, interfaceType);
|
|
841
|
+
const result = await OntologyObjectSet_exports.loadMultipleObjectTypes(addUserAgentAndRequestContextHeaders(client, interfaceType), await client.ontologyRid, requestBody, {
|
|
842
|
+
preview: true,
|
|
843
|
+
branch: client.branch
|
|
624
844
|
});
|
|
625
845
|
return Promise.resolve({
|
|
626
846
|
data: await client.objectFactory2(client, result.data, (await extractObjectOrInterfaceType(client, resolvedInterfaceObjectSet))?.apiName ?? interfaceType.apiName, {}, !args.$includeRid, args.$select, false, result.interfaceToObjectTypeMappings),
|
|
@@ -655,35 +875,71 @@ async function fetchPageWithErrorsInternal(client, objectType, objectSet, args =
|
|
|
655
875
|
async function fetchPage(client, objectType, args, objectSet = resolveBaseObjectSetType(objectType)) {
|
|
656
876
|
return fetchPageInternal(client, objectType, objectSet, args);
|
|
657
877
|
}
|
|
658
|
-
function
|
|
878
|
+
async function buildAndRemapRequestBody(args, baseBody, client, objectType) {
|
|
879
|
+
const requestBody = await applyFetchArgs(args, baseBody, client, objectType);
|
|
880
|
+
if (requestBody.select != null && requestBody.select.length > 0) {
|
|
881
|
+
const remapped = remapPropertyNames(objectType, requestBody.select);
|
|
882
|
+
return {
|
|
883
|
+
...requestBody,
|
|
884
|
+
select: remapped
|
|
885
|
+
};
|
|
886
|
+
}
|
|
887
|
+
return requestBody;
|
|
888
|
+
}
|
|
889
|
+
function remapPropertyNames(objectOrInterface, propertyNames) {
|
|
890
|
+
if (objectOrInterface == null) {
|
|
891
|
+
return propertyNames;
|
|
892
|
+
}
|
|
893
|
+
if (objectOrInterface.type === "interface") {
|
|
894
|
+
const [objApiNamespace] = extractNamespace(objectOrInterface.apiName);
|
|
895
|
+
return propertyNames.map((name) => {
|
|
896
|
+
const [fieldApiNamespace, fieldShortName] = extractNamespace(name);
|
|
897
|
+
return fieldApiNamespace == null && objApiNamespace != null ? `${objApiNamespace}.${fieldShortName}` : name;
|
|
898
|
+
});
|
|
899
|
+
}
|
|
900
|
+
return propertyNames;
|
|
901
|
+
}
|
|
902
|
+
async function applyFetchArgs(args, body, _client, objectType) {
|
|
659
903
|
if (args?.$nextPageToken) {
|
|
660
904
|
body.pageToken = args.$nextPageToken;
|
|
661
905
|
}
|
|
662
906
|
if (args?.$pageSize != null) {
|
|
663
907
|
body.pageSize = args.$pageSize;
|
|
664
908
|
}
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
909
|
+
const orderBy = args?.$orderBy;
|
|
910
|
+
if (orderBy) {
|
|
911
|
+
if (orderBy === "relevance") {
|
|
912
|
+
body.orderBy = {
|
|
913
|
+
orderType: "relevance",
|
|
914
|
+
fields: []
|
|
915
|
+
};
|
|
916
|
+
} else {
|
|
917
|
+
const orderByEntries = Object.entries(orderBy);
|
|
918
|
+
const fieldNames = orderByEntries.map(([field]) => field);
|
|
919
|
+
const remappedFields = remapPropertyNames(objectType, fieldNames);
|
|
920
|
+
body.orderBy = {
|
|
921
|
+
fields: orderByEntries.map(([, direction], index) => ({
|
|
922
|
+
field: remappedFields[index],
|
|
923
|
+
direction
|
|
924
|
+
}))
|
|
925
|
+
};
|
|
926
|
+
}
|
|
672
927
|
}
|
|
673
928
|
return body;
|
|
674
929
|
}
|
|
675
930
|
async function fetchObjectPage(client, objectType, args, objectSet, useSnapshot = false) {
|
|
676
931
|
void client.ontologyProvider.getObjectDefinition(objectType.apiName);
|
|
677
|
-
const
|
|
932
|
+
const requestBody = await buildAndRemapRequestBody(args, {
|
|
678
933
|
objectSet,
|
|
679
|
-
|
|
680
|
-
select: args?.$select ?? [],
|
|
681
|
-
// FIXME?
|
|
934
|
+
select: args?.$select ? [...args.$select] : [],
|
|
682
935
|
excludeRid: !args?.$includeRid,
|
|
683
936
|
snapshot: useSnapshot
|
|
684
|
-
})
|
|
937
|
+
}, client, objectType);
|
|
938
|
+
const r = await OntologyObjectSet_exports.load(addUserAgentAndRequestContextHeaders(client, objectType), await client.ontologyRid, requestBody, {
|
|
939
|
+
branch: client.branch
|
|
940
|
+
});
|
|
685
941
|
return Promise.resolve({
|
|
686
|
-
data: await client.objectFactory(client, r.data, void 0, void 0, await extractRdpDefinition(client, objectSet), args.$select),
|
|
942
|
+
data: await client.objectFactory(client, r.data, void 0, void 0, await extractRdpDefinition(client, objectSet), args.$select, false),
|
|
687
943
|
nextPageToken: r.nextPageToken,
|
|
688
944
|
totalCount: r.totalCount
|
|
689
945
|
});
|
|
@@ -805,187 +1061,6 @@ async function fetchSingleWithErrors(client, objectType, args, objectSet) {
|
|
|
805
1061
|
};
|
|
806
1062
|
}
|
|
807
1063
|
}
|
|
808
|
-
function extractNamespace(fqApiName) {
|
|
809
|
-
const last = fqApiName.lastIndexOf(".");
|
|
810
|
-
if (last === -1) return [void 0, fqApiName];
|
|
811
|
-
return [fqApiName.slice(0, last), fqApiName.slice(last + 1)];
|
|
812
|
-
}
|
|
813
|
-
function modernToLegacyWhereClause(whereClause, objectOrInterface) {
|
|
814
|
-
if ("$and" in whereClause) {
|
|
815
|
-
return {
|
|
816
|
-
type: "and",
|
|
817
|
-
value: whereClause.$and.map((clause) => modernToLegacyWhereClause(clause, objectOrInterface))
|
|
818
|
-
};
|
|
819
|
-
} else if ("$or" in whereClause) {
|
|
820
|
-
return {
|
|
821
|
-
type: "or",
|
|
822
|
-
value: whereClause.$or.map((clause) => modernToLegacyWhereClause(clause, objectOrInterface))
|
|
823
|
-
};
|
|
824
|
-
} else if ("$not" in whereClause) {
|
|
825
|
-
return {
|
|
826
|
-
type: "not",
|
|
827
|
-
value: modernToLegacyWhereClause(whereClause.$not, objectOrInterface)
|
|
828
|
-
};
|
|
829
|
-
}
|
|
830
|
-
const parts = Object.entries(whereClause);
|
|
831
|
-
if (parts.length === 1) {
|
|
832
|
-
return handleWherePair(parts[0], objectOrInterface);
|
|
833
|
-
}
|
|
834
|
-
return {
|
|
835
|
-
type: "and",
|
|
836
|
-
value: parts.map((v) => handleWherePair(v, objectOrInterface))
|
|
837
|
-
};
|
|
838
|
-
}
|
|
839
|
-
function makeGeoFilterBbox(bbox, filterType, propertyIdentifier, field) {
|
|
840
|
-
return {
|
|
841
|
-
type: filterType === "$within" ? "withinBoundingBox" : "intersectsBoundingBox",
|
|
842
|
-
/**
|
|
843
|
-
* This is a bit ugly, but did this so that propertyIdentifier only shows up in the return object if its defined,
|
|
844
|
-
* this makes it so we don't need to go update our entire test bed either to include a field which may change in near future.
|
|
845
|
-
* Once we solidify that this is the way forward, I can remove field and clean this up
|
|
846
|
-
*/
|
|
847
|
-
...propertyIdentifier != null && {
|
|
848
|
-
propertyIdentifier
|
|
849
|
-
},
|
|
850
|
-
field,
|
|
851
|
-
value: {
|
|
852
|
-
topLeft: {
|
|
853
|
-
type: "Point",
|
|
854
|
-
coordinates: [bbox[0], bbox[3]]
|
|
855
|
-
},
|
|
856
|
-
bottomRight: {
|
|
857
|
-
type: "Point",
|
|
858
|
-
coordinates: [bbox[2], bbox[1]]
|
|
859
|
-
}
|
|
860
|
-
}
|
|
861
|
-
};
|
|
862
|
-
}
|
|
863
|
-
function makeGeoFilterPolygon(coordinates, filterType, propertyIdentifier, field) {
|
|
864
|
-
return {
|
|
865
|
-
type: filterType,
|
|
866
|
-
...propertyIdentifier != null && {
|
|
867
|
-
propertyIdentifier
|
|
868
|
-
},
|
|
869
|
-
field,
|
|
870
|
-
value: {
|
|
871
|
-
type: "Polygon",
|
|
872
|
-
coordinates
|
|
873
|
-
}
|
|
874
|
-
};
|
|
875
|
-
}
|
|
876
|
-
function handleWherePair([fieldName, filter], objectOrInterface, structFieldSelector) {
|
|
877
|
-
!(filter != null) ? process.env.NODE_ENV !== "production" ? invariant8__default.default(false, "Defined key values are only allowed when they are not undefined.") : invariant8__default.default(false) : void 0;
|
|
878
|
-
const propertyIdentifier = structFieldSelector != null ? {
|
|
879
|
-
type: "structField",
|
|
880
|
-
...structFieldSelector,
|
|
881
|
-
propertyApiName: fullyQualifyPropName(structFieldSelector.propertyApiName, objectOrInterface)
|
|
882
|
-
} : void 0;
|
|
883
|
-
const field = structFieldSelector == null ? fullyQualifyPropName(fieldName, objectOrInterface) : void 0;
|
|
884
|
-
if (typeof filter === "string" || typeof filter === "number" || typeof filter === "boolean") {
|
|
885
|
-
return {
|
|
886
|
-
type: "eq",
|
|
887
|
-
...propertyIdentifier != null && {
|
|
888
|
-
propertyIdentifier
|
|
889
|
-
},
|
|
890
|
-
field,
|
|
891
|
-
value: filter
|
|
892
|
-
};
|
|
893
|
-
}
|
|
894
|
-
const keysOfFilter = Object.keys(filter);
|
|
895
|
-
const hasDollarSign = keysOfFilter.some((key) => key.startsWith("$"));
|
|
896
|
-
!(!hasDollarSign || keysOfFilter.length === 1) ? process.env.NODE_ENV !== "production" ? invariant8__default.default(false, "A WhereClause Filter with multiple clauses/fields is not allowed. Instead, use an 'or'/'and' clause to combine multiple filters.") : invariant8__default.default(false) : void 0;
|
|
897
|
-
if (!hasDollarSign) {
|
|
898
|
-
const structFilter = Object.entries(filter);
|
|
899
|
-
!(structFilter.length === 1) ? process.env.NODE_ENV !== "production" ? invariant8__default.default(false, "Cannot filter on more than one struct field in the same clause, need to use an and clause") : invariant8__default.default(false) : void 0;
|
|
900
|
-
const structFieldApiName = keysOfFilter[0];
|
|
901
|
-
return handleWherePair(Object.entries(filter)[0], objectOrInterface, {
|
|
902
|
-
propertyApiName: fieldName,
|
|
903
|
-
structFieldApiName
|
|
904
|
-
});
|
|
905
|
-
}
|
|
906
|
-
const firstKey = keysOfFilter[0];
|
|
907
|
-
!(filter[firstKey] != null) ? process.env.NODE_ENV !== "production" ? invariant8__default.default(false) : invariant8__default.default(false) : void 0;
|
|
908
|
-
if (firstKey === "$ne") {
|
|
909
|
-
return {
|
|
910
|
-
type: "not",
|
|
911
|
-
value: {
|
|
912
|
-
type: "eq",
|
|
913
|
-
...propertyIdentifier != null && {
|
|
914
|
-
propertyIdentifier
|
|
915
|
-
},
|
|
916
|
-
field,
|
|
917
|
-
value: filter[firstKey]
|
|
918
|
-
}
|
|
919
|
-
};
|
|
920
|
-
}
|
|
921
|
-
if (firstKey === "$within") {
|
|
922
|
-
const withinBody = filter[firstKey];
|
|
923
|
-
if (Array.isArray(withinBody)) {
|
|
924
|
-
return makeGeoFilterBbox(withinBody, firstKey, propertyIdentifier, field);
|
|
925
|
-
} else if ("$bbox" in withinBody && withinBody.$bbox != null) {
|
|
926
|
-
return makeGeoFilterBbox(withinBody.$bbox, firstKey, propertyIdentifier, field);
|
|
927
|
-
} else if ("$distance" in withinBody && "$of" in withinBody && withinBody.$distance != null && withinBody.$of != null) {
|
|
928
|
-
return {
|
|
929
|
-
type: "withinDistanceOf",
|
|
930
|
-
...propertyIdentifier != null && {
|
|
931
|
-
propertyIdentifier
|
|
932
|
-
},
|
|
933
|
-
field,
|
|
934
|
-
value: {
|
|
935
|
-
center: Array.isArray(withinBody.$of) ? {
|
|
936
|
-
type: "Point",
|
|
937
|
-
coordinates: withinBody.$of
|
|
938
|
-
} : withinBody.$of,
|
|
939
|
-
distance: {
|
|
940
|
-
value: withinBody.$distance[0],
|
|
941
|
-
unit: api.DistanceUnitMapping[withinBody.$distance[1]]
|
|
942
|
-
}
|
|
943
|
-
}
|
|
944
|
-
};
|
|
945
|
-
} else {
|
|
946
|
-
const coordinates = "$polygon" in withinBody ? withinBody.$polygon : withinBody.coordinates;
|
|
947
|
-
return makeGeoFilterPolygon(coordinates, "withinPolygon", propertyIdentifier, fieldName);
|
|
948
|
-
}
|
|
949
|
-
}
|
|
950
|
-
if (firstKey === "$intersects") {
|
|
951
|
-
const intersectsBody = filter[firstKey];
|
|
952
|
-
if (Array.isArray(intersectsBody)) {
|
|
953
|
-
return makeGeoFilterBbox(intersectsBody, firstKey, propertyIdentifier, field);
|
|
954
|
-
} else if ("$bbox" in intersectsBody && intersectsBody.$bbox != null) {
|
|
955
|
-
return makeGeoFilterBbox(intersectsBody.$bbox, firstKey, propertyIdentifier, field);
|
|
956
|
-
} else {
|
|
957
|
-
const coordinates = "$polygon" in intersectsBody ? intersectsBody.$polygon : intersectsBody.coordinates;
|
|
958
|
-
return makeGeoFilterPolygon(coordinates, "intersectsPolygon", propertyIdentifier, field);
|
|
959
|
-
}
|
|
960
|
-
}
|
|
961
|
-
if (firstKey === "$containsAllTerms" || firstKey === "$containsAnyTerm") {
|
|
962
|
-
return {
|
|
963
|
-
type: firstKey.substring(1),
|
|
964
|
-
...propertyIdentifier != null && {
|
|
965
|
-
propertyIdentifier
|
|
966
|
-
},
|
|
967
|
-
field,
|
|
968
|
-
value: typeof filter[firstKey] === "string" ? filter[firstKey] : filter[firstKey]["term"],
|
|
969
|
-
fuzzy: typeof filter[firstKey] === "string" ? false : filter[firstKey]["fuzzySearch"] ?? false
|
|
970
|
-
};
|
|
971
|
-
}
|
|
972
|
-
return {
|
|
973
|
-
type: firstKey.substring(1),
|
|
974
|
-
...propertyIdentifier != null && {
|
|
975
|
-
propertyIdentifier
|
|
976
|
-
},
|
|
977
|
-
field,
|
|
978
|
-
value: filter[firstKey]
|
|
979
|
-
};
|
|
980
|
-
}
|
|
981
|
-
function fullyQualifyPropName(fieldName, objectOrInterface) {
|
|
982
|
-
if (objectOrInterface.type === "interface") {
|
|
983
|
-
const [objApiNamespace] = extractNamespace(objectOrInterface.apiName);
|
|
984
|
-
const [fieldApiNamespace, fieldShortName] = extractNamespace(fieldName);
|
|
985
|
-
return fieldApiNamespace == null && objApiNamespace != null ? `${objApiNamespace}.${fieldShortName}` : fieldName;
|
|
986
|
-
}
|
|
987
|
-
return fieldName;
|
|
988
|
-
}
|
|
989
1064
|
function derivedPropertyDefinitionFactory(wireDefinition, definitionMap) {
|
|
990
1065
|
const definition = {
|
|
991
1066
|
abs() {
|
|
@@ -1052,12 +1127,12 @@ function derivedPropertyDefinitionFactory(wireDefinition, definitionMap) {
|
|
|
1052
1127
|
var getDefinitionFromMap = (arg, definitionMap) => {
|
|
1053
1128
|
if (typeof arg === "object") {
|
|
1054
1129
|
const definition = definitionMap.get(arg);
|
|
1055
|
-
!definition ? process.env.NODE_ENV !== "production" ?
|
|
1130
|
+
!definition ? process.env.NODE_ENV !== "production" ? invariant5__default.default(false, "Derived Property is not defined") : invariant5__default.default(false) : void 0;
|
|
1056
1131
|
return definition;
|
|
1057
1132
|
} else if (typeof arg === "number") {
|
|
1058
|
-
process.env.NODE_ENV !== "production" ?
|
|
1133
|
+
process.env.NODE_ENV !== "production" ? invariant5__default.default(false, "Literals for derived properties are not yet supported") : invariant5__default.default(false) ;
|
|
1059
1134
|
}
|
|
1060
|
-
process.env.NODE_ENV !== "production" ?
|
|
1135
|
+
process.env.NODE_ENV !== "production" ? invariant5__default.default(false, "Invalid argument type for a derived property") : invariant5__default.default(false) ;
|
|
1061
1136
|
};
|
|
1062
1137
|
|
|
1063
1138
|
// src/derivedProperties/createWithPropertiesObjectSet.ts
|
|
@@ -1079,7 +1154,7 @@ function createWithPropertiesObjectSet(objectType, objectSet, definitionMap, fro
|
|
|
1079
1154
|
},
|
|
1080
1155
|
aggregate: (aggregation, opt) => {
|
|
1081
1156
|
const splitAggregation = aggregation.split(":");
|
|
1082
|
-
!(splitAggregation.length === 2 || splitAggregation[0] === "$count") ? process.env.NODE_ENV !== "production" ?
|
|
1157
|
+
!(splitAggregation.length === 2 || splitAggregation[0] === "$count") ? process.env.NODE_ENV !== "production" ? invariant5__default.default(false, "Invalid aggregation format") : invariant5__default.default(false) : void 0;
|
|
1083
1158
|
const [aggregationPropertyName, aggregationOperation] = splitAggregation;
|
|
1084
1159
|
let aggregationOperationDefinition;
|
|
1085
1160
|
switch (aggregationOperation) {
|
|
@@ -1117,7 +1192,7 @@ function createWithPropertiesObjectSet(objectType, objectSet, definitionMap, fro
|
|
|
1117
1192
|
break;
|
|
1118
1193
|
}
|
|
1119
1194
|
default:
|
|
1120
|
-
process.env.NODE_ENV !== "production" ?
|
|
1195
|
+
process.env.NODE_ENV !== "production" ? invariant5__default.default(false, "Invalid aggregation operation " + aggregationOperation) : invariant5__default.default(false) ;
|
|
1121
1196
|
}
|
|
1122
1197
|
const wrappedObjectSet = {
|
|
1123
1198
|
type: "selection",
|
|
@@ -1149,6 +1224,23 @@ function createWithPropertiesObjectSet(objectType, objectSet, definitionMap, fro
|
|
|
1149
1224
|
const selectorResult = derivedPropertyDefinitionFactory(wrappedObjectSet, definitionMap);
|
|
1150
1225
|
definitionMap.set(selectorResult, wrappedObjectSet);
|
|
1151
1226
|
return selectorResult;
|
|
1227
|
+
},
|
|
1228
|
+
constant: {
|
|
1229
|
+
double: (value) => {
|
|
1230
|
+
process.env.NODE_ENV !== "production" ? invariant5__default.default(false, "Not supported") : invariant5__default.default(false) ;
|
|
1231
|
+
},
|
|
1232
|
+
integer: (value) => {
|
|
1233
|
+
process.env.NODE_ENV !== "production" ? invariant5__default.default(false, "Not supported") : invariant5__default.default(false) ;
|
|
1234
|
+
},
|
|
1235
|
+
long: (value) => {
|
|
1236
|
+
process.env.NODE_ENV !== "production" ? invariant5__default.default(false, "Not supported") : invariant5__default.default(false) ;
|
|
1237
|
+
},
|
|
1238
|
+
datetime: (value) => {
|
|
1239
|
+
process.env.NODE_ENV !== "production" ? invariant5__default.default(false, "Not supported") : invariant5__default.default(false) ;
|
|
1240
|
+
},
|
|
1241
|
+
timestamp: (value) => {
|
|
1242
|
+
process.env.NODE_ENV !== "production" ? invariant5__default.default(false, "Not supported") : invariant5__default.default(false) ;
|
|
1243
|
+
}
|
|
1152
1244
|
}
|
|
1153
1245
|
};
|
|
1154
1246
|
}
|
|
@@ -1158,7 +1250,7 @@ function legacyToModernSingleAggregationResult(entry) {
|
|
|
1158
1250
|
if (parts[0] === "count") {
|
|
1159
1251
|
return accumulator;
|
|
1160
1252
|
}
|
|
1161
|
-
!(parts.length === 2) ? process.env.NODE_ENV !== "production" ?
|
|
1253
|
+
!(parts.length === 2) ? process.env.NODE_ENV !== "production" ? invariant5__default.default(false, "assumed we were getting a `${key}.${type}`") : invariant5__default.default(false) : void 0;
|
|
1162
1254
|
const property = parts[0];
|
|
1163
1255
|
const metricType = parts[1];
|
|
1164
1256
|
if (!(property in accumulator)) {
|
|
@@ -1257,9 +1349,11 @@ async function aggregate3(clientCtx, objectType, objectSet = resolveBaseObjectSe
|
|
|
1257
1349
|
objectSet,
|
|
1258
1350
|
groupBy: body.groupBy,
|
|
1259
1351
|
aggregation: body.aggregation
|
|
1352
|
+
}, {
|
|
1353
|
+
branch: clientCtx.branch
|
|
1260
1354
|
});
|
|
1261
1355
|
if (!req.$groupBy) {
|
|
1262
|
-
!(result.data.length === 1) ? process.env.NODE_ENV !== "production" ?
|
|
1356
|
+
!(result.data.length === 1) ? process.env.NODE_ENV !== "production" ? invariant5__default.default(false, "no group by clause should mean only one data result") : invariant5__default.default(false) : void 0;
|
|
1263
1357
|
return {
|
|
1264
1358
|
...aggregationToCountResult(result.data[0]),
|
|
1265
1359
|
...legacyToModernSingleAggregationResult(result.data[0])
|
|
@@ -1298,7 +1392,50 @@ var WIRE_OBJECT_SET_TYPES = /* @__PURE__ */ new Set(["base", "filter", "intersec
|
|
|
1298
1392
|
function isWireObjectSet(o) {
|
|
1299
1393
|
return o != null && typeof o === "object" && WIRE_OBJECT_SET_TYPES.has(o.type);
|
|
1300
1394
|
}
|
|
1395
|
+
|
|
1396
|
+
// src/util/exponentialBackoff.ts
|
|
1397
|
+
var DEFAULT_OPTIONS = {
|
|
1398
|
+
initialDelayMs: 1e3,
|
|
1399
|
+
maxDelayMs: 6e4,
|
|
1400
|
+
multiplier: 2,
|
|
1401
|
+
jitterFactor: 0.3
|
|
1402
|
+
};
|
|
1403
|
+
var ExponentialBackoff = class {
|
|
1404
|
+
attempt = 0;
|
|
1405
|
+
constructor(options = {}) {
|
|
1406
|
+
this.options = {
|
|
1407
|
+
...DEFAULT_OPTIONS,
|
|
1408
|
+
...options
|
|
1409
|
+
};
|
|
1410
|
+
}
|
|
1411
|
+
calculateDelay() {
|
|
1412
|
+
const {
|
|
1413
|
+
initialDelayMs,
|
|
1414
|
+
maxDelayMs,
|
|
1415
|
+
multiplier,
|
|
1416
|
+
jitterFactor
|
|
1417
|
+
} = this.options;
|
|
1418
|
+
const baseDelay = Math.min(initialDelayMs * Math.pow(multiplier, this.attempt), maxDelayMs);
|
|
1419
|
+
const jitter = baseDelay * jitterFactor * (Math.random() * 2 - 1);
|
|
1420
|
+
const delayWithJitter = Math.max(0, baseDelay + jitter);
|
|
1421
|
+
this.attempt++;
|
|
1422
|
+
return Math.round(delayWithJitter);
|
|
1423
|
+
}
|
|
1424
|
+
reset() {
|
|
1425
|
+
this.attempt = 0;
|
|
1426
|
+
}
|
|
1427
|
+
getAttempt() {
|
|
1428
|
+
return this.attempt;
|
|
1429
|
+
}
|
|
1430
|
+
};
|
|
1431
|
+
|
|
1432
|
+
// src/objectSet/ObjectSetListenerWebsocket.ts
|
|
1301
1433
|
var MINIMUM_RECONNECT_DELAY_MS = 5 * 1e3;
|
|
1434
|
+
var EXPONENTIAL_BACKOFF_INITIAL_DELAY_MS = 1e3;
|
|
1435
|
+
var EXPONENTIAL_BACKOFF_MAX_DELAY_MS = 6e4;
|
|
1436
|
+
var EXPONENTIAL_BACKOFF_MULTIPLIER = 2;
|
|
1437
|
+
var EXPONENTIAL_BACKOFF_JITTER_FACTOR = 0.3;
|
|
1438
|
+
var WEBSOCKET_IDLE_DISCONNECT_DELAY_MS = 15e3;
|
|
1302
1439
|
function doNothing() {
|
|
1303
1440
|
}
|
|
1304
1441
|
function fillOutListener({
|
|
@@ -1334,6 +1471,8 @@ var ObjectSetListenerWebsocket = class _ObjectSetListenerWebsocket {
|
|
|
1334
1471
|
#ws;
|
|
1335
1472
|
#lastWsConnect = 0;
|
|
1336
1473
|
#client;
|
|
1474
|
+
#backoff;
|
|
1475
|
+
#isFirstConnection = true;
|
|
1337
1476
|
#logger;
|
|
1338
1477
|
/**
|
|
1339
1478
|
* map of requestId to all active subscriptions at the time of the request
|
|
@@ -1352,10 +1491,16 @@ var ObjectSetListenerWebsocket = class _ObjectSetListenerWebsocket {
|
|
|
1352
1491
|
} = {}) {
|
|
1353
1492
|
this.MINIMUM_RECONNECT_DELAY_MS = minimumReconnectDelayMs;
|
|
1354
1493
|
this.#client = client;
|
|
1494
|
+
this.#backoff = new ExponentialBackoff({
|
|
1495
|
+
initialDelayMs: EXPONENTIAL_BACKOFF_INITIAL_DELAY_MS,
|
|
1496
|
+
maxDelayMs: EXPONENTIAL_BACKOFF_MAX_DELAY_MS,
|
|
1497
|
+
multiplier: EXPONENTIAL_BACKOFF_MULTIPLIER,
|
|
1498
|
+
jitterFactor: EXPONENTIAL_BACKOFF_JITTER_FACTOR
|
|
1499
|
+
});
|
|
1355
1500
|
this.#logger = client.logger?.child({}, {
|
|
1356
1501
|
msgPrefix: "<OSW> "
|
|
1357
1502
|
});
|
|
1358
|
-
!(client.baseUrl.startsWith("https://") || client.baseUrl.startsWith("http://")) ? process.env.NODE_ENV !== "production" ?
|
|
1503
|
+
!(client.baseUrl.startsWith("https://") || client.baseUrl.startsWith("http://")) ? process.env.NODE_ENV !== "production" ? invariant5__default.default(false, "Stack must be a URL") : invariant5__default.default(false) : void 0;
|
|
1359
1504
|
}
|
|
1360
1505
|
async subscribe(objectType, objectSet, listener, properties = []) {
|
|
1361
1506
|
const objOrInterfaceDef = objectType.type === "object" ? await this.#client.ontologyProvider.getObjectDefinition(objectType.apiName) : await this.#client.ontologyProvider.getInterfaceDefinition(objectType.apiName);
|
|
@@ -1452,16 +1597,12 @@ var ObjectSetListenerWebsocket = class _ObjectSetListenerWebsocket {
|
|
|
1452
1597
|
if (this.#maybeDisconnectTimeout) {
|
|
1453
1598
|
clearTimeout(this.#maybeDisconnectTimeout);
|
|
1454
1599
|
}
|
|
1455
|
-
this.#maybeDisconnectTimeout = setTimeout(
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
},
|
|
1462
|
-
15e3
|
|
1463
|
-
/* ms */
|
|
1464
|
-
);
|
|
1600
|
+
this.#maybeDisconnectTimeout = setTimeout(() => {
|
|
1601
|
+
this.#maybeDisconnectTimeout = void 0;
|
|
1602
|
+
if (this.#subscriptions.size === 0) {
|
|
1603
|
+
this.#cycleWebsocket();
|
|
1604
|
+
}
|
|
1605
|
+
}, WEBSOCKET_IDLE_DISCONNECT_DELAY_MS);
|
|
1465
1606
|
}
|
|
1466
1607
|
async #ensureWebsocket() {
|
|
1467
1608
|
if (this.#ws == null) {
|
|
@@ -1472,10 +1613,16 @@ var ObjectSetListenerWebsocket = class _ObjectSetListenerWebsocket {
|
|
|
1472
1613
|
const url = constructWebsocketUrl(baseUrl, await this.#client.ontologyRid);
|
|
1473
1614
|
const token = await tokenProvider();
|
|
1474
1615
|
if (this.#ws == null) {
|
|
1475
|
-
|
|
1476
|
-
|
|
1616
|
+
if (!this.#isFirstConnection) {
|
|
1617
|
+
const delay = this.#backoff.calculateDelay();
|
|
1618
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1619
|
+
this.#logger?.debug({
|
|
1620
|
+
delay,
|
|
1621
|
+
attempt: this.#backoff.getAttempt()
|
|
1622
|
+
}, "Waiting before reconnect");
|
|
1623
|
+
}
|
|
1477
1624
|
await new Promise((resolve) => {
|
|
1478
|
-
setTimeout(resolve,
|
|
1625
|
+
setTimeout(resolve, delay);
|
|
1479
1626
|
});
|
|
1480
1627
|
}
|
|
1481
1628
|
this.#lastWsConnect = Date.now();
|
|
@@ -1503,7 +1650,7 @@ var ObjectSetListenerWebsocket = class _ObjectSetListenerWebsocket {
|
|
|
1503
1650
|
}
|
|
1504
1651
|
function error(evt) {
|
|
1505
1652
|
cleanup();
|
|
1506
|
-
reject(evt);
|
|
1653
|
+
reject(new Error(String(evt)));
|
|
1507
1654
|
}
|
|
1508
1655
|
ws.addEventListener("open", open);
|
|
1509
1656
|
ws.addEventListener("error", error);
|
|
@@ -1513,10 +1660,12 @@ var ObjectSetListenerWebsocket = class _ObjectSetListenerWebsocket {
|
|
|
1513
1660
|
}
|
|
1514
1661
|
}
|
|
1515
1662
|
#onOpen = () => {
|
|
1663
|
+
this.#isFirstConnection = false;
|
|
1664
|
+
this.#backoff.reset();
|
|
1516
1665
|
this.#sendSubscribeMessage();
|
|
1517
1666
|
};
|
|
1518
1667
|
#onMessage = async (message) => {
|
|
1519
|
-
const data = JSON.parse(message.data
|
|
1668
|
+
const data = JSON.parse(String(message.data));
|
|
1520
1669
|
if (process.env.NODE_ENV !== "production") {
|
|
1521
1670
|
this.#logger?.debug({
|
|
1522
1671
|
payload: data
|
|
@@ -1537,7 +1686,7 @@ var ObjectSetListenerWebsocket = class _ObjectSetListenerWebsocket {
|
|
|
1537
1686
|
return;
|
|
1538
1687
|
}
|
|
1539
1688
|
default:
|
|
1540
|
-
process.env.NODE_ENV !== "production" ?
|
|
1689
|
+
process.env.NODE_ENV !== "production" ? invariant5__default.default(false, "Unexpected message type") : invariant5__default.default(false) ;
|
|
1541
1690
|
}
|
|
1542
1691
|
};
|
|
1543
1692
|
#handleMessage_objectSetChanged = async (payload) => {
|
|
@@ -1602,7 +1751,7 @@ var ObjectSetListenerWebsocket = class _ObjectSetListenerWebsocket {
|
|
|
1602
1751
|
}
|
|
1603
1752
|
#handleMessage_refreshObjectSet = (payload) => {
|
|
1604
1753
|
const sub = this.#subscriptions.get(payload.id);
|
|
1605
|
-
!sub ? process.env.NODE_ENV !== "production" ?
|
|
1754
|
+
!sub ? process.env.NODE_ENV !== "production" ? invariant5__default.default(false, `Expected subscription id ${payload.id}`) : invariant5__default.default(false) : void 0;
|
|
1606
1755
|
try {
|
|
1607
1756
|
sub.listener.onOutOfDate();
|
|
1608
1757
|
} catch (error) {
|
|
@@ -1616,7 +1765,7 @@ var ObjectSetListenerWebsocket = class _ObjectSetListenerWebsocket {
|
|
|
1616
1765
|
responses
|
|
1617
1766
|
} = payload;
|
|
1618
1767
|
const subs = this.#pendingSubscriptions.get(id);
|
|
1619
|
-
!subs ? process.env.NODE_ENV !== "production" ?
|
|
1768
|
+
!subs ? process.env.NODE_ENV !== "production" ? invariant5__default.default(false, `should have a pending subscription for ${id}`) : invariant5__default.default(false) : void 0;
|
|
1620
1769
|
this.#pendingSubscriptions.delete(id);
|
|
1621
1770
|
for (let i = 0; i < responses.length; i++) {
|
|
1622
1771
|
const sub = subs[i];
|
|
@@ -1658,7 +1807,7 @@ var ObjectSetListenerWebsocket = class _ObjectSetListenerWebsocket {
|
|
|
1658
1807
|
#handleMessage_subscriptionClosed(payload) {
|
|
1659
1808
|
const sub = this.#subscriptions.get(payload.id);
|
|
1660
1809
|
if (sub == null && this.#endedSubscriptions.has(payload.id)) return;
|
|
1661
|
-
!sub ? process.env.NODE_ENV !== "production" ?
|
|
1810
|
+
!sub ? process.env.NODE_ENV !== "production" ? invariant5__default.default(false, `Expected subscription id ${payload.id}`) : invariant5__default.default(false) : void 0;
|
|
1662
1811
|
this.#tryCatchOnError(sub, true, payload.cause);
|
|
1663
1812
|
this.#unsubscribe(sub, "error");
|
|
1664
1813
|
}
|
|
@@ -1683,7 +1832,7 @@ var ObjectSetListenerWebsocket = class _ObjectSetListenerWebsocket {
|
|
|
1683
1832
|
if (this.#subscriptions.size > 0) {
|
|
1684
1833
|
if (process.env.NODE_ENV !== "production") {
|
|
1685
1834
|
for (const s of this.#subscriptions.values()) {
|
|
1686
|
-
!(s.status !== "done" && s.status !== "error") ? process.env.NODE_ENV !== "production" ?
|
|
1835
|
+
!(s.status !== "done" && s.status !== "error") ? process.env.NODE_ENV !== "production" ? invariant5__default.default(false, "should not have done/error subscriptions still") : invariant5__default.default(false) : void 0;
|
|
1687
1836
|
}
|
|
1688
1837
|
}
|
|
1689
1838
|
for (const s of this.#subscriptions.values()) {
|
|
@@ -1896,11 +2045,12 @@ exports.extractNamespace = extractNamespace;
|
|
|
1896
2045
|
exports.fetchPage = fetchPage;
|
|
1897
2046
|
exports.fetchSingle = fetchSingle;
|
|
1898
2047
|
exports.fetchSingleWithErrors = fetchSingleWithErrors;
|
|
2048
|
+
exports.fetchStaticRidPage = fetchStaticRidPage;
|
|
1899
2049
|
exports.getWireObjectSet = getWireObjectSet;
|
|
1900
2050
|
exports.hydrateAttachmentFromRid = hydrateAttachmentFromRid;
|
|
1901
2051
|
exports.hydrateAttachmentFromRidInternal = hydrateAttachmentFromRidInternal;
|
|
1902
2052
|
exports.isObjectSet = isObjectSet;
|
|
1903
2053
|
exports.isWireObjectSet = isWireObjectSet;
|
|
1904
2054
|
exports.symbolClientContext = symbolClientContext;
|
|
1905
|
-
//# sourceMappingURL=chunk-
|
|
1906
|
-
//# sourceMappingURL=chunk-
|
|
2055
|
+
//# sourceMappingURL=chunk-GVGP7T5P.cjs.map
|
|
2056
|
+
//# sourceMappingURL=chunk-GVGP7T5P.cjs.map
|