@osdk/client 2.2.0-beta.8 → 2.3.0-beta.1
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 +388 -0
- package/build/browser/MinimalClientContext.js.map +1 -1
- package/build/browser/__unstable/ConjureSupport.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 +134 -89
- package/build/browser/actions/actions.test.js.map +1 -1
- package/build/browser/actions/applyAction.js.map +1 -1
- package/build/browser/createClient.js +5 -1
- package/build/browser/createClient.js.map +1 -1
- package/build/browser/createClient.test.js +14 -6
- package/build/browser/createClient.test.js.map +1 -1
- package/build/browser/createMinimalClient.js +2 -2
- package/build/browser/createMinimalClient.js.map +1 -1
- package/build/browser/createMinimalClientHelper.js +25 -0
- package/build/browser/createMinimalClientHelper.js.map +1 -0
- package/build/browser/derivedProperties/createWithPropertiesObjectSet.js +36 -13
- package/build/browser/derivedProperties/createWithPropertiesObjectSet.js.map +1 -1
- package/build/browser/derivedProperties/createWithPropertiesObjectSet.test.js +133 -0
- package/build/browser/derivedProperties/createWithPropertiesObjectSet.test.js.map +1 -1
- package/build/browser/derivedProperties/derivedPropertyDefinitionFactory.js +93 -0
- package/build/browser/derivedProperties/derivedPropertyDefinitionFactory.js.map +1 -0
- package/build/browser/fetchMetadata.js +1 -1
- package/build/browser/fetchMetadata.js.map +1 -1
- package/build/browser/fetchMetadata.test.js +11 -9
- package/build/browser/fetchMetadata.test.js.map +1 -1
- package/build/browser/index.js +0 -1
- package/build/browser/index.js.map +1 -1
- package/build/{esm/util/isOsdkBaseObject.js → browser/intellisense.test.helpers/showsObjectPropertyJsdoc.js} +9 -4
- package/build/browser/intellisense.test.helpers/showsObjectPropertyJsdoc.js.map +1 -0
- package/build/browser/intellisense.test.js +17 -1
- package/build/browser/intellisense.test.js.map +1 -1
- package/build/browser/logger/BaseLogger.js +59 -0
- package/build/browser/logger/BaseLogger.js.map +1 -0
- package/build/browser/logger/BrowserLogger.js +67 -0
- package/build/browser/logger/BrowserLogger.js.map +1 -0
- package/build/browser/logger/MinimalLogger.js +39 -0
- package/build/browser/logger/MinimalLogger.js.map +1 -0
- package/build/browser/logger/MinimalLogger.test.js +60 -0
- package/build/browser/logger/MinimalLogger.test.js.map +1 -0
- package/build/browser/logger/TestLogger.js +56 -0
- package/build/browser/logger/TestLogger.js.map +1 -0
- package/build/browser/object/SimpleOsdkProperties.js +2 -0
- package/build/browser/object/SimpleOsdkProperties.js.map +1 -0
- package/build/browser/object/attachment.test.js +20 -7
- package/build/browser/object/attachment.test.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/BaseHolder.js +2 -0
- package/build/browser/object/convertWireToOsdkObjects/BaseHolder.js.map +1 -0
- package/build/browser/object/convertWireToOsdkObjects/InterfaceHolder.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/ObjectHolder.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.js +4 -0
- package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.js +53 -35
- package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/getDollarAs.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/getDollarLink.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects.js +7 -15
- package/build/browser/object/convertWireToOsdkObjects.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects.test.js +39 -33
- package/build/browser/object/convertWireToOsdkObjects.test.js.map +1 -1
- package/build/browser/object/fetchPage.js +17 -4
- package/build/browser/object/fetchPage.js.map +1 -1
- package/build/browser/object/fetchPage.test.js +56 -2
- package/build/browser/object/fetchPage.test.js.map +1 -1
- package/build/browser/object/geotimeseriesreference.test.js +56 -134
- package/build/browser/object/geotimeseriesreference.test.js.map +1 -1
- package/build/browser/object/media.test.js +19 -14
- package/build/browser/object/media.test.js.map +1 -1
- package/build/browser/object/object.test.js +96 -89
- package/build/browser/object/object.test.js.map +1 -1
- package/build/browser/object/timeseries.test.js +119 -85
- package/build/browser/object/timeseries.test.js.map +1 -1
- package/build/browser/objectSet/InterfaceObjectSet.test.js +37 -17
- package/build/browser/objectSet/InterfaceObjectSet.test.js.map +1 -1
- package/build/browser/objectSet/ObjectSet.test.js +200 -116
- package/build/browser/objectSet/ObjectSet.test.js.map +1 -1
- package/build/browser/objectSet/ObjectSetListenerWebsocket.js +20 -16
- package/build/browser/objectSet/ObjectSetListenerWebsocket.js.map +1 -1
- package/build/browser/objectSet/ObjectSetListenerWebsocket.test.js +19 -12
- package/build/browser/objectSet/ObjectSetListenerWebsocket.test.js.map +1 -1
- package/build/browser/objectSet/createObjectSet.js +2 -1
- package/build/browser/objectSet/createObjectSet.js.map +1 -1
- package/build/browser/observable/ListPayload.js.map +1 -1
- package/build/browser/observable/ObjectPayload.js.map +1 -1
- package/build/browser/observable/ObservableClient.js.map +1 -1
- package/build/browser/observable/internal/ActionApplication.js +32 -32
- package/build/browser/observable/internal/ActionApplication.js.map +1 -1
- package/build/browser/observable/internal/BulkObjectLoader.js +93 -0
- package/build/browser/observable/internal/BulkObjectLoader.js.map +1 -0
- package/build/browser/observable/internal/BulkObjectLoader.test.js +112 -0
- package/build/browser/observable/internal/BulkObjectLoader.test.js.map +1 -0
- package/build/browser/observable/internal/CacheKey.js +1 -1
- package/build/browser/observable/internal/CacheKey.js.map +1 -1
- package/build/browser/observable/internal/CacheKeys.js +2 -2
- package/build/browser/observable/internal/CacheKeys.js.map +1 -1
- package/build/browser/observable/internal/{ChangedObjects.js → Changes.js} +20 -9
- package/build/browser/observable/internal/Changes.js.map +1 -0
- package/build/browser/observable/internal/Layer.js +3 -0
- package/build/browser/observable/internal/Layer.js.map +1 -1
- package/build/browser/observable/internal/ListQuery.js +414 -170
- package/build/browser/observable/internal/ListQuery.js.map +1 -1
- package/build/browser/observable/internal/ObjectQuery.js +34 -21
- package/build/browser/observable/internal/ObjectQuery.js.map +1 -1
- package/build/browser/observable/internal/ObservableClientImpl.js +4 -12
- package/build/browser/observable/internal/ObservableClientImpl.js.map +1 -1
- package/build/browser/observable/internal/OptimisticJob.js +1 -1
- package/build/browser/observable/internal/OptimisticJob.js.map +1 -1
- package/build/browser/observable/internal/OrderByCanonicalizer.js +73 -0
- package/build/browser/observable/internal/OrderByCanonicalizer.js.map +1 -0
- package/build/browser/observable/internal/OrderByCanonicalizer.test.js +78 -0
- package/build/browser/observable/internal/OrderByCanonicalizer.test.js.map +1 -0
- package/build/browser/observable/internal/Query.js +64 -31
- package/build/browser/observable/internal/Query.js.map +1 -1
- package/build/browser/observable/internal/RefCounts.js +7 -2
- package/build/browser/observable/internal/RefCounts.js.map +1 -1
- package/build/browser/observable/internal/SimpleWhereClause.js +2 -0
- package/build/browser/observable/internal/SimpleWhereClause.js.map +1 -0
- package/build/browser/observable/internal/Store.js +86 -269
- package/build/browser/observable/internal/Store.js.map +1 -1
- package/build/browser/observable/internal/Store.test.js +401 -375
- package/build/browser/observable/internal/Store.test.js.map +1 -1
- package/build/browser/observable/internal/WhereClauseCanonicalizer.js +11 -3
- package/build/browser/observable/internal/WhereClauseCanonicalizer.js.map +1 -1
- package/build/browser/observable/internal/objectMatchesWhereClause.js +0 -2
- package/build/browser/observable/internal/objectMatchesWhereClause.js.map +1 -1
- package/build/browser/observable/internal/objectMatchesWhereClause.test.js.map +1 -1
- package/build/browser/observable/internal/testUtils.js +85 -20
- package/build/browser/observable/internal/testUtils.js.map +1 -1
- package/build/browser/ontology/OntologyProvider.js.map +1 -1
- package/build/browser/ontology/StandardOntologyProvider.js +12 -5
- package/build/browser/ontology/StandardOntologyProvider.js.map +1 -1
- package/build/browser/ontology/StandardOntologyProvider.test.js +17 -16
- package/build/browser/ontology/StandardOntologyProvider.test.js.map +1 -1
- package/build/browser/ontology/loadFullObjectMetadata.js +0 -1
- package/build/browser/ontology/loadFullObjectMetadata.js.map +1 -1
- package/build/browser/ontology/loadQueryMetadata.js +5 -2
- package/build/browser/ontology/loadQueryMetadata.js.map +1 -1
- package/build/browser/public/internal.js +2 -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/osdkConfig.js +49 -0
- package/build/browser/public-utils/osdkConfig.js.map +1 -0
- package/build/browser/{object/createObjectSpecifierFromPrimaryKey.js → public-utils/vite-env.d.ts} +2 -3
- package/build/browser/queries/applyQuery.js +6 -4
- package/build/browser/queries/applyQuery.js.map +1 -1
- package/build/browser/queries/queries.test.js +93 -27
- package/build/browser/queries/queries.test.js.map +1 -1
- package/build/browser/queries/types.js.map +1 -1
- package/build/browser/tsserver.js.map +1 -1
- package/build/browser/util/UserAgent.js +1 -1
- package/build/browser/util/extractRdpDefinition.js +140 -0
- package/build/browser/util/extractRdpDefinition.js.map +1 -0
- package/build/browser/util/extractRdpDefinition.test.js +233 -0
- package/build/browser/util/extractRdpDefinition.test.js.map +1 -0
- package/build/browser/util/{isOsdkBaseObject.js → isObjectSpecifiersObject.js} +2 -2
- package/build/browser/util/isObjectSpecifiersObject.js.map +1 -0
- package/build/browser/util/isPoint.js +20 -0
- package/build/browser/util/isPoint.js.map +1 -0
- package/build/browser/util/objectSpecifierUtils.js +48 -0
- package/build/browser/util/objectSpecifierUtils.js.map +1 -0
- package/build/browser/util/objectSpecifierUtils.test.js +42 -0
- package/build/browser/util/objectSpecifierUtils.test.js.map +1 -0
- package/build/browser/util/toDataValue.js +6 -2
- package/build/browser/util/toDataValue.js.map +1 -1
- package/build/browser/util/toDataValue.test.js +37 -16
- package/build/browser/util/toDataValue.test.js.map +1 -1
- package/build/browser/util/toDataValueQueries.js +4 -6
- package/build/browser/util/toDataValueQueries.js.map +1 -1
- package/build/cjs/{Client-DBTcM9gB.d.cts → Client-CgL2LKN9.d.cts} +6 -7
- package/build/cjs/{chunk-IU47QMYO.cjs → chunk-FKI2LO2O.cjs} +250 -82
- package/build/cjs/chunk-FKI2LO2O.cjs.map +1 -0
- package/build/cjs/chunk-T4NIFYZS.cjs +14 -0
- package/build/cjs/chunk-T4NIFYZS.cjs.map +1 -0
- package/build/cjs/{chunk-JPENHIJB.cjs → chunk-W5PFESFR.cjs} +174 -35
- package/build/cjs/chunk-W5PFESFR.cjs.map +1 -0
- package/build/cjs/index.cjs +212 -193
- package/build/cjs/index.cjs.map +1 -1
- package/build/cjs/index.d.cts +4 -24
- package/build/cjs/public/internal.cjs +61 -7
- package/build/cjs/public/internal.cjs.map +1 -1
- package/build/cjs/public/internal.d.cts +50 -3
- package/build/cjs/public/unstable-do-not-use.cjs +885 -620
- package/build/cjs/public/unstable-do-not-use.cjs.map +1 -1
- package/build/cjs/public/unstable-do-not-use.d.cts +35 -25
- package/build/esm/MinimalClientContext.js.map +1 -1
- package/build/esm/__unstable/ConjureSupport.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 +134 -89
- package/build/esm/actions/actions.test.js.map +1 -1
- package/build/esm/actions/applyAction.js.map +1 -1
- package/build/esm/createClient.js +5 -1
- package/build/esm/createClient.js.map +1 -1
- package/build/esm/createClient.test.js +14 -6
- package/build/esm/createClient.test.js.map +1 -1
- package/build/esm/createMinimalClient.js +2 -2
- package/build/esm/createMinimalClient.js.map +1 -1
- package/build/esm/createMinimalClientHelper.js +25 -0
- package/build/esm/createMinimalClientHelper.js.map +1 -0
- package/build/esm/derivedProperties/createWithPropertiesObjectSet.js +36 -13
- package/build/esm/derivedProperties/createWithPropertiesObjectSet.js.map +1 -1
- package/build/esm/derivedProperties/createWithPropertiesObjectSet.test.js +133 -0
- package/build/esm/derivedProperties/createWithPropertiesObjectSet.test.js.map +1 -1
- package/build/esm/derivedProperties/derivedPropertyDefinitionFactory.js +93 -0
- package/build/esm/derivedProperties/derivedPropertyDefinitionFactory.js.map +1 -0
- package/build/esm/fetchMetadata.js +1 -1
- package/build/esm/fetchMetadata.js.map +1 -1
- package/build/esm/fetchMetadata.test.js +11 -9
- package/build/esm/fetchMetadata.test.js.map +1 -1
- package/build/esm/index.js +0 -1
- package/build/esm/index.js.map +1 -1
- package/build/esm/{util/isOsdkObject.js → intellisense.test.helpers/showsObjectPropertyJsdoc.js} +9 -4
- package/build/esm/intellisense.test.helpers/showsObjectPropertyJsdoc.js.map +1 -0
- package/build/esm/intellisense.test.js +17 -1
- package/build/esm/intellisense.test.js.map +1 -1
- package/build/esm/logger/BaseLogger.js +59 -0
- package/build/esm/logger/BaseLogger.js.map +1 -0
- package/build/esm/logger/BrowserLogger.js +67 -0
- package/build/esm/logger/BrowserLogger.js.map +1 -0
- package/build/esm/logger/MinimalLogger.js +39 -0
- package/build/esm/logger/MinimalLogger.js.map +1 -0
- package/build/esm/logger/MinimalLogger.test.js +60 -0
- package/build/esm/logger/MinimalLogger.test.js.map +1 -0
- package/build/esm/logger/TestLogger.js +56 -0
- package/build/esm/logger/TestLogger.js.map +1 -0
- package/build/esm/object/SimpleOsdkProperties.js +2 -0
- package/build/esm/object/SimpleOsdkProperties.js.map +1 -0
- package/build/esm/object/attachment.test.js +20 -7
- package/build/esm/object/attachment.test.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/BaseHolder.js +2 -0
- package/build/esm/object/convertWireToOsdkObjects/BaseHolder.js.map +1 -0
- package/build/esm/object/convertWireToOsdkObjects/InterfaceHolder.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/ObjectHolder.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.js +4 -0
- package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/createOsdkObject.js +53 -35
- package/build/esm/object/convertWireToOsdkObjects/createOsdkObject.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/getDollarAs.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/getDollarLink.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects.js +7 -15
- package/build/esm/object/convertWireToOsdkObjects.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects.test.js +39 -33
- package/build/esm/object/convertWireToOsdkObjects.test.js.map +1 -1
- package/build/esm/object/fetchPage.js +17 -4
- package/build/esm/object/fetchPage.js.map +1 -1
- package/build/esm/object/fetchPage.test.js +56 -2
- package/build/esm/object/fetchPage.test.js.map +1 -1
- package/build/esm/object/geotimeseriesreference.test.js +56 -134
- package/build/esm/object/geotimeseriesreference.test.js.map +1 -1
- package/build/esm/object/media.test.js +19 -14
- package/build/esm/object/media.test.js.map +1 -1
- package/build/esm/object/object.test.js +96 -89
- package/build/esm/object/object.test.js.map +1 -1
- package/build/esm/object/timeseries.test.js +119 -85
- package/build/esm/object/timeseries.test.js.map +1 -1
- package/build/esm/objectSet/InterfaceObjectSet.test.js +37 -17
- package/build/esm/objectSet/InterfaceObjectSet.test.js.map +1 -1
- package/build/esm/objectSet/ObjectSet.test.js +200 -116
- package/build/esm/objectSet/ObjectSet.test.js.map +1 -1
- package/build/esm/objectSet/ObjectSetListenerWebsocket.js +20 -16
- package/build/esm/objectSet/ObjectSetListenerWebsocket.js.map +1 -1
- package/build/esm/objectSet/ObjectSetListenerWebsocket.test.js +19 -12
- package/build/esm/objectSet/ObjectSetListenerWebsocket.test.js.map +1 -1
- package/build/esm/objectSet/createObjectSet.js +2 -1
- package/build/esm/objectSet/createObjectSet.js.map +1 -1
- package/build/esm/observable/ListPayload.js.map +1 -1
- package/build/esm/observable/ObjectPayload.js.map +1 -1
- package/build/esm/observable/ObservableClient.js.map +1 -1
- package/build/esm/observable/internal/ActionApplication.js +32 -32
- package/build/esm/observable/internal/ActionApplication.js.map +1 -1
- package/build/esm/observable/internal/BulkObjectLoader.js +93 -0
- package/build/esm/observable/internal/BulkObjectLoader.js.map +1 -0
- package/build/esm/observable/internal/BulkObjectLoader.test.js +112 -0
- package/build/esm/observable/internal/BulkObjectLoader.test.js.map +1 -0
- package/build/esm/observable/internal/CacheKey.js +1 -1
- package/build/esm/observable/internal/CacheKey.js.map +1 -1
- package/build/esm/observable/internal/CacheKeys.js +2 -2
- package/build/esm/observable/internal/CacheKeys.js.map +1 -1
- package/build/esm/observable/internal/{ChangedObjects.js → Changes.js} +20 -9
- package/build/esm/observable/internal/Changes.js.map +1 -0
- package/build/esm/observable/internal/Layer.js +3 -0
- package/build/esm/observable/internal/Layer.js.map +1 -1
- package/build/esm/observable/internal/ListQuery.js +414 -170
- package/build/esm/observable/internal/ListQuery.js.map +1 -1
- package/build/esm/observable/internal/ObjectQuery.js +34 -21
- package/build/esm/observable/internal/ObjectQuery.js.map +1 -1
- package/build/esm/observable/internal/ObservableClientImpl.js +4 -12
- package/build/esm/observable/internal/ObservableClientImpl.js.map +1 -1
- package/build/esm/observable/internal/OptimisticJob.js +1 -1
- package/build/esm/observable/internal/OptimisticJob.js.map +1 -1
- package/build/esm/observable/internal/OrderByCanonicalizer.js +73 -0
- package/build/esm/observable/internal/OrderByCanonicalizer.js.map +1 -0
- package/build/esm/observable/internal/OrderByCanonicalizer.test.js +78 -0
- package/build/esm/observable/internal/OrderByCanonicalizer.test.js.map +1 -0
- package/build/esm/observable/internal/Query.js +64 -31
- package/build/esm/observable/internal/Query.js.map +1 -1
- package/build/esm/observable/internal/RefCounts.js +7 -2
- package/build/esm/observable/internal/RefCounts.js.map +1 -1
- package/build/esm/observable/internal/SimpleWhereClause.js +2 -0
- package/build/esm/observable/internal/SimpleWhereClause.js.map +1 -0
- package/build/esm/observable/internal/Store.js +86 -269
- package/build/esm/observable/internal/Store.js.map +1 -1
- package/build/esm/observable/internal/Store.test.js +401 -375
- package/build/esm/observable/internal/Store.test.js.map +1 -1
- package/build/esm/observable/internal/WhereClauseCanonicalizer.js +11 -3
- package/build/esm/observable/internal/WhereClauseCanonicalizer.js.map +1 -1
- package/build/esm/observable/internal/objectMatchesWhereClause.js +0 -2
- package/build/esm/observable/internal/objectMatchesWhereClause.js.map +1 -1
- package/build/esm/observable/internal/objectMatchesWhereClause.test.js.map +1 -1
- package/build/esm/observable/internal/testUtils.js +85 -20
- package/build/esm/observable/internal/testUtils.js.map +1 -1
- package/build/esm/ontology/OntologyProvider.js.map +1 -1
- package/build/esm/ontology/StandardOntologyProvider.js +12 -5
- package/build/esm/ontology/StandardOntologyProvider.js.map +1 -1
- package/build/esm/ontology/StandardOntologyProvider.test.js +17 -16
- package/build/esm/ontology/StandardOntologyProvider.test.js.map +1 -1
- package/build/esm/ontology/loadFullObjectMetadata.js +0 -1
- package/build/esm/ontology/loadFullObjectMetadata.js.map +1 -1
- package/build/esm/ontology/loadQueryMetadata.js +5 -2
- package/build/esm/ontology/loadQueryMetadata.js.map +1 -1
- package/build/esm/public/internal.js +2 -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/osdkConfig.js +49 -0
- package/build/esm/public-utils/osdkConfig.js.map +1 -0
- package/build/esm/{object/createObjectSpecifierFromPrimaryKey.js → public-utils/vite-env.d.ts} +2 -3
- package/build/esm/queries/applyQuery.js +6 -4
- package/build/esm/queries/applyQuery.js.map +1 -1
- package/build/esm/queries/queries.test.js +93 -27
- package/build/esm/queries/queries.test.js.map +1 -1
- package/build/esm/queries/types.js.map +1 -1
- package/build/esm/tsserver.js.map +1 -1
- package/build/esm/util/UserAgent.js +1 -1
- package/build/esm/util/extractRdpDefinition.js +140 -0
- package/build/esm/util/extractRdpDefinition.js.map +1 -0
- package/build/esm/util/extractRdpDefinition.test.js +233 -0
- package/build/esm/util/extractRdpDefinition.test.js.map +1 -0
- package/build/{browser/util/isOsdkObject.js → esm/util/isObjectSpecifiersObject.js} +2 -2
- package/build/esm/util/isObjectSpecifiersObject.js.map +1 -0
- package/build/esm/util/isPoint.js +20 -0
- package/build/esm/util/isPoint.js.map +1 -0
- package/build/esm/util/objectSpecifierUtils.js +48 -0
- package/build/esm/util/objectSpecifierUtils.js.map +1 -0
- package/build/esm/util/objectSpecifierUtils.test.js +42 -0
- package/build/esm/util/objectSpecifierUtils.test.js.map +1 -0
- package/build/esm/util/toDataValue.js +6 -2
- package/build/esm/util/toDataValue.js.map +1 -1
- package/build/esm/util/toDataValue.test.js +37 -16
- package/build/esm/util/toDataValue.test.js.map +1 -1
- package/build/esm/util/toDataValueQueries.js +4 -6
- package/build/esm/util/toDataValueQueries.js.map +1 -1
- package/build/types/MinimalClientContext.d.ts +1 -1
- package/build/types/MinimalClientContext.d.ts.map +1 -1
- package/build/types/__unstable/ConjureSupport.d.ts +2 -2
- package/build/types/actions/applyAction.d.ts +1 -2
- package/build/types/actions/applyAction.d.ts.map +1 -1
- package/build/types/createClient.d.ts +1 -1
- package/build/types/createClient.d.ts.map +1 -1
- package/build/types/createClient.test.d.ts +2 -1
- package/build/types/createClient.test.d.ts.map +1 -1
- package/build/types/createMinimalClientHelper.d.ts +1 -0
- package/build/types/createMinimalClientHelper.d.ts.map +1 -0
- package/build/types/derivedProperties/derivedPropertyDefinitionFactory.d.ts +1 -0
- package/build/types/derivedProperties/derivedPropertyDefinitionFactory.d.ts.map +1 -0
- package/build/types/index.d.ts +4 -6
- package/build/types/index.d.ts.map +1 -1
- package/build/types/intellisense.test.helpers/showsObjectPropertyJsdoc.d.ts +1 -0
- package/build/types/intellisense.test.helpers/showsObjectPropertyJsdoc.d.ts.map +1 -0
- package/build/types/logger/BaseLogger.d.ts +33 -0
- package/build/types/logger/BaseLogger.d.ts.map +1 -0
- package/build/types/logger/BrowserLogger.d.ts +9 -0
- package/build/types/logger/BrowserLogger.d.ts.map +1 -0
- package/build/types/logger/MinimalLogger.d.ts +9 -0
- package/build/types/logger/MinimalLogger.d.ts.map +1 -0
- package/build/types/logger/MinimalLogger.test.d.ts +1 -0
- package/build/types/logger/MinimalLogger.test.d.ts.map +1 -0
- package/build/types/logger/TestLogger.d.ts +14 -0
- package/build/types/logger/TestLogger.d.ts.map +1 -0
- package/build/types/object/SimpleOsdkProperties.d.ts +1 -0
- package/build/types/object/SimpleOsdkProperties.d.ts.map +1 -0
- package/build/types/object/convertWireToOsdkObjects/BaseHolder.d.ts +1 -0
- package/build/types/object/convertWireToOsdkObjects/BaseHolder.d.ts.map +1 -0
- package/build/types/object/convertWireToOsdkObjects.d.ts +8 -1
- package/build/types/object/convertWireToOsdkObjects.d.ts.map +1 -1
- package/build/types/object/fetchPage.d.ts.map +1 -1
- package/build/types/object/object.test.d.ts.map +1 -1
- package/build/types/objectSet/ObjectSet.test.d.ts.map +1 -1
- package/build/types/observable/ListPayload.d.ts +5 -9
- package/build/types/observable/ListPayload.d.ts.map +1 -1
- package/build/types/observable/ObjectPayload.d.ts +4 -7
- package/build/types/observable/ObjectPayload.d.ts.map +1 -1
- package/build/types/observable/ObservableClient.d.ts +27 -11
- package/build/types/observable/ObservableClient.d.ts.map +1 -1
- package/build/types/observable/internal/ActionApplication.d.ts +2 -2
- package/build/types/observable/internal/ActionApplication.d.ts.map +1 -1
- package/build/types/observable/internal/BulkObjectLoader.d.ts +8 -0
- package/build/types/observable/internal/BulkObjectLoader.d.ts.map +1 -0
- package/build/types/observable/internal/BulkObjectLoader.test.d.ts +1 -0
- package/build/types/observable/internal/BulkObjectLoader.test.d.ts.map +1 -0
- package/build/types/observable/internal/CacheKeys.d.ts +1 -1
- package/build/types/observable/internal/CacheKeys.d.ts.map +1 -1
- package/build/types/observable/internal/Changes.d.ts +15 -0
- package/build/types/observable/internal/Changes.d.ts.map +1 -0
- package/build/types/observable/internal/Layer.d.ts +1 -0
- package/build/types/observable/internal/Layer.d.ts.map +1 -1
- package/build/types/observable/internal/ListQuery.d.ts +59 -14
- package/build/types/observable/internal/ListQuery.d.ts.map +1 -1
- package/build/types/observable/internal/ObjectQuery.d.ts +5 -6
- package/build/types/observable/internal/ObjectQuery.d.ts.map +1 -1
- package/build/types/observable/internal/OptimisticJob.d.ts +1 -1
- package/build/types/observable/internal/OptimisticJob.d.ts.map +1 -1
- package/build/types/observable/internal/OrderByCanonicalizer.d.ts +12 -0
- package/build/types/observable/internal/OrderByCanonicalizer.d.ts.map +1 -0
- package/build/types/observable/internal/OrderByCanonicalizer.test.d.ts +1 -0
- package/build/types/observable/internal/OrderByCanonicalizer.test.d.ts.map +1 -0
- package/build/types/observable/internal/Query.d.ts +41 -6
- package/build/types/observable/internal/Query.d.ts.map +1 -1
- package/build/types/observable/internal/RefCounts.d.ts.map +1 -1
- package/build/types/observable/internal/SimpleWhereClause.d.ts +2 -0
- package/build/types/observable/internal/SimpleWhereClause.d.ts.map +1 -0
- package/build/types/observable/internal/Store.d.ts +20 -44
- package/build/types/observable/internal/Store.d.ts.map +1 -1
- package/build/types/observable/internal/WhereClauseCanonicalizer.d.ts +2 -1
- package/build/types/observable/internal/WhereClauseCanonicalizer.d.ts.map +1 -1
- package/build/types/observable/internal/objectMatchesWhereClause.d.ts +4 -2
- package/build/types/observable/internal/objectMatchesWhereClause.d.ts.map +1 -1
- package/build/types/observable/internal/testUtils.d.ts +39 -10
- package/build/types/observable/internal/testUtils.d.ts.map +1 -1
- package/build/types/ontology/OntologyProvider.d.ts +1 -1
- package/build/types/ontology/OntologyProvider.d.ts.map +1 -1
- package/build/types/ontology/loadQueryMetadata.d.ts +1 -1
- package/build/types/ontology/loadQueryMetadata.d.ts.map +1 -1
- package/build/types/public/internal.d.ts +2 -0
- package/build/types/public/internal.d.ts.map +1 -1
- package/build/types/public/unstable-do-not-use.d.ts +4 -5
- package/build/types/public/unstable-do-not-use.d.ts.map +1 -1
- package/build/types/public-utils/osdkConfig.d.ts +8 -0
- package/build/types/public-utils/osdkConfig.d.ts.map +1 -0
- package/build/types/public-utils/vite-env.d.d.ts +3 -0
- package/build/types/public-utils/vite-env.d.d.ts.map +1 -0
- package/build/types/queries/applyQuery.d.ts +2 -2
- package/build/types/queries/applyQuery.d.ts.map +1 -1
- package/build/types/queries/types.d.ts +1 -1
- package/build/types/queries/types.d.ts.map +1 -1
- package/build/types/tsserver.d.ts +1 -1
- package/build/types/tsserver.d.ts.map +1 -1
- package/build/types/util/extractRdpDefinition.d.ts +4 -0
- package/build/types/util/extractRdpDefinition.d.ts.map +1 -0
- package/build/types/util/extractRdpDefinition.test.d.ts +1 -0
- package/build/types/util/extractRdpDefinition.test.d.ts.map +1 -0
- package/build/types/util/isObjectSpecifiersObject.d.ts +5 -0
- package/build/types/util/isObjectSpecifiersObject.d.ts.map +1 -0
- package/build/types/util/isPoint.d.ts +1 -0
- package/build/types/util/isPoint.d.ts.map +1 -0
- package/build/types/util/objectSpecifierUtils.d.ts +24 -0
- package/build/types/util/objectSpecifierUtils.d.ts.map +1 -0
- package/build/types/util/objectSpecifierUtils.test.d.ts +1 -0
- package/build/types/util/objectSpecifierUtils.test.d.ts.map +1 -0
- package/package.json +21 -18
- package/build/browser/Logger.js +0 -2
- package/build/browser/Logger.js.map +0 -1
- package/build/browser/object/createObjectSpecifierFromPrimaryKey.js.map +0 -1
- package/build/browser/observable/internal/ChangedObjects.js.map +0 -1
- package/build/browser/util/isOsdkBaseObject.js.map +0 -1
- package/build/browser/util/isOsdkObject.js.map +0 -1
- package/build/cjs/chunk-IU47QMYO.cjs.map +0 -1
- package/build/cjs/chunk-JPENHIJB.cjs.map +0 -1
- package/build/cjs/chunk-Q7SFCCGT.cjs +0 -11
- package/build/cjs/chunk-Q7SFCCGT.cjs.map +0 -1
- package/build/cjs/graphql-RGM5SRWV.cjs +0 -10532
- package/build/cjs/graphql-RGM5SRWV.cjs.map +0 -1
- package/build/esm/Logger.js +0 -2
- package/build/esm/Logger.js.map +0 -1
- package/build/esm/object/createObjectSpecifierFromPrimaryKey.js.map +0 -1
- package/build/esm/observable/internal/ChangedObjects.js.map +0 -1
- package/build/esm/util/isOsdkBaseObject.js.map +0 -1
- package/build/esm/util/isOsdkObject.js.map +0 -1
- package/build/types/Logger.d.ts +0 -17
- package/build/types/Logger.d.ts.map +0 -1
- package/build/types/object/createObjectSpecifierFromPrimaryKey.d.ts +0 -2
- package/build/types/object/createObjectSpecifierFromPrimaryKey.d.ts.map +0 -1
- package/build/types/observable/internal/ChangedObjects.d.ts +0 -11
- package/build/types/observable/internal/ChangedObjects.d.ts.map +0 -1
- package/build/types/util/isOsdkBaseObject.d.ts +0 -2
- package/build/types/util/isOsdkBaseObject.d.ts.map +0 -1
- package/build/types/util/isOsdkObject.d.ts +0 -2
- package/build/types/util/isOsdkObject.d.ts.map +0 -1
package/build/cjs/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
3
|
+
var chunkFKI2LO2O_cjs = require('./chunk-FKI2LO2O.cjs');
|
|
4
|
+
var chunkT4NIFYZS_cjs = require('./chunk-T4NIFYZS.cjs');
|
|
5
|
+
var chunkW5PFESFR_cjs = require('./chunk-W5PFESFR.cjs');
|
|
6
6
|
var api = require('@osdk/api');
|
|
7
7
|
var shared_net_errors = require('@osdk/shared.net.errors');
|
|
8
8
|
var unstable = require('@osdk/api/unstable');
|
|
@@ -18,7 +18,7 @@ var invariant__default = /*#__PURE__*/_interopDefault(invariant);
|
|
|
18
18
|
// src/actions/ActionValidationError.ts
|
|
19
19
|
var ActionValidationError = class extends Error {
|
|
20
20
|
constructor(validation) {
|
|
21
|
-
super("Validation Error");
|
|
21
|
+
super("Validation Error: " + JSON.stringify(validation, null, 2));
|
|
22
22
|
this.validation = validation;
|
|
23
23
|
}
|
|
24
24
|
};
|
|
@@ -55,7 +55,7 @@ function applyPageToken(payload, {
|
|
|
55
55
|
return pageToken ? {
|
|
56
56
|
...payload,
|
|
57
57
|
pageToken
|
|
58
|
-
} :
|
|
58
|
+
} : void 0;
|
|
59
59
|
}
|
|
60
60
|
async function* pageRequestAsAsyncIter(call, values, nextArgs, initialPayload) {
|
|
61
61
|
let payload = initialPayload;
|
|
@@ -72,7 +72,7 @@ async function* pageRequestAsAsyncIter(call, values, nextArgs, initialPayload) {
|
|
|
72
72
|
function createSimpleCache(map = /* @__PURE__ */ new Map(), fn) {
|
|
73
73
|
function get(key) {
|
|
74
74
|
let r = map.get(key);
|
|
75
|
-
if (r ===
|
|
75
|
+
if (r === void 0 && fn !== void 0) {
|
|
76
76
|
return set(key, fn(key));
|
|
77
77
|
} else {
|
|
78
78
|
return r;
|
|
@@ -120,7 +120,7 @@ function createSimpleAsyncCache(type, fn, createCacheLocal = createSimpleCache)
|
|
|
120
120
|
var cachedAllOntologies;
|
|
121
121
|
async function getOntologyVersionForRid(ctx, ontologyRid) {
|
|
122
122
|
cachedAllOntologies ??= await client_unstable.loadAllOntologies(ctx, {});
|
|
123
|
-
!cachedAllOntologies.ontologies[ontologyRid] ? process.env.NODE_ENV !== "production" ? invariant__default.default(false, "ontology should be loaded") : invariant__default.default(false) :
|
|
123
|
+
!cachedAllOntologies.ontologies[ontologyRid] ? process.env.NODE_ENV !== "production" ? invariant__default.default(false, "ontology should be loaded") : invariant__default.default(false) : void 0;
|
|
124
124
|
return cachedAllOntologies.ontologies[ontologyRid].currentOntologyVersion;
|
|
125
125
|
}
|
|
126
126
|
var strongMemoAsync = (fn) => createSimpleAsyncCache("strong", fn).get;
|
|
@@ -162,7 +162,7 @@ var MetadataClient = class {
|
|
|
162
162
|
[objectTypeRid]: await this.ontologyVersion("")
|
|
163
163
|
}
|
|
164
164
|
});
|
|
165
|
-
!linkTypes.linkTypes[objectTypeRid] ? process.env.NODE_ENV !== "production" ? invariant__default.default(false, "link type should be loaded") : invariant__default.default(false) :
|
|
165
|
+
!linkTypes.linkTypes[objectTypeRid] ? process.env.NODE_ENV !== "production" ? invariant__default.default(false, "link type should be loaded") : invariant__default.default(false) : void 0;
|
|
166
166
|
const ret = {};
|
|
167
167
|
for (const l of linkTypes.linkTypes[objectTypeRid]) {
|
|
168
168
|
const helper = ({
|
|
@@ -232,22 +232,22 @@ var MetadataClient = class {
|
|
|
232
232
|
interfaceTypes: [],
|
|
233
233
|
typeGroups: [],
|
|
234
234
|
loadRedacted: false,
|
|
235
|
-
includeObjectTypeCount:
|
|
235
|
+
includeObjectTypeCount: void 0,
|
|
236
236
|
includeObjectTypesWithoutSearchableDatasources: true,
|
|
237
|
-
includeEntityMetadata:
|
|
237
|
+
includeEntityMetadata: void 0,
|
|
238
238
|
actionTypes: [],
|
|
239
|
-
includeTypeGroupEntitiesCount:
|
|
240
|
-
entityMetadata:
|
|
239
|
+
includeTypeGroupEntitiesCount: void 0,
|
|
240
|
+
entityMetadata: void 0
|
|
241
241
|
};
|
|
242
|
-
const entities = await client_unstable.bulkLoadOntologyEntities(this.#ctx,
|
|
243
|
-
!entities.objectTypes[0]?.objectType ? process.env.NODE_ENV !== "production" ? invariant__default.default(false, "object type should be loaded") : invariant__default.default(false) :
|
|
242
|
+
const entities = await client_unstable.bulkLoadOntologyEntities(this.#ctx, void 0, body);
|
|
243
|
+
!entities.objectTypes[0]?.objectType ? process.env.NODE_ENV !== "production" ? invariant__default.default(false, "object type should be loaded") : invariant__default.default(false) : void 0;
|
|
244
244
|
return entities.objectTypes[0].objectType;
|
|
245
245
|
});
|
|
246
246
|
ontologyVersion = strongMemoAsync(async (_) => getOntologyVersionForRid(this.#ctx, await this.#client.ontologyRid));
|
|
247
247
|
};
|
|
248
248
|
var metadataCacheClient = weakMemoAsync((client) => Promise.resolve(new MetadataClient(client)));
|
|
249
249
|
function createObjectPropertyMapping(conjureOT) {
|
|
250
|
-
!(conjureOT.primaryKeys.length === 1) ? process.env.NODE_ENV !== "production" ? invariant__default.default(false, `only one primary key supported, got ${conjureOT.primaryKeys.length}`) : invariant__default.default(false) :
|
|
250
|
+
!(conjureOT.primaryKeys.length === 1) ? process.env.NODE_ENV !== "production" ? invariant__default.default(false, `only one primary key supported, got ${conjureOT.primaryKeys.length}`) : invariant__default.default(false) : void 0;
|
|
251
251
|
const pkRid = conjureOT.primaryKeys[0];
|
|
252
252
|
const pkProperty = Object.values(conjureOT.propertyTypes).find((a) => a.rid === pkRid);
|
|
253
253
|
if (!pkProperty) {
|
|
@@ -279,7 +279,7 @@ function createBulkLinksAsyncIterFactory(ctx) {
|
|
|
279
279
|
return;
|
|
280
280
|
}
|
|
281
281
|
ctx.logger?.debug("Preparing to fetch bulk links");
|
|
282
|
-
!objs.every((a) => a.$objectType === objs[0].$objectType) ? process.env.NODE_ENV !== "production" ? invariant__default.default(false) : invariant__default.default(false) :
|
|
282
|
+
!objs.every((a) => a.$objectType === objs[0].$objectType) ? process.env.NODE_ENV !== "production" ? invariant__default.default(false) : invariant__default.default(false) : void 0;
|
|
283
283
|
const mcc = await metadataCacheClient(ctx);
|
|
284
284
|
const helper = await mcc.forObjectByApiName(objs[0].$objectType);
|
|
285
285
|
const [objectTypeRid, propertyMapping, fullLinkMapping] = await Promise.all([helper.getRid(), helper.getPropertyMapping(), helper.getLinkMapping()]);
|
|
@@ -291,21 +291,21 @@ function createBulkLinksAsyncIterFactory(ctx) {
|
|
|
291
291
|
}
|
|
292
292
|
const req = {
|
|
293
293
|
objectSetContext: {
|
|
294
|
-
forkRid:
|
|
294
|
+
forkRid: void 0,
|
|
295
295
|
objectSetFilterContext: {
|
|
296
296
|
parameterOverrides: {}
|
|
297
297
|
},
|
|
298
|
-
ontologyBranchRid:
|
|
299
|
-
owningRid:
|
|
300
|
-
reportUsage:
|
|
301
|
-
workstateRid:
|
|
298
|
+
ontologyBranchRid: void 0,
|
|
299
|
+
owningRid: void 0,
|
|
300
|
+
reportUsage: void 0,
|
|
301
|
+
workstateRid: void 0
|
|
302
302
|
},
|
|
303
303
|
responseOptions: {
|
|
304
304
|
includeObjectSetEntities: true,
|
|
305
305
|
includeUsageCost: false
|
|
306
306
|
},
|
|
307
307
|
pageSize: 1e3,
|
|
308
|
-
pageToken:
|
|
308
|
+
pageToken: void 0,
|
|
309
309
|
linksRequests: [{
|
|
310
310
|
directedLinkTypes: Object.values(linkMapping).map(({
|
|
311
311
|
directedLinkTypeRid
|
|
@@ -318,7 +318,7 @@ function createBulkLinksAsyncIterFactory(ctx) {
|
|
|
318
318
|
})))
|
|
319
319
|
}]
|
|
320
320
|
};
|
|
321
|
-
const bulkLinksIter = pageRequestAsAsyncIter(client_unstable.getBulkLinksPage.bind(
|
|
321
|
+
const bulkLinksIter = pageRequestAsAsyncIter(client_unstable.getBulkLinksPage.bind(void 0, makeConjureContext(ctx, "object-set-service/api")), getResults, applyPageToken, req);
|
|
322
322
|
for await (const item of bulkLinksIter) {
|
|
323
323
|
const {
|
|
324
324
|
objectIdentifier
|
|
@@ -388,14 +388,19 @@ function isInterfaceActionParam(o) {
|
|
|
388
388
|
return o != null && typeof o === "object" && "$objectType" in o && "$primaryKey" in o;
|
|
389
389
|
}
|
|
390
390
|
|
|
391
|
+
// src/util/isObjectSpecifiersObject.ts
|
|
392
|
+
function isObjectSpecifiersObject(o) {
|
|
393
|
+
return o && typeof o === "object" && typeof o.$apiName === "string" && o.$primaryKey != null;
|
|
394
|
+
}
|
|
395
|
+
|
|
391
396
|
// src/util/isOntologyObjectV2.ts
|
|
392
397
|
function isOntologyObjectV2(o) {
|
|
393
398
|
return o && typeof o === "object" && typeof o.__apiName === "string" && o.__primaryKey != null;
|
|
394
399
|
}
|
|
395
400
|
|
|
396
|
-
// src/util/
|
|
397
|
-
function
|
|
398
|
-
return o && typeof o === "object" &&
|
|
401
|
+
// src/util/isPoint.ts
|
|
402
|
+
function isPoint(o) {
|
|
403
|
+
return o && typeof o === "object" && "type" in o && o.type === "Point" && "coordinates" in o && o.coordinates.length === 2;
|
|
399
404
|
}
|
|
400
405
|
|
|
401
406
|
// src/util/toDataValue.ts
|
|
@@ -416,13 +421,13 @@ async function toDataValue(value, client) {
|
|
|
416
421
|
return Promise.all(promiseArray);
|
|
417
422
|
}
|
|
418
423
|
if (isAttachmentUpload(value)) {
|
|
419
|
-
const attachment = await
|
|
424
|
+
const attachment = await chunkW5PFESFR_cjs.Attachment_exports.upload(client, value.data, {
|
|
420
425
|
filename: value.name
|
|
421
426
|
});
|
|
422
427
|
return await toDataValue(attachment.rid, client);
|
|
423
428
|
}
|
|
424
429
|
if (isAttachmentFile(value)) {
|
|
425
|
-
const attachment = await
|
|
430
|
+
const attachment = await chunkW5PFESFR_cjs.Attachment_exports.upload(client, value, {
|
|
426
431
|
filename: value.name
|
|
427
432
|
});
|
|
428
433
|
return await toDataValue(attachment.rid, client);
|
|
@@ -430,14 +435,17 @@ async function toDataValue(value, client) {
|
|
|
430
435
|
if (isOntologyObjectV2(value)) {
|
|
431
436
|
return await toDataValue(value.__primaryKey, client);
|
|
432
437
|
}
|
|
433
|
-
if (
|
|
438
|
+
if (isObjectSpecifiersObject(value)) {
|
|
434
439
|
return await toDataValue(value.$primaryKey, client);
|
|
435
440
|
}
|
|
436
|
-
if (
|
|
441
|
+
if (isPoint(value)) {
|
|
442
|
+
return await toDataValue(value.coordinates.join(), client);
|
|
443
|
+
}
|
|
444
|
+
if (chunkFKI2LO2O_cjs.isWireObjectSet(value)) {
|
|
437
445
|
return value;
|
|
438
446
|
}
|
|
439
|
-
if (
|
|
440
|
-
return
|
|
447
|
+
if (chunkFKI2LO2O_cjs.isObjectSet(value)) {
|
|
448
|
+
return chunkFKI2LO2O_cjs.getWireObjectSet(value);
|
|
441
449
|
}
|
|
442
450
|
if (isMediaReference(value)) {
|
|
443
451
|
return value;
|
|
@@ -460,20 +468,20 @@ async function toDataValue(value, client) {
|
|
|
460
468
|
|
|
461
469
|
// src/actions/applyAction.ts
|
|
462
470
|
async function applyAction(client, action, parameters, options = {}) {
|
|
463
|
-
const clientWithHeaders =
|
|
471
|
+
const clientWithHeaders = chunkW5PFESFR_cjs.addUserAgentAndRequestContextHeaders(chunkFKI2LO2O_cjs.augmentRequestContext(client, (_) => ({
|
|
464
472
|
finalMethodCall: "applyAction"
|
|
465
473
|
})), action);
|
|
466
474
|
if (Array.isArray(parameters)) {
|
|
467
|
-
const response = await
|
|
475
|
+
const response = await chunkW5PFESFR_cjs.Action_exports.applyBatch(clientWithHeaders, await client.ontologyRid, action.apiName, {
|
|
468
476
|
requests: parameters ? await remapBatchActionParams(parameters, client) : [],
|
|
469
477
|
options: {
|
|
470
478
|
returnEdits: options?.$returnEdits ? "ALL" : "NONE"
|
|
471
479
|
}
|
|
472
480
|
});
|
|
473
481
|
const edits = response.edits;
|
|
474
|
-
return options?.$returnEdits ? edits?.type === "edits" ? remapActionResponse(response) : edits :
|
|
482
|
+
return options?.$returnEdits ? edits?.type === "edits" ? remapActionResponse(response) : edits : void 0;
|
|
475
483
|
} else {
|
|
476
|
-
const response = await
|
|
484
|
+
const response = await chunkW5PFESFR_cjs.Action_exports.apply(clientWithHeaders, await client.ontologyRid, action.apiName, {
|
|
477
485
|
parameters: await remapActionParams(parameters, client),
|
|
478
486
|
options: {
|
|
479
487
|
mode: options?.$validateOnly ? "VALIDATE_ONLY" : "VALIDATE_AND_EXECUTE",
|
|
@@ -487,7 +495,7 @@ async function applyAction(client, action, parameters, options = {}) {
|
|
|
487
495
|
throw new ActionValidationError(response.validation);
|
|
488
496
|
}
|
|
489
497
|
const edits = response.edits;
|
|
490
|
-
return options?.$returnEdits ? edits?.type === "edits" ? remapActionResponse(response) : edits :
|
|
498
|
+
return options?.$returnEdits ? edits?.type === "edits" ? remapActionResponse(response) : edits : void 0;
|
|
491
499
|
}
|
|
492
500
|
}
|
|
493
501
|
async function remapActionParams(params, client) {
|
|
@@ -677,7 +685,7 @@ var GeotimeSeriesPropertyImpl = class {
|
|
|
677
685
|
}
|
|
678
686
|
}
|
|
679
687
|
async getLatestValue() {
|
|
680
|
-
const latestPointPromise =
|
|
688
|
+
const latestPointPromise = chunkW5PFESFR_cjs.TimeSeriesValueBankProperty_exports.getLatestValue(this.#client, await this.#client.ontologyRid, ...this.#triplet);
|
|
681
689
|
latestPointPromise.then(
|
|
682
690
|
(latestPoint) => this.lastFetchedValue = latestPoint,
|
|
683
691
|
// eslint-disable-next-line no-console
|
|
@@ -693,7 +701,7 @@ var GeotimeSeriesPropertyImpl = class {
|
|
|
693
701
|
return allPoints;
|
|
694
702
|
}
|
|
695
703
|
async *asyncIterValues(query) {
|
|
696
|
-
const streamPointsIterator = await
|
|
704
|
+
const streamPointsIterator = await chunkW5PFESFR_cjs.TimeSeriesValueBankProperty_exports.streamValues(this.#client, await this.#client.ontologyRid, ...this.#triplet, query ? {
|
|
697
705
|
range: getTimeRange(query)
|
|
698
706
|
} : {});
|
|
699
707
|
for await (const timeseriesPoint of asyncIterPointsHelper(streamPointsIterator)) {
|
|
@@ -717,13 +725,13 @@ var MediaReferencePropertyImpl = class {
|
|
|
717
725
|
this.#triplet = [objectApiName, primaryKey, propertyName];
|
|
718
726
|
}
|
|
719
727
|
async fetchContents() {
|
|
720
|
-
return
|
|
728
|
+
return chunkW5PFESFR_cjs.MediaReferenceProperty_exports.getMediaContent(this.#client, await this.#client.ontologyRid, ...this.#triplet, {
|
|
721
729
|
preview: true
|
|
722
730
|
// TODO: Can turn this back off when backend is no longer in beta.
|
|
723
731
|
});
|
|
724
732
|
}
|
|
725
733
|
async fetchMetadata() {
|
|
726
|
-
const r = await
|
|
734
|
+
const r = await chunkW5PFESFR_cjs.MediaReferenceProperty_exports.getMediaMetadata(this.#client, await this.#client.ontologyRid, ...this.#triplet, {
|
|
727
735
|
preview: true
|
|
728
736
|
// TODO: Can turn this back off when backend is no longer in beta.
|
|
729
737
|
});
|
|
@@ -744,10 +752,10 @@ var TimeSeriesPropertyImpl = class {
|
|
|
744
752
|
this.#triplet = [objectApiName, primaryKey, propertyName];
|
|
745
753
|
}
|
|
746
754
|
async getFirstPoint() {
|
|
747
|
-
return
|
|
755
|
+
return chunkW5PFESFR_cjs.TimeSeriesPropertyV2_exports.getFirstPoint(this.#client, await this.#client.ontologyRid, ...this.#triplet);
|
|
748
756
|
}
|
|
749
757
|
async getLastPoint() {
|
|
750
|
-
return
|
|
758
|
+
return chunkW5PFESFR_cjs.TimeSeriesPropertyV2_exports.getLastPoint(this.#client, await this.#client.ontologyRid, ...this.#triplet);
|
|
751
759
|
}
|
|
752
760
|
async getAllPoints(query) {
|
|
753
761
|
const allPoints = [];
|
|
@@ -757,7 +765,7 @@ var TimeSeriesPropertyImpl = class {
|
|
|
757
765
|
return allPoints;
|
|
758
766
|
}
|
|
759
767
|
async *asyncIterPoints(query) {
|
|
760
|
-
const streamPointsIterator = await
|
|
768
|
+
const streamPointsIterator = await chunkW5PFESFR_cjs.TimeSeriesPropertyV2_exports.streamPoints(this.#client, await this.#client.ontologyRid, ...this.#triplet, query ? {
|
|
761
769
|
range: getTimeRange(query)
|
|
762
770
|
} : {});
|
|
763
771
|
for await (const timeseriesPoint of asyncIterPointsHelper(streamPointsIterator)) {
|
|
@@ -766,21 +774,23 @@ var TimeSeriesPropertyImpl = class {
|
|
|
766
774
|
}
|
|
767
775
|
};
|
|
768
776
|
|
|
777
|
+
// src/util/objectSpecifierUtils.ts
|
|
778
|
+
function createObjectSpecifierFromPrimaryKey(objectDef, primaryKey) {
|
|
779
|
+
return `${objectDef.apiName}:${primaryKey}`;
|
|
780
|
+
}
|
|
781
|
+
function extractPrimaryKeyFromObjectSpecifier(ObjectSpecifier) {
|
|
782
|
+
return ObjectSpecifier.split(":")[1];
|
|
783
|
+
}
|
|
784
|
+
|
|
769
785
|
// src/ontology/OntologyProvider.ts
|
|
770
786
|
var InterfaceDefinitions = Symbol("InterfaceDefinitions" );
|
|
771
787
|
|
|
772
|
-
// src/object/convertWireToOsdkObjects/InternalSymbols.ts
|
|
773
|
-
var UnderlyingOsdkObject = Symbol("Underlying Object" );
|
|
774
|
-
var ObjectDefRef = Symbol("ObjectDefinition" );
|
|
775
|
-
var InterfaceDefRef = Symbol("InterfaceDefinition" );
|
|
776
|
-
var ClientRef = Symbol("ClientRef" );
|
|
777
|
-
|
|
778
788
|
// src/object/convertWireToOsdkObjects/createOsdkInterface.ts
|
|
779
789
|
function createOsdkInterface(underlying, interfaceDef) {
|
|
780
|
-
const [objApiNamespace] =
|
|
790
|
+
const [objApiNamespace] = chunkFKI2LO2O_cjs.extractNamespace(interfaceDef.apiName);
|
|
781
791
|
return Object.freeze(Object.defineProperties({}, {
|
|
782
792
|
// first to minimize hidden classes
|
|
783
|
-
[UnderlyingOsdkObject]: {
|
|
793
|
+
[chunkT4NIFYZS_cjs.UnderlyingOsdkObject]: {
|
|
784
794
|
value: underlying
|
|
785
795
|
},
|
|
786
796
|
"$apiName": {
|
|
@@ -799,6 +809,10 @@ function createOsdkInterface(underlying, interfaceDef) {
|
|
|
799
809
|
value: underlying.$primaryKey,
|
|
800
810
|
enumerable: "$primaryKey" in underlying
|
|
801
811
|
},
|
|
812
|
+
"$objectSpecifier": {
|
|
813
|
+
value: underlying.$objectSpecifier,
|
|
814
|
+
enumerable: "$objectSpecifier" in underlying
|
|
815
|
+
},
|
|
802
816
|
"$title": {
|
|
803
817
|
value: underlying.$title,
|
|
804
818
|
enumerable: "$title" in underlying
|
|
@@ -811,12 +825,12 @@ function createOsdkInterface(underlying, interfaceDef) {
|
|
|
811
825
|
value: clone,
|
|
812
826
|
enumerable: false
|
|
813
827
|
},
|
|
814
|
-
[InterfaceDefRef]: {
|
|
828
|
+
[chunkT4NIFYZS_cjs.InterfaceDefRef]: {
|
|
815
829
|
value: interfaceDef
|
|
816
830
|
},
|
|
817
831
|
...Object.fromEntries(Object.keys(interfaceDef.properties).map((p) => {
|
|
818
|
-
const objDef = underlying[ObjectDefRef];
|
|
819
|
-
const [apiNamespace, apiName] =
|
|
832
|
+
const objDef = underlying[chunkT4NIFYZS_cjs.ObjectDefRef];
|
|
833
|
+
const [apiNamespace, apiName] = chunkFKI2LO2O_cjs.extractNamespace(p);
|
|
820
834
|
const targetPropName = objDef.interfaceMap[interfaceDef.apiName][p];
|
|
821
835
|
return [apiNamespace === objApiNamespace ? apiName : p, {
|
|
822
836
|
enumerable: targetPropName in underlying,
|
|
@@ -837,7 +851,7 @@ function createOsdkInterface(underlying, interfaceDef) {
|
|
|
837
851
|
return underlying.$clone(remappedProps).$as(interfaceDef);
|
|
838
852
|
}
|
|
839
853
|
function mapProperty(propertyName, value) {
|
|
840
|
-
const objDef = underlying[ObjectDefRef];
|
|
854
|
+
const objDef = underlying[chunkT4NIFYZS_cjs.ObjectDefRef];
|
|
841
855
|
const targetPropName = objDef.interfaceMap[interfaceDef.apiName][propertyName];
|
|
842
856
|
if (targetPropName == null) {
|
|
843
857
|
throw new Error(`Cannot clone interface with ${propertyName} as property is not implemented by the underlying object type ${objDef.apiName}`);
|
|
@@ -854,14 +868,14 @@ function $asFactory(objDef) {
|
|
|
854
868
|
let targetInterfaceApiName;
|
|
855
869
|
if (typeof targetMinDef === "string") {
|
|
856
870
|
if (targetMinDef === objDef.apiName) {
|
|
857
|
-
return this[UnderlyingOsdkObject];
|
|
871
|
+
return this[chunkT4NIFYZS_cjs.UnderlyingOsdkObject];
|
|
858
872
|
}
|
|
859
873
|
if (objDef.interfaceMap?.[targetMinDef] == null) {
|
|
860
874
|
throw new Error(`Object does not implement interface '${targetMinDef}'.`);
|
|
861
875
|
}
|
|
862
876
|
targetInterfaceApiName = targetMinDef;
|
|
863
877
|
} else if (targetMinDef.apiName === objDef.apiName) {
|
|
864
|
-
return this[UnderlyingOsdkObject];
|
|
878
|
+
return this[chunkT4NIFYZS_cjs.UnderlyingOsdkObject];
|
|
865
879
|
} else {
|
|
866
880
|
if (targetMinDef.type === "object") {
|
|
867
881
|
throw new Error(`'${targetMinDef.apiName}' is not an interface nor is it '${objDef.apiName}', which is the object type.`);
|
|
@@ -872,7 +886,7 @@ function $asFactory(objDef) {
|
|
|
872
886
|
if (!def) {
|
|
873
887
|
throw new Error(`Object does not implement interface '${targetInterfaceApiName}'.`);
|
|
874
888
|
}
|
|
875
|
-
const underlying = this[UnderlyingOsdkObject];
|
|
889
|
+
const underlying = this[chunkT4NIFYZS_cjs.UnderlyingOsdkObject];
|
|
876
890
|
const existing = osdkObjectToInterfaceView.get(underlying).get(targetInterfaceApiName)?.deref();
|
|
877
891
|
if (existing) return existing;
|
|
878
892
|
const osdkInterface = createOsdkInterface(underlying, def.def);
|
|
@@ -883,17 +897,17 @@ function $asFactory(objDef) {
|
|
|
883
897
|
|
|
884
898
|
// src/object/convertWireToOsdkObjects/getDollarLink.ts
|
|
885
899
|
function get$link(holder) {
|
|
886
|
-
const client = holder[ClientRef];
|
|
887
|
-
const objDef = holder[ObjectDefRef];
|
|
888
|
-
const rawObj = holder[UnderlyingOsdkObject];
|
|
900
|
+
const client = holder[chunkT4NIFYZS_cjs.ClientRef];
|
|
901
|
+
const objDef = holder[chunkT4NIFYZS_cjs.ObjectDefRef];
|
|
902
|
+
const rawObj = holder[chunkT4NIFYZS_cjs.UnderlyingOsdkObject];
|
|
889
903
|
return Object.freeze(Object.fromEntries(Object.keys(objDef.links).map((linkName) => {
|
|
890
904
|
const linkDef = objDef.links[linkName];
|
|
891
905
|
const objectSet = client.objectSetFactory(objDef, client).where({
|
|
892
906
|
[objDef.primaryKeyApiName]: rawObj.$primaryKey
|
|
893
907
|
}).pivotTo(linkName);
|
|
894
908
|
const value = !linkDef.multiplicity ? {
|
|
895
|
-
fetchOne: (options) =>
|
|
896
|
-
fetchOneWithErrors: (options) =>
|
|
909
|
+
fetchOne: (options) => chunkFKI2LO2O_cjs.fetchSingle(client, objDef, options ?? {}, chunkFKI2LO2O_cjs.getWireObjectSet(objectSet)),
|
|
910
|
+
fetchOneWithErrors: (options) => chunkFKI2LO2O_cjs.fetchSingleWithErrors(client, objDef, options ?? {}, chunkFKI2LO2O_cjs.getWireObjectSet(objectSet))
|
|
897
911
|
} : objectSet;
|
|
898
912
|
return [linkName, value];
|
|
899
913
|
})));
|
|
@@ -904,7 +918,7 @@ var specialPropertyTypes = /* @__PURE__ */ new Set(["attachment", "geotimeSeries
|
|
|
904
918
|
var basePropDefs = {
|
|
905
919
|
"$as": {
|
|
906
920
|
get: function() {
|
|
907
|
-
return get$as(this[ObjectDefRef]);
|
|
921
|
+
return get$as(this[chunkT4NIFYZS_cjs.ObjectDefRef]);
|
|
908
922
|
}
|
|
909
923
|
},
|
|
910
924
|
"$link": {
|
|
@@ -914,10 +928,10 @@ var basePropDefs = {
|
|
|
914
928
|
},
|
|
915
929
|
"$clone": {
|
|
916
930
|
value: function(update) {
|
|
917
|
-
const rawObj = this[UnderlyingOsdkObject];
|
|
918
|
-
const def = this[ObjectDefRef];
|
|
931
|
+
const rawObj = this[chunkT4NIFYZS_cjs.UnderlyingOsdkObject];
|
|
932
|
+
const def = this[chunkT4NIFYZS_cjs.ObjectDefRef];
|
|
919
933
|
if (update == null) {
|
|
920
|
-
return createOsdkObject(this[ClientRef], def, {
|
|
934
|
+
return createOsdkObject(this[chunkT4NIFYZS_cjs.ClientRef], def, {
|
|
921
935
|
...rawObj
|
|
922
936
|
});
|
|
923
937
|
}
|
|
@@ -928,24 +942,32 @@ var basePropDefs = {
|
|
|
928
942
|
update.$title = update[def.titleProperty];
|
|
929
943
|
}
|
|
930
944
|
const newObject = {
|
|
931
|
-
...this[UnderlyingOsdkObject],
|
|
945
|
+
...this[chunkT4NIFYZS_cjs.UnderlyingOsdkObject],
|
|
932
946
|
...update
|
|
933
947
|
};
|
|
934
|
-
return createOsdkObject(this[ClientRef], this[ObjectDefRef], newObject);
|
|
948
|
+
return createOsdkObject(this[chunkT4NIFYZS_cjs.ClientRef], this[chunkT4NIFYZS_cjs.ObjectDefRef], newObject);
|
|
935
949
|
}
|
|
950
|
+
},
|
|
951
|
+
"$objectSpecifier": {
|
|
952
|
+
get: function() {
|
|
953
|
+
const rawObj = this[chunkT4NIFYZS_cjs.UnderlyingOsdkObject];
|
|
954
|
+
return createObjectSpecifierFromPrimaryKey(this[chunkT4NIFYZS_cjs.ObjectDefRef], rawObj.$primaryKey);
|
|
955
|
+
},
|
|
956
|
+
enumerable: true
|
|
936
957
|
}
|
|
937
958
|
};
|
|
938
|
-
function createOsdkObject(client, objectDef,
|
|
959
|
+
function createOsdkObject(client, objectDef, simpleOsdkProperties, derivedPropertyTypeByName = {}) {
|
|
960
|
+
const rawObj = simpleOsdkProperties;
|
|
939
961
|
Object.defineProperties(rawObj, {
|
|
940
|
-
[UnderlyingOsdkObject]: {
|
|
962
|
+
[chunkT4NIFYZS_cjs.UnderlyingOsdkObject]: {
|
|
941
963
|
enumerable: false,
|
|
942
|
-
value:
|
|
964
|
+
value: simpleOsdkProperties
|
|
943
965
|
},
|
|
944
|
-
[ObjectDefRef]: {
|
|
966
|
+
[chunkT4NIFYZS_cjs.ObjectDefRef]: {
|
|
945
967
|
value: objectDef,
|
|
946
968
|
enumerable: false
|
|
947
969
|
},
|
|
948
|
-
[ClientRef]: {
|
|
970
|
+
[chunkT4NIFYZS_cjs.ClientRef]: {
|
|
949
971
|
value: client,
|
|
950
972
|
enumerable: false
|
|
951
973
|
},
|
|
@@ -954,6 +976,17 @@ function createOsdkObject(client, objectDef, rawObj) {
|
|
|
954
976
|
for (const propKey of Object.keys(rawObj)) {
|
|
955
977
|
if (propKey in objectDef.properties && typeof objectDef.properties[propKey].type === "string" && specialPropertyTypes.has(objectDef.properties[propKey].type)) {
|
|
956
978
|
rawObj[propKey] = createSpecialProperty(client, objectDef, rawObj, propKey);
|
|
979
|
+
} else if (propKey in derivedPropertyTypeByName && typeof derivedPropertyTypeByName[propKey].type === "string" && specialPropertyTypes.has(derivedPropertyTypeByName[propKey].type)) {
|
|
980
|
+
const rawValue = rawObj[propKey];
|
|
981
|
+
if (derivedPropertyTypeByName[propKey].type === "attachment") {
|
|
982
|
+
if (Array.isArray(rawValue)) {
|
|
983
|
+
rawObj[propKey] = rawValue.map((a) => chunkFKI2LO2O_cjs.hydrateAttachmentFromRidInternal(client, a.rid));
|
|
984
|
+
} else {
|
|
985
|
+
rawObj[propKey] = chunkFKI2LO2O_cjs.hydrateAttachmentFromRidInternal(client, rawValue.rid);
|
|
986
|
+
}
|
|
987
|
+
} else {
|
|
988
|
+
process.env.NODE_ENV !== "production" ? invariant__default.default(false, "Derived property aggregations for Timeseries and Media are not supported") : invariant__default.default(false) ;
|
|
989
|
+
}
|
|
957
990
|
}
|
|
958
991
|
}
|
|
959
992
|
return Object.freeze(rawObj);
|
|
@@ -962,59 +995,45 @@ function createSpecialProperty(client, objectDef, rawObject, p) {
|
|
|
962
995
|
const rawValue = rawObject[p];
|
|
963
996
|
const propDef = objectDef.properties[p];
|
|
964
997
|
if (process.env.NODE_ENV !== "production") {
|
|
965
|
-
!(propDef != null && typeof propDef.type === "string" && specialPropertyTypes.has(propDef.type)) ? process.env.NODE_ENV !== "production" ? invariant__default.default(false) : invariant__default.default(false) :
|
|
966
|
-
}
|
|
967
|
-
{
|
|
968
|
-
{
|
|
969
|
-
|
|
970
|
-
{
|
|
971
|
-
if (propDef.type === "attachment") {
|
|
972
|
-
if (Array.isArray(rawValue)) {
|
|
973
|
-
return rawValue.map((a) => chunkIU47QMYO_cjs.hydrateAttachmentFromRidInternal(client, a.rid));
|
|
974
|
-
}
|
|
975
|
-
return chunkIU47QMYO_cjs.hydrateAttachmentFromRidInternal(client, rawValue.rid);
|
|
976
|
-
}
|
|
977
|
-
if (propDef.type === "numericTimeseries" || propDef.type === "stringTimeseries" || propDef.type === "sensorTimeseries") {
|
|
978
|
-
return new TimeSeriesPropertyImpl(client, objectDef.apiName, rawObject[objectDef.primaryKeyApiName], p);
|
|
979
|
-
}
|
|
980
|
-
if (propDef.type === "geotimeSeriesReference") {
|
|
981
|
-
return new GeotimeSeriesPropertyImpl(client, objectDef.apiName, rawObject[objectDef.primaryKeyApiName], p, rawValue.type === "geotimeSeriesValue" ? {
|
|
982
|
-
time: rawValue.timestamp,
|
|
983
|
-
value: {
|
|
984
|
-
type: "Point",
|
|
985
|
-
coordinates: rawValue.position
|
|
986
|
-
}
|
|
987
|
-
} : undefined);
|
|
988
|
-
}
|
|
989
|
-
if (propDef.type === "mediaReference") {
|
|
990
|
-
return new MediaReferencePropertyImpl({
|
|
991
|
-
client,
|
|
992
|
-
objectApiName: objectDef.apiName,
|
|
993
|
-
primaryKey: rawObject[objectDef.primaryKeyApiName],
|
|
994
|
-
propertyName: p
|
|
995
|
-
});
|
|
996
|
-
}
|
|
997
|
-
}
|
|
998
|
-
}
|
|
998
|
+
!(propDef != null && typeof propDef.type === "string" && specialPropertyTypes.has(propDef.type)) ? process.env.NODE_ENV !== "production" ? invariant__default.default(false) : invariant__default.default(false) : void 0;
|
|
999
|
+
}
|
|
1000
|
+
if (propDef.type === "attachment") {
|
|
1001
|
+
if (Array.isArray(rawValue)) {
|
|
1002
|
+
return rawValue.map((a) => chunkFKI2LO2O_cjs.hydrateAttachmentFromRidInternal(client, a.rid));
|
|
999
1003
|
}
|
|
1004
|
+
return chunkFKI2LO2O_cjs.hydrateAttachmentFromRidInternal(client, rawValue.rid);
|
|
1005
|
+
}
|
|
1006
|
+
if (propDef.type === "numericTimeseries" || propDef.type === "stringTimeseries" || propDef.type === "sensorTimeseries") {
|
|
1007
|
+
return new TimeSeriesPropertyImpl(client, objectDef.apiName, rawObject[objectDef.primaryKeyApiName], p);
|
|
1008
|
+
}
|
|
1009
|
+
if (propDef.type === "geotimeSeriesReference") {
|
|
1010
|
+
return new GeotimeSeriesPropertyImpl(client, objectDef.apiName, rawObject[objectDef.primaryKeyApiName], p, rawValue.type === "geotimeSeriesValue" ? {
|
|
1011
|
+
time: rawValue.timestamp,
|
|
1012
|
+
value: {
|
|
1013
|
+
type: "Point",
|
|
1014
|
+
coordinates: rawValue.position
|
|
1015
|
+
}
|
|
1016
|
+
} : void 0);
|
|
1017
|
+
}
|
|
1018
|
+
if (propDef.type === "mediaReference") {
|
|
1019
|
+
return new MediaReferencePropertyImpl({
|
|
1020
|
+
client,
|
|
1021
|
+
objectApiName: objectDef.apiName,
|
|
1022
|
+
primaryKey: rawObject[objectDef.primaryKeyApiName],
|
|
1023
|
+
propertyName: p
|
|
1024
|
+
});
|
|
1000
1025
|
}
|
|
1001
|
-
}
|
|
1002
|
-
|
|
1003
|
-
// src/object/createObjectSpecifierFromPrimaryKey.ts
|
|
1004
|
-
function createObjectSpecifierFromPrimaryKey(def, primaryKey) {
|
|
1005
|
-
return `${def.apiName}:${primaryKey}`;
|
|
1006
1026
|
}
|
|
1007
1027
|
|
|
1008
1028
|
// src/object/convertWireToOsdkObjects.ts
|
|
1009
|
-
async function convertWireToOsdkObjects(client, objects, interfaceApiName, forceRemoveRid = false, selectedProps, strictNonNull = false) {
|
|
1010
|
-
client.logger?.debug(`START convertWireToOsdkObjects()`);
|
|
1029
|
+
async function convertWireToOsdkObjects(client, objects, interfaceApiName, forceRemoveRid = false, derivedPropertyTypesByName, selectedProps, strictNonNull = false) {
|
|
1011
1030
|
fixObjectPropertiesInPlace(objects, forceRemoveRid);
|
|
1012
|
-
const ifaceDef = interfaceApiName ? await client.ontologyProvider.getInterfaceDefinition(interfaceApiName) :
|
|
1013
|
-
const ifaceSelected = ifaceDef ? selectedProps ?? Object.keys(ifaceDef.properties) :
|
|
1031
|
+
const ifaceDef = interfaceApiName ? await client.ontologyProvider.getInterfaceDefinition(interfaceApiName) : void 0;
|
|
1032
|
+
const ifaceSelected = ifaceDef ? selectedProps ?? Object.keys(ifaceDef.properties) : void 0;
|
|
1014
1033
|
const ret = [];
|
|
1015
1034
|
for (const rawObj of objects) {
|
|
1016
1035
|
const objectDef = await client.ontologyProvider.getObjectDefinition(rawObj.$apiName);
|
|
1017
|
-
!objectDef ? process.env.NODE_ENV !== "production" ? invariant__default.default(false, `Missing definition for '${rawObj.$apiName}'`) : invariant__default.default(false) :
|
|
1036
|
+
!objectDef ? process.env.NODE_ENV !== "production" ? invariant__default.default(false, `Missing definition for '${rawObj.$apiName}'`) : invariant__default.default(false) : void 0;
|
|
1018
1037
|
let objProps;
|
|
1019
1038
|
let conforming = true;
|
|
1020
1039
|
if (ifaceDef && ifaceSelected) {
|
|
@@ -1031,24 +1050,22 @@ async function convertWireToOsdkObjects(client, objects, interfaceApiName, force
|
|
|
1031
1050
|
} else if (strictNonNull === "drop" && !conforming) {
|
|
1032
1051
|
continue;
|
|
1033
1052
|
}
|
|
1034
|
-
let osdkObject = createOsdkObject(client, objectDef, rawObj);
|
|
1053
|
+
let osdkObject = createOsdkObject(client, objectDef, rawObj, derivedPropertyTypesByName);
|
|
1035
1054
|
if (interfaceApiName) osdkObject = osdkObject.$as(interfaceApiName);
|
|
1036
1055
|
ret.push(osdkObject);
|
|
1037
1056
|
}
|
|
1038
|
-
client.logger?.debug(`END convertWireToOsdkObjects()`);
|
|
1039
1057
|
return ret;
|
|
1040
1058
|
}
|
|
1041
|
-
async function convertWireToOsdkObjects2(client, objects, interfaceApiName, forceRemoveRid = false, selectedProps, strictNonNull = false, interfaceToObjectTypeMappings = {}) {
|
|
1042
|
-
client.logger?.debug(`START convertWireToOsdkObjects2()`);
|
|
1059
|
+
async function convertWireToOsdkObjects2(client, objects, interfaceApiName, derivedPropertyTypeByName, forceRemoveRid = false, selectedProps, strictNonNull = false, interfaceToObjectTypeMappings = {}) {
|
|
1043
1060
|
fixObjectPropertiesInPlace(objects, forceRemoveRid);
|
|
1044
1061
|
const ret = [];
|
|
1045
1062
|
for (const rawObj of objects) {
|
|
1046
1063
|
const objectDef = await client.ontologyProvider.getObjectDefinition(rawObj.$apiName);
|
|
1047
|
-
!objectDef ? process.env.NODE_ENV !== "production" ? invariant__default.default(false, `Missing definition for '${rawObj.$apiName}'`) : invariant__default.default(false) :
|
|
1048
|
-
const interfaceToObjMapping = interfaceApiName ? interfaceToObjectTypeMappings[interfaceApiName][rawObj.$apiName] :
|
|
1064
|
+
!objectDef ? process.env.NODE_ENV !== "production" ? invariant__default.default(false, `Missing definition for '${rawObj.$apiName}'`) : invariant__default.default(false) : void 0;
|
|
1065
|
+
const interfaceToObjMapping = interfaceApiName ? interfaceToObjectTypeMappings[interfaceApiName][rawObj.$apiName] : void 0;
|
|
1049
1066
|
const ifaceSelected = interfaceApiName && interfaceToObjMapping ? selectedProps ? Object.keys(interfaceToObjMapping).filter((val) => {
|
|
1050
1067
|
selectedProps?.includes(interfaceToObjMapping[val]);
|
|
1051
|
-
}) : [...Object.values(interfaceToObjMapping), objectDef.primaryKeyApiName] :
|
|
1068
|
+
}) : [...Object.values(interfaceToObjMapping), objectDef.primaryKeyApiName] : void 0;
|
|
1052
1069
|
let objProps;
|
|
1053
1070
|
let conforming = true;
|
|
1054
1071
|
if (interfaceApiName && ifaceSelected) {
|
|
@@ -1063,11 +1080,10 @@ async function convertWireToOsdkObjects2(client, objects, interfaceApiName, forc
|
|
|
1063
1080
|
} else if (strictNonNull === "drop" && !conforming) {
|
|
1064
1081
|
continue;
|
|
1065
1082
|
}
|
|
1066
|
-
let osdkObject = createOsdkObject(client, objectDef, rawObj);
|
|
1083
|
+
let osdkObject = createOsdkObject(client, objectDef, rawObj, derivedPropertyTypeByName);
|
|
1067
1084
|
if (interfaceApiName) osdkObject = osdkObject.$as(interfaceApiName);
|
|
1068
1085
|
ret.push(osdkObject);
|
|
1069
1086
|
}
|
|
1070
|
-
client.logger?.debug(`END convertWireToOsdkObjects2()`);
|
|
1071
1087
|
return ret;
|
|
1072
1088
|
}
|
|
1073
1089
|
function convertInterfacePropNamesToObjectPropNames(objectDef, interfaceApiName, ifacePropsToMap) {
|
|
@@ -1079,7 +1095,7 @@ function reframeAsObjectInPlace(objectDef, interfaceApiName, rawObj) {
|
|
|
1079
1095
|
if (sptProp in rawObj) {
|
|
1080
1096
|
const value = rawObj[sptProp];
|
|
1081
1097
|
delete rawObj[sptProp];
|
|
1082
|
-
if (value !==
|
|
1098
|
+
if (value !== void 0) {
|
|
1083
1099
|
newProps[regularProp] = value;
|
|
1084
1100
|
}
|
|
1085
1101
|
}
|
|
@@ -1095,6 +1111,7 @@ function isConforming(client, def, obj, propsToCheck) {
|
|
|
1095
1111
|
if (process.env.NODE_ENV !== "production") {
|
|
1096
1112
|
client.logger?.debug({
|
|
1097
1113
|
obj: {
|
|
1114
|
+
$apiName: obj["$apiName"],
|
|
1098
1115
|
$objectType: obj["$objectType"],
|
|
1099
1116
|
$primaryKey: obj["$primaryKey"]
|
|
1100
1117
|
}
|
|
@@ -1129,10 +1146,6 @@ function fixObjectPropertiesInPlace(objs, forceRemoveRid) {
|
|
|
1129
1146
|
obj.$objectType = obj.$apiName;
|
|
1130
1147
|
obj.$primaryKey ??= obj.__primaryKey;
|
|
1131
1148
|
obj.$title ??= obj.__title;
|
|
1132
|
-
obj.$objectSpecifier = createObjectSpecifierFromPrimaryKey({
|
|
1133
|
-
apiName: obj.$apiName,
|
|
1134
|
-
type: "object"
|
|
1135
|
-
}, obj.$primaryKey);
|
|
1136
1149
|
delete obj.__apiName;
|
|
1137
1150
|
delete obj.__primaryKey;
|
|
1138
1151
|
delete obj.__title;
|
|
@@ -1147,7 +1160,7 @@ function createClientCache(fn) {
|
|
|
1147
1160
|
cache.set(client.clientCacheKey, /* @__PURE__ */ new Map());
|
|
1148
1161
|
}
|
|
1149
1162
|
let r = cache.get(client.clientCacheKey).get(key);
|
|
1150
|
-
if (r ===
|
|
1163
|
+
if (r === void 0 && fn !== void 0) {
|
|
1151
1164
|
return set(client, key, fn(client, key));
|
|
1152
1165
|
} else {
|
|
1153
1166
|
return r;
|
|
@@ -1195,27 +1208,29 @@ function createAsyncClientCache(fn, createCacheLocal = createClientCache) {
|
|
|
1195
1208
|
return ret;
|
|
1196
1209
|
}
|
|
1197
1210
|
async function loadActionMetadata(client, actionType) {
|
|
1198
|
-
const r = await
|
|
1211
|
+
const r = await chunkW5PFESFR_cjs.ActionTypeV2_exports.get(client, await client.ontologyRid, actionType);
|
|
1199
1212
|
return generatorConverters.wireActionTypeV2ToSdkActionMetadata(r);
|
|
1200
1213
|
}
|
|
1201
1214
|
async function loadFullObjectMetadata(client, objectType) {
|
|
1202
|
-
const full = await
|
|
1215
|
+
const full = await chunkW5PFESFR_cjs.ObjectTypeV2_exports.getFullMetadata(client, await client.ontologyRid, objectType, {
|
|
1203
1216
|
preview: true
|
|
1204
1217
|
});
|
|
1205
1218
|
const ret = generatorConverters.wireObjectTypeFullMetadataToSdkObjectMetadata(full, true);
|
|
1206
|
-
client.logger?.debug(`END loadFullObjectMetadata(${objectType})`);
|
|
1207
1219
|
return {
|
|
1208
1220
|
...ret
|
|
1209
1221
|
};
|
|
1210
1222
|
}
|
|
1211
1223
|
async function loadInterfaceMetadata(client, objectType) {
|
|
1212
|
-
const r = await
|
|
1224
|
+
const r = await chunkW5PFESFR_cjs.OntologyInterface_exports.get(client, await client.ontologyRid, objectType, {
|
|
1213
1225
|
preview: true
|
|
1214
1226
|
});
|
|
1215
1227
|
return generatorConverters.__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(r, true);
|
|
1216
1228
|
}
|
|
1217
|
-
async function loadQueryMetadata(client,
|
|
1218
|
-
const
|
|
1229
|
+
async function loadQueryMetadata(client, queryTypeApiNameAndVersion) {
|
|
1230
|
+
const [apiName, version] = queryTypeApiNameAndVersion.split(":");
|
|
1231
|
+
const r = await chunkW5PFESFR_cjs.QueryType_exports.get(client, await client.ontologyRid, apiName, {
|
|
1232
|
+
version
|
|
1233
|
+
});
|
|
1219
1234
|
return generatorConverters.wireQueryTypeV2ToSdkQueryMetadata(r);
|
|
1220
1235
|
}
|
|
1221
1236
|
|
|
@@ -1223,10 +1238,10 @@ async function loadQueryMetadata(client, queryType) {
|
|
|
1223
1238
|
var createStandardOntologyProviderFactory = (client) => {
|
|
1224
1239
|
return (client2) => {
|
|
1225
1240
|
async function loadObject(client3, key) {
|
|
1226
|
-
|
|
1241
|
+
const objectDef = await loadFullObjectMetadata(client3, key);
|
|
1227
1242
|
const interfaceDefs = Object.fromEntries((await Promise.all(objectDef.implements?.map((i) => ret.getInterfaceDefinition(i)) ?? [])).map((i) => [i.apiName, {
|
|
1228
1243
|
def: i,
|
|
1229
|
-
handler:
|
|
1244
|
+
handler: void 0
|
|
1230
1245
|
}]));
|
|
1231
1246
|
const fullObjectDef = {
|
|
1232
1247
|
...objectDef,
|
|
@@ -1238,8 +1253,7 @@ var createStandardOntologyProviderFactory = (client) => {
|
|
|
1238
1253
|
return loadInterfaceMetadata(client3, key);
|
|
1239
1254
|
}
|
|
1240
1255
|
async function loadQuery(client3, key) {
|
|
1241
|
-
|
|
1242
|
-
return r;
|
|
1256
|
+
return loadQueryMetadata(client3, key);
|
|
1243
1257
|
}
|
|
1244
1258
|
async function loadAction(client3, key) {
|
|
1245
1259
|
const r = await loadActionMetadata(client3, key);
|
|
@@ -1251,21 +1265,30 @@ var createStandardOntologyProviderFactory = (client) => {
|
|
|
1251
1265
|
return await cache.get(client2, apiName);
|
|
1252
1266
|
};
|
|
1253
1267
|
}
|
|
1268
|
+
function makeQueryGetter(client3, fn) {
|
|
1269
|
+
const queryCache = createAsyncClientCache((client4, key) => {
|
|
1270
|
+
return fn(client4, key);
|
|
1271
|
+
});
|
|
1272
|
+
return async (apiName, version) => {
|
|
1273
|
+
const key = version ? `${apiName}:${version}` : apiName;
|
|
1274
|
+
return await queryCache.get(client3, key);
|
|
1275
|
+
};
|
|
1276
|
+
}
|
|
1254
1277
|
const ret = {
|
|
1255
1278
|
getObjectDefinition: makeGetter(loadObject),
|
|
1256
1279
|
getInterfaceDefinition: makeGetter(loadInterface),
|
|
1257
|
-
|
|
1258
|
-
|
|
1280
|
+
getActionDefinition: makeGetter(loadAction),
|
|
1281
|
+
getQueryDefinition: makeQueryGetter(client2, loadQuery)
|
|
1259
1282
|
};
|
|
1260
1283
|
return ret;
|
|
1261
1284
|
};
|
|
1262
1285
|
};
|
|
1263
1286
|
|
|
1264
1287
|
// src/util/UserAgent.ts
|
|
1265
|
-
var USER_AGENT = `osdk-client/${"2.
|
|
1288
|
+
var USER_AGENT = `osdk-client/${"2.3.0-beta.1"}`;
|
|
1266
1289
|
|
|
1267
1290
|
// src/createMinimalClient.ts
|
|
1268
|
-
function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory =
|
|
1291
|
+
function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory = chunkFKI2LO2O_cjs.createObjectSet, createOntologyProviderFactory = createStandardOntologyProviderFactory) {
|
|
1269
1292
|
if (process.env.NODE_ENV !== "production") {
|
|
1270
1293
|
try {
|
|
1271
1294
|
new URL(baseUrl);
|
|
@@ -1287,7 +1310,7 @@ function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fet
|
|
|
1287
1310
|
requestContext: {}
|
|
1288
1311
|
};
|
|
1289
1312
|
return Object.freeze(Object.assign(minimalClient, {
|
|
1290
|
-
ontologyProvider:
|
|
1313
|
+
ontologyProvider: createOntologyProviderFactory(options)(minimalClient)
|
|
1291
1314
|
}));
|
|
1292
1315
|
}
|
|
1293
1316
|
|
|
@@ -1304,17 +1327,12 @@ var fetchMetadataInternal = async (client, definition) => {
|
|
|
1304
1327
|
} else if (definition.type === "action") {
|
|
1305
1328
|
return client.ontologyProvider.getActionDefinition(definition.apiName);
|
|
1306
1329
|
} else if (definition.type === "query") {
|
|
1307
|
-
return client.ontologyProvider.getQueryDefinition(definition.apiName);
|
|
1330
|
+
return client.ontologyProvider.getQueryDefinition(definition.apiName, definition.isFixedVersion ? definition.version : void 0);
|
|
1308
1331
|
} else {
|
|
1309
1332
|
throw new Error("Not implemented for given definition");
|
|
1310
1333
|
}
|
|
1311
1334
|
};
|
|
1312
1335
|
|
|
1313
|
-
// src/util/isOsdkBaseObject.ts
|
|
1314
|
-
function isOsdkBaseObject2(o) {
|
|
1315
|
-
return o && typeof o === "object" && typeof o.$apiName === "string" && o.$primaryKey != null;
|
|
1316
|
-
}
|
|
1317
|
-
|
|
1318
1336
|
// src/util/toDataValueQueries.ts
|
|
1319
1337
|
async function toDataValueQueries(value, client, desiredType) {
|
|
1320
1338
|
if (value == null) {
|
|
@@ -1335,13 +1353,13 @@ async function toDataValueQueries(value, client, desiredType) {
|
|
|
1335
1353
|
switch (desiredType.type) {
|
|
1336
1354
|
case "attachment": {
|
|
1337
1355
|
if (isAttachmentUpload(value)) {
|
|
1338
|
-
const attachment = await
|
|
1356
|
+
const attachment = await chunkW5PFESFR_cjs.Attachment_exports.upload(client, value.data, {
|
|
1339
1357
|
filename: value.name
|
|
1340
1358
|
});
|
|
1341
1359
|
return attachment.rid;
|
|
1342
1360
|
}
|
|
1343
1361
|
if (isAttachmentFile(value)) {
|
|
1344
|
-
const attachment = await
|
|
1362
|
+
const attachment = await chunkW5PFESFR_cjs.Attachment_exports.upload(client, value, {
|
|
1345
1363
|
filename: value.name
|
|
1346
1364
|
});
|
|
1347
1365
|
return attachment.rid;
|
|
@@ -1366,17 +1384,17 @@ async function toDataValueQueries(value, client, desiredType) {
|
|
|
1366
1384
|
break;
|
|
1367
1385
|
}
|
|
1368
1386
|
case "object": {
|
|
1369
|
-
if (
|
|
1387
|
+
if (isObjectSpecifiersObject(value)) {
|
|
1370
1388
|
return value.$primaryKey;
|
|
1371
1389
|
}
|
|
1372
1390
|
break;
|
|
1373
1391
|
}
|
|
1374
1392
|
case "objectSet": {
|
|
1375
|
-
if (
|
|
1393
|
+
if (chunkFKI2LO2O_cjs.isWireObjectSet(value)) {
|
|
1376
1394
|
return value;
|
|
1377
1395
|
}
|
|
1378
|
-
if (
|
|
1379
|
-
return
|
|
1396
|
+
if (chunkFKI2LO2O_cjs.isObjectSet(value)) {
|
|
1397
|
+
return chunkFKI2LO2O_cjs.getWireObjectSet(value);
|
|
1380
1398
|
}
|
|
1381
1399
|
break;
|
|
1382
1400
|
}
|
|
@@ -1385,7 +1403,7 @@ async function toDataValueQueries(value, client, desiredType) {
|
|
|
1385
1403
|
const entrySet = [];
|
|
1386
1404
|
for (const [key, mapValue] of Object.entries(value)) {
|
|
1387
1405
|
entrySet.push({
|
|
1388
|
-
key: desiredType.keyType.type === "object" ?
|
|
1406
|
+
key: desiredType.keyType.type === "object" ? extractPrimaryKeyFromObjectSpecifier(key) : await toDataValueQueries(key, client, desiredType.keyType),
|
|
1389
1407
|
value: await toDataValueQueries(mapValue, client, desiredType.valueType)
|
|
1390
1408
|
});
|
|
1391
1409
|
}
|
|
@@ -1414,17 +1432,16 @@ async function toDataValueQueries(value, client, desiredType) {
|
|
|
1414
1432
|
}
|
|
1415
1433
|
return value;
|
|
1416
1434
|
}
|
|
1417
|
-
function extractPrimaryKeyFromObjectIdentifier(a) {
|
|
1418
|
-
return a.substring(a.indexOf(":") + 1);
|
|
1419
|
-
}
|
|
1420
1435
|
|
|
1421
1436
|
// src/queries/applyQuery.ts
|
|
1422
1437
|
async function applyQuery(client, query, params) {
|
|
1423
|
-
const qd = await client.ontologyProvider.getQueryDefinition(query.apiName);
|
|
1424
|
-
const response = await
|
|
1438
|
+
const qd = await client.ontologyProvider.getQueryDefinition(query.apiName, query.isFixedVersion ? query.version : void 0);
|
|
1439
|
+
const response = await chunkW5PFESFR_cjs.Query_exports.execute(chunkW5PFESFR_cjs.addUserAgentAndRequestContextHeaders(chunkFKI2LO2O_cjs.augmentRequestContext(client, (_) => ({
|
|
1425
1440
|
finalMethodCall: "applyQuery"
|
|
1426
1441
|
})), query), await client.ontologyRid, query.apiName, {
|
|
1427
1442
|
parameters: params ? await remapQueryParams(params, client, qd.parameters) : {}
|
|
1443
|
+
}, {
|
|
1444
|
+
version: qd.version
|
|
1428
1445
|
});
|
|
1429
1446
|
const objectOutputDefs = await getRequiredDefinitions(qd.output, client);
|
|
1430
1447
|
const remappedResponse = await remapQueryResponse(client, qd.output, response.value, objectOutputDefs);
|
|
@@ -1440,7 +1457,7 @@ async function remapQueryParams(params, client, paramTypes) {
|
|
|
1440
1457
|
async function remapQueryResponse(client, responseDataType, responseValue, definitions) {
|
|
1441
1458
|
if (responseValue == null) {
|
|
1442
1459
|
if (responseDataType.nullable) {
|
|
1443
|
-
return
|
|
1460
|
+
return void 0;
|
|
1444
1461
|
} else {
|
|
1445
1462
|
throw new Error("Got null response when nullable was not allowed");
|
|
1446
1463
|
}
|
|
@@ -1466,11 +1483,11 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
1466
1483
|
return responseValue;
|
|
1467
1484
|
}
|
|
1468
1485
|
case "attachment": {
|
|
1469
|
-
return
|
|
1486
|
+
return chunkFKI2LO2O_cjs.hydrateAttachmentFromRidInternal(client, responseValue);
|
|
1470
1487
|
}
|
|
1471
1488
|
case "object": {
|
|
1472
1489
|
const def = definitions.get(responseDataType.object);
|
|
1473
|
-
if (!def) {
|
|
1490
|
+
if (!def || def.type !== "object") {
|
|
1474
1491
|
throw new Error(`Missing definition for ${responseDataType.object}`);
|
|
1475
1492
|
}
|
|
1476
1493
|
return createQueryObjectResponse(responseValue, def);
|
|
@@ -1481,7 +1498,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
1481
1498
|
throw new Error(`Missing definition for ${responseDataType.objectSet}`);
|
|
1482
1499
|
}
|
|
1483
1500
|
if (typeof responseValue === "string") {
|
|
1484
|
-
return
|
|
1501
|
+
return chunkFKI2LO2O_cjs.createObjectSet(def, client, {
|
|
1485
1502
|
type: "intersect",
|
|
1486
1503
|
objectSets: [{
|
|
1487
1504
|
type: "base",
|
|
@@ -1492,7 +1509,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
1492
1509
|
}]
|
|
1493
1510
|
});
|
|
1494
1511
|
}
|
|
1495
|
-
return
|
|
1512
|
+
return chunkFKI2LO2O_cjs.createObjectSet(def, client, responseValue);
|
|
1496
1513
|
}
|
|
1497
1514
|
case "struct": {
|
|
1498
1515
|
for (const [key, subtype] of Object.entries(responseDataType.struct)) {
|
|
@@ -1504,10 +1521,10 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
1504
1521
|
}
|
|
1505
1522
|
case "map": {
|
|
1506
1523
|
const map = {};
|
|
1507
|
-
!Array.isArray(responseValue) ? process.env.NODE_ENV !== "production" ? invariant__default.default(false, "Expected array entry") : invariant__default.default(false) :
|
|
1524
|
+
!Array.isArray(responseValue) ? process.env.NODE_ENV !== "production" ? invariant__default.default(false, "Expected array entry") : invariant__default.default(false) : void 0;
|
|
1508
1525
|
for (const entry of responseValue) {
|
|
1509
|
-
!entry.key ? process.env.NODE_ENV !== "production" ? invariant__default.default(false, "Expected key") : invariant__default.default(false) :
|
|
1510
|
-
!entry.value ? process.env.NODE_ENV !== "production" ? invariant__default.default(false, "Expected value") : invariant__default.default(false) :
|
|
1526
|
+
!entry.key ? process.env.NODE_ENV !== "production" ? invariant__default.default(false, "Expected key") : invariant__default.default(false) : void 0;
|
|
1527
|
+
!entry.value ? process.env.NODE_ENV !== "production" ? invariant__default.default(false, "Expected value") : invariant__default.default(false) : void 0;
|
|
1511
1528
|
const key = responseDataType.keyType.type === "object" ? getObjectSpecifier(entry.key, responseDataType.keyType.object, definitions) : entry.key;
|
|
1512
1529
|
const value = await remapQueryResponse(client, responseDataType.valueType, entry.value, definitions);
|
|
1513
1530
|
map[key] = value;
|
|
@@ -1617,7 +1634,7 @@ function requiresConversion(dataType) {
|
|
|
1617
1634
|
}
|
|
1618
1635
|
function getObjectSpecifier(primaryKey, objectTypeApiName, definitions) {
|
|
1619
1636
|
const def = definitions.get(objectTypeApiName);
|
|
1620
|
-
if (!def) {
|
|
1637
|
+
if (!def || def.type !== "object") {
|
|
1621
1638
|
throw new Error(`Missing definition for ${objectTypeApiName}`);
|
|
1622
1639
|
}
|
|
1623
1640
|
return createObjectSpecifierFromPrimaryKey(def, primaryKey);
|
|
@@ -1625,7 +1642,7 @@ function getObjectSpecifier(primaryKey, objectTypeApiName, definitions) {
|
|
|
1625
1642
|
function createQueryObjectResponse(primaryKey, objectDef) {
|
|
1626
1643
|
return {
|
|
1627
1644
|
$apiName: objectDef.apiName,
|
|
1628
|
-
$title:
|
|
1645
|
+
$title: void 0,
|
|
1629
1646
|
$objectType: objectDef.apiName,
|
|
1630
1647
|
$primaryKey: primaryKey,
|
|
1631
1648
|
$objectSpecifier: createObjectSpecifierFromPrimaryKey(objectDef, primaryKey)
|
|
@@ -1635,16 +1652,16 @@ function createQueryObjectResponse(primaryKey, objectDef) {
|
|
|
1635
1652
|
// src/createClient.ts
|
|
1636
1653
|
var ActionInvoker = class {
|
|
1637
1654
|
constructor(clientCtx, actionDef) {
|
|
1638
|
-
this.applyAction = applyAction.bind(
|
|
1639
|
-
this.batchApplyAction = applyAction.bind(
|
|
1655
|
+
this.applyAction = applyAction.bind(void 0, clientCtx, actionDef);
|
|
1656
|
+
this.batchApplyAction = applyAction.bind(void 0, clientCtx, actionDef);
|
|
1640
1657
|
}
|
|
1641
1658
|
};
|
|
1642
1659
|
var QueryInvoker = class {
|
|
1643
1660
|
constructor(clientCtx, queryDef) {
|
|
1644
|
-
this.executeFunction = applyQuery.bind(
|
|
1661
|
+
this.executeFunction = applyQuery.bind(void 0, clientCtx, queryDef);
|
|
1645
1662
|
}
|
|
1646
1663
|
};
|
|
1647
|
-
function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvider, options =
|
|
1664
|
+
function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvider, options = void 0, fetchFn = fetch) {
|
|
1648
1665
|
if (typeof ontologyRid === "string") {
|
|
1649
1666
|
if (!ontologyRid.startsWith("ri.")) {
|
|
1650
1667
|
throw new Error("Invalid ontology RID");
|
|
@@ -1658,7 +1675,10 @@ function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvi
|
|
|
1658
1675
|
}
|
|
1659
1676
|
const clientCtx = createMinimalClient({
|
|
1660
1677
|
ontologyRid
|
|
1661
|
-
}, baseUrl, tokenProvider,
|
|
1678
|
+
}, baseUrl, tokenProvider, {
|
|
1679
|
+
...options,
|
|
1680
|
+
logger: options?.logger ?? new chunkFKI2LO2O_cjs.MinimalLogger()
|
|
1681
|
+
}, fetchFn, objectSetFactory);
|
|
1662
1682
|
function clientFn(o) {
|
|
1663
1683
|
if (o.type === "object" || o.type === "interface") {
|
|
1664
1684
|
return objectSetFactory(o, clientCtx);
|
|
@@ -1675,7 +1695,7 @@ function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvi
|
|
|
1675
1695
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid.name:
|
|
1676
1696
|
return {
|
|
1677
1697
|
fetchOneByRid: async (objectType, rid, options2) => {
|
|
1678
|
-
return await
|
|
1698
|
+
return await chunkFKI2LO2O_cjs.fetchSingle(clientCtx, objectType, options2, createWithRid([rid]));
|
|
1679
1699
|
}
|
|
1680
1700
|
};
|
|
1681
1701
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference.name:
|
|
@@ -1687,7 +1707,7 @@ function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvi
|
|
|
1687
1707
|
objectType,
|
|
1688
1708
|
propertyType
|
|
1689
1709
|
} = args;
|
|
1690
|
-
return await
|
|
1710
|
+
return await chunkW5PFESFR_cjs.MediaReferenceProperty_exports.upload(clientCtx, await clientCtx.ontologyRid, objectType.apiName, propertyType, data, {
|
|
1691
1711
|
mediaItemPath: fileName,
|
|
1692
1712
|
preview: true
|
|
1693
1713
|
});
|
|
@@ -1696,7 +1716,7 @@ function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvi
|
|
|
1696
1716
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid.name:
|
|
1697
1717
|
return {
|
|
1698
1718
|
fetchPageByRid: async (objectOrInterfaceType, rids, options2 = {}) => {
|
|
1699
|
-
return await
|
|
1719
|
+
return await chunkW5PFESFR_cjs.fetchPage(clientCtx, objectOrInterfaceType, options2, createWithRid(rids));
|
|
1700
1720
|
}
|
|
1701
1721
|
};
|
|
1702
1722
|
}
|
|
@@ -1705,16 +1725,16 @@ function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvi
|
|
|
1705
1725
|
throw new Error("not implemented");
|
|
1706
1726
|
}
|
|
1707
1727
|
}
|
|
1708
|
-
const fetchMetadata = fetchMetadataInternal.bind(
|
|
1728
|
+
const fetchMetadata = fetchMetadataInternal.bind(void 0, clientCtx);
|
|
1709
1729
|
const symbolClientContext2 = "__osdkClientContext";
|
|
1710
1730
|
const client = Object.defineProperties(clientFn, {
|
|
1711
|
-
[
|
|
1731
|
+
[chunkW5PFESFR_cjs.symbolClientContext]: {
|
|
1712
1732
|
value: clientCtx
|
|
1713
1733
|
},
|
|
1714
1734
|
[symbolClientContext2]: {
|
|
1715
1735
|
value: clientCtx
|
|
1716
1736
|
},
|
|
1717
|
-
[
|
|
1737
|
+
[chunkW5PFESFR_cjs.additionalContext]: {
|
|
1718
1738
|
value: clientCtx
|
|
1719
1739
|
},
|
|
1720
1740
|
fetchMetadata: {
|
|
@@ -1723,7 +1743,7 @@ function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvi
|
|
|
1723
1743
|
});
|
|
1724
1744
|
return client;
|
|
1725
1745
|
}
|
|
1726
|
-
var createClient = createClientInternal.bind(
|
|
1746
|
+
var createClient = createClientInternal.bind(void 0, chunkFKI2LO2O_cjs.createObjectSet);
|
|
1727
1747
|
function createWithRid(rids) {
|
|
1728
1748
|
const withRid = {
|
|
1729
1749
|
type: "static",
|
|
@@ -1731,13 +1751,13 @@ function createWithRid(rids) {
|
|
|
1731
1751
|
};
|
|
1732
1752
|
return withRid;
|
|
1733
1753
|
}
|
|
1734
|
-
function createPlatformClient(baseUrl, tokenProvider, options =
|
|
1754
|
+
function createPlatformClient(baseUrl, tokenProvider, options = void 0, fetchFn = fetch) {
|
|
1735
1755
|
return shared_client_impl.createSharedClientContext(baseUrl, tokenProvider, USER_AGENT, fetchFn);
|
|
1736
1756
|
}
|
|
1737
1757
|
var isoRegex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})?$/;
|
|
1738
1758
|
var extractDate = (dateTime) => {
|
|
1739
|
-
!(dateTime.length < 33) ? process.env.NODE_ENV !== "production" ? invariant__default.default(false, "Invalid date format. Provided input is too long.") : invariant__default.default(false) :
|
|
1740
|
-
!isoRegex.test(dateTime) ? process.env.NODE_ENV !== "production" ? invariant__default.default(false, `Invalid date format. Expected ISO 8601 format, but received ${dateTime}`) : invariant__default.default(false) :
|
|
1759
|
+
!(dateTime.length < 33) ? process.env.NODE_ENV !== "production" ? invariant__default.default(false, "Invalid date format. Provided input is too long.") : invariant__default.default(false) : void 0;
|
|
1760
|
+
!isoRegex.test(dateTime) ? process.env.NODE_ENV !== "production" ? invariant__default.default(false, `Invalid date format. Expected ISO 8601 format, but received ${dateTime}`) : invariant__default.default(false) : void 0;
|
|
1741
1761
|
return extractDateFromIsoString(dateTime);
|
|
1742
1762
|
};
|
|
1743
1763
|
var extractDateInUTC = (date) => {
|
|
@@ -1765,7 +1785,6 @@ Object.defineProperty(exports, "PalantirApiError", {
|
|
|
1765
1785
|
exports.ActionValidationError = ActionValidationError;
|
|
1766
1786
|
exports.createAttachmentUpload = createAttachmentUpload;
|
|
1767
1787
|
exports.createClient = createClient;
|
|
1768
|
-
exports.createObjectSpecifierFromPrimaryKey = createObjectSpecifierFromPrimaryKey;
|
|
1769
1788
|
exports.createPlatformClient = createPlatformClient;
|
|
1770
1789
|
exports.extractDate = extractDate;
|
|
1771
1790
|
exports.extractDateInLocalTime = extractDateInLocalTime;
|