@osdk/client 2.2.0-beta.9 → 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 +370 -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.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/attachment.test.js +20 -7
- package/build/browser/object/attachment.test.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/BaseHolder.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 +44 -33
- package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/getDollarLink.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects.js +4 -14
- 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 +4 -3
- package/build/browser/object/fetchPage.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 +24 -20
- package/build/browser/objectSet/InterfaceObjectSet.test.js.map +1 -1
- package/build/browser/objectSet/ObjectSet.test.js +113 -19
- package/build/browser/objectSet/ObjectSet.test.js.map +1 -1
- package/build/browser/objectSet/ObjectSetListenerWebsocket.js +2 -2
- 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/internal/ActionApplication.js +4 -4
- 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/ListQuery.js +4 -1
- package/build/browser/observable/internal/ListQuery.js.map +1 -1
- package/build/browser/observable/internal/ObjectQuery.js +3 -6
- package/build/browser/observable/internal/ObjectQuery.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/Query.js.map +1 -1
- package/build/browser/observable/internal/Store.js +2 -2
- package/build/browser/observable/internal/Store.js.map +1 -1
- package/build/browser/observable/internal/Store.test.js +215 -206
- package/build/browser/observable/internal/Store.test.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/testUtils.js +4 -3
- 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-MCQVHD2F.cjs → chunk-FKI2LO2O.cjs} +232 -68
- package/build/cjs/chunk-FKI2LO2O.cjs.map +1 -0
- package/build/cjs/{chunk-EY52J5Z4.cjs → chunk-W5PFESFR.cjs} +163 -34
- package/build/cjs/chunk-W5PFESFR.cjs.map +1 -0
- package/build/cjs/index.cjs +188 -166
- 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 +224 -103
- package/build/cjs/public/unstable-do-not-use.cjs.map +1 -1
- package/build/cjs/public/unstable-do-not-use.d.cts +12 -3
- 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.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/attachment.test.js +20 -7
- package/build/esm/object/attachment.test.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/BaseHolder.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 +44 -33
- package/build/esm/object/convertWireToOsdkObjects/createOsdkObject.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/getDollarLink.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects.js +4 -14
- 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 +4 -3
- package/build/esm/object/fetchPage.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 +24 -20
- package/build/esm/objectSet/InterfaceObjectSet.test.js.map +1 -1
- package/build/esm/objectSet/ObjectSet.test.js +113 -19
- package/build/esm/objectSet/ObjectSet.test.js.map +1 -1
- package/build/esm/objectSet/ObjectSetListenerWebsocket.js +2 -2
- 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/internal/ActionApplication.js +4 -4
- 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/ListQuery.js +4 -1
- package/build/esm/observable/internal/ListQuery.js.map +1 -1
- package/build/esm/observable/internal/ObjectQuery.js +3 -6
- package/build/esm/observable/internal/ObjectQuery.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/Query.js.map +1 -1
- package/build/esm/observable/internal/Store.js +2 -2
- package/build/esm/observable/internal/Store.js.map +1 -1
- package/build/esm/observable/internal/Store.test.js +215 -206
- package/build/esm/observable/internal/Store.test.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/testUtils.js +4 -3
- 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/convertWireToOsdkObjects.d.ts +4 -4
- 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/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/ListQuery.d.ts.map +1 -1
- package/build/types/observable/internal/ObjectQuery.d.ts.map +1 -1
- package/build/types/observable/internal/OptimisticJob.d.ts.map +1 -1
- package/build/types/observable/internal/Query.d.ts +2 -2
- package/build/types/observable/internal/Query.d.ts.map +1 -1
- package/build/types/observable/internal/Store.d.ts +2 -2
- package/build/types/observable/internal/Store.d.ts.map +1 -1
- package/build/types/observable/internal/testUtils.d.ts +1 -2
- 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 -2
- 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 +19 -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/util/isOsdkBaseObject.js.map +0 -1
- package/build/browser/util/isOsdkObject.js.map +0 -1
- package/build/cjs/chunk-EY52J5Z4.cjs.map +0 -1
- package/build/cjs/chunk-MCQVHD2F.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/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/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,9 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkFKI2LO2O_cjs = require('./chunk-FKI2LO2O.cjs');
|
|
4
4
|
var chunkT4NIFYZS_cjs = require('./chunk-T4NIFYZS.cjs');
|
|
5
|
-
var
|
|
6
|
-
require('./chunk-Q7SFCCGT.cjs');
|
|
5
|
+
var chunkW5PFESFR_cjs = require('./chunk-W5PFESFR.cjs');
|
|
7
6
|
var api = require('@osdk/api');
|
|
8
7
|
var shared_net_errors = require('@osdk/shared.net.errors');
|
|
9
8
|
var unstable = require('@osdk/api/unstable');
|
|
@@ -19,7 +18,7 @@ var invariant__default = /*#__PURE__*/_interopDefault(invariant);
|
|
|
19
18
|
// src/actions/ActionValidationError.ts
|
|
20
19
|
var ActionValidationError = class extends Error {
|
|
21
20
|
constructor(validation) {
|
|
22
|
-
super("Validation Error");
|
|
21
|
+
super("Validation Error: " + JSON.stringify(validation, null, 2));
|
|
23
22
|
this.validation = validation;
|
|
24
23
|
}
|
|
25
24
|
};
|
|
@@ -56,7 +55,7 @@ function applyPageToken(payload, {
|
|
|
56
55
|
return pageToken ? {
|
|
57
56
|
...payload,
|
|
58
57
|
pageToken
|
|
59
|
-
} :
|
|
58
|
+
} : void 0;
|
|
60
59
|
}
|
|
61
60
|
async function* pageRequestAsAsyncIter(call, values, nextArgs, initialPayload) {
|
|
62
61
|
let payload = initialPayload;
|
|
@@ -73,7 +72,7 @@ async function* pageRequestAsAsyncIter(call, values, nextArgs, initialPayload) {
|
|
|
73
72
|
function createSimpleCache(map = /* @__PURE__ */ new Map(), fn) {
|
|
74
73
|
function get(key) {
|
|
75
74
|
let r = map.get(key);
|
|
76
|
-
if (r ===
|
|
75
|
+
if (r === void 0 && fn !== void 0) {
|
|
77
76
|
return set(key, fn(key));
|
|
78
77
|
} else {
|
|
79
78
|
return r;
|
|
@@ -121,7 +120,7 @@ function createSimpleAsyncCache(type, fn, createCacheLocal = createSimpleCache)
|
|
|
121
120
|
var cachedAllOntologies;
|
|
122
121
|
async function getOntologyVersionForRid(ctx, ontologyRid) {
|
|
123
122
|
cachedAllOntologies ??= await client_unstable.loadAllOntologies(ctx, {});
|
|
124
|
-
!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;
|
|
125
124
|
return cachedAllOntologies.ontologies[ontologyRid].currentOntologyVersion;
|
|
126
125
|
}
|
|
127
126
|
var strongMemoAsync = (fn) => createSimpleAsyncCache("strong", fn).get;
|
|
@@ -163,7 +162,7 @@ var MetadataClient = class {
|
|
|
163
162
|
[objectTypeRid]: await this.ontologyVersion("")
|
|
164
163
|
}
|
|
165
164
|
});
|
|
166
|
-
!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;
|
|
167
166
|
const ret = {};
|
|
168
167
|
for (const l of linkTypes.linkTypes[objectTypeRid]) {
|
|
169
168
|
const helper = ({
|
|
@@ -233,22 +232,22 @@ var MetadataClient = class {
|
|
|
233
232
|
interfaceTypes: [],
|
|
234
233
|
typeGroups: [],
|
|
235
234
|
loadRedacted: false,
|
|
236
|
-
includeObjectTypeCount:
|
|
235
|
+
includeObjectTypeCount: void 0,
|
|
237
236
|
includeObjectTypesWithoutSearchableDatasources: true,
|
|
238
|
-
includeEntityMetadata:
|
|
237
|
+
includeEntityMetadata: void 0,
|
|
239
238
|
actionTypes: [],
|
|
240
|
-
includeTypeGroupEntitiesCount:
|
|
241
|
-
entityMetadata:
|
|
239
|
+
includeTypeGroupEntitiesCount: void 0,
|
|
240
|
+
entityMetadata: void 0
|
|
242
241
|
};
|
|
243
|
-
const entities = await client_unstable.bulkLoadOntologyEntities(this.#ctx,
|
|
244
|
-
!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;
|
|
245
244
|
return entities.objectTypes[0].objectType;
|
|
246
245
|
});
|
|
247
246
|
ontologyVersion = strongMemoAsync(async (_) => getOntologyVersionForRid(this.#ctx, await this.#client.ontologyRid));
|
|
248
247
|
};
|
|
249
248
|
var metadataCacheClient = weakMemoAsync((client) => Promise.resolve(new MetadataClient(client)));
|
|
250
249
|
function createObjectPropertyMapping(conjureOT) {
|
|
251
|
-
!(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;
|
|
252
251
|
const pkRid = conjureOT.primaryKeys[0];
|
|
253
252
|
const pkProperty = Object.values(conjureOT.propertyTypes).find((a) => a.rid === pkRid);
|
|
254
253
|
if (!pkProperty) {
|
|
@@ -280,7 +279,7 @@ function createBulkLinksAsyncIterFactory(ctx) {
|
|
|
280
279
|
return;
|
|
281
280
|
}
|
|
282
281
|
ctx.logger?.debug("Preparing to fetch bulk links");
|
|
283
|
-
!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;
|
|
284
283
|
const mcc = await metadataCacheClient(ctx);
|
|
285
284
|
const helper = await mcc.forObjectByApiName(objs[0].$objectType);
|
|
286
285
|
const [objectTypeRid, propertyMapping, fullLinkMapping] = await Promise.all([helper.getRid(), helper.getPropertyMapping(), helper.getLinkMapping()]);
|
|
@@ -292,21 +291,21 @@ function createBulkLinksAsyncIterFactory(ctx) {
|
|
|
292
291
|
}
|
|
293
292
|
const req = {
|
|
294
293
|
objectSetContext: {
|
|
295
|
-
forkRid:
|
|
294
|
+
forkRid: void 0,
|
|
296
295
|
objectSetFilterContext: {
|
|
297
296
|
parameterOverrides: {}
|
|
298
297
|
},
|
|
299
|
-
ontologyBranchRid:
|
|
300
|
-
owningRid:
|
|
301
|
-
reportUsage:
|
|
302
|
-
workstateRid:
|
|
298
|
+
ontologyBranchRid: void 0,
|
|
299
|
+
owningRid: void 0,
|
|
300
|
+
reportUsage: void 0,
|
|
301
|
+
workstateRid: void 0
|
|
303
302
|
},
|
|
304
303
|
responseOptions: {
|
|
305
304
|
includeObjectSetEntities: true,
|
|
306
305
|
includeUsageCost: false
|
|
307
306
|
},
|
|
308
307
|
pageSize: 1e3,
|
|
309
|
-
pageToken:
|
|
308
|
+
pageToken: void 0,
|
|
310
309
|
linksRequests: [{
|
|
311
310
|
directedLinkTypes: Object.values(linkMapping).map(({
|
|
312
311
|
directedLinkTypeRid
|
|
@@ -319,7 +318,7 @@ function createBulkLinksAsyncIterFactory(ctx) {
|
|
|
319
318
|
})))
|
|
320
319
|
}]
|
|
321
320
|
};
|
|
322
|
-
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);
|
|
323
322
|
for await (const item of bulkLinksIter) {
|
|
324
323
|
const {
|
|
325
324
|
objectIdentifier
|
|
@@ -389,14 +388,19 @@ function isInterfaceActionParam(o) {
|
|
|
389
388
|
return o != null && typeof o === "object" && "$objectType" in o && "$primaryKey" in o;
|
|
390
389
|
}
|
|
391
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
|
+
|
|
392
396
|
// src/util/isOntologyObjectV2.ts
|
|
393
397
|
function isOntologyObjectV2(o) {
|
|
394
398
|
return o && typeof o === "object" && typeof o.__apiName === "string" && o.__primaryKey != null;
|
|
395
399
|
}
|
|
396
400
|
|
|
397
|
-
// src/util/
|
|
398
|
-
function
|
|
399
|
-
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;
|
|
400
404
|
}
|
|
401
405
|
|
|
402
406
|
// src/util/toDataValue.ts
|
|
@@ -417,13 +421,13 @@ async function toDataValue(value, client) {
|
|
|
417
421
|
return Promise.all(promiseArray);
|
|
418
422
|
}
|
|
419
423
|
if (isAttachmentUpload(value)) {
|
|
420
|
-
const attachment = await
|
|
424
|
+
const attachment = await chunkW5PFESFR_cjs.Attachment_exports.upload(client, value.data, {
|
|
421
425
|
filename: value.name
|
|
422
426
|
});
|
|
423
427
|
return await toDataValue(attachment.rid, client);
|
|
424
428
|
}
|
|
425
429
|
if (isAttachmentFile(value)) {
|
|
426
|
-
const attachment = await
|
|
430
|
+
const attachment = await chunkW5PFESFR_cjs.Attachment_exports.upload(client, value, {
|
|
427
431
|
filename: value.name
|
|
428
432
|
});
|
|
429
433
|
return await toDataValue(attachment.rid, client);
|
|
@@ -431,14 +435,17 @@ async function toDataValue(value, client) {
|
|
|
431
435
|
if (isOntologyObjectV2(value)) {
|
|
432
436
|
return await toDataValue(value.__primaryKey, client);
|
|
433
437
|
}
|
|
434
|
-
if (
|
|
438
|
+
if (isObjectSpecifiersObject(value)) {
|
|
435
439
|
return await toDataValue(value.$primaryKey, client);
|
|
436
440
|
}
|
|
437
|
-
if (
|
|
441
|
+
if (isPoint(value)) {
|
|
442
|
+
return await toDataValue(value.coordinates.join(), client);
|
|
443
|
+
}
|
|
444
|
+
if (chunkFKI2LO2O_cjs.isWireObjectSet(value)) {
|
|
438
445
|
return value;
|
|
439
446
|
}
|
|
440
|
-
if (
|
|
441
|
-
return
|
|
447
|
+
if (chunkFKI2LO2O_cjs.isObjectSet(value)) {
|
|
448
|
+
return chunkFKI2LO2O_cjs.getWireObjectSet(value);
|
|
442
449
|
}
|
|
443
450
|
if (isMediaReference(value)) {
|
|
444
451
|
return value;
|
|
@@ -461,20 +468,20 @@ async function toDataValue(value, client) {
|
|
|
461
468
|
|
|
462
469
|
// src/actions/applyAction.ts
|
|
463
470
|
async function applyAction(client, action, parameters, options = {}) {
|
|
464
|
-
const clientWithHeaders =
|
|
471
|
+
const clientWithHeaders = chunkW5PFESFR_cjs.addUserAgentAndRequestContextHeaders(chunkFKI2LO2O_cjs.augmentRequestContext(client, (_) => ({
|
|
465
472
|
finalMethodCall: "applyAction"
|
|
466
473
|
})), action);
|
|
467
474
|
if (Array.isArray(parameters)) {
|
|
468
|
-
const response = await
|
|
475
|
+
const response = await chunkW5PFESFR_cjs.Action_exports.applyBatch(clientWithHeaders, await client.ontologyRid, action.apiName, {
|
|
469
476
|
requests: parameters ? await remapBatchActionParams(parameters, client) : [],
|
|
470
477
|
options: {
|
|
471
478
|
returnEdits: options?.$returnEdits ? "ALL" : "NONE"
|
|
472
479
|
}
|
|
473
480
|
});
|
|
474
481
|
const edits = response.edits;
|
|
475
|
-
return options?.$returnEdits ? edits?.type === "edits" ? remapActionResponse(response) : edits :
|
|
482
|
+
return options?.$returnEdits ? edits?.type === "edits" ? remapActionResponse(response) : edits : void 0;
|
|
476
483
|
} else {
|
|
477
|
-
const response = await
|
|
484
|
+
const response = await chunkW5PFESFR_cjs.Action_exports.apply(clientWithHeaders, await client.ontologyRid, action.apiName, {
|
|
478
485
|
parameters: await remapActionParams(parameters, client),
|
|
479
486
|
options: {
|
|
480
487
|
mode: options?.$validateOnly ? "VALIDATE_ONLY" : "VALIDATE_AND_EXECUTE",
|
|
@@ -488,7 +495,7 @@ async function applyAction(client, action, parameters, options = {}) {
|
|
|
488
495
|
throw new ActionValidationError(response.validation);
|
|
489
496
|
}
|
|
490
497
|
const edits = response.edits;
|
|
491
|
-
return options?.$returnEdits ? edits?.type === "edits" ? remapActionResponse(response) : edits :
|
|
498
|
+
return options?.$returnEdits ? edits?.type === "edits" ? remapActionResponse(response) : edits : void 0;
|
|
492
499
|
}
|
|
493
500
|
}
|
|
494
501
|
async function remapActionParams(params, client) {
|
|
@@ -678,7 +685,7 @@ var GeotimeSeriesPropertyImpl = class {
|
|
|
678
685
|
}
|
|
679
686
|
}
|
|
680
687
|
async getLatestValue() {
|
|
681
|
-
const latestPointPromise =
|
|
688
|
+
const latestPointPromise = chunkW5PFESFR_cjs.TimeSeriesValueBankProperty_exports.getLatestValue(this.#client, await this.#client.ontologyRid, ...this.#triplet);
|
|
682
689
|
latestPointPromise.then(
|
|
683
690
|
(latestPoint) => this.lastFetchedValue = latestPoint,
|
|
684
691
|
// eslint-disable-next-line no-console
|
|
@@ -694,7 +701,7 @@ var GeotimeSeriesPropertyImpl = class {
|
|
|
694
701
|
return allPoints;
|
|
695
702
|
}
|
|
696
703
|
async *asyncIterValues(query) {
|
|
697
|
-
const streamPointsIterator = await
|
|
704
|
+
const streamPointsIterator = await chunkW5PFESFR_cjs.TimeSeriesValueBankProperty_exports.streamValues(this.#client, await this.#client.ontologyRid, ...this.#triplet, query ? {
|
|
698
705
|
range: getTimeRange(query)
|
|
699
706
|
} : {});
|
|
700
707
|
for await (const timeseriesPoint of asyncIterPointsHelper(streamPointsIterator)) {
|
|
@@ -718,13 +725,13 @@ var MediaReferencePropertyImpl = class {
|
|
|
718
725
|
this.#triplet = [objectApiName, primaryKey, propertyName];
|
|
719
726
|
}
|
|
720
727
|
async fetchContents() {
|
|
721
|
-
return
|
|
728
|
+
return chunkW5PFESFR_cjs.MediaReferenceProperty_exports.getMediaContent(this.#client, await this.#client.ontologyRid, ...this.#triplet, {
|
|
722
729
|
preview: true
|
|
723
730
|
// TODO: Can turn this back off when backend is no longer in beta.
|
|
724
731
|
});
|
|
725
732
|
}
|
|
726
733
|
async fetchMetadata() {
|
|
727
|
-
const r = await
|
|
734
|
+
const r = await chunkW5PFESFR_cjs.MediaReferenceProperty_exports.getMediaMetadata(this.#client, await this.#client.ontologyRid, ...this.#triplet, {
|
|
728
735
|
preview: true
|
|
729
736
|
// TODO: Can turn this back off when backend is no longer in beta.
|
|
730
737
|
});
|
|
@@ -745,10 +752,10 @@ var TimeSeriesPropertyImpl = class {
|
|
|
745
752
|
this.#triplet = [objectApiName, primaryKey, propertyName];
|
|
746
753
|
}
|
|
747
754
|
async getFirstPoint() {
|
|
748
|
-
return
|
|
755
|
+
return chunkW5PFESFR_cjs.TimeSeriesPropertyV2_exports.getFirstPoint(this.#client, await this.#client.ontologyRid, ...this.#triplet);
|
|
749
756
|
}
|
|
750
757
|
async getLastPoint() {
|
|
751
|
-
return
|
|
758
|
+
return chunkW5PFESFR_cjs.TimeSeriesPropertyV2_exports.getLastPoint(this.#client, await this.#client.ontologyRid, ...this.#triplet);
|
|
752
759
|
}
|
|
753
760
|
async getAllPoints(query) {
|
|
754
761
|
const allPoints = [];
|
|
@@ -758,7 +765,7 @@ var TimeSeriesPropertyImpl = class {
|
|
|
758
765
|
return allPoints;
|
|
759
766
|
}
|
|
760
767
|
async *asyncIterPoints(query) {
|
|
761
|
-
const streamPointsIterator = await
|
|
768
|
+
const streamPointsIterator = await chunkW5PFESFR_cjs.TimeSeriesPropertyV2_exports.streamPoints(this.#client, await this.#client.ontologyRid, ...this.#triplet, query ? {
|
|
762
769
|
range: getTimeRange(query)
|
|
763
770
|
} : {});
|
|
764
771
|
for await (const timeseriesPoint of asyncIterPointsHelper(streamPointsIterator)) {
|
|
@@ -767,12 +774,20 @@ var TimeSeriesPropertyImpl = class {
|
|
|
767
774
|
}
|
|
768
775
|
};
|
|
769
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
|
+
|
|
770
785
|
// src/ontology/OntologyProvider.ts
|
|
771
786
|
var InterfaceDefinitions = Symbol("InterfaceDefinitions" );
|
|
772
787
|
|
|
773
788
|
// src/object/convertWireToOsdkObjects/createOsdkInterface.ts
|
|
774
789
|
function createOsdkInterface(underlying, interfaceDef) {
|
|
775
|
-
const [objApiNamespace] =
|
|
790
|
+
const [objApiNamespace] = chunkFKI2LO2O_cjs.extractNamespace(interfaceDef.apiName);
|
|
776
791
|
return Object.freeze(Object.defineProperties({}, {
|
|
777
792
|
// first to minimize hidden classes
|
|
778
793
|
[chunkT4NIFYZS_cjs.UnderlyingOsdkObject]: {
|
|
@@ -794,6 +809,10 @@ function createOsdkInterface(underlying, interfaceDef) {
|
|
|
794
809
|
value: underlying.$primaryKey,
|
|
795
810
|
enumerable: "$primaryKey" in underlying
|
|
796
811
|
},
|
|
812
|
+
"$objectSpecifier": {
|
|
813
|
+
value: underlying.$objectSpecifier,
|
|
814
|
+
enumerable: "$objectSpecifier" in underlying
|
|
815
|
+
},
|
|
797
816
|
"$title": {
|
|
798
817
|
value: underlying.$title,
|
|
799
818
|
enumerable: "$title" in underlying
|
|
@@ -811,7 +830,7 @@ function createOsdkInterface(underlying, interfaceDef) {
|
|
|
811
830
|
},
|
|
812
831
|
...Object.fromEntries(Object.keys(interfaceDef.properties).map((p) => {
|
|
813
832
|
const objDef = underlying[chunkT4NIFYZS_cjs.ObjectDefRef];
|
|
814
|
-
const [apiNamespace, apiName] =
|
|
833
|
+
const [apiNamespace, apiName] = chunkFKI2LO2O_cjs.extractNamespace(p);
|
|
815
834
|
const targetPropName = objDef.interfaceMap[interfaceDef.apiName][p];
|
|
816
835
|
return [apiNamespace === objApiNamespace ? apiName : p, {
|
|
817
836
|
enumerable: targetPropName in underlying,
|
|
@@ -887,8 +906,8 @@ function get$link(holder) {
|
|
|
887
906
|
[objDef.primaryKeyApiName]: rawObj.$primaryKey
|
|
888
907
|
}).pivotTo(linkName);
|
|
889
908
|
const value = !linkDef.multiplicity ? {
|
|
890
|
-
fetchOne: (options) =>
|
|
891
|
-
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))
|
|
892
911
|
} : objectSet;
|
|
893
912
|
return [linkName, value];
|
|
894
913
|
})));
|
|
@@ -928,9 +947,16 @@ var basePropDefs = {
|
|
|
928
947
|
};
|
|
929
948
|
return createOsdkObject(this[chunkT4NIFYZS_cjs.ClientRef], this[chunkT4NIFYZS_cjs.ObjectDefRef], newObject);
|
|
930
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
|
|
931
957
|
}
|
|
932
958
|
};
|
|
933
|
-
function createOsdkObject(client, objectDef, simpleOsdkProperties) {
|
|
959
|
+
function createOsdkObject(client, objectDef, simpleOsdkProperties, derivedPropertyTypeByName = {}) {
|
|
934
960
|
const rawObj = simpleOsdkProperties;
|
|
935
961
|
Object.defineProperties(rawObj, {
|
|
936
962
|
[chunkT4NIFYZS_cjs.UnderlyingOsdkObject]: {
|
|
@@ -950,6 +976,17 @@ function createOsdkObject(client, objectDef, simpleOsdkProperties) {
|
|
|
950
976
|
for (const propKey of Object.keys(rawObj)) {
|
|
951
977
|
if (propKey in objectDef.properties && typeof objectDef.properties[propKey].type === "string" && specialPropertyTypes.has(objectDef.properties[propKey].type)) {
|
|
952
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
|
+
}
|
|
953
990
|
}
|
|
954
991
|
}
|
|
955
992
|
return Object.freeze(rawObj);
|
|
@@ -958,59 +995,45 @@ function createSpecialProperty(client, objectDef, rawObject, p) {
|
|
|
958
995
|
const rawValue = rawObject[p];
|
|
959
996
|
const propDef = objectDef.properties[p];
|
|
960
997
|
if (process.env.NODE_ENV !== "production") {
|
|
961
|
-
!(propDef != null && typeof propDef.type === "string" && specialPropertyTypes.has(propDef.type)) ? process.env.NODE_ENV !== "production" ? invariant__default.default(false) : invariant__default.default(false) :
|
|
962
|
-
}
|
|
963
|
-
{
|
|
964
|
-
{
|
|
965
|
-
|
|
966
|
-
{
|
|
967
|
-
if (propDef.type === "attachment") {
|
|
968
|
-
if (Array.isArray(rawValue)) {
|
|
969
|
-
return rawValue.map((a) => chunkMCQVHD2F_cjs.hydrateAttachmentFromRidInternal(client, a.rid));
|
|
970
|
-
}
|
|
971
|
-
return chunkMCQVHD2F_cjs.hydrateAttachmentFromRidInternal(client, rawValue.rid);
|
|
972
|
-
}
|
|
973
|
-
if (propDef.type === "numericTimeseries" || propDef.type === "stringTimeseries" || propDef.type === "sensorTimeseries") {
|
|
974
|
-
return new TimeSeriesPropertyImpl(client, objectDef.apiName, rawObject[objectDef.primaryKeyApiName], p);
|
|
975
|
-
}
|
|
976
|
-
if (propDef.type === "geotimeSeriesReference") {
|
|
977
|
-
return new GeotimeSeriesPropertyImpl(client, objectDef.apiName, rawObject[objectDef.primaryKeyApiName], p, rawValue.type === "geotimeSeriesValue" ? {
|
|
978
|
-
time: rawValue.timestamp,
|
|
979
|
-
value: {
|
|
980
|
-
type: "Point",
|
|
981
|
-
coordinates: rawValue.position
|
|
982
|
-
}
|
|
983
|
-
} : undefined);
|
|
984
|
-
}
|
|
985
|
-
if (propDef.type === "mediaReference") {
|
|
986
|
-
return new MediaReferencePropertyImpl({
|
|
987
|
-
client,
|
|
988
|
-
objectApiName: objectDef.apiName,
|
|
989
|
-
primaryKey: rawObject[objectDef.primaryKeyApiName],
|
|
990
|
-
propertyName: p
|
|
991
|
-
});
|
|
992
|
-
}
|
|
993
|
-
}
|
|
994
|
-
}
|
|
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));
|
|
995
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
|
+
});
|
|
996
1025
|
}
|
|
997
|
-
}
|
|
998
|
-
|
|
999
|
-
// src/object/createObjectSpecifierFromPrimaryKey.ts
|
|
1000
|
-
function createObjectSpecifierFromPrimaryKey(def, primaryKey) {
|
|
1001
|
-
return `${def.apiName}:${primaryKey}`;
|
|
1002
1026
|
}
|
|
1003
1027
|
|
|
1004
1028
|
// src/object/convertWireToOsdkObjects.ts
|
|
1005
|
-
async function convertWireToOsdkObjects(client, objects, interfaceApiName, forceRemoveRid = false, selectedProps, strictNonNull = false) {
|
|
1006
|
-
client.logger?.debug(`START convertWireToOsdkObjects()`);
|
|
1029
|
+
async function convertWireToOsdkObjects(client, objects, interfaceApiName, forceRemoveRid = false, derivedPropertyTypesByName, selectedProps, strictNonNull = false) {
|
|
1007
1030
|
fixObjectPropertiesInPlace(objects, forceRemoveRid);
|
|
1008
|
-
const ifaceDef = interfaceApiName ? await client.ontologyProvider.getInterfaceDefinition(interfaceApiName) :
|
|
1009
|
-
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;
|
|
1010
1033
|
const ret = [];
|
|
1011
1034
|
for (const rawObj of objects) {
|
|
1012
1035
|
const objectDef = await client.ontologyProvider.getObjectDefinition(rawObj.$apiName);
|
|
1013
|
-
!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;
|
|
1014
1037
|
let objProps;
|
|
1015
1038
|
let conforming = true;
|
|
1016
1039
|
if (ifaceDef && ifaceSelected) {
|
|
@@ -1027,24 +1050,22 @@ async function convertWireToOsdkObjects(client, objects, interfaceApiName, force
|
|
|
1027
1050
|
} else if (strictNonNull === "drop" && !conforming) {
|
|
1028
1051
|
continue;
|
|
1029
1052
|
}
|
|
1030
|
-
let osdkObject = createOsdkObject(client, objectDef, rawObj);
|
|
1053
|
+
let osdkObject = createOsdkObject(client, objectDef, rawObj, derivedPropertyTypesByName);
|
|
1031
1054
|
if (interfaceApiName) osdkObject = osdkObject.$as(interfaceApiName);
|
|
1032
1055
|
ret.push(osdkObject);
|
|
1033
1056
|
}
|
|
1034
|
-
client.logger?.debug(`END convertWireToOsdkObjects()`);
|
|
1035
1057
|
return ret;
|
|
1036
1058
|
}
|
|
1037
|
-
async function convertWireToOsdkObjects2(client, objects, interfaceApiName, forceRemoveRid = false, selectedProps, strictNonNull = false, interfaceToObjectTypeMappings = {}) {
|
|
1038
|
-
client.logger?.debug(`START convertWireToOsdkObjects2()`);
|
|
1059
|
+
async function convertWireToOsdkObjects2(client, objects, interfaceApiName, derivedPropertyTypeByName, forceRemoveRid = false, selectedProps, strictNonNull = false, interfaceToObjectTypeMappings = {}) {
|
|
1039
1060
|
fixObjectPropertiesInPlace(objects, forceRemoveRid);
|
|
1040
1061
|
const ret = [];
|
|
1041
1062
|
for (const rawObj of objects) {
|
|
1042
1063
|
const objectDef = await client.ontologyProvider.getObjectDefinition(rawObj.$apiName);
|
|
1043
|
-
!objectDef ? process.env.NODE_ENV !== "production" ? invariant__default.default(false, `Missing definition for '${rawObj.$apiName}'`) : invariant__default.default(false) :
|
|
1044
|
-
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;
|
|
1045
1066
|
const ifaceSelected = interfaceApiName && interfaceToObjMapping ? selectedProps ? Object.keys(interfaceToObjMapping).filter((val) => {
|
|
1046
1067
|
selectedProps?.includes(interfaceToObjMapping[val]);
|
|
1047
|
-
}) : [...Object.values(interfaceToObjMapping), objectDef.primaryKeyApiName] :
|
|
1068
|
+
}) : [...Object.values(interfaceToObjMapping), objectDef.primaryKeyApiName] : void 0;
|
|
1048
1069
|
let objProps;
|
|
1049
1070
|
let conforming = true;
|
|
1050
1071
|
if (interfaceApiName && ifaceSelected) {
|
|
@@ -1059,11 +1080,10 @@ async function convertWireToOsdkObjects2(client, objects, interfaceApiName, forc
|
|
|
1059
1080
|
} else if (strictNonNull === "drop" && !conforming) {
|
|
1060
1081
|
continue;
|
|
1061
1082
|
}
|
|
1062
|
-
let osdkObject = createOsdkObject(client, objectDef, rawObj);
|
|
1083
|
+
let osdkObject = createOsdkObject(client, objectDef, rawObj, derivedPropertyTypeByName);
|
|
1063
1084
|
if (interfaceApiName) osdkObject = osdkObject.$as(interfaceApiName);
|
|
1064
1085
|
ret.push(osdkObject);
|
|
1065
1086
|
}
|
|
1066
|
-
client.logger?.debug(`END convertWireToOsdkObjects2()`);
|
|
1067
1087
|
return ret;
|
|
1068
1088
|
}
|
|
1069
1089
|
function convertInterfacePropNamesToObjectPropNames(objectDef, interfaceApiName, ifacePropsToMap) {
|
|
@@ -1075,7 +1095,7 @@ function reframeAsObjectInPlace(objectDef, interfaceApiName, rawObj) {
|
|
|
1075
1095
|
if (sptProp in rawObj) {
|
|
1076
1096
|
const value = rawObj[sptProp];
|
|
1077
1097
|
delete rawObj[sptProp];
|
|
1078
|
-
if (value !==
|
|
1098
|
+
if (value !== void 0) {
|
|
1079
1099
|
newProps[regularProp] = value;
|
|
1080
1100
|
}
|
|
1081
1101
|
}
|
|
@@ -1126,10 +1146,6 @@ function fixObjectPropertiesInPlace(objs, forceRemoveRid) {
|
|
|
1126
1146
|
obj.$objectType = obj.$apiName;
|
|
1127
1147
|
obj.$primaryKey ??= obj.__primaryKey;
|
|
1128
1148
|
obj.$title ??= obj.__title;
|
|
1129
|
-
obj.$objectSpecifier = createObjectSpecifierFromPrimaryKey({
|
|
1130
|
-
apiName: obj.$apiName,
|
|
1131
|
-
type: "object"
|
|
1132
|
-
}, obj.$primaryKey);
|
|
1133
1149
|
delete obj.__apiName;
|
|
1134
1150
|
delete obj.__primaryKey;
|
|
1135
1151
|
delete obj.__title;
|
|
@@ -1144,7 +1160,7 @@ function createClientCache(fn) {
|
|
|
1144
1160
|
cache.set(client.clientCacheKey, /* @__PURE__ */ new Map());
|
|
1145
1161
|
}
|
|
1146
1162
|
let r = cache.get(client.clientCacheKey).get(key);
|
|
1147
|
-
if (r ===
|
|
1163
|
+
if (r === void 0 && fn !== void 0) {
|
|
1148
1164
|
return set(client, key, fn(client, key));
|
|
1149
1165
|
} else {
|
|
1150
1166
|
return r;
|
|
@@ -1192,27 +1208,29 @@ function createAsyncClientCache(fn, createCacheLocal = createClientCache) {
|
|
|
1192
1208
|
return ret;
|
|
1193
1209
|
}
|
|
1194
1210
|
async function loadActionMetadata(client, actionType) {
|
|
1195
|
-
const r = await
|
|
1211
|
+
const r = await chunkW5PFESFR_cjs.ActionTypeV2_exports.get(client, await client.ontologyRid, actionType);
|
|
1196
1212
|
return generatorConverters.wireActionTypeV2ToSdkActionMetadata(r);
|
|
1197
1213
|
}
|
|
1198
1214
|
async function loadFullObjectMetadata(client, objectType) {
|
|
1199
|
-
const full = await
|
|
1215
|
+
const full = await chunkW5PFESFR_cjs.ObjectTypeV2_exports.getFullMetadata(client, await client.ontologyRid, objectType, {
|
|
1200
1216
|
preview: true
|
|
1201
1217
|
});
|
|
1202
1218
|
const ret = generatorConverters.wireObjectTypeFullMetadataToSdkObjectMetadata(full, true);
|
|
1203
|
-
client.logger?.debug(`END loadFullObjectMetadata(${objectType})`);
|
|
1204
1219
|
return {
|
|
1205
1220
|
...ret
|
|
1206
1221
|
};
|
|
1207
1222
|
}
|
|
1208
1223
|
async function loadInterfaceMetadata(client, objectType) {
|
|
1209
|
-
const r = await
|
|
1224
|
+
const r = await chunkW5PFESFR_cjs.OntologyInterface_exports.get(client, await client.ontologyRid, objectType, {
|
|
1210
1225
|
preview: true
|
|
1211
1226
|
});
|
|
1212
1227
|
return generatorConverters.__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(r, true);
|
|
1213
1228
|
}
|
|
1214
|
-
async function loadQueryMetadata(client,
|
|
1215
|
-
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
|
+
});
|
|
1216
1234
|
return generatorConverters.wireQueryTypeV2ToSdkQueryMetadata(r);
|
|
1217
1235
|
}
|
|
1218
1236
|
|
|
@@ -1220,10 +1238,10 @@ async function loadQueryMetadata(client, queryType) {
|
|
|
1220
1238
|
var createStandardOntologyProviderFactory = (client) => {
|
|
1221
1239
|
return (client2) => {
|
|
1222
1240
|
async function loadObject(client3, key) {
|
|
1223
|
-
|
|
1241
|
+
const objectDef = await loadFullObjectMetadata(client3, key);
|
|
1224
1242
|
const interfaceDefs = Object.fromEntries((await Promise.all(objectDef.implements?.map((i) => ret.getInterfaceDefinition(i)) ?? [])).map((i) => [i.apiName, {
|
|
1225
1243
|
def: i,
|
|
1226
|
-
handler:
|
|
1244
|
+
handler: void 0
|
|
1227
1245
|
}]));
|
|
1228
1246
|
const fullObjectDef = {
|
|
1229
1247
|
...objectDef,
|
|
@@ -1235,8 +1253,7 @@ var createStandardOntologyProviderFactory = (client) => {
|
|
|
1235
1253
|
return loadInterfaceMetadata(client3, key);
|
|
1236
1254
|
}
|
|
1237
1255
|
async function loadQuery(client3, key) {
|
|
1238
|
-
|
|
1239
|
-
return r;
|
|
1256
|
+
return loadQueryMetadata(client3, key);
|
|
1240
1257
|
}
|
|
1241
1258
|
async function loadAction(client3, key) {
|
|
1242
1259
|
const r = await loadActionMetadata(client3, key);
|
|
@@ -1248,21 +1265,30 @@ var createStandardOntologyProviderFactory = (client) => {
|
|
|
1248
1265
|
return await cache.get(client2, apiName);
|
|
1249
1266
|
};
|
|
1250
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
|
+
}
|
|
1251
1277
|
const ret = {
|
|
1252
1278
|
getObjectDefinition: makeGetter(loadObject),
|
|
1253
1279
|
getInterfaceDefinition: makeGetter(loadInterface),
|
|
1254
|
-
|
|
1255
|
-
|
|
1280
|
+
getActionDefinition: makeGetter(loadAction),
|
|
1281
|
+
getQueryDefinition: makeQueryGetter(client2, loadQuery)
|
|
1256
1282
|
};
|
|
1257
1283
|
return ret;
|
|
1258
1284
|
};
|
|
1259
1285
|
};
|
|
1260
1286
|
|
|
1261
1287
|
// src/util/UserAgent.ts
|
|
1262
|
-
var USER_AGENT = `osdk-client/${"2.
|
|
1288
|
+
var USER_AGENT = `osdk-client/${"2.3.0-beta.1"}`;
|
|
1263
1289
|
|
|
1264
1290
|
// src/createMinimalClient.ts
|
|
1265
|
-
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) {
|
|
1266
1292
|
if (process.env.NODE_ENV !== "production") {
|
|
1267
1293
|
try {
|
|
1268
1294
|
new URL(baseUrl);
|
|
@@ -1301,17 +1327,12 @@ var fetchMetadataInternal = async (client, definition) => {
|
|
|
1301
1327
|
} else if (definition.type === "action") {
|
|
1302
1328
|
return client.ontologyProvider.getActionDefinition(definition.apiName);
|
|
1303
1329
|
} else if (definition.type === "query") {
|
|
1304
|
-
return client.ontologyProvider.getQueryDefinition(definition.apiName);
|
|
1330
|
+
return client.ontologyProvider.getQueryDefinition(definition.apiName, definition.isFixedVersion ? definition.version : void 0);
|
|
1305
1331
|
} else {
|
|
1306
1332
|
throw new Error("Not implemented for given definition");
|
|
1307
1333
|
}
|
|
1308
1334
|
};
|
|
1309
1335
|
|
|
1310
|
-
// src/util/isOsdkBaseObject.ts
|
|
1311
|
-
function isOsdkBaseObject2(o) {
|
|
1312
|
-
return o && typeof o === "object" && typeof o.$apiName === "string" && o.$primaryKey != null;
|
|
1313
|
-
}
|
|
1314
|
-
|
|
1315
1336
|
// src/util/toDataValueQueries.ts
|
|
1316
1337
|
async function toDataValueQueries(value, client, desiredType) {
|
|
1317
1338
|
if (value == null) {
|
|
@@ -1332,13 +1353,13 @@ async function toDataValueQueries(value, client, desiredType) {
|
|
|
1332
1353
|
switch (desiredType.type) {
|
|
1333
1354
|
case "attachment": {
|
|
1334
1355
|
if (isAttachmentUpload(value)) {
|
|
1335
|
-
const attachment = await
|
|
1356
|
+
const attachment = await chunkW5PFESFR_cjs.Attachment_exports.upload(client, value.data, {
|
|
1336
1357
|
filename: value.name
|
|
1337
1358
|
});
|
|
1338
1359
|
return attachment.rid;
|
|
1339
1360
|
}
|
|
1340
1361
|
if (isAttachmentFile(value)) {
|
|
1341
|
-
const attachment = await
|
|
1362
|
+
const attachment = await chunkW5PFESFR_cjs.Attachment_exports.upload(client, value, {
|
|
1342
1363
|
filename: value.name
|
|
1343
1364
|
});
|
|
1344
1365
|
return attachment.rid;
|
|
@@ -1363,17 +1384,17 @@ async function toDataValueQueries(value, client, desiredType) {
|
|
|
1363
1384
|
break;
|
|
1364
1385
|
}
|
|
1365
1386
|
case "object": {
|
|
1366
|
-
if (
|
|
1387
|
+
if (isObjectSpecifiersObject(value)) {
|
|
1367
1388
|
return value.$primaryKey;
|
|
1368
1389
|
}
|
|
1369
1390
|
break;
|
|
1370
1391
|
}
|
|
1371
1392
|
case "objectSet": {
|
|
1372
|
-
if (
|
|
1393
|
+
if (chunkFKI2LO2O_cjs.isWireObjectSet(value)) {
|
|
1373
1394
|
return value;
|
|
1374
1395
|
}
|
|
1375
|
-
if (
|
|
1376
|
-
return
|
|
1396
|
+
if (chunkFKI2LO2O_cjs.isObjectSet(value)) {
|
|
1397
|
+
return chunkFKI2LO2O_cjs.getWireObjectSet(value);
|
|
1377
1398
|
}
|
|
1378
1399
|
break;
|
|
1379
1400
|
}
|
|
@@ -1382,7 +1403,7 @@ async function toDataValueQueries(value, client, desiredType) {
|
|
|
1382
1403
|
const entrySet = [];
|
|
1383
1404
|
for (const [key, mapValue] of Object.entries(value)) {
|
|
1384
1405
|
entrySet.push({
|
|
1385
|
-
key: desiredType.keyType.type === "object" ?
|
|
1406
|
+
key: desiredType.keyType.type === "object" ? extractPrimaryKeyFromObjectSpecifier(key) : await toDataValueQueries(key, client, desiredType.keyType),
|
|
1386
1407
|
value: await toDataValueQueries(mapValue, client, desiredType.valueType)
|
|
1387
1408
|
});
|
|
1388
1409
|
}
|
|
@@ -1411,17 +1432,16 @@ async function toDataValueQueries(value, client, desiredType) {
|
|
|
1411
1432
|
}
|
|
1412
1433
|
return value;
|
|
1413
1434
|
}
|
|
1414
|
-
function extractPrimaryKeyFromObjectIdentifier(a) {
|
|
1415
|
-
return a.substring(a.indexOf(":") + 1);
|
|
1416
|
-
}
|
|
1417
1435
|
|
|
1418
1436
|
// src/queries/applyQuery.ts
|
|
1419
1437
|
async function applyQuery(client, query, params) {
|
|
1420
|
-
const qd = await client.ontologyProvider.getQueryDefinition(query.apiName);
|
|
1421
|
-
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, (_) => ({
|
|
1422
1440
|
finalMethodCall: "applyQuery"
|
|
1423
1441
|
})), query), await client.ontologyRid, query.apiName, {
|
|
1424
1442
|
parameters: params ? await remapQueryParams(params, client, qd.parameters) : {}
|
|
1443
|
+
}, {
|
|
1444
|
+
version: qd.version
|
|
1425
1445
|
});
|
|
1426
1446
|
const objectOutputDefs = await getRequiredDefinitions(qd.output, client);
|
|
1427
1447
|
const remappedResponse = await remapQueryResponse(client, qd.output, response.value, objectOutputDefs);
|
|
@@ -1437,7 +1457,7 @@ async function remapQueryParams(params, client, paramTypes) {
|
|
|
1437
1457
|
async function remapQueryResponse(client, responseDataType, responseValue, definitions) {
|
|
1438
1458
|
if (responseValue == null) {
|
|
1439
1459
|
if (responseDataType.nullable) {
|
|
1440
|
-
return
|
|
1460
|
+
return void 0;
|
|
1441
1461
|
} else {
|
|
1442
1462
|
throw new Error("Got null response when nullable was not allowed");
|
|
1443
1463
|
}
|
|
@@ -1463,11 +1483,11 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
1463
1483
|
return responseValue;
|
|
1464
1484
|
}
|
|
1465
1485
|
case "attachment": {
|
|
1466
|
-
return
|
|
1486
|
+
return chunkFKI2LO2O_cjs.hydrateAttachmentFromRidInternal(client, responseValue);
|
|
1467
1487
|
}
|
|
1468
1488
|
case "object": {
|
|
1469
1489
|
const def = definitions.get(responseDataType.object);
|
|
1470
|
-
if (!def) {
|
|
1490
|
+
if (!def || def.type !== "object") {
|
|
1471
1491
|
throw new Error(`Missing definition for ${responseDataType.object}`);
|
|
1472
1492
|
}
|
|
1473
1493
|
return createQueryObjectResponse(responseValue, def);
|
|
@@ -1478,7 +1498,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
1478
1498
|
throw new Error(`Missing definition for ${responseDataType.objectSet}`);
|
|
1479
1499
|
}
|
|
1480
1500
|
if (typeof responseValue === "string") {
|
|
1481
|
-
return
|
|
1501
|
+
return chunkFKI2LO2O_cjs.createObjectSet(def, client, {
|
|
1482
1502
|
type: "intersect",
|
|
1483
1503
|
objectSets: [{
|
|
1484
1504
|
type: "base",
|
|
@@ -1489,7 +1509,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
1489
1509
|
}]
|
|
1490
1510
|
});
|
|
1491
1511
|
}
|
|
1492
|
-
return
|
|
1512
|
+
return chunkFKI2LO2O_cjs.createObjectSet(def, client, responseValue);
|
|
1493
1513
|
}
|
|
1494
1514
|
case "struct": {
|
|
1495
1515
|
for (const [key, subtype] of Object.entries(responseDataType.struct)) {
|
|
@@ -1501,10 +1521,10 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
1501
1521
|
}
|
|
1502
1522
|
case "map": {
|
|
1503
1523
|
const map = {};
|
|
1504
|
-
!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;
|
|
1505
1525
|
for (const entry of responseValue) {
|
|
1506
|
-
!entry.key ? process.env.NODE_ENV !== "production" ? invariant__default.default(false, "Expected key") : invariant__default.default(false) :
|
|
1507
|
-
!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;
|
|
1508
1528
|
const key = responseDataType.keyType.type === "object" ? getObjectSpecifier(entry.key, responseDataType.keyType.object, definitions) : entry.key;
|
|
1509
1529
|
const value = await remapQueryResponse(client, responseDataType.valueType, entry.value, definitions);
|
|
1510
1530
|
map[key] = value;
|
|
@@ -1614,7 +1634,7 @@ function requiresConversion(dataType) {
|
|
|
1614
1634
|
}
|
|
1615
1635
|
function getObjectSpecifier(primaryKey, objectTypeApiName, definitions) {
|
|
1616
1636
|
const def = definitions.get(objectTypeApiName);
|
|
1617
|
-
if (!def) {
|
|
1637
|
+
if (!def || def.type !== "object") {
|
|
1618
1638
|
throw new Error(`Missing definition for ${objectTypeApiName}`);
|
|
1619
1639
|
}
|
|
1620
1640
|
return createObjectSpecifierFromPrimaryKey(def, primaryKey);
|
|
@@ -1622,7 +1642,7 @@ function getObjectSpecifier(primaryKey, objectTypeApiName, definitions) {
|
|
|
1622
1642
|
function createQueryObjectResponse(primaryKey, objectDef) {
|
|
1623
1643
|
return {
|
|
1624
1644
|
$apiName: objectDef.apiName,
|
|
1625
|
-
$title:
|
|
1645
|
+
$title: void 0,
|
|
1626
1646
|
$objectType: objectDef.apiName,
|
|
1627
1647
|
$primaryKey: primaryKey,
|
|
1628
1648
|
$objectSpecifier: createObjectSpecifierFromPrimaryKey(objectDef, primaryKey)
|
|
@@ -1632,16 +1652,16 @@ function createQueryObjectResponse(primaryKey, objectDef) {
|
|
|
1632
1652
|
// src/createClient.ts
|
|
1633
1653
|
var ActionInvoker = class {
|
|
1634
1654
|
constructor(clientCtx, actionDef) {
|
|
1635
|
-
this.applyAction = applyAction.bind(
|
|
1636
|
-
this.batchApplyAction = applyAction.bind(
|
|
1655
|
+
this.applyAction = applyAction.bind(void 0, clientCtx, actionDef);
|
|
1656
|
+
this.batchApplyAction = applyAction.bind(void 0, clientCtx, actionDef);
|
|
1637
1657
|
}
|
|
1638
1658
|
};
|
|
1639
1659
|
var QueryInvoker = class {
|
|
1640
1660
|
constructor(clientCtx, queryDef) {
|
|
1641
|
-
this.executeFunction = applyQuery.bind(
|
|
1661
|
+
this.executeFunction = applyQuery.bind(void 0, clientCtx, queryDef);
|
|
1642
1662
|
}
|
|
1643
1663
|
};
|
|
1644
|
-
function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvider, options =
|
|
1664
|
+
function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvider, options = void 0, fetchFn = fetch) {
|
|
1645
1665
|
if (typeof ontologyRid === "string") {
|
|
1646
1666
|
if (!ontologyRid.startsWith("ri.")) {
|
|
1647
1667
|
throw new Error("Invalid ontology RID");
|
|
@@ -1655,7 +1675,10 @@ function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvi
|
|
|
1655
1675
|
}
|
|
1656
1676
|
const clientCtx = createMinimalClient({
|
|
1657
1677
|
ontologyRid
|
|
1658
|
-
}, baseUrl, tokenProvider,
|
|
1678
|
+
}, baseUrl, tokenProvider, {
|
|
1679
|
+
...options,
|
|
1680
|
+
logger: options?.logger ?? new chunkFKI2LO2O_cjs.MinimalLogger()
|
|
1681
|
+
}, fetchFn, objectSetFactory);
|
|
1659
1682
|
function clientFn(o) {
|
|
1660
1683
|
if (o.type === "object" || o.type === "interface") {
|
|
1661
1684
|
return objectSetFactory(o, clientCtx);
|
|
@@ -1672,7 +1695,7 @@ function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvi
|
|
|
1672
1695
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid.name:
|
|
1673
1696
|
return {
|
|
1674
1697
|
fetchOneByRid: async (objectType, rid, options2) => {
|
|
1675
|
-
return await
|
|
1698
|
+
return await chunkFKI2LO2O_cjs.fetchSingle(clientCtx, objectType, options2, createWithRid([rid]));
|
|
1676
1699
|
}
|
|
1677
1700
|
};
|
|
1678
1701
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference.name:
|
|
@@ -1684,7 +1707,7 @@ function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvi
|
|
|
1684
1707
|
objectType,
|
|
1685
1708
|
propertyType
|
|
1686
1709
|
} = args;
|
|
1687
|
-
return await
|
|
1710
|
+
return await chunkW5PFESFR_cjs.MediaReferenceProperty_exports.upload(clientCtx, await clientCtx.ontologyRid, objectType.apiName, propertyType, data, {
|
|
1688
1711
|
mediaItemPath: fileName,
|
|
1689
1712
|
preview: true
|
|
1690
1713
|
});
|
|
@@ -1693,7 +1716,7 @@ function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvi
|
|
|
1693
1716
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid.name:
|
|
1694
1717
|
return {
|
|
1695
1718
|
fetchPageByRid: async (objectOrInterfaceType, rids, options2 = {}) => {
|
|
1696
|
-
return await
|
|
1719
|
+
return await chunkW5PFESFR_cjs.fetchPage(clientCtx, objectOrInterfaceType, options2, createWithRid(rids));
|
|
1697
1720
|
}
|
|
1698
1721
|
};
|
|
1699
1722
|
}
|
|
@@ -1702,16 +1725,16 @@ function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvi
|
|
|
1702
1725
|
throw new Error("not implemented");
|
|
1703
1726
|
}
|
|
1704
1727
|
}
|
|
1705
|
-
const fetchMetadata = fetchMetadataInternal.bind(
|
|
1728
|
+
const fetchMetadata = fetchMetadataInternal.bind(void 0, clientCtx);
|
|
1706
1729
|
const symbolClientContext2 = "__osdkClientContext";
|
|
1707
1730
|
const client = Object.defineProperties(clientFn, {
|
|
1708
|
-
[
|
|
1731
|
+
[chunkW5PFESFR_cjs.symbolClientContext]: {
|
|
1709
1732
|
value: clientCtx
|
|
1710
1733
|
},
|
|
1711
1734
|
[symbolClientContext2]: {
|
|
1712
1735
|
value: clientCtx
|
|
1713
1736
|
},
|
|
1714
|
-
[
|
|
1737
|
+
[chunkW5PFESFR_cjs.additionalContext]: {
|
|
1715
1738
|
value: clientCtx
|
|
1716
1739
|
},
|
|
1717
1740
|
fetchMetadata: {
|
|
@@ -1720,7 +1743,7 @@ function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvi
|
|
|
1720
1743
|
});
|
|
1721
1744
|
return client;
|
|
1722
1745
|
}
|
|
1723
|
-
var createClient = createClientInternal.bind(
|
|
1746
|
+
var createClient = createClientInternal.bind(void 0, chunkFKI2LO2O_cjs.createObjectSet);
|
|
1724
1747
|
function createWithRid(rids) {
|
|
1725
1748
|
const withRid = {
|
|
1726
1749
|
type: "static",
|
|
@@ -1728,13 +1751,13 @@ function createWithRid(rids) {
|
|
|
1728
1751
|
};
|
|
1729
1752
|
return withRid;
|
|
1730
1753
|
}
|
|
1731
|
-
function createPlatformClient(baseUrl, tokenProvider, options =
|
|
1754
|
+
function createPlatformClient(baseUrl, tokenProvider, options = void 0, fetchFn = fetch) {
|
|
1732
1755
|
return shared_client_impl.createSharedClientContext(baseUrl, tokenProvider, USER_AGENT, fetchFn);
|
|
1733
1756
|
}
|
|
1734
1757
|
var isoRegex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})?$/;
|
|
1735
1758
|
var extractDate = (dateTime) => {
|
|
1736
|
-
!(dateTime.length < 33) ? process.env.NODE_ENV !== "production" ? invariant__default.default(false, "Invalid date format. Provided input is too long.") : invariant__default.default(false) :
|
|
1737
|
-
!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;
|
|
1738
1761
|
return extractDateFromIsoString(dateTime);
|
|
1739
1762
|
};
|
|
1740
1763
|
var extractDateInUTC = (date) => {
|
|
@@ -1762,7 +1785,6 @@ Object.defineProperty(exports, "PalantirApiError", {
|
|
|
1762
1785
|
exports.ActionValidationError = ActionValidationError;
|
|
1763
1786
|
exports.createAttachmentUpload = createAttachmentUpload;
|
|
1764
1787
|
exports.createClient = createClient;
|
|
1765
|
-
exports.createObjectSpecifierFromPrimaryKey = createObjectSpecifierFromPrimaryKey;
|
|
1766
1788
|
exports.createPlatformClient = createPlatformClient;
|
|
1767
1789
|
exports.extractDate = extractDate;
|
|
1768
1790
|
exports.extractDateInLocalTime = extractDateInLocalTime;
|