@osdk/client 2.0.0-beta.8 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +284 -0
- package/build/browser/Client.d.ts +39 -0
- package/build/browser/Client.d.ts.map +1 -0
- package/build/browser/Client.js +20 -0
- package/build/browser/Client.js.map +1 -0
- package/build/browser/Definitions.test.d.ts +2 -0
- package/build/browser/Definitions.test.d.ts.map +1 -0
- package/build/browser/Definitions.test.js +35 -0
- package/build/browser/Definitions.test.js.map +1 -0
- package/build/browser/Logger.d.ts +19 -0
- package/build/browser/Logger.d.ts.map +1 -0
- package/build/browser/Logger.js +17 -0
- package/build/browser/Logger.js.map +1 -0
- package/build/browser/MinimalClientContext.d.ts +26 -0
- package/build/browser/MinimalClientContext.d.ts.map +1 -0
- package/build/browser/MinimalClientContext.js +17 -0
- package/build/browser/MinimalClientContext.js.map +1 -0
- package/build/browser/ResultOrError.d.ts +12 -0
- package/build/browser/ResultOrError.d.ts.map +1 -0
- package/build/browser/ResultOrError.js +19 -0
- package/build/browser/ResultOrError.js.map +1 -0
- package/build/browser/SatisfiesSemver.d.ts +4 -0
- package/build/browser/SatisfiesSemver.d.ts.map +1 -0
- package/build/browser/SatisfiesSemver.js +17 -0
- package/build/browser/SatisfiesSemver.js.map +1 -0
- package/build/browser/SatisfiesSemver.test.d.ts +2 -0
- package/build/browser/SatisfiesSemver.test.d.ts.map +1 -0
- package/build/browser/SatisfiesSemver.test.js +69 -0
- package/build/browser/SatisfiesSemver.test.js.map +1 -0
- package/build/browser/__unstable/ConjureSupport.d.ts +55 -0
- package/build/browser/__unstable/ConjureSupport.d.ts.map +1 -0
- package/build/browser/__unstable/ConjureSupport.js +174 -0
- package/build/browser/__unstable/ConjureSupport.js.map +1 -0
- package/build/browser/__unstable/createBulkLinksAsyncIterFactory.d.ts +10 -0
- package/build/browser/__unstable/createBulkLinksAsyncIterFactory.d.ts.map +1 -0
- package/build/browser/__unstable/createBulkLinksAsyncIterFactory.js +114 -0
- package/build/browser/__unstable/createBulkLinksAsyncIterFactory.js.map +1 -0
- package/build/browser/actions/ActionValidationError.d.ts +6 -0
- package/build/browser/actions/ActionValidationError.d.ts.map +1 -0
- package/build/browser/actions/ActionValidationError.js +23 -0
- package/build/browser/actions/ActionValidationError.js.map +1 -0
- package/build/browser/actions/actions.test.d.ts +2 -0
- package/build/browser/actions/actions.test.d.ts.map +1 -0
- package/build/browser/actions/actions.test.js +323 -0
- package/build/browser/actions/actions.test.js.map +1 -0
- package/build/browser/actions/applyAction.d.ts +30 -0
- package/build/browser/actions/applyAction.d.ts.map +1 -0
- package/build/browser/actions/applyAction.js +114 -0
- package/build/browser/actions/applyAction.js.map +1 -0
- package/build/browser/createAttachmentFromRid.d.ts +10 -0
- package/build/browser/createAttachmentFromRid.d.ts.map +1 -0
- package/build/browser/createAttachmentFromRid.js +38 -0
- package/build/browser/createAttachmentFromRid.js.map +1 -0
- package/build/browser/createClient.d.ts +6 -0
- package/build/browser/createClient.d.ts.map +1 -0
- package/build/browser/createClient.js +88 -0
- package/build/browser/createClient.js.map +1 -0
- package/build/browser/createClient.test.d.ts +2 -0
- package/build/browser/createClient.test.d.ts.map +1 -0
- package/build/browser/createClient.test.js +45 -0
- package/build/browser/createClient.test.js.map +1 -0
- package/build/browser/createMinimalClient.d.ts +2 -0
- package/build/browser/createMinimalClient.d.ts.map +1 -0
- package/build/browser/createMinimalClient.js +42 -0
- package/build/browser/createMinimalClient.js.map +1 -0
- package/build/browser/createPlatformClient.d.ts +17 -0
- package/build/browser/createPlatformClient.d.ts.map +1 -0
- package/build/browser/createPlatformClient.js +33 -0
- package/build/browser/createPlatformClient.js.map +1 -0
- package/build/browser/createTimeseriesProperty.d.ts +14 -0
- package/build/browser/createTimeseriesProperty.d.ts.map +1 -0
- package/build/browser/createTimeseriesProperty.js +79 -0
- package/build/browser/createTimeseriesProperty.js.map +1 -0
- package/build/browser/definitions/LinkDefinitions.test.d.ts +2 -0
- package/build/browser/definitions/LinkDefinitions.test.d.ts.map +1 -0
- package/build/browser/definitions/LinkDefinitions.test.js +41 -0
- package/build/browser/definitions/LinkDefinitions.test.js.map +1 -0
- package/build/browser/fetchMetadata.d.ts +2 -0
- package/build/browser/fetchMetadata.d.ts.map +1 -0
- package/build/browser/fetchMetadata.js +35 -0
- package/build/browser/fetchMetadata.js.map +1 -0
- package/build/browser/fetchMetadata.test.d.ts +2 -0
- package/build/browser/fetchMetadata.test.d.ts.map +1 -0
- package/build/browser/fetchMetadata.test.js +218 -0
- package/build/browser/fetchMetadata.test.js.map +1 -0
- package/build/browser/index.d.ts +13 -0
- package/build/browser/index.d.ts.map +1 -0
- package/build/browser/index.js +22 -12
- package/build/browser/index.js.map +1 -1
- package/build/browser/intellisense.test.d.ts +2 -0
- package/build/browser/intellisense.test.d.ts.map +1 -0
- package/build/browser/intellisense.test.helpers/callsQueryAcceptsObject.d.ts +2 -0
- package/build/browser/intellisense.test.helpers/callsQueryAcceptsObject.d.ts.map +1 -0
- package/build/browser/intellisense.test.helpers/callsQueryAcceptsObject.js +25 -0
- package/build/browser/intellisense.test.helpers/callsQueryAcceptsObject.js.map +1 -0
- package/build/browser/intellisense.test.js +86 -0
- package/build/browser/intellisense.test.js.map +1 -0
- package/build/browser/internal/conversions/legacyToModernSingleAggregationResult.d.ts +2 -0
- package/build/browser/internal/conversions/legacyToModernSingleAggregationResult.d.ts.map +1 -0
- package/build/browser/internal/conversions/legacyToModernSingleAggregationResult.js +34 -0
- package/build/browser/internal/conversions/legacyToModernSingleAggregationResult.js.map +1 -0
- package/build/browser/internal/conversions/modernToLegacyAggregationClause.d.ts +2 -0
- package/build/browser/internal/conversions/modernToLegacyAggregationClause.d.ts.map +1 -0
- package/build/browser/internal/conversions/modernToLegacyAggregationClause.js +38 -0
- package/build/browser/internal/conversions/modernToLegacyAggregationClause.js.map +1 -0
- package/build/browser/internal/conversions/modernToLegacyGroupByClause.d.ts +2 -0
- package/build/browser/internal/conversions/modernToLegacyGroupByClause.d.ts.map +1 -0
- package/build/browser/internal/conversions/modernToLegacyGroupByClause.js +62 -0
- package/build/browser/internal/conversions/modernToLegacyGroupByClause.js.map +1 -0
- package/build/browser/internal/conversions/modernToLegacyWhereClause.d.ts +2 -0
- package/build/browser/internal/conversions/modernToLegacyWhereClause.d.ts.map +1 -0
- package/build/browser/internal/conversions/modernToLegacyWhereClause.js +144 -0
- package/build/browser/internal/conversions/modernToLegacyWhereClause.js.map +1 -0
- package/build/browser/internal/conversions/modernToLegacyWhereClause.test.d.ts +2 -0
- package/build/browser/internal/conversions/modernToLegacyWhereClause.test.d.ts.map +1 -0
- package/build/browser/internal/conversions/modernToLegacyWhereClause.test.js +486 -0
- package/build/browser/internal/conversions/modernToLegacyWhereClause.test.js.map +1 -0
- package/build/browser/object/AttachmentUpload.d.ts +4 -0
- package/build/browser/object/AttachmentUpload.d.ts.map +1 -0
- package/build/browser/object/AttachmentUpload.js +27 -0
- package/build/browser/object/AttachmentUpload.js.map +1 -0
- package/build/browser/object/Cache.d.ts +2 -0
- package/build/browser/object/Cache.d.ts.map +1 -0
- package/build/browser/object/Cache.js +76 -0
- package/build/browser/object/Cache.js.map +1 -0
- package/build/browser/object/Cache.test.d.ts +11 -0
- package/build/browser/object/Cache.test.d.ts.map +1 -0
- package/build/browser/object/Cache.test.js +283 -0
- package/build/browser/object/Cache.test.js.map +1 -0
- package/build/browser/object/SimpleCache.d.ts +38 -0
- package/build/browser/object/SimpleCache.d.ts.map +1 -0
- package/build/browser/object/SimpleCache.js +67 -0
- package/build/browser/object/SimpleCache.js.map +1 -0
- package/build/browser/object/aggregate.d.ts +2 -0
- package/build/browser/object/aggregate.d.ts.map +1 -0
- package/build/browser/object/aggregate.js +69 -0
- package/build/browser/object/aggregate.js.map +1 -0
- package/build/browser/object/aggregate.test.d.ts +2 -0
- package/build/browser/object/aggregate.test.d.ts.map +1 -0
- package/build/browser/object/aggregate.test.js +398 -0
- package/build/browser/object/aggregate.test.js.map +1 -0
- package/build/browser/object/attachment.test.d.ts +2 -0
- package/build/browser/object/attachment.test.d.ts.map +1 -0
- package/build/browser/object/attachment.test.js +55 -0
- package/build/browser/object/attachment.test.js.map +1 -0
- package/build/browser/object/convertWireToOsdkObjects/InterfaceHolder.d.ts +11 -0
- package/build/browser/object/convertWireToOsdkObjects/InterfaceHolder.d.ts.map +1 -0
- package/build/browser/object/convertWireToOsdkObjects/InterfaceHolder.js +17 -0
- package/build/browser/object/convertWireToOsdkObjects/InterfaceHolder.js.map +1 -0
- package/build/browser/object/convertWireToOsdkObjects/InternalSymbols.d.ts +13 -0
- package/build/browser/object/convertWireToOsdkObjects/InternalSymbols.d.ts.map +1 -0
- package/build/browser/object/convertWireToOsdkObjects/InternalSymbols.js +22 -0
- package/build/browser/object/convertWireToOsdkObjects/InternalSymbols.js.map +1 -0
- package/build/browser/object/convertWireToOsdkObjects/ObjectHolder.d.ts +2 -0
- package/build/browser/object/convertWireToOsdkObjects/ObjectHolder.d.ts.map +1 -0
- package/build/browser/object/convertWireToOsdkObjects/ObjectHolder.js +17 -0
- package/build/browser/object/convertWireToOsdkObjects/ObjectHolder.js.map +1 -0
- package/build/browser/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.d.ts +2 -0
- package/build/browser/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.d.ts.map +1 -0
- package/build/browser/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.js +48 -0
- package/build/browser/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.js.map +1 -0
- package/build/browser/object/convertWireToOsdkObjects/PropertyDescriptorRecord.d.ts +8 -0
- package/build/browser/object/convertWireToOsdkObjects/PropertyDescriptorRecord.d.ts.map +1 -0
- package/build/browser/object/convertWireToOsdkObjects/PropertyDescriptorRecord.js +17 -0
- package/build/browser/object/convertWireToOsdkObjects/PropertyDescriptorRecord.js.map +1 -0
- package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.d.ts +2 -0
- package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.d.ts.map +1 -0
- package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.js +82 -0
- package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.js.map +1 -0
- package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.d.ts +2 -0
- package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.d.ts.map +1 -0
- package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.js +114 -0
- package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.js.map +1 -0
- package/build/browser/object/convertWireToOsdkObjects/getDollarAs.d.ts +3 -0
- package/build/browser/object/convertWireToOsdkObjects/getDollarAs.d.ts.map +1 -0
- package/build/browser/object/convertWireToOsdkObjects/getDollarAs.js +55 -0
- package/build/browser/object/convertWireToOsdkObjects/getDollarAs.js.map +1 -0
- package/build/browser/object/convertWireToOsdkObjects/getDollarLink.d.ts +2 -0
- package/build/browser/object/convertWireToOsdkObjects/getDollarLink.d.ts.map +1 -0
- package/build/browser/object/convertWireToOsdkObjects/getDollarLink.js +60 -0
- package/build/browser/object/convertWireToOsdkObjects/getDollarLink.js.map +1 -0
- package/build/browser/object/convertWireToOsdkObjects.d.ts +2 -0
- package/build/browser/object/convertWireToOsdkObjects.d.ts.map +1 -0
- package/build/browser/object/convertWireToOsdkObjects.js +150 -0
- package/build/browser/object/convertWireToOsdkObjects.js.map +1 -0
- package/build/browser/object/convertWireToOsdkObjects.test.d.ts +2 -0
- package/build/browser/object/convertWireToOsdkObjects.test.d.ts.map +1 -0
- package/build/browser/object/convertWireToOsdkObjects.test.js +254 -0
- package/build/browser/object/convertWireToOsdkObjects.test.js.map +1 -0
- package/build/browser/object/fetchPage.d.ts +3 -0
- package/build/browser/object/fetchPage.d.ts.map +1 -0
- package/build/browser/object/fetchPage.js +135 -0
- package/build/browser/object/fetchPage.js.map +1 -0
- package/build/browser/object/fetchPage.test.d.ts +2 -0
- package/build/browser/object/fetchPage.test.d.ts.map +1 -0
- package/build/browser/object/fetchPage.test.js +106 -0
- package/build/browser/object/fetchPage.test.js.map +1 -0
- package/build/browser/object/fetchSingle.d.ts +2 -0
- package/build/browser/object/fetchSingle.d.ts.map +1 -0
- package/build/browser/object/fetchSingle.js +47 -0
- package/build/browser/object/fetchSingle.js.map +1 -0
- package/build/browser/object/object.test.d.ts +12 -0
- package/build/browser/object/object.test.d.ts.map +1 -0
- package/build/browser/object/object.test.js +179 -0
- package/build/browser/object/object.test.js.map +1 -0
- package/build/browser/object/timeseries.test.d.ts +2 -0
- package/build/browser/object/timeseries.test.d.ts.map +1 -0
- package/build/browser/object/timeseries.test.js +163 -0
- package/build/browser/object/timeseries.test.js.map +1 -0
- package/build/browser/objectSet/ObjectSet.test.d.ts +2 -0
- package/build/browser/objectSet/ObjectSet.test.d.ts.map +1 -0
- package/build/browser/objectSet/ObjectSet.test.js +313 -0
- package/build/browser/objectSet/ObjectSet.test.js.map +1 -0
- package/build/browser/objectSet/ObjectSetFactory.d.ts +2 -0
- package/build/browser/objectSet/ObjectSetFactory.d.ts.map +1 -0
- package/build/browser/objectSet/ObjectSetFactory.js +17 -0
- package/build/browser/objectSet/ObjectSetFactory.js.map +1 -0
- package/build/browser/objectSet/ObjectSetListenerWebsocket.d.ts +7 -0
- package/build/browser/objectSet/ObjectSetListenerWebsocket.d.ts.map +1 -0
- package/build/browser/objectSet/ObjectSetListenerWebsocket.js +533 -0
- package/build/browser/objectSet/ObjectSetListenerWebsocket.js.map +1 -0
- package/build/browser/objectSet/ObjectSetListenerWebsocket.test.d.ts +2 -0
- package/build/browser/objectSet/ObjectSetListenerWebsocket.test.d.ts.map +1 -0
- package/build/browser/objectSet/ObjectSetListenerWebsocket.test.js +338 -0
- package/build/browser/objectSet/ObjectSetListenerWebsocket.test.js.map +1 -0
- package/build/browser/objectSet/conjureUnionType.d.ts +13 -0
- package/build/browser/objectSet/conjureUnionType.d.ts.map +1 -0
- package/build/browser/objectSet/conjureUnionType.js +27 -0
- package/build/browser/objectSet/conjureUnionType.js.map +1 -0
- package/build/browser/objectSet/createObjectSet.d.ts +2 -0
- package/build/browser/objectSet/createObjectSet.d.ts.map +1 -0
- package/build/browser/objectSet/createObjectSet.js +136 -0
- package/build/browser/objectSet/createObjectSet.js.map +1 -0
- package/build/browser/objectSet/toConjureObjectSet.d.ts +2 -0
- package/build/browser/objectSet/toConjureObjectSet.d.ts.map +1 -0
- package/build/browser/objectSet/toConjureObjectSet.js +158 -0
- package/build/browser/objectSet/toConjureObjectSet.js.map +1 -0
- package/build/browser/ontology/OntologyProvider.d.ts +32 -0
- package/build/browser/ontology/OntologyProvider.d.ts.map +1 -0
- package/build/browser/ontology/OntologyProvider.js +17 -0
- package/build/browser/ontology/OntologyProvider.js.map +1 -0
- package/build/browser/ontology/StandardOntologyProvider.d.ts +5 -0
- package/build/browser/ontology/StandardOntologyProvider.d.ts.map +1 -0
- package/build/browser/ontology/StandardOntologyProvider.js +59 -0
- package/build/browser/ontology/StandardOntologyProvider.js.map +1 -0
- package/build/browser/ontology/StandardOntologyProvider.test.d.ts +2 -0
- package/build/browser/ontology/StandardOntologyProvider.test.d.ts.map +1 -0
- package/build/browser/ontology/StandardOntologyProvider.test.js +48 -0
- package/build/browser/ontology/StandardOntologyProvider.test.js.map +1 -0
- package/build/browser/ontology/loadActionMetadata.d.ts +4 -0
- package/build/browser/ontology/loadActionMetadata.d.ts.map +1 -0
- package/build/browser/ontology/loadActionMetadata.js +22 -0
- package/build/browser/ontology/loadActionMetadata.js.map +1 -0
- package/build/browser/ontology/loadFullObjectMetadata.d.ts +6 -0
- package/build/browser/ontology/loadFullObjectMetadata.d.ts.map +1 -0
- package/build/browser/ontology/loadFullObjectMetadata.js +28 -0
- package/build/browser/ontology/loadFullObjectMetadata.js.map +1 -0
- package/build/browser/ontology/loadInterfaceMetadata.d.ts +4 -0
- package/build/browser/ontology/loadInterfaceMetadata.d.ts.map +1 -0
- package/build/browser/ontology/loadInterfaceMetadata.js +24 -0
- package/build/browser/ontology/loadInterfaceMetadata.js.map +1 -0
- package/build/browser/ontology/loadQueryMetadata.d.ts +4 -0
- package/build/browser/ontology/loadQueryMetadata.d.ts.map +1 -0
- package/build/browser/ontology/loadQueryMetadata.js +22 -0
- package/build/browser/ontology/loadQueryMetadata.js.map +1 -0
- package/build/browser/ontology/makeConjureContext.d.ts +4 -0
- package/build/browser/ontology/makeConjureContext.d.ts.map +1 -0
- package/build/browser/ontology/makeConjureContext.js +28 -0
- package/build/browser/ontology/makeConjureContext.js.map +1 -0
- package/build/browser/pageRequestAsAsyncIter.d.ts +10 -0
- package/build/browser/pageRequestAsAsyncIter.d.ts.map +1 -0
- package/build/browser/pageRequestAsAsyncIter.js +37 -0
- package/build/browser/pageRequestAsAsyncIter.js.map +1 -0
- package/build/browser/public/unstable-do-not-use.d.ts +2 -0
- package/build/browser/public/unstable-do-not-use.d.ts.map +1 -0
- package/build/browser/public/unstable-do-not-use.js +16 -878
- package/build/browser/public/unstable-do-not-use.js.map +1 -1
- package/build/browser/queries/applyQuery.d.ts +6 -0
- package/build/browser/queries/applyQuery.d.ts.map +1 -0
- package/build/browser/queries/applyQuery.js +234 -0
- package/build/browser/queries/applyQuery.js.map +1 -0
- package/build/browser/queries/queries.test.d.ts +2 -0
- package/build/browser/queries/queries.test.d.ts.map +1 -0
- package/build/browser/queries/queries.test.js +171 -0
- package/build/browser/queries/queries.test.js.map +1 -0
- package/build/browser/queries/types.d.ts +20 -0
- package/build/browser/queries/types.d.ts.map +1 -0
- package/build/browser/queries/types.js +17 -0
- package/build/browser/queries/types.js.map +1 -0
- package/build/browser/tsserver.d.ts +34 -0
- package/build/browser/tsserver.d.ts.map +1 -0
- package/build/browser/tsserver.js +133 -0
- package/build/browser/tsserver.js.map +1 -0
- package/build/browser/util/ArrayElement.d.ts +2 -0
- package/build/browser/util/ArrayElement.d.ts.map +1 -0
- package/build/browser/util/ArrayElement.js +17 -0
- package/build/browser/util/ArrayElement.js.map +1 -0
- package/build/browser/util/NOOP.d.ts +4 -0
- package/build/browser/util/NOOP.d.ts.map +1 -0
- package/build/browser/util/NOOP.js +17 -0
- package/build/browser/util/NOOP.js.map +1 -0
- package/build/browser/util/NullableProps.d.ts +6 -0
- package/build/browser/util/NullableProps.d.ts.map +1 -0
- package/build/browser/util/NullableProps.js +17 -0
- package/build/browser/util/NullableProps.js.map +1 -0
- package/build/browser/util/UserAgent.d.ts +2 -0
- package/build/browser/util/UserAgent.d.ts.map +1 -0
- package/build/browser/util/UserAgent.js +17 -0
- package/build/browser/util/UserAgent.js.map +1 -0
- package/build/browser/util/WireObjectSet.d.ts +2 -0
- package/build/browser/util/WireObjectSet.d.ts.map +1 -0
- package/build/browser/util/WireObjectSet.js +21 -0
- package/build/browser/util/WireObjectSet.js.map +1 -0
- package/build/browser/util/addUserAgentAndRequestContextHeaders.d.ts +4 -0
- package/build/browser/util/addUserAgentAndRequestContextHeaders.d.ts.map +1 -0
- package/build/browser/util/addUserAgentAndRequestContextHeaders.js +27 -0
- package/build/browser/util/addUserAgentAndRequestContextHeaders.js.map +1 -0
- package/build/browser/util/augmentRequestContext.d.ts +32 -0
- package/build/browser/util/augmentRequestContext.d.ts.map +1 -0
- package/build/browser/util/augmentRequestContext.js +52 -0
- package/build/browser/util/augmentRequestContext.js.map +1 -0
- package/build/browser/util/isOntologyObjectV2.d.ts +2 -0
- package/build/browser/util/isOntologyObjectV2.d.ts.map +1 -0
- package/build/browser/util/isOntologyObjectV2.js +20 -0
- package/build/browser/util/isOntologyObjectV2.js.map +1 -0
- package/build/browser/util/isOsdkBaseObject.d.ts +3 -0
- package/build/browser/util/isOsdkBaseObject.d.ts.map +1 -0
- package/build/browser/util/isOsdkBaseObject.js +19 -0
- package/build/browser/util/isOsdkBaseObject.js.map +1 -0
- package/build/browser/util/isOsdkObject.d.ts +3 -0
- package/build/browser/util/isOsdkObject.d.ts.map +1 -0
- package/build/browser/util/isOsdkObject.js +19 -0
- package/build/browser/util/isOsdkObject.js.map +1 -0
- package/build/browser/util/partialBy.d.ts +3 -0
- package/build/browser/util/partialBy.d.ts.map +1 -0
- package/build/browser/util/partialBy.js +17 -0
- package/build/browser/util/partialBy.js.map +1 -0
- package/build/browser/util/streamutils.d.ts +3 -0
- package/build/browser/util/streamutils.d.ts.map +1 -0
- package/build/browser/util/streamutils.js +95 -0
- package/build/browser/util/streamutils.js.map +1 -0
- package/build/browser/util/toDataValue.d.ts +2 -0
- package/build/browser/util/toDataValue.d.ts.map +1 -0
- package/build/browser/util/toDataValue.js +73 -0
- package/build/browser/util/toDataValue.js.map +1 -0
- package/build/browser/util/toDataValue.test.d.ts +2 -0
- package/build/browser/util/toDataValue.test.d.ts.map +1 -0
- package/build/browser/util/toDataValue.test.js +117 -0
- package/build/browser/util/toDataValue.test.js.map +1 -0
- package/build/browser/util/toDataValueQueries.d.ts +2 -0
- package/build/browser/util/toDataValueQueries.d.ts.map +1 -0
- package/build/browser/util/toDataValueQueries.js +107 -0
- package/build/browser/util/toDataValueQueries.js.map +1 -0
- package/build/esm/Client.d.ts +24 -4
- package/build/esm/Client.d.ts.map +1 -1
- package/build/esm/Client.js +20 -0
- package/build/esm/Client.js.map +1 -0
- package/build/esm/Definitions.test.js +35 -0
- package/build/esm/Definitions.test.js.map +1 -0
- package/build/esm/Logger.d.ts +19 -0
- package/build/esm/Logger.d.ts.map +1 -0
- package/build/esm/Logger.js +17 -0
- package/build/esm/Logger.js.map +1 -0
- package/build/esm/MinimalClientContext.d.ts +1 -1
- package/build/esm/MinimalClientContext.d.ts.map +1 -1
- package/build/esm/MinimalClientContext.js +17 -0
- package/build/esm/MinimalClientContext.js.map +1 -0
- package/build/esm/ResultOrError.js +19 -0
- package/build/esm/ResultOrError.js.map +1 -0
- package/build/esm/SatisfiesSemver.js +17 -0
- package/build/esm/SatisfiesSemver.js.map +1 -0
- package/build/esm/SatisfiesSemver.test.js +69 -0
- package/build/esm/SatisfiesSemver.test.js.map +1 -0
- package/build/esm/__unstable/ConjureSupport.js +174 -0
- package/build/esm/__unstable/ConjureSupport.js.map +1 -0
- package/build/esm/__unstable/createBulkLinksAsyncIterFactory.d.ts +1 -1
- package/build/esm/__unstable/createBulkLinksAsyncIterFactory.d.ts.map +1 -1
- package/build/esm/__unstable/createBulkLinksAsyncIterFactory.js +114 -0
- package/build/esm/__unstable/createBulkLinksAsyncIterFactory.js.map +1 -0
- package/build/esm/actions/ActionValidationError.d.ts +1 -1
- package/build/esm/actions/ActionValidationError.d.ts.map +1 -1
- package/build/esm/actions/ActionValidationError.js +23 -0
- package/build/esm/actions/ActionValidationError.js.map +1 -0
- package/build/esm/actions/actions.test.js +323 -0
- package/build/esm/actions/actions.test.js.map +1 -0
- package/build/esm/actions/applyAction.d.ts +17 -11
- package/build/esm/actions/applyAction.d.ts.map +1 -1
- package/build/esm/actions/applyAction.js +114 -0
- package/build/esm/actions/applyAction.js.map +1 -0
- package/build/esm/createAttachmentFromRid.d.ts +1 -1
- package/build/esm/createAttachmentFromRid.d.ts.map +1 -1
- package/build/esm/createAttachmentFromRid.js +38 -0
- package/build/esm/createAttachmentFromRid.js.map +1 -0
- package/build/esm/createClient.d.ts +1 -1
- package/build/esm/createClient.d.ts.map +1 -1
- package/build/esm/createClient.js +88 -0
- package/build/esm/createClient.js.map +1 -0
- package/build/esm/createClient.test.js +45 -0
- package/build/esm/createClient.test.js.map +1 -0
- package/build/esm/createMinimalClient.js +42 -0
- package/build/esm/createMinimalClient.js.map +1 -0
- package/build/esm/createPlatformClient.js +33 -0
- package/build/esm/createPlatformClient.js.map +1 -0
- package/build/esm/createTimeseriesProperty.d.ts +12 -2
- package/build/esm/createTimeseriesProperty.d.ts.map +1 -1
- package/build/esm/createTimeseriesProperty.js +79 -0
- package/build/esm/createTimeseriesProperty.js.map +1 -0
- package/build/esm/definitions/LinkDefinitions.test.js +41 -0
- package/build/esm/definitions/LinkDefinitions.test.js.map +1 -0
- package/build/esm/fetchMetadata.d.ts +2 -0
- package/build/esm/fetchMetadata.d.ts.map +1 -0
- package/build/esm/fetchMetadata.js +35 -0
- package/build/esm/fetchMetadata.js.map +1 -0
- package/build/esm/fetchMetadata.test.d.ts +2 -0
- package/build/esm/fetchMetadata.test.d.ts.map +1 -0
- package/build/esm/fetchMetadata.test.js +218 -0
- package/build/esm/fetchMetadata.test.js.map +1 -0
- package/build/esm/index.d.ts +3 -2
- package/build/esm/index.d.ts.map +1 -1
- package/build/esm/index.js +22 -12
- package/build/esm/index.js.map +1 -1
- package/build/esm/intellisense.test.helpers/callsQueryAcceptsObject.js +25 -0
- package/build/esm/intellisense.test.helpers/callsQueryAcceptsObject.js.map +1 -0
- package/build/esm/intellisense.test.js +86 -0
- package/build/esm/intellisense.test.js.map +1 -0
- package/build/esm/internal/conversions/legacyToModernSingleAggregationResult.js +34 -0
- package/build/esm/internal/conversions/legacyToModernSingleAggregationResult.js.map +1 -0
- package/build/esm/internal/conversions/modernToLegacyAggregationClause.js +38 -0
- package/build/esm/internal/conversions/modernToLegacyAggregationClause.js.map +1 -0
- package/build/esm/internal/conversions/modernToLegacyGroupByClause.js +62 -0
- package/build/esm/internal/conversions/modernToLegacyGroupByClause.js.map +1 -0
- package/build/esm/internal/conversions/modernToLegacyWhereClause.js +144 -0
- package/build/esm/internal/conversions/modernToLegacyWhereClause.js.map +1 -0
- package/build/esm/internal/conversions/modernToLegacyWhereClause.test.js +486 -0
- package/build/esm/internal/conversions/modernToLegacyWhereClause.test.js.map +1 -0
- package/build/esm/object/AttachmentUpload.d.ts +1 -1
- package/build/esm/object/AttachmentUpload.d.ts.map +1 -1
- package/build/esm/object/AttachmentUpload.js +27 -0
- package/build/esm/object/AttachmentUpload.js.map +1 -0
- package/build/esm/object/Cache.js +76 -0
- package/build/esm/object/Cache.js.map +1 -0
- package/build/esm/object/Cache.test.js +283 -0
- package/build/esm/object/Cache.test.js.map +1 -0
- package/build/esm/object/SimpleCache.js +67 -0
- package/build/esm/object/SimpleCache.js.map +1 -0
- package/build/esm/object/aggregate.js +69 -0
- package/build/esm/object/aggregate.js.map +1 -0
- package/build/esm/object/aggregate.test.js +398 -0
- package/build/esm/object/aggregate.test.js.map +1 -0
- package/build/esm/object/attachment.test.js +55 -0
- package/build/esm/object/attachment.test.js.map +1 -0
- package/build/esm/object/convertWireToOsdkObjects/InterfaceHolder.d.ts +4 -5
- package/build/esm/object/convertWireToOsdkObjects/InterfaceHolder.d.ts.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/InterfaceHolder.js +17 -0
- package/build/esm/object/convertWireToOsdkObjects/InterfaceHolder.js.map +1 -0
- package/build/esm/object/convertWireToOsdkObjects/InternalSymbols.d.ts +2 -3
- package/build/esm/object/convertWireToOsdkObjects/InternalSymbols.d.ts.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/InternalSymbols.js +22 -0
- package/build/esm/object/convertWireToOsdkObjects/InternalSymbols.js.map +1 -0
- package/build/esm/object/convertWireToOsdkObjects/ObjectHolder.js +17 -0
- package/build/esm/object/convertWireToOsdkObjects/ObjectHolder.js.map +1 -0
- package/build/esm/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.d.ts.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.js +48 -0
- package/build/esm/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.js.map +1 -0
- package/build/esm/object/convertWireToOsdkObjects/PropertyDescriptorRecord.js +17 -0
- package/build/esm/object/convertWireToOsdkObjects/PropertyDescriptorRecord.js.map +1 -0
- package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.js +82 -0
- package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.js.map +1 -0
- package/build/esm/object/convertWireToOsdkObjects/createOsdkObject.js +114 -0
- package/build/esm/object/convertWireToOsdkObjects/createOsdkObject.js.map +1 -0
- package/build/esm/object/convertWireToOsdkObjects/getDollarAs.d.ts +1 -1
- package/build/esm/object/convertWireToOsdkObjects/getDollarAs.d.ts.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/getDollarAs.js +55 -0
- package/build/esm/object/convertWireToOsdkObjects/getDollarAs.js.map +1 -0
- package/build/esm/object/convertWireToOsdkObjects/getDollarLink.js +60 -0
- package/build/esm/object/convertWireToOsdkObjects/getDollarLink.js.map +1 -0
- package/build/esm/object/convertWireToOsdkObjects.js +150 -0
- package/build/esm/object/convertWireToOsdkObjects.js.map +1 -0
- package/build/esm/object/convertWireToOsdkObjects.test.js +254 -0
- package/build/esm/object/convertWireToOsdkObjects.test.js.map +1 -0
- package/build/esm/object/fetchPage.d.ts +2 -3
- package/build/esm/object/fetchPage.d.ts.map +1 -1
- package/build/esm/object/fetchPage.js +135 -0
- package/build/esm/object/fetchPage.js.map +1 -0
- package/build/esm/object/fetchPage.test.js +106 -0
- package/build/esm/object/fetchPage.test.js.map +1 -0
- package/build/esm/object/fetchSingle.js +47 -0
- package/build/esm/object/fetchSingle.js.map +1 -0
- package/build/esm/object/object.test.d.ts +4 -5
- package/build/esm/object/object.test.d.ts.map +1 -1
- package/build/esm/object/object.test.js +179 -0
- package/build/esm/object/object.test.js.map +1 -0
- package/build/esm/object/timeseries.test.js +163 -0
- package/build/esm/object/timeseries.test.js.map +1 -0
- package/build/esm/objectSet/ObjectSet.test.js +313 -0
- package/build/esm/objectSet/ObjectSet.test.js.map +1 -0
- package/build/esm/objectSet/ObjectSetFactory.js +17 -0
- package/build/esm/objectSet/ObjectSetFactory.js.map +1 -0
- package/build/esm/objectSet/ObjectSetListenerWebsocket.d.ts.map +1 -1
- package/build/esm/objectSet/ObjectSetListenerWebsocket.js +536 -0
- package/build/esm/objectSet/ObjectSetListenerWebsocket.js.map +1 -0
- package/build/esm/objectSet/ObjectSetListenerWebsocket.test.js +338 -0
- package/build/esm/objectSet/ObjectSetListenerWebsocket.test.js.map +1 -0
- package/build/esm/objectSet/conjureUnionType.js +27 -0
- package/build/esm/objectSet/conjureUnionType.js.map +1 -0
- package/build/esm/objectSet/createObjectSet.js +136 -0
- package/build/esm/objectSet/createObjectSet.js.map +1 -0
- package/build/esm/objectSet/toConjureObjectSet.js +158 -0
- package/build/esm/objectSet/toConjureObjectSet.js.map +1 -0
- package/build/esm/ontology/OntologyProvider.d.ts +7 -13
- package/build/esm/ontology/OntologyProvider.d.ts.map +1 -1
- package/build/esm/ontology/OntologyProvider.js +17 -0
- package/build/esm/ontology/OntologyProvider.js.map +1 -0
- package/build/esm/ontology/StandardOntologyProvider.d.ts.map +1 -1
- package/build/esm/ontology/StandardOntologyProvider.js +59 -0
- package/build/esm/ontology/StandardOntologyProvider.js.map +1 -0
- package/build/esm/ontology/StandardOntologyProvider.test.js +48 -0
- package/build/esm/ontology/StandardOntologyProvider.test.js.map +1 -0
- package/build/esm/ontology/loadActionMetadata.d.ts +4 -0
- package/build/esm/ontology/loadActionMetadata.d.ts.map +1 -0
- package/build/esm/ontology/loadActionMetadata.js +22 -0
- package/build/esm/ontology/loadActionMetadata.js.map +1 -0
- package/build/esm/ontology/loadFullObjectMetadata.d.ts +2 -2
- package/build/esm/ontology/loadFullObjectMetadata.d.ts.map +1 -1
- package/build/esm/ontology/loadFullObjectMetadata.js +28 -0
- package/build/esm/ontology/loadFullObjectMetadata.js.map +1 -0
- package/build/esm/ontology/loadInterfaceMetadata.d.ts +4 -0
- package/build/esm/ontology/loadInterfaceMetadata.d.ts.map +1 -0
- package/build/esm/ontology/loadInterfaceMetadata.js +24 -0
- package/build/esm/ontology/loadInterfaceMetadata.js.map +1 -0
- package/build/esm/ontology/loadQueryMetadata.d.ts +4 -0
- package/build/esm/ontology/loadQueryMetadata.d.ts.map +1 -0
- package/build/esm/ontology/loadQueryMetadata.js +22 -0
- package/build/esm/ontology/loadQueryMetadata.js.map +1 -0
- package/build/esm/ontology/makeConjureContext.js +28 -0
- package/build/esm/ontology/makeConjureContext.js.map +1 -0
- package/build/esm/pageRequestAsAsyncIter.js +37 -0
- package/build/esm/pageRequestAsAsyncIter.js.map +1 -0
- package/build/esm/public/unstable-do-not-use.d.ts +0 -4
- package/build/esm/public/unstable-do-not-use.d.ts.map +1 -1
- package/build/esm/public/unstable-do-not-use.js +16 -881
- package/build/esm/public/unstable-do-not-use.js.map +1 -1
- package/build/esm/queries/applyQuery.d.ts +3 -4
- package/build/esm/queries/applyQuery.d.ts.map +1 -1
- package/build/esm/queries/applyQuery.js +234 -0
- package/build/esm/queries/applyQuery.js.map +1 -0
- package/build/esm/queries/queries.test.js +171 -0
- package/build/esm/queries/queries.test.js.map +1 -0
- package/build/esm/queries/types.d.ts +10 -11
- package/build/esm/queries/types.d.ts.map +1 -1
- package/build/esm/queries/types.js +17 -0
- package/build/esm/queries/types.js.map +1 -0
- package/build/esm/tsserver.d.ts +1 -1
- package/build/esm/tsserver.d.ts.map +1 -1
- package/build/esm/tsserver.js +133 -0
- package/build/esm/tsserver.js.map +1 -0
- package/build/esm/util/ArrayElement.js +17 -0
- package/build/esm/util/ArrayElement.js.map +1 -0
- package/build/esm/util/NOOP.js +17 -0
- package/build/esm/util/NOOP.js.map +1 -0
- package/build/esm/util/NullableProps.js +17 -0
- package/build/esm/util/NullableProps.js.map +1 -0
- package/build/esm/util/UserAgent.js +17 -0
- package/build/esm/util/UserAgent.js.map +1 -0
- package/build/esm/util/WireObjectSet.js +21 -0
- package/build/esm/util/WireObjectSet.js.map +1 -0
- package/build/esm/util/addUserAgentAndRequestContextHeaders.js +27 -0
- package/build/esm/util/addUserAgentAndRequestContextHeaders.js.map +1 -0
- package/build/esm/util/augmentRequestContext.js +52 -0
- package/build/esm/util/augmentRequestContext.js.map +1 -0
- package/build/esm/util/isOntologyObjectV2.js +20 -0
- package/build/esm/util/isOntologyObjectV2.js.map +1 -0
- package/build/esm/util/isOsdkBaseObject.d.ts +1 -1
- package/build/esm/util/isOsdkBaseObject.d.ts.map +1 -1
- package/build/esm/util/isOsdkBaseObject.js +19 -0
- package/build/esm/util/isOsdkBaseObject.js.map +1 -0
- package/build/esm/util/isOsdkObject.d.ts +1 -1
- package/build/esm/util/isOsdkObject.d.ts.map +1 -1
- package/build/esm/util/isOsdkObject.js +19 -0
- package/build/esm/util/isOsdkObject.js.map +1 -0
- package/build/esm/util/partialBy.js +17 -0
- package/build/esm/util/partialBy.js.map +1 -0
- package/build/esm/util/streamutils.js +95 -0
- package/build/esm/util/streamutils.js.map +1 -0
- package/build/esm/util/toDataValue.js +73 -0
- package/build/esm/util/toDataValue.js.map +1 -0
- package/build/esm/util/toDataValue.test.js +117 -0
- package/build/esm/util/toDataValue.test.js.map +1 -0
- package/build/esm/util/toDataValueQueries.js +107 -0
- package/build/esm/util/toDataValueQueries.js.map +1 -0
- package/package.json +15 -27
- package/build/browser/chunk-5HUCUBJX.js +0 -2327
- package/build/browser/chunk-5HUCUBJX.js.map +0 -1
- package/build/esm/__unstable/UNSTABLE_createClient.d.ts +0 -4
- package/build/esm/__unstable/UNSTABLE_createClient.d.ts.map +0 -1
- package/build/esm/__unstable/UnstableClient.d.ts +0 -12
- package/build/esm/__unstable/UnstableClient.d.ts.map +0 -1
- package/build/esm/chunk-5HUCUBJX.js +0 -2327
- package/build/esm/chunk-5HUCUBJX.js.map +0 -1
- package/build/esm/objectSet/ObjectSetListener.d.ts +0 -18
- package/build/esm/objectSet/ObjectSetListener.d.ts.map +0 -1
- package/build/esm/objectSet/createUnstableObjectSet.d.ts +0 -8
- package/build/esm/objectSet/createUnstableObjectSet.d.ts.map +0 -1
- package/build/esm/ontology/loadInterfaceDefinition.d.ts +0 -4
- package/build/esm/ontology/loadInterfaceDefinition.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OsdkCustomInspectPrototype.d.ts","sourceRoot":"","sources":["../../../../src/object/convertWireToOsdkObjects/OsdkCustomInspectPrototype.ts"],"names":[],"mappings":"AAyBA,eAAO,MAAM,0BAA0B,KAErC,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
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
|
+
import { InterfaceDefRef, ObjectDefRef, UnderlyingOsdkObject } from "./InternalSymbols.js";
|
|
17
|
+
export const OsdkCustomInspectPrototype = Object.create(null, {
|
|
18
|
+
[Symbol.for("nodejs.util.inspect.custom")]: {
|
|
19
|
+
value: customInspect
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
/**
|
|
23
|
+
* A custom `util.inspect`/`console.log` for nodejs. Not emitted in the browser version
|
|
24
|
+
* @param this
|
|
25
|
+
* @param _depth
|
|
26
|
+
* @param options
|
|
27
|
+
* @param inspect
|
|
28
|
+
* @returns
|
|
29
|
+
*/
|
|
30
|
+
function customInspect(_depth, options, localInspect) {
|
|
31
|
+
const newOptions = {
|
|
32
|
+
...options,
|
|
33
|
+
depth: options.depth == null ? null : options.depth - 1
|
|
34
|
+
};
|
|
35
|
+
let ret = `Osdk<${options.stylize(this[ObjectDefRef]?.apiName ?? this[InterfaceDefRef]?.apiName ?? "", "special")}> {\n`;
|
|
36
|
+
for (const k of new Set(["$apiName", "$objectType", "$primaryKey", ...Reflect.ownKeys(this)])) {
|
|
37
|
+
if (typeof k === "symbol") continue;
|
|
38
|
+
ret += ` ${options.stylize(k.toString(), "undefined")}: ${localInspect(this[k], newOptions)}\n`;
|
|
39
|
+
}
|
|
40
|
+
if (this[UnderlyingOsdkObject] !== this) {
|
|
41
|
+
ret += "\n";
|
|
42
|
+
ret += ` ${options.stylize("$as", "special")}: ${localInspect(this[UnderlyingOsdkObject], newOptions).replace(/\n/g, `\n `)}`;
|
|
43
|
+
ret += "\n";
|
|
44
|
+
}
|
|
45
|
+
ret += "}";
|
|
46
|
+
return ret;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=OsdkCustomInspectPrototype.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OsdkCustomInspectPrototype.js","names":["InterfaceDefRef","ObjectDefRef","UnderlyingOsdkObject","OsdkCustomInspectPrototype","Object","create","Symbol","for","value","customInspect","_depth","options","localInspect","newOptions","depth","ret","stylize","apiName","k","Set","Reflect","ownKeys","toString","replace"],"sources":["OsdkCustomInspectPrototype.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 { InterfaceDefRef, ObjectDefRef, UnderlyingOsdkObject, } from \"./InternalSymbols.js\";\nexport const OsdkCustomInspectPrototype = Object.create(null, {\n [Symbol.for(\"nodejs.util.inspect.custom\")]: { value: customInspect },\n});\n/**\n * A custom `util.inspect`/`console.log` for nodejs. Not emitted in the browser version\n * @param this\n * @param _depth\n * @param options\n * @param inspect\n * @returns\n */\nfunction customInspect(_depth, options, localInspect) {\n const newOptions = {\n ...options,\n depth: options.depth == null ? null : options.depth - 1,\n };\n let ret = `Osdk<${options.stylize(this[ObjectDefRef]?.apiName ?? this[InterfaceDefRef]?.apiName ?? \"\", \"special\")}> {\\n`;\n for (const k of new Set([\n \"$apiName\",\n \"$objectType\",\n \"$primaryKey\",\n ...Reflect.ownKeys(this),\n ])) {\n if (typeof k === \"symbol\")\n continue;\n ret += ` ${options.stylize(k.toString(), \"undefined\")}: ${localInspect(this[k], newOptions)}\\n`;\n }\n if (this[UnderlyingOsdkObject] !== this) {\n ret += \"\\n\";\n ret += ` ${options.stylize(\"$as\", \"special\")}: ${localInspect(this[UnderlyingOsdkObject], newOptions).replace(/\\n/g, `\\n `)}`;\n ret += \"\\n\";\n }\n ret += \"}\";\n return ret;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,eAAe,EAAEC,YAAY,EAAEC,oBAAoB,QAAS,sBAAsB;AAC3F,OAAO,MAAMC,0BAA0B,GAAGC,MAAM,CAACC,MAAM,CAAC,IAAI,EAAE;EAC1D,CAACC,MAAM,CAACC,GAAG,CAAC,4BAA4B,CAAC,GAAG;IAAEC,KAAK,EAAEC;EAAc;AACvE,CAAC,CAAC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,aAAaA,CAACC,MAAM,EAAEC,OAAO,EAAEC,YAAY,EAAE;EAClD,MAAMC,UAAU,GAAG;IACf,GAAGF,OAAO;IACVG,KAAK,EAAEH,OAAO,CAACG,KAAK,IAAI,IAAI,GAAG,IAAI,GAAGH,OAAO,CAACG,KAAK,GAAG;EAC1D,CAAC;EACD,IAAIC,GAAG,GAAG,QAAQJ,OAAO,CAACK,OAAO,CAAC,IAAI,CAACf,YAAY,CAAC,EAAEgB,OAAO,IAAI,IAAI,CAACjB,eAAe,CAAC,EAAEiB,OAAO,IAAI,EAAE,EAAE,SAAS,CAAC,OAAO;EACxH,KAAK,MAAMC,CAAC,IAAI,IAAIC,GAAG,CAAC,CACpB,UAAU,EACV,aAAa,EACb,aAAa,EACb,GAAGC,OAAO,CAACC,OAAO,CAAC,IAAI,CAAC,CAC3B,CAAC,EAAE;IACA,IAAI,OAAOH,CAAC,KAAK,QAAQ,EACrB;IACJH,GAAG,IAAI,KAAKJ,OAAO,CAACK,OAAO,CAACE,CAAC,CAACI,QAAQ,CAAC,CAAC,EAAE,WAAW,CAAC,KAAKV,YAAY,CAAC,IAAI,CAACM,CAAC,CAAC,EAAEL,UAAU,CAAC,IAAI;EACpG;EACA,IAAI,IAAI,CAACX,oBAAoB,CAAC,KAAK,IAAI,EAAE;IACrCa,GAAG,IAAI,IAAI;IACXA,GAAG,IAAI,KAAKJ,OAAO,CAACK,OAAO,CAAC,KAAK,EAAE,SAAS,CAAC,KAAKJ,YAAY,CAAC,IAAI,CAACV,oBAAoB,CAAC,EAAEW,UAAU,CAAC,CAACU,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE;IAC/HR,GAAG,IAAI,IAAI;EACf;EACAA,GAAG,IAAI,GAAG;EACV,OAAOA,GAAG;AACd","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Helper object to make sure property descriptors are declared correctly */
|
|
2
|
+
export type PropertyDescriptorRecord<X> = {
|
|
3
|
+
[K in keyof X]: PropertyDescriptor & {
|
|
4
|
+
get?: () => X[K];
|
|
5
|
+
value?: X[K];
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=PropertyDescriptorRecord.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PropertyDescriptorRecord.d.ts","sourceRoot":"","sources":["../../../../src/object/convertWireToOsdkObjects/PropertyDescriptorRecord.ts"],"names":[],"mappings":"AAgBA,6EAA6E;AAC7E,MAAM,MAAM,wBAAwB,CAAC,CAAC,IAAI;KACvC,CAAC,IAAI,MAAM,CAAC,GAAG,kBAAkB,GAAG;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE;CACxE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=PropertyDescriptorRecord.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PropertyDescriptorRecord.js","names":[],"sources":["PropertyDescriptorRecord.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 */\nexport {};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createOsdkInterface.d.ts","sourceRoot":"","sources":["../../../../src/object/convertWireToOsdkObjects/createOsdkInterface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,82 @@
|
|
|
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
|
+
import { createSimpleCache } from "../SimpleCache.js";
|
|
17
|
+
import { InterfaceDefRef, ObjectDefRef, UnderlyingOsdkObject } from "./InternalSymbols.js";
|
|
18
|
+
const handlerCache = createSimpleCache(new WeakMap(), createInterfaceProxyHandler);
|
|
19
|
+
/** @internal */
|
|
20
|
+
export function createOsdkInterface(underlying, interfaceDef) {
|
|
21
|
+
const handler = handlerCache.get(interfaceDef);
|
|
22
|
+
const proxy = new Proxy({
|
|
23
|
+
[UnderlyingOsdkObject]: underlying,
|
|
24
|
+
[InterfaceDefRef]: interfaceDef
|
|
25
|
+
},
|
|
26
|
+
// the wrapper doesn't contain everything obviously. we proxy
|
|
27
|
+
handler);
|
|
28
|
+
return proxy;
|
|
29
|
+
}
|
|
30
|
+
function createInterfaceProxyHandler(newDef) {
|
|
31
|
+
return {
|
|
32
|
+
getOwnPropertyDescriptor(target, p) {
|
|
33
|
+
const underlying = target[UnderlyingOsdkObject];
|
|
34
|
+
const objDef = underlying[ObjectDefRef];
|
|
35
|
+
switch (p) {
|
|
36
|
+
case "$primaryKey":
|
|
37
|
+
case "$title":
|
|
38
|
+
case "$objectType":
|
|
39
|
+
case "$rid":
|
|
40
|
+
return underlying[p] != null ? Reflect.getOwnPropertyDescriptor(underlying, p) : undefined;
|
|
41
|
+
case "$apiName":
|
|
42
|
+
return {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
configurable: true,
|
|
45
|
+
value: target[InterfaceDefRef].apiName
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
if (newDef.properties[p] != null) {
|
|
49
|
+
return {
|
|
50
|
+
enumerable: true,
|
|
51
|
+
configurable: true,
|
|
52
|
+
value: underlying[objDef.interfaceMap[newDef.apiName][p]]
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
ownKeys(target) {
|
|
57
|
+
const underlying = target[UnderlyingOsdkObject];
|
|
58
|
+
return ["$apiName", "$objectType", "$primaryKey", ...(underlying["$rid"] ? ["$rid"] : []), "$title", ...Object.keys(newDef.properties)];
|
|
59
|
+
},
|
|
60
|
+
get(target, p) {
|
|
61
|
+
const underlying = target[UnderlyingOsdkObject];
|
|
62
|
+
switch (p) {
|
|
63
|
+
case InterfaceDefRef:
|
|
64
|
+
return newDef;
|
|
65
|
+
case "$apiName":
|
|
66
|
+
return newDef.apiName;
|
|
67
|
+
case "$as":
|
|
68
|
+
case UnderlyingOsdkObject:
|
|
69
|
+
case "$primaryKey":
|
|
70
|
+
case "$title":
|
|
71
|
+
case "$objectType":
|
|
72
|
+
case "$rid":
|
|
73
|
+
return underlying[p];
|
|
74
|
+
}
|
|
75
|
+
if (newDef.properties[p] != null) {
|
|
76
|
+
const objDef = target[UnderlyingOsdkObject][ObjectDefRef];
|
|
77
|
+
return underlying[objDef.interfaceMap[newDef.apiName][p]];
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=createOsdkInterface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createOsdkInterface.js","names":["createSimpleCache","InterfaceDefRef","ObjectDefRef","UnderlyingOsdkObject","handlerCache","WeakMap","createInterfaceProxyHandler","createOsdkInterface","underlying","interfaceDef","handler","get","proxy","Proxy","newDef","getOwnPropertyDescriptor","target","p","objDef","Reflect","undefined","enumerable","configurable","value","apiName","properties","interfaceMap","ownKeys","Object","keys"],"sources":["createOsdkInterface.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 { createSimpleCache } from \"../SimpleCache.js\";\nimport { InterfaceDefRef, ObjectDefRef, UnderlyingOsdkObject, } from \"./InternalSymbols.js\";\nconst handlerCache = createSimpleCache(new WeakMap(), createInterfaceProxyHandler);\n/** @internal */\nexport function createOsdkInterface(underlying, interfaceDef) {\n const interfaceHolder = {\n [UnderlyingOsdkObject]: underlying,\n [InterfaceDefRef]: interfaceDef,\n };\n const handler = handlerCache.get(interfaceDef);\n const proxy = new Proxy(interfaceHolder, // the wrapper doesn't contain everything obviously. we proxy\n handler);\n return proxy;\n}\nfunction createInterfaceProxyHandler(newDef) {\n return {\n getOwnPropertyDescriptor(target, p) {\n const underlying = target[UnderlyingOsdkObject];\n const objDef = underlying[ObjectDefRef];\n switch (p) {\n case \"$primaryKey\":\n case \"$title\":\n case \"$objectType\":\n case \"$rid\":\n return underlying[p] != null\n ? Reflect.getOwnPropertyDescriptor(underlying, p)\n : undefined;\n case \"$apiName\":\n return {\n enumerable: true,\n configurable: true,\n value: target[InterfaceDefRef].apiName,\n };\n }\n if (newDef.properties[p] != null) {\n return {\n enumerable: true,\n configurable: true,\n value: underlying[objDef.interfaceMap[newDef.apiName][p]],\n };\n }\n },\n ownKeys(target) {\n const underlying = target[UnderlyingOsdkObject];\n return [\n \"$apiName\",\n \"$objectType\",\n \"$primaryKey\",\n ...(underlying[\"$rid\"] ? [\"$rid\"] : []),\n \"$title\",\n ...Object.keys(newDef.properties),\n ];\n },\n get(target, p) {\n const underlying = target[UnderlyingOsdkObject];\n switch (p) {\n case InterfaceDefRef:\n return newDef;\n case \"$apiName\":\n return newDef.apiName;\n case \"$as\":\n case UnderlyingOsdkObject:\n case \"$primaryKey\":\n case \"$title\":\n case \"$objectType\":\n case \"$rid\":\n return underlying[p];\n }\n if (newDef.properties[p] != null) {\n const objDef = target[UnderlyingOsdkObject][ObjectDefRef];\n return underlying[objDef.interfaceMap[newDef.apiName][p]];\n }\n },\n };\n}\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createOsdkObject.d.ts","sourceRoot":"","sources":["../../../../src/object/convertWireToOsdkObjects/createOsdkObject.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,114 @@
|
|
|
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
|
+
import { createAttachmentFromRid } from "../../createAttachmentFromRid.js";
|
|
17
|
+
import { TimeSeriesPropertyImpl } from "../../createTimeseriesProperty.js";
|
|
18
|
+
import { createClientCache } from "../Cache.js";
|
|
19
|
+
import { get$as } from "./getDollarAs.js";
|
|
20
|
+
import { get$link } from "./getDollarLink.js";
|
|
21
|
+
import { ClientRef, ObjectDefRef, RawObject, UnderlyingOsdkObject } from "./InternalSymbols.js";
|
|
22
|
+
const objectPrototypeCache = createClientCache(function (client, objectDef) {
|
|
23
|
+
return Object.create(null, {
|
|
24
|
+
[ObjectDefRef]: {
|
|
25
|
+
value: objectDef
|
|
26
|
+
},
|
|
27
|
+
[ClientRef]: {
|
|
28
|
+
value: client
|
|
29
|
+
},
|
|
30
|
+
"$as": {
|
|
31
|
+
value: get$as(objectDef)
|
|
32
|
+
},
|
|
33
|
+
"$link": {
|
|
34
|
+
get: function () {
|
|
35
|
+
return get$link(this);
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"$updateInternalValues": {
|
|
39
|
+
value: function (newValues) {
|
|
40
|
+
this[RawObject] = Object.assign({}, this[RawObject], newValues);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
/** @internal */
|
|
46
|
+
export function createOsdkObject(client, objectDef, rawObj) {
|
|
47
|
+
// We use multiple layers of prototypes to maximize reuse and also to keep
|
|
48
|
+
// [RawObject] out of `ownKeys`. This keeps the code in the proxy below simpler.
|
|
49
|
+
const objectHolderPrototype = Object.create(objectPrototypeCache.get(client, objectDef), {
|
|
50
|
+
[RawObject]: {
|
|
51
|
+
value: rawObj,
|
|
52
|
+
writable: true // so we can allow updates
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
// we separate the holder out so we can update
|
|
56
|
+
// the underlying data without having to return a new object
|
|
57
|
+
// we also need the holder so we can customize the console.log output
|
|
58
|
+
const holder = Object.create(objectHolderPrototype);
|
|
59
|
+
const osdkObject = new Proxy(holder, {
|
|
60
|
+
ownKeys(target) {
|
|
61
|
+
return Reflect.ownKeys(target[RawObject]);
|
|
62
|
+
},
|
|
63
|
+
get(target, p, receiver) {
|
|
64
|
+
switch (p) {
|
|
65
|
+
case UnderlyingOsdkObject:
|
|
66
|
+
// effectively point back to the proxy
|
|
67
|
+
return receiver;
|
|
68
|
+
}
|
|
69
|
+
if (p in target) return target[p];
|
|
70
|
+
if (p in rawObj) {
|
|
71
|
+
const rawValue = target[RawObject][p];
|
|
72
|
+
const propDef = objectDef.properties[p];
|
|
73
|
+
if (propDef) {
|
|
74
|
+
if (propDef.type === "attachment") {
|
|
75
|
+
if (Array.isArray(rawValue)) {
|
|
76
|
+
return rawValue.map(a => createAttachmentFromRid(client, a.rid));
|
|
77
|
+
}
|
|
78
|
+
return createAttachmentFromRid(client, rawValue.rid);
|
|
79
|
+
}
|
|
80
|
+
if (propDef.type === "numericTimeseries" || propDef.type === "stringTimeseries") {
|
|
81
|
+
return new TimeSeriesPropertyImpl(client, objectDef.apiName, target[RawObject][objectDef.primaryKeyApiName], p);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return rawValue;
|
|
85
|
+
}
|
|
86
|
+
// we do not do any fall through to avoid unexpected behavior
|
|
87
|
+
},
|
|
88
|
+
set(target, p, newValue) {
|
|
89
|
+
// allow the prototype to update this value
|
|
90
|
+
if (p === RawObject) {
|
|
91
|
+
// symbol only exists internally so no one else can hit this
|
|
92
|
+
target[p] = newValue;
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
95
|
+
return false;
|
|
96
|
+
},
|
|
97
|
+
getOwnPropertyDescriptor(target, p) {
|
|
98
|
+
if (p === RawObject) {
|
|
99
|
+
return Reflect.getOwnPropertyDescriptor(target, p);
|
|
100
|
+
}
|
|
101
|
+
if (target[RawObject][p] != null) {
|
|
102
|
+
return {
|
|
103
|
+
configurable: true,
|
|
104
|
+
enumerable: true
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
return {
|
|
108
|
+
enumerable: false
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
return osdkObject;
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=createOsdkObject.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createOsdkObject.js","names":["createAttachmentFromRid","TimeSeriesPropertyImpl","createClientCache","get$as","get$link","ClientRef","ObjectDefRef","RawObject","UnderlyingOsdkObject","objectPrototypeCache","client","objectDef","Object","create","value","get","newValues","assign","createOsdkObject","rawObj","objectHolderPrototype","writable","holder","osdkObject","Proxy","ownKeys","target","Reflect","p","receiver","rawValue","propDef","properties","type","Array","isArray","map","a","rid","apiName","primaryKeyApiName","set","newValue","getOwnPropertyDescriptor","configurable","enumerable"],"sources":["createOsdkObject.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 { createAttachmentFromRid } from \"../../createAttachmentFromRid.js\";\nimport { TimeSeriesPropertyImpl } from \"../../createTimeseriesProperty.js\";\nimport { createClientCache } from \"../Cache.js\";\nimport { get$as } from \"./getDollarAs.js\";\nimport { get$link } from \"./getDollarLink.js\";\nimport { ClientRef, ObjectDefRef, RawObject, UnderlyingOsdkObject, } from \"./InternalSymbols.js\";\nconst objectPrototypeCache = createClientCache(function (client, objectDef) {\n return Object.create(null, {\n [ObjectDefRef]: { value: objectDef },\n [ClientRef]: { value: client },\n \"$as\": { value: get$as(objectDef) },\n \"$link\": {\n get: function () {\n return get$link(this);\n },\n },\n \"$updateInternalValues\": {\n value: function (newValues) {\n this[RawObject] = Object.assign({}, this[RawObject], newValues);\n },\n },\n });\n});\n/** @internal */\nexport function createOsdkObject(client, objectDef, rawObj) {\n // We use multiple layers of prototypes to maximize reuse and also to keep\n // [RawObject] out of `ownKeys`. This keeps the code in the proxy below simpler.\n const objectHolderPrototype = Object.create(objectPrototypeCache.get(client, objectDef), {\n [RawObject]: {\n value: rawObj,\n writable: true, // so we can allow updates\n },\n });\n // we separate the holder out so we can update\n // the underlying data without having to return a new object\n // we also need the holder so we can customize the console.log output\n const holder = Object.create(objectHolderPrototype);\n const osdkObject = new Proxy(holder, {\n ownKeys(target) {\n return Reflect.ownKeys(target[RawObject]);\n },\n get(target, p, receiver) {\n switch (p) {\n case UnderlyingOsdkObject:\n // effectively point back to the proxy\n return receiver;\n }\n if (p in target)\n return target[p];\n if (p in rawObj) {\n const rawValue = target[RawObject][p];\n const propDef = objectDef.properties[p];\n if (propDef) {\n if (propDef.type === \"attachment\") {\n if (Array.isArray(rawValue)) {\n return rawValue.map(a => createAttachmentFromRid(client, a.rid));\n }\n return createAttachmentFromRid(client, rawValue.rid);\n }\n if (propDef.type === \"numericTimeseries\"\n || propDef.type === \"stringTimeseries\") {\n return new TimeSeriesPropertyImpl(client, objectDef.apiName, target[RawObject][objectDef.primaryKeyApiName], p);\n }\n }\n return rawValue;\n }\n // we do not do any fall through to avoid unexpected behavior\n },\n set(target, p, newValue) {\n // allow the prototype to update this value\n if (p === RawObject) {\n // symbol only exists internally so no one else can hit this\n target[p] = newValue;\n return true;\n }\n return false;\n },\n getOwnPropertyDescriptor(target, p) {\n if (p === RawObject) {\n return Reflect.getOwnPropertyDescriptor(target, p);\n }\n if (target[RawObject][p] != null) {\n return { configurable: true, enumerable: true };\n }\n return { enumerable: false };\n },\n });\n return osdkObject;\n}\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getDollarAs.d.ts","sourceRoot":"","sources":["../../../../src/object/convertWireToOsdkObjects/getDollarAs.ts"],"names":[],"mappings":"AAiBA,OAAO,EACL,KAAK,2BAA2B,EAEjC,MAAM,oCAAoC,CAAC;AAgB5C,eAAO,MAAM,MAAM,kDAGa,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { InterfaceDefinitions } from "../../ontology/OntologyProvider.js";
|
|
17
|
+
import { createSimpleCache } from "../SimpleCache.js";
|
|
18
|
+
import { createOsdkInterface } from "./createOsdkInterface.js";
|
|
19
|
+
import { UnderlyingOsdkObject } from "./InternalSymbols.js";
|
|
20
|
+
export const get$as = createSimpleCache(new WeakMap(), $asFactory).get;
|
|
21
|
+
const osdkObjectToInterfaceView = createSimpleCache(new WeakMap(), () => new Map());
|
|
22
|
+
function $asFactory(objDef) {
|
|
23
|
+
// We use the exact same logic for both the interface rep and the underlying rep
|
|
24
|
+
return function (targetMinDef) {
|
|
25
|
+
let targetInterfaceApiName;
|
|
26
|
+
if (typeof targetMinDef === "string") {
|
|
27
|
+
if (targetMinDef === objDef.apiName) {
|
|
28
|
+
return this[UnderlyingOsdkObject];
|
|
29
|
+
}
|
|
30
|
+
// this is sufficient to determine if we implement the interface
|
|
31
|
+
if (objDef.interfaceMap?.[targetMinDef] == null) {
|
|
32
|
+
throw new Error(`Object does not implement interface '${targetMinDef}'.`);
|
|
33
|
+
}
|
|
34
|
+
targetInterfaceApiName = targetMinDef;
|
|
35
|
+
} else if (targetMinDef.apiName === objDef.apiName) {
|
|
36
|
+
return this[UnderlyingOsdkObject];
|
|
37
|
+
} else {
|
|
38
|
+
if (targetMinDef.type === "object") {
|
|
39
|
+
throw new Error(`'${targetMinDef.apiName}' is not an interface nor is it '${objDef.apiName}', which is the object type.`);
|
|
40
|
+
}
|
|
41
|
+
targetInterfaceApiName = targetMinDef.apiName;
|
|
42
|
+
}
|
|
43
|
+
const def = objDef[InterfaceDefinitions][targetInterfaceApiName];
|
|
44
|
+
if (!def) {
|
|
45
|
+
throw new Error(`Object does not implement interface '${targetMinDef}'.`);
|
|
46
|
+
}
|
|
47
|
+
const underlying = this[UnderlyingOsdkObject];
|
|
48
|
+
const existing = osdkObjectToInterfaceView.get(underlying).get(targetInterfaceApiName);
|
|
49
|
+
if (existing) return existing;
|
|
50
|
+
const osdkInterface = createOsdkInterface(underlying, def.def);
|
|
51
|
+
osdkObjectToInterfaceView.get(underlying).set(targetInterfaceApiName, osdkInterface);
|
|
52
|
+
return osdkInterface;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=getDollarAs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getDollarAs.js","names":["InterfaceDefinitions","createSimpleCache","createOsdkInterface","UnderlyingOsdkObject","get$as","WeakMap","$asFactory","get","osdkObjectToInterfaceView","Map","objDef","targetMinDef","targetInterfaceApiName","apiName","interfaceMap","Error","type","def","underlying","existing","osdkInterface","set"],"sources":["getDollarAs.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 { InterfaceDefinitions, } from \"../../ontology/OntologyProvider.js\";\nimport { createSimpleCache } from \"../SimpleCache.js\";\nimport { createOsdkInterface } from \"./createOsdkInterface.js\";\nimport { UnderlyingOsdkObject } from \"./InternalSymbols.js\";\nexport const get$as = createSimpleCache(new WeakMap(), $asFactory).get;\nconst osdkObjectToInterfaceView = createSimpleCache(new WeakMap(), () => new Map());\nfunction $asFactory(objDef) {\n // We use the exact same logic for both the interface rep and the underlying rep\n return function $as(targetMinDef) {\n let targetInterfaceApiName;\n if (typeof targetMinDef === \"string\") {\n if (targetMinDef === objDef.apiName) {\n return this[UnderlyingOsdkObject];\n }\n // this is sufficient to determine if we implement the interface\n if (objDef.interfaceMap?.[targetMinDef] == null) {\n throw new Error(`Object does not implement interface '${targetMinDef}'.`);\n }\n targetInterfaceApiName = targetMinDef;\n }\n else if (targetMinDef.apiName === objDef.apiName) {\n return this[UnderlyingOsdkObject];\n }\n else {\n if (targetMinDef.type === \"object\") {\n throw new Error(`'${targetMinDef.apiName}' is not an interface nor is it '${objDef.apiName}', which is the object type.`);\n }\n targetInterfaceApiName = targetMinDef.apiName;\n }\n const def = objDef[InterfaceDefinitions][targetInterfaceApiName];\n if (!def) {\n throw new Error(`Object does not implement interface '${targetMinDef}'.`);\n }\n const underlying = this[UnderlyingOsdkObject];\n const existing = osdkObjectToInterfaceView\n .get(underlying)\n .get(targetInterfaceApiName);\n if (existing)\n return existing;\n const osdkInterface = createOsdkInterface(underlying, def.def);\n osdkObjectToInterfaceView.get(underlying).set(targetInterfaceApiName, osdkInterface);\n return osdkInterface;\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,oBAAoB,QAAS,oCAAoC;AAC1E,SAASC,iBAAiB,QAAQ,mBAAmB;AACrD,SAASC,mBAAmB,QAAQ,0BAA0B;AAC9D,SAASC,oBAAoB,QAAQ,sBAAsB;AAC3D,OAAO,MAAMC,MAAM,GAAGH,iBAAiB,CAAC,IAAII,OAAO,CAAC,CAAC,EAAEC,UAAU,CAAC,CAACC,GAAG;AACtE,MAAMC,yBAAyB,GAAGP,iBAAiB,CAAC,IAAII,OAAO,CAAC,CAAC,EAAE,MAAM,IAAII,GAAG,CAAC,CAAC,CAAC;AACnF,SAASH,UAAUA,CAACI,MAAM,EAAE;EACxB;EACA,OAAO,UAAaC,YAAY,EAAE;IAC9B,IAAIC,sBAAsB;IAC1B,IAAI,OAAOD,YAAY,KAAK,QAAQ,EAAE;MAClC,IAAIA,YAAY,KAAKD,MAAM,CAACG,OAAO,EAAE;QACjC,OAAO,IAAI,CAACV,oBAAoB,CAAC;MACrC;MACA;MACA,IAAIO,MAAM,CAACI,YAAY,GAAGH,YAAY,CAAC,IAAI,IAAI,EAAE;QAC7C,MAAM,IAAII,KAAK,CAAC,wCAAwCJ,YAAY,IAAI,CAAC;MAC7E;MACAC,sBAAsB,GAAGD,YAAY;IACzC,CAAC,MACI,IAAIA,YAAY,CAACE,OAAO,KAAKH,MAAM,CAACG,OAAO,EAAE;MAC9C,OAAO,IAAI,CAACV,oBAAoB,CAAC;IACrC,CAAC,MACI;MACD,IAAIQ,YAAY,CAACK,IAAI,KAAK,QAAQ,EAAE;QAChC,MAAM,IAAID,KAAK,CAAC,IAAIJ,YAAY,CAACE,OAAO,oCAAoCH,MAAM,CAACG,OAAO,8BAA8B,CAAC;MAC7H;MACAD,sBAAsB,GAAGD,YAAY,CAACE,OAAO;IACjD;IACA,MAAMI,GAAG,GAAGP,MAAM,CAACV,oBAAoB,CAAC,CAACY,sBAAsB,CAAC;IAChE,IAAI,CAACK,GAAG,EAAE;MACN,MAAM,IAAIF,KAAK,CAAC,wCAAwCJ,YAAY,IAAI,CAAC;IAC7E;IACA,MAAMO,UAAU,GAAG,IAAI,CAACf,oBAAoB,CAAC;IAC7C,MAAMgB,QAAQ,GAAGX,yBAAyB,CACrCD,GAAG,CAACW,UAAU,CAAC,CACfX,GAAG,CAACK,sBAAsB,CAAC;IAChC,IAAIO,QAAQ,EACR,OAAOA,QAAQ;IACnB,MAAMC,aAAa,GAAGlB,mBAAmB,CAACgB,UAAU,EAAED,GAAG,CAACA,GAAG,CAAC;IAC9DT,yBAAyB,CAACD,GAAG,CAACW,UAAU,CAAC,CAACG,GAAG,CAACT,sBAAsB,EAAEQ,aAAa,CAAC;IACpF,OAAOA,aAAa;EACxB,CAAC;AACL","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getDollarLink.d.ts","sourceRoot":"","sources":["../../../../src/object/convertWireToOsdkObjects/getDollarLink.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,60 @@
|
|
|
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
|
+
import { getWireObjectSet } from "../../objectSet/createObjectSet.js";
|
|
17
|
+
import { fetchSingle, fetchSingleWithErrors } from "../fetchSingle.js";
|
|
18
|
+
import { ClientRef, ObjectDefRef, RawObject } from "./InternalSymbols.js";
|
|
19
|
+
/** @internal */
|
|
20
|
+
export function get$link(holder) {
|
|
21
|
+
return new Proxy(holder, DollarLinkProxyHandler);
|
|
22
|
+
}
|
|
23
|
+
const DollarLinkProxyHandler = {
|
|
24
|
+
get(target, p) {
|
|
25
|
+
const {
|
|
26
|
+
[ObjectDefRef]: objDef,
|
|
27
|
+
[ClientRef]: client,
|
|
28
|
+
[RawObject]: rawObj
|
|
29
|
+
} = target;
|
|
30
|
+
const linkDef = objDef.links[p];
|
|
31
|
+
if (linkDef == null) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const objectSet = client.objectSetFactory(objDef, client).where({
|
|
35
|
+
[objDef.primaryKeyApiName]: rawObj.$primaryKey
|
|
36
|
+
}).pivotTo(p);
|
|
37
|
+
if (!linkDef.multiplicity) {
|
|
38
|
+
return {
|
|
39
|
+
fetchOne: options => fetchSingle(client, objDef, options ?? {}, getWireObjectSet(objectSet)),
|
|
40
|
+
fetchOneWithErrors: options => fetchSingleWithErrors(client, objDef, options ?? {}, getWireObjectSet(objectSet))
|
|
41
|
+
};
|
|
42
|
+
} else {
|
|
43
|
+
return objectSet;
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
ownKeys(target) {
|
|
47
|
+
return [...Object.keys(target[ObjectDefRef].links)];
|
|
48
|
+
},
|
|
49
|
+
getOwnPropertyDescriptor(target, p) {
|
|
50
|
+
if (target[ObjectDefRef].links[p]) {
|
|
51
|
+
return {
|
|
52
|
+
enumerable: true,
|
|
53
|
+
configurable: true,
|
|
54
|
+
// fixme
|
|
55
|
+
writable: false
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=getDollarLink.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getDollarLink.js","names":["getWireObjectSet","fetchSingle","fetchSingleWithErrors","ClientRef","ObjectDefRef","RawObject","get$link","holder","Proxy","DollarLinkProxyHandler","get","target","p","objDef","client","rawObj","linkDef","links","objectSet","objectSetFactory","where","primaryKeyApiName","$primaryKey","pivotTo","multiplicity","fetchOne","options","fetchOneWithErrors","ownKeys","Object","keys","getOwnPropertyDescriptor","enumerable","configurable","writable"],"sources":["getDollarLink.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 { getWireObjectSet } from \"../../objectSet/createObjectSet.js\";\nimport { fetchSingle, fetchSingleWithErrors } from \"../fetchSingle.js\";\nimport { ClientRef, ObjectDefRef, RawObject } from \"./InternalSymbols.js\";\n/** @internal */\nexport function get$link(holder) {\n return new Proxy(holder, DollarLinkProxyHandler);\n}\nconst DollarLinkProxyHandler = {\n get(target, p) {\n const { [ObjectDefRef]: objDef, [ClientRef]: client, [RawObject]: rawObj, } = target;\n const linkDef = objDef.links[p];\n if (linkDef == null) {\n return;\n }\n const objectSet = client.objectSetFactory(objDef, client)\n .where({\n [objDef.primaryKeyApiName]: rawObj.$primaryKey,\n })\n .pivotTo(p);\n if (!linkDef.multiplicity) {\n return {\n fetchOne: (options) => fetchSingle(client, objDef, options ?? {}, getWireObjectSet(objectSet)),\n fetchOneWithErrors: (options) => fetchSingleWithErrors(client, objDef, options ?? {}, getWireObjectSet(objectSet)),\n };\n }\n else {\n return objectSet;\n }\n },\n ownKeys(target) {\n return [...Object.keys(target[ObjectDefRef].links)];\n },\n getOwnPropertyDescriptor(target, p) {\n if (target[ObjectDefRef].links[p]) {\n return {\n enumerable: true,\n configurable: true, // fixme\n writable: false,\n };\n }\n },\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,gBAAgB,QAAQ,oCAAoC;AACrE,SAASC,WAAW,EAAEC,qBAAqB,QAAQ,mBAAmB;AACtE,SAASC,SAAS,EAAEC,YAAY,EAAEC,SAAS,QAAQ,sBAAsB;AACzE;AACA,OAAO,SAASC,QAAQA,CAACC,MAAM,EAAE;EAC7B,OAAO,IAAIC,KAAK,CAACD,MAAM,EAAEE,sBAAsB,CAAC;AACpD;AACA,MAAMA,sBAAsB,GAAG;EAC3BC,GAAGA,CAACC,MAAM,EAAEC,CAAC,EAAE;IACX,MAAM;MAAE,CAACR,YAAY,GAAGS,MAAM;MAAE,CAACV,SAAS,GAAGW,MAAM;MAAE,CAACT,SAAS,GAAGU;IAAQ,CAAC,GAAGJ,MAAM;IACpF,MAAMK,OAAO,GAAGH,MAAM,CAACI,KAAK,CAACL,CAAC,CAAC;IAC/B,IAAII,OAAO,IAAI,IAAI,EAAE;MACjB;IACJ;IACA,MAAME,SAAS,GAAGJ,MAAM,CAACK,gBAAgB,CAACN,MAAM,EAAEC,MAAM,CAAC,CACpDM,KAAK,CAAC;MACP,CAACP,MAAM,CAACQ,iBAAiB,GAAGN,MAAM,CAACO;IACvC,CAAC,CAAC,CACGC,OAAO,CAACX,CAAC,CAAC;IACf,IAAI,CAACI,OAAO,CAACQ,YAAY,EAAE;MACvB,OAAO;QACHC,QAAQ,EAAGC,OAAO,IAAKzB,WAAW,CAACa,MAAM,EAAED,MAAM,EAAEa,OAAO,IAAI,CAAC,CAAC,EAAE1B,gBAAgB,CAACkB,SAAS,CAAC,CAAC;QAC9FS,kBAAkB,EAAGD,OAAO,IAAKxB,qBAAqB,CAACY,MAAM,EAAED,MAAM,EAAEa,OAAO,IAAI,CAAC,CAAC,EAAE1B,gBAAgB,CAACkB,SAAS,CAAC;MACrH,CAAC;IACL,CAAC,MACI;MACD,OAAOA,SAAS;IACpB;EACJ,CAAC;EACDU,OAAOA,CAACjB,MAAM,EAAE;IACZ,OAAO,CAAC,GAAGkB,MAAM,CAACC,IAAI,CAACnB,MAAM,CAACP,YAAY,CAAC,CAACa,KAAK,CAAC,CAAC;EACvD,CAAC;EACDc,wBAAwBA,CAACpB,MAAM,EAAEC,CAAC,EAAE;IAChC,IAAID,MAAM,CAACP,YAAY,CAAC,CAACa,KAAK,CAACL,CAAC,CAAC,EAAE;MAC/B,OAAO;QACHoB,UAAU,EAAE,IAAI;QAChBC,YAAY,EAAE,IAAI;QAAE;QACpBC,QAAQ,EAAE;MACd,CAAC;IACL;EACJ;AACJ,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertWireToOsdkObjects.d.ts","sourceRoot":"","sources":["../../../src/object/convertWireToOsdkObjects.ts"],"names":[],"mappings":""}
|