@osdk/client 2.1.0-beta.9 → 2.1.0
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 +529 -0
- package/build/browser/Client.js +7 -0
- package/build/browser/Client.js.map +1 -1
- package/build/browser/Definitions.test.js +1 -0
- package/build/browser/Definitions.test.js.map +1 -1
- package/build/browser/Logger.js +0 -15
- package/build/browser/Logger.js.map +1 -1
- package/build/browser/MinimalClientContext.js +0 -15
- package/build/browser/MinimalClientContext.js.map +1 -1
- package/build/browser/ResultOrError.js +1 -0
- package/build/browser/ResultOrError.js.map +1 -1
- package/build/browser/SatisfiesSemver.js +0 -15
- package/build/browser/SatisfiesSemver.js.map +1 -1
- package/build/browser/SatisfiesSemver.test.js +1 -0
- package/build/browser/SatisfiesSemver.test.js.map +1 -1
- package/build/browser/__unstable/ConjureSupport.js +8 -2
- package/build/browser/__unstable/ConjureSupport.js.map +1 -1
- package/build/browser/__unstable/createBulkLinksAsyncIterFactory.js +5 -1
- package/build/browser/__unstable/createBulkLinksAsyncIterFactory.js.map +1 -1
- package/build/browser/actions/ActionValidationError.js +1 -1
- package/build/browser/actions/ActionValidationError.js.map +1 -1
- package/build/browser/actions/actions.test.js +85 -4
- package/build/browser/actions/actions.test.js.map +1 -1
- package/build/browser/actions/applyAction.js +2 -1
- package/build/browser/actions/applyAction.js.map +1 -1
- package/build/browser/createClient.js +37 -26
- package/build/browser/createClient.js.map +1 -1
- package/build/browser/createClient.test.js +25 -0
- package/build/browser/createClient.test.js.map +1 -1
- package/build/browser/createGeotimeSeriesProperty.js +5 -3
- package/build/browser/createGeotimeSeriesProperty.js.map +1 -1
- package/build/browser/createMediaReferenceProperty.js +47 -0
- package/build/browser/createMediaReferenceProperty.js.map +1 -0
- package/build/browser/createMinimalClient.js +8 -1
- package/build/browser/createMinimalClient.js.map +1 -1
- package/build/browser/createPlatformClient.js +1 -0
- package/build/browser/createPlatformClient.js.map +1 -1
- package/build/browser/createTimeseriesProperty.js +2 -1
- package/build/browser/createTimeseriesProperty.js.map +1 -1
- package/build/browser/definitions/LinkDefinitions.test.js +4 -0
- package/build/browser/definitions/LinkDefinitions.test.js.map +1 -1
- package/build/browser/fetchMetadata.js +2 -0
- package/build/browser/fetchMetadata.js.map +1 -1
- package/build/browser/fetchMetadata.test.js +19 -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/callsQueryAcceptsObject.js +3 -1
- package/build/browser/intellisense.test.helpers/callsQueryAcceptsObject.js.map +1 -1
- package/build/browser/intellisense.test.js +4 -1
- package/build/browser/intellisense.test.js.map +1 -1
- package/build/browser/internal/conversions/legacyToModernSingleAggregationResult.js +2 -0
- package/build/browser/internal/conversions/legacyToModernSingleAggregationResult.js.map +1 -1
- package/build/browser/internal/conversions/modernToLegacyAggregationClause.js +2 -0
- package/build/browser/internal/conversions/modernToLegacyAggregationClause.js.map +1 -1
- package/build/browser/internal/conversions/modernToLegacyGroupByClause.js +1 -0
- package/build/browser/internal/conversions/modernToLegacyGroupByClause.js.map +1 -1
- package/build/browser/internal/conversions/modernToLegacyWhereClause.js +67 -18
- package/build/browser/internal/conversions/modernToLegacyWhereClause.js.map +1 -1
- package/build/browser/internal/conversions/modernToLegacyWhereClause.test.js +402 -14
- package/build/browser/internal/conversions/modernToLegacyWhereClause.test.js.map +1 -1
- package/build/browser/object/AttachmentUpload.js +6 -13
- package/build/browser/object/AttachmentUpload.js.map +1 -1
- package/build/browser/object/Cache.js +27 -0
- package/build/browser/object/Cache.js.map +1 -1
- package/build/browser/object/Cache.test.js +10 -3
- package/build/browser/object/Cache.test.js.map +1 -1
- package/build/browser/object/SimpleCache.js +20 -0
- package/build/browser/object/SimpleCache.js.map +1 -1
- package/build/browser/object/aggregate.js +7 -9
- package/build/browser/object/aggregate.js.map +1 -1
- package/build/browser/object/aggregate.test.js +11 -9
- package/build/browser/object/aggregate.test.js.map +1 -1
- package/build/browser/object/attachment.test.js +1 -0
- package/build/browser/object/attachment.test.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/InterfaceHolder.js +0 -15
- package/build/browser/object/convertWireToOsdkObjects/InterfaceHolder.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/InternalSymbols.js +4 -5
- package/build/browser/object/convertWireToOsdkObjects/InternalSymbols.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/ObjectHolder.js +0 -15
- package/build/browser/object/convertWireToOsdkObjects/ObjectHolder.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.js +4 -1
- package/build/browser/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/PropertyDescriptorRecord.js +0 -15
- package/build/browser/object/convertWireToOsdkObjects/PropertyDescriptorRecord.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.js +42 -85
- package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.test.js +1 -6
- package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.test.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.js +88 -88
- package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/getDollarAs.js +9 -3
- package/build/browser/object/convertWireToOsdkObjects/getDollarAs.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/getDollarLink.js +15 -38
- package/build/browser/object/convertWireToOsdkObjects/getDollarLink.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects.js +51 -4
- package/build/browser/object/convertWireToOsdkObjects.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects.test.js +197 -44
- package/build/browser/object/convertWireToOsdkObjects.test.js.map +1 -1
- package/build/browser/object/fetchPage.js +42 -24
- package/build/browser/object/fetchPage.js.map +1 -1
- package/build/browser/object/fetchPage.test.js +80 -1
- package/build/browser/object/fetchPage.test.js.map +1 -1
- package/build/browser/object/fetchSingle.js +3 -0
- package/build/browser/object/fetchSingle.js.map +1 -1
- package/build/browser/object/geotimeseriesreference.test.js +2 -0
- package/build/browser/object/geotimeseriesreference.test.js.map +1 -1
- package/build/browser/object/media.test.js +55 -0
- package/build/browser/object/media.test.js.map +1 -0
- package/build/browser/object/mediaUpload.js +20 -0
- package/build/browser/object/mediaUpload.js.map +1 -0
- package/build/browser/object/object.test.js +203 -10
- package/build/browser/object/object.test.js.map +1 -1
- package/build/browser/object/timeseries.test.js +11 -0
- package/build/browser/object/timeseries.test.js.map +1 -1
- package/build/browser/objectSet/InterfaceObjectSet.test.js +65 -0
- package/build/browser/objectSet/InterfaceObjectSet.test.js.map +1 -0
- package/build/browser/objectSet/ObjectSet.test.js +140 -28
- package/build/browser/objectSet/ObjectSet.test.js.map +1 -1
- package/build/browser/objectSet/ObjectSetFactory.js +0 -15
- package/build/browser/objectSet/ObjectSetFactory.js.map +1 -1
- package/build/browser/objectSet/ObjectSetListenerWebsocket.js +117 -37
- package/build/browser/objectSet/ObjectSetListenerWebsocket.js.map +1 -1
- package/build/browser/objectSet/ObjectSetListenerWebsocket.test.js +53 -26
- package/build/browser/objectSet/ObjectSetListenerWebsocket.test.js.map +1 -1
- package/build/browser/objectSet/conjureUnionType.js +1 -0
- package/build/browser/objectSet/conjureUnionType.js.map +1 -1
- package/build/browser/objectSet/createObjectSet.js +9 -6
- package/build/browser/objectSet/createObjectSet.js.map +1 -1
- package/build/browser/observable/DebugFlags.js +19 -0
- package/build/browser/observable/DebugFlags.js.map +1 -0
- package/build/browser/observable/ListPayload.js +2 -0
- package/build/browser/observable/ListPayload.js.map +1 -0
- package/build/browser/observable/ObjectPayload.js +2 -0
- package/build/browser/observable/ObjectPayload.js.map +1 -0
- package/build/browser/observable/ObservableClient.js +23 -0
- package/build/browser/observable/ObservableClient.js.map +1 -0
- package/build/browser/observable/OptimisticBuilder.js +2 -0
- package/build/browser/observable/OptimisticBuilder.js.map +1 -0
- package/build/browser/observable/internal/CacheKey.js +2 -0
- package/build/browser/observable/internal/CacheKey.js.map +1 -0
- package/build/browser/observable/internal/CacheKeys.js +60 -0
- package/build/browser/observable/internal/CacheKeys.js.map +1 -0
- package/build/browser/observable/internal/Canonical.js +2 -0
- package/build/browser/observable/internal/Canonical.js.map +1 -0
- package/build/browser/observable/internal/ChangedObjects.js +24 -0
- package/build/browser/observable/internal/ChangedObjects.js.map +1 -0
- package/build/browser/observable/internal/Layer.js +76 -0
- package/build/browser/observable/internal/Layer.js.map +1 -0
- package/build/browser/observable/internal/ListQuery.js +250 -0
- package/build/browser/observable/internal/ListQuery.js.map +1 -0
- package/build/browser/observable/internal/ObjectQuery.js +71 -0
- package/build/browser/observable/internal/ObjectQuery.js.map +1 -0
- package/build/browser/observable/internal/ObservableClientImpl.js +38 -0
- package/build/browser/observable/internal/ObservableClientImpl.js.map +1 -0
- package/build/browser/observable/internal/OptimisticId.js +30 -0
- package/build/browser/observable/internal/OptimisticId.js.map +1 -0
- package/build/browser/observable/internal/OptimisticJob.js +91 -0
- package/build/browser/observable/internal/OptimisticJob.js.map +1 -0
- package/build/browser/observable/internal/Query.js +70 -0
- package/build/browser/observable/internal/Query.js.map +1 -0
- package/build/browser/observable/internal/RefCounts.js +77 -0
- package/build/browser/observable/internal/RefCounts.js.map +1 -0
- package/build/browser/observable/internal/Store.js +464 -0
- package/build/browser/observable/internal/Store.js.map +1 -0
- package/build/browser/observable/internal/Store.test.js +765 -0
- package/build/browser/observable/internal/Store.test.js.map +1 -0
- package/build/browser/observable/internal/WeakMapWithEntries.js +124 -0
- package/build/browser/observable/internal/WeakMapWithEntries.js.map +1 -0
- package/build/browser/observable/internal/WhereClauseCanonicalizer.js +83 -0
- package/build/browser/observable/internal/WhereClauseCanonicalizer.js.map +1 -0
- package/build/browser/observable/internal/WhereClauseCanonicalizer.test.js +131 -0
- package/build/browser/observable/internal/WhereClauseCanonicalizer.test.js.map +1 -0
- package/build/browser/observable/internal/objectMatchesWhereClause.js +112 -0
- package/build/browser/observable/internal/objectMatchesWhereClause.js.map +1 -0
- package/build/browser/observable/internal/objectMatchesWhereClause.test.js +121 -0
- package/build/browser/observable/internal/objectMatchesWhereClause.test.js.map +1 -0
- package/build/browser/observable/internal/testUtils.js +178 -0
- package/build/browser/observable/internal/testUtils.js.map +1 -0
- package/build/browser/observable/types.js +2 -0
- package/build/browser/observable/types.js.map +1 -0
- package/build/browser/ontology/OntologyProvider.js +1 -0
- package/build/browser/ontology/OntologyProvider.js.map +1 -1
- package/build/browser/ontology/StandardOntologyProvider.js +2 -0
- package/build/browser/ontology/StandardOntologyProvider.js.map +1 -1
- package/build/browser/ontology/StandardOntologyProvider.test.js +2 -0
- package/build/browser/ontology/StandardOntologyProvider.test.js.map +1 -1
- package/build/browser/ontology/loadActionMetadata.js +2 -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/ontology/loadQueryMetadata.js +2 -1
- package/build/browser/ontology/loadQueryMetadata.js.map +1 -1
- package/build/browser/ontology/makeConjureContext.js +1 -0
- package/build/browser/ontology/makeConjureContext.js.map +1 -1
- package/build/browser/pageRequestAsAsyncIter.js +1 -0
- package/build/browser/pageRequestAsAsyncIter.js.map +1 -1
- package/build/browser/public/internal.js +20 -0
- package/build/browser/public/internal.js.map +1 -0
- package/build/browser/public/unstable-do-not-use.js +5 -0
- package/build/browser/public/unstable-do-not-use.js.map +1 -1
- package/build/browser/public-utils/createAndFetchTempObjectSetRid.js +34 -0
- package/build/browser/public-utils/createAndFetchTempObjectSetRid.js.map +1 -0
- package/build/browser/public-utils/hydrateAttachmentFromRid.js +45 -0
- package/build/browser/public-utils/hydrateAttachmentFromRid.js.map +1 -0
- package/build/browser/public-utils/hydrateObjectSetFromRid.js +39 -0
- package/build/browser/public-utils/hydrateObjectSetFromRid.js.map +1 -0
- package/build/browser/queries/applyQuery.js +5 -5
- package/build/browser/queries/applyQuery.js.map +1 -1
- package/build/browser/queries/queries.test.js +9 -0
- package/build/browser/queries/queries.test.js.map +1 -1
- package/build/browser/queries/types.js +0 -15
- package/build/browser/queries/types.js.map +1 -1
- package/build/browser/tsserver.js +1 -0
- package/build/browser/tsserver.js.map +1 -1
- package/build/browser/util/ArrayElement.js +0 -15
- package/build/browser/util/ArrayElement.js.map +1 -1
- package/build/browser/util/NOOP.js +0 -15
- package/build/browser/util/NOOP.js.map +1 -1
- package/build/browser/util/NullableProps.js +0 -15
- package/build/browser/util/NullableProps.js.map +1 -1
- package/build/browser/util/UserAgent.js +2 -1
- package/build/browser/util/UserAgent.js.map +1 -1
- package/build/browser/util/WireObjectSet.js +2 -0
- package/build/browser/util/WireObjectSet.js.map +1 -1
- package/build/browser/util/addUserAgentAndRequestContextHeaders.js +1 -0
- package/build/browser/util/addUserAgentAndRequestContextHeaders.js.map +1 -1
- package/build/browser/util/augmentRequestContext.js +1 -0
- package/build/browser/util/augmentRequestContext.js.map +1 -1
- package/build/browser/util/datetimeConverters.js +60 -0
- package/build/browser/util/datetimeConverters.js.map +1 -0
- package/build/browser/util/datetimeConverters.test.js +76 -0
- package/build/browser/util/datetimeConverters.test.js.map +1 -0
- package/build/browser/util/interfaceUtils.js +21 -0
- package/build/browser/util/interfaceUtils.js.map +1 -0
- package/build/browser/util/isOntologyObjectV2.js +1 -0
- package/build/browser/util/isOntologyObjectV2.js.map +1 -1
- package/build/browser/util/isOsdkBaseObject.js +1 -0
- package/build/browser/util/isOsdkBaseObject.js.map +1 -1
- package/build/browser/util/isOsdkObject.js +1 -0
- package/build/browser/util/isOsdkObject.js.map +1 -1
- package/build/browser/util/objectSetUtils.js +26 -0
- package/build/browser/util/objectSetUtils.js.map +1 -0
- package/build/browser/util/partialBy.js +0 -15
- package/build/browser/util/partialBy.js.map +1 -1
- package/build/browser/util/streamutils.js +7 -0
- package/build/browser/util/streamutils.js.map +1 -1
- package/build/browser/util/timeseriesUtils.js +2 -1
- package/build/browser/util/timeseriesUtils.js.map +1 -1
- package/build/browser/util/toDataValue.js +28 -2
- package/build/browser/util/toDataValue.js.map +1 -1
- package/build/browser/util/toDataValue.test.js +14 -1
- package/build/browser/util/toDataValue.test.js.map +1 -1
- package/build/browser/util/toDataValueQueries.js +10 -1
- package/build/browser/util/toDataValueQueries.js.map +1 -1
- package/build/cjs/Client-C8K3E1vH.d.cts +67 -0
- package/build/cjs/chunk-65QQ6SME.cjs +922 -0
- package/build/cjs/chunk-65QQ6SME.cjs.map +1 -0
- package/build/cjs/chunk-FEUFIE6T.cjs +465 -0
- package/build/cjs/chunk-FEUFIE6T.cjs.map +1 -0
- package/build/cjs/chunk-Q7SFCCGT.cjs +11 -0
- package/build/cjs/chunk-Q7SFCCGT.cjs.map +1 -0
- package/build/cjs/graphql-JJX5MZPQ.cjs +10491 -0
- package/build/cjs/graphql-JJX5MZPQ.cjs.map +1 -0
- package/build/cjs/index.cjs +1665 -0
- package/build/cjs/index.cjs.map +1 -0
- package/build/cjs/index.d.cts +85 -0
- package/build/cjs/public/internal.cjs +36 -0
- package/build/cjs/public/internal.cjs.map +1 -0
- package/build/cjs/public/internal.d.cts +33 -0
- package/build/cjs/public/unstable-do-not-use.cjs +1248 -0
- package/build/cjs/public/unstable-do-not-use.cjs.map +1 -0
- package/build/cjs/public/unstable-do-not-use.d.cts +62 -0
- package/build/esm/Client.js +7 -0
- package/build/esm/Client.js.map +1 -1
- package/build/esm/Definitions.test.js +1 -0
- package/build/esm/Definitions.test.js.map +1 -1
- package/build/esm/Logger.js +0 -15
- package/build/esm/Logger.js.map +1 -1
- package/build/esm/MinimalClientContext.js +0 -15
- package/build/esm/MinimalClientContext.js.map +1 -1
- package/build/esm/ResultOrError.js +1 -0
- package/build/esm/ResultOrError.js.map +1 -1
- package/build/esm/SatisfiesSemver.js +0 -15
- package/build/esm/SatisfiesSemver.js.map +1 -1
- package/build/esm/SatisfiesSemver.test.js +1 -0
- package/build/esm/SatisfiesSemver.test.js.map +1 -1
- package/build/esm/__unstable/ConjureSupport.js +8 -2
- package/build/esm/__unstable/ConjureSupport.js.map +1 -1
- package/build/esm/__unstable/createBulkLinksAsyncIterFactory.js +5 -1
- package/build/esm/__unstable/createBulkLinksAsyncIterFactory.js.map +1 -1
- package/build/esm/actions/ActionValidationError.js +1 -1
- package/build/esm/actions/ActionValidationError.js.map +1 -1
- package/build/esm/actions/actions.test.js +85 -4
- package/build/esm/actions/actions.test.js.map +1 -1
- package/build/esm/actions/applyAction.js +2 -1
- package/build/esm/actions/applyAction.js.map +1 -1
- package/build/esm/createClient.js +37 -26
- package/build/esm/createClient.js.map +1 -1
- package/build/esm/createClient.test.js +25 -0
- package/build/esm/createClient.test.js.map +1 -1
- package/build/esm/createGeotimeSeriesProperty.js +5 -3
- package/build/esm/createGeotimeSeriesProperty.js.map +1 -1
- package/build/esm/createMediaReferenceProperty.js +47 -0
- package/build/esm/createMediaReferenceProperty.js.map +1 -0
- package/build/esm/createMinimalClient.js +8 -1
- package/build/esm/createMinimalClient.js.map +1 -1
- package/build/esm/createPlatformClient.js +1 -0
- package/build/esm/createPlatformClient.js.map +1 -1
- package/build/esm/createTimeseriesProperty.js +2 -1
- package/build/esm/createTimeseriesProperty.js.map +1 -1
- package/build/esm/definitions/LinkDefinitions.test.js +4 -0
- package/build/esm/definitions/LinkDefinitions.test.js.map +1 -1
- package/build/esm/fetchMetadata.js +2 -0
- package/build/esm/fetchMetadata.js.map +1 -1
- package/build/esm/fetchMetadata.test.js +19 -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/callsQueryAcceptsObject.js +3 -1
- package/build/esm/intellisense.test.helpers/callsQueryAcceptsObject.js.map +1 -1
- package/build/esm/intellisense.test.js +4 -1
- package/build/esm/intellisense.test.js.map +1 -1
- package/build/esm/internal/conversions/legacyToModernSingleAggregationResult.js +2 -0
- package/build/esm/internal/conversions/legacyToModernSingleAggregationResult.js.map +1 -1
- package/build/esm/internal/conversions/modernToLegacyAggregationClause.js +2 -0
- package/build/esm/internal/conversions/modernToLegacyAggregationClause.js.map +1 -1
- package/build/esm/internal/conversions/modernToLegacyGroupByClause.js +1 -0
- package/build/esm/internal/conversions/modernToLegacyGroupByClause.js.map +1 -1
- package/build/esm/internal/conversions/modernToLegacyWhereClause.js +67 -18
- package/build/esm/internal/conversions/modernToLegacyWhereClause.js.map +1 -1
- package/build/esm/internal/conversions/modernToLegacyWhereClause.test.js +402 -14
- package/build/esm/internal/conversions/modernToLegacyWhereClause.test.js.map +1 -1
- package/build/esm/object/AttachmentUpload.js +6 -13
- package/build/esm/object/AttachmentUpload.js.map +1 -1
- package/build/esm/object/Cache.js +27 -0
- package/build/esm/object/Cache.js.map +1 -1
- package/build/esm/object/Cache.test.js +10 -3
- package/build/esm/object/Cache.test.js.map +1 -1
- package/build/esm/object/SimpleCache.js +20 -0
- package/build/esm/object/SimpleCache.js.map +1 -1
- package/build/esm/object/aggregate.js +7 -9
- package/build/esm/object/aggregate.js.map +1 -1
- package/build/esm/object/aggregate.test.js +11 -9
- package/build/esm/object/aggregate.test.js.map +1 -1
- package/build/esm/object/attachment.test.js +1 -0
- package/build/esm/object/attachment.test.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/InterfaceHolder.js +0 -15
- package/build/esm/object/convertWireToOsdkObjects/InterfaceHolder.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/InternalSymbols.js +4 -5
- package/build/esm/object/convertWireToOsdkObjects/InternalSymbols.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/ObjectHolder.js +0 -15
- package/build/esm/object/convertWireToOsdkObjects/ObjectHolder.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.js +4 -1
- package/build/esm/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/PropertyDescriptorRecord.js +0 -15
- package/build/esm/object/convertWireToOsdkObjects/PropertyDescriptorRecord.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.js +42 -85
- package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.test.js +1 -6
- package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.test.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/createOsdkObject.js +88 -88
- package/build/esm/object/convertWireToOsdkObjects/createOsdkObject.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/getDollarAs.js +9 -3
- package/build/esm/object/convertWireToOsdkObjects/getDollarAs.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/getDollarLink.js +15 -38
- package/build/esm/object/convertWireToOsdkObjects/getDollarLink.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects.js +51 -4
- package/build/esm/object/convertWireToOsdkObjects.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects.test.js +197 -44
- package/build/esm/object/convertWireToOsdkObjects.test.js.map +1 -1
- package/build/esm/object/fetchPage.js +42 -24
- package/build/esm/object/fetchPage.js.map +1 -1
- package/build/esm/object/fetchPage.test.js +80 -1
- package/build/esm/object/fetchPage.test.js.map +1 -1
- package/build/esm/object/fetchSingle.js +3 -0
- package/build/esm/object/fetchSingle.js.map +1 -1
- package/build/esm/object/geotimeseriesreference.test.js +2 -0
- package/build/esm/object/geotimeseriesreference.test.js.map +1 -1
- package/build/esm/object/media.test.js +55 -0
- package/build/esm/object/media.test.js.map +1 -0
- package/build/esm/object/mediaUpload.js +20 -0
- package/build/esm/object/mediaUpload.js.map +1 -0
- package/build/esm/object/object.test.js +203 -10
- package/build/esm/object/object.test.js.map +1 -1
- package/build/esm/object/timeseries.test.js +11 -0
- package/build/esm/object/timeseries.test.js.map +1 -1
- package/build/esm/objectSet/InterfaceObjectSet.test.js +65 -0
- package/build/esm/objectSet/InterfaceObjectSet.test.js.map +1 -0
- package/build/esm/objectSet/ObjectSet.test.js +140 -28
- package/build/esm/objectSet/ObjectSet.test.js.map +1 -1
- package/build/esm/objectSet/ObjectSetFactory.js +0 -15
- package/build/esm/objectSet/ObjectSetFactory.js.map +1 -1
- package/build/esm/objectSet/ObjectSetListenerWebsocket.js +117 -40
- package/build/esm/objectSet/ObjectSetListenerWebsocket.js.map +1 -1
- package/build/esm/objectSet/ObjectSetListenerWebsocket.test.js +53 -26
- package/build/esm/objectSet/ObjectSetListenerWebsocket.test.js.map +1 -1
- package/build/esm/objectSet/conjureUnionType.js +1 -0
- package/build/esm/objectSet/conjureUnionType.js.map +1 -1
- package/build/esm/objectSet/createObjectSet.js +9 -6
- package/build/esm/objectSet/createObjectSet.js.map +1 -1
- package/build/esm/observable/DebugFlags.js +19 -0
- package/build/esm/observable/DebugFlags.js.map +1 -0
- package/build/esm/observable/ListPayload.js +2 -0
- package/build/esm/observable/ListPayload.js.map +1 -0
- package/build/esm/observable/ObjectPayload.js +2 -0
- package/build/esm/observable/ObjectPayload.js.map +1 -0
- package/build/esm/observable/ObservableClient.js +23 -0
- package/build/esm/observable/ObservableClient.js.map +1 -0
- package/build/esm/observable/OptimisticBuilder.js +2 -0
- package/build/esm/observable/OptimisticBuilder.js.map +1 -0
- package/build/esm/observable/internal/CacheKey.js +2 -0
- package/build/esm/observable/internal/CacheKey.js.map +1 -0
- package/build/esm/observable/internal/CacheKeys.js +60 -0
- package/build/esm/observable/internal/CacheKeys.js.map +1 -0
- package/build/esm/observable/internal/Canonical.js +2 -0
- package/build/esm/observable/internal/Canonical.js.map +1 -0
- package/build/esm/observable/internal/ChangedObjects.js +24 -0
- package/build/esm/observable/internal/ChangedObjects.js.map +1 -0
- package/build/esm/observable/internal/Layer.js +76 -0
- package/build/esm/observable/internal/Layer.js.map +1 -0
- package/build/esm/observable/internal/ListQuery.js +250 -0
- package/build/esm/observable/internal/ListQuery.js.map +1 -0
- package/build/esm/observable/internal/ObjectQuery.js +71 -0
- package/build/esm/observable/internal/ObjectQuery.js.map +1 -0
- package/build/esm/observable/internal/ObservableClientImpl.js +38 -0
- package/build/esm/observable/internal/ObservableClientImpl.js.map +1 -0
- package/build/esm/observable/internal/OptimisticId.js +30 -0
- package/build/esm/observable/internal/OptimisticId.js.map +1 -0
- package/build/esm/observable/internal/OptimisticJob.js +91 -0
- package/build/esm/observable/internal/OptimisticJob.js.map +1 -0
- package/build/esm/observable/internal/Query.js +70 -0
- package/build/esm/observable/internal/Query.js.map +1 -0
- package/build/esm/observable/internal/RefCounts.js +77 -0
- package/build/esm/observable/internal/RefCounts.js.map +1 -0
- package/build/esm/observable/internal/Store.js +464 -0
- package/build/esm/observable/internal/Store.js.map +1 -0
- package/build/esm/observable/internal/Store.test.js +765 -0
- package/build/esm/observable/internal/Store.test.js.map +1 -0
- package/build/esm/observable/internal/WeakMapWithEntries.js +124 -0
- package/build/esm/observable/internal/WeakMapWithEntries.js.map +1 -0
- package/build/esm/observable/internal/WhereClauseCanonicalizer.js +83 -0
- package/build/esm/observable/internal/WhereClauseCanonicalizer.js.map +1 -0
- package/build/esm/observable/internal/WhereClauseCanonicalizer.test.js +131 -0
- package/build/esm/observable/internal/WhereClauseCanonicalizer.test.js.map +1 -0
- package/build/esm/observable/internal/objectMatchesWhereClause.js +112 -0
- package/build/esm/observable/internal/objectMatchesWhereClause.js.map +1 -0
- package/build/esm/observable/internal/objectMatchesWhereClause.test.js +121 -0
- package/build/esm/observable/internal/objectMatchesWhereClause.test.js.map +1 -0
- package/build/esm/observable/internal/testUtils.js +178 -0
- package/build/esm/observable/internal/testUtils.js.map +1 -0
- package/build/esm/observable/types.js +2 -0
- package/build/esm/observable/types.js.map +1 -0
- package/build/esm/ontology/OntologyProvider.js +1 -0
- package/build/esm/ontology/OntologyProvider.js.map +1 -1
- package/build/esm/ontology/StandardOntologyProvider.js +2 -0
- package/build/esm/ontology/StandardOntologyProvider.js.map +1 -1
- package/build/esm/ontology/StandardOntologyProvider.test.js +2 -0
- package/build/esm/ontology/StandardOntologyProvider.test.js.map +1 -1
- package/build/esm/ontology/loadActionMetadata.js +2 -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/ontology/loadQueryMetadata.js +2 -1
- package/build/esm/ontology/loadQueryMetadata.js.map +1 -1
- package/build/esm/ontology/makeConjureContext.js +1 -0
- package/build/esm/ontology/makeConjureContext.js.map +1 -1
- package/build/esm/pageRequestAsAsyncIter.js +1 -0
- package/build/esm/pageRequestAsAsyncIter.js.map +1 -1
- package/build/esm/public/internal.js +20 -0
- package/build/esm/public/internal.js.map +1 -0
- package/build/esm/public/unstable-do-not-use.js +5 -0
- package/build/esm/public/unstable-do-not-use.js.map +1 -1
- package/build/esm/public-utils/createAndFetchTempObjectSetRid.js +34 -0
- package/build/esm/public-utils/createAndFetchTempObjectSetRid.js.map +1 -0
- package/build/esm/public-utils/hydrateAttachmentFromRid.js +45 -0
- package/build/esm/public-utils/hydrateAttachmentFromRid.js.map +1 -0
- package/build/esm/public-utils/hydrateObjectSetFromRid.js +39 -0
- package/build/esm/public-utils/hydrateObjectSetFromRid.js.map +1 -0
- package/build/esm/queries/applyQuery.js +5 -5
- package/build/esm/queries/applyQuery.js.map +1 -1
- package/build/esm/queries/queries.test.js +9 -0
- package/build/esm/queries/queries.test.js.map +1 -1
- package/build/esm/queries/types.js +0 -15
- package/build/esm/queries/types.js.map +1 -1
- package/build/esm/tsserver.js +1 -0
- package/build/esm/tsserver.js.map +1 -1
- package/build/esm/util/ArrayElement.js +0 -15
- package/build/esm/util/ArrayElement.js.map +1 -1
- package/build/esm/util/NOOP.js +0 -15
- package/build/esm/util/NOOP.js.map +1 -1
- package/build/esm/util/NullableProps.js +0 -15
- package/build/esm/util/NullableProps.js.map +1 -1
- package/build/esm/util/UserAgent.js +2 -1
- package/build/esm/util/UserAgent.js.map +1 -1
- package/build/esm/util/WireObjectSet.js +2 -0
- package/build/esm/util/WireObjectSet.js.map +1 -1
- package/build/esm/util/addUserAgentAndRequestContextHeaders.js +1 -0
- package/build/esm/util/addUserAgentAndRequestContextHeaders.js.map +1 -1
- package/build/esm/util/augmentRequestContext.js +1 -0
- package/build/esm/util/augmentRequestContext.js.map +1 -1
- package/build/esm/util/datetimeConverters.js +60 -0
- package/build/esm/util/datetimeConverters.js.map +1 -0
- package/build/esm/util/datetimeConverters.test.js +76 -0
- package/build/esm/util/datetimeConverters.test.js.map +1 -0
- package/build/esm/util/interfaceUtils.js +21 -0
- package/build/esm/util/interfaceUtils.js.map +1 -0
- package/build/esm/util/isOntologyObjectV2.js +1 -0
- package/build/esm/util/isOntologyObjectV2.js.map +1 -1
- package/build/esm/util/isOsdkBaseObject.js +1 -0
- package/build/esm/util/isOsdkBaseObject.js.map +1 -1
- package/build/esm/util/isOsdkObject.js +1 -0
- package/build/esm/util/isOsdkObject.js.map +1 -1
- package/build/esm/util/objectSetUtils.js +26 -0
- package/build/esm/util/objectSetUtils.js.map +1 -0
- package/build/esm/util/partialBy.js +0 -15
- package/build/esm/util/partialBy.js.map +1 -1
- package/build/esm/util/streamutils.js +7 -0
- package/build/esm/util/streamutils.js.map +1 -1
- package/build/esm/util/timeseriesUtils.js +2 -1
- package/build/esm/util/timeseriesUtils.js.map +1 -1
- package/build/esm/util/toDataValue.js +28 -2
- package/build/esm/util/toDataValue.js.map +1 -1
- package/build/esm/util/toDataValue.test.js +14 -1
- package/build/esm/util/toDataValue.test.js.map +1 -1
- package/build/esm/util/toDataValueQueries.js +10 -1
- package/build/esm/util/toDataValueQueries.js.map +1 -1
- package/build/types/Client.d.ts +22 -0
- package/build/types/Client.d.ts.map +1 -0
- package/build/types/Definitions.test.d.ts +1 -0
- package/build/types/Definitions.test.d.ts.map +1 -0
- package/build/types/Logger.d.ts +18 -0
- package/build/types/Logger.d.ts.map +1 -0
- package/build/types/MinimalClientContext.d.ts +25 -0
- package/build/types/MinimalClientContext.d.ts.map +1 -0
- package/build/types/ResultOrError.d.ts +11 -0
- package/build/types/ResultOrError.d.ts.map +1 -0
- package/build/types/SatisfiesSemver.d.ts +10 -0
- package/build/types/SatisfiesSemver.d.ts.map +1 -0
- package/build/types/SatisfiesSemver.test.d.ts +1 -0
- package/build/types/SatisfiesSemver.test.d.ts.map +1 -0
- package/build/types/__unstable/ConjureSupport.d.ts +37 -0
- package/build/types/__unstable/ConjureSupport.d.ts.map +1 -0
- package/build/types/__unstable/createBulkLinksAsyncIterFactory.d.ts +4 -0
- package/build/types/__unstable/createBulkLinksAsyncIterFactory.d.ts.map +1 -0
- package/build/types/actions/ActionValidationError.d.ts +5 -0
- package/build/types/actions/ActionValidationError.d.ts.map +1 -0
- package/build/types/actions/actions.test.d.ts +1 -0
- package/build/types/actions/actions.test.d.ts.map +1 -0
- package/build/types/actions/applyAction.d.ts +31 -0
- package/build/types/actions/applyAction.d.ts.map +1 -0
- package/build/types/createClient.d.ts +5 -0
- package/build/types/createClient.d.ts.map +1 -0
- package/build/types/createClient.test.d.ts +1 -0
- package/build/types/createClient.test.d.ts.map +1 -0
- package/build/types/createGeotimeSeriesProperty.d.ts +13 -0
- package/build/types/createGeotimeSeriesProperty.d.ts.map +1 -0
- package/build/types/createMediaReferenceProperty.d.ts +13 -0
- package/build/types/createMediaReferenceProperty.d.ts.map +1 -0
- package/build/types/createMinimalClient.d.ts +1 -0
- package/build/types/createMinimalClient.d.ts.map +1 -0
- package/build/types/createPlatformClient.d.ts +15 -0
- package/build/types/createPlatformClient.d.ts.map +1 -0
- package/build/types/createTimeseriesProperty.d.ts +13 -0
- package/build/types/createTimeseriesProperty.d.ts.map +1 -0
- package/build/types/definitions/LinkDefinitions.test.d.ts +1 -0
- package/build/types/definitions/LinkDefinitions.test.d.ts.map +1 -0
- package/build/types/fetchMetadata.d.ts +1 -0
- package/build/types/fetchMetadata.d.ts.map +1 -0
- package/build/types/fetchMetadata.test.d.ts +1 -0
- package/build/types/fetchMetadata.test.d.ts.map +1 -0
- package/build/types/index.d.ts +12 -0
- package/build/types/index.d.ts.map +1 -0
- package/build/types/intellisense.test.d.ts +1 -0
- package/build/types/intellisense.test.d.ts.map +1 -0
- package/build/types/intellisense.test.helpers/callsQueryAcceptsObject.d.ts +1 -0
- package/build/types/intellisense.test.helpers/callsQueryAcceptsObject.d.ts.map +1 -0
- package/build/types/internal/conversions/legacyToModernSingleAggregationResult.d.ts +1 -0
- package/build/types/internal/conversions/legacyToModernSingleAggregationResult.d.ts.map +1 -0
- package/build/types/internal/conversions/modernToLegacyAggregationClause.d.ts +1 -0
- package/build/types/internal/conversions/modernToLegacyAggregationClause.d.ts.map +1 -0
- package/build/types/internal/conversions/modernToLegacyGroupByClause.d.ts +1 -0
- package/build/types/internal/conversions/modernToLegacyGroupByClause.d.ts.map +1 -0
- package/build/types/internal/conversions/modernToLegacyWhereClause.d.ts +1 -0
- package/build/types/internal/conversions/modernToLegacyWhereClause.d.ts.map +1 -0
- package/build/types/internal/conversions/modernToLegacyWhereClause.test.d.ts +1 -0
- package/build/types/internal/conversions/modernToLegacyWhereClause.test.d.ts.map +1 -0
- package/build/types/object/AttachmentUpload.d.ts +3 -0
- package/build/types/object/AttachmentUpload.d.ts.map +1 -0
- package/build/types/object/Cache.d.ts +17 -0
- package/build/types/object/Cache.d.ts.map +1 -0
- package/build/types/object/Cache.test.d.ts +1 -0
- package/build/types/object/Cache.test.d.ts.map +1 -0
- package/build/types/object/SimpleCache.d.ts +52 -0
- package/build/types/object/SimpleCache.d.ts.map +1 -0
- package/build/types/object/aggregate.d.ts +1 -0
- package/build/types/object/aggregate.d.ts.map +1 -0
- package/build/types/object/aggregate.test.d.ts +1 -0
- package/build/types/object/aggregate.test.d.ts.map +1 -0
- package/build/types/object/attachment.test.d.ts +1 -0
- package/build/types/object/attachment.test.d.ts.map +1 -0
- package/build/types/object/convertWireToOsdkObjects/InterfaceHolder.d.ts +1 -0
- package/build/types/object/convertWireToOsdkObjects/InterfaceHolder.d.ts.map +1 -0
- package/build/types/object/convertWireToOsdkObjects/InternalSymbols.d.ts +6 -0
- package/build/types/object/convertWireToOsdkObjects/InternalSymbols.d.ts.map +1 -0
- package/build/types/object/convertWireToOsdkObjects/ObjectHolder.d.ts +1 -0
- package/build/types/object/convertWireToOsdkObjects/ObjectHolder.d.ts.map +1 -0
- package/build/types/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.d.ts +17 -0
- package/build/types/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.d.ts.map +1 -0
- package/build/types/object/convertWireToOsdkObjects/PropertyDescriptorRecord.d.ts +5 -0
- package/build/types/object/convertWireToOsdkObjects/PropertyDescriptorRecord.d.ts.map +1 -0
- package/build/types/object/convertWireToOsdkObjects/createOsdkInterface.d.ts +1 -0
- package/build/types/object/convertWireToOsdkObjects/createOsdkInterface.d.ts.map +1 -0
- package/build/types/object/convertWireToOsdkObjects/createOsdkInterface.test.d.ts +1 -0
- package/build/types/object/convertWireToOsdkObjects/createOsdkInterface.test.d.ts.map +1 -0
- package/build/types/object/convertWireToOsdkObjects/createOsdkObject.d.ts +1 -0
- package/build/types/object/convertWireToOsdkObjects/createOsdkObject.d.ts.map +1 -0
- package/build/types/object/convertWireToOsdkObjects/getDollarAs.d.ts +2 -0
- package/build/types/object/convertWireToOsdkObjects/getDollarAs.d.ts.map +1 -0
- package/build/types/object/convertWireToOsdkObjects/getDollarLink.d.ts +1 -0
- package/build/types/object/convertWireToOsdkObjects/getDollarLink.d.ts.map +1 -0
- package/build/types/object/convertWireToOsdkObjects.d.ts +1 -0
- package/build/types/object/convertWireToOsdkObjects.d.ts.map +1 -0
- package/build/types/object/convertWireToOsdkObjects.test.d.ts +1 -0
- package/build/types/object/convertWireToOsdkObjects.test.d.ts.map +1 -0
- package/build/types/object/fetchPage.d.ts +5 -0
- package/build/types/object/fetchPage.d.ts.map +1 -0
- package/build/types/object/fetchPage.test.d.ts +1 -0
- package/build/types/object/fetchPage.test.d.ts.map +1 -0
- package/build/types/object/fetchSingle.d.ts +1 -0
- package/build/types/object/fetchSingle.d.ts.map +1 -0
- package/build/types/object/geotimeseriesreference.test.d.ts +1 -0
- package/build/types/object/geotimeseriesreference.test.d.ts.map +1 -0
- package/build/types/object/media.test.d.ts +1 -0
- package/build/types/object/media.test.d.ts.map +1 -0
- package/build/types/object/mediaUpload.d.ts +2 -0
- package/build/types/object/mediaUpload.d.ts.map +1 -0
- package/build/types/object/object.test.d.ts +11 -0
- package/build/types/object/object.test.d.ts.map +1 -0
- package/build/types/object/timeseries.test.d.ts +1 -0
- package/build/types/object/timeseries.test.d.ts.map +1 -0
- package/build/types/objectSet/InterfaceObjectSet.test.d.ts +1 -0
- package/build/types/objectSet/InterfaceObjectSet.test.d.ts.map +1 -0
- package/build/types/objectSet/ObjectSet.test.d.ts +7 -0
- package/build/types/objectSet/ObjectSet.test.d.ts.map +1 -0
- package/build/types/objectSet/ObjectSetFactory.d.ts +1 -0
- package/build/types/objectSet/ObjectSetFactory.d.ts.map +1 -0
- package/build/types/objectSet/ObjectSetListenerWebsocket.d.ts +1 -0
- package/build/types/objectSet/ObjectSetListenerWebsocket.d.ts.map +1 -0
- package/build/types/objectSet/ObjectSetListenerWebsocket.test.d.ts +1 -0
- package/build/types/objectSet/ObjectSetListenerWebsocket.test.d.ts.map +1 -0
- package/build/types/objectSet/conjureUnionType.d.ts +13 -0
- package/build/types/objectSet/conjureUnionType.d.ts.map +1 -0
- package/build/types/objectSet/createObjectSet.d.ts +1 -0
- package/build/types/objectSet/createObjectSet.d.ts.map +1 -0
- package/build/types/observable/DebugFlags.d.ts +2 -0
- package/build/types/observable/DebugFlags.d.ts.map +1 -0
- package/build/types/observable/ListPayload.d.ts +10 -0
- package/build/types/observable/ListPayload.d.ts.map +1 -0
- package/build/types/observable/ObjectPayload.d.ts +8 -0
- package/build/types/observable/ObjectPayload.d.ts.map +1 -0
- package/build/types/observable/ObservableClient.d.ts +36 -0
- package/build/types/observable/ObservableClient.d.ts.map +1 -0
- package/build/types/observable/OptimisticBuilder.d.ts +5 -0
- package/build/types/observable/OptimisticBuilder.d.ts.map +1 -0
- package/build/types/observable/internal/CacheKey.d.ts +15 -0
- package/build/types/observable/internal/CacheKey.d.ts.map +1 -0
- package/build/types/observable/internal/CacheKeys.d.ts +8 -0
- package/build/types/observable/internal/CacheKeys.d.ts.map +1 -0
- package/build/types/observable/internal/Canonical.d.ts +3 -0
- package/build/types/observable/internal/Canonical.d.ts.map +1 -0
- package/build/types/observable/internal/ChangedObjects.d.ts +7 -0
- package/build/types/observable/internal/ChangedObjects.d.ts.map +1 -0
- package/build/types/observable/internal/Layer.d.ts +19 -0
- package/build/types/observable/internal/Layer.d.ts.map +1 -0
- package/build/types/observable/internal/ListQuery.d.ts +42 -0
- package/build/types/observable/internal/ListQuery.d.ts.map +1 -0
- package/build/types/observable/internal/ObjectQuery.d.ts +19 -0
- package/build/types/observable/internal/ObjectQuery.d.ts.map +1 -0
- package/build/types/observable/internal/ObservableClientImpl.d.ts +1 -0
- package/build/types/observable/internal/ObservableClientImpl.d.ts.map +1 -0
- package/build/types/observable/internal/OptimisticId.d.ts +4 -0
- package/build/types/observable/internal/OptimisticId.d.ts.map +1 -0
- package/build/types/observable/internal/OptimisticJob.d.ts +11 -0
- package/build/types/observable/internal/OptimisticJob.d.ts.map +1 -0
- package/build/types/observable/internal/Query.d.ts +29 -0
- package/build/types/observable/internal/Query.d.ts.map +1 -0
- package/build/types/observable/internal/RefCounts.d.ts +12 -0
- package/build/types/observable/internal/RefCounts.d.ts.map +1 -0
- package/build/types/observable/internal/Store.d.ts +73 -0
- package/build/types/observable/internal/Store.d.ts.map +1 -0
- package/build/types/observable/internal/Store.test.d.ts +1 -0
- package/build/types/observable/internal/Store.test.d.ts.map +1 -0
- package/build/types/observable/internal/WeakMapWithEntries.d.ts +50 -0
- package/build/types/observable/internal/WeakMapWithEntries.d.ts.map +1 -0
- package/build/types/observable/internal/WhereClauseCanonicalizer.d.ts +6 -0
- package/build/types/observable/internal/WhereClauseCanonicalizer.d.ts.map +1 -0
- package/build/types/observable/internal/WhereClauseCanonicalizer.test.d.ts +1 -0
- package/build/types/observable/internal/WhereClauseCanonicalizer.test.d.ts.map +1 -0
- package/build/types/observable/internal/objectMatchesWhereClause.d.ts +2 -0
- package/build/types/observable/internal/objectMatchesWhereClause.d.ts.map +1 -0
- package/build/types/observable/internal/objectMatchesWhereClause.test.d.ts +1 -0
- package/build/types/observable/internal/objectMatchesWhereClause.test.d.ts.map +1 -0
- package/build/types/observable/internal/testUtils.d.ts +40 -0
- package/build/types/observable/internal/testUtils.d.ts.map +1 -0
- package/build/types/observable/types.d.ts +1 -0
- package/build/types/observable/types.d.ts.map +1 -0
- package/build/types/ontology/OntologyProvider.d.ts +31 -0
- package/build/types/ontology/OntologyProvider.d.ts.map +1 -0
- package/build/types/ontology/StandardOntologyProvider.d.ts +3 -0
- package/build/types/ontology/StandardOntologyProvider.d.ts.map +1 -0
- package/build/types/ontology/StandardOntologyProvider.test.d.ts +1 -0
- package/build/types/ontology/StandardOntologyProvider.test.d.ts.map +1 -0
- package/build/types/ontology/loadActionMetadata.d.ts +3 -0
- package/build/types/ontology/loadActionMetadata.d.ts.map +1 -0
- package/build/types/ontology/loadFullObjectMetadata.d.ts +5 -0
- package/build/types/ontology/loadFullObjectMetadata.d.ts.map +1 -0
- package/build/types/ontology/loadInterfaceMetadata.d.ts +3 -0
- package/build/types/ontology/loadInterfaceMetadata.d.ts.map +1 -0
- package/build/types/ontology/loadQueryMetadata.d.ts +3 -0
- package/build/types/ontology/loadQueryMetadata.d.ts.map +1 -0
- package/build/types/ontology/makeConjureContext.d.ts +3 -0
- package/build/types/ontology/makeConjureContext.d.ts.map +1 -0
- package/build/types/pageRequestAsAsyncIter.d.ts +16 -0
- package/build/types/pageRequestAsAsyncIter.d.ts.map +1 -0
- package/build/types/public/internal.d.ts +3 -0
- package/build/types/public/internal.d.ts.map +1 -0
- package/build/types/public/unstable-do-not-use.d.ts +7 -0
- package/build/types/public/unstable-do-not-use.d.ts.map +1 -0
- package/build/types/public-utils/createAndFetchTempObjectSetRid.d.ts +10 -0
- package/build/types/public-utils/createAndFetchTempObjectSetRid.d.ts.map +1 -0
- package/build/types/public-utils/hydrateAttachmentFromRid.d.ts +9 -0
- package/build/types/public-utils/hydrateAttachmentFromRid.d.ts.map +1 -0
- package/build/types/public-utils/hydrateObjectSetFromRid.d.ts +10 -0
- package/build/types/public-utils/hydrateObjectSetFromRid.d.ts.map +1 -0
- package/build/types/queries/applyQuery.d.ts +8 -0
- package/build/types/queries/applyQuery.d.ts.map +1 -0
- package/build/types/queries/queries.test.d.ts +1 -0
- package/build/types/queries/queries.test.d.ts.map +1 -0
- package/build/types/queries/types.d.ts +15 -0
- package/build/types/queries/types.d.ts.map +1 -0
- package/build/types/tsserver.d.ts +34 -0
- package/build/types/tsserver.d.ts.map +1 -0
- package/build/types/util/ArrayElement.d.ts +1 -0
- package/build/types/util/ArrayElement.d.ts.map +1 -0
- package/build/types/util/NOOP.d.ts +1 -0
- package/build/types/util/NOOP.d.ts.map +1 -0
- package/build/types/util/NullableProps.d.ts +3 -0
- package/build/types/util/NullableProps.d.ts.map +1 -0
- package/build/types/util/UserAgent.d.ts +1 -0
- package/build/types/util/UserAgent.d.ts.map +1 -0
- package/build/types/util/WireObjectSet.d.ts +1 -0
- package/build/types/util/WireObjectSet.d.ts.map +1 -0
- package/build/types/util/addUserAgentAndRequestContextHeaders.d.ts +3 -0
- package/build/types/util/addUserAgentAndRequestContextHeaders.d.ts.map +1 -0
- package/build/types/util/augmentRequestContext.d.ts +31 -0
- package/build/types/util/augmentRequestContext.d.ts.map +1 -0
- package/build/types/util/datetimeConverters.d.ts +21 -0
- package/build/types/util/datetimeConverters.d.ts.map +1 -0
- package/build/types/util/datetimeConverters.test.d.ts +1 -0
- package/build/types/util/datetimeConverters.test.d.ts.map +1 -0
- package/build/types/util/interfaceUtils.d.ts +1 -0
- package/build/types/util/interfaceUtils.d.ts.map +1 -0
- package/build/types/util/isOntologyObjectV2.d.ts +1 -0
- package/build/types/util/isOntologyObjectV2.d.ts.map +1 -0
- package/build/types/util/isOsdkBaseObject.d.ts +2 -0
- package/build/types/util/isOsdkBaseObject.d.ts.map +1 -0
- package/build/types/util/isOsdkObject.d.ts +2 -0
- package/build/types/util/isOsdkObject.d.ts.map +1 -0
- package/build/types/util/objectSetUtils.d.ts +3 -0
- package/build/types/util/objectSetUtils.d.ts.map +1 -0
- package/build/types/util/partialBy.d.ts +8 -0
- package/build/types/util/partialBy.d.ts.map +1 -0
- package/build/types/util/streamutils.d.ts +2 -0
- package/build/types/util/streamutils.d.ts.map +1 -0
- package/build/types/util/timeseriesUtils.d.ts +7 -0
- package/build/types/util/timeseriesUtils.d.ts.map +1 -0
- package/build/types/util/toDataValue.d.ts +1 -0
- package/build/types/util/toDataValue.d.ts.map +1 -0
- package/build/types/util/toDataValue.test.d.ts +1 -0
- package/build/types/util/toDataValue.test.d.ts.map +1 -0
- package/build/types/util/toDataValueQueries.d.ts +1 -0
- package/build/types/util/toDataValueQueries.d.ts.map +1 -0
- package/index.d.ts +17 -0
- package/internal.d.ts +17 -0
- package/package.json +57 -23
- package/unstable-do-not-use.d.ts +1 -1
- package/build/browser/Client.d.ts +0 -26
- package/build/browser/Client.d.ts.map +0 -1
- package/build/browser/Definitions.test.d.ts +0 -2
- package/build/browser/Definitions.test.d.ts.map +0 -1
- package/build/browser/Logger.d.ts +0 -19
- package/build/browser/Logger.d.ts.map +0 -1
- package/build/browser/MinimalClientContext.d.ts +0 -26
- package/build/browser/MinimalClientContext.d.ts.map +0 -1
- package/build/browser/ResultOrError.d.ts +0 -12
- package/build/browser/ResultOrError.d.ts.map +0 -1
- package/build/browser/SatisfiesSemver.d.ts +0 -4
- package/build/browser/SatisfiesSemver.d.ts.map +0 -1
- package/build/browser/SatisfiesSemver.test.d.ts +0 -2
- package/build/browser/SatisfiesSemver.test.d.ts.map +0 -1
- package/build/browser/__unstable/ConjureSupport.d.ts +0 -55
- package/build/browser/__unstable/ConjureSupport.d.ts.map +0 -1
- package/build/browser/__unstable/createBulkLinksAsyncIterFactory.d.ts +0 -5
- package/build/browser/__unstable/createBulkLinksAsyncIterFactory.d.ts.map +0 -1
- package/build/browser/actions/ActionValidationError.d.ts +0 -6
- package/build/browser/actions/ActionValidationError.d.ts.map +0 -1
- package/build/browser/actions/actions.test.d.ts +0 -2
- package/build/browser/actions/actions.test.d.ts.map +0 -1
- package/build/browser/actions/applyAction.d.ts +0 -30
- package/build/browser/actions/applyAction.d.ts.map +0 -1
- package/build/browser/createAttachmentFromRid.d.ts +0 -10
- package/build/browser/createAttachmentFromRid.d.ts.map +0 -1
- package/build/browser/createAttachmentFromRid.js +0 -38
- package/build/browser/createAttachmentFromRid.js.map +0 -1
- package/build/browser/createClient.d.ts +0 -6
- package/build/browser/createClient.d.ts.map +0 -1
- package/build/browser/createClient.test.d.ts +0 -2
- package/build/browser/createClient.test.d.ts.map +0 -1
- package/build/browser/createGeotimeSeriesProperty.d.ts +0 -14
- package/build/browser/createGeotimeSeriesProperty.d.ts.map +0 -1
- package/build/browser/createMinimalClient.d.ts +0 -2
- package/build/browser/createMinimalClient.d.ts.map +0 -1
- package/build/browser/createPlatformClient.d.ts +0 -17
- package/build/browser/createPlatformClient.d.ts.map +0 -1
- package/build/browser/createTimeseriesProperty.d.ts +0 -14
- package/build/browser/createTimeseriesProperty.d.ts.map +0 -1
- package/build/browser/definitions/LinkDefinitions.test.d.ts +0 -2
- package/build/browser/definitions/LinkDefinitions.test.d.ts.map +0 -1
- package/build/browser/fetchMetadata.d.ts +0 -2
- package/build/browser/fetchMetadata.d.ts.map +0 -1
- package/build/browser/fetchMetadata.test.d.ts +0 -2
- package/build/browser/fetchMetadata.test.d.ts.map +0 -1
- package/build/browser/index.d.ts +0 -12
- package/build/browser/index.d.ts.map +0 -1
- package/build/browser/intellisense.test.d.ts +0 -2
- package/build/browser/intellisense.test.d.ts.map +0 -1
- package/build/browser/intellisense.test.helpers/callsQueryAcceptsObject.d.ts +0 -2
- package/build/browser/intellisense.test.helpers/callsQueryAcceptsObject.d.ts.map +0 -1
- package/build/browser/internal/conversions/legacyToModernSingleAggregationResult.d.ts +0 -2
- package/build/browser/internal/conversions/legacyToModernSingleAggregationResult.d.ts.map +0 -1
- package/build/browser/internal/conversions/modernToLegacyAggregationClause.d.ts +0 -2
- package/build/browser/internal/conversions/modernToLegacyAggregationClause.d.ts.map +0 -1
- package/build/browser/internal/conversions/modernToLegacyGroupByClause.d.ts +0 -2
- package/build/browser/internal/conversions/modernToLegacyGroupByClause.d.ts.map +0 -1
- package/build/browser/internal/conversions/modernToLegacyWhereClause.d.ts +0 -2
- package/build/browser/internal/conversions/modernToLegacyWhereClause.d.ts.map +0 -1
- package/build/browser/internal/conversions/modernToLegacyWhereClause.test.d.ts +0 -2
- package/build/browser/internal/conversions/modernToLegacyWhereClause.test.d.ts.map +0 -1
- package/build/browser/object/AttachmentUpload.d.ts +0 -4
- package/build/browser/object/AttachmentUpload.d.ts.map +0 -1
- package/build/browser/object/Cache.d.ts +0 -2
- package/build/browser/object/Cache.d.ts.map +0 -1
- package/build/browser/object/Cache.test.d.ts +0 -11
- package/build/browser/object/Cache.test.d.ts.map +0 -1
- package/build/browser/object/SimpleCache.d.ts +0 -38
- package/build/browser/object/SimpleCache.d.ts.map +0 -1
- package/build/browser/object/aggregate.d.ts +0 -2
- package/build/browser/object/aggregate.d.ts.map +0 -1
- package/build/browser/object/aggregate.test.d.ts +0 -2
- package/build/browser/object/aggregate.test.d.ts.map +0 -1
- package/build/browser/object/attachment.test.d.ts +0 -2
- package/build/browser/object/attachment.test.d.ts.map +0 -1
- package/build/browser/object/convertWireToOsdkObjects/InterfaceHolder.d.ts +0 -2
- package/build/browser/object/convertWireToOsdkObjects/InterfaceHolder.d.ts.map +0 -1
- package/build/browser/object/convertWireToOsdkObjects/InternalSymbols.d.ts +0 -7
- package/build/browser/object/convertWireToOsdkObjects/InternalSymbols.d.ts.map +0 -1
- package/build/browser/object/convertWireToOsdkObjects/ObjectHolder.d.ts +0 -2
- package/build/browser/object/convertWireToOsdkObjects/ObjectHolder.d.ts.map +0 -1
- package/build/browser/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.d.ts +0 -2
- package/build/browser/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.d.ts.map +0 -1
- package/build/browser/object/convertWireToOsdkObjects/PropertyDescriptorRecord.d.ts +0 -8
- package/build/browser/object/convertWireToOsdkObjects/PropertyDescriptorRecord.d.ts.map +0 -1
- package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.d.ts +0 -2
- package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.d.ts.map +0 -1
- package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.test.d.ts +0 -2
- package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.test.d.ts.map +0 -1
- package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.d.ts +0 -2
- package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.d.ts.map +0 -1
- package/build/browser/object/convertWireToOsdkObjects/getDollarAs.d.ts +0 -3
- package/build/browser/object/convertWireToOsdkObjects/getDollarAs.d.ts.map +0 -1
- package/build/browser/object/convertWireToOsdkObjects/getDollarLink.d.ts +0 -2
- package/build/browser/object/convertWireToOsdkObjects/getDollarLink.d.ts.map +0 -1
- package/build/browser/object/convertWireToOsdkObjects.d.ts +0 -2
- package/build/browser/object/convertWireToOsdkObjects.d.ts.map +0 -1
- package/build/browser/object/convertWireToOsdkObjects.test.d.ts +0 -2
- package/build/browser/object/convertWireToOsdkObjects.test.d.ts.map +0 -1
- package/build/browser/object/fetchPage.d.ts +0 -3
- package/build/browser/object/fetchPage.d.ts.map +0 -1
- package/build/browser/object/fetchPage.test.d.ts +0 -2
- package/build/browser/object/fetchPage.test.d.ts.map +0 -1
- package/build/browser/object/fetchSingle.d.ts +0 -2
- package/build/browser/object/fetchSingle.d.ts.map +0 -1
- package/build/browser/object/geotimeseriesreference.test.d.ts +0 -2
- package/build/browser/object/geotimeseriesreference.test.d.ts.map +0 -1
- package/build/browser/object/object.test.d.ts +0 -12
- package/build/browser/object/object.test.d.ts.map +0 -1
- package/build/browser/object/timeseries.test.d.ts +0 -2
- package/build/browser/object/timeseries.test.d.ts.map +0 -1
- package/build/browser/objectSet/ObjectSet.test.d.ts +0 -2
- package/build/browser/objectSet/ObjectSet.test.d.ts.map +0 -1
- package/build/browser/objectSet/ObjectSetFactory.d.ts +0 -2
- package/build/browser/objectSet/ObjectSetFactory.d.ts.map +0 -1
- package/build/browser/objectSet/ObjectSetListenerWebsocket.d.ts +0 -2
- package/build/browser/objectSet/ObjectSetListenerWebsocket.d.ts.map +0 -1
- package/build/browser/objectSet/ObjectSetListenerWebsocket.test.d.ts +0 -2
- package/build/browser/objectSet/ObjectSetListenerWebsocket.test.d.ts.map +0 -1
- package/build/browser/objectSet/conjureUnionType.d.ts +0 -13
- package/build/browser/objectSet/conjureUnionType.d.ts.map +0 -1
- package/build/browser/objectSet/createObjectSet.d.ts +0 -2
- package/build/browser/objectSet/createObjectSet.d.ts.map +0 -1
- package/build/browser/objectSet/toConjureObjectSet.d.ts +0 -2
- package/build/browser/objectSet/toConjureObjectSet.d.ts.map +0 -1
- package/build/browser/objectSet/toConjureObjectSet.js +0 -165
- package/build/browser/objectSet/toConjureObjectSet.js.map +0 -1
- package/build/browser/ontology/OntologyProvider.d.ts +0 -32
- package/build/browser/ontology/OntologyProvider.d.ts.map +0 -1
- package/build/browser/ontology/StandardOntologyProvider.d.ts +0 -5
- package/build/browser/ontology/StandardOntologyProvider.d.ts.map +0 -1
- package/build/browser/ontology/StandardOntologyProvider.test.d.ts +0 -2
- package/build/browser/ontology/StandardOntologyProvider.test.d.ts.map +0 -1
- package/build/browser/ontology/loadActionMetadata.d.ts +0 -4
- package/build/browser/ontology/loadActionMetadata.d.ts.map +0 -1
- package/build/browser/ontology/loadFullObjectMetadata.d.ts +0 -6
- package/build/browser/ontology/loadFullObjectMetadata.d.ts.map +0 -1
- package/build/browser/ontology/loadInterfaceMetadata.d.ts +0 -4
- package/build/browser/ontology/loadInterfaceMetadata.d.ts.map +0 -1
- package/build/browser/ontology/loadQueryMetadata.d.ts +0 -4
- package/build/browser/ontology/loadQueryMetadata.d.ts.map +0 -1
- package/build/browser/ontology/makeConjureContext.d.ts +0 -4
- package/build/browser/ontology/makeConjureContext.d.ts.map +0 -1
- package/build/browser/pageRequestAsAsyncIter.d.ts +0 -10
- package/build/browser/pageRequestAsAsyncIter.d.ts.map +0 -1
- package/build/browser/public/unstable-do-not-use.d.ts +0 -2
- package/build/browser/public/unstable-do-not-use.d.ts.map +0 -1
- package/build/browser/queries/applyQuery.d.ts +0 -6
- package/build/browser/queries/applyQuery.d.ts.map +0 -1
- package/build/browser/queries/queries.test.d.ts +0 -2
- package/build/browser/queries/queries.test.d.ts.map +0 -1
- package/build/browser/queries/types.d.ts +0 -20
- package/build/browser/queries/types.d.ts.map +0 -1
- package/build/browser/tsserver.d.ts +0 -34
- package/build/browser/tsserver.d.ts.map +0 -1
- package/build/browser/util/ArrayElement.d.ts +0 -2
- package/build/browser/util/ArrayElement.d.ts.map +0 -1
- package/build/browser/util/NOOP.d.ts +0 -4
- package/build/browser/util/NOOP.d.ts.map +0 -1
- package/build/browser/util/NullableProps.d.ts +0 -6
- package/build/browser/util/NullableProps.d.ts.map +0 -1
- package/build/browser/util/UserAgent.d.ts +0 -2
- package/build/browser/util/UserAgent.d.ts.map +0 -1
- package/build/browser/util/WireObjectSet.d.ts +0 -2
- package/build/browser/util/WireObjectSet.d.ts.map +0 -1
- package/build/browser/util/addUserAgentAndRequestContextHeaders.d.ts +0 -4
- package/build/browser/util/addUserAgentAndRequestContextHeaders.d.ts.map +0 -1
- package/build/browser/util/augmentRequestContext.d.ts +0 -32
- package/build/browser/util/augmentRequestContext.d.ts.map +0 -1
- package/build/browser/util/isOntologyObjectV2.d.ts +0 -2
- package/build/browser/util/isOntologyObjectV2.d.ts.map +0 -1
- package/build/browser/util/isOsdkBaseObject.d.ts +0 -3
- package/build/browser/util/isOsdkBaseObject.d.ts.map +0 -1
- package/build/browser/util/isOsdkObject.d.ts +0 -3
- package/build/browser/util/isOsdkObject.d.ts.map +0 -1
- package/build/browser/util/partialBy.d.ts +0 -3
- package/build/browser/util/partialBy.d.ts.map +0 -1
- package/build/browser/util/streamutils.d.ts +0 -3
- package/build/browser/util/streamutils.d.ts.map +0 -1
- package/build/browser/util/timeseriesUtils.d.ts +0 -8
- package/build/browser/util/timeseriesUtils.d.ts.map +0 -1
- package/build/browser/util/toDataValue.d.ts +0 -2
- package/build/browser/util/toDataValue.d.ts.map +0 -1
- package/build/browser/util/toDataValue.test.d.ts +0 -2
- package/build/browser/util/toDataValue.test.d.ts.map +0 -1
- package/build/browser/util/toDataValueQueries.d.ts +0 -2
- package/build/browser/util/toDataValueQueries.d.ts.map +0 -1
- package/build/esm/Client.d.ts +0 -26
- package/build/esm/Client.d.ts.map +0 -1
- package/build/esm/Definitions.test.d.ts +0 -2
- package/build/esm/Definitions.test.d.ts.map +0 -1
- package/build/esm/Logger.d.ts +0 -19
- package/build/esm/Logger.d.ts.map +0 -1
- package/build/esm/MinimalClientContext.d.ts +0 -26
- package/build/esm/MinimalClientContext.d.ts.map +0 -1
- package/build/esm/ResultOrError.d.ts +0 -12
- package/build/esm/ResultOrError.d.ts.map +0 -1
- package/build/esm/SatisfiesSemver.d.ts +0 -4
- package/build/esm/SatisfiesSemver.d.ts.map +0 -1
- package/build/esm/SatisfiesSemver.test.d.ts +0 -2
- package/build/esm/SatisfiesSemver.test.d.ts.map +0 -1
- package/build/esm/__unstable/ConjureSupport.d.ts +0 -55
- package/build/esm/__unstable/ConjureSupport.d.ts.map +0 -1
- package/build/esm/__unstable/createBulkLinksAsyncIterFactory.d.ts +0 -5
- package/build/esm/__unstable/createBulkLinksAsyncIterFactory.d.ts.map +0 -1
- package/build/esm/actions/ActionValidationError.d.ts +0 -6
- package/build/esm/actions/ActionValidationError.d.ts.map +0 -1
- package/build/esm/actions/actions.test.d.ts +0 -2
- package/build/esm/actions/actions.test.d.ts.map +0 -1
- package/build/esm/actions/applyAction.d.ts +0 -30
- package/build/esm/actions/applyAction.d.ts.map +0 -1
- package/build/esm/createAttachmentFromRid.d.ts +0 -10
- package/build/esm/createAttachmentFromRid.d.ts.map +0 -1
- package/build/esm/createAttachmentFromRid.js +0 -38
- package/build/esm/createAttachmentFromRid.js.map +0 -1
- package/build/esm/createClient.d.ts +0 -6
- package/build/esm/createClient.d.ts.map +0 -1
- package/build/esm/createClient.test.d.ts +0 -2
- package/build/esm/createClient.test.d.ts.map +0 -1
- package/build/esm/createGeotimeSeriesProperty.d.ts +0 -14
- package/build/esm/createGeotimeSeriesProperty.d.ts.map +0 -1
- package/build/esm/createMinimalClient.d.ts +0 -2
- package/build/esm/createMinimalClient.d.ts.map +0 -1
- package/build/esm/createPlatformClient.d.ts +0 -17
- package/build/esm/createPlatformClient.d.ts.map +0 -1
- package/build/esm/createTimeseriesProperty.d.ts +0 -14
- package/build/esm/createTimeseriesProperty.d.ts.map +0 -1
- package/build/esm/definitions/LinkDefinitions.test.d.ts +0 -2
- package/build/esm/definitions/LinkDefinitions.test.d.ts.map +0 -1
- package/build/esm/fetchMetadata.d.ts +0 -2
- package/build/esm/fetchMetadata.d.ts.map +0 -1
- package/build/esm/fetchMetadata.test.d.ts +0 -2
- package/build/esm/fetchMetadata.test.d.ts.map +0 -1
- package/build/esm/index.d.ts +0 -12
- package/build/esm/index.d.ts.map +0 -1
- package/build/esm/intellisense.test.d.ts +0 -2
- package/build/esm/intellisense.test.d.ts.map +0 -1
- package/build/esm/intellisense.test.helpers/callsQueryAcceptsObject.d.ts +0 -2
- package/build/esm/intellisense.test.helpers/callsQueryAcceptsObject.d.ts.map +0 -1
- package/build/esm/internal/conversions/legacyToModernSingleAggregationResult.d.ts +0 -2
- package/build/esm/internal/conversions/legacyToModernSingleAggregationResult.d.ts.map +0 -1
- package/build/esm/internal/conversions/modernToLegacyAggregationClause.d.ts +0 -2
- package/build/esm/internal/conversions/modernToLegacyAggregationClause.d.ts.map +0 -1
- package/build/esm/internal/conversions/modernToLegacyGroupByClause.d.ts +0 -2
- package/build/esm/internal/conversions/modernToLegacyGroupByClause.d.ts.map +0 -1
- package/build/esm/internal/conversions/modernToLegacyWhereClause.d.ts +0 -2
- package/build/esm/internal/conversions/modernToLegacyWhereClause.d.ts.map +0 -1
- package/build/esm/internal/conversions/modernToLegacyWhereClause.test.d.ts +0 -2
- package/build/esm/internal/conversions/modernToLegacyWhereClause.test.d.ts.map +0 -1
- package/build/esm/object/AttachmentUpload.d.ts +0 -4
- package/build/esm/object/AttachmentUpload.d.ts.map +0 -1
- package/build/esm/object/Cache.d.ts +0 -2
- package/build/esm/object/Cache.d.ts.map +0 -1
- package/build/esm/object/Cache.test.d.ts +0 -11
- package/build/esm/object/Cache.test.d.ts.map +0 -1
- package/build/esm/object/SimpleCache.d.ts +0 -38
- package/build/esm/object/SimpleCache.d.ts.map +0 -1
- package/build/esm/object/aggregate.d.ts +0 -2
- package/build/esm/object/aggregate.d.ts.map +0 -1
- package/build/esm/object/aggregate.test.d.ts +0 -2
- package/build/esm/object/aggregate.test.d.ts.map +0 -1
- package/build/esm/object/attachment.test.d.ts +0 -2
- package/build/esm/object/attachment.test.d.ts.map +0 -1
- package/build/esm/object/convertWireToOsdkObjects/InterfaceHolder.d.ts +0 -2
- package/build/esm/object/convertWireToOsdkObjects/InterfaceHolder.d.ts.map +0 -1
- package/build/esm/object/convertWireToOsdkObjects/InternalSymbols.d.ts +0 -7
- package/build/esm/object/convertWireToOsdkObjects/InternalSymbols.d.ts.map +0 -1
- package/build/esm/object/convertWireToOsdkObjects/ObjectHolder.d.ts +0 -2
- package/build/esm/object/convertWireToOsdkObjects/ObjectHolder.d.ts.map +0 -1
- package/build/esm/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.d.ts +0 -2
- package/build/esm/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.d.ts.map +0 -1
- package/build/esm/object/convertWireToOsdkObjects/PropertyDescriptorRecord.d.ts +0 -8
- package/build/esm/object/convertWireToOsdkObjects/PropertyDescriptorRecord.d.ts.map +0 -1
- package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.d.ts +0 -2
- package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.d.ts.map +0 -1
- package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.test.d.ts +0 -2
- package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.test.d.ts.map +0 -1
- package/build/esm/object/convertWireToOsdkObjects/createOsdkObject.d.ts +0 -2
- package/build/esm/object/convertWireToOsdkObjects/createOsdkObject.d.ts.map +0 -1
- package/build/esm/object/convertWireToOsdkObjects/getDollarAs.d.ts +0 -3
- package/build/esm/object/convertWireToOsdkObjects/getDollarAs.d.ts.map +0 -1
- package/build/esm/object/convertWireToOsdkObjects/getDollarLink.d.ts +0 -2
- package/build/esm/object/convertWireToOsdkObjects/getDollarLink.d.ts.map +0 -1
- package/build/esm/object/convertWireToOsdkObjects.d.ts +0 -2
- package/build/esm/object/convertWireToOsdkObjects.d.ts.map +0 -1
- package/build/esm/object/convertWireToOsdkObjects.test.d.ts +0 -2
- package/build/esm/object/convertWireToOsdkObjects.test.d.ts.map +0 -1
- package/build/esm/object/fetchPage.d.ts +0 -3
- package/build/esm/object/fetchPage.d.ts.map +0 -1
- package/build/esm/object/fetchPage.test.d.ts +0 -2
- package/build/esm/object/fetchPage.test.d.ts.map +0 -1
- package/build/esm/object/fetchSingle.d.ts +0 -2
- package/build/esm/object/fetchSingle.d.ts.map +0 -1
- package/build/esm/object/geotimeseriesreference.test.d.ts +0 -2
- package/build/esm/object/geotimeseriesreference.test.d.ts.map +0 -1
- package/build/esm/object/object.test.d.ts +0 -12
- package/build/esm/object/object.test.d.ts.map +0 -1
- package/build/esm/object/timeseries.test.d.ts +0 -2
- package/build/esm/object/timeseries.test.d.ts.map +0 -1
- package/build/esm/objectSet/ObjectSet.test.d.ts +0 -2
- package/build/esm/objectSet/ObjectSet.test.d.ts.map +0 -1
- package/build/esm/objectSet/ObjectSetFactory.d.ts +0 -2
- package/build/esm/objectSet/ObjectSetFactory.d.ts.map +0 -1
- package/build/esm/objectSet/ObjectSetListenerWebsocket.d.ts +0 -2
- package/build/esm/objectSet/ObjectSetListenerWebsocket.d.ts.map +0 -1
- package/build/esm/objectSet/ObjectSetListenerWebsocket.test.d.ts +0 -2
- package/build/esm/objectSet/ObjectSetListenerWebsocket.test.d.ts.map +0 -1
- package/build/esm/objectSet/conjureUnionType.d.ts +0 -13
- package/build/esm/objectSet/conjureUnionType.d.ts.map +0 -1
- package/build/esm/objectSet/createObjectSet.d.ts +0 -2
- package/build/esm/objectSet/createObjectSet.d.ts.map +0 -1
- package/build/esm/objectSet/toConjureObjectSet.d.ts +0 -2
- package/build/esm/objectSet/toConjureObjectSet.d.ts.map +0 -1
- package/build/esm/objectSet/toConjureObjectSet.js +0 -165
- package/build/esm/objectSet/toConjureObjectSet.js.map +0 -1
- package/build/esm/ontology/OntologyProvider.d.ts +0 -32
- package/build/esm/ontology/OntologyProvider.d.ts.map +0 -1
- package/build/esm/ontology/StandardOntologyProvider.d.ts +0 -5
- package/build/esm/ontology/StandardOntologyProvider.d.ts.map +0 -1
- package/build/esm/ontology/StandardOntologyProvider.test.d.ts +0 -2
- package/build/esm/ontology/StandardOntologyProvider.test.d.ts.map +0 -1
- package/build/esm/ontology/loadActionMetadata.d.ts +0 -4
- package/build/esm/ontology/loadActionMetadata.d.ts.map +0 -1
- package/build/esm/ontology/loadFullObjectMetadata.d.ts +0 -6
- package/build/esm/ontology/loadFullObjectMetadata.d.ts.map +0 -1
- package/build/esm/ontology/loadInterfaceMetadata.d.ts +0 -4
- package/build/esm/ontology/loadInterfaceMetadata.d.ts.map +0 -1
- package/build/esm/ontology/loadQueryMetadata.d.ts +0 -4
- package/build/esm/ontology/loadQueryMetadata.d.ts.map +0 -1
- package/build/esm/ontology/makeConjureContext.d.ts +0 -4
- package/build/esm/ontology/makeConjureContext.d.ts.map +0 -1
- package/build/esm/pageRequestAsAsyncIter.d.ts +0 -10
- package/build/esm/pageRequestAsAsyncIter.d.ts.map +0 -1
- package/build/esm/public/unstable-do-not-use.d.ts +0 -2
- package/build/esm/public/unstable-do-not-use.d.ts.map +0 -1
- package/build/esm/queries/applyQuery.d.ts +0 -6
- package/build/esm/queries/applyQuery.d.ts.map +0 -1
- package/build/esm/queries/queries.test.d.ts +0 -2
- package/build/esm/queries/queries.test.d.ts.map +0 -1
- package/build/esm/queries/types.d.ts +0 -20
- package/build/esm/queries/types.d.ts.map +0 -1
- package/build/esm/tsserver.d.ts +0 -34
- package/build/esm/tsserver.d.ts.map +0 -1
- package/build/esm/util/ArrayElement.d.ts +0 -2
- package/build/esm/util/ArrayElement.d.ts.map +0 -1
- package/build/esm/util/NOOP.d.ts +0 -4
- package/build/esm/util/NOOP.d.ts.map +0 -1
- package/build/esm/util/NullableProps.d.ts +0 -6
- package/build/esm/util/NullableProps.d.ts.map +0 -1
- package/build/esm/util/UserAgent.d.ts +0 -2
- package/build/esm/util/UserAgent.d.ts.map +0 -1
- package/build/esm/util/WireObjectSet.d.ts +0 -2
- package/build/esm/util/WireObjectSet.d.ts.map +0 -1
- package/build/esm/util/addUserAgentAndRequestContextHeaders.d.ts +0 -4
- package/build/esm/util/addUserAgentAndRequestContextHeaders.d.ts.map +0 -1
- package/build/esm/util/augmentRequestContext.d.ts +0 -32
- package/build/esm/util/augmentRequestContext.d.ts.map +0 -1
- package/build/esm/util/isOntologyObjectV2.d.ts +0 -2
- package/build/esm/util/isOntologyObjectV2.d.ts.map +0 -1
- package/build/esm/util/isOsdkBaseObject.d.ts +0 -3
- package/build/esm/util/isOsdkBaseObject.d.ts.map +0 -1
- package/build/esm/util/isOsdkObject.d.ts +0 -3
- package/build/esm/util/isOsdkObject.d.ts.map +0 -1
- package/build/esm/util/partialBy.d.ts +0 -3
- package/build/esm/util/partialBy.d.ts.map +0 -1
- package/build/esm/util/streamutils.d.ts +0 -3
- package/build/esm/util/streamutils.d.ts.map +0 -1
- package/build/esm/util/timeseriesUtils.d.ts +0 -8
- package/build/esm/util/timeseriesUtils.d.ts.map +0 -1
- package/build/esm/util/toDataValue.d.ts +0 -2
- package/build/esm/util/toDataValue.d.ts.map +0 -1
- package/build/esm/util/toDataValue.test.d.ts +0 -2
- package/build/esm/util/toDataValue.test.d.ts.map +0 -1
- package/build/esm/util/toDataValueQueries.d.ts +0 -2
- package/build/esm/util/toDataValueQueries.d.ts.map +0 -1
|
@@ -13,12 +13,14 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
|
|
16
17
|
import WebSocket from "isomorphic-ws";
|
|
17
18
|
import invariant from "tiny-invariant";
|
|
18
|
-
import { convertWireToOsdkObjects } from "../object/convertWireToOsdkObjects.js";
|
|
19
19
|
const MINIMUM_RECONNECT_DELAY_MS = 5 * 1000;
|
|
20
|
+
|
|
20
21
|
/** Noop function to reduce conditional checks */
|
|
21
22
|
function doNothing() {}
|
|
23
|
+
|
|
22
24
|
/**
|
|
23
25
|
* Converts an ObjectSetListener to one where all the functions are defined.
|
|
24
26
|
*/
|
|
@@ -41,10 +43,10 @@ function isReady(sub) {
|
|
|
41
43
|
function subscriptionIsDone(sub) {
|
|
42
44
|
return sub.status === "done" || sub.status === "error";
|
|
43
45
|
}
|
|
46
|
+
|
|
44
47
|
/** @internal */
|
|
45
48
|
export class ObjectSetListenerWebsocket {
|
|
46
49
|
static #instances = new WeakMap();
|
|
47
|
-
MINIMUM_RECONNECT_DELAY_MS;
|
|
48
50
|
// FIXME
|
|
49
51
|
static getInstance(client) {
|
|
50
52
|
let instance = ObjectSetListenerWebsocket.#instances.get(client.clientCacheKey);
|
|
@@ -58,16 +60,20 @@ export class ObjectSetListenerWebsocket {
|
|
|
58
60
|
#lastWsConnect = 0;
|
|
59
61
|
#client;
|
|
60
62
|
#logger;
|
|
63
|
+
|
|
61
64
|
/**
|
|
62
65
|
* map of requestId to all active subscriptions at the time of the request
|
|
63
66
|
*/
|
|
64
67
|
#pendingSubscriptions = new Map();
|
|
68
|
+
|
|
65
69
|
/**
|
|
66
70
|
* Map of subscriptionId to Subscription. Note: the subscriptionId may be
|
|
67
71
|
* temporary and not the actual subscriptionId from the server.
|
|
68
72
|
*/
|
|
69
73
|
#subscriptions = new Map();
|
|
74
|
+
#endedSubscriptions = new Set();
|
|
70
75
|
#maybeDisconnectTimeout;
|
|
76
|
+
|
|
71
77
|
// DO NOT CONSTRUCT DIRECTLY. ONLY EXPOSED AS A TESTING SEAM
|
|
72
78
|
constructor(client, {
|
|
73
79
|
minimumReconnectDelayMs = MINIMUM_RECONNECT_DELAY_MS
|
|
@@ -79,32 +85,37 @@ export class ObjectSetListenerWebsocket {
|
|
|
79
85
|
});
|
|
80
86
|
!(client.baseUrl.startsWith("https://") || client.baseUrl.startsWith("http://")) ? process.env.NODE_ENV !== "production" ? invariant(false, "Stack must be a URL") : invariant(false) : void 0;
|
|
81
87
|
}
|
|
82
|
-
async subscribe(objectType, objectSet, listener, properties) {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
88
|
+
async subscribe(objectType, objectSet, listener, properties = []) {
|
|
89
|
+
const objOrInterfaceDef = objectType.type === "object" ? await this.#client.ontologyProvider.getObjectDefinition(objectType.apiName) : await this.#client.ontologyProvider.getInterfaceDefinition(objectType.apiName);
|
|
90
|
+
let objectProperties = [];
|
|
91
|
+
let referenceProperties = [];
|
|
92
|
+
if (properties.length === 0) {
|
|
93
|
+
properties = Object.keys(objOrInterfaceDef.properties);
|
|
94
|
+
}
|
|
95
|
+
objectProperties = properties.filter(p => objOrInterfaceDef.properties[p].type !== "geotimeSeriesReference");
|
|
96
|
+
referenceProperties = properties.filter(p => objOrInterfaceDef.properties[p].type === "geotimeSeriesReference");
|
|
89
97
|
const sub = {
|
|
90
98
|
listener: fillOutListener(listener),
|
|
91
99
|
objectSet,
|
|
92
|
-
primaryKeyPropertyName:
|
|
100
|
+
primaryKeyPropertyName: objOrInterfaceDef.type === "interface" ? undefined : objOrInterfaceDef.primaryKeyApiName,
|
|
93
101
|
requestedProperties: objectProperties,
|
|
94
102
|
requestedReferenceProperties: referenceProperties,
|
|
95
103
|
status: "preparing",
|
|
96
104
|
// Since we don't have a real subscription id yet but we need to keep
|
|
97
105
|
// track of this reference, we can just use a random uuid.
|
|
98
|
-
subscriptionId: `TMP-${
|
|
106
|
+
subscriptionId: `TMP-${nextUuid()}}`,
|
|
107
|
+
interfaceApiName: objOrInterfaceDef.type === "object" ? undefined : objOrInterfaceDef.apiName
|
|
99
108
|
};
|
|
100
109
|
this.#subscriptions.set(sub.subscriptionId, sub);
|
|
110
|
+
|
|
101
111
|
// actually prepares the subscription, ensures the ws is ready, and sends
|
|
102
112
|
// a subscribe message. We don't want to block on this.
|
|
103
|
-
this.#initiateSubscribe(sub);
|
|
113
|
+
void this.#initiateSubscribe(sub);
|
|
104
114
|
return () => {
|
|
105
115
|
this.#unsubscribe(sub);
|
|
106
116
|
};
|
|
107
117
|
}
|
|
118
|
+
|
|
108
119
|
/**
|
|
109
120
|
* Called at least once for every subscription.
|
|
110
121
|
*
|
|
@@ -120,6 +131,7 @@ export class ObjectSetListenerWebsocket {
|
|
|
120
131
|
}
|
|
121
132
|
try {
|
|
122
133
|
await this.#ensureWebsocket();
|
|
134
|
+
|
|
123
135
|
// the consumer may have already unsubscribed before we are ready to request a subscription
|
|
124
136
|
// so we have to acquire the pendingSubscription after the await.
|
|
125
137
|
if (subscriptionIsDone(sub)) {
|
|
@@ -132,7 +144,7 @@ export class ObjectSetListenerWebsocket {
|
|
|
132
144
|
}
|
|
133
145
|
} catch (error) {
|
|
134
146
|
this.#logger?.error(error, "Error in #initiateSubscribe");
|
|
135
|
-
sub
|
|
147
|
+
this.#tryCatchOnError(sub, true, error);
|
|
136
148
|
}
|
|
137
149
|
}
|
|
138
150
|
#sendSubscribeMessage() {
|
|
@@ -143,16 +155,10 @@ export class ObjectSetListenerWebsocket {
|
|
|
143
155
|
// we may have multiple subscriptions that don't have a subscriptionId yet,
|
|
144
156
|
// so we filter those out.
|
|
145
157
|
const readySubs = [...this.#subscriptions.values()].filter(isReady);
|
|
146
|
-
|
|
147
|
-
if (process.env.NODE_ENV !== "production") {
|
|
148
|
-
this.#logger?.trace("#sendSubscribeMessage(): aborting due to no ready subscriptions");
|
|
149
|
-
}
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
// Assumes the node 18 crypto fallback to globalThis in `subscribe` has happened.
|
|
153
|
-
const id = crypto.randomUUID();
|
|
158
|
+
const id = nextUuid();
|
|
154
159
|
// responses come back as an array of subIds, so we need to know the sources
|
|
155
160
|
this.#pendingSubscriptions.set(id, readySubs);
|
|
161
|
+
|
|
156
162
|
// every subscribe message "overwrites" the previous ones that are not
|
|
157
163
|
// re-included, so we have to reconstitute the entire list of subscriptions
|
|
158
164
|
const subscribe = {
|
|
@@ -160,7 +166,8 @@ export class ObjectSetListenerWebsocket {
|
|
|
160
166
|
requests: readySubs.map(({
|
|
161
167
|
objectSet,
|
|
162
168
|
requestedProperties,
|
|
163
|
-
requestedReferenceProperties
|
|
169
|
+
requestedReferenceProperties,
|
|
170
|
+
interfaceApiName
|
|
164
171
|
}) => {
|
|
165
172
|
return {
|
|
166
173
|
objectSet: objectSet,
|
|
@@ -182,10 +189,13 @@ export class ObjectSetListenerWebsocket {
|
|
|
182
189
|
return;
|
|
183
190
|
}
|
|
184
191
|
sub.status = newStatus;
|
|
192
|
+
|
|
185
193
|
// make sure listeners do nothing now
|
|
186
194
|
sub.listener = fillOutListener({});
|
|
187
195
|
this.#subscriptions.delete(sub.subscriptionId);
|
|
196
|
+
this.#endedSubscriptions.add(sub.subscriptionId);
|
|
188
197
|
this.#sendSubscribeMessage();
|
|
198
|
+
|
|
189
199
|
// If we have no more subscriptions, we can disconnect the websocket
|
|
190
200
|
// however we should wait a bit to see if we get any more subscriptions.
|
|
191
201
|
// For example, when switching between react views, you may unsubscribe
|
|
@@ -215,9 +225,9 @@ export class ObjectSetListenerWebsocket {
|
|
|
215
225
|
baseUrl,
|
|
216
226
|
tokenProvider
|
|
217
227
|
} = this.#client;
|
|
218
|
-
const
|
|
219
|
-
const url = `wss://${base.host}/api/v2/ontologySubscriptions/ontologies/${this.#client.ontologyRid}/streamSubscriptions`;
|
|
228
|
+
const url = constructWebsocketUrl(baseUrl, await this.#client.ontologyRid);
|
|
220
229
|
const token = await tokenProvider();
|
|
230
|
+
|
|
221
231
|
// tokenProvider is async, there could potentially be a race to create the websocket.
|
|
222
232
|
// Only the first call to reach here will find a null this.#ws, the rest will bail out
|
|
223
233
|
if (this.#ws == null) {
|
|
@@ -230,6 +240,7 @@ export class ObjectSetListenerWebsocket {
|
|
|
230
240
|
});
|
|
231
241
|
}
|
|
232
242
|
this.#lastWsConnect = Date.now();
|
|
243
|
+
|
|
233
244
|
// we again may have lost the race after our minimum backoff time
|
|
234
245
|
if (this.#ws == null) {
|
|
235
246
|
if (process.env.NODE_ENV !== "production") {
|
|
@@ -279,14 +290,14 @@ export class ObjectSetListenerWebsocket {
|
|
|
279
290
|
}
|
|
280
291
|
switch (data.type) {
|
|
281
292
|
case "objectSetChanged":
|
|
282
|
-
return this.#handleMessage_objectSetChanged(data);
|
|
293
|
+
return void this.#handleMessage_objectSetChanged(data);
|
|
283
294
|
case "refreshObjectSet":
|
|
284
|
-
return this.#handleMessage_refreshObjectSet(data);
|
|
295
|
+
return void this.#handleMessage_refreshObjectSet(data);
|
|
285
296
|
case "subscribeResponses":
|
|
286
|
-
return this.#handleMessage_subscribeResponses(data);
|
|
297
|
+
return void this.#handleMessage_subscribeResponses(data);
|
|
287
298
|
case "subscriptionClosed":
|
|
288
299
|
{
|
|
289
|
-
return this.#handleMessage_subscriptionClosed(data);
|
|
300
|
+
return void this.#handleMessage_subscriptionClosed(data);
|
|
290
301
|
}
|
|
291
302
|
default:
|
|
292
303
|
process.env.NODE_ENV !== "production" ? invariant(false, "Unexpected message type") : invariant(false);
|
|
@@ -298,12 +309,12 @@ export class ObjectSetListenerWebsocket {
|
|
|
298
309
|
const objectUpdates = payload.updates.filter(update => update.type === "object");
|
|
299
310
|
const referenceUpdates = payload.updates.filter(update => update.type === "reference");
|
|
300
311
|
const osdkObjectsWithReferenceUpdates = await Promise.all(referenceUpdates.map(async o => {
|
|
301
|
-
const osdkObjectArray = await
|
|
312
|
+
const osdkObjectArray = await this.#client.objectFactory2(this.#client, [{
|
|
302
313
|
__apiName: o.objectType,
|
|
303
|
-
__primaryKey: o.primaryKey[sub.primaryKeyPropertyName],
|
|
314
|
+
__primaryKey: sub.primaryKeyPropertyName != null ? o.primaryKey[sub.primaryKeyPropertyName] : undefined,
|
|
304
315
|
...o.primaryKey,
|
|
305
316
|
[o.property]: o.value
|
|
306
|
-
}], undefined);
|
|
317
|
+
}], sub.interfaceApiName, false, undefined, false, await this.#fetchInterfaceMapping(o.objectType, sub.interfaceApiName));
|
|
307
318
|
const singleOsdkObject = osdkObjectArray[0] ?? undefined;
|
|
308
319
|
return singleOsdkObject != null ? {
|
|
309
320
|
object: singleOsdkObject,
|
|
@@ -312,7 +323,12 @@ export class ObjectSetListenerWebsocket {
|
|
|
312
323
|
}));
|
|
313
324
|
for (const osdkObject of osdkObjectsWithReferenceUpdates) {
|
|
314
325
|
if (osdkObject != null) {
|
|
315
|
-
|
|
326
|
+
try {
|
|
327
|
+
sub.listener.onChange?.(osdkObject);
|
|
328
|
+
} catch (error) {
|
|
329
|
+
this.#logger?.error(error, "Error in onChange callback");
|
|
330
|
+
this.#tryCatchOnError(sub, false, error);
|
|
331
|
+
}
|
|
316
332
|
}
|
|
317
333
|
}
|
|
318
334
|
const osdkObjects = await Promise.all(objectUpdates.map(async o => {
|
|
@@ -320,7 +336,7 @@ export class ObjectSetListenerWebsocket {
|
|
|
320
336
|
for (const key of keysToDelete) {
|
|
321
337
|
delete o.object[key];
|
|
322
338
|
}
|
|
323
|
-
const osdkObjectArray = await
|
|
339
|
+
const osdkObjectArray = await this.#client.objectFactory2(this.#client, [o.object], sub.interfaceApiName, false, undefined, false, await this.#fetchInterfaceMapping(o.object.__apiName, sub.interfaceApiName));
|
|
324
340
|
const singleOsdkObject = osdkObjectArray[0] ?? undefined;
|
|
325
341
|
return singleOsdkObject != null ? {
|
|
326
342
|
object: singleOsdkObject,
|
|
@@ -329,14 +345,33 @@ export class ObjectSetListenerWebsocket {
|
|
|
329
345
|
}));
|
|
330
346
|
for (const osdkObject of osdkObjects) {
|
|
331
347
|
if (osdkObject != null) {
|
|
332
|
-
|
|
348
|
+
try {
|
|
349
|
+
sub.listener.onChange?.(osdkObject);
|
|
350
|
+
} catch (error) {
|
|
351
|
+
this.#logger?.error(error, "Error in onChange callback");
|
|
352
|
+
this.#tryCatchOnError(sub, false, error);
|
|
353
|
+
}
|
|
333
354
|
}
|
|
334
355
|
}
|
|
335
356
|
};
|
|
357
|
+
async #fetchInterfaceMapping(objectTypeApiName, interfaceApiName) {
|
|
358
|
+
if (interfaceApiName == null) return {};
|
|
359
|
+
const interfaceMap = (await this.#client.ontologyProvider.getObjectDefinition(objectTypeApiName)).interfaceMap;
|
|
360
|
+
return {
|
|
361
|
+
[interfaceApiName]: {
|
|
362
|
+
[objectTypeApiName]: interfaceMap[interfaceApiName]
|
|
363
|
+
}
|
|
364
|
+
};
|
|
365
|
+
}
|
|
336
366
|
#handleMessage_refreshObjectSet = payload => {
|
|
337
367
|
const sub = this.#subscriptions.get(payload.id);
|
|
338
368
|
!sub ? process.env.NODE_ENV !== "production" ? invariant(false, `Expected subscription id ${payload.id}`) : invariant(false) : void 0;
|
|
339
|
-
|
|
369
|
+
try {
|
|
370
|
+
sub.listener.onOutOfDate();
|
|
371
|
+
} catch (error) {
|
|
372
|
+
this.#logger?.error(error, "Error in onOutOfDate callback");
|
|
373
|
+
this.#tryCatchOnError(sub, false, error);
|
|
374
|
+
}
|
|
340
375
|
};
|
|
341
376
|
#handleMessage_subscribeResponses = payload => {
|
|
342
377
|
const {
|
|
@@ -351,7 +386,7 @@ export class ObjectSetListenerWebsocket {
|
|
|
351
386
|
const response = responses[i];
|
|
352
387
|
switch (response.type) {
|
|
353
388
|
case "error":
|
|
354
|
-
sub
|
|
389
|
+
this.#tryCatchOnError(sub, true, response.errors);
|
|
355
390
|
this.#unsubscribe(sub, "error");
|
|
356
391
|
break;
|
|
357
392
|
case "qos":
|
|
@@ -373,17 +408,23 @@ export class ObjectSetListenerWebsocket {
|
|
|
373
408
|
sub.subscriptionId = response.id;
|
|
374
409
|
this.#subscriptions.set(sub.subscriptionId, sub); // future messages come by this subId
|
|
375
410
|
}
|
|
376
|
-
|
|
411
|
+
try {
|
|
412
|
+
if (shouldFireOutOfDate) sub.listener.onOutOfDate();else sub.listener.onSuccessfulSubscription();
|
|
413
|
+
} catch (error) {
|
|
414
|
+
this.#logger?.error(error, "Error in onOutOfDate or onSuccessfulSubscription callback");
|
|
415
|
+
this.#tryCatchOnError(sub, false, error);
|
|
416
|
+
}
|
|
377
417
|
break;
|
|
378
418
|
default:
|
|
379
|
-
sub
|
|
419
|
+
this.#tryCatchOnError(sub, true, response);
|
|
380
420
|
}
|
|
381
421
|
}
|
|
382
422
|
};
|
|
383
423
|
#handleMessage_subscriptionClosed(payload) {
|
|
384
424
|
const sub = this.#subscriptions.get(payload.id);
|
|
425
|
+
if (sub == null && this.#endedSubscriptions.has(payload.id)) return;
|
|
385
426
|
!sub ? process.env.NODE_ENV !== "production" ? invariant(false, `Expected subscription id ${payload.id}`) : invariant(false) : void 0;
|
|
386
|
-
sub
|
|
427
|
+
this.#tryCatchOnError(sub, true, payload.cause);
|
|
387
428
|
this.#unsubscribe(sub, "error");
|
|
388
429
|
}
|
|
389
430
|
#onClose = event => {
|
|
@@ -405,6 +446,7 @@ export class ObjectSetListenerWebsocket {
|
|
|
405
446
|
}
|
|
406
447
|
this.#ws = undefined;
|
|
407
448
|
}
|
|
449
|
+
|
|
408
450
|
// if we have any listeners that are still depending on us, go ahead and reopen the websocket
|
|
409
451
|
if (this.#subscriptions.size > 0) {
|
|
410
452
|
if (process.env.NODE_ENV !== "production") {
|
|
@@ -415,8 +457,43 @@ export class ObjectSetListenerWebsocket {
|
|
|
415
457
|
for (const s of this.#subscriptions.values()) {
|
|
416
458
|
if (s.status === "subscribed") s.status = "reconnecting";
|
|
417
459
|
}
|
|
418
|
-
|
|
460
|
+
|
|
461
|
+
// we don't care about the result of this (we want cycleWebsocket to be fire and forget)
|
|
462
|
+
// just that it happens
|
|
463
|
+
void this.#ensureWebsocket();
|
|
464
|
+
}
|
|
465
|
+
};
|
|
466
|
+
#tryCatchOnError = (sub, subscriptionClosed, error) => {
|
|
467
|
+
try {
|
|
468
|
+
sub.listener.onError({
|
|
469
|
+
subscriptionClosed: subscriptionClosed,
|
|
470
|
+
error
|
|
471
|
+
});
|
|
472
|
+
} catch (onErrorError) {
|
|
473
|
+
// eslint-disable-next-line no-console
|
|
474
|
+
console.error(`Error encountered in an onError callback for an OSDK subscription`, onErrorError);
|
|
475
|
+
// eslint-disable-next-line no-console
|
|
476
|
+
console.error(`This onError call was triggered by an error in another callback`, error);
|
|
477
|
+
// eslint-disable-next-line no-console
|
|
478
|
+
console.error(`The subscription has been closed.`, error);
|
|
479
|
+
if (!subscriptionClosed) {
|
|
480
|
+
this.#logger?.error(error, "Error in onError callback");
|
|
481
|
+
this.#unsubscribe(sub, "error");
|
|
482
|
+
this.#tryCatchOnError(sub, true, onErrorError);
|
|
483
|
+
}
|
|
419
484
|
}
|
|
420
485
|
};
|
|
421
486
|
}
|
|
487
|
+
|
|
488
|
+
/** @internal */
|
|
489
|
+
export function constructWebsocketUrl(baseUrl, ontologyRid) {
|
|
490
|
+
const base = new URL(baseUrl);
|
|
491
|
+
const url = new URL(`api/v2/ontologySubscriptions/ontologies/${ontologyRid}/streamSubscriptions`, base);
|
|
492
|
+
url.protocol = url.protocol.replace("https", "wss");
|
|
493
|
+
return url;
|
|
494
|
+
}
|
|
495
|
+
let uuidCounter = 0;
|
|
496
|
+
function nextUuid() {
|
|
497
|
+
return `00000000-0000-0000-0000-${(uuidCounter++).toString().padStart(12, "0")}`;
|
|
498
|
+
}
|
|
422
499
|
//# sourceMappingURL=ObjectSetListenerWebsocket.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectSetListenerWebsocket.js","names":["WebSocket","invariant","convertWireToOsdkObjects","MINIMUM_RECONNECT_DELAY_MS","doNothing","fillOutListener","onChange","onError","onOutOfDate","onSuccessfulSubscription","isReady","sub","subscriptionIsDone","status","ObjectSetListenerWebsocket","instances","WeakMap","getInstance","client","instance","get","clientCacheKey","set","ws","lastWsConnect","logger","pendingSubscriptions","Map","subscriptions","maybeDisconnectTimeout","constructor","minimumReconnectDelayMs","child","msgPrefix","baseUrl","startsWith","process","env","NODE_ENV","subscribe","objectType","objectSet","listener","properties","globalThis","crypto","webcrypto","objDef","ontologyProvider","getObjectDefinition","apiName","objectProperties","filter","p","type","referenceProperties","primaryKeyPropertyName","primaryKeyApiName","requestedProperties","requestedReferenceProperties","subscriptionId","randomUUID","initiateSubscribe","unsubscribe","#initiateSubscribe","trace","ensureWebsocket","readyState","OPEN","sendSubscribeMessage","error","#sendSubscribeMessage","readySubs","values","length","id","requests","map","propertySet","referenceSet","payload","send","JSON","stringify","#unsubscribe","newStatus","delete","clearTimeout","setTimeout","undefined","size","cycleWebsocket","#ensureWebsocket","tokenProvider","base","URL","url","host","ontologyRid","token","nextConnectTime","Date","now","Promise","resolve","addEventListener","onClose","onMessage","onOpen","CONNECTING","reject","cleanup","removeEventListener","open","evt","#onOpen","message","data","parse","toString","handleMessage_objectSetChanged","handleMessage_refreshObjectSet","handleMessage_subscribeResponses","handleMessage_subscriptionClosed","objectUpdates","updates","update","referenceUpdates","osdkObjectsWithReferenceUpdates","all","o","osdkObjectArray","__apiName","__primaryKey","primaryKey","property","value","singleOsdkObject","object","state","osdkObject","osdkObjects","keysToDelete","Object","keys","key","includes","responses","subs","i","response","errors","shouldFireOutOfDate","#handleMessage_subscriptionClosed","cause","event","#cycleWebsocket","CLOSING","CLOSED","close","s"],"sources":["ObjectSetListenerWebsocket.js"],"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 */\nimport WebSocket from \"isomorphic-ws\";\nimport invariant from \"tiny-invariant\";\nimport { convertWireToOsdkObjects } from \"../object/convertWireToOsdkObjects.js\";\nconst MINIMUM_RECONNECT_DELAY_MS = 5 * 1000;\n/** Noop function to reduce conditional checks */\nfunction doNothing() { }\n/**\n * Converts an ObjectSetListener to one where all the functions are defined.\n */\nfunction fillOutListener({ onChange = doNothing, onError = doNothing, onOutOfDate = doNothing, onSuccessfulSubscription = doNothing, }) {\n return { onChange, onError, onOutOfDate, onSuccessfulSubscription };\n}\nfunction isReady(sub) {\n return sub.isReady != null;\n}\nfunction subscriptionIsDone(sub) {\n return sub.status === \"done\" || sub.status === \"error\";\n}\n/** @internal */\nexport class ObjectSetListenerWebsocket {\n static #instances = new WeakMap();\n MINIMUM_RECONNECT_DELAY_MS;\n // FIXME\n static getInstance(client) {\n let instance = ObjectSetListenerWebsocket.#instances.get(client.clientCacheKey);\n if (instance == null) {\n instance = new ObjectSetListenerWebsocket(client);\n ObjectSetListenerWebsocket.#instances.set(client.clientCacheKey, instance);\n }\n return instance;\n }\n #ws;\n #lastWsConnect = 0;\n #client;\n #logger;\n /**\n * map of requestId to all active subscriptions at the time of the request\n */\n #pendingSubscriptions = new Map();\n /**\n * Map of subscriptionId to Subscription. Note: the subscriptionId may be\n * temporary and not the actual subscriptionId from the server.\n */\n #subscriptions = new Map();\n #maybeDisconnectTimeout;\n // DO NOT CONSTRUCT DIRECTLY. ONLY EXPOSED AS A TESTING SEAM\n constructor(client, { minimumReconnectDelayMs = MINIMUM_RECONNECT_DELAY_MS, } = {}) {\n this.MINIMUM_RECONNECT_DELAY_MS = minimumReconnectDelayMs;\n this.#client = client;\n this.#logger = client.logger?.child({}, {\n msgPrefix: \"<OSW> \",\n });\n invariant(client.baseUrl.startsWith(\"https://\")\n || client.baseUrl.startsWith(\"http://\"), \"Stack must be a URL\");\n }\n async subscribe(objectType, objectSet, listener, properties) {\n if (process.env.TARGET !== \"browser\") {\n // Node 18 does not expose 'crypto' on globalThis, so we need to do it ourselves. This\n // will not be needed after our minimum version is 19 or greater.\n globalThis.crypto ??= (await import(\"node:crypto\")).webcrypto;\n }\n const objDef = await this.#client.ontologyProvider.getObjectDefinition(objectType.apiName);\n const objectProperties = properties.filter((p) => objDef.properties[p].type !== \"geotimeSeriesReference\");\n const referenceProperties = properties.filter((p) => objDef.properties[p].type === \"geotimeSeriesReference\");\n const sub = {\n listener: fillOutListener(listener),\n objectSet,\n primaryKeyPropertyName: objDef.primaryKeyApiName,\n requestedProperties: objectProperties,\n requestedReferenceProperties: referenceProperties,\n status: \"preparing\",\n // Since we don't have a real subscription id yet but we need to keep\n // track of this reference, we can just use a random uuid.\n subscriptionId: `TMP-${crypto.randomUUID()}`,\n };\n this.#subscriptions.set(sub.subscriptionId, sub);\n // actually prepares the subscription, ensures the ws is ready, and sends\n // a subscribe message. We don't want to block on this.\n this.#initiateSubscribe(sub);\n return () => {\n this.#unsubscribe(sub);\n };\n }\n /**\n * Called at least once for every subscription.\n *\n * - Resets pending expiry\n * - Recreates temporary object set\n * - Triggers a full subscribe message\n *\n * @returns\n */\n async #initiateSubscribe(sub) {\n if (process.env.NODE_ENV !== \"production\") {\n this.#logger?.trace(\"#initiateSubscribe()\");\n }\n try {\n await this.#ensureWebsocket();\n // the consumer may have already unsubscribed before we are ready to request a subscription\n // so we have to acquire the pendingSubscription after the await.\n if (subscriptionIsDone(sub)) {\n return;\n }\n sub.isReady = true;\n // if we aren't open, then this happens after we #onConnect\n if (this.#ws?.readyState === WebSocket.OPEN) {\n this.#sendSubscribeMessage();\n }\n }\n catch (error) {\n this.#logger?.error(error, \"Error in #initiateSubscribe\");\n sub.listener.onError([error]);\n }\n }\n #sendSubscribeMessage() {\n if (process.env.NODE_ENV !== \"production\") {\n this.#logger?.trace(\"#sendSubscribeMessage()\");\n }\n // If two calls to `.subscribe()` happen at once (or if the connection is reset),\n // we may have multiple subscriptions that don't have a subscriptionId yet,\n // so we filter those out.\n const readySubs = [...this.#subscriptions.values()].filter(isReady);\n if (readySubs.length === 0) {\n if (process.env.NODE_ENV !== \"production\") {\n this.#logger?.trace(\"#sendSubscribeMessage(): aborting due to no ready subscriptions\");\n }\n return;\n }\n // Assumes the node 18 crypto fallback to globalThis in `subscribe` has happened.\n const id = crypto.randomUUID();\n // responses come back as an array of subIds, so we need to know the sources\n this.#pendingSubscriptions.set(id, readySubs);\n // every subscribe message \"overwrites\" the previous ones that are not\n // re-included, so we have to reconstitute the entire list of subscriptions\n const subscribe = {\n id,\n requests: readySubs.map(({ objectSet, requestedProperties, requestedReferenceProperties }) => {\n return {\n objectSet: objectSet,\n propertySet: requestedProperties,\n referenceSet: requestedReferenceProperties,\n };\n }),\n };\n if (process.env.NODE_ENV !== \"production\") {\n this.#logger?.trace({ payload: subscribe }, \"sending subscribe message\");\n }\n this.#ws?.send(JSON.stringify(subscribe));\n }\n #unsubscribe(sub, newStatus = \"done\") {\n if (subscriptionIsDone(sub)) {\n // if we are already done, we don't need to do anything\n return;\n }\n sub.status = newStatus;\n // make sure listeners do nothing now\n sub.listener = fillOutListener({});\n this.#subscriptions.delete(sub.subscriptionId);\n this.#sendSubscribeMessage();\n // If we have no more subscriptions, we can disconnect the websocket\n // however we should wait a bit to see if we get any more subscriptions.\n // For example, when switching between react views, you may unsubscribe\n // in the old view and subscribe in the new view. We don't need to re-establish\n // the websocket connection in that case.\n if (this.#maybeDisconnectTimeout) {\n // We reset the timeout on every unsubscribe so its always at least 15s from\n // the last time we are empty. E.g.:\n // - 0s: Subscribe(A)\n // - 10s: Unsubscribe(A)\n // - 11s: Subscribe(B)\n // - 20s: Unsubscribe(B)\n // If we do not clear out the timeout we would disconnect at 25s but that would only be\n // 5s after the last subscription was removed instead of at 35s for the desired 15s.\n clearTimeout(this.#maybeDisconnectTimeout);\n }\n this.#maybeDisconnectTimeout = setTimeout(() => {\n this.#maybeDisconnectTimeout = undefined;\n if (this.#subscriptions.size === 0) {\n this.#cycleWebsocket();\n }\n }, 15_000 /* ms */);\n }\n async #ensureWebsocket() {\n if (this.#ws == null) {\n const { baseUrl, tokenProvider } = this.#client;\n const base = new URL(baseUrl);\n const url = `wss://${base.host}/api/v2/ontologySubscriptions/ontologies/${this.#client.ontologyRid}/streamSubscriptions`;\n const token = await tokenProvider();\n // tokenProvider is async, there could potentially be a race to create the websocket.\n // Only the first call to reach here will find a null this.#ws, the rest will bail out\n if (this.#ws == null) {\n // TODO this can probably be exponential backoff with jitter\n // don't reconnect more quickly than MINIMUM_RECONNECT_DELAY\n const nextConnectTime = (this.#lastWsConnect ?? 0)\n + this.MINIMUM_RECONNECT_DELAY_MS;\n if (nextConnectTime > Date.now()) {\n await new Promise((resolve) => {\n setTimeout(resolve, nextConnectTime - Date.now());\n });\n }\n this.#lastWsConnect = Date.now();\n // we again may have lost the race after our minimum backoff time\n if (this.#ws == null) {\n if (process.env.NODE_ENV !== \"production\") {\n this.#logger?.trace(\"Creating websocket\");\n }\n this.#ws = new WebSocket(url, [`Bearer-${token}`]);\n this.#ws.addEventListener(\"close\", this.#onClose);\n this.#ws.addEventListener(\"message\", this.#onMessage);\n this.#ws.addEventListener(\"open\", this.#onOpen);\n }\n }\n // Allow await-ing the websocket open event if it isn't open already.\n // This needs to happen even for callers that didn't just create this.#ws\n if (this.#ws.readyState === WebSocket.CONNECTING) {\n const ws = this.#ws;\n return new Promise((resolve, reject) => {\n function cleanup() {\n ws.removeEventListener(\"open\", open);\n ws.removeEventListener(\"error\", error);\n ws.removeEventListener(\"close\", cleanup);\n }\n function open() {\n cleanup();\n resolve();\n }\n function error(evt) {\n cleanup();\n reject(evt);\n }\n ws.addEventListener(\"open\", open);\n ws.addEventListener(\"error\", error);\n ws.addEventListener(\"close\", cleanup);\n });\n }\n }\n }\n #onOpen = () => {\n // resubscribe all of the listeners\n this.#sendSubscribeMessage();\n };\n #onMessage = async (message) => {\n const data = JSON.parse(message.data.toString());\n if (process.env.NODE_ENV !== \"production\") {\n this.#logger?.trace({ payload: data }, \"received message from ws\");\n }\n switch (data.type) {\n case \"objectSetChanged\":\n return this.#handleMessage_objectSetChanged(data);\n case \"refreshObjectSet\":\n return this.#handleMessage_refreshObjectSet(data);\n case \"subscribeResponses\":\n return this.#handleMessage_subscribeResponses(data);\n case \"subscriptionClosed\": {\n return this.#handleMessage_subscriptionClosed(data);\n }\n default:\n const _ = data;\n invariant(false, \"Unexpected message type\");\n }\n };\n #handleMessage_objectSetChanged = async (payload) => {\n const sub = this.#subscriptions.get(payload.id);\n if (sub == null)\n return;\n const objectUpdates = payload.updates.filter((update) => update.type === \"object\");\n const referenceUpdates = payload.updates.filter((update) => update.type === \"reference\");\n const osdkObjectsWithReferenceUpdates = await Promise.all(referenceUpdates.map(async (o) => {\n const osdkObjectArray = await convertWireToOsdkObjects(this.#client, [{\n __apiName: o.objectType,\n __primaryKey: o.primaryKey[sub.primaryKeyPropertyName],\n ...o.primaryKey,\n [o.property]: o.value,\n }], undefined);\n const singleOsdkObject = osdkObjectArray[0] ?? undefined;\n return singleOsdkObject != null\n ? {\n object: singleOsdkObject,\n state: \"ADDED_OR_UPDATED\",\n }\n : undefined;\n }));\n for (const osdkObject of osdkObjectsWithReferenceUpdates) {\n if (osdkObject != null) {\n sub.listener.onChange?.(osdkObject);\n }\n }\n const osdkObjects = await Promise.all(objectUpdates.map(async (o) => {\n const keysToDelete = Object.keys(o.object).filter((key) => sub.requestedReferenceProperties.includes(key));\n for (const key of keysToDelete) {\n delete o.object[key];\n }\n const osdkObjectArray = await convertWireToOsdkObjects(this.#client, [o.object], undefined);\n const singleOsdkObject = osdkObjectArray[0] ?? undefined;\n return singleOsdkObject != null\n ? {\n object: singleOsdkObject,\n state: o.state,\n }\n : undefined;\n }));\n for (const osdkObject of osdkObjects) {\n if (osdkObject != null) {\n sub.listener.onChange?.(osdkObject);\n }\n }\n };\n #handleMessage_refreshObjectSet = (payload) => {\n const sub = this.#subscriptions.get(payload.id);\n invariant(sub, `Expected subscription id ${payload.id}`);\n sub.listener.onOutOfDate();\n };\n #handleMessage_subscribeResponses = (payload) => {\n const { id, responses } = payload;\n const subs = this.#pendingSubscriptions.get(id);\n invariant(subs, `should have a pending subscription for ${id}`);\n this.#pendingSubscriptions.delete(id);\n for (let i = 0; i < responses.length; i++) {\n const sub = subs[i];\n const response = responses[i];\n switch (response.type) {\n case \"error\":\n sub.listener.onError(response.errors);\n this.#unsubscribe(sub, \"error\");\n break;\n case \"qos\":\n // the server has requested that we tear down our websocket and reconnect to help load balance\n this.#cycleWebsocket();\n break;\n case \"success\":\n // `\"preparing\"` should only be the status on an initial subscribe.\n const shouldFireOutOfDate = sub.status === \"expired\"\n || sub.status === \"reconnecting\";\n if (process.env.NODE_ENV !== \"production\") {\n this.#logger?.trace({ shouldFireOutOfDate }, \"success\");\n }\n sub.status = \"subscribed\";\n if (sub.subscriptionId !== response.id) {\n // might be the temporary one\n this.#subscriptions.delete(sub.subscriptionId);\n sub.subscriptionId = response.id;\n this.#subscriptions.set(sub.subscriptionId, sub); // future messages come by this subId\n }\n if (shouldFireOutOfDate)\n sub.listener.onOutOfDate();\n else\n sub.listener.onSuccessfulSubscription();\n break;\n default:\n const _ = response;\n sub.listener.onError(response);\n }\n }\n };\n #handleMessage_subscriptionClosed(payload) {\n const sub = this.#subscriptions.get(payload.id);\n invariant(sub, `Expected subscription id ${payload.id}`);\n sub.listener.onError([payload.cause]);\n this.#unsubscribe(sub, \"error\");\n }\n #onClose = (event) => {\n if (process.env.NODE_ENV !== \"production\") {\n this.#logger?.trace({ event }, \"Received close event from ws\", event);\n }\n // TODO we should probably throttle this so we don't abuse the backend\n this.#cycleWebsocket();\n };\n #cycleWebsocket = () => {\n if (this.#ws) {\n this.#ws.removeEventListener(\"open\", this.#onOpen);\n this.#ws.removeEventListener(\"message\", this.#onMessage);\n this.#ws.removeEventListener(\"close\", this.#onClose);\n if (this.#ws.readyState !== WebSocket.CLOSING\n && this.#ws.readyState !== WebSocket.CLOSED) {\n this.#ws.close();\n }\n this.#ws = undefined;\n }\n // if we have any listeners that are still depending on us, go ahead and reopen the websocket\n if (this.#subscriptions.size > 0) {\n if (process.env.NODE_ENV !== \"production\") {\n for (const s of this.#subscriptions.values()) {\n invariant(s.status !== \"done\" && s.status !== \"error\", \"should not have done/error subscriptions still\");\n }\n }\n for (const s of this.#subscriptions.values()) {\n if (s.status === \"subscribed\")\n s.status = \"reconnecting\";\n }\n this.#ensureWebsocket();\n }\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAOA,SAAS,MAAM,eAAe;AACrC,OAAOC,SAAS,MAAM,gBAAgB;AACtC,SAASC,wBAAwB,QAAQ,uCAAuC;AAChF,MAAMC,0BAA0B,GAAG,CAAC,GAAG,IAAI;AAC3C;AACA,SAASC,SAASA,CAAA,EAAG,CAAE;AACv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AAE;QAC1C,IAAIuF,CAAC,CAACnJ,MAAM,KAAK,YAAY,EACzBmJ,CAAC,CAACnJ,MAAM,GAAG,cAAc;MACjC;MACA,IAAI,CAAC,CAACqD,eAAe,CAAC,CAAC;IAC3B;EACJ,CAAC;AACL","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ObjectSetListenerWebsocket.js","names":["WebSocket","invariant","MINIMUM_RECONNECT_DELAY_MS","doNothing","fillOutListener","onChange","onError","onOutOfDate","onSuccessfulSubscription","isReady","sub","subscriptionIsDone","status","ObjectSetListenerWebsocket","instances","WeakMap","getInstance","client","instance","get","clientCacheKey","set","ws","lastWsConnect","logger","pendingSubscriptions","Map","subscriptions","endedSubscriptions","Set","maybeDisconnectTimeout","constructor","minimumReconnectDelayMs","child","msgPrefix","baseUrl","startsWith","process","env","NODE_ENV","subscribe","objectType","objectSet","listener","properties","objOrInterfaceDef","type","ontologyProvider","getObjectDefinition","apiName","getInterfaceDefinition","objectProperties","referenceProperties","length","Object","keys","filter","p","primaryKeyPropertyName","undefined","primaryKeyApiName","requestedProperties","requestedReferenceProperties","subscriptionId","nextUuid","interfaceApiName","initiateSubscribe","unsubscribe","#initiateSubscribe","trace","ensureWebsocket","readyState","OPEN","sendSubscribeMessage","error","tryCatchOnError","#sendSubscribeMessage","readySubs","values","id","requests","map","propertySet","referenceSet","payload","send","JSON","stringify","#unsubscribe","newStatus","delete","add","clearTimeout","setTimeout","size","cycleWebsocket","#ensureWebsocket","tokenProvider","url","constructWebsocketUrl","ontologyRid","token","nextConnectTime","Date","now","Promise","resolve","addEventListener","onClose","onMessage","onOpen","CONNECTING","reject","cleanup","removeEventListener","open","evt","#onOpen","message","data","parse","toString","handleMessage_objectSetChanged","handleMessage_refreshObjectSet","handleMessage_subscribeResponses","handleMessage_subscriptionClosed","objectUpdates","updates","update","referenceUpdates","osdkObjectsWithReferenceUpdates","all","o","osdkObjectArray","objectFactory2","__apiName","__primaryKey","primaryKey","property","value","fetchInterfaceMapping","singleOsdkObject","object","state","osdkObject","osdkObjects","keysToDelete","key","includes","#fetchInterfaceMapping","objectTypeApiName","interfaceMap","responses","subs","i","response","errors","shouldFireOutOfDate","#handleMessage_subscriptionClosed","has","cause","event","#cycleWebsocket","CLOSING","CLOSED","close","s","#tryCatchOnError","subscriptionClosed","onErrorError","console","base","URL","protocol","replace","uuidCounter","padStart"],"sources":["ObjectSetListenerWebsocket.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ObjectOrInterfaceDefinition,\n ObjectSetSubscription,\n Osdk,\n PropertyKeys,\n} from \"@osdk/api\";\nimport type {\n ObjectSet,\n ObjectSetStreamSubscribeRequest,\n ObjectSetStreamSubscribeRequests,\n ObjectSetSubscribeResponses,\n ObjectSetUpdates,\n ObjectState,\n RefreshObjectSet,\n StreamMessage,\n SubscriptionClosed,\n} from \"@osdk/foundry.ontologies\";\nimport WebSocket from \"isomorphic-ws\";\nimport invariant from \"tiny-invariant\";\nimport type { Logger } from \"../Logger.js\";\nimport type { ClientCacheKey, MinimalClient } from \"../MinimalClientContext.js\";\n\nconst MINIMUM_RECONNECT_DELAY_MS = 5 * 1000;\n\n/** Noop function to reduce conditional checks */\nfunction doNothing() {}\n\n/**\n * Converts an ObjectSetListener to one where all the functions are defined.\n */\nfunction fillOutListener<\n Q extends ObjectOrInterfaceDefinition,\n P extends PropertyKeys<Q>,\n>(\n {\n onChange = doNothing,\n onError = doNothing,\n onOutOfDate = doNothing,\n onSuccessfulSubscription = doNothing,\n }: ObjectSetSubscription.Listener<Q, P>,\n): Required<ObjectSetSubscription.Listener<Q, P>> {\n return { onChange, onError, onOutOfDate, onSuccessfulSubscription };\n}\n\ninterface Subscription<\n Q extends ObjectOrInterfaceDefinition,\n P extends PropertyKeys<Q>,\n> {\n listener: Required<ObjectSetSubscription.Listener<Q, P>>;\n requestedProperties: Array<P>;\n requestedReferenceProperties: Array<P>;\n objectSet: ObjectSet;\n\n subscriptionId: string;\n isReady?: boolean;\n status:\n | \"preparing\"\n | \"subscribed\"\n | \"done\"\n | \"expired\"\n | \"error\"\n | \"reconnecting\";\n\n interfaceApiName?: string;\n primaryKeyPropertyName?: string;\n}\n\nfunction isReady<\n Q extends ObjectOrInterfaceDefinition,\n P extends PropertyKeys<Q>,\n>(\n sub: Subscription<Q, P>,\n): sub is Subscription<Q, P> & { temporaryObjectSetId: string } {\n return sub.isReady != null;\n}\n\nfunction subscriptionIsDone(sub: Subscription<any, any>) {\n return sub.status === \"done\" || sub.status === \"error\";\n}\n\n/** @internal */\nexport class ObjectSetListenerWebsocket {\n static #instances = new WeakMap<\n ClientCacheKey,\n ObjectSetListenerWebsocket\n >();\n readonly MINIMUM_RECONNECT_DELAY_MS: number;\n\n // FIXME\n static getInstance(client: MinimalClient): ObjectSetListenerWebsocket {\n let instance = ObjectSetListenerWebsocket.#instances.get(\n client.clientCacheKey,\n );\n if (instance == null) {\n instance = new ObjectSetListenerWebsocket(client);\n ObjectSetListenerWebsocket.#instances.set(\n client.clientCacheKey,\n instance,\n );\n }\n return instance;\n }\n\n #ws: WebSocket | undefined;\n #lastWsConnect = 0;\n #client: MinimalClient;\n\n #logger?: Logger;\n\n /**\n * map of requestId to all active subscriptions at the time of the request\n */\n #pendingSubscriptions = new Map<\n string,\n Subscription<any, any>[]\n >();\n\n /**\n * Map of subscriptionId to Subscription. Note: the subscriptionId may be\n * temporary and not the actual subscriptionId from the server.\n */\n #subscriptions = new Map<\n string,\n Subscription<any, any>\n >();\n\n #endedSubscriptions = new Set<\n string\n >();\n\n #maybeDisconnectTimeout: ReturnType<typeof setTimeout> | undefined;\n\n // DO NOT CONSTRUCT DIRECTLY. ONLY EXPOSED AS A TESTING SEAM\n constructor(\n client: MinimalClient,\n {\n minimumReconnectDelayMs = MINIMUM_RECONNECT_DELAY_MS,\n } = {},\n ) {\n this.MINIMUM_RECONNECT_DELAY_MS = minimumReconnectDelayMs;\n this.#client = client;\n this.#logger = client.logger?.child({}, {\n msgPrefix: \"<OSW> \",\n });\n invariant(\n client.baseUrl.startsWith(\"https://\")\n || client.baseUrl.startsWith(\"http://\"),\n \"Stack must be a URL\",\n );\n }\n\n async subscribe<\n Q extends ObjectOrInterfaceDefinition,\n P extends PropertyKeys<Q>,\n >(\n objectType: ObjectOrInterfaceDefinition,\n objectSet: ObjectSet,\n listener: ObjectSetSubscription.Listener<Q, P>,\n properties: Array<P> = [],\n ): Promise<() => void> {\n const objOrInterfaceDef = objectType.type === \"object\"\n ? await this.#client.ontologyProvider.getObjectDefinition(\n objectType.apiName,\n )\n : await this.#client.ontologyProvider.getInterfaceDefinition(\n objectType.apiName,\n );\n\n let objectProperties: Array<P> = [];\n let referenceProperties: Array<P> = [];\n\n if (properties.length === 0) {\n properties = Object.keys(objOrInterfaceDef.properties) as Array<P>;\n }\n\n objectProperties = properties.filter((p) =>\n objOrInterfaceDef.properties[p].type !== \"geotimeSeriesReference\"\n );\n\n referenceProperties = properties.filter((p) =>\n objOrInterfaceDef.properties[p].type === \"geotimeSeriesReference\"\n );\n\n const sub: Subscription<Q, P> = {\n listener: fillOutListener<Q, P>(listener),\n objectSet,\n primaryKeyPropertyName: objOrInterfaceDef.type === \"interface\"\n ? undefined\n : objOrInterfaceDef.primaryKeyApiName,\n requestedProperties: objectProperties,\n requestedReferenceProperties: referenceProperties,\n status: \"preparing\",\n // Since we don't have a real subscription id yet but we need to keep\n // track of this reference, we can just use a random uuid.\n subscriptionId: `TMP-${nextUuid()}}`,\n interfaceApiName: objOrInterfaceDef.type === \"object\"\n ? undefined\n : objOrInterfaceDef.apiName,\n };\n\n this.#subscriptions.set(sub.subscriptionId, sub);\n\n // actually prepares the subscription, ensures the ws is ready, and sends\n // a subscribe message. We don't want to block on this.\n void this.#initiateSubscribe(sub);\n\n return () => {\n this.#unsubscribe(sub);\n };\n }\n\n /**\n * Called at least once for every subscription.\n *\n * - Resets pending expiry\n * - Recreates temporary object set\n * - Triggers a full subscribe message\n *\n * @returns\n */\n async #initiateSubscribe(sub: Subscription<any, any>) {\n if (process.env.NODE_ENV !== \"production\") {\n this.#logger?.trace(\"#initiateSubscribe()\");\n }\n\n try {\n await this.#ensureWebsocket();\n\n // the consumer may have already unsubscribed before we are ready to request a subscription\n // so we have to acquire the pendingSubscription after the await.\n if (subscriptionIsDone(sub)) {\n return;\n }\n sub.isReady = true;\n // if we aren't open, then this happens after we #onConnect\n if (this.#ws?.readyState === WebSocket.OPEN) {\n this.#sendSubscribeMessage();\n }\n } catch (error) {\n this.#logger?.error(error, \"Error in #initiateSubscribe\");\n this.#tryCatchOnError(sub, true, error);\n }\n }\n\n #sendSubscribeMessage() {\n if (process.env.NODE_ENV !== \"production\") {\n this.#logger?.trace(\"#sendSubscribeMessage()\");\n }\n // If two calls to `.subscribe()` happen at once (or if the connection is reset),\n // we may have multiple subscriptions that don't have a subscriptionId yet,\n // so we filter those out.\n const readySubs = [...this.#subscriptions.values()].filter(isReady);\n\n const id = nextUuid();\n // responses come back as an array of subIds, so we need to know the sources\n this.#pendingSubscriptions.set(id, readySubs);\n\n // every subscribe message \"overwrites\" the previous ones that are not\n // re-included, so we have to reconstitute the entire list of subscriptions\n const subscribe: ObjectSetStreamSubscribeRequests = {\n id,\n requests: readySubs.map<ObjectSetStreamSubscribeRequest>((\n {\n objectSet,\n requestedProperties,\n requestedReferenceProperties,\n interfaceApiName,\n },\n ) => {\n return {\n objectSet: objectSet,\n propertySet: requestedProperties,\n referenceSet: requestedReferenceProperties,\n };\n }),\n };\n\n if (process.env.NODE_ENV !== \"production\") {\n this.#logger?.trace(\n { payload: subscribe },\n \"sending subscribe message\",\n );\n }\n this.#ws?.send(JSON.stringify(subscribe));\n }\n\n #unsubscribe<Q extends ObjectOrInterfaceDefinition>(\n sub: Subscription<Q, any>,\n newStatus: \"done\" | \"error\" = \"done\",\n ) {\n if (subscriptionIsDone(sub)) {\n // if we are already done, we don't need to do anything\n return;\n }\n\n sub.status = newStatus;\n\n // make sure listeners do nothing now\n sub.listener = fillOutListener<Q, any>({});\n\n this.#subscriptions.delete(sub.subscriptionId);\n this.#endedSubscriptions.add(sub.subscriptionId);\n this.#sendSubscribeMessage();\n\n // If we have no more subscriptions, we can disconnect the websocket\n // however we should wait a bit to see if we get any more subscriptions.\n // For example, when switching between react views, you may unsubscribe\n // in the old view and subscribe in the new view. We don't need to re-establish\n // the websocket connection in that case.\n if (this.#maybeDisconnectTimeout) {\n // We reset the timeout on every unsubscribe so its always at least 15s from\n // the last time we are empty. E.g.:\n // - 0s: Subscribe(A)\n // - 10s: Unsubscribe(A)\n // - 11s: Subscribe(B)\n // - 20s: Unsubscribe(B)\n // If we do not clear out the timeout we would disconnect at 25s but that would only be\n // 5s after the last subscription was removed instead of at 35s for the desired 15s.\n clearTimeout(this.#maybeDisconnectTimeout);\n }\n this.#maybeDisconnectTimeout = setTimeout(() => {\n this.#maybeDisconnectTimeout = undefined;\n if (this.#subscriptions.size === 0) {\n this.#cycleWebsocket();\n }\n }, 15_000 /* ms */);\n }\n\n async #ensureWebsocket() {\n if (this.#ws == null) {\n const { baseUrl, tokenProvider } = this.#client;\n const url = constructWebsocketUrl(\n baseUrl,\n await this.#client.ontologyRid,\n );\n\n const token = await tokenProvider();\n\n // tokenProvider is async, there could potentially be a race to create the websocket.\n // Only the first call to reach here will find a null this.#ws, the rest will bail out\n if (this.#ws == null) {\n // TODO this can probably be exponential backoff with jitter\n // don't reconnect more quickly than MINIMUM_RECONNECT_DELAY\n const nextConnectTime = (this.#lastWsConnect ?? 0)\n + this.MINIMUM_RECONNECT_DELAY_MS;\n if (nextConnectTime > Date.now()) {\n await new Promise((resolve) => {\n setTimeout(resolve, nextConnectTime - Date.now());\n });\n }\n\n this.#lastWsConnect = Date.now();\n\n // we again may have lost the race after our minimum backoff time\n if (this.#ws == null) {\n if (process.env.NODE_ENV !== \"production\") {\n this.#logger?.trace(\"Creating websocket\");\n }\n this.#ws = new WebSocket(url, [`Bearer-${token}`]);\n this.#ws.addEventListener(\"close\", this.#onClose);\n this.#ws.addEventListener(\"message\", this.#onMessage);\n this.#ws.addEventListener(\"open\", this.#onOpen);\n }\n }\n // Allow await-ing the websocket open event if it isn't open already.\n // This needs to happen even for callers that didn't just create this.#ws\n if (this.#ws.readyState === WebSocket.CONNECTING) {\n const ws = this.#ws;\n return new Promise<void>((resolve, reject) => {\n function cleanup() {\n ws.removeEventListener(\"open\", open);\n ws.removeEventListener(\"error\", error);\n ws.removeEventListener(\"close\", cleanup);\n }\n function open() {\n cleanup();\n resolve();\n }\n function error(evt: unknown) {\n cleanup();\n reject(evt);\n }\n ws.addEventListener(\"open\", open);\n ws.addEventListener(\"error\", error);\n ws.addEventListener(\"close\", cleanup);\n });\n }\n }\n }\n\n #onOpen = () => {\n // resubscribe all of the listeners\n this.#sendSubscribeMessage();\n };\n\n #onMessage = async (message: WebSocket.MessageEvent) => {\n const data = JSON.parse(message.data.toString()) as StreamMessage;\n if (process.env.NODE_ENV !== \"production\") {\n this.#logger?.trace({ payload: data }, \"received message from ws\");\n }\n switch (data.type) {\n case \"objectSetChanged\":\n return void this.#handleMessage_objectSetChanged(data);\n\n case \"refreshObjectSet\":\n return void this.#handleMessage_refreshObjectSet(data);\n\n case \"subscribeResponses\":\n return void this.#handleMessage_subscribeResponses(data);\n\n case \"subscriptionClosed\": {\n return void this.#handleMessage_subscriptionClosed(data);\n }\n\n default:\n const _: never = data;\n invariant(false, \"Unexpected message type\");\n }\n };\n\n #handleMessage_objectSetChanged = async (\n payload: ObjectSetUpdates,\n ) => {\n const sub = this.#subscriptions.get(payload.id);\n if (sub == null) return;\n\n const objectUpdates = payload.updates.filter((update) =>\n update.type === \"object\"\n );\n const referenceUpdates = payload.updates.filter((update) =>\n update.type === \"reference\"\n );\n const osdkObjectsWithReferenceUpdates = await Promise.all(\n referenceUpdates.map(async (o) => {\n const osdkObjectArray = await this.#client.objectFactory2(\n this.#client,\n [{\n __apiName: o.objectType,\n __primaryKey: sub.primaryKeyPropertyName != null\n ? o.primaryKey[sub.primaryKeyPropertyName]\n : undefined,\n ...o.primaryKey,\n [o.property]: o.value,\n }],\n sub.interfaceApiName,\n false,\n undefined,\n false,\n await this.#fetchInterfaceMapping(\n o.objectType,\n sub.interfaceApiName,\n ),\n ) as Array<Osdk.Instance<any, never, any>>;\n const singleOsdkObject = osdkObjectArray[0] ?? undefined;\n return singleOsdkObject != null\n ? {\n object: singleOsdkObject,\n state: \"ADDED_OR_UPDATED\" as ObjectState,\n }\n : undefined;\n }),\n );\n\n for (const osdkObject of osdkObjectsWithReferenceUpdates) {\n if (osdkObject != null) {\n try {\n sub.listener.onChange?.(osdkObject);\n } catch (error) {\n this.#logger?.error(error, \"Error in onChange callback\");\n this.#tryCatchOnError(sub, false, error);\n }\n }\n }\n\n const osdkObjects = await Promise.all(objectUpdates.map(async (o) => {\n const keysToDelete = Object.keys(o.object).filter((key) =>\n sub.requestedReferenceProperties.includes(key)\n );\n for (const key of keysToDelete) {\n delete o.object[key];\n }\n\n const osdkObjectArray = await this.#client.objectFactory2(\n this.#client,\n [o.object],\n sub.interfaceApiName,\n false,\n undefined,\n false,\n await this.#fetchInterfaceMapping(\n o.object.__apiName,\n sub.interfaceApiName,\n ),\n ) as Array<Osdk.Instance<any, never, any>>;\n const singleOsdkObject = osdkObjectArray[0] ?? undefined;\n return singleOsdkObject != null\n ? {\n object: singleOsdkObject,\n state: o.state,\n }\n : undefined;\n }));\n\n for (const osdkObject of osdkObjects) {\n if (osdkObject != null) {\n try {\n sub.listener.onChange?.(osdkObject);\n } catch (error) {\n this.#logger?.error(error, \"Error in onChange callback\");\n this.#tryCatchOnError(sub, false, error);\n }\n }\n }\n };\n\n async #fetchInterfaceMapping(\n objectTypeApiName: string,\n interfaceApiName: string | undefined,\n ): Promise<Record<string, Record<string, Record<string, string>>>> {\n if (interfaceApiName == null) return {};\n const interfaceMap = (await this.#client.ontologyProvider\n .getObjectDefinition(objectTypeApiName)).interfaceMap;\n return {\n [interfaceApiName]: {\n [objectTypeApiName]: interfaceMap[interfaceApiName],\n },\n };\n }\n\n #handleMessage_refreshObjectSet = (payload: RefreshObjectSet) => {\n const sub = this.#subscriptions.get(payload.id);\n invariant(sub, `Expected subscription id ${payload.id}`);\n try {\n sub.listener.onOutOfDate();\n } catch (error) {\n this.#logger?.error(error, \"Error in onOutOfDate callback\");\n this.#tryCatchOnError(sub, false, error);\n }\n };\n\n #handleMessage_subscribeResponses = (\n payload: ObjectSetSubscribeResponses,\n ) => {\n const { id, responses } = payload;\n\n const subs = this.#pendingSubscriptions.get(id);\n invariant(subs, `should have a pending subscription for ${id}`);\n this.#pendingSubscriptions.delete(id);\n\n for (let i = 0; i < responses.length; i++) {\n const sub = subs[i];\n const response = responses[i];\n\n switch (response.type) {\n case \"error\":\n this.#tryCatchOnError(sub, true, response.errors);\n this.#unsubscribe(sub, \"error\");\n break;\n\n case \"qos\":\n // the server has requested that we tear down our websocket and reconnect to help load balance\n this.#cycleWebsocket();\n break;\n\n case \"success\":\n // `\"preparing\"` should only be the status on an initial subscribe.\n const shouldFireOutOfDate = sub.status === \"expired\"\n || sub.status === \"reconnecting\";\n\n if (process.env.NODE_ENV !== \"production\") {\n this.#logger?.trace({ shouldFireOutOfDate }, \"success\");\n }\n sub.status = \"subscribed\";\n if (sub.subscriptionId !== response.id) {\n // might be the temporary one\n this.#subscriptions.delete(sub.subscriptionId);\n sub.subscriptionId = response.id;\n this.#subscriptions.set(sub.subscriptionId, sub); // future messages come by this subId\n }\n try {\n if (shouldFireOutOfDate) sub.listener.onOutOfDate();\n else sub.listener.onSuccessfulSubscription();\n } catch (error) {\n this.#logger?.error(\n error,\n \"Error in onOutOfDate or onSuccessfulSubscription callback\",\n );\n this.#tryCatchOnError(sub, false, error);\n }\n break;\n default:\n this.#tryCatchOnError(sub, true, response);\n }\n }\n };\n\n #handleMessage_subscriptionClosed(payload: SubscriptionClosed) {\n const sub = this.#subscriptions.get(payload.id);\n if (sub == null && this.#endedSubscriptions.has(payload.id)) return;\n invariant(sub, `Expected subscription id ${payload.id}`);\n this.#tryCatchOnError(sub, true, payload.cause);\n this.#unsubscribe(sub, \"error\");\n }\n\n #onClose = (event: WebSocket.CloseEvent) => {\n if (process.env.NODE_ENV !== \"production\") {\n this.#logger?.trace({ event }, \"Received close event from ws\", event);\n }\n // TODO we should probably throttle this so we don't abuse the backend\n this.#cycleWebsocket();\n };\n\n #cycleWebsocket = () => {\n if (this.#ws) {\n this.#ws.removeEventListener(\"open\", this.#onOpen);\n this.#ws.removeEventListener(\"message\", this.#onMessage);\n this.#ws.removeEventListener(\"close\", this.#onClose);\n\n if (\n this.#ws.readyState !== WebSocket.CLOSING\n && this.#ws.readyState !== WebSocket.CLOSED\n ) {\n this.#ws.close();\n }\n this.#ws = undefined;\n }\n\n // if we have any listeners that are still depending on us, go ahead and reopen the websocket\n if (this.#subscriptions.size > 0) {\n if (process.env.NODE_ENV !== \"production\") {\n for (const s of this.#subscriptions.values()) {\n invariant(\n s.status !== \"done\" && s.status !== \"error\",\n \"should not have done/error subscriptions still\",\n );\n }\n }\n\n for (const s of this.#subscriptions.values()) {\n if (s.status === \"subscribed\") s.status = \"reconnecting\";\n }\n\n // we don't care about the result of this (we want cycleWebsocket to be fire and forget)\n // just that it happens\n void this.#ensureWebsocket();\n }\n };\n\n #tryCatchOnError = (\n sub: Subscription<any, any>,\n subscriptionClosed: boolean,\n error: any,\n ) => {\n try {\n sub.listener.onError({ subscriptionClosed: subscriptionClosed, error });\n } catch (onErrorError) {\n // eslint-disable-next-line no-console\n console.error(\n `Error encountered in an onError callback for an OSDK subscription`,\n onErrorError,\n );\n // eslint-disable-next-line no-console\n console.error(\n `This onError call was triggered by an error in another callback`,\n error,\n );\n // eslint-disable-next-line no-console\n console.error(\n `The subscription has been closed.`,\n error,\n );\n\n if (!subscriptionClosed) {\n this.#logger?.error(error, \"Error in onError callback\");\n this.#unsubscribe(sub, \"error\");\n this.#tryCatchOnError(sub, true, onErrorError);\n }\n }\n };\n}\n\n/** @internal */\nexport function constructWebsocketUrl(\n baseUrl: string,\n ontologyRid: string,\n) {\n const base = new URL(baseUrl);\n const url = new URL(\n `api/v2/ontologySubscriptions/ontologies/${ontologyRid}/streamSubscriptions`,\n base,\n );\n url.protocol = url.protocol.replace(\"https\", \"wss\");\n return url;\n}\n\nlet uuidCounter = 0;\n\nfunction nextUuid() {\n return `00000000-0000-0000-0000-${\n (uuidCounter++).toString().padStart(12, \"0\")\n }`;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAmBA,OAAOA,SAAS,MAAM,eAAe;AACrC,OAAOC,SAAS,MAAM,gBAAgB;AAItC,MAAMC,0BAA0B,GAAG,CAAC,GAAG,IAAI;;AAE3C;AACA,SAASC,SAASA,CAAA,EAAG,CAAC;;AAEtB;AACA;AACA;AACA,SAASC,eAAeA,CAItB;EACEC,QAAQ,GAAGF,SAAS;EACpBG,OAAO,GAAGH,SAAS;EACnBI,WAAW,GAAGJ,SAAS;EACvBK,wBAAwB,GAAGL;AACS,CAAC,EACS;EAChD,OAAO;IAAEE,QAAQ;IAAEC,OAAO;IAAEC,WAAW;IAAEC;EAAyB,CAAC;AACrE;AAyBA,SAASC,OAAOA,CAIdC,GAAuB,EACuC;EAC9D,OAAOA,GAAG,CAACD,OAAO,IAAI,IAAI;AAC5B;AAEA,SAASE,kBAAkBA,CAACD,GAA2B,EAAE;EACvD,OAAOA,GAAG,CAACE,MAAM,KAAK,MAAM,IAAIF,GAAG,CAACE,MAAM,KAAK,OAAO;AACxD;;AAEA;AACA,OAAO,MAAMC,0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