@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,20 +13,25 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
|
|
17
|
+
import * as OntologiesV2 from "@osdk/foundry.ontologies";
|
|
17
18
|
import { addUserAgentAndRequestContextHeaders } from "../util/addUserAgentAndRequestContextHeaders.js";
|
|
18
|
-
import {
|
|
19
|
+
import { resolveBaseObjectSetType } from "../util/objectSetUtils.js";
|
|
19
20
|
export function augment(type, ...properties) {
|
|
20
21
|
return {
|
|
21
22
|
[type.apiName]: properties
|
|
22
23
|
};
|
|
23
24
|
}
|
|
25
|
+
|
|
24
26
|
/** @internal */
|
|
25
27
|
export function objectSetToSearchJsonV2(objectSet, expectedApiName, existingWhere = undefined) {
|
|
26
|
-
if (objectSet.type === "base") {
|
|
27
|
-
if (objectSet.objectType !== expectedApiName) {
|
|
28
|
+
if (objectSet.type === "base" || objectSet.type === "interfaceBase") {
|
|
29
|
+
if (objectSet.type === "base" && objectSet.objectType !== expectedApiName) {
|
|
28
30
|
throw new Error(`Expected objectSet.objectType to be ${expectedApiName}, but got ${objectSet.objectType}`);
|
|
29
31
|
}
|
|
32
|
+
if (objectSet.type === "interfaceBase" && objectSet.interfaceType !== expectedApiName) {
|
|
33
|
+
throw new Error(`Expected objectSet.objectType to be ${expectedApiName}, but got ${objectSet.interfaceType}`);
|
|
34
|
+
}
|
|
30
35
|
return existingWhere;
|
|
31
36
|
}
|
|
32
37
|
if (objectSet.type === "filter") {
|
|
@@ -38,21 +43,36 @@ export function objectSetToSearchJsonV2(objectSet, expectedApiName, existingWher
|
|
|
38
43
|
throw new Error(`Unsupported objectSet type: ${objectSet.type}`);
|
|
39
44
|
}
|
|
40
45
|
async function fetchInterfacePage(client, interfaceType, args, objectSet) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
if (args.$__UNSTABLE_useOldInterfaceApis) {
|
|
47
|
+
const result = await OntologiesV2.OntologyInterfaces.search(addUserAgentAndRequestContextHeaders(client, interfaceType), await client.ontologyRid, interfaceType.apiName, applyFetchArgs(args, {
|
|
48
|
+
augmentedProperties: {},
|
|
49
|
+
augmentedSharedPropertyTypes: {},
|
|
50
|
+
otherInterfaceTypes: [],
|
|
51
|
+
selectedObjectTypes: [],
|
|
52
|
+
selectedSharedPropertyTypes: args.$select ?? [],
|
|
53
|
+
where: objectSetToSearchJsonV2(objectSet, interfaceType.apiName)
|
|
54
|
+
}), {
|
|
55
|
+
preview: true
|
|
56
|
+
});
|
|
57
|
+
result.data = await client.objectFactory(client, result.data,
|
|
58
|
+
// drop readonly
|
|
59
|
+
interfaceType.apiName, !args.$includeRid);
|
|
60
|
+
return result;
|
|
61
|
+
}
|
|
62
|
+
const result = await OntologiesV2.OntologyObjectSets.loadMultipleObjectTypes(addUserAgentAndRequestContextHeaders(client, interfaceType), await client.ontologyRid, applyFetchArgs(args, {
|
|
63
|
+
objectSet,
|
|
64
|
+
select: args?.$select ?? [],
|
|
65
|
+
excludeRid: !args?.$includeRid
|
|
48
66
|
}), {
|
|
49
67
|
preview: true
|
|
50
68
|
});
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
69
|
+
return Promise.resolve({
|
|
70
|
+
data: await client.objectFactory2(client, result.data, interfaceType.apiName, !args.$includeRid, args.$select, false, result.interfaceToObjectTypeMappings),
|
|
71
|
+
nextPageToken: result.nextPageToken,
|
|
72
|
+
totalCount: result.totalCount
|
|
73
|
+
});
|
|
55
74
|
}
|
|
75
|
+
|
|
56
76
|
/** @internal */
|
|
57
77
|
export async function fetchPageInternal(client, objectType, objectSet, args = {}) {
|
|
58
78
|
if (objectType.type === "interface") {
|
|
@@ -61,6 +81,7 @@ export async function fetchPageInternal(client, objectType, objectSet, args = {}
|
|
|
61
81
|
return await fetchObjectPage(client, objectType, args, objectSet); // fixme
|
|
62
82
|
}
|
|
63
83
|
}
|
|
84
|
+
|
|
64
85
|
/** @internal */
|
|
65
86
|
export async function fetchPageWithErrorsInternal(client, objectType, objectSet, args = {}) {
|
|
66
87
|
try {
|
|
@@ -79,6 +100,7 @@ export async function fetchPageWithErrorsInternal(client, objectType, objectSet,
|
|
|
79
100
|
};
|
|
80
101
|
}
|
|
81
102
|
}
|
|
103
|
+
|
|
82
104
|
/**
|
|
83
105
|
* @param client
|
|
84
106
|
* @param objectType
|
|
@@ -87,17 +109,12 @@ export async function fetchPageWithErrorsInternal(client, objectType, objectSet,
|
|
|
87
109
|
* @returns
|
|
88
110
|
* @internal
|
|
89
111
|
*/
|
|
90
|
-
export async function fetchPage(client, objectType, args, objectSet = {
|
|
91
|
-
type: "base",
|
|
92
|
-
objectType: objectType["apiName"]
|
|
93
|
-
}) {
|
|
112
|
+
export async function fetchPage(client, objectType, args, objectSet = resolveBaseObjectSetType(objectType)) {
|
|
94
113
|
return fetchPageInternal(client, objectType, objectSet, args);
|
|
95
114
|
}
|
|
115
|
+
|
|
96
116
|
/** @internal */
|
|
97
|
-
export async function fetchPageWithErrors(client, objectType, args, objectSet = {
|
|
98
|
-
type: "base",
|
|
99
|
-
objectType: objectType["apiName"]
|
|
100
|
-
}) {
|
|
117
|
+
export async function fetchPageWithErrors(client, objectType, args, objectSet = resolveBaseObjectSetType(objectType)) {
|
|
101
118
|
return fetchPageWithErrorsInternal(client, objectType, objectSet, args);
|
|
102
119
|
}
|
|
103
120
|
function applyFetchArgs(args, body) {
|
|
@@ -117,6 +134,7 @@ function applyFetchArgs(args, body) {
|
|
|
117
134
|
}
|
|
118
135
|
return body;
|
|
119
136
|
}
|
|
137
|
+
|
|
120
138
|
/** @internal */
|
|
121
139
|
export async function fetchObjectPage(client, objectType, args, objectSet) {
|
|
122
140
|
const r = await OntologiesV2.OntologyObjectSets.load(addUserAgentAndRequestContextHeaders(client, objectType), await client.ontologyRid, applyFetchArgs(args, {
|
|
@@ -127,7 +145,7 @@ export async function fetchObjectPage(client, objectType, args, objectSet) {
|
|
|
127
145
|
excludeRid: !args?.$includeRid
|
|
128
146
|
}));
|
|
129
147
|
return Promise.resolve({
|
|
130
|
-
data: await
|
|
148
|
+
data: await client.objectFactory(client, r.data, undefined, undefined, args.$select),
|
|
131
149
|
nextPageToken: r.nextPageToken,
|
|
132
150
|
totalCount: r.totalCount
|
|
133
151
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchPage.js","names":["OntologiesV2","addUserAgentAndRequestContextHeaders","convertWireToOsdkObjects","augment","type","properties","apiName","objectSetToSearchJsonV2","objectSet","expectedApiName","existingWhere","undefined","objectType","Error","where","value","fetchInterfacePage","client","interfaceType","args","result","OntologyInterfaces","search","ontologyRid","applyFetchArgs","augmentedProperties","augmentedSharedPropertyTypes","otherInterfaceTypes","selectedObjectTypes","selectedSharedPropertyTypes","$select","preview","data","$includeRid","fetchPageInternal","fetchObjectPage","fetchPageWithErrorsInternal","e","error","fetchPage","fetchPageWithErrors","body","$nextPageToken","pageToken","$pageSize","pageSize","$orderBy","orderBy","fields","Object","entries","map","field","direction","r","OntologyObjectSets","load","select","excludeRid","Promise","resolve","nextPageToken","totalCount"],"sources":["fetchPage.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 * as OntologiesV2 from \"@osdk/internal.foundry.ontologiesv2\";\nimport { addUserAgentAndRequestContextHeaders } from \"../util/addUserAgentAndRequestContextHeaders.js\";\nimport { convertWireToOsdkObjects } from \"./convertWireToOsdkObjects.js\";\nexport function augment(type, ...properties) {\n return { [type.apiName]: properties };\n}\n/** @internal */\nexport function objectSetToSearchJsonV2(objectSet, expectedApiName, existingWhere = undefined) {\n if (objectSet.type === \"base\") {\n if (objectSet.objectType !== expectedApiName) {\n throw new Error(`Expected objectSet.objectType to be ${expectedApiName}, but got ${objectSet.objectType}`);\n }\n return existingWhere;\n }\n if (objectSet.type === \"filter\") {\n return objectSetToSearchJsonV2(objectSet.objectSet, expectedApiName, existingWhere == null ? objectSet.where : {\n type: \"and\",\n value: [existingWhere, objectSet.where],\n });\n }\n throw new Error(`Unsupported objectSet type: ${objectSet.type}`);\n}\nasync function fetchInterfacePage(client, interfaceType, args, objectSet) {\n const result = await OntologiesV2.OntologyInterfaces\n .search(addUserAgentAndRequestContextHeaders(client, interfaceType), await client.ontologyRid, interfaceType.apiName, applyFetchArgs(args, {\n augmentedProperties: {},\n augmentedSharedPropertyTypes: {},\n otherInterfaceTypes: [],\n selectedObjectTypes: [],\n selectedSharedPropertyTypes: args.$select ?? [],\n where: objectSetToSearchJsonV2(objectSet, interfaceType.apiName),\n }), { preview: true });\n result.data = await convertWireToOsdkObjects(client, result.data, // drop readonly\n interfaceType.apiName, !args.$includeRid);\n return result;\n}\n/** @internal */\nexport async function fetchPageInternal(client, objectType, objectSet, args = {}) {\n if (objectType.type === \"interface\") {\n return await fetchInterfacePage(client, objectType, args, objectSet); // fixme\n }\n else {\n return await fetchObjectPage(client, objectType, args, objectSet); // fixme\n }\n}\n/** @internal */\nexport async function fetchPageWithErrorsInternal(client, objectType, objectSet, args = {}) {\n try {\n const result = await fetchPageInternal(client, objectType, objectSet, args);\n return { value: result };\n }\n catch (e) {\n if (e instanceof Error) {\n return { error: e };\n }\n return { error: e };\n }\n}\n/**\n * @param client\n * @param objectType\n * @param args\n * @param objectSet\n * @returns\n * @internal\n */\nexport async function fetchPage(client, objectType, args, objectSet = {\n type: \"base\",\n objectType: objectType[\"apiName\"],\n}) {\n return fetchPageInternal(client, objectType, objectSet, args);\n}\n/** @internal */\nexport async function fetchPageWithErrors(client, objectType, args, objectSet = {\n type: \"base\",\n objectType: objectType[\"apiName\"],\n}) {\n return fetchPageWithErrorsInternal(client, objectType, objectSet, args);\n}\nfunction applyFetchArgs(args, body) {\n if (args?.$nextPageToken) {\n body.pageToken = args.$nextPageToken;\n }\n if (args?.$pageSize != null) {\n body.pageSize = args.$pageSize;\n }\n if (args?.$orderBy != null) {\n body.orderBy = {\n fields: Object.entries(args.$orderBy).map(([field, direction]) => ({\n field,\n direction,\n })),\n };\n }\n return body;\n}\n/** @internal */\nexport async function fetchObjectPage(client, objectType, args, objectSet) {\n const r = await OntologiesV2.OntologyObjectSets.load(addUserAgentAndRequestContextHeaders(client, objectType), await client.ontologyRid, applyFetchArgs(args, {\n objectSet,\n // We have to do the following case because LoadObjectSetRequestV2 isn't readonly\n select: (args?.$select ?? []), // FIXME?\n excludeRid: !args?.$includeRid,\n }));\n return Promise.resolve({\n data: await convertWireToOsdkObjects(client, r.data, undefined, undefined, args.$select),\n nextPageToken: r.nextPageToken,\n totalC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AAC;EACL;EACA,OAAOZ,IAAI;AACf;AACA;AACA,OAAO,eAAeN,eAAeA,CAAClB,MAAM,EAAEL,UAAU,EAAEO,IAAI,EAAEX,SAAS,EAAE;EACvE,MAAM8C,CAAC,GAAG,MAAMtD,YAAY,CAACuD,kBAAkB,CAACC,IAAI,CAACvD,oCAAoC,CAACgB,MAAM,EAAEL,UAAU,CAAC,EAAE,MAAMK,MAAM,CAACM,WAAW,EAAEC,cAAc,CAACL,IAAI,EAAE;IAC1JX,SAAS;IACT;IACAiD,MAAM,EAAGtC,IAAI,EAAEW,OAAO,IAAI,EAAG;IAAE;IAC/B4B,UAAU,EAAE,CAACvC,IAAI,EAAEc;EACvB,CAAC,CAAC,CAAC;EACH,OAAO0B,OAAO,CAACC,OAAO,CAAC;IACnB5B,IAAI,EAAE,MAAM9B,wBAAwB,CAACe,MAAM,EAAEqC,CAAC,CAACtB,IAAI,EAAErB,SAAS,EAAEA,SAAS,EAAEQ,IAAI,CAACW,OAAO,CAAC;IACxF+B,aAAa,EAAEP,CAAC,CAACO,aAAa;IAC9BC,UAAU,EAAER,CAAC,CAACQ;EAClB,CAAC,CAAC;AACN","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"fetchPage.js","names":["OntologiesV2","addUserAgentAndRequestContextHeaders","resolveBaseObjectSetType","augment","type","properties","apiName","objectSetToSearchJsonV2","objectSet","expectedApiName","existingWhere","undefined","objectType","Error","interfaceType","where","value","fetchInterfacePage","client","args","$__UNSTABLE_useOldInterfaceApis","result","OntologyInterfaces","search","ontologyRid","applyFetchArgs","augmentedProperties","augmentedSharedPropertyTypes","otherInterfaceTypes","selectedObjectTypes","selectedSharedPropertyTypes","$select","preview","data","objectFactory","$includeRid","OntologyObjectSets","loadMultipleObjectTypes","select","excludeRid","Promise","resolve","objectFactory2","interfaceToObjectTypeMappings","nextPageToken","totalCount","fetchPageInternal","fetchObjectPage","fetchPageWithErrorsInternal","e","error","fetchPage","fetchPageWithErrors","body","$nextPageToken","pageToken","$pageSize","pageSize","$orderBy","orderBy","fields","Object","entries","map","field","direction","r","load"],"sources":["fetchPage.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 Augment,\n Augments,\n FetchPageArgs,\n FetchPageResult,\n InterfaceDefinition,\n NullabilityAdherence,\n ObjectOrInterfaceDefinition,\n ObjectTypeDefinition,\n PropertyKeys,\n Result,\n} from \"@osdk/api\";\nimport type { PageSize, PageToken } from \"@osdk/foundry.core\";\nimport type {\n LoadObjectSetRequestV2,\n LoadObjectSetV2MultipleObjectTypesRequest,\n ObjectSet,\n OntologyObjectV2,\n SearchJsonQueryV2,\n SearchObjectsForInterfaceRequest,\n SearchOrderByV2,\n} from \"@osdk/foundry.ontologies\";\nimport * as OntologiesV2 from \"@osdk/foundry.ontologies\";\nimport type { MinimalClient } from \"../MinimalClientContext.js\";\nimport { addUserAgentAndRequestContextHeaders } from \"../util/addUserAgentAndRequestContextHeaders.js\";\nimport { resolveBaseObjectSetType } from \"../util/objectSetUtils.js\";\n\nexport function augment<\n Q extends ObjectOrInterfaceDefinition,\n T extends PropertyKeys<Q>,\n>(\n type: Q,\n ...properties: T[]\n): Augment<Q, T> {\n return { [type.apiName]: properties } as any;\n}\n\n/** @internal */\nexport function objectSetToSearchJsonV2(\n objectSet: ObjectSet,\n expectedApiName: string,\n existingWhere: SearchJsonQueryV2 | undefined = undefined,\n): SearchJsonQueryV2 | undefined {\n if (objectSet.type === \"base\" || objectSet.type === \"interfaceBase\") {\n if (objectSet.type === \"base\" && objectSet.objectType !== expectedApiName) {\n throw new Error(\n `Expected objectSet.objectType to be ${expectedApiName}, but got ${objectSet.objectType}`,\n );\n }\n if (\n objectSet.type === \"interfaceBase\"\n && objectSet.interfaceType !== expectedApiName\n ) {\n throw new Error(\n `Expected objectSet.objectType to be ${expectedApiName}, but got ${objectSet.interfaceType}`,\n );\n }\n\n return existingWhere;\n }\n\n if (objectSet.type === \"filter\") {\n return objectSetToSearchJsonV2(\n objectSet.objectSet,\n expectedApiName,\n existingWhere == null ? objectSet.where : {\n type: \"and\",\n value: [existingWhere, objectSet.where],\n },\n );\n }\n\n throw new Error(`Unsupported objectSet type: ${objectSet.type}`);\n}\n\nasync function fetchInterfacePage<\n Q extends InterfaceDefinition,\n L extends PropertyKeys<Q>,\n R extends boolean,\n S extends NullabilityAdherence,\n>(\n client: MinimalClient,\n interfaceType: Q,\n args: FetchPageArgs<Q, L, R, any, S>,\n objectSet: ObjectSet,\n): Promise<FetchPageResult<Q, L, R, S>> {\n if (args.$__UNSTABLE_useOldInterfaceApis) {\n const result = await OntologiesV2.OntologyInterfaces\n .search(\n addUserAgentAndRequestContextHeaders(client, interfaceType),\n await client.ontologyRid,\n interfaceType.apiName,\n applyFetchArgs<SearchObjectsForInterfaceRequest>(args, {\n augmentedProperties: {},\n augmentedSharedPropertyTypes: {},\n otherInterfaceTypes: [],\n selectedObjectTypes: [],\n selectedSharedPropertyTypes: args.$select as undefined | string[]\n ?? [],\n where: objectSetToSearchJsonV2(objectSet, interfaceType.apiName),\n }),\n { preview: true },\n );\n\n result.data = await client.objectFactory(\n client,\n result.data as OntologyObjectV2[], // drop readonly\n interfaceType.apiName,\n !args.$includeRid,\n );\n return result as any;\n }\n const result = await OntologiesV2.OntologyObjectSets.loadMultipleObjectTypes(\n addUserAgentAndRequestContextHeaders(client, interfaceType),\n await client.ontologyRid,\n applyFetchArgs<LoadObjectSetV2MultipleObjectTypesRequest>(args, {\n objectSet,\n select: ((args?.$select as string[] | undefined) ?? []),\n excludeRid: !args?.$includeRid,\n }),\n { preview: true },\n );\n return Promise.resolve({\n data: await client.objectFactory2(\n client,\n result.data,\n interfaceType.apiName,\n !args.$includeRid,\n args.$select,\n false,\n result.interfaceToObjectTypeMappings,\n ),\n nextPageToken: result.nextPageToken,\n totalCount: result.totalCount,\n }) as unknown as Promise<FetchPageResult<Q, L, R, S>>;\n}\n\n/** @internal */\nexport async function fetchPageInternal<\n Q extends ObjectOrInterfaceDefinition,\n L extends PropertyKeys<Q>,\n R extends boolean,\n A extends Augments,\n S extends NullabilityAdherence,\n>(\n client: MinimalClient,\n objectType: Q,\n objectSet: ObjectSet,\n args: FetchPageArgs<Q, L, R, A, S> = {},\n): Promise<FetchPageResult<Q, L, R, S>> {\n if (objectType.type === \"interface\") {\n return await fetchInterfacePage(\n client,\n objectType,\n args,\n objectSet,\n ) as any; // fixme\n } else {\n return await fetchObjectPage(\n client,\n objectType,\n args,\n objectSet,\n ) as any; // fixme\n }\n}\n\n/** @internal */\nexport async function fetchPageWithErrorsInternal<\n Q extends ObjectOrInterfaceDefinition,\n L extends PropertyKeys<Q>,\n R extends boolean,\n A extends Augments,\n S extends NullabilityAdherence,\n>(\n client: MinimalClient,\n objectType: Q,\n objectSet: ObjectSet,\n args: FetchPageArgs<Q, L, R, A, S> = {},\n): Promise<Result<FetchPageResult<Q, L, R, S>>> {\n try {\n const result = await fetchPageInternal(client, objectType, objectSet, args);\n return { value: result };\n } catch (e) {\n if (e instanceof Error) {\n return { error: e };\n }\n return { error: e as Error };\n }\n}\n\n/**\n * @param client\n * @param objectType\n * @param args\n * @param objectSet\n * @returns\n * @internal\n */\nexport async function fetchPage<\n Q extends ObjectOrInterfaceDefinition,\n L extends PropertyKeys<Q>,\n R extends boolean,\n S extends NullabilityAdherence,\n>(\n client: MinimalClient,\n objectType: Q,\n args: FetchPageArgs<Q, L, R, any, S>,\n objectSet: ObjectSet = resolveBaseObjectSetType(objectType),\n): Promise<FetchPageResult<Q, L, R, S>> {\n return fetchPageInternal(client, objectType, objectSet, args);\n}\n\n/** @internal */\nexport async function fetchPageWithErrors<\n Q extends ObjectOrInterfaceDefinition,\n L extends PropertyKeys<Q>,\n R extends boolean,\n S extends NullabilityAdherence,\n>(\n client: MinimalClient,\n objectType: Q,\n args: FetchPageArgs<Q, L, R, any, S>,\n objectSet: ObjectSet = resolveBaseObjectSetType(objectType),\n): Promise<Result<FetchPageResult<Q, L, R, S>>> {\n return fetchPageWithErrorsInternal(client, objectType, objectSet, args);\n}\n\nfunction applyFetchArgs<\n X extends {\n orderBy?: SearchOrderByV2;\n pageToken?: PageToken;\n pageSize?: PageSize;\n },\n>(\n args: FetchPageArgs<any, any, any, any, any>,\n body: X,\n): X {\n if (args?.$nextPageToken) {\n body.pageToken = args.$nextPageToken;\n }\n\n if (args?.$pageSize != null) {\n body.pageSize = args.$pageSize;\n }\n\n if (args?.$orderBy != null) {\n body.orderBy = {\n fields: Object.entries(args.$orderBy).map(([field, direction]) => ({\n field,\n direction,\n })),\n };\n }\n\n return body;\n}\n\n/** @internal */\nexport async function fetchObjectPage<\n Q extends ObjectTypeDefinition,\n L extends PropertyKeys<Q>,\n R extends boolean,\n S extends NullabilityAdherence,\n>(\n client: MinimalClient,\n objectType: Q,\n args: FetchPageArgs<Q, L, R, Augments, S>,\n objectSet: ObjectSet,\n): Promise<FetchPageResult<Q, L, R, S>> {\n const r = await OntologiesV2.OntologyObjectSets.load(\n addUserAgentAndRequestContextHeaders(client, objectType),\n await client.ontologyRid,\n applyFetchArgs<LoadObjectSetRequestV2>(args, {\n objectSet,\n // We have to do the following case because LoadObjectSetRequestV2 isn't readonly\n select: ((args?.$select as string[] | undefined) ?? []), // FIXME?\n excludeRid: !args?.$includeRid,\n }),\n );\n\n return Promise.resolve({\n data: await client.objectFactory(\n client,\n r.data as OntologyObjectV2[],\n undefined,\n undefined,\n args.$select,\n ),\n nextPageToken: r.nextPageToken,\n totalCount: r.totalCount,\n }) as unknown as Promise<FetchPageResult<Q, L, R, S>>;\n}\n"],"mappings":"AAAA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AC3CX,SAAS;IACT;IACA8B,MAAM,EAAInB,IAAI,EAAEY,OAAO,IAA6B,EAAG;IAAE;IACzDQ,UAAU,EAAE,CAACpB,IAAI,EAAEgB;EACrB,CAAC,CACH,CAAC;EAED,OAAOK,OAAO,CAACC,OAAO,CAAC;IACrBR,IAAI,EAAE,MAAMf,MAAM,CAACgB,aAAa,CAC9BhB,MAAM,EACNgD,CAAC,CAACjC,IAAI,EACNtB,SAAS,EACTA,SAAS,EACTQ,IAAI,CAACY,OACP,CAAC;IACDa,aAAa,EAAEsB,CAAC,CAACtB,aAAa;IAC9BC,UAAU,EAAEqB,CAAC,CAACrB;EAChB,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
|
|
17
|
+
import { Employee, Todo } from "@osdk/client.test.ontology";
|
|
17
18
|
import { describe, expect, expectTypeOf, it } from "vitest";
|
|
18
19
|
import { createMinimalClient } from "../createMinimalClient.js";
|
|
19
20
|
import { fetchPage, objectSetToSearchJsonV2 } from "../object/fetchPage.js";
|
|
@@ -26,10 +27,13 @@ describe(fetchPage, () => {
|
|
|
26
27
|
// this helper lets us get return types of functions that are generic
|
|
27
28
|
|
|
28
29
|
expectTypeOf().branded.toEqualTypeOf();
|
|
30
|
+
|
|
29
31
|
// e.g. fetchPage({ select: [] });
|
|
30
32
|
expectTypeOf().branded.toEqualTypeOf();
|
|
33
|
+
|
|
31
34
|
// e.g. fetchPage()
|
|
32
35
|
expectTypeOf().branded.toEqualTypeOf();
|
|
36
|
+
|
|
33
37
|
// e.g. fetchPage({ $select: ["text"]}
|
|
34
38
|
expectTypeOf().branded.toEqualTypeOf();
|
|
35
39
|
});
|
|
@@ -89,6 +93,81 @@ describe(fetchPage, () => {
|
|
|
89
93
|
}]
|
|
90
94
|
});
|
|
91
95
|
});
|
|
96
|
+
it("where clause keys correctly typed", () => {
|
|
97
|
+
const client = createMinimalClient(metadata, "https://foo", async () => "");
|
|
98
|
+
const objectSet = createObjectSet(Todo, client);
|
|
99
|
+
const objectSetWithSpecialPropertyTypes = createObjectSet(Employee, client);
|
|
100
|
+
expectTypeOf(objectSet.where).toBeCallableWith({
|
|
101
|
+
$and: [{
|
|
102
|
+
id: {
|
|
103
|
+
$gt: 2
|
|
104
|
+
}
|
|
105
|
+
}, {
|
|
106
|
+
id: {
|
|
107
|
+
$lte: 2
|
|
108
|
+
}
|
|
109
|
+
}]
|
|
110
|
+
});
|
|
111
|
+
expectTypeOf(objectSet.where).toBeCallableWith({
|
|
112
|
+
// @ts-expect-error
|
|
113
|
+
id: {
|
|
114
|
+
$gt: 2,
|
|
115
|
+
$lte: 2
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
// We used to default to number filters for other types, like geotimeseries reference and timeseries. These tests will make sure
|
|
120
|
+
// we don't do that anymore
|
|
121
|
+
expectTypeOf(objectSetWithSpecialPropertyTypes.where).toBeCallableWith({
|
|
122
|
+
$and: [{
|
|
123
|
+
employeeLocation: {
|
|
124
|
+
$eq: "myLocation"
|
|
125
|
+
}
|
|
126
|
+
}, {
|
|
127
|
+
employeeLocation: {
|
|
128
|
+
$ne: "notMyLocation"
|
|
129
|
+
}
|
|
130
|
+
}, {
|
|
131
|
+
employeeLocation: {
|
|
132
|
+
$isNull: false
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
// @ts-expect-error
|
|
136
|
+
{
|
|
137
|
+
employeeLocation: {
|
|
138
|
+
$isNull: false,
|
|
139
|
+
$eq: "myLocation"
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
// @ts-expect-error
|
|
143
|
+
{
|
|
144
|
+
employeeLocation: {
|
|
145
|
+
$gt: 5
|
|
146
|
+
}
|
|
147
|
+
}]
|
|
148
|
+
});
|
|
149
|
+
expectTypeOf(objectSetWithSpecialPropertyTypes.where).toBeCallableWith({
|
|
150
|
+
$and: [{
|
|
151
|
+
employeeStatus: {
|
|
152
|
+
$eq: "myStatus"
|
|
153
|
+
}
|
|
154
|
+
}, {
|
|
155
|
+
employeeLocation: {
|
|
156
|
+
$ne: "notMyStatus"
|
|
157
|
+
}
|
|
158
|
+
}, {
|
|
159
|
+
employeeLocation: {
|
|
160
|
+
$isNull: false
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
// @ts-expect-error
|
|
164
|
+
{
|
|
165
|
+
employeeLocation: {
|
|
166
|
+
$lte: 5
|
|
167
|
+
}
|
|
168
|
+
}]
|
|
169
|
+
});
|
|
170
|
+
});
|
|
92
171
|
describe("includeRid", () => {
|
|
93
172
|
it("properly returns the correct string for includeRid", () => {
|
|
94
173
|
expectTypeOf().toEqualTypeOf();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchPage.test.js","names":["Todo","describe","expect","expectTypeOf","it","createMinimalClient","fetchPage","objectSetToSearchJsonV2","createObjectSet","getWireObjectSet","metadata","ontologyRid","branded","toEqualTypeOf","type","objectSet","objectType","where","field","value","undefined","toEqual","client","text","id","$gt","wireObjectSet"],"sources":["fetchPage.test.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 { Todo } from \"@osdk/client.test.ontology\";\nimport { describe, expect, expectTypeOf, it } from \"vitest\";\nimport { createMinimalClient } from \"../createMinimalClient.js\";\nimport { fetchPage, objectSetToSearchJsonV2 } from \"../object/fetchPage.js\";\nimport { createObjectSet, getWireObjectSet, } from \"../objectSet/createObjectSet.js\";\nconst metadata = {\n ontologyRid: \"asdf\",\n};\ndescribe(fetchPage, () => {\n it(\"infers select properly\", () => {\n // this helper lets us get return types of functions that are generic\n class Helper {\n fetchPage() {\n return fetchPage({}, {}, {});\n }\n }\n expectTypeOf()\n .branded\n .toEqualTypeOf();\n // e.g. fetchPage({ select: [] });\n expectTypeOf()\n .branded\n .toEqualTypeOf();\n // e.g. fetchPage()\n expectTypeOf()\n .branded\n .toEqualTypeOf();\n // e.g. fetchPage({ $select: [\"text\"]}\n expectTypeOf()\n .branded\n .toEqualTypeOf();\n });\n it(\"converts interface objectsets to search properly\", () => {\n expect(objectSetToSearchJsonV2({\n type: \"filter\",\n objectSet: {\n type: \"filter\",\n objectSet: {\n type: \"base\",\n objectType: \"Todo\",\n },\n where: {\n type: \"eq\",\n field: \"text\",\n value: \"hello\",\n },\n },\n where: {\n type: \"gt\",\n field: \"id\",\n value: 2,\n },\n }, \"Todo\", undefined)).toEqual({\n type: \"and\",\n value: [\n {\n type: \"gt\",\n field: \"id\",\n value: 2,\n },\n {\n type: \"eq\",\n field: \"text\",\n value: \"hello\",\n },\n ],\n });\n });\n it(\"converts interface objectsets to search properly part 2\", () => {\n const client = createMinimalClient(metadata, \"https://foo\", async () => \"\");\n const objectSet = createObjectSet(Todo, client).where({\n text: \"hello\",\n }).where({\n id: { $gt: 2 },\n });\n const wireObjectSet = getWireObjectSet(objectSet);\n expect(objectSetToSearchJsonV2(wireObjectSet, \"Todo\", undefined)).toEqual({\n type: \"and\",\n value: [\n {\n type: \"gt\",\n field: \"id\",\n value: 2,\n },\n {\n type: \"eq\",\n field: \"text\",\n value: \"hello\",\n },\n ],\n });\n });\n describe(\"includeRid\", () => {\n it(\"properly returns the correct string for includeRid\", () => {\n expectTypeOf()\n .toEqualTypeOf();\n expectTypeOf()\n .branded\n .toEqualTypeOf();\n });\n it(\"works with $all\", () => {\n expectTypeOf().branded\n .toEqualTypeOf();\n expectTypeOf()\n .branded\n .toEqualTypeOf();\n expectTypeOf()\n .branded\n .toEqualTypeOf();\n expectTypeOf()\n .branded\n .toEqualTypeOf();\n expectTypeOf()\n .branded\n .toEqualTypeOf();\n });\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,IAAI,QAAQ,4BAA4B;AACjD,SAASC,QAAQ,EAAEC,MAAM,EAAEC,YAAY,EAAEC,EAAE,QAAQ,QAAQ;AAC3D,SAASC,mBAAmB,QAAQ,2BAA2B;AAC/D,SAASC,SAAS,EAAEC,uBAAuB,QAAQ,wBAAwB;AAC3E,SAASC,eAAe,EAAEC,gBAAgB,QAAS,iCAAiC;AACpF,MAAMC,QAAQ,GAAG;EACbC,WAAW,EAAE;AACjB,CAAC;AACDV,QAAQ,CAACK,SAAS,EAAE,MAAM;EACtBF,EAAE,CAAC,wBAAwB,EAAE,MAAM;IAC/B;;IAMAD,YAAY,CAAC,CAAC,CACTS,OAAO,CACPC,aAAa,CAAC,CAAC;IACpB;IACAV,YAAY,CAAC,CAAC,CACTS,OAAO,CACPC,aAAa,CAAC,CAAC;IACpB;IACAV,YAAY,CAAC,CAAC,CACTS,OAAO,CACPC,aAAa,CAAC,CAAC;IACpB;IACAV,YAAY,CAAC,CAAC,CACTS,OAAO,CACPC,aAAa,CAAC,CAAC;EACxB,CAAC,CAAC;EACFT,EAAE,CAAC,kDAAkD,EAAE,MAAM;IACzDF,MAAM,CAACK,uBAAuB,CAAC;MAC3BO,IAAI,EAAE,QAAQ;MACdC,SAAS,EAAE;QACPD,IAAI,EAAE,QAAQ;QACdC,SAAS,EAAE;UACPD,IAAI,EAAE,MAAM;UACZE,UAAU,EAAE;QAChB,CAAC;QACDC,KAAK,EAAE;UACHH,IAAI,EAAE,IAAI;UACVI,KAAK,EAAE,MAAM;UACbC,KAAK,EAAE;QACX;MACJ,CAAC;MACDF,KAAK,EAAE;QACHH,IAAI,EAAE,IAAI;QACVI,KAAK,EAA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,CAAC,CAAC;IACxB,CAAC,CAAC;IACFT,EAAE,CAAC,iBAAiB,EAAE,MAAM;MACxBD,YAAY,CAAC,CAAC,CAACS,OAAO,CACjBC,aAAa,CAAC,CAAC;MACpBV,YAAY,CAAC,CAAC,CACTS,OAAO,CACPC,aAAa,CAAC,CAAC;MACpBV,YAAY,CAAC,CAAC,CACTS,OAAO,CACPC,aAAa,CAAC,CAAC;MACpBV,YAAY,CAAC,CAAC,CACTS,OAAO,CACPC,aAAa,CAAC,CAAC;MACpBV,YAAY,CAAC,CAAC,CACTS,OAAO,CACPC,aAAa,CAAC,CAAC;IACxB,CAAC,CAAC;EACN,CAAC,CAAC;AACN,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"fetchPage.test.js","names":["Employee","Todo","describe","expect","expectTypeOf","it","createMinimalClient","fetchPage","objectSetToSearchJsonV2","createObjectSet","getWireObjectSet","metadata","ontologyRid","branded","toEqualTypeOf","type","objectSet","objectType","where","field","value","undefined","toEqual","client","text","id","$gt","wireObjectSet","objectSetWithSpecialPropertyTypes","toBeCallableWith","$and","$lte","employeeLocation","$eq","$ne","$isNull","employeeStatus"],"sources":["fetchPage.test.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 FetchPageArgs,\n FetchPageResult,\n ObjectTypeDefinition,\n Osdk,\n PageResult,\n PropertyKeys,\n SelectArgToKeys,\n} from \"@osdk/api\";\nimport type { FooInterface } from \"@osdk/client.test.ontology\";\nimport { Employee, Todo } from \"@osdk/client.test.ontology\";\nimport type { SearchJsonQueryV2 } from \"@osdk/foundry.ontologies\";\nimport { describe, expect, expectTypeOf, it } from \"vitest\";\nimport { createMinimalClient } from \"../createMinimalClient.js\";\nimport { fetchPage, objectSetToSearchJsonV2 } from \"../object/fetchPage.js\";\nimport {\n createObjectSet,\n getWireObjectSet,\n} from \"../objectSet/createObjectSet.js\";\n\nconst metadata = {\n ontologyRid: \"asdf\",\n};\ntype TodoDef = Todo;\n\ndescribe(fetchPage, () => {\n it(\"infers select properly\", () => {\n // this helper lets us get return types of functions that are generic\n class Helper<\n T extends ObjectTypeDefinition,\n const A extends FetchPageArgs<T>,\n > {\n public fetchPage<\n L extends SelectArgToKeys<T, A>,\n R extends A[\"$includeRid\"] extends true ? true : false,\n >() {\n return fetchPage<\n T,\n L & PropertyKeys<T>,\n R,\n \"drop\"\n >({} as any, {} as any, {} as any);\n }\n }\n\n expectTypeOf<Awaited<ReturnType<Helper<TodoDef, {}>[\"fetchPage\"]>>>()\n .branded\n .toEqualTypeOf<PageResult<Osdk<TodoDef, \"$all\">>>();\n\n // e.g. fetchPage({ select: [] });\n expectTypeOf<\n Awaited<ReturnType<Helper<TodoDef, { $select: [] }>[\"fetchPage\"]>>\n >()\n .branded\n .toEqualTypeOf<PageResult<Osdk<TodoDef, \"$all\">>>();\n\n // e.g. fetchPage()\n expectTypeOf<\n Awaited<\n ReturnType<\n Helper<TodoDef, FetchPageArgs<TodoDef>>[\"fetchPage\"]\n >\n >\n >()\n .branded\n .toEqualTypeOf<PageResult<Osdk<TodoDef, \"$all\">>>();\n\n // e.g. fetchPage({ $select: [\"text\"]}\n expectTypeOf<\n Awaited<\n ReturnType<Helper<TodoDef, { $select: [\"text\"] }>[\"fetchPage\"]>\n >\n >()\n .branded\n .toEqualTypeOf<PageResult<Osdk<TodoDef, \"text\">>>();\n });\n\n it(\"converts interface objectsets to search properly\", () => {\n expect(objectSetToSearchJsonV2(\n {\n type: \"filter\",\n objectSet: {\n type: \"filter\",\n objectSet: {\n type: \"base\",\n objectType: \"Todo\",\n },\n where: {\n type: \"eq\",\n field: \"text\",\n value: \"hello\",\n },\n },\n\n where: {\n type: \"gt\",\n field: \"id\",\n value: 2,\n },\n },\n \"Todo\",\n undefined,\n )).toEqual(\n {\n type: \"and\",\n value: [\n {\n type: \"gt\",\n field: \"id\",\n value: 2,\n },\n {\n type: \"eq\",\n field: \"text\",\n value: \"hello\",\n },\n ],\n } satisfies SearchJsonQueryV2,\n );\n });\n\n it(\"converts interface objectsets to search properly part 2\", () => {\n const client = createMinimalClient(\n metadata,\n \"https://foo\",\n async () => \"\",\n );\n const objectSet = createObjectSet(Todo, client).where({\n text: \"hello\",\n }).where({\n id: { $gt: 2 },\n });\n\n const wireObjectSet = getWireObjectSet(objectSet);\n\n expect(objectSetToSearchJsonV2(wireObjectSet, \"Todo\", undefined)).toEqual(\n {\n type: \"and\",\n value: [\n {\n type: \"gt\",\n field: \"id\",\n value: 2,\n },\n {\n type: \"eq\",\n field: \"text\",\n value: \"hello\",\n },\n ],\n } satisfies SearchJsonQueryV2,\n );\n });\n\n it(\"where clause keys correctly typed\", () => {\n const client = createMinimalClient(\n metadata,\n \"https://foo\",\n async () => \"\",\n );\n const objectSet = createObjectSet(Todo, client);\n const objectSetWithSpecialPropertyTypes = createObjectSet(Employee, client);\n\n expectTypeOf(objectSet.where).toBeCallableWith({\n $and: [{ id: { $gt: 2 } }, { id: { $lte: 2 } }],\n });\n expectTypeOf(objectSet.where).toBeCallableWith({\n // @ts-expect-error\n id: { $gt: 2, $lte: 2 },\n });\n\n // We used to default to number filters for other types, like geotimeseries reference and timeseries. These tests will make sure\n // we don't do that anymore\n expectTypeOf(objectSetWithSpecialPropertyTypes.where).toBeCallableWith({\n $and: [\n { employeeLocation: { $eq: \"myLocation\" } },\n {\n employeeLocation: { $ne: \"notMyLocation\" },\n },\n { employeeLocation: { $isNull: false } },\n // @ts-expect-error\n { employeeLocation: { $isNull: false, $eq: \"myLocation\" } },\n // @ts-expect-error\n { employeeLocation: { $gt: 5 } },\n ],\n });\n\n expectTypeOf(objectSetWithSpecialPropertyTypes.where).toBeCallableWith({\n $and: [\n { employeeStatus: { $eq: \"myStatus\" } },\n {\n employeeLocation: { $ne: \"notMyStatus\" },\n },\n { employeeLocation: { $isNull: false } },\n // @ts-expect-error\n { employeeLocation: { $lte: 5 } },\n ],\n });\n });\n\n describe(\"includeRid\", () => {\n it(\"properly returns the correct string for includeRid\", () => {\n expectTypeOf<Awaited<FetchPageResult<TodoDef, \"text\", false, \"throw\">>>()\n .toEqualTypeOf<{\n data: Osdk<TodoDef, \"text\">[];\n nextPageToken: string | undefined;\n totalCount: string;\n }>();\n\n expectTypeOf<Awaited<FetchPageResult<TodoDef, \"text\", true, false>>>()\n .branded\n .toEqualTypeOf<{\n data: Osdk<TodoDef, \"text\" | \"$rid\" | \"$notStrict\">[];\n nextPageToken: string | undefined;\n totalCount: string;\n }>();\n });\n\n it(\"works with $all\", () => {\n expectTypeOf<\n Awaited<FetchPageResult<TodoDef, \"text\" | \"id\", false, \"drop\">>\n >().branded\n .toEqualTypeOf<{\n data: Osdk<TodoDef>[];\n nextPageToken: string | undefined;\n totalCount: string;\n }>();\n\n expectTypeOf<\n Awaited<FetchPageResult<TodoDef, \"text\" | \"id\", true, \"drop\">>\n >()\n .branded\n .toEqualTypeOf<{\n data: Osdk<TodoDef, \"$all\" | \"$rid\">[];\n nextPageToken: string | undefined;\n totalCount: string;\n }>();\n\n expectTypeOf<\n Awaited<FetchPageResult<TodoDef, \"text\" | \"id\", true, \"drop\">>\n >()\n .branded\n .toEqualTypeOf<{\n data: Osdk<TodoDef, \"$all\" | \"$rid\">[];\n nextPageToken: string | undefined;\n totalCount: string;\n }>();\n\n expectTypeOf<\n Awaited<FetchPageResult<FooInterface, \"fooSpt\", true, \"drop\">>\n >()\n .branded\n .toEqualTypeOf<{\n data: Osdk<FooInterface, \"$all\" | \"$rid\">[];\n nextPageToken: string | undefined;\n totalCount: string;\n }>();\n\n expectTypeOf<\n Awaited<FetchPageResult<FooInterface, \"fooSpt\", true, \"drop\">>\n >()\n .branded\n .toEqualTypeOf<{\n data: Osdk<FooInterface, \"$all\" | \"$rid\">[];\n nextPageToken: string | undefined;\n totalCount: string;\n }>();\n });\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYA,SAASA,QAAQ,EAAEC,IAAI,QAAQ,4BAA4B;AAE3D,SAASC,QAAQ,EAAEC,MAAM,EAAEC,YAAY,EAAEC,EAAE,QAAQ,QAAQ;AAC3D,SAASC,mBAAmB,QAAQ,2BAA2B;AAC/D,SAASC,SAAS,EAAEC,uBAAuB,QAAQ,wBAAwB;AAC3E,SACEC,eAAe,EACfC,gBAAgB,QACX,iCAAiC;AAExC,MAAMC,QAAQ,GAAG;EACfC,WAAW,EAAE;AACf,CAAC;AAGDV,QAAQ,CAACK,SAAS,EAAE,MAAM;EACxBF,EAAE,CAAC,wBAAwB,EAAE,MAAM;IACjC;;IAkBAD,YAAY,CAAwD,CAAC,CAClES,OAAO,CACPC,aAAa,CAAoC,CAAC;;IAErD;IACAV,YAAY,CAEV,CAAC,CACAS,OAAO,CACPC,aAAa,CAAoC,CAAC;;IAErD;IACAV,YAAY,CAMV,CAAC,CACAS,OAAO,CACPC,aAAa,CAAoC,CAAC;;IAErD;IACAV,YAAY,CAIV,CAAC,CACAS,OAAO,CACPC,aAAa,CAAoC,CAAC;EACvD,CAAC,CAAC;EAEFT,EAAE,CAAC,kDAAkD,EAAE,MAAM;IAC3DF,MAAM,CAACK,uBAAuB,CAC5B;MACEO,IAAI,EAAE,QAAQ;MACdC,SAAS,EAAE;QACTD,IAAI,EAAE,QAAQ;QACdC,SAAS,EAAE;UACTD,IAAI,EAAE,MAAM;UACZE,UAAU,EAAE;QACd,CAAC;QACDC,KAAK,EAAE;UACLH,IAAI,EAAE,IAAI;UACVI,KAAK,EAAE,MAAM;UACbC,KAAK,EAAE;QACT;MAC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AgB,EAAE;UAAEG,OAAO,EAAE;QAAM;MAAE,CAAC;MACxC;MACA;QAAEH,gBAAgB,EAAE;UAAED,IAAI,EAAE;QAAE;MAAE,CAAC;IAErC,CAAC,CAAC;EACJ,CAAC,CAAC;EAEF7B,QAAQ,CAAC,YAAY,EAAE,MAAM;IAC3BG,EAAE,CAAC,oDAAoD,EAAE,MAAM;MAC7DD,YAAY,CAA4D,CAAC,CACtEU,aAAa,CAIX,CAAC;MAENV,YAAY,CAAyD,CAAC,CACnES,OAAO,CACPC,aAAa,CAIX,CAAC;IACR,CAAC,CAAC;IAEFT,EAAE,CAAC,iBAAiB,EAAE,MAAM;MAC1BD,YAAY,CAEV,CAAC,CAACS,OAAO,CACRC,aAAa,CAIX,CAAC;MAENV,YAAY,CAEV,CAAC,CACAS,OAAO,CACPC,aAAa,CAIX,CAAC;MAENV,YAAY,CAEV,CAAC,CACAS,OAAO,CACPC,aAAa,CAIX,CAAC;MAENV,YAAY,CAEV,CAAC,CACAS,OAAO,CACPC,aAAa,CAIX,CAAC;MAENV,YAAY,CAEV,CAAC,CACAS,OAAO,CACPC,aAAa,CAIX,CAAC;IACR,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -13,8 +13,10 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
|
|
16
17
|
import { PalantirApiError } from "@osdk/shared.net.errors";
|
|
17
18
|
import { fetchPage } from "./fetchPage.js";
|
|
19
|
+
|
|
18
20
|
/** @internal */
|
|
19
21
|
export async function fetchSingle(client, objectType, args, objectSet) {
|
|
20
22
|
const result = await fetchPage(client, objectType, {
|
|
@@ -26,6 +28,7 @@ export async function fetchSingle(client, objectType, args, objectSet) {
|
|
|
26
28
|
}
|
|
27
29
|
return result.data[0];
|
|
28
30
|
}
|
|
31
|
+
|
|
29
32
|
/** @internal */
|
|
30
33
|
export async function fetchSingleWithErrors(client, objectType, args, objectSet) {
|
|
31
34
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchSingle.js","names":["PalantirApiError","fetchPage","fetchSingle","client","objectType","args","objectSet","result","$pageSize","data","length","nextPageToken","fetchSingleWithErrors","value","e","Error","error"],"sources":["fetchSingle.
|
|
1
|
+
{"version":3,"file":"fetchSingle.js","names":["PalantirApiError","fetchPage","fetchSingle","client","objectType","args","objectSet","result","$pageSize","data","length","nextPageToken","fetchSingleWithErrors","value","e","Error","error"],"sources":["fetchSingle.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n FetchPageArgs,\n ObjectOrInterfaceDefinition,\n Result,\n SingleOsdkResult,\n} from \"@osdk/api\";\nimport type { ObjectSet } from \"@osdk/foundry.ontologies\";\nimport { PalantirApiError } from \"@osdk/shared.net.errors\";\nimport type { MinimalClient } from \"../MinimalClientContext.js\";\nimport { fetchPage } from \"./fetchPage.js\";\n\n/** @internal */\nexport async function fetchSingle<\n Q extends ObjectOrInterfaceDefinition,\n const A extends FetchPageArgs<Q, any, any>,\n>(\n client: MinimalClient,\n objectType: Q,\n args: A,\n objectSet: ObjectSet,\n): Promise<\n A extends FetchPageArgs<Q, infer L, infer R, any, infer S>\n ? SingleOsdkResult<Q, L, R, S>\n : SingleOsdkResult<Q, any, any, any>\n> {\n const result = await fetchPage(\n client,\n objectType,\n { ...args, $pageSize: 1 },\n objectSet,\n );\n\n if (result.data.length !== 1 || result.nextPageToken != null) {\n throw new PalantirApiError(\n `Expected a single result but got ${result.data.length} instead${\n result.nextPageToken != null ? \" with nextPageToken set\" : \"\"\n }`,\n );\n }\n\n return result.data[0] as any;\n}\n\n/** @internal */\nexport async function fetchSingleWithErrors<\n Q extends ObjectOrInterfaceDefinition,\n const A extends FetchPageArgs<Q, any, any>,\n>(\n client: MinimalClient,\n objectType: Q,\n args: A,\n objectSet: ObjectSet,\n): Promise<\n Result<\n A extends FetchPageArgs<Q, infer L, infer R, any, infer S>\n ? SingleOsdkResult<Q, L, R, S>\n : SingleOsdkResult<Q, any, any, any>\n >\n> {\n try {\n const result = await fetchSingle(client, objectType, args, objectSet);\n return { value: result as any };\n } catch (e) {\n if (e instanceof Error) {\n return { error: e };\n }\n return { error: e as Error };\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASA,SAASA,gBAAgB,QAAQ,yBAAyB;AAE1D,SAASC,SAAS,QAAQ,gBAAgB;;AAE1C;AACA,OAAO,eAAeC,WAAWA,CAI/BC,MAAqB,EACrBC,UAAa,EACbC,IAAO,EACPC,SAAoB,EAKpB;EACA,MAAMC,MAAM,GAAG,MAAMN,SAAS,CAC5BE,MAAM,EACNC,UAAU,EACV;IAAE,GAAGC,IAAI;IAAEG,SAAS,EAAE;EAAE,CAAC,EACzBF,SACF,CAAC;EAED,IAAIC,MAAM,CAACE,IAAI,CAACC,MAAM,KAAK,CAAC,IAAIH,MAAM,CAACI,aAAa,IAAI,IAAI,EAAE;IAC5D,MAAM,IAAIX,gBAAgB,CACxB,oCAAoCO,MAAM,CAACE,IAAI,CAACC,MAAM,WACpDH,MAAM,CAACI,aAAa,IAAI,IAAI,GAAG,yBAAyB,GAAG,EAAE,EAEjE,CAAC;EACH;EAEA,OAAOJ,MAAM,CAACE,IAAI,CAAC,CAAC,CAAC;AACvB;;AAEA;AACA,OAAO,eAAeG,qBAAqBA,CAIzCT,MAAqB,EACrBC,UAAa,EACbC,IAAO,EACPC,SAAoB,EAOpB;EACA,IAAI;IACF,MAAMC,MAAM,GAAG,MAAML,WAAW,CAACC,MAAM,EAAEC,UAAU,EAAEC,IAAI,EAAEC,SAAS,CAAC;IACrE,OAAO;MAAEO,KAAK,EAAEN;IAAc,CAAC;EACjC,CAAC,CAAC,OAAOO,CAAC,EAAE;IACV,IAAIA,CAAC,YAAYC,KAAK,EAAE;MACtB,OAAO;QAAEC,KAAK,EAAEF;MAAE,CAAC;IACrB;IACA,OAAO;MAAEE,KAAK,EAAEF;IAAW,CAAC;EAC9B;AACF","ignoreList":[]}
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
|
|
16
17
|
import { $ontologyRid, Employee } from "@osdk/client.test.ontology";
|
|
17
18
|
import { apiServer } from "@osdk/shared.test";
|
|
18
19
|
import { afterAll, beforeAll, describe, expect, it } from "vitest";
|
|
@@ -49,6 +50,7 @@ describe("Timeseries", () => {
|
|
|
49
50
|
type: "Point",
|
|
50
51
|
coordinates: [3.3, 3.3]
|
|
51
52
|
});
|
|
53
|
+
|
|
52
54
|
// Making sure caching working as expected
|
|
53
55
|
const initialPointEmployee2 = employee2.employeeLocation?.lastFetchedValue;
|
|
54
56
|
expect(initialPointEmployee2).toBeUndefined();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geotimeseriesreference.test.js","names":["$ontologyRid","Employee","apiServer","afterAll","beforeAll","describe","expect","it","createClient","client","listen","close","employee","fetchOne","employee2","$primaryKey","toEqual","location","employeeLocation","toBeDefined","initialLastPoint","lastFetchedValue","toBeUndefined","fetchedPoint","getLatestValue","nextLastPoint","time","value","type","coordinates","initialPointEmployee2","fetchedPoint2","nextLastPoint2","points","getAllValues","$before","$unit","$after","$startTime","$endTime","pointsIter","asyncIterValues","point","push"],"sources":["geotimeseriesreference.test.js"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { $ontologyRid, Employee } from \"@osdk/client.test.ontology\";\nimport { apiServer } from \"@osdk/shared.test\";\nimport { afterAll, beforeAll, describe, expect, it } from \"vitest\";\nimport { createClient } from \"../createClient.js\";\ndescribe(\"Timeseries\", () => {\n let client;\n beforeAll(async () => {\n apiServer.listen();\n client = createClient(\"https://stack.palantir.com\", $ontologyRid, async () => \"myAccessToken\");\n });\n afterAll(() => {\n apiServer.close();\n });\n it(\"get latest value works\", async () => {\n const employee = await client(Employee).fetchOne(50030);\n const employee2 = await client(Employee).fetchOne(50031);\n expect(employee.$primaryKey).toEqual(50030);\n expect(employee2.$primaryKey).toEqual(50031);\n const location = employee.employeeLocation;\n expect(location).toBeDefined();\n const initialLastPoint = employee.employeeLocation?.lastFetchedValue;\n expect(initialLastPoint).toBeUndefined();\n const fetchedPoint = await employee.employeeLocation?.getLatestValue();\n const nextLastPoint = employee.employeeLocation?.lastFetchedValue;\n expect(employee.employeeLocation?.lastFetchedValue).toBeDefined();\n expect(nextLastPoint).toEqual(fetchedPoint);\n expect(nextLastPoint?.time).toEqual(\"2014-04-14\");\n expect(nextLastPoint?.value).toEqual({\n type: \"Point\",\n coordinates: [3.3, 3.3],\n });\n expect(fetchedPoint?.time).toEqual(\"2014-04-14\");\n expect(fetchedPoint?.value).toEqual({\n type: \"Point\",\n coordinates: [3.3, 3.3],\n });\n // Making sure caching working as expected\n const initialPointEmployee2 = employee2.employeeLocation?.lastFetchedValue;\n expect(initialPointEmployee2).toBeUndefined();\n const fetchedPoint2 = await employee2.employeeLocation?.getLatestValue();\n const nextLastPoint2 = employee2.employeeLocation?.lastFetchedValue;\n expect(employee2.employeeLocation?.lastFetchedValue).toBeDefined();\n expect(nextLastPoint2).toEqual(fetchedPoint2);\n expect(nextLastPoint2?.time).toEqual(\"2013-03-13\");\n expect(nextLastPoint2?.value).toEqual({\n type: \"Point\",\n coordinates: [2.2, 2.2],\n });\n expect(fetchedPoint2?.time).toEqual(\"2013-03-13\");\n expect(fetchedPoint2?.value).toEqual({\n type: \"Point\",\n coordinates: [2.2, 2.2],\n });\n });\n it(\"getAll values with before works\", async () => {\n const employee = await client(Employee).fetchOne(50030);\n expect(employee.$primaryKey).toEqual(50030);\n const points = await employee.employeeLocation?.getAllValues({\n $before: 1,\n $unit: \"month\",\n });\n expect(points).toBeDefined();\n expect(points).toEqual([{\n time: \"2012-02-12\",\n value: { type: \"Point\", coordinates: [1.1, 1.1] },\n }, {\n time: \"2013-03-13\",\n value: { type: \"Point\", coordinates: [2.2, 2.2] },\n }, {\n time: \"2014-04-14\",\n value: { type: \"Point\", coordinates: [3.3, 3.3] },\n }]);\n });\n it(\"getAll values with after works\", async () => {\n const employee = await client(Employee).fetchOne(50030);\n expect(employee.$primaryKey).toEqual(50030);\n const points = await employee.employeeLocation?.getAllValues({\n $after: 1,\n $unit: \"month\",\n });\n expect(points).toBeDefined();\n expect(points).toEqual([{\n time: \"2012-02-12\",\n value: { type: \"Point\", coordinates: [1.1, 1.1] },\n }, {\n time: \"2014-04-14\",\n value: { type: \"Point\", coordinates: [3.3, 3.3] },\n }]);\n });\n it(\"getAll points with absolute range works\", async () => {\n const employee = await client(Employee).fetchOne(50030);\n expect(employee.$primaryKey).toEqual(50030);\n const points = await employee.employeeLocation?.getAllValues({\n $startTime: \"2013-03-12T12:00:00.000Z\",\n $endTime: \"2014-04-14T12:00:00.000Z\",\n });\n expect(points).toBeDefined();\n expect(points).toEqual([{\n time: \"2013-03-13\",\n value: { type: \"Point\", coordinates: [2.2, 2.2] },\n }, {\n time: \"2014-04-14\",\n value: { type: \"Point\", coordinates: [3.3, 3.3] },\n }]);\n });\n it(\"getAll points with no query works\", async () => {\n const employee = await client(Employee).fetchOne(50030);\n expect(employee.$primaryKey).toEqual(50030);\n const points = await employee.employeeLocation?.getAllValues();\n expect(points).toBeDefined();\n expect(points).toEqual([\n { time: \"2012-02-12\", value: { type: \"Point\", coordinates: [1.1, 1.1] } },\n { time: \"2012-02-12\", value: { type: \"Point\", coordinates: [1.1, 1.1] } },\n {\n time: \"2013-03-13\",\n value: { type: \"Point\", coordinates: [2.2, 2.2] },\n },\n { time: \"2014-04-14\", value: { type: \"Point\", coordinates: [3.3, 3.3] } },\n { time: \"2014-04-14\", value: { type: \"Point\", coordinates: [3.3, 3.3] } },\n ]);\n });\n it(\"getAll points with no data works\", async () => {\n const employee = await client(Employee).fetchOne(50030);\n expect(employee.$primaryKey).toEqual(50030);\n const points = await employee.employeeLocation?.getAllValues({\n $startTime: \"2021-03-12T12:00:00.000Z\",\n $endTime: \"2022-04-14T12:00:00.000Z\",\n });\n expect(points).toBeDefined();\n expect(points).toEqual([]);\n });\n it(\"async iter points with absolute range works\", async () => {\n const employee = await client(Employee).fetchOne(50030);\n expect(employee.$primaryKey).toEqual(50030);\n const pointsIter = employee.employeeLocation?.asyncIterValues({\n $startTime: \"2013-03-12T12:00:00.000Z\",\n $endTime: \"2014-04-14T12:00:00.000Z\",\n });\n const points = [];\n for await (const point of pointsIter) {\n points.push(point);\n }\n expect(points).toBeDefined();\n expect(points).toEqual([{\n time: \"2013-03-13\",\n value: { type: \"Point\", coordinates: [2.2, 2.2] },\n }, {\n time: \"2014-04-14\",\n value: { type: \"Point\", coordinates: [3.3, 3.3] },\n }]);\n });\n it(\"async iter points with no query\", async () => {\n const employee = await client(Employee).fetchOne(50030);\n expect(employee.$primaryKey).toEqual(50030);\n const pointsIter = employee.employeeLocation?.asyncIterValues();\n const points = [];\n for await (const point of pointsIter) {\n points.push(point);\n }\n expect(points).toBeDefined();\n expect(points).toEqual([\n { time: \"2012-02-12\", value: { type: \"Point\", coordinates: [1.1, 1.1] } },\n { time: \"2012-02-12\", value: { type: \"Point\", coordinates: [1.1, 1.1] } },\n {\n time: \"2013-03-13\",\n value: { type: \"Point\", coordinates: [2.2, 2.2] },\n },\n { time: \"2014-04-14\", value: { type: \"Point\", coordinates: [3.3, 3.3] } },\n { time: \"2014-04-14\", value: { type: \"Point\", coordinates: [3.3, 3.3] } },\n ]);\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,YAAY,EAAEC,QAAQ,QAAQ,4BAA4B;AACnE,SAASC,SAAS,QAAQ,mBAAmB;AAC7C,SAASC,QAAQ,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAClE,SAASC,YAAY,QAAQ,oBAAoB;AACjDH,QAAQ,CAAC,YAAY,EAAE,MAAM;EACzB,IAAII,MAAM;EACVL,SAAS,CAAC,YAAY;IAClBF,SAAS,CAACQ,MAAM,CAAC,CAAC;IAClBD,MAAM,GAAGD,YAAY,CAAC,4BAA4B,EAAER,YAAY,EAAE,YAAY,eAAe,CAAC;EAClG,CAAC,CAAC;EACFG,QAAQ,CAAC,MAAM;IACXD,SAAS,CAACS,KAAK,CAAC,CAAC;EACrB,CAAC,CAAC;EACFJ,EAAE,CAAC,wBAAwB,EAAE,YAAY;IACrC,MAAMK,QAAQ,GAAG,MAAMH,MAAM,CAACR,QAAQ,CAAC,CAACY,QAAQ,CAAC,KAAK,CAAC;IACvD,MAAMC,SAAS,GAAG,MAAML,MAAM,CAACR,QAAQ,CAAC,CAACY,QAAQ,CAAC,KAAK,CAAC;IACxDP,MAAM,CAACM,QAAQ,CAACG,WAAW,CAAC,CAACC,OAAO,CAAC,KAAK,CAAC;IAC3CV,MAAM,CAACQ,SAAS,CAACC,WAAW,CAAC,CAACC,OAAO,CAAC,KAAK,CAAC;IAC5C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,WAAW,EAAE,CAAC,GAAG,EAAE,GAAG;MAAE;IAAE,CAAC,EACzE;MAAEH,IAAI,EAAE,YAAY;MAAEC,KAAK,EAAE;QAAEC,IAAI,EAAE,OAAO;QAAEC,WAAW,EAAE,CAAC,GAAG,EAAE,GAAG;MAAE;IAAE,CAAC,EACzE;MACIH,IAAI,EAAE,YAAY;MAClBC,KAAK,EAAE;QAAEC,IAAI,EAAE,OAAO;QAAEC,WAAW,EAAE,CAAC,GAAG,EAAE,GAAG;MAAE;IACpD,CAAC,EACD;MAAEH,IAAI,EAAE,YAAY;MAAEC,KAAK,EAAE;QAAEC,IAAI,EAAE,OAAO;QAAEC,WAAW,EAAE,CAAC,GAAG,EAAE,GAAG;MAAE;IAAE,CAAC,EACzE;MAAEH,IAAI,EAAE,YAAY;MAAEC,KAAK,EAAE;QAAEC,IAAI,EAAE,OAAO;QAAEC,WAAW,EAAE,CAAC,GAAG,EAAE,GAAG;MAAE;IAAE,CAAC,CAC5E,CAAC;EACN,CAAC,CAAC;AACN,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"geotimeseriesreference.test.js","names":["$ontologyRid","Employee","apiServer","afterAll","beforeAll","describe","expect","it","createClient","client","listen","close","employee","fetchOne","employee2","$primaryKey","toEqual","location","employeeLocation","toBeDefined","initialLastPoint","lastFetchedValue","toBeUndefined","fetchedPoint","getLatestValue","nextLastPoint","time","value","type","coordinates","initialPointEmployee2","fetchedPoint2","nextLastPoint2","points","getAllValues","$before","$unit","$after","$startTime","$endTime","pointsIter","asyncIterValues","point","push"],"sources":["geotimeseriesreference.test.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { TimeSeriesPoint } from \"@osdk/api\";\nimport { $ontologyRid, Employee } from \"@osdk/client.test.ontology\";\nimport { apiServer } from \"@osdk/shared.test\";\nimport { afterAll, beforeAll, describe, expect, it } from \"vitest\";\nimport type { Client } from \"../Client.js\";\nimport { createClient } from \"../createClient.js\";\n\ndescribe(\"Timeseries\", () => {\n let client: Client;\n\n beforeAll(async () => {\n apiServer.listen();\n client = createClient(\n \"https://stack.palantir.com\",\n $ontologyRid,\n async () => \"myAccessToken\",\n );\n });\n\n afterAll(() => {\n apiServer.close();\n });\n\n it(\"get latest value works\", async () => {\n const employee = await client(Employee).fetchOne(50030);\n const employee2 = await client(Employee).fetchOne(50031);\n expect(employee.$primaryKey).toEqual(50030);\n expect(employee2.$primaryKey).toEqual(50031);\n const location = employee.employeeLocation;\n\n expect(location).toBeDefined();\n\n const initialLastPoint = employee.employeeLocation?.lastFetchedValue;\n expect(initialLastPoint).toBeUndefined();\n\n const fetchedPoint = await employee.employeeLocation?.getLatestValue();\n const nextLastPoint = employee.employeeLocation?.lastFetchedValue;\n expect(employee.employeeLocation?.lastFetchedValue).toBeDefined();\n\n expect(nextLastPoint).toEqual(fetchedPoint);\n expect(nextLastPoint?.time).toEqual(\"2014-04-14\");\n expect(nextLastPoint?.value).toEqual({\n type: \"Point\",\n coordinates: [3.3, 3.3],\n });\n\n expect(fetchedPoint?.time).toEqual(\"2014-04-14\");\n expect(fetchedPoint?.value).toEqual({\n type: \"Point\",\n coordinates: [3.3, 3.3],\n });\n\n // Making sure caching working as expected\n const initialPointEmployee2 = employee2.employeeLocation?.lastFetchedValue;\n expect(initialPointEmployee2).toBeUndefined();\n\n const fetchedPoint2 = await employee2.employeeLocation?.getLatestValue();\n const nextLastPoint2 = employee2.employeeLocation?.lastFetchedValue;\n expect(employee2.employeeLocation?.lastFetchedValue).toBeDefined();\n\n expect(nextLastPoint2).toEqual(fetchedPoint2);\n expect(nextLastPoint2?.time).toEqual(\"2013-03-13\");\n expect(nextLastPoint2?.value).toEqual({\n type: \"Point\",\n coordinates: [2.2, 2.2],\n });\n\n expect(fetchedPoint2?.time).toEqual(\"2013-03-13\");\n expect(fetchedPoint2?.value).toEqual({\n type: \"Point\",\n coordinates: [2.2, 2.2],\n });\n });\n\n it(\"getAll values with before works\", async () => {\n const employee = await client(Employee).fetchOne(50030);\n expect(employee.$primaryKey).toEqual(50030);\n const points = await employee.employeeLocation?.getAllValues({\n $before: 1,\n $unit: \"month\",\n });\n expect(points).toBeDefined();\n expect(points!).toEqual([{\n time: \"2012-02-12\",\n value: { type: \"Point\", coordinates: [1.1, 1.1] },\n }, {\n time: \"2013-03-13\",\n value: { type: \"Point\", coordinates: [2.2, 2.2] },\n }, {\n time: \"2014-04-14\",\n value: { type: \"Point\", coordinates: [3.3, 3.3] },\n }]);\n });\n\n it(\"getAll values with after works\", async () => {\n const employee = await client(Employee).fetchOne(50030);\n expect(employee.$primaryKey).toEqual(50030);\n const points = await employee.employeeLocation?.getAllValues({\n $after: 1,\n $unit: \"month\",\n });\n expect(points).toBeDefined();\n expect(points!).toEqual([{\n time: \"2012-02-12\",\n value: { type: \"Point\", coordinates: [1.1, 1.1] },\n }, {\n time: \"2014-04-14\",\n value: { type: \"Point\", coordinates: [3.3, 3.3] },\n }]);\n });\n\n it(\"getAll points with absolute range works\", async () => {\n const employee = await client(Employee).fetchOne(50030);\n expect(employee.$primaryKey).toEqual(50030);\n const points = await employee.employeeLocation?.getAllValues({\n $startTime: \"2013-03-12T12:00:00.000Z\",\n $endTime: \"2014-04-14T12:00:00.000Z\",\n });\n expect(points).toBeDefined();\n expect(points!).toEqual([{\n time: \"2013-03-13\",\n value: { type: \"Point\", coordinates: [2.2, 2.2] },\n }, {\n time: \"2014-04-14\",\n value: { type: \"Point\", coordinates: [3.3, 3.3] },\n }]);\n });\n\n it(\"getAll points with no query works\", async () => {\n const employee = await client(Employee).fetchOne(50030);\n expect(employee.$primaryKey).toEqual(50030);\n const points = await employee.employeeLocation?.getAllValues();\n expect(points).toBeDefined();\n expect(points!).toEqual([\n { time: \"2012-02-12\", value: { type: \"Point\", coordinates: [1.1, 1.1] } },\n { time: \"2012-02-12\", value: { type: \"Point\", coordinates: [1.1, 1.1] } },\n {\n time: \"2013-03-13\",\n value: { type: \"Point\", coordinates: [2.2, 2.2] },\n },\n { time: \"2014-04-14\", value: { type: \"Point\", coordinates: [3.3, 3.3] } },\n { time: \"2014-04-14\", value: { type: \"Point\", coordinates: [3.3, 3.3] } },\n ]);\n });\n\n it(\"getAll points with no data works\", async () => {\n const employee = await client(Employee).fetchOne(50030);\n expect(employee.$primaryKey).toEqual(50030);\n const points = await employee.employeeLocation?.getAllValues({\n $startTime: \"2021-03-12T12:00:00.000Z\",\n $endTime: \"2022-04-14T12:00:00.000Z\",\n });\n expect(points).toBeDefined();\n expect(points!).toEqual([]);\n });\n\n it(\"async iter points with absolute range works\", async () => {\n const employee = await client(Employee).fetchOne(50030);\n expect(employee.$primaryKey).toEqual(50030);\n const pointsIter = employee.employeeLocation?.asyncIterValues({\n $startTime: \"2013-03-12T12:00:00.000Z\",\n $endTime: \"2014-04-14T12:00:00.000Z\",\n });\n\n const points: TimeSeriesPoint<GeoJSON.Point>[] = [];\n for await (const point of pointsIter!) {\n points.push(point);\n }\n expect(points).toBeDefined();\n expect(points!).toEqual([{\n time: \"2013-03-13\",\n value: { type: \"Point\", coordinates: [2.2, 2.2] },\n }, {\n time: \"2014-04-14\",\n value: { type: \"Point\", coordinates: [3.3, 3.3] },\n }]);\n });\n\n it(\"async iter points with no query\", async () => {\n const employee = await client(Employee).fetchOne(50030);\n expect(employee.$primaryKey).toEqual(50030);\n const pointsIter = employee.employeeLocation?.asyncIterValues();\n\n const points: TimeSeriesPoint<GeoJSON.Point>[] = [];\n for await (const point of pointsIter!) {\n points.push(point);\n }\n expect(points).toBeDefined();\n expect(points!).toEqual([\n { time: \"2012-02-12\", value: { type: \"Point\", coordinates: [1.1, 1.1] } },\n { time: \"2012-02-12\", value: { type: \"Point\", coordinates: [1.1, 1.1] } },\n {\n time: \"2013-03-13\",\n value: { type: \"Point\", coordinates: [2.2, 2.2] },\n },\n { time: \"2014-04-14\", value: { type: \"Point\", coordinates: [3.3, 3.3] } },\n { time: \"2014-04-14\", value: { type: \"Point\", coordinates: [3.3, 3.3] } },\n ]);\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,YAAY,EAAEC,QAAQ,QAAQ,4BAA4B;AACnE,SAASC,SAAS,QAAQ,mBAAmB;AAC7C,SAASC,QAAQ,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAElE,SAASC,YAAY,QAAQ,oBAAoB;AAEjDH,QAAQ,CAAC,YAAY,EAAE,MAAM;EAC3B,IAAII,MAAc;EAElBL,SAAS,CAAC,YAAY;IACpBF,SAAS,CAACQ,MAAM,CAAC,CAAC;IAClBD,MAAM,GAAGD,YAAY,CACnB,4BAA4B,EAC5BR,YAAY,EACZ,YAAY,eACd,CAAC;EACH,CAAC,CAAC;EAEFG,QAAQ,CAAC,MAAM;IACbD,SAAS,CAACS,KAAK,CAAC,CAAC;EACnB,CAAC,CAAC;EAEFJ,EAAE,CAAC,wBAAwB,EAAE,YAAY;IACvC,MAAMK,QAAQ,GAAG,MAAMH,MAAM,CAACR,QAAQ,CAAC,CAACY,QAAQ,CAAC,KAAK,CAAC;IACvD,MAAMC,SAAS,GAAG,MAAML,MAAM,CAACR,QAAQ,CAAC,CAACY,QAAQ,CAAC,KAAK,CAAC;IACxDP,MAAM,CAACM,QAAQ,CAACG,WAAW,CAAC,CAACC,OAAO,CAAC,KAAK,CAAC;IAC3CV,MAAM,CAACQ,SAAS,CAACC,WAAW,CAAC,CAACC,OAAO,CAAC,KAAK,CAAC;IAC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AAI,EAAE,OAAO;QAAEC,WAAW,EAAE,CAAC,GAAG,EAAE,GAAG;MAAE;IAAE,CAAC,EACzE;MAAEH,IAAI,EAAE,YAAY;MAAEC,KAAK,EAAE;QAAEC,IAAI,EAAE,OAAO;QAAEC,WAAW,EAAE,CAAC,GAAG,EAAE,GAAG;MAAE;IAAE,CAAC,EACzE;MACEH,IAAI,EAAE,YAAY;MAClBC,KAAK,EAAE;QAAEC,IAAI,EAAE,OAAO;QAAEC,WAAW,EAAE,CAAC,GAAG,EAAE,GAAG;MAAE;IAClD,CAAC,EACD;MAAEH,IAAI,EAAE,YAAY;MAAEC,KAAK,EAAE;QAAEC,IAAI,EAAE,OAAO;QAAEC,WAAW,EAAE,CAAC,GAAG,EAAE,GAAG;MAAE;IAAE,CAAC,EACzE;MAAEH,IAAI,EAAE,YAAY;MAAEC,KAAK,EAAE;QAAEC,IAAI,EAAE,OAAO;QAAEC,WAAW,EAAE,CAAC,GAAG,EAAE,GAAG;MAAE;IAAE,CAAC,CAC1E,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { $ontologyRid, objectTypeWithAllPropertyTypes } from "@osdk/client.test.ontology";
|
|
18
|
+
import { apiServer, stubData } from "@osdk/shared.test";
|
|
19
|
+
import { afterAll, beforeAll, describe, expect, it } from "vitest";
|
|
20
|
+
import { createClient } from "../createClient.js";
|
|
21
|
+
describe("media", () => {
|
|
22
|
+
let client;
|
|
23
|
+
beforeAll(async () => {
|
|
24
|
+
apiServer.listen();
|
|
25
|
+
client = createClient("https://stack.palantir.com", $ontologyRid, async () => "myAccessToken");
|
|
26
|
+
});
|
|
27
|
+
afterAll(() => {
|
|
28
|
+
apiServer.close();
|
|
29
|
+
});
|
|
30
|
+
it("reads media metadata successfully", async () => {
|
|
31
|
+
const result = await client(objectTypeWithAllPropertyTypes).where({
|
|
32
|
+
id: stubData.objectWithAllPropertyTypes1.id
|
|
33
|
+
}).fetchPage();
|
|
34
|
+
const object1 = result.data[0];
|
|
35
|
+
expect(object1.mediaReference).toBeDefined();
|
|
36
|
+
const mediaMetadata = await object1.mediaReference?.fetchMetadata();
|
|
37
|
+
expect(mediaMetadata).toBeDefined();
|
|
38
|
+
expect(mediaMetadata?.path).toEqual("file1.txt");
|
|
39
|
+
expect(mediaMetadata?.mediaType).toEqual("application/json");
|
|
40
|
+
expect(mediaMetadata?.sizeBytes).toEqual(20);
|
|
41
|
+
});
|
|
42
|
+
it("reads media content successfully", async () => {
|
|
43
|
+
const result = await client(objectTypeWithAllPropertyTypes).where({
|
|
44
|
+
id: stubData.objectWithAllPropertyTypes1.id
|
|
45
|
+
}).fetchPage();
|
|
46
|
+
const object1 = result.data[0];
|
|
47
|
+
expect(object1.mediaReference).toBeDefined();
|
|
48
|
+
const mediaContent = await object1?.mediaReference?.fetchContents();
|
|
49
|
+
const mediaText = await mediaContent.text();
|
|
50
|
+
expect(JSON.parse(mediaText)).toEqual({
|
|
51
|
+
content: "Hello World"
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
//# sourceMappingURL=media.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media.test.js","names":["$ontologyRid","objectTypeWithAllPropertyTypes","apiServer","stubData","afterAll","beforeAll","describe","expect","it","createClient","client","listen","close","result","where","id","objectWithAllPropertyTypes1","fetchPage","object1","data","mediaReference","toBeDefined","mediaMetadata","fetchMetadata","path","toEqual","mediaType","sizeBytes","mediaContent","fetchContents","mediaText","text","JSON","parse","content"],"sources":["media.test.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n $ontologyRid,\n objectTypeWithAllPropertyTypes,\n} from \"@osdk/client.test.ontology\";\nimport { apiServer, stubData } from \"@osdk/shared.test\";\nimport { afterAll, beforeAll, describe, expect, it } from \"vitest\";\nimport type { Client } from \"../Client.js\";\nimport { createClient } from \"../createClient.js\";\n\ndescribe(\"media\", () => {\n let client: Client;\n\n beforeAll(async () => {\n apiServer.listen();\n client = createClient(\n \"https://stack.palantir.com\",\n $ontologyRid,\n async () => \"myAccessToken\",\n );\n });\n\n afterAll(() => {\n apiServer.close();\n });\n\n it(\"reads media metadata successfully\", async () => {\n const result = await client(\n objectTypeWithAllPropertyTypes,\n )\n .where({ id: stubData.objectWithAllPropertyTypes1.id }).fetchPage();\n\n const object1 = result.data[0];\n expect(object1.mediaReference).toBeDefined();\n const mediaMetadata = await object1.mediaReference?.fetchMetadata();\n expect(mediaMetadata).toBeDefined();\n expect(mediaMetadata?.path).toEqual(\"file1.txt\");\n expect(mediaMetadata?.mediaType).toEqual(\"application/json\");\n expect(mediaMetadata?.sizeBytes).toEqual(20);\n });\n\n it(\"reads media content successfully\", async () => {\n const result = await client(objectTypeWithAllPropertyTypes)\n .where({ id: stubData.objectWithAllPropertyTypes1.id }).fetchPage();\n\n const object1 = result.data[0];\n expect(object1.mediaReference).toBeDefined();\n const mediaContent = await object1?.mediaReference?.fetchContents();\n const mediaText = await mediaContent!.text();\n expect(JSON.parse(mediaText)).toEqual({\n content: \"Hello World\",\n });\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,YAAY,EACZC,8BAA8B,QACzB,4BAA4B;AACnC,SAASC,SAAS,EAAEC,QAAQ,QAAQ,mBAAmB;AACvD,SAASC,QAAQ,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAElE,SAASC,YAAY,QAAQ,oBAAoB;AAEjDH,QAAQ,CAAC,OAAO,EAAE,MAAM;EACtB,IAAII,MAAc;EAElBL,SAAS,CAAC,YAAY;IACpBH,SAAS,CAACS,MAAM,CAAC,CAAC;IAClBD,MAAM,GAAGD,YAAY,CACnB,4BAA4B,EAC5BT,YAAY,EACZ,YAAY,eACd,CAAC;EACH,CAAC,CAAC;EAEFI,QAAQ,CAAC,MAAM;IACbF,SAAS,CAACU,KAAK,CAAC,CAAC;EACnB,CAAC,CAAC;EAEFJ,EAAE,CAAC,mCAAmC,EAAE,YAAY;IAClD,MAAMK,MAAM,GAAG,MAAMH,MAAM,CACzBT,8BACF,CAAC,CACEa,KAAK,CAAC;MAAEC,EAAE,EAAEZ,QAAQ,CAACa,2BAA2B,CAACD;IAAG,CAAC,CAAC,CAACE,SAAS,CAAC,CAAC;IAErE,MAAMC,OAAO,GAAGL,MAAM,CAACM,IAAI,CAAC,CAAC,CAAC;IAC9BZ,MAAM,CAACW,OAAO,CAACE,cAAc,CAAC,CAACC,WAAW,CAAC,CAAC;IAC5C,MAAMC,aAAa,GAAG,MAAMJ,OAAO,CAACE,cAAc,EAAEG,aAAa,CAAC,CAAC;IACnEhB,MAAM,CAACe,aAAa,CAAC,CAACD,WAAW,CAAC,CAAC;IACnCd,MAAM,CAACe,aAAa,EAAEE,IAAI,CAAC,CAACC,OAAO,CAAC,WAAW,CAAC;IAChDlB,MAAM,CAACe,aAAa,EAAEI,SAAS,CAAC,CAACD,OAAO,CAAC,kBAAkB,CAAC;IAC5DlB,MAAM,CAACe,aAAa,EAAEK,SAAS,CAAC,CAACF,OAAO,CAAC,EAAE,CAAC;EAC9C,CAAC,CAAC;EAEFjB,EAAE,CAAC,kCAAkC,EAAE,YAAY;IACjD,MAAMK,MAAM,GAAG,MAAMH,MAAM,CAACT,8BAA8B,CAAC,CACxDa,KAAK,CAAC;MAAEC,EAAE,EAAEZ,QAAQ,CAACa,2BAA2B,CAACD;IAAG,CAAC,CAAC,CAACE,SAAS,CAAC,CAAC;IAErE,MAAMC,OAAO,GAAGL,MAAM,CAACM,IAAI,CAAC,CAAC,CAAC;IAC9BZ,MAAM,CAACW,OAAO,CAACE,cAAc,CAAC,CAACC,WAAW,CAAC,CAAC;IAC5C,MAAMO,YAAY,GAAG,MAAMV,OAAO,EAAEE,cAAc,EAAES,aAAa,CAAC,CAAC;IACnE,MAAMC,SAAS,GAAG,MAAMF,YAAY,CAAEG,IAAI,CAAC,CAAC;IAC5CxB,MAAM,CAACyB,IAAI,CAACC,KAAK,CAACH,SAAS,CAAC,CAAC,CAACL,OAAO,CAAC;MACpCS,OAAO,EAAE;IACX,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
export function isMediaReference(o) {
|
|
18
|
+
return typeof o === `object` && typeof o.mimeType === "string" && "reference" in o && typeof o.reference === "object" && o.reference.type === "mediaSetViewItem" && "mediaSetViewItem" in o.reference && typeof o.reference.mediaSetViewItem === "object" && typeof o.reference.mediaSetViewItem.mediaSetRid === "string" && typeof o.reference.mediaSetViewItem.mediaSetViewRid === "string" && typeof o.reference.mediaSetViewItem.mediaItemRid === "string";
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=mediaUpload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mediaUpload.js","names":["isMediaReference","o","mimeType","reference","type","mediaSetViewItem","mediaSetRid","mediaSetViewRid","mediaItemRid"],"sources":["mediaUpload.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { MediaReference } from \"@osdk/api\";\n\nexport function isMediaReference(o: any): o is MediaReference {\n return typeof o === `object`\n && typeof o.mimeType === \"string\"\n && \"reference\" in o\n && typeof o.reference === \"object\"\n && o.reference.type === \"mediaSetViewItem\"\n && \"mediaSetViewItem\" in o.reference\n && typeof o.reference.mediaSetViewItem === \"object\"\n && typeof o.reference.mediaSetViewItem.mediaSetRid === \"string\"\n && typeof o.reference.mediaSetViewItem.mediaSetViewRid === \"string\"\n && typeof o.reference.mediaSetViewItem.mediaItemRid === \"string\";\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,OAAO,SAASA,gBAAgBA,CAACC,CAAM,EAAuB;EAC5D,OAAO,OAAOA,CAAC,KAAK,QAAQ,IACvB,OAAOA,CAAC,CAACC,QAAQ,KAAK,QAAQ,IAC9B,WAAW,IAAID,CAAC,IAChB,OAAOA,CAAC,CAACE,SAAS,KAAK,QAAQ,IAC/BF,CAAC,CAACE,SAAS,CAACC,IAAI,KAAK,kBAAkB,IACvC,kBAAkB,IAAIH,CAAC,CAACE,SAAS,IACjC,OAAOF,CAAC,CAACE,SAAS,CAACE,gBAAgB,KAAK,QAAQ,IAChD,OAAOJ,CAAC,CAACE,SAAS,CAACE,gBAAgB,CAACC,WAAW,KAAK,QAAQ,IAC5D,OAAOL,CAAC,CAACE,SAAS,CAACE,gBAAgB,CAACE,eAAe,KAAK,QAAQ,IAChE,OAAON,CAAC,CAACE,SAAS,CAACE,gBAAgB,CAACG,YAAY,KAAK,QAAQ;AACpE","ignoreList":[]}
|