@osdk/client 2.1.0-beta.22 → 2.1.0-beta.24
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 +42 -0
- package/build/browser/Client.js +6 -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 +7 -1
- package/build/browser/__unstable/ConjureSupport.js.map +1 -1
- package/build/browser/__unstable/createBulkLinksAsyncIterFactory.js +4 -0
- 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 +37 -4
- package/build/browser/actions/actions.test.js.map +1 -1
- package/build/browser/actions/applyAction.js +1 -0
- package/build/browser/actions/applyAction.js.map +1 -1
- package/build/browser/createClient.js +10 -5
- package/build/browser/createClient.js.map +1 -1
- package/build/browser/createClient.test.js +1 -0
- package/build/browser/createClient.test.js.map +1 -1
- package/build/browser/createGeotimeSeriesProperty.js +1 -1
- 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 +2 -0
- 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 +1 -0
- 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 +5 -0
- package/build/browser/fetchMetadata.test.js.map +1 -1
- package/build/browser/index.js +1 -0
- package/build/browser/index.js.map +1 -1
- package/build/browser/intellisense.test.helpers/callsQueryAcceptsObject.js +2 -0
- 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 +3 -0
- package/build/browser/internal/conversions/modernToLegacyWhereClause.js.map +1 -1
- package/build/browser/internal/conversions/modernToLegacyWhereClause.test.js +1 -0
- package/build/browser/internal/conversions/modernToLegacyWhereClause.test.js.map +1 -1
- package/build/browser/object/AttachmentUpload.js +1 -0
- 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 +9 -0
- 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 +3 -0
- package/build/browser/object/aggregate.js.map +1 -1
- package/build/browser/object/aggregate.test.js +5 -0
- 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 -0
- 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 +2 -0
- 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 +1 -0
- package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.test.js +1 -0
- package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.test.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.js +14 -1
- package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/getDollarAs.js +6 -0
- package/build/browser/object/convertWireToOsdkObjects/getDollarAs.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/getDollarLink.js +1 -0
- package/build/browser/object/convertWireToOsdkObjects/getDollarLink.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects.js +11 -0
- package/build/browser/object/convertWireToOsdkObjects.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects.test.js +21 -0
- package/build/browser/object/convertWireToOsdkObjects.test.js.map +1 -1
- package/build/browser/object/fetchPage.js +7 -0
- package/build/browser/object/fetchPage.js.map +1 -1
- package/build/browser/object/fetchPage.test.js +5 -0
- 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/object.test.js +8 -0
- package/build/browser/object/object.test.js.map +1 -1
- package/build/browser/object/timeseries.test.js +1 -0
- package/build/browser/object/timeseries.test.js.map +1 -1
- package/build/browser/objectSet/InterfaceObjectSet.test.js +4 -0
- package/build/browser/objectSet/InterfaceObjectSet.test.js.map +1 -1
- package/build/browser/objectSet/ObjectSet.test.js +13 -0
- 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 +18 -1
- package/build/browser/objectSet/ObjectSetListenerWebsocket.js.map +1 -1
- package/build/browser/objectSet/ObjectSetListenerWebsocket.test.js +8 -1
- 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 +5 -0
- package/build/browser/objectSet/createObjectSet.js.map +1 -1
- 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 +1 -0
- package/build/browser/ontology/loadActionMetadata.js.map +1 -1
- package/build/browser/ontology/loadFullObjectMetadata.js +1 -0
- package/build/browser/ontology/loadFullObjectMetadata.js.map +1 -1
- package/build/browser/ontology/loadInterfaceMetadata.js +1 -0
- package/build/browser/ontology/loadInterfaceMetadata.js.map +1 -1
- package/build/browser/ontology/loadQueryMetadata.js +1 -0
- 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 +1 -0
- package/build/browser/public/internal.js.map +1 -1
- package/build/browser/public/unstable-do-not-use.js +1 -0
- package/build/browser/public/unstable-do-not-use.js.map +1 -1
- package/build/browser/public-utils/createAndFetchTempObjectSetRid.js +3 -1
- package/build/browser/public-utils/createAndFetchTempObjectSetRid.js.map +1 -1
- package/build/browser/public-utils/hydrateAttachmentFromRid.js +3 -1
- package/build/browser/public-utils/hydrateAttachmentFromRid.js.map +1 -1
- package/build/browser/public-utils/hydrateObjectSetFromRid.js +7 -5
- package/build/browser/public-utils/hydrateObjectSetFromRid.js.map +1 -1
- package/build/browser/queries/applyQuery.js +1 -0
- package/build/browser/queries/applyQuery.js.map +1 -1
- package/build/browser/queries/queries.test.js +2 -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 +5 -0
- package/build/browser/util/datetimeConverters.js.map +1 -1
- package/build/browser/util/datetimeConverters.test.js +1 -0
- package/build/browser/util/datetimeConverters.test.js.map +1 -1
- 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 +1 -0
- package/build/browser/util/objectSetUtils.js.map +1 -1
- 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 +1 -0
- package/build/browser/util/timeseriesUtils.js.map +1 -1
- package/build/browser/util/toDataValue.js +16 -0
- package/build/browser/util/toDataValue.js.map +1 -1
- package/build/browser/util/toDataValue.test.js +1 -0
- package/build/browser/util/toDataValue.test.js.map +1 -1
- package/build/browser/util/toDataValueQueries.js +3 -0
- package/build/browser/util/toDataValueQueries.js.map +1 -1
- package/build/cjs/Client-BZcoRu7n.d.cts +67 -0
- package/build/cjs/chunk-Q4BVHDNO.cjs +460 -0
- package/build/cjs/chunk-Q4BVHDNO.cjs.map +1 -0
- package/build/cjs/chunk-RWHJNRHF.cjs +887 -0
- package/build/cjs/chunk-RWHJNRHF.cjs.map +1 -0
- package/build/cjs/index.cjs +1628 -0
- package/build/cjs/index.cjs.map +1 -0
- package/build/cjs/index.d.cts +85 -0
- package/build/cjs/public/internal.cjs +35 -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 +12 -0
- package/build/cjs/public/unstable-do-not-use.cjs.map +1 -0
- package/build/cjs/public/unstable-do-not-use.d.cts +5 -0
- package/build/esm/Client.js +6 -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 +7 -1
- package/build/esm/__unstable/ConjureSupport.js.map +1 -1
- package/build/esm/__unstable/createBulkLinksAsyncIterFactory.js +4 -0
- 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 +37 -4
- package/build/esm/actions/actions.test.js.map +1 -1
- package/build/esm/actions/applyAction.js +1 -0
- package/build/esm/actions/applyAction.js.map +1 -1
- package/build/esm/createClient.js +10 -5
- package/build/esm/createClient.js.map +1 -1
- package/build/esm/createClient.test.js +1 -0
- package/build/esm/createClient.test.js.map +1 -1
- package/build/esm/createGeotimeSeriesProperty.js +1 -1
- 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 +2 -0
- 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 +1 -0
- 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 +5 -0
- package/build/esm/fetchMetadata.test.js.map +1 -1
- package/build/esm/index.js +1 -0
- package/build/esm/index.js.map +1 -1
- package/build/esm/intellisense.test.helpers/callsQueryAcceptsObject.js +2 -0
- 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 +3 -0
- package/build/esm/internal/conversions/modernToLegacyWhereClause.js.map +1 -1
- package/build/esm/internal/conversions/modernToLegacyWhereClause.test.js +1 -0
- package/build/esm/internal/conversions/modernToLegacyWhereClause.test.js.map +1 -1
- package/build/esm/object/AttachmentUpload.js +1 -0
- 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 +9 -0
- 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 +3 -0
- package/build/esm/object/aggregate.js.map +1 -1
- package/build/esm/object/aggregate.test.js +5 -0
- 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 -0
- 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 +2 -0
- 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 +1 -0
- package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.test.js +1 -0
- package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.test.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/createOsdkObject.js +14 -1
- package/build/esm/object/convertWireToOsdkObjects/createOsdkObject.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/getDollarAs.js +6 -0
- package/build/esm/object/convertWireToOsdkObjects/getDollarAs.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/getDollarLink.js +1 -0
- package/build/esm/object/convertWireToOsdkObjects/getDollarLink.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects.js +11 -0
- package/build/esm/object/convertWireToOsdkObjects.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects.test.js +21 -0
- package/build/esm/object/convertWireToOsdkObjects.test.js.map +1 -1
- package/build/esm/object/fetchPage.js +7 -0
- package/build/esm/object/fetchPage.js.map +1 -1
- package/build/esm/object/fetchPage.test.js +5 -0
- 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/object.test.js +8 -0
- package/build/esm/object/object.test.js.map +1 -1
- package/build/esm/object/timeseries.test.js +1 -0
- package/build/esm/object/timeseries.test.js.map +1 -1
- package/build/esm/objectSet/InterfaceObjectSet.test.js +4 -0
- package/build/esm/objectSet/InterfaceObjectSet.test.js.map +1 -1
- package/build/esm/objectSet/ObjectSet.test.js +13 -0
- 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 +18 -1
- package/build/esm/objectSet/ObjectSetListenerWebsocket.js.map +1 -1
- package/build/esm/objectSet/ObjectSetListenerWebsocket.test.js +8 -1
- 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 +5 -0
- package/build/esm/objectSet/createObjectSet.js.map +1 -1
- 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 +1 -0
- package/build/esm/ontology/loadActionMetadata.js.map +1 -1
- package/build/esm/ontology/loadFullObjectMetadata.js +1 -0
- package/build/esm/ontology/loadFullObjectMetadata.js.map +1 -1
- package/build/esm/ontology/loadInterfaceMetadata.js +1 -0
- package/build/esm/ontology/loadInterfaceMetadata.js.map +1 -1
- package/build/esm/ontology/loadQueryMetadata.js +1 -0
- 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 +1 -0
- package/build/esm/public/internal.js.map +1 -1
- package/build/esm/public/unstable-do-not-use.js +1 -0
- package/build/esm/public/unstable-do-not-use.js.map +1 -1
- package/build/esm/public-utils/createAndFetchTempObjectSetRid.js +3 -1
- package/build/esm/public-utils/createAndFetchTempObjectSetRid.js.map +1 -1
- package/build/esm/public-utils/hydrateAttachmentFromRid.js +3 -1
- package/build/esm/public-utils/hydrateAttachmentFromRid.js.map +1 -1
- package/build/esm/public-utils/hydrateObjectSetFromRid.js +7 -5
- package/build/esm/public-utils/hydrateObjectSetFromRid.js.map +1 -1
- package/build/esm/queries/applyQuery.js +1 -0
- package/build/esm/queries/applyQuery.js.map +1 -1
- package/build/esm/queries/queries.test.js +2 -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 +5 -0
- package/build/esm/util/datetimeConverters.js.map +1 -1
- package/build/esm/util/datetimeConverters.test.js +1 -0
- package/build/esm/util/datetimeConverters.test.js.map +1 -1
- 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 +1 -0
- package/build/esm/util/objectSetUtils.js.map +1 -1
- 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 +1 -0
- package/build/esm/util/timeseriesUtils.js.map +1 -1
- package/build/esm/util/toDataValue.js +16 -0
- package/build/esm/util/toDataValue.js.map +1 -1
- package/build/esm/util/toDataValue.test.js +1 -0
- package/build/esm/util/toDataValue.test.js.map +1 -1
- package/build/esm/util/toDataValueQueries.js +3 -0
- package/build/esm/util/toDataValueQueries.js.map +1 -1
- package/build/types/Client.d.ts +20 -0
- package/build/types/Definitions.test.d.ts +1 -0
- package/build/types/Logger.d.ts +18 -0
- package/build/types/MinimalClientContext.d.ts +21 -0
- package/build/types/ResultOrError.d.ts +9 -0
- package/build/types/SatisfiesSemver.d.ts +10 -0
- package/build/types/SatisfiesSemver.test.d.ts +1 -0
- package/build/types/__unstable/ConjureSupport.d.ts +37 -0
- package/build/{browser → types}/__unstable/createBulkLinksAsyncIterFactory.d.ts +0 -1
- package/build/types/actions/ActionValidationError.d.ts +5 -0
- package/build/types/actions/actions.test.d.ts +1 -0
- package/build/{esm → types}/actions/applyAction.d.ts +17 -16
- package/build/{browser → types}/createClient.d.ts +1 -4
- package/build/types/createClient.test.d.ts +1 -0
- package/build/types/createGeotimeSeriesProperty.d.ts +13 -0
- package/build/types/createMediaReferenceProperty.d.ts +13 -0
- package/build/types/createMinimalClient.d.ts +1 -0
- package/build/types/createPlatformClient.d.ts +15 -0
- package/build/types/createTimeseriesProperty.d.ts +13 -0
- package/build/types/definitions/LinkDefinitions.test.d.ts +1 -0
- package/build/types/fetchMetadata.d.ts +1 -0
- package/build/types/fetchMetadata.test.d.ts +1 -0
- package/build/types/index.d.ts +12 -0
- package/build/types/intellisense.test.d.ts +1 -0
- package/build/types/intellisense.test.helpers/callsQueryAcceptsObject.d.ts +1 -0
- package/build/types/internal/conversions/legacyToModernSingleAggregationResult.d.ts +1 -0
- package/build/types/internal/conversions/modernToLegacyAggregationClause.d.ts +1 -0
- package/build/types/internal/conversions/modernToLegacyGroupByClause.d.ts +1 -0
- package/build/{browser → types}/internal/conversions/modernToLegacyWhereClause.d.ts +0 -1
- package/build/types/internal/conversions/modernToLegacyWhereClause.test.d.ts +1 -0
- package/build/{browser → types}/object/AttachmentUpload.d.ts +0 -1
- package/build/types/object/Cache.d.ts +17 -0
- package/build/types/object/Cache.test.d.ts +8 -0
- package/build/types/object/SimpleCache.d.ts +52 -0
- package/build/types/object/aggregate.d.ts +1 -0
- package/build/types/object/aggregate.test.d.ts +1 -0
- package/build/types/object/attachment.test.d.ts +1 -0
- package/build/types/object/convertWireToOsdkObjects/InterfaceHolder.d.ts +1 -0
- package/build/{browser → types}/object/convertWireToOsdkObjects/InternalSymbols.d.ts +3 -4
- package/build/types/object/convertWireToOsdkObjects/ObjectHolder.d.ts +1 -0
- package/build/{esm → types}/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.d.ts +8 -11
- package/build/types/object/convertWireToOsdkObjects/PropertyDescriptorRecord.d.ts +5 -0
- package/build/types/object/convertWireToOsdkObjects/createOsdkInterface.d.ts +1 -0
- package/build/types/object/convertWireToOsdkObjects/createOsdkInterface.test.d.ts +1 -0
- package/build/types/object/convertWireToOsdkObjects/createOsdkObject.d.ts +1 -0
- package/build/{browser → types}/object/convertWireToOsdkObjects/getDollarAs.d.ts +0 -1
- package/build/types/object/convertWireToOsdkObjects/getDollarLink.d.ts +1 -0
- package/build/types/object/convertWireToOsdkObjects.d.ts +1 -0
- package/build/types/object/convertWireToOsdkObjects.test.d.ts +1 -0
- package/build/types/object/fetchPage.d.ts +5 -0
- package/build/types/object/fetchPage.test.d.ts +1 -0
- package/build/types/object/fetchSingle.d.ts +1 -0
- package/build/types/object/geotimeseriesreference.test.d.ts +1 -0
- package/build/types/object/media.test.d.ts +1 -0
- package/build/{esm → types}/object/object.test.d.ts +0 -1
- package/build/types/object/timeseries.test.d.ts +1 -0
- package/build/types/objectSet/InterfaceObjectSet.test.d.ts +1 -0
- package/build/types/objectSet/ObjectSet.test.d.ts +7 -0
- package/build/types/objectSet/ObjectSetFactory.d.ts +1 -0
- package/build/types/objectSet/ObjectSetListenerWebsocket.d.ts +1 -0
- package/build/types/objectSet/ObjectSetListenerWebsocket.test.d.ts +1 -0
- package/build/types/objectSet/conjureUnionType.d.ts +11 -0
- package/build/types/objectSet/createObjectSet.d.ts +1 -0
- package/build/types/ontology/OntologyProvider.d.ts +27 -0
- package/build/{browser → types}/ontology/StandardOntologyProvider.d.ts +1 -3
- package/build/types/ontology/StandardOntologyProvider.test.d.ts +1 -0
- package/build/{browser → types}/ontology/loadActionMetadata.d.ts +0 -1
- package/build/{esm → types}/ontology/loadFullObjectMetadata.d.ts +1 -4
- package/build/{esm → types}/ontology/loadInterfaceMetadata.d.ts +0 -1
- package/build/{browser → types}/ontology/loadQueryMetadata.d.ts +0 -1
- package/build/{browser → types}/ontology/makeConjureContext.d.ts +0 -1
- package/build/types/pageRequestAsAsyncIter.d.ts +10 -0
- package/build/{browser → types}/public/internal.d.ts +0 -1
- package/build/{browser → types}/public/unstable-do-not-use.d.ts +0 -1
- package/build/types/public-utils/createAndFetchTempObjectSetRid.d.ts +10 -0
- package/build/types/public-utils/hydrateAttachmentFromRid.d.ts +9 -0
- package/build/types/public-utils/hydrateObjectSetFromRid.d.ts +10 -0
- package/build/{browser → types}/queries/applyQuery.d.ts +4 -2
- package/build/types/queries/queries.test.d.ts +1 -0
- package/build/{esm → types}/queries/types.d.ts +3 -12
- package/build/{browser → types}/tsserver.d.ts +18 -18
- package/build/{browser → types}/util/ArrayElement.d.ts +0 -1
- package/build/types/util/NOOP.d.ts +1 -0
- package/build/types/util/NullableProps.d.ts +1 -0
- package/build/{browser → types}/util/UserAgent.d.ts +0 -1
- package/build/types/util/WireObjectSet.d.ts +1 -0
- package/build/{esm → types}/util/addUserAgentAndRequestContextHeaders.d.ts +0 -1
- package/build/{browser → types}/util/augmentRequestContext.d.ts +6 -7
- package/build/types/util/datetimeConverters.d.ts +21 -0
- package/build/types/util/datetimeConverters.test.d.ts +1 -0
- package/build/types/util/interfaceUtils.d.ts +1 -0
- package/build/types/util/isOntologyObjectV2.d.ts +1 -0
- package/build/{esm/util/isOsdkObject.d.ts → types/util/isOsdkBaseObject.d.ts} +0 -1
- package/build/{browser → types}/util/isOsdkObject.d.ts +0 -1
- package/build/{browser → types}/util/objectSetUtils.d.ts +0 -1
- package/build/types/util/partialBy.d.ts +8 -0
- package/build/{browser → types}/util/streamutils.d.ts +0 -1
- package/build/{browser → types}/util/timeseriesUtils.d.ts +2 -3
- package/build/types/util/toDataValue.d.ts +1 -0
- package/build/types/util/toDataValue.test.d.ts +1 -0
- package/build/types/util/toDataValueQueries.d.ts +1 -0
- package/index.d.ts +17 -0
- package/internal.d.ts +17 -0
- package/package.json +49 -18
- package/unstable-do-not-use.d.ts +1 -1
- package/build/browser/Client.d.ts +0 -23
- 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 -38
- package/build/browser/__unstable/ConjureSupport.d.ts.map +0 -1
- 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/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 -13
- 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.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.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.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 -18
- 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.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/InterfaceObjectSet.test.d.ts +0 -2
- package/build/browser/objectSet/InterfaceObjectSet.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/ontology/OntologyProvider.d.ts +0 -32
- package/build/browser/ontology/OntologyProvider.d.ts.map +0 -1
- 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.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.map +0 -1
- 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/internal.d.ts.map +0 -1
- package/build/browser/public/unstable-do-not-use.d.ts.map +0 -1
- package/build/browser/public-utils/createAndFetchTempObjectSetRid.d.ts +0 -11
- package/build/browser/public-utils/createAndFetchTempObjectSetRid.d.ts.map +0 -1
- package/build/browser/public-utils/hydrateAttachmentFromRid.d.ts +0 -10
- package/build/browser/public-utils/hydrateAttachmentFromRid.d.ts.map +0 -1
- package/build/browser/public-utils/hydrateObjectSetFromRid.d.ts +0 -11
- package/build/browser/public-utils/hydrateObjectSetFromRid.d.ts.map +0 -1
- 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.map +0 -1
- 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.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.map +0 -1
- package/build/browser/util/datetimeConverters.d.ts +0 -22
- package/build/browser/util/datetimeConverters.d.ts.map +0 -1
- package/build/browser/util/datetimeConverters.test.d.ts +0 -2
- package/build/browser/util/datetimeConverters.test.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.map +0 -1
- package/build/browser/util/objectSetUtils.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.map +0 -1
- 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 -23
- 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 -38
- 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.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 -13
- 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.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.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/InterfaceObjectSet.test.d.ts +0 -2
- package/build/esm/objectSet/InterfaceObjectSet.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/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.map +0 -1
- 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/internal.d.ts +0 -4
- package/build/esm/public/internal.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/public-utils/createAndFetchTempObjectSetRid.d.ts +0 -11
- package/build/esm/public-utils/createAndFetchTempObjectSetRid.d.ts.map +0 -1
- package/build/esm/public-utils/hydrateAttachmentFromRid.d.ts +0 -10
- package/build/esm/public-utils/hydrateAttachmentFromRid.d.ts.map +0 -1
- package/build/esm/public-utils/hydrateObjectSetFromRid.d.ts +0 -11
- package/build/esm/public-utils/hydrateObjectSetFromRid.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.map +0 -1
- package/build/esm/tsserver.d.ts +0 -32
- 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.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/datetimeConverters.d.ts +0 -22
- package/build/esm/util/datetimeConverters.d.ts.map +0 -1
- package/build/esm/util/datetimeConverters.test.d.ts +0 -2
- package/build/esm/util/datetimeConverters.test.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.map +0 -1
- package/build/esm/util/objectSetUtils.d.ts +0 -4
- package/build/esm/util/objectSetUtils.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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,47 @@
|
|
|
1
1
|
# @osdk/client
|
|
2
2
|
|
|
3
|
+
## 2.1.0-beta.24
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 03f95eb: Add support for interface params in actions.
|
|
8
|
+
- c691c8b: Package now has experimental support for commonjs
|
|
9
|
+
- 3c9ac22: Cleaning up where clause types.
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [03f95eb]
|
|
14
|
+
- Updated dependencies [c691c8b]
|
|
15
|
+
- Updated dependencies [3c9ac22]
|
|
16
|
+
- @osdk/generator-converters@2.1.0-beta.24
|
|
17
|
+
- @osdk/api@2.1.0-beta.24
|
|
18
|
+
- @osdk/shared.client.impl@1.1.0-beta.5
|
|
19
|
+
- @osdk/shared.net.errors@2.1.0-beta.2
|
|
20
|
+
- @osdk/shared.net.fetch@1.1.0-beta.3
|
|
21
|
+
- @osdk/client.unstable@2.1.0-beta.24
|
|
22
|
+
|
|
23
|
+
## 2.1.0-beta.23
|
|
24
|
+
|
|
25
|
+
### Minor Changes
|
|
26
|
+
|
|
27
|
+
- d794c19: Adding support for struct action params.
|
|
28
|
+
- 7a95618: Generate new OMS APIs
|
|
29
|
+
- 62c1d63: Add support for reading media reference property in OSDK.
|
|
30
|
+
- 3fc2ee6: Include more descriptive JS docs for public utils
|
|
31
|
+
- d665147: Update platform sdk deps
|
|
32
|
+
|
|
33
|
+
### Patch Changes
|
|
34
|
+
|
|
35
|
+
- Updated dependencies [d794c19]
|
|
36
|
+
- Updated dependencies [f0b519d]
|
|
37
|
+
- Updated dependencies [7a95618]
|
|
38
|
+
- Updated dependencies [62c1d63]
|
|
39
|
+
- Updated dependencies [83e7ea3]
|
|
40
|
+
- Updated dependencies [d665147]
|
|
41
|
+
- @osdk/generator-converters@2.1.0-beta.23
|
|
42
|
+
- @osdk/api@2.1.0-beta.23
|
|
43
|
+
- @osdk/client.unstable@2.1.0-beta.23
|
|
44
|
+
|
|
3
45
|
## 2.1.0-beta.22
|
|
4
46
|
|
|
5
47
|
### Minor Changes
|
package/build/browser/Client.js
CHANGED
|
@@ -13,10 +13,16 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
|
|
18
|
+
|
|
16
19
|
// DO NOT EXPORT FROM PACKAGE
|
|
17
20
|
/** @internal */
|
|
18
21
|
export const additionalContext = Symbol("additionalContext");
|
|
22
|
+
|
|
19
23
|
// BEGIN: THIS IS GENERATED CODE. DO NOT EDIT.
|
|
20
24
|
const MaxOsdkVersion = "2.1.0";
|
|
25
|
+
// END: THIS IS GENERATED CODE. DO NOT EDIT.
|
|
26
|
+
|
|
21
27
|
const ErrorMessage = Symbol("ErrorMessage");
|
|
22
28
|
//# sourceMappingURL=Client.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Client.js","names":["additionalContext","Symbol","MaxOsdkVersion","ErrorMessage"],"sources":["Client.
|
|
1
|
+
{"version":3,"file":"Client.js","names":["additionalContext","Symbol","MaxOsdkVersion","ErrorMessage"],"sources":["Client.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 ActionDefinition,\n ActionMetadata,\n CompileTimeMetadata,\n InterfaceDefinition,\n InterfaceMetadata,\n ObjectMetadata,\n ObjectSet,\n ObjectTypeDefinition,\n QueryDefinition,\n QueryMetadata,\n VersionBound,\n} from \"@osdk/api\";\nimport type {\n Experiment,\n ExperimentFns,\n MinimalObjectSet,\n} from \"@osdk/api/unstable\";\nimport type { SharedClient } from \"@osdk/shared.client2\";\nimport type { ActionSignatureFromDef } from \"./actions/applyAction.js\";\nimport type { MinimalClient } from \"./MinimalClientContext.js\";\nimport type { QuerySignatureFromDef } from \"./queries/types.js\";\nimport type { SatisfiesSemver } from \"./SatisfiesSemver.js\";\n\n// eslint-disable-next-line @typescript-eslint/consistent-type-imports\ntype OldSharedClient = import(\"@osdk/shared.client\").SharedClient;\n\nexport type CheckVersionBound<Q> = Q extends VersionBound<infer V> ? (\n SatisfiesSemver<V, MaxOsdkVersion> extends true ? Q\n : Q & {\n [ErrorMessage]:\n `Your SDK requires a semver compatible version with ${V}. You have ${MaxOsdkVersion}. Update your package.json`;\n }\n )\n : Q;\n\nexport interface Client extends SharedClient, OldSharedClient {\n <Q extends ObjectTypeDefinition>(\n o: Q,\n ): unknown extends CompileTimeMetadata<Q>[\"objectSet\"] ? ObjectSet<Q>\n : CompileTimeMetadata<Q>[\"objectSet\"];\n\n <Q extends (InterfaceDefinition)>(\n o: Q,\n ): unknown extends CompileTimeMetadata<Q>[\"objectSet\"] ? MinimalObjectSet<Q>\n : CompileTimeMetadata<Q>[\"objectSet\"];\n\n <Q extends ActionDefinition<any>>(\n o: Q,\n ): ActionSignatureFromDef<Q>;\n\n <Q extends QueryDefinition<any>>(\n o: Q,\n ): QuerySignatureFromDef<Q>;\n\n <Q extends Experiment<\"2.0.8\"> | Experiment<\"2.1.0\">>(\n experiment: Q,\n ): ExperimentFns<Q>;\n\n fetchMetadata<\n Q extends (\n | ObjectTypeDefinition\n | InterfaceDefinition\n | ActionDefinition<any>\n | QueryDefinition<any>\n ),\n >(o: Q): Promise<\n Q extends ObjectTypeDefinition ? ObjectMetadata\n : Q extends InterfaceDefinition ? InterfaceMetadata\n : Q extends ActionDefinition<any> ? ActionMetadata\n : Q extends QueryDefinition<any> ? QueryMetadata\n : never\n >;\n\n /** @internal */\n [additionalContext]: MinimalClient;\n}\n\n// DO NOT EXPORT FROM PACKAGE\n/** @internal */\nexport const additionalContext: unique symbol = Symbol(\"additionalContext\");\n\n// BEGIN: THIS IS GENERATED CODE. DO NOT EDIT.\nconst MaxOsdkVersion = \"2.1.0\";\n// END: THIS IS GENERATED CODE. DO NOT EDIT.\nexport type MaxOsdkVersion = typeof MaxOsdkVersion;\nconst ErrorMessage: unique symbol = Symbol(\"ErrorMessage\");\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA0BA;;AAsDA;AACA;AACA,OAAO,MAAMA,iBAAgC,GAAGC,MAAM,CAAC,mBAAmB,CAAC;;AAE3E;AACA,MAAMC,cAAc,GAAG,OAAO;AAC9B;;AAEA,MAAMC,YAA2B,GAAGF,MAAM,CAAC,cAAc,CAAC","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 { describe, expectTypeOf, it } from "vitest";
|
|
17
18
|
describe("OsdkObjectPropertyType", () => {
|
|
18
19
|
describe("{ nullable: false } property", () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Definitions.test.js","names":["describe","expectTypeOf","it","toEqualTypeOf"],"sources":["Definitions.test.
|
|
1
|
+
{"version":3,"file":"Definitions.test.js","names":["describe","expectTypeOf","it","toEqualTypeOf"],"sources":["Definitions.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 { ObjectMetadata, OsdkObjectPropertyType } from \"@osdk/api\";\nimport { describe, expectTypeOf, it } from \"vitest\";\n\ndescribe(\"OsdkObjectPropertyType\", () => {\n describe(\"{ nullable: false } property\", () => {\n const nonNullDef = {\n type: \"string\",\n nullable: false,\n } satisfies ObjectMetadata.Property;\n\n it(\"is `| undefined` for `false`\", () => {\n expectTypeOf<OsdkObjectPropertyType<typeof nonNullDef, false>>()\n .toEqualTypeOf<string | undefined>();\n });\n\n it(\"is not `| undefined` for `true`\", () => {\n expectTypeOf<OsdkObjectPropertyType<typeof nonNullDef, true>>()\n .toEqualTypeOf<string>();\n });\n });\n\n describe(\"{ nullable: true } property\", () => {\n const nullableDef = {\n type: \"string\",\n nullable: true,\n } satisfies ObjectMetadata.Property;\n\n it(\"is | undefined for `false`\", () => {\n expectTypeOf<OsdkObjectPropertyType<typeof nullableDef, false>>()\n .toEqualTypeOf<string | undefined>();\n });\n\n it(\"is `| undefined` for `true`\", () => {\n expectTypeOf<OsdkObjectPropertyType<typeof nullableDef, true>>()\n .toEqualTypeOf<string | undefined>();\n });\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,QAAQ,EAAEC,YAAY,EAAEC,EAAE,QAAQ,QAAQ;AAEnDF,QAAQ,CAAC,wBAAwB,EAAE,MAAM;EACvCA,QAAQ,CAAC,8BAA8B,EAAE,MAAM;IAM7CE,EAAE,CAAC,8BAA8B,EAAE,MAAM;MACvCD,YAAY,CAAmD,CAAC,CAC7DE,aAAa,CAAqB,CAAC;IACxC,CAAC,CAAC;IAEFD,EAAE,CAAC,iCAAiC,EAAE,MAAM;MAC1CD,YAAY,CAAkD,CAAC,CAC5DE,aAAa,CAAS,CAAC;IAC5B,CAAC,CAAC;EACJ,CAAC,CAAC;EAEFH,QAAQ,CAAC,6BAA6B,EAAE,MAAM;IAM5CE,EAAE,CAAC,4BAA4B,EAAE,MAAM;MACrCD,YAAY,CAAoD,CAAC,CAC9DE,aAAa,CAAqB,CAAC;IACxC,CAAC,CAAC;IAEFD,EAAE,CAAC,6BAA6B,EAAE,MAAM;MACtCD,YAAY,CAAmD,CAAC,CAC7DE,aAAa,CAAqB,CAAC;IACxC,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
package/build/browser/Logger.js
CHANGED
|
@@ -1,17 +1,2 @@
|
|
|
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
1
|
export {};
|
|
17
2
|
//# sourceMappingURL=Logger.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Logger.js","names":[],"sources":["Logger.
|
|
1
|
+
{"version":3,"file":"Logger.js","names":[],"sources":["Logger.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport interface Logger {\n trace: LogFn;\n debug: LogFn;\n fatal: LogFn;\n error: LogFn;\n warn: LogFn;\n info: LogFn;\n\n isLevelEnabled(level: string): boolean;\n\n child(\n bindings: Record<string, any>,\n options?: { level?: string; msgPrefix?: string },\n ): Logger;\n}\n\ninterface LogFn {\n (obj: unknown, msg?: string, ...args: any[]): void;\n (msg: string, ...args: any[]): void;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,17 +1,2 @@
|
|
|
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
1
|
export {};
|
|
17
2
|
//# sourceMappingURL=MinimalClientContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MinimalClientContext.js","names":[],"sources":["MinimalClientContext.
|
|
1
|
+
{"version":3,"file":"MinimalClientContext.js","names":[],"sources":["MinimalClientContext.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 { SharedClientContext } from \"@osdk/shared.client2\";\nimport type { Logger } from \"./Logger.js\";\nimport type {\n convertWireToOsdkObjects,\n convertWireToOsdkObjects2,\n} from \"./object/convertWireToOsdkObjects.js\";\nimport type { ObjectSetFactory } from \"./objectSet/ObjectSetFactory.js\";\nimport type { OntologyProvider } from \"./ontology/OntologyProvider.js\";\n\ndeclare const tag: unique symbol;\n\nexport type ClientCacheKey = {} & { readonly [tag]: void };\n\nexport type RequestContext = {\n finalMethodCall?: string;\n};\n\nexport interface MinimalClient extends SharedClientContext {\n ontologyRid: string | Promise<string>;\n ontologyProvider: OntologyProvider;\n logger?: Logger;\n /** @internal */\n objectSetFactory: ObjectSetFactory<any, any>;\n /** @internal */\n objectFactory: typeof convertWireToOsdkObjects;\n /** @internal */\n objectFactory2: typeof convertWireToOsdkObjects2;\n\n clientCacheKey: ClientCacheKey;\n requestContext: RequestContext;\n}\n\nexport type MinimalClientParams = {\n metadata: MinimalClientMetadata;\n provider: OntologyProvider;\n};\n\nexport interface MinimalClientMetadata {\n ontologyRid: string | Promise<string>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResultOrError.js","names":["isOk","result","type"],"sources":["ResultOrError.
|
|
1
|
+
{"version":3,"file":"ResultOrError.js","names":["isOk","result","type"],"sources":["ResultOrError.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport type ResultOrError<T extends object> =\n | ({ type: \"ok\"; err?: never } & T)\n | { type: \"err\"; data?: never; err?: unknown };\n\nexport function isOk(result: ResultOrError<any>): result is { type: \"ok\" } {\n return result.type === \"ok\";\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA,OAAO,SAASA,IAAIA,CAACC,MAA0B,EAA4B;EACzE,OAAOA,MAAM,CAACC,IAAI,KAAK,IAAI;AAC7B","ignoreList":[]}
|
|
@@ -1,17 +1,2 @@
|
|
|
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
1
|
export {};
|
|
17
2
|
//# sourceMappingURL=SatisfiesSemver.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SatisfiesSemver.js","names":[],"sources":["SatisfiesSemver.
|
|
1
|
+
{"version":3,"file":"SatisfiesSemver.js","names":[],"sources":["SatisfiesSemver.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 GreaterThan,\n GreaterThanOrEqual,\n IsEqual,\n LessThan,\n} from \"type-fest\";\n\nexport type VersionString<\n Major extends number,\n Minor extends number,\n Patch extends number,\n> = `${Major}.${Minor}.${Patch}`;\n\nexport type SatisfiesSemver<\n E extends VersionString<any, any, any>,\n C extends VersionString<any, any, any>,\n> = E extends VersionString<infer ExpMajor, infer ExpMinor, infer ExpPatch>\n ? C extends VersionString<infer CurMajor, infer CurMinor, infer CurPatch> ? (\n IsEqual<CurMajor, ExpMajor> extends false ? false\n : LessThan<CurMinor, ExpMinor> extends true ? false\n : GreaterThan<CurMinor, ExpMinor> extends true ? true\n : GreaterThanOrEqual<CurPatch, ExpPatch>\n )\n : false\n : false;\n"],"mappings":"","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 { describe, expectTypeOf, it } from "vitest";
|
|
17
18
|
describe("SatisfiesSemver", () => {
|
|
18
19
|
describe("SatisfiesSemver type alias", () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SatisfiesSemver.test.js","names":["describe","expectTypeOf","it","toEqualTypeOf"],"sources":["SatisfiesSemver.test.
|
|
1
|
+
{"version":3,"file":"SatisfiesSemver.test.js","names":["describe","expectTypeOf","it","toEqualTypeOf"],"sources":["SatisfiesSemver.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 { describe, expectTypeOf, it } from \"vitest\";\nimport type { SatisfiesSemver } from \"./SatisfiesSemver.js\";\n\ndescribe(\"SatisfiesSemver\", () => {\n describe(\"SatisfiesSemver type alias\", () => {\n it(\"has simple examples to review\", () => {\n expectTypeOf<SatisfiesSemver<\"0.0.0\", \"0.0.0\">>().toEqualTypeOf(true);\n expectTypeOf<SatisfiesSemver<\"1.0.0\", \"1.1.0\">>().toEqualTypeOf(true);\n expectTypeOf<SatisfiesSemver<\"1.1.0\", \"1.1.1\">>().toEqualTypeOf(true);\n expectTypeOf<SatisfiesSemver<\"1.5.0\", \"1.4.0\">>().toEqualTypeOf(false);\n expectTypeOf<SatisfiesSemver<\"1.0.0\", \"2.0.0\">>().toEqualTypeOf(false);\n });\n\n it(\"is true eq major, eq minor, eq patch\", () => {\n expectTypeOf<SatisfiesSemver<\"0.0.0\", \"0.0.0\">>().toEqualTypeOf(true);\n expectTypeOf<SatisfiesSemver<\"1.0.0\", \"1.0.0\">>().toEqualTypeOf(true);\n expectTypeOf<SatisfiesSemver<\"2.2.0\", \"2.2.0\">>().toEqualTypeOf(true);\n expectTypeOf<SatisfiesSemver<\"3.3.3\", \"3.3.3\">>().toEqualTypeOf(true);\n });\n\n it(\"is true for eq major, eq minor, gt patch\", () => {\n expectTypeOf<SatisfiesSemver<\"5.5.5\", \"5.5.6\">>().toEqualTypeOf(true);\n });\n\n it(\"is true for eq major, gt minor, any patch\", () => {\n expectTypeOf<SatisfiesSemver<\"5.5.5\", \"5.6.4\">>().toEqualTypeOf(true);\n expectTypeOf<SatisfiesSemver<\"5.5.5\", \"5.6.5\">>().toEqualTypeOf(true);\n expectTypeOf<SatisfiesSemver<\"5.5.5\", \"5.6.6\">>().toEqualTypeOf(true);\n });\n\n it(\"is false for eq major, lt minor, any patch\", () => {\n expectTypeOf<SatisfiesSemver<\"5.5.5\", \"5.4.4\">>().toEqualTypeOf(false);\n expectTypeOf<SatisfiesSemver<\"5.5.5\", \"5.4.5\">>().toEqualTypeOf(false);\n expectTypeOf<SatisfiesSemver<\"5.5.5\", \"5.4.6\">>().toEqualTypeOf(false);\n });\n\n it(\"is false for gt major, any minor, any patch\", () => {\n expectTypeOf<SatisfiesSemver<\"5.5.5\", \"6.4.4\">>().toEqualTypeOf(false);\n expectTypeOf<SatisfiesSemver<\"5.5.5\", \"6.4.5\">>().toEqualTypeOf(false);\n expectTypeOf<SatisfiesSemver<\"5.5.5\", \"6.4.6\">>().toEqualTypeOf(false);\n\n expectTypeOf<SatisfiesSemver<\"5.5.5\", \"6.5.4\">>().toEqualTypeOf(false);\n expectTypeOf<SatisfiesSemver<\"5.5.5\", \"6.5.5\">>().toEqualTypeOf(false);\n expectTypeOf<SatisfiesSemver<\"5.5.5\", \"6.5.6\">>().toEqualTypeOf(false);\n\n expectTypeOf<SatisfiesSemver<\"5.5.5\", \"6.6.4\">>().toEqualTypeOf(false);\n expectTypeOf<SatisfiesSemver<\"5.5.5\", \"6.6.5\">>().toEqualTypeOf(false);\n expectTypeOf<SatisfiesSemver<\"5.5.5\", \"6.6.6\">>().toEqualTypeOf(false);\n });\n\n it(\"is false for lt major, any minor, any patch\", () => {\n expectTypeOf<SatisfiesSemver<\"5.5.5\", \"4.4.4\">>().toEqualTypeOf(false);\n expectTypeOf<SatisfiesSemver<\"5.5.5\", \"4.4.5\">>().toEqualTypeOf(false);\n expectTypeOf<SatisfiesSemver<\"5.5.5\", \"4.4.6\">>().toEqualTypeOf(false);\n\n expectTypeOf<SatisfiesSemver<\"5.5.5\", \"4.5.4\">>().toEqualTypeOf(false);\n expectTypeOf<SatisfiesSemver<\"5.5.5\", \"4.5.5\">>().toEqualTypeOf(false);\n expectTypeOf<SatisfiesSemver<\"5.5.5\", \"4.5.6\">>().toEqualTypeOf(false);\n\n expectTypeOf<SatisfiesSemver<\"5.5.5\", \"4.6.4\">>().toEqualTypeOf(false);\n expectTypeOf<SatisfiesSemver<\"5.5.5\", \"4.6.5\">>().toEqualTypeOf(false);\n expectTypeOf<SatisfiesSemver<\"5.5.5\", \"4.6.6\">>().toEqualTypeOf(false);\n });\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,EAAEC,YAAY,EAAEC,EAAE,QAAQ,QAAQ;AAGnDF,QAAQ,CAAC,iBAAiB,EAAE,MAAM;EAChCA,QAAQ,CAAC,4BAA4B,EAAE,MAAM;IAC3CE,EAAE,CAAC,+BAA+B,EAAE,MAAM;MACxCD,YAAY,CAAoC,CAAC,CAACE,aAAa,CAAC,IAAI,CAAC;MACrEF,YAAY,CAAoC,CAAC,CAACE,aAAa,CAAC,IAAI,CAAC;MACrEF,YAAY,CAAoC,CAAC,CAACE,aAAa,CAAC,IAAI,CAAC;MACrEF,YAAY,CAAoC,CAAC,CAACE,aAAa,CAAC,KAAK,CAAC;MACtEF,YAAY,CAAoC,C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ACtEF,YAAY,CAAoC,CAAC,CAACE,aAAa,CAAC,KAAK,CAAC;MAEtEF,YAAY,CAAoC,CAAC,CAACE,aAAa,CAAC,KAAK,CAAC;MACtEF,YAAY,CAAoC,CAAC,CAACE,aAAa,CAAC,KAAK,CAAC;MACtEF,YAAY,CAAoC,CAAC,CAACE,aAAa,CAAC,KAAK,CAAC;IACxE,CAAC,CAAC;IAEFD,EAAE,CAAC,6CAA6C,EAAE,MAAM;MACtDD,YAAY,CAAoC,CAAC,CAACE,aAAa,CAAC,KAAK,CAAC;MACtEF,YAAY,CAAoC,CAAC,CAACE,aAAa,CAAC,KAAK,CAAC;MACtEF,YAAY,CAAoC,CAAC,CAACE,aAAa,CAAC,KAAK,CAAC;MAEtEF,YAAY,CAAoC,CAAC,CAACE,aAAa,CAAC,KAAK,CAAC;MACtEF,YAAY,CAAoC,CAAC,CAACE,aAAa,CAAC,KAAK,CAAC;MACtEF,YAAY,CAAoC,CAAC,CAACE,aAAa,CAAC,KAAK,CAAC;MAEtEF,YAAY,CAAoC,CAAC,CAACE,aAAa,CAAC,KAAK,CAAC;MACtEF,YAAY,CAAoC,CAAC,CAACE,aAAa,CAAC,KAAK,CAAC;MACtEF,YAAY,CAAoC,CAAC,CAACE,aAAa,CAAC,KAAK,CAAC;IACxE,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","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 { bulkLoadOntologyEntities, getLinkTypesForObjectTypes, loadAllOntologies } from "@osdk/client.unstable";
|
|
17
18
|
import invariant from "tiny-invariant";
|
|
18
19
|
import { createSimpleAsyncCache, createSimpleCache } from "../object/SimpleCache.js";
|
|
@@ -25,6 +26,7 @@ async function getOntologyVersionForRid(ctx, ontologyRid) {
|
|
|
25
26
|
}
|
|
26
27
|
const strongMemoSync = fn => createSimpleCache(new Map(), fn).get;
|
|
27
28
|
const weakMemoSync = fn => createSimpleCache(new WeakMap(), fn).get; // FIXME
|
|
29
|
+
|
|
28
30
|
const strongMemoAsync = fn => createSimpleAsyncCache("strong", fn).get;
|
|
29
31
|
const weakMemoAsync = fn => createSimpleAsyncCache("weak", fn).get;
|
|
30
32
|
export class MetadataClient {
|
|
@@ -65,6 +67,7 @@ export class MetadataClient {
|
|
|
65
67
|
}
|
|
66
68
|
});
|
|
67
69
|
!linkTypes.linkTypes[objectTypeRid] ? process.env.NODE_ENV !== "production" ? invariant(false, "link type should be loaded") : invariant(false) : void 0;
|
|
70
|
+
|
|
68
71
|
// apiName to content
|
|
69
72
|
const ret = {};
|
|
70
73
|
for (const l of linkTypes.linkTypes[objectTypeRid]) {
|
|
@@ -137,7 +140,10 @@ export class MetadataClient {
|
|
|
137
140
|
loadRedacted: false,
|
|
138
141
|
includeObjectTypeCount: undefined,
|
|
139
142
|
includeObjectTypesWithoutSearchableDatasources: true,
|
|
140
|
-
includeEntityMetadata: undefined
|
|
143
|
+
includeEntityMetadata: undefined,
|
|
144
|
+
actionTypes: [],
|
|
145
|
+
includeTypeGroupEntitiesCount: undefined,
|
|
146
|
+
entityMetadata: undefined
|
|
141
147
|
};
|
|
142
148
|
const entities = await bulkLoadOntologyEntities(this.#ctx, undefined, body);
|
|
143
149
|
!entities.objectTypes[0]?.objectType ? process.env.NODE_ENV !== "production" ? invariant(false, "object type should be loaded") : invariant(false) : void 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConjureSupport.js","names":["bulkLoadOntologyEntities","getLinkTypesForObjectTypes","loadAllOntologies","invariant","createSimpleAsyncCache","createSimpleCache","makeConjureContext","cachedAllOntologies","getOntologyVersionForRid","ctx","ontologyRid","ontologies","process","env","NODE_ENV","currentOntologyVersion","strongMemoSync","fn","Map","get","weakMemoSync","WeakMap","strongMemoAsync","weakMemoAsync","MetadataClient","client","logger","constructor","ontologyProvider","getObjectDefinition","child","mcc","forObjectByRid","rid","Promise","resolve","getPropertyMapping","objectPropertyMapping","bind","getLinkMapping","objectLinkMapping","getRid","getApiName","getConjureObjectType","apiName","forObjectByApiName","objectApiName","objectDef","objectTypeRid","conjureObjectType","createObjectPropertyMapping","linkTypes","includeObjectTypesWithoutSearchableDatasources","loadRedacted","objectTypeBranches","objectTypeVersions","ontologyVersion","ret","l","helper","linkSide","otherObjectType","directedLinkTypeRid","linkTypeRid","definition","type","oneToMany","objectTypeRidManySide","manyToOneLinkMetadata","objectTypeRidOneSide","oneToManyLinkMetadata","manyToMany","objectTypeRidA","objectTypeAToBLinkMetadata","objectTypeRidB","objectTypeBToALinkMetadata","debug","body","datasourceTypes","objectTypes","identifier","versionReference","sharedPropertyTypes","interfaceTypes","typeGroups","includeObjectTypeCount","undefined","includeEntityMetadata","entities","objectType","metadataCacheClient","conjureOT","primaryKeys","length","pkRid","pkProperty","Object","values","propertyTypes","find","a","Error","propertyIdToApiNameMapping","fromEntries","map","property","id","propertyApiNameToIdMapping","pk"],"sources":["ConjureSupport.js"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { bulkLoadOntologyEntities, getLinkTypesForObjectTypes, loadAllOntologies, } from \"@osdk/client.unstable\";\nimport invariant from \"tiny-invariant\";\nimport { createSimpleAsyncCache, createSimpleCache, } from \"../object/SimpleCache.js\";\nimport { makeConjureContext } from \"../ontology/makeConjureContext.js\";\nlet cachedAllOntologies;\nasync function getOntologyVersionForRid(ctx, ontologyRid) {\n cachedAllOntologies ??= await loadAllOntologies(ctx, {});\n invariant(cachedAllOntologies.ontologies[ontologyRid], \"ontology should be loaded\");\n return cachedAllOntologies.ontologies[ontologyRid].currentOntologyVersion;\n}\nconst strongMemoSync = (fn) => createSimpleCache(new Map(), fn).get;\nconst weakMemoSync = (fn) => createSimpleCache(new WeakMap(), fn).get; // FIXME\nconst strongMemoAsync = (fn) => createSimpleAsyncCache(\"strong\", fn).get;\nconst weakMemoAsync = (fn) => createSimpleAsyncCache(\"weak\", fn).get;\nexport class MetadataClient {\n #client;\n #ctx;\n #logger;\n constructor(client) {\n this.#client = client;\n this.#ctx = makeConjureContext(client, \"ontology-metadata/api\");\n this.#client.ontologyProvider.getObjectDefinition;\n this.#logger = this.#client.logger?.child({\n mcc: true,\n });\n }\n forObjectByRid = strongMemoAsync(async (rid) => {\n return Promise.resolve({\n getPropertyMapping: this.#objectPropertyMapping.bind(this, rid),\n getLinkMapping: this.#objectLinkMapping.bind(this, rid),\n getRid: () => rid,\n getApiName: async () => (await this.#getConjureObjectType(rid)).apiName,\n });\n });\n forObjectByApiName = strongMemoAsync(async (objectApiName) => {\n const objectDef = await this.#client.ontologyProvider.getObjectDefinition(objectApiName);\n return this.forObjectByRid(objectDef.rid);\n });\n #objectPropertyMapping = strongMemoAsync(async (objectTypeRid) => {\n const conjureObjectType = await this.#getConjureObjectType(objectTypeRid);\n return createObjectPropertyMapping(conjureObjectType);\n });\n #objectLinkMapping = strongMemoAsync(async (objectTypeRid) => {\n const linkTypes = await getLinkTypesForObjectTypes(this.#ctx, {\n includeObjectTypesWithoutSearchableDatasources: true,\n loadRedacted: false,\n objectTypeBranches: {},\n objectTypeVersions: {\n [objectTypeRid]: await this.ontologyVersion(\"\"),\n },\n });\n invariant(linkTypes.linkTypes[objectTypeRid], \"link type should be loaded\");\n // apiName to content\n const ret = {};\n for (const l of linkTypes.linkTypes[objectTypeRid]) {\n const helper = ({ apiName }, linkSide, otherObjectType) => {\n if (apiName) {\n ret[apiName] = {\n apiName,\n directedLinkTypeRid: {\n linkTypeRid: l.rid,\n linkSide,\n },\n otherObjectType,\n };\n }\n };\n if (l.definition.type === \"oneToMany\") {\n const { oneToMany: { objectTypeRidManySide, manyToOneLinkMetadata, objectTypeRidOneSide, oneToManyLinkMetadata, }, } = l.definition;\n if (objectTypeRidManySide === objectTypeRid) {\n helper(manyToOneLinkMetadata, \"TARGET\", objectTypeRidOneSide);\n }\n if (objectTypeRidOneSide === objectTypeRid) {\n helper(oneToManyLinkMetadata, \"SOURCE\", objectTypeRidManySide);\n }\n }\n else if (l.definition.type === \"manyToMany\") {\n const { manyToMany: { objectTypeRidA, objectTypeAToBLinkMetadata, objectTypeRidB, objectTypeBToALinkMetadata, }, } = l.definition;\n if (objectTypeRidA === objectTypeRid) {\n helper(objectTypeAToBLinkMetadata, \"SOURCE\", objectTypeRidB);\n }\n if (objectTypeRidB === objectTypeRid) {\n helper(objectTypeBToALinkMetadata, \"TARGET\", objectTypeRidA);\n }\n }\n }\n return ret;\n });\n #getConjureObjectType = strongMemoAsync(async (objectTypeRid) => {\n this.#logger?.debug(`getConjureObjectType(${objectTypeRid})`);\n const body = {\n datasourceTypes: [],\n objectTypes: [{\n identifier: {\n type: \"objectTypeRid\",\n objectTypeRid: objectTypeRid,\n },\n versionReference: {\n type: \"ontologyVersion\",\n ontologyVersion: await this.ontologyVersion(\"\"),\n },\n }],\n linkTypes: [],\n sharedPropertyTypes: [],\n interfaceTypes: [],\n typeGroups: [],\n loadRedacted: false,\n includeObjectTypeCount: undefined,\n includeObjectTypesWithoutSearchableDatasources: true,\n includeEntityMetadata: undefined,\n };\n const entities = await bulkLoadOntologyEntities(this.#ctx, undefined, body);\n invariant(entities.objectTypes[0]?.objectType, \"object type should be loaded\");\n return entities.objectTypes[0].objectType;\n });\n ontologyVersion = strongMemoAsync(async (_) => getOntologyVersionForRid(this.#ctx, await this.#client.ontologyRid));\n}\nexport const metadataCacheClient = weakMemoAsync((client) => Promise.resolve(new MetadataClient(client)));\nfunction createObjectPropertyMapping(conjureOT) {\n invariant(conjureOT.primaryKeys.length === 1, `only one primary key supported, got ${conjureOT.primaryKeys.length}`);\n const pkRid = conjureOT.primaryKeys[0];\n const pkProperty = Object.values(conjureOT.propertyTypes).find(a => a.rid === pkRid);\n if (!pkProperty) {\n throw new Error(`Could not find PK property by rid: ${pkRid}`);\n }\n const propertyIdToApiNameMapping = Object\n .fromEntries(Object.values(conjureOT.propertyTypes).map(property => {\n return [property.id, property.apiName];\n }));\n const propertyApiNameToIdMapping = Object\n .fromEntries(Object.values(conjureOT.propertyTypes).map(property => {\n return [property.apiName, property.id];\n }));\n return {\n apiName: conjureOT.apiName,\n id: conjureOT.id,\n propertyIdToApiNameMapping,\n propertyApiNameToIdMapping,\n pk: {\n rid: pkRid,\n apiName: pkProperty.apiName,\n type: pkProperty.type,\n },\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,wBAAwB,EAAEC,0BAA0B,EAAEC,iBAAiB,QAAS,uBAAuB;AAChH,OAAOC,SAAS,MAAM,gBAAgB;AACtC,SAASC,sBAAsB,EAAEC,iBAAiB,QAAS,0BAA0B;AACrF,SAASC,kBAAkB,QAAQ,mCAAmC;AACtE,IAAIC,mBAAmB;AACvB,eAAeC,wBAAwBA,CAACC,GAAG,EAAEC,WAAW,EAAE;EACtDH,mBAAmB,KAAK,MAAML,iBAAiB,CAACO,GAAG,EAAE,CAAC,CAAC,CAAC;EACxD,CAAUF,mBAAmB,CAACI,UAAU,CAACD,WAAW,CAAC,GAAAE,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAArDX,SAAS,QAA8C,2BAA2B,IAAlFA,SAAS;EACT,OAAOI,mBAAmB,CAACI,UAAU,CAACD,WAAW,CAAC,CAACK,sBAAsB;AAC7E;AACA,MAAMC,cAAc,GAAIC,EAAE,IAAKZ,iBAAiB,CAAC,IAAIa,GAAG,CAAC,CAAC,EAAED,EAAE,CAAC,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C,MAAMG,UAAU,GAAGC,MAAM,CAACC,MAAM,CAACN,SAAS,CAACO,aAAa,CAAC,CAACC,IAAI,CAACC,CAAC,IAAIA,CAAC,CAACnE,GAAG,KAAK6D,KAAK,CAAC;EACpF,IAAI,CAACC,UAAU,EAAE;IACb,MAAM,IAAIM,KAAK,CAAC,sCAAsCP,KAAK,EAAE,CAAC;EAClE;EACA,MAAMQ,0BAA0B,GAAGN,MAAM,CACpCO,WAAW,CAACP,MAAM,CAACC,MAAM,CAACN,SAAS,CAACO,aAAa,CAAC,CAACM,GAAG,CAACC,QAAQ,IAAI;IACpE,OAAO,CAACA,QAAQ,CAACC,EAAE,EAAED,QAAQ,CAAC7D,OAAO,CAAC;EAC1C,CAAC,CAAC,CAAC;EACH,MAAM+D,0BAA0B,GAAGX,MAAM,CACpCO,WAAW,CAACP,MAAM,CAACC,MAAM,CAACN,SAAS,CAACO,aAAa,CAAC,CAACM,GAAG,CAACC,QAAQ,IAAI;IACpE,OAAO,CAACA,QAAQ,CAAC7D,OAAO,EAAE6D,QAAQ,CAACC,EAAE,CAAC;EAC1C,CAAC,CAAC,CAAC;EACH,OAAO;IACH9D,OAAO,EAAE+C,SAAS,CAAC/C,OAAO;IAC1B8D,EAAE,EAAEf,SAAS,CAACe,EAAE;IAChBJ,0BAA0B;IAC1BK,0BAA0B;IAC1BC,EAAE,EAAE;MACA3E,GAAG,EAAE6D,KAAK;MACVlD,OAAO,EAAEmD,UAAU,CAACnD,OAAO;MAC3BqB,IAAI,EAAE8B,UAAU,CAAC9B;IACrB;EACJ,CAAC;AACL","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ConjureSupport.js","names":["bulkLoadOntologyEntities","getLinkTypesForObjectTypes","loadAllOntologies","invariant","createSimpleAsyncCache","createSimpleCache","makeConjureContext","cachedAllOntologies","getOntologyVersionForRid","ctx","ontologyRid","ontologies","process","env","NODE_ENV","currentOntologyVersion","strongMemoSync","fn","Map","get","weakMemoSync","WeakMap","strongMemoAsync","weakMemoAsync","MetadataClient","client","logger","constructor","ontologyProvider","getObjectDefinition","child","mcc","forObjectByRid","rid","Promise","resolve","getPropertyMapping","objectPropertyMapping","bind","getLinkMapping","objectLinkMapping","getRid","getApiName","getConjureObjectType","apiName","forObjectByApiName","objectApiName","objectDef","objectTypeRid","conjureObjectType","createObjectPropertyMapping","linkTypes","includeObjectTypesWithoutSearchableDatasources","loadRedacted","objectTypeBranches","objectTypeVersions","ontologyVersion","ret","l","helper","linkSide","otherObjectType","directedLinkTypeRid","linkTypeRid","definition","type","oneToMany","objectTypeRidManySide","manyToOneLinkMetadata","objectTypeRidOneSide","oneToManyLinkMetadata","manyToMany","objectTypeRidA","objectTypeAToBLinkMetadata","objectTypeRidB","objectTypeBToALinkMetadata","debug","body","datasourceTypes","objectTypes","identifier","versionReference","sharedPropertyTypes","interfaceTypes","typeGroups","includeObjectTypeCount","undefined","includeEntityMetadata","actionTypes","includeTypeGroupEntitiesCount","entityMetadata","entities","objectType","metadataCacheClient","conjureOT","primaryKeys","length","pkRid","pkProperty","Object","values","propertyTypes","find","a","Error","propertyIdToApiNameMapping","fromEntries","map","property","id","propertyApiNameToIdMapping","pk"],"sources":["ConjureSupport.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 DirectedLinkTypeRid,\n LinkTypeMetadata,\n LoadAllOntologiesResponse,\n ObjectType,\n Type,\n} from \"@osdk/client.unstable\";\nimport {\n bulkLoadOntologyEntities,\n getLinkTypesForObjectTypes,\n loadAllOntologies,\n} from \"@osdk/client.unstable\";\nimport type { ConjureContext } from \"conjure-lite\";\nimport invariant from \"tiny-invariant\";\nimport type { MinimalClient } from \"../MinimalClientContext.js\";\nimport {\n createSimpleAsyncCache,\n createSimpleCache,\n} from \"../object/SimpleCache.js\";\nimport { makeConjureContext } from \"../ontology/makeConjureContext.js\";\n\nexport interface ObjectPropertyMapping {\n apiName: string;\n id: string;\n propertyIdToApiNameMapping: Record<string, string>;\n propertyApiNameToIdMapping: Record<string, string>;\n pk: {\n rid: string;\n apiName: string;\n type: Type;\n };\n}\n\ntype ObjectLinkMapping = Record<string, {\n apiName: string;\n directedLinkTypeRid: DirectedLinkTypeRid;\n otherObjectType: string; // rid\n}>;\n\nlet cachedAllOntologies: LoadAllOntologiesResponse | undefined;\nasync function getOntologyVersionForRid(\n ctx: ConjureContext,\n ontologyRid: string,\n) {\n cachedAllOntologies ??= await loadAllOntologies(ctx, {});\n invariant(\n cachedAllOntologies.ontologies[ontologyRid],\n \"ontology should be loaded\",\n );\n\n return cachedAllOntologies.ontologies[ontologyRid].currentOntologyVersion;\n}\n\nconst strongMemoSync = <K, V>(fn: (entry: K) => V) =>\n createSimpleCache<K, V>(new Map(), fn).get;\n\nconst weakMemoSync = <K extends object, V>(fn: (entry: K) => V) =>\n createSimpleCache<K, V>(new WeakMap() as any, fn).get; // FIXME\n\nconst strongMemoAsync = <K, V>(fn: (entry: K) => Promise<V>) =>\n createSimpleAsyncCache<K, V>(\"strong\", fn).get;\n\nconst weakMemoAsync = <K, V>(fn: (entry: K) => Promise<V>) =>\n createSimpleAsyncCache<K, V>(\"weak\", fn).get;\n\nexport class MetadataClient {\n #client: MinimalClient;\n #ctx: ConjureContext;\n #logger: any;\n\n constructor(client: MinimalClient) {\n this.#client = client;\n this.#ctx = makeConjureContext(client, \"ontology-metadata/api\");\n this.#client.ontologyProvider.getObjectDefinition;\n\n this.#logger = this.#client.logger?.child({\n mcc: true,\n });\n }\n\n forObjectByRid: (key: string) => Promise<{\n getPropertyMapping: () => Promise<ObjectPropertyMapping>;\n getLinkMapping: () => Promise<ObjectLinkMapping>;\n getRid: () => string;\n getApiName: () => Promise<string | undefined>;\n }> = strongMemoAsync(async (rid: string) => {\n return Promise.resolve({\n getPropertyMapping: this.#objectPropertyMapping.bind(this, rid),\n getLinkMapping: this.#objectLinkMapping.bind(this, rid),\n getRid: () => rid,\n getApiName: async () => (await this.#getConjureObjectType(rid)).apiName,\n });\n });\n\n forObjectByApiName: (key: string) => Promise<{\n getPropertyMapping: () => Promise<ObjectPropertyMapping>;\n getLinkMapping: () => Promise<ObjectLinkMapping>;\n getRid: () => string;\n getApiName: () => Promise<string | undefined>;\n }> = strongMemoAsync(\n async (objectApiName: string) => {\n const objectDef = await this.#client.ontologyProvider.getObjectDefinition(\n objectApiName,\n );\n return this.forObjectByRid(objectDef.rid);\n },\n );\n\n #objectPropertyMapping = strongMemoAsync(async (objectTypeRid: string) => {\n const conjureObjectType = await this.#getConjureObjectType(objectTypeRid);\n return createObjectPropertyMapping(conjureObjectType);\n });\n\n #objectLinkMapping = strongMemoAsync(async (objectTypeRid: string) => {\n const linkTypes = await getLinkTypesForObjectTypes(this.#ctx, {\n includeObjectTypesWithoutSearchableDatasources: true,\n loadRedacted: false,\n objectTypeBranches: {},\n objectTypeVersions: {\n [objectTypeRid]: await this.ontologyVersion(\"\"),\n },\n });\n invariant(\n linkTypes.linkTypes[objectTypeRid],\n \"link type should be loaded\",\n );\n\n // apiName to content\n const ret: ObjectLinkMapping = {};\n for (const l of linkTypes.linkTypes[objectTypeRid]) {\n const helper = (\n { apiName }: LinkTypeMetadata,\n linkSide: \"SOURCE\" | \"TARGET\",\n otherObjectType: string,\n ) => {\n if (apiName) {\n ret[apiName] = {\n apiName,\n directedLinkTypeRid: {\n linkTypeRid: l.rid,\n linkSide,\n },\n otherObjectType,\n };\n }\n };\n if (l.definition.type === \"oneToMany\") {\n const {\n oneToMany: {\n objectTypeRidManySide,\n manyToOneLinkMetadata,\n objectTypeRidOneSide,\n oneToManyLinkMetadata,\n },\n } = l.definition;\n if (objectTypeRidManySide === objectTypeRid) {\n helper(\n manyToOneLinkMetadata,\n \"TARGET\",\n objectTypeRidOneSide,\n );\n }\n if (objectTypeRidOneSide === objectTypeRid) {\n helper(\n oneToManyLinkMetadata,\n \"SOURCE\",\n objectTypeRidManySide,\n );\n }\n } else if (l.definition.type === \"manyToMany\") {\n const {\n manyToMany: {\n objectTypeRidA,\n objectTypeAToBLinkMetadata,\n objectTypeRidB,\n objectTypeBToALinkMetadata,\n },\n } = l.definition;\n if (objectTypeRidA === objectTypeRid) {\n helper(\n objectTypeAToBLinkMetadata,\n \"SOURCE\",\n objectTypeRidB,\n );\n }\n\n if (objectTypeRidB === objectTypeRid) {\n helper(\n objectTypeBToALinkMetadata,\n \"TARGET\",\n objectTypeRidA,\n );\n }\n }\n }\n\n return ret;\n });\n\n #getConjureObjectType = strongMemoAsync(async (objectTypeRid: string) => {\n this.#logger?.debug(`getConjureObjectType(${objectTypeRid})`);\n const body = {\n datasourceTypes: [],\n objectTypes: [{\n identifier: {\n type: \"objectTypeRid\" as const,\n objectTypeRid: objectTypeRid,\n },\n versionReference: {\n type: \"ontologyVersion\" as const,\n ontologyVersion: await this.ontologyVersion(\"\"),\n },\n }],\n linkTypes: [],\n sharedPropertyTypes: [],\n interfaceTypes: [],\n typeGroups: [],\n loadRedacted: false,\n includeObjectTypeCount: undefined,\n includeObjectTypesWithoutSearchableDatasources: true,\n includeEntityMetadata: undefined,\n actionTypes: [],\n includeTypeGroupEntitiesCount: undefined,\n entityMetadata: undefined,\n };\n const entities = await bulkLoadOntologyEntities(this.#ctx, undefined, body);\n invariant(\n entities.objectTypes[0]?.objectType,\n \"object type should be loaded\",\n );\n return entities.objectTypes[0].objectType;\n });\n\n ontologyVersion: (key: string) => Promise<string> = strongMemoAsync(async (\n _: string,\n ) => getOntologyVersionForRid(this.#ctx, await this.#client.ontologyRid));\n}\n\nexport const metadataCacheClient: (\n key: MinimalClient,\n) => Promise<MetadataClient> = weakMemoAsync(\n (client: MinimalClient) => Promise.resolve(new MetadataClient(client)),\n);\n\nfunction createObjectPropertyMapping(\n conjureOT: ObjectType,\n): ObjectPropertyMapping {\n invariant(\n conjureOT.primaryKeys.length === 1,\n `only one primary key supported, got ${conjureOT.primaryKeys.length}`,\n );\n const pkRid = conjureOT.primaryKeys[0];\n\n const pkProperty = Object.values(conjureOT.propertyTypes).find(a =>\n a.rid === pkRid\n );\n if (!pkProperty) {\n throw new Error(`Could not find PK property by rid: ${pkRid}`);\n }\n\n const propertyIdToApiNameMapping: Record<string, string> = Object\n .fromEntries(\n Object.values(conjureOT.propertyTypes).map(\n property => {\n return [property.id, property.apiName!];\n },\n ),\n );\n\n const propertyApiNameToIdMapping: Record<string, string> = Object\n .fromEntries(\n Object.values(conjureOT.propertyTypes).map(\n property => {\n return [property.apiName!, property.id];\n },\n ),\n );\n\n return {\n apiName: conjureOT.apiName!,\n id: conjureOT.id,\n propertyIdToApiNameMapping,\n propertyApiNameToIdMapping,\n pk: {\n rid: pkRid,\n apiName: pkProperty.apiName!,\n type: pkProperty.type,\n },\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASA,SACEA,wBAAwB,EACxBC,0BAA0B,EAC1BC,iBAAiB,QACZ,uBAAuB;AAE9B,OAAOC,SAAS,MAAM,gBAAgB;AAEtC,SACEC,sBAAsB,EACtBC,iBAAiB,QACZ,0BAA0B;AACjC,SAASC,kBAAkB,QAAQ,mCAAmC;AAoBtE,IAAIC,mBAA0D;AAC9D,eAAeC,wBAAwBA,CACrCC,GAAmB,EACnBC,WAAmB,EACnB;EACAH,mBAAmB,KAAK,MAAML,iBAAiB,CAACO,GAAG,EAAE,CAAC,CAAC,CAAC;EACxD,CACEF,mBAAmB,CAACI,UAAU,CAACD,WAAW,CAAC,GAAAE,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAD7CX,SAAS,QAEP,2BAA2B,IAF7B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AACH","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 { getBulkLinksPage } from "@osdk/client.unstable";
|
|
17
18
|
import invariant from "tiny-invariant";
|
|
18
19
|
import { conjureUnionType } from "../objectSet/conjureUnionType.js";
|
|
@@ -25,12 +26,14 @@ export function createBulkLinksAsyncIterFactory(ctx) {
|
|
|
25
26
|
return;
|
|
26
27
|
}
|
|
27
28
|
ctx.logger?.debug("Preparing to fetch bulk links");
|
|
29
|
+
|
|
28
30
|
// require all objects to be the same type for now
|
|
29
31
|
!objs.every(a => a.$objectType === objs[0].$objectType) ? process.env.NODE_ENV !== "production" ? invariant(false) : invariant(false) : void 0;
|
|
30
32
|
const mcc = await metadataCacheClient(ctx);
|
|
31
33
|
const helper = await mcc.forObjectByApiName(objs[0].$objectType);
|
|
32
34
|
const [objectTypeRid, propertyMapping, fullLinkMapping] = await Promise.all([helper.getRid(), helper.getPropertyMapping(), helper.getLinkMapping()]);
|
|
33
35
|
const linkMapping = Object.fromEntries(Object.entries(fullLinkMapping).filter(([apiName]) => linkTypes.includes(apiName)));
|
|
36
|
+
|
|
34
37
|
// make sure the link being requested exists
|
|
35
38
|
for (const linkType of linkTypes) {
|
|
36
39
|
if (linkMapping[linkType] == null) {
|
|
@@ -78,6 +81,7 @@ export function createBulkLinksAsyncIterFactory(ctx) {
|
|
|
78
81
|
const otherObjectApiName = await (await mcc.forObjectByRid(pk.objectTypeRid)).getApiName();
|
|
79
82
|
const mappedLink = Object.values(linkMapping).find(a => a.directedLinkTypeRid.linkTypeRid === link.link.linkTypeRid && a.directedLinkTypeRid.linkSide === link.linkSide);
|
|
80
83
|
if (!mappedLink) throw new Error("Could not find link type"); // should not happens
|
|
84
|
+
|
|
81
85
|
yield {
|
|
82
86
|
object: obj,
|
|
83
87
|
linkApiName: mappedLink.apiName,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createBulkLinksAsyncIterFactory.js","names":["getBulkLinksPage","invariant","conjureUnionType","makeConjureContext","applyPageToken","getResults","pageRequestAsAsyncIter","metadataCacheClient","createBulkLinksAsyncIterFactory","ctx","objs","linkTypes","length","logger","debug","every","a","$objectType","process","env","NODE_ENV","mcc","helper","forObjectByApiName","objectTypeRid","propertyMapping","fullLinkMapping","Promise","all","getRid","getPropertyMapping","getLinkMapping","linkMapping","Object","fromEntries","entries","filter","apiName","includes","linkType","req","objectSetContext","forkRid","undefined","objectSetFilterContext","parameterOverrides","ontologyBranchRid","owningRid","reportUsage","workstateRid","responseOptions","includeObjectSetEntities","includeUsageCost","pageSize","pageToken","linksRequests","directedLinkTypes","values","map","directedLinkTypeRid","objects","o","objectPrimaryKey","pk","rid","type","$primaryKey","bulkLinksIter","bind","item","objectIdentifier","obj","findObject","link","links","ref","linkSide","getPrimaryKeyOrThrow","otherObjectApiName","forObjectByRid","getApiName","mappedLink","find","linkTypeRid","Error","object","linkApiName","otherObjectPk","pkValue","pks","objectLocatorV2"],"sources":["createBulkLinksAsyncIterFactory.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 { getBulkLinksPage } from \"@osdk/client.unstable\";\nimport invariant from \"tiny-invariant\";\nimport { conjureUnionType } from \"../objectSet/conjureUnionType.js\";\nimport { makeConjureContext } from \"../ontology/makeConjureContext.js\";\nimport { applyPageToken, getResults, pageRequestAsAsyncIter, } from \"../pageRequestAsAsyncIter.js\";\nimport { metadataCacheClient } from \"./ConjureSupport.js\";\nexport function createBulkLinksAsyncIterFactory(ctx) {\n return async function* (objs, linkTypes) {\n if (objs.length === 0) {\n return;\n }\n ctx.logger?.debug(\"Preparing to fetch bulk links\");\n // require all objects to be the same type for now\n invariant(objs.every(a => a.$objectType === objs[0].$objectType));\n const mcc = await metadataCacheClient(ctx);\n const helper = await mcc.forObjectByApiName(objs[0].$objectType);\n const [objectTypeRid, propertyMapping, fullLinkMapping] = await Promise.all([\n helper.getRid(),\n helper.getPropertyMapping(),\n helper.getLinkMapping(),\n ]);\n const linkMapping = Object.fromEntries(Object.entries(fullLinkMapping)\n .filter(([apiName]) => linkTypes.includes(apiName)));\n // make sure the link being requested exists\n for (const linkType of linkTypes) {\n if (linkMapping[linkType] == null) {\n throw \"Unable to find link type: \" + linkType;\n }\n }\n const req = {\n objectSetContext: {\n forkRid: undefined,\n objectSetFilterContext: { parameterOverrides: {} },\n ontologyBranchRid: undefined,\n owningRid: undefined,\n reportUsage: undefined,\n workstateRid: undefined,\n },\n responseOptions: {\n includeObjectSetEntities: true,\n includeUsageCost: false,\n },\n pageSize: 1000,\n pageToken: undefined,\n linksRequests: [{\n directedLinkTypes: Object.values(linkMapping)\n .map(({ directedLinkTypeRid }) => directedLinkTypeRid),\n objects: conjureUnionType(\"objects\", objs.map(o => conjureUnionType(\"objectLocatorV2\", {\n objectTypeRid,\n objectPrimaryKey: {\n [propertyMapping.pk.rid]: conjureUnionType(propertyMapping.pk.type.type, o.$primaryKey),\n },\n }))),\n }],\n };\n const bulkLinksIter = pageRequestAsAsyncIter(getBulkLinksPage.bind(undefined, makeConjureContext(ctx, \"object-set-service/api\")), getResults, applyPageToken, req);\n for await (const item of bulkLinksIter) {\n const { objectIdentifier } = item;\n const obj = findObject(objectIdentifier, objs);\n for (const link of item.links) {\n const ref = link.link[link.linkSide === \"SOURCE\"\n ? \"objectSideB\"\n : \"objectSideA\"];\n const pk = getPrimaryKeyOrThrow(ref);\n const otherObjectApiName = await (await mcc.forObjectByRid(pk.objectTypeRid))\n .getApiName();\n const mappedLink = Object.values(linkMapping).find(a => a.directedLinkTypeRid.linkTypeRid === link.link.linkTypeRid\n && a.directedLinkTypeRid.linkSide === link.linkSide);\n if (!mappedLink)\n throw new Error(\"Could not find link type\"); // should not happens\n yield {\n object: obj,\n linkApiName: mappedLink.apiName,\n otherObjectApiName: otherObjectApiName,\n otherObjectPk: pk.pkValue,\n };\n }\n }\n };\n}\nfunction findObject(objectIdentifier, objs) {\n const { pkValue } = getPrimaryKeyOrThrow(objectIdentifier);\n const obj = objs.find(o => o.$primaryKey === pkValue);\n if (obj == null) {\n throw new Error(`Needed to find object with pk ${pkValue}} and could not`);\n }\n return obj;\n}\nfunction getPrimaryKeyOrThrow(ref) {\n if (\"type\" in ref && ref.type !== \"objectLocatorV2\") {\n throw new Error(\"We do not support looking up object by rid\");\n }\n const pks = Object.entries(ref.objectLocatorV2.objectPrimaryKey);\n if (pks.length !== 1) {\n throw new Error(\"Unable to support this request due to multiple pks\");\n }\n return {\n objectTypeRid: ref.objectLocatorV2.objectTypeRid,\n pkValue: pks[0][1][pks[0][1].type],\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,gBAAgB,QAAQ,uBAAuB;AACxD,OAAOC,SAAS,MAAM,gBAAgB;AACtC,SAASC,gBAAgB,QAAQ,kCAAkC;AACnE,SAASC,kBAAkB,QAAQ,mCAAmC;AACtE,SAASC,cAAc,EAAEC,UAAU,EAAEC,sBAAsB,QAAS,8BAA8B;AAClG,SAASC,mBAAmB,QAAQ,qBAAqB;AACzD,OAAO,SAASC,+BAA+BA,CAACC,GAAG,EAAE;EACjD,OAAO,iBAAiBC,IAAI,EAAEC,SAAS,EAAE;IACrC,IAAID,IAAI,CAACE,MAAM,KAAK,CAAC,EAAE;MACnB;IACJ;IACAH,GAAG,CAACI,MAAM,EAAEC,KAAK,CAAC,+BAA+B,CAAC;I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AAIwE,KAAK,CAAC,oDAAoD,CAAC;EACzE;EACA,OAAO;IACH5D,aAAa,EAAEmD,GAAG,CAACe,eAAe,CAAClE,aAAa;IAChDgE,OAAO,EAAEC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAACA,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAACxB,IAAI;EACrC,CAAC;AACL","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"createBulkLinksAsyncIterFactory.js","names":["getBulkLinksPage","invariant","conjureUnionType","makeConjureContext","applyPageToken","getResults","pageRequestAsAsyncIter","metadataCacheClient","createBulkLinksAsyncIterFactory","ctx","objs","linkTypes","length","logger","debug","every","a","$objectType","process","env","NODE_ENV","mcc","helper","forObjectByApiName","objectTypeRid","propertyMapping","fullLinkMapping","Promise","all","getRid","getPropertyMapping","getLinkMapping","linkMapping","Object","fromEntries","entries","filter","apiName","includes","linkType","req","objectSetContext","forkRid","undefined","objectSetFilterContext","parameterOverrides","ontologyBranchRid","owningRid","reportUsage","workstateRid","responseOptions","includeObjectSetEntities","includeUsageCost","pageSize","pageToken","linksRequests","directedLinkTypes","values","map","directedLinkTypeRid","objects","o","objectPrimaryKey","pk","rid","type","$primaryKey","bulkLinksIter","bind","item","objectIdentifier","obj","findObject","link","links","ref","linkSide","getPrimaryKeyOrThrow","otherObjectApiName","forObjectByRid","getApiName","mappedLink","find","linkTypeRid","Error","object","linkApiName","otherObjectPk","pkValue","pks","objectLocatorV2"],"sources":["createBulkLinksAsyncIterFactory.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 { OsdkBase } from \"@osdk/api\";\nimport type { EXPERIMENTAL_BulkLinkResult as BulkLinkResult } from \"@osdk/api/unstable\";\nimport type {\n DirectedLinkTypeRid,\n FoundryObjectReference,\n GetBulkLinksPageRequest,\n ObjectIdentifier,\n} from \"@osdk/client.unstable\";\nimport { getBulkLinksPage } from \"@osdk/client.unstable\";\nimport invariant from \"tiny-invariant\";\nimport type { MinimalClient } from \"../MinimalClientContext.js\";\nimport { conjureUnionType } from \"../objectSet/conjureUnionType.js\";\nimport { makeConjureContext } from \"../ontology/makeConjureContext.js\";\nimport {\n applyPageToken,\n getResults,\n pageRequestAsAsyncIter,\n} from \"../pageRequestAsAsyncIter.js\";\nimport { metadataCacheClient } from \"./ConjureSupport.js\";\n\nexport function createBulkLinksAsyncIterFactory(ctx: MinimalClient) {\n return async function*(\n objs: Array<OsdkBase<any>>,\n linkTypes: string[],\n ): AsyncGenerator<BulkLinkResult, void, unknown> {\n if (objs.length === 0) {\n return;\n }\n\n ctx.logger?.debug(\"Preparing to fetch bulk links\");\n\n // require all objects to be the same type for now\n invariant(objs.every(a => a.$objectType === objs[0].$objectType));\n\n const mcc = await metadataCacheClient(ctx);\n const helper = await mcc.forObjectByApiName(objs[0].$objectType);\n\n const [objectTypeRid, propertyMapping, fullLinkMapping] = await Promise.all(\n [\n helper.getRid(),\n helper.getPropertyMapping(),\n helper.getLinkMapping(),\n ],\n );\n\n const linkMapping = Object.fromEntries(\n Object.entries(fullLinkMapping)\n .filter(([apiName]) => linkTypes.includes(apiName)),\n );\n\n // make sure the link being requested exists\n for (const linkType of linkTypes) {\n if (linkMapping[linkType] == null) {\n throw \"Unable to find link type: \" + linkType;\n }\n }\n\n const req: GetBulkLinksPageRequest = {\n objectSetContext: {\n forkRid: undefined,\n objectSetFilterContext: { parameterOverrides: {} },\n ontologyBranchRid: undefined,\n owningRid: undefined,\n reportUsage: undefined,\n workstateRid: undefined,\n },\n responseOptions: {\n includeObjectSetEntities: true,\n includeUsageCost: false,\n },\n pageSize: 1000,\n pageToken: undefined,\n linksRequests: [{\n directedLinkTypes: Object.values(linkMapping)\n .map<DirectedLinkTypeRid>(({ directedLinkTypeRid }) =>\n directedLinkTypeRid\n ),\n objects: conjureUnionType(\n \"objects\",\n objs.map<ObjectIdentifier>(o =>\n conjureUnionType(\"objectLocatorV2\", {\n objectTypeRid,\n objectPrimaryKey: {\n [propertyMapping.pk.rid]: conjureUnionType(\n propertyMapping.pk.type.type as \"string\",\n o.$primaryKey as string,\n ),\n },\n })\n ),\n ),\n }],\n };\n\n const bulkLinksIter = pageRequestAsAsyncIter(\n getBulkLinksPage.bind(\n undefined,\n makeConjureContext(ctx, \"object-set-service/api\"),\n ),\n getResults,\n applyPageToken,\n req,\n );\n\n for await (const item of bulkLinksIter) {\n const { objectIdentifier } = item;\n const obj = findObject(objectIdentifier, objs);\n\n for (const link of item.links) {\n const ref = link.link[\n link.linkSide === \"SOURCE\"\n ? \"objectSideB\"\n : \"objectSideA\"\n ];\n const pk = getPrimaryKeyOrThrow(ref);\n const otherObjectApiName =\n await (await mcc.forObjectByRid(pk.objectTypeRid))\n .getApiName();\n\n const mappedLink = Object.values(linkMapping).find(a =>\n a.directedLinkTypeRid.linkTypeRid === link.link.linkTypeRid\n && a.directedLinkTypeRid.linkSide === link.linkSide\n );\n if (!mappedLink) throw new Error(\"Could not find link type\"); // should not happens\n\n yield {\n object: obj,\n linkApiName: mappedLink.apiName,\n otherObjectApiName: otherObjectApiName,\n otherObjectPk: pk.pkValue,\n };\n }\n }\n };\n}\n\nfunction findObject(\n objectIdentifier: ObjectIdentifier,\n objs: (OsdkBase<any>)[],\n) {\n const { pkValue } = getPrimaryKeyOrThrow(objectIdentifier);\n\n const obj = objs.find(o => o.$primaryKey === pkValue);\n if (obj == null) {\n throw new Error(\n `Needed to find object with pk ${pkValue}} and could not`,\n );\n }\n return obj;\n}\n\nfunction getPrimaryKeyOrThrow(\n ref: FoundryObjectReference | ObjectIdentifier,\n) {\n if (\"type\" in ref && ref.type !== \"objectLocatorV2\") {\n throw new Error(\"We do not support looking up object by rid\");\n }\n\n const pks = Object.entries(ref.objectLocatorV2.objectPrimaryKey);\n if (pks.length !== 1) {\n throw new Error(\n \"Unable to support this request due to multiple pks\",\n );\n }\n\n return {\n objectTypeRid: ref.objectLocatorV2.objectTypeRid,\n pkValue: (pks[0][1] as any)[pks[0][1].type] as unknown,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUA,SAASA,gBAAgB,QAAQ,uBAAuB;AACxD,OAAOC,SAAS,MAAM,gBAAgB;AAEtC,SAASC,gBAAgB,QAAQ,kCAAkC;AACnE,SAASC,kBAAkB,QAAQ,mCAAmC;AACtE,SACEC,cAAc,EACdC,UAAU,EACVC,sBAAsB,QACjB,8BAA8B;AACrC,SAASC,mBAAmB,QAAQ,qBAAqB;AAEzD,OAAO,SAASC,+BAA+BA,CAACC,GAAkB,EAAE;EAClE,OAAO,iBACLC,IAA0B,EAC1BC,SAAmB,EAC4B;IAC/C,IAAID,IAAI,CAACE,MAAM,KAAK,CAAC,EAAE;MACrB;IACF;IAEAH,GAAG,CAACI,MAAM,EAAEC,KAAK,CAAC,+BAA+B,CAAC;;IAElD;IACA,CAAUJ,IAAI,CAACK,KAAK,CAACC,CAAC,IAAIA,CAAC,CAACC,WAAW,KAAKP,IAAI,CAAC,CAAC,CAAC,CAACO,WAAW,CAAC,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAhEnB,SAAS,UAATA,SAAS;IAET,MAAMoB,GAAG,GAAG,MAAMd,mBAAmB,CAACE,GAAG,CAAC;IAC1C,MAAMa,MAAM,GAAG,MAAMD,GAAG,CAACE,kBAAkB,CAACb,IAAI,CAAC,CAAC,CAAC,CAACO,WAAW,CAAC;IAEhE,MAAM,CAACO,aAAa,EAAEC,eAAe,EAAEC,eAAe,CA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WAAW,EAAEL,UAAU,CAAC5C,OAAO;UAC/ByC,kBAAkB,EAAEA,kBAAkB;UACtCS,aAAa,EAAExB,EAAE,CAACyB;QACpB,CAAC;MACH;IACF;EACF,CAAC;AACH;AAEA,SAAShB,UAAUA,CACjBF,gBAAkC,EAClC5D,IAAuB,EACvB;EACA,MAAM;IAAE8E;EAAQ,CAAC,GAAGX,oBAAoB,CAACP,gBAAgB,CAAC;EAE1D,MAAMC,GAAG,GAAG7D,IAAI,CAACwE,IAAI,CAACrB,CAAC,IAAIA,CAAC,CAACK,WAAW,KAAKsB,OAAO,CAAC;EACrD,IAAIjB,GAAG,IAAI,IAAI,EAAE;IACf,MAAM,IAAIa,KAAK,CACb,iCAAiCI,OAAO,iBAC1C,CAAC;EACH;EACA,OAAOjB,GAAG;AACZ;AAEA,SAASM,oBAAoBA,CAC3BF,GAA8C,EAC9C;EACA,IAAI,MAAM,IAAIA,GAAG,IAAIA,GAAG,CAACV,IAAI,KAAK,iBAAiB,EAAE;IACnD,MAAM,IAAImB,KAAK,CAAC,4CAA4C,CAAC;EAC/D;EAEA,MAAMK,GAAG,GAAGxD,MAAM,CAACE,OAAO,CAACwC,GAAG,CAACe,eAAe,CAAC5B,gBAAgB,CAAC;EAChE,IAAI2B,GAAG,CAAC7E,MAAM,KAAK,CAAC,EAAE;IACpB,MAAM,IAAIwE,KAAK,CACb,oDACF,CAAC;EACH;EAEA,OAAO;IACL5D,aAAa,EAAEmD,GAAG,CAACe,eAAe,CAAClE,aAAa;IAChDgE,OAAO,EAAGC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAASA,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAACxB,IAAI;EAC5C,CAAC;AACH","ignoreList":[]}
|
|
@@ -13,8 +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
|
export class ActionValidationError extends Error {
|
|
17
|
-
validation;
|
|
18
18
|
constructor(validation) {
|
|
19
19
|
super("Validation Error");
|
|
20
20
|
this.validation = validation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionValidationError.js","names":["ActionValidationError","Error","
|
|
1
|
+
{"version":3,"file":"ActionValidationError.js","names":["ActionValidationError","Error","constructor","validation"],"sources":["ActionValidationError.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 { ActionValidationResponse } from \"@osdk/api\";\n\nexport class ActionValidationError extends Error {\n constructor(public validation: ActionValidationResponse) {\n super(\"Validation Error\");\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,OAAO,MAAMA,qBAAqB,SAASC,KAAK,CAAC;EAC/CC,WAAWA,CAAQC,UAAoC,EAAE;IACvD,KAAK,CAAC,kBAAkB,CAAC;IAAC,KADTA,UAAoC,GAApCA,UAAoC;EAEvD;AACF","ignoreList":[]}
|
|
@@ -13,9 +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 { $Actions, $ontologyRid, actionTakesAttachment, createOffice, createStructPerson, deleteFooInterface, moveOffice } from "@osdk/client.test.ontology";
|
|
17
18
|
import { apiServer, stubData } from "@osdk/shared.test";
|
|
18
|
-
import { afterAll, beforeAll, describe, expect, expectTypeOf, it } from "vitest";
|
|
19
|
+
import { afterAll, beforeAll, describe, expect, expectTypeOf, it, vi } from "vitest";
|
|
19
20
|
import { createClient } from "../createClient.js";
|
|
20
21
|
import { createAttachmentUpload } from "../object/AttachmentUpload.js";
|
|
21
22
|
import { ActionValidationError } from "./ActionValidationError.js";
|
|
@@ -58,6 +59,8 @@ describe("actions", () => {
|
|
|
58
59
|
"type": "edits",
|
|
59
60
|
}
|
|
60
61
|
`);
|
|
62
|
+
|
|
63
|
+
// eslint-disable-next-line @typescript-eslint/no-confusing-void-expression
|
|
61
64
|
const undefinedResult = await client(createOffice).applyAction({
|
|
62
65
|
officeId: "NYC",
|
|
63
66
|
address: "123 Main Street",
|
|
@@ -66,7 +69,8 @@ describe("actions", () => {
|
|
|
66
69
|
expectTypeOf().toEqualTypeOf();
|
|
67
70
|
expect(undefinedResult).toBeUndefined();
|
|
68
71
|
client(createOffice).batchApplyAction;
|
|
69
|
-
|
|
72
|
+
const clientCreateOfficeMock = vi.fn();
|
|
73
|
+
void clientCreateOfficeMock([{
|
|
70
74
|
officeId: "NYC",
|
|
71
75
|
address: "123 Main Street",
|
|
72
76
|
capacity: 100
|
|
@@ -129,6 +133,20 @@ describe("actions", () => {
|
|
|
129
133
|
`);
|
|
130
134
|
}
|
|
131
135
|
});
|
|
136
|
+
it("Accepts structs", async () => {
|
|
137
|
+
client(createStructPerson).applyAction;
|
|
138
|
+
expectTypeOf().toMatchTypeOf();
|
|
139
|
+
const result = await client(createStructPerson).applyAction({
|
|
140
|
+
name: "testMan",
|
|
141
|
+
address: {
|
|
142
|
+
city: "NYC",
|
|
143
|
+
state: "NY",
|
|
144
|
+
zipcode: 12345
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
expectTypeOf().toEqualTypeOf();
|
|
148
|
+
expect(result).toBeUndefined();
|
|
149
|
+
});
|
|
132
150
|
it("Accepts attachments", async () => {
|
|
133
151
|
client(actionTakesAttachment).applyAction;
|
|
134
152
|
expectTypeOf().toMatchTypeOf();
|
|
@@ -147,6 +165,7 @@ describe("actions", () => {
|
|
|
147
165
|
expectTypeOf().toMatchTypeOf();
|
|
148
166
|
const blob = stubData.attachmentUploadRequestBody[stubData.localAttachment1.filename];
|
|
149
167
|
const attachment = createAttachmentUpload(blob, "file1.txt");
|
|
168
|
+
|
|
150
169
|
// Mimics the Web file API (https://developer.mozilla.org/en-US/docs/Web/API/File). The File constructor is only available in Node 19.2.0 and above
|
|
151
170
|
const fileAttachment = Object.assign(blob, {
|
|
152
171
|
name: "file1.txt"
|
|
@@ -162,6 +181,20 @@ describe("actions", () => {
|
|
|
162
181
|
expectTypeOf().toEqualTypeOf();
|
|
163
182
|
expect(result2).toBeUndefined();
|
|
164
183
|
});
|
|
184
|
+
it("Accepts interfaces", async () => {
|
|
185
|
+
client(deleteFooInterface).applyAction;
|
|
186
|
+
expectTypeOf().toMatchTypeOf();
|
|
187
|
+
client(deleteFooInterface).batchApplyAction;
|
|
188
|
+
expectTypeOf().toMatchTypeOf();
|
|
189
|
+
const result = await client(deleteFooInterface).applyAction({
|
|
190
|
+
deletedInterface: {
|
|
191
|
+
$objectType: "Employee",
|
|
192
|
+
$primaryKey: 1
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
expectTypeOf().toEqualTypeOf();
|
|
196
|
+
expect(result).toBeUndefined();
|
|
197
|
+
});
|
|
165
198
|
it("conditionally returns edits in batch mode", async () => {
|
|
166
199
|
const result = await client(moveOffice).batchApplyAction([{
|
|
167
200
|
officeId: "SEA",
|
|
@@ -345,7 +378,7 @@ describe("ActionResponse remapping", () => {
|
|
|
345
378
|
});
|
|
346
379
|
it("actions are enumerable", async () => {
|
|
347
380
|
const actions = Object.keys($Actions);
|
|
348
|
-
expect(actions).toStrictEqual(["actionTakesAttachment", "actionTakesObjectSet", "createOffice", "createOfficeAndEmployee", "moveOffice", "promoteEmployee", "promoteEmployeeObject"]);
|
|
381
|
+
expect(actions).toStrictEqual(["actionTakesAttachment", "actionTakesObjectSet", "createOffice", "createOfficeAndEmployee", "createStructPerson", "deleteFooInterface", "moveOffice", "promoteEmployee", "promoteEmployeeObject"]);
|
|
349
382
|
});
|
|
350
383
|
});
|
|
351
384
|
//# sourceMappingURL=actions.test.js.map
|