@osdk/client 2.2.0-beta.9 → 2.2.0-rc.25
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 +394 -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 +4 -21
- package/build/browser/derivedProperties/createWithPropertiesObjectSet.js.map +1 -1
- package/build/browser/derivedProperties/createWithPropertiesObjectSet.test.js +14 -14
- package/build/browser/derivedProperties/createWithPropertiesObjectSet.test.js.map +1 -1
- package/build/browser/derivedProperties/derivedPropertyRuntimeMetadata.js +2 -0
- package/build/browser/derivedProperties/derivedPropertyRuntimeMetadata.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/browser/intellisense.test.helpers/orderBySuggestionIsRight.js +30 -0
- package/build/browser/intellisense.test.helpers/orderBySuggestionIsRight.js.map +1 -0
- 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 +39 -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 +56 -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 +188 -66
- 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 +1 -0
- package/build/browser/tsserver.js.map +1 -1
- package/build/browser/util/UserAgent.js +1 -1
- package/build/browser/util/UserAgent.js.map +1 -1
- package/build/browser/util/extractRdpDefinition.js +151 -0
- package/build/browser/util/extractRdpDefinition.js.map +1 -0
- package/build/browser/util/extractRdpDefinition.test.js +315 -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-5JZGGCIW.cjs} +124 -72
- package/build/cjs/chunk-5JZGGCIW.cjs.map +1 -0
- package/build/cjs/{chunk-EY52J5Z4.cjs → chunk-HDAQ6JIR.cjs} +174 -34
- package/build/cjs/chunk-HDAQ6JIR.cjs.map +1 -0
- package/build/cjs/index.cjs +198 -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 +4 -21
- package/build/esm/derivedProperties/createWithPropertiesObjectSet.js.map +1 -1
- package/build/esm/derivedProperties/createWithPropertiesObjectSet.test.js +14 -14
- package/build/esm/derivedProperties/createWithPropertiesObjectSet.test.js.map +1 -1
- package/build/esm/derivedProperties/derivedPropertyRuntimeMetadata.js +2 -0
- package/build/esm/derivedProperties/derivedPropertyRuntimeMetadata.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/intellisense.test.helpers/orderBySuggestionIsRight.js +30 -0
- package/build/esm/intellisense.test.helpers/orderBySuggestionIsRight.js.map +1 -0
- 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 +39 -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 +56 -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 +188 -66
- 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 +1 -0
- package/build/esm/tsserver.js.map +1 -1
- package/build/esm/util/UserAgent.js +1 -1
- package/build/esm/util/UserAgent.js.map +1 -1
- package/build/esm/util/extractRdpDefinition.js +151 -0
- package/build/esm/util/extractRdpDefinition.js.map +1 -0
- package/build/esm/util/extractRdpDefinition.test.js +315 -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/derivedPropertyRuntimeMetadata.d.ts +6 -0
- package/build/types/derivedProperties/derivedPropertyRuntimeMetadata.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/orderBySuggestionIsRight.d.ts +1 -0
- package/build/types/intellisense.test.helpers/orderBySuggestionIsRight.d.ts.map +1 -0
- 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 -3
- 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 +2 -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 +14 -13
- 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 chunk5JZGGCIW_cjs = require('./chunk-5JZGGCIW.cjs');
|
|
4
4
|
var chunkT4NIFYZS_cjs = require('./chunk-T4NIFYZS.cjs');
|
|
5
|
-
var
|
|
6
|
-
require('./chunk-Q7SFCCGT.cjs');
|
|
5
|
+
var chunkHDAQ6JIR_cjs = require('./chunk-HDAQ6JIR.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 chunkHDAQ6JIR_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 chunkHDAQ6JIR_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 (chunk5JZGGCIW_cjs.isWireObjectSet(value)) {
|
|
438
445
|
return value;
|
|
439
446
|
}
|
|
440
|
-
if (
|
|
441
|
-
return
|
|
447
|
+
if (chunk5JZGGCIW_cjs.isObjectSet(value)) {
|
|
448
|
+
return chunk5JZGGCIW_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 = chunkHDAQ6JIR_cjs.addUserAgentAndRequestContextHeaders(chunk5JZGGCIW_cjs.augmentRequestContext(client, (_) => ({
|
|
465
472
|
finalMethodCall: "applyAction"
|
|
466
473
|
})), action);
|
|
467
474
|
if (Array.isArray(parameters)) {
|
|
468
|
-
const response = await
|
|
475
|
+
const response = await chunkHDAQ6JIR_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 chunkHDAQ6JIR_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 = chunkHDAQ6JIR_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 chunkHDAQ6JIR_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 chunkHDAQ6JIR_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 chunkHDAQ6JIR_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 chunkHDAQ6JIR_cjs.TimeSeriesPropertyV2_exports.getFirstPoint(this.#client, await this.#client.ontologyRid, ...this.#triplet);
|
|
749
756
|
}
|
|
750
757
|
async getLastPoint() {
|
|
751
|
-
return
|
|
758
|
+
return chunkHDAQ6JIR_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 chunkHDAQ6JIR_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] = chunk5JZGGCIW_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] = chunk5JZGGCIW_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) => chunk5JZGGCIW_cjs.fetchSingle(client, objDef, options ?? {}, chunk5JZGGCIW_cjs.getWireObjectSet(objectSet)),
|
|
910
|
+
fetchOneWithErrors: (options) => chunk5JZGGCIW_cjs.fetchSingleWithErrors(client, objDef, options ?? {}, chunk5JZGGCIW_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,67 +976,74 @@ 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) {
|
|
980
|
+
rawObj[propKey] = modifyRdpProperties(client, derivedPropertyTypeByName, rawObj[propKey], propKey);
|
|
953
981
|
}
|
|
954
982
|
}
|
|
955
983
|
return Object.freeze(rawObj);
|
|
956
984
|
}
|
|
985
|
+
function modifyRdpProperties(client, derivedPropertyTypeByName, rawValue, propKey) {
|
|
986
|
+
if (derivedPropertyTypeByName[propKey].definition.type === "selection" && derivedPropertyTypeByName[propKey].definition.operation.type === "count") {
|
|
987
|
+
const num = Number(rawValue);
|
|
988
|
+
!Number.isSafeInteger(num) ? process.env.NODE_ENV !== "production" ? invariant__default.default(false, "Count aggregation for derived property " + propKey + " returned a value larger than safe integer.") : invariant__default.default(false) : void 0;
|
|
989
|
+
return num;
|
|
990
|
+
} else if (derivedPropertyTypeByName[propKey].selectedOrCollectedPropertyType != null && typeof derivedPropertyTypeByName[propKey].selectedOrCollectedPropertyType.type === "string" && specialPropertyTypes.has(derivedPropertyTypeByName[propKey].selectedOrCollectedPropertyType.type)) {
|
|
991
|
+
switch (derivedPropertyTypeByName[propKey].selectedOrCollectedPropertyType?.type) {
|
|
992
|
+
case "attachment":
|
|
993
|
+
if (Array.isArray(rawValue)) {
|
|
994
|
+
return rawValue.map((a) => chunk5JZGGCIW_cjs.hydrateAttachmentFromRidInternal(client, a.rid));
|
|
995
|
+
} else {
|
|
996
|
+
return chunk5JZGGCIW_cjs.hydrateAttachmentFromRidInternal(client, rawValue.rid);
|
|
997
|
+
}
|
|
998
|
+
default:
|
|
999
|
+
process.env.NODE_ENV !== "production" ? invariant__default.default(false, "Derived property aggregations for Timeseries and Media are not supported") : invariant__default.default(false) ;
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
return rawValue;
|
|
1003
|
+
}
|
|
957
1004
|
function createSpecialProperty(client, objectDef, rawObject, p) {
|
|
958
1005
|
const rawValue = rawObject[p];
|
|
959
1006
|
const propDef = objectDef.properties[p];
|
|
960
1007
|
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
|
-
}
|
|
1008
|
+
!(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;
|
|
1009
|
+
}
|
|
1010
|
+
if (propDef.type === "attachment") {
|
|
1011
|
+
if (Array.isArray(rawValue)) {
|
|
1012
|
+
return rawValue.map((a) => chunk5JZGGCIW_cjs.hydrateAttachmentFromRidInternal(client, a.rid));
|
|
995
1013
|
}
|
|
1014
|
+
return chunk5JZGGCIW_cjs.hydrateAttachmentFromRidInternal(client, rawValue.rid);
|
|
1015
|
+
}
|
|
1016
|
+
if (propDef.type === "numericTimeseries" || propDef.type === "stringTimeseries" || propDef.type === "sensorTimeseries") {
|
|
1017
|
+
return new TimeSeriesPropertyImpl(client, objectDef.apiName, rawObject[objectDef.primaryKeyApiName], p);
|
|
1018
|
+
}
|
|
1019
|
+
if (propDef.type === "geotimeSeriesReference") {
|
|
1020
|
+
return new GeotimeSeriesPropertyImpl(client, objectDef.apiName, rawObject[objectDef.primaryKeyApiName], p, rawValue.type === "geotimeSeriesValue" ? {
|
|
1021
|
+
time: rawValue.timestamp,
|
|
1022
|
+
value: {
|
|
1023
|
+
type: "Point",
|
|
1024
|
+
coordinates: rawValue.position
|
|
1025
|
+
}
|
|
1026
|
+
} : void 0);
|
|
1027
|
+
}
|
|
1028
|
+
if (propDef.type === "mediaReference") {
|
|
1029
|
+
return new MediaReferencePropertyImpl({
|
|
1030
|
+
client,
|
|
1031
|
+
objectApiName: objectDef.apiName,
|
|
1032
|
+
primaryKey: rawObject[objectDef.primaryKeyApiName],
|
|
1033
|
+
propertyName: p
|
|
1034
|
+
});
|
|
996
1035
|
}
|
|
997
|
-
}
|
|
998
|
-
|
|
999
|
-
// src/object/createObjectSpecifierFromPrimaryKey.ts
|
|
1000
|
-
function createObjectSpecifierFromPrimaryKey(def, primaryKey) {
|
|
1001
|
-
return `${def.apiName}:${primaryKey}`;
|
|
1002
1036
|
}
|
|
1003
1037
|
|
|
1004
1038
|
// src/object/convertWireToOsdkObjects.ts
|
|
1005
|
-
async function convertWireToOsdkObjects(client, objects, interfaceApiName, forceRemoveRid = false, selectedProps, strictNonNull = false) {
|
|
1006
|
-
client.logger?.debug(`START convertWireToOsdkObjects()`);
|
|
1039
|
+
async function convertWireToOsdkObjects(client, objects, interfaceApiName, forceRemoveRid = false, derivedPropertyTypesByName, selectedProps, strictNonNull = false) {
|
|
1007
1040
|
fixObjectPropertiesInPlace(objects, forceRemoveRid);
|
|
1008
|
-
const ifaceDef = interfaceApiName ? await client.ontologyProvider.getInterfaceDefinition(interfaceApiName) :
|
|
1009
|
-
const ifaceSelected = ifaceDef ? selectedProps ?? Object.keys(ifaceDef.properties) :
|
|
1041
|
+
const ifaceDef = interfaceApiName ? await client.ontologyProvider.getInterfaceDefinition(interfaceApiName) : void 0;
|
|
1042
|
+
const ifaceSelected = ifaceDef ? selectedProps ?? Object.keys(ifaceDef.properties) : void 0;
|
|
1010
1043
|
const ret = [];
|
|
1011
1044
|
for (const rawObj of objects) {
|
|
1012
1045
|
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) :
|
|
1046
|
+
!objectDef ? process.env.NODE_ENV !== "production" ? invariant__default.default(false, `Missing definition for '${rawObj.$apiName}'`) : invariant__default.default(false) : void 0;
|
|
1014
1047
|
let objProps;
|
|
1015
1048
|
let conforming = true;
|
|
1016
1049
|
if (ifaceDef && ifaceSelected) {
|
|
@@ -1027,24 +1060,22 @@ async function convertWireToOsdkObjects(client, objects, interfaceApiName, force
|
|
|
1027
1060
|
} else if (strictNonNull === "drop" && !conforming) {
|
|
1028
1061
|
continue;
|
|
1029
1062
|
}
|
|
1030
|
-
let osdkObject = createOsdkObject(client, objectDef, rawObj);
|
|
1063
|
+
let osdkObject = createOsdkObject(client, objectDef, rawObj, derivedPropertyTypesByName);
|
|
1031
1064
|
if (interfaceApiName) osdkObject = osdkObject.$as(interfaceApiName);
|
|
1032
1065
|
ret.push(osdkObject);
|
|
1033
1066
|
}
|
|
1034
|
-
client.logger?.debug(`END convertWireToOsdkObjects()`);
|
|
1035
1067
|
return ret;
|
|
1036
1068
|
}
|
|
1037
|
-
async function convertWireToOsdkObjects2(client, objects, interfaceApiName, forceRemoveRid = false, selectedProps, strictNonNull = false, interfaceToObjectTypeMappings = {}) {
|
|
1038
|
-
client.logger?.debug(`START convertWireToOsdkObjects2()`);
|
|
1069
|
+
async function convertWireToOsdkObjects2(client, objects, interfaceApiName, derivedPropertyTypeByName, forceRemoveRid = false, selectedProps, strictNonNull = false, interfaceToObjectTypeMappings = {}) {
|
|
1039
1070
|
fixObjectPropertiesInPlace(objects, forceRemoveRid);
|
|
1040
1071
|
const ret = [];
|
|
1041
1072
|
for (const rawObj of objects) {
|
|
1042
1073
|
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] :
|
|
1074
|
+
!objectDef ? process.env.NODE_ENV !== "production" ? invariant__default.default(false, `Missing definition for '${rawObj.$apiName}'`) : invariant__default.default(false) : void 0;
|
|
1075
|
+
const interfaceToObjMapping = interfaceApiName ? interfaceToObjectTypeMappings[interfaceApiName][rawObj.$apiName] : void 0;
|
|
1045
1076
|
const ifaceSelected = interfaceApiName && interfaceToObjMapping ? selectedProps ? Object.keys(interfaceToObjMapping).filter((val) => {
|
|
1046
1077
|
selectedProps?.includes(interfaceToObjMapping[val]);
|
|
1047
|
-
}) : [...Object.values(interfaceToObjMapping), objectDef.primaryKeyApiName] :
|
|
1078
|
+
}) : [...Object.values(interfaceToObjMapping), objectDef.primaryKeyApiName] : void 0;
|
|
1048
1079
|
let objProps;
|
|
1049
1080
|
let conforming = true;
|
|
1050
1081
|
if (interfaceApiName && ifaceSelected) {
|
|
@@ -1059,11 +1090,10 @@ async function convertWireToOsdkObjects2(client, objects, interfaceApiName, forc
|
|
|
1059
1090
|
} else if (strictNonNull === "drop" && !conforming) {
|
|
1060
1091
|
continue;
|
|
1061
1092
|
}
|
|
1062
|
-
let osdkObject = createOsdkObject(client, objectDef, rawObj);
|
|
1093
|
+
let osdkObject = createOsdkObject(client, objectDef, rawObj, derivedPropertyTypeByName);
|
|
1063
1094
|
if (interfaceApiName) osdkObject = osdkObject.$as(interfaceApiName);
|
|
1064
1095
|
ret.push(osdkObject);
|
|
1065
1096
|
}
|
|
1066
|
-
client.logger?.debug(`END convertWireToOsdkObjects2()`);
|
|
1067
1097
|
return ret;
|
|
1068
1098
|
}
|
|
1069
1099
|
function convertInterfacePropNamesToObjectPropNames(objectDef, interfaceApiName, ifacePropsToMap) {
|
|
@@ -1075,7 +1105,7 @@ function reframeAsObjectInPlace(objectDef, interfaceApiName, rawObj) {
|
|
|
1075
1105
|
if (sptProp in rawObj) {
|
|
1076
1106
|
const value = rawObj[sptProp];
|
|
1077
1107
|
delete rawObj[sptProp];
|
|
1078
|
-
if (value !==
|
|
1108
|
+
if (value !== void 0) {
|
|
1079
1109
|
newProps[regularProp] = value;
|
|
1080
1110
|
}
|
|
1081
1111
|
}
|
|
@@ -1126,10 +1156,6 @@ function fixObjectPropertiesInPlace(objs, forceRemoveRid) {
|
|
|
1126
1156
|
obj.$objectType = obj.$apiName;
|
|
1127
1157
|
obj.$primaryKey ??= obj.__primaryKey;
|
|
1128
1158
|
obj.$title ??= obj.__title;
|
|
1129
|
-
obj.$objectSpecifier = createObjectSpecifierFromPrimaryKey({
|
|
1130
|
-
apiName: obj.$apiName,
|
|
1131
|
-
type: "object"
|
|
1132
|
-
}, obj.$primaryKey);
|
|
1133
1159
|
delete obj.__apiName;
|
|
1134
1160
|
delete obj.__primaryKey;
|
|
1135
1161
|
delete obj.__title;
|
|
@@ -1144,7 +1170,7 @@ function createClientCache(fn) {
|
|
|
1144
1170
|
cache.set(client.clientCacheKey, /* @__PURE__ */ new Map());
|
|
1145
1171
|
}
|
|
1146
1172
|
let r = cache.get(client.clientCacheKey).get(key);
|
|
1147
|
-
if (r ===
|
|
1173
|
+
if (r === void 0 && fn !== void 0) {
|
|
1148
1174
|
return set(client, key, fn(client, key));
|
|
1149
1175
|
} else {
|
|
1150
1176
|
return r;
|
|
@@ -1192,27 +1218,29 @@ function createAsyncClientCache(fn, createCacheLocal = createClientCache) {
|
|
|
1192
1218
|
return ret;
|
|
1193
1219
|
}
|
|
1194
1220
|
async function loadActionMetadata(client, actionType) {
|
|
1195
|
-
const r = await
|
|
1221
|
+
const r = await chunkHDAQ6JIR_cjs.ActionTypeV2_exports.get(client, await client.ontologyRid, actionType);
|
|
1196
1222
|
return generatorConverters.wireActionTypeV2ToSdkActionMetadata(r);
|
|
1197
1223
|
}
|
|
1198
1224
|
async function loadFullObjectMetadata(client, objectType) {
|
|
1199
|
-
const full = await
|
|
1225
|
+
const full = await chunkHDAQ6JIR_cjs.ObjectTypeV2_exports.getFullMetadata(client, await client.ontologyRid, objectType, {
|
|
1200
1226
|
preview: true
|
|
1201
1227
|
});
|
|
1202
1228
|
const ret = generatorConverters.wireObjectTypeFullMetadataToSdkObjectMetadata(full, true);
|
|
1203
|
-
client.logger?.debug(`END loadFullObjectMetadata(${objectType})`);
|
|
1204
1229
|
return {
|
|
1205
1230
|
...ret
|
|
1206
1231
|
};
|
|
1207
1232
|
}
|
|
1208
1233
|
async function loadInterfaceMetadata(client, objectType) {
|
|
1209
|
-
const r = await
|
|
1234
|
+
const r = await chunkHDAQ6JIR_cjs.OntologyInterface_exports.get(client, await client.ontologyRid, objectType, {
|
|
1210
1235
|
preview: true
|
|
1211
1236
|
});
|
|
1212
1237
|
return generatorConverters.__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(r, true);
|
|
1213
1238
|
}
|
|
1214
|
-
async function loadQueryMetadata(client,
|
|
1215
|
-
const
|
|
1239
|
+
async function loadQueryMetadata(client, queryTypeApiNameAndVersion) {
|
|
1240
|
+
const [apiName, version] = queryTypeApiNameAndVersion.split(":");
|
|
1241
|
+
const r = await chunkHDAQ6JIR_cjs.QueryType_exports.get(client, await client.ontologyRid, apiName, {
|
|
1242
|
+
version
|
|
1243
|
+
});
|
|
1216
1244
|
return generatorConverters.wireQueryTypeV2ToSdkQueryMetadata(r);
|
|
1217
1245
|
}
|
|
1218
1246
|
|
|
@@ -1220,10 +1248,10 @@ async function loadQueryMetadata(client, queryType) {
|
|
|
1220
1248
|
var createStandardOntologyProviderFactory = (client) => {
|
|
1221
1249
|
return (client2) => {
|
|
1222
1250
|
async function loadObject(client3, key) {
|
|
1223
|
-
|
|
1251
|
+
const objectDef = await loadFullObjectMetadata(client3, key);
|
|
1224
1252
|
const interfaceDefs = Object.fromEntries((await Promise.all(objectDef.implements?.map((i) => ret.getInterfaceDefinition(i)) ?? [])).map((i) => [i.apiName, {
|
|
1225
1253
|
def: i,
|
|
1226
|
-
handler:
|
|
1254
|
+
handler: void 0
|
|
1227
1255
|
}]));
|
|
1228
1256
|
const fullObjectDef = {
|
|
1229
1257
|
...objectDef,
|
|
@@ -1235,8 +1263,7 @@ var createStandardOntologyProviderFactory = (client) => {
|
|
|
1235
1263
|
return loadInterfaceMetadata(client3, key);
|
|
1236
1264
|
}
|
|
1237
1265
|
async function loadQuery(client3, key) {
|
|
1238
|
-
|
|
1239
|
-
return r;
|
|
1266
|
+
return loadQueryMetadata(client3, key);
|
|
1240
1267
|
}
|
|
1241
1268
|
async function loadAction(client3, key) {
|
|
1242
1269
|
const r = await loadActionMetadata(client3, key);
|
|
@@ -1248,21 +1275,30 @@ var createStandardOntologyProviderFactory = (client) => {
|
|
|
1248
1275
|
return await cache.get(client2, apiName);
|
|
1249
1276
|
};
|
|
1250
1277
|
}
|
|
1278
|
+
function makeQueryGetter(client3, fn) {
|
|
1279
|
+
const queryCache = createAsyncClientCache((client4, key) => {
|
|
1280
|
+
return fn(client4, key);
|
|
1281
|
+
});
|
|
1282
|
+
return async (apiName, version) => {
|
|
1283
|
+
const key = version ? `${apiName}:${version}` : apiName;
|
|
1284
|
+
return await queryCache.get(client3, key);
|
|
1285
|
+
};
|
|
1286
|
+
}
|
|
1251
1287
|
const ret = {
|
|
1252
1288
|
getObjectDefinition: makeGetter(loadObject),
|
|
1253
1289
|
getInterfaceDefinition: makeGetter(loadInterface),
|
|
1254
|
-
|
|
1255
|
-
|
|
1290
|
+
getActionDefinition: makeGetter(loadAction),
|
|
1291
|
+
getQueryDefinition: makeQueryGetter(client2, loadQuery)
|
|
1256
1292
|
};
|
|
1257
1293
|
return ret;
|
|
1258
1294
|
};
|
|
1259
1295
|
};
|
|
1260
1296
|
|
|
1261
1297
|
// src/util/UserAgent.ts
|
|
1262
|
-
var USER_AGENT = `osdk-client/${"2.2.0-
|
|
1298
|
+
var USER_AGENT = `osdk-client/${"2.2.0-rc.25"}`;
|
|
1263
1299
|
|
|
1264
1300
|
// src/createMinimalClient.ts
|
|
1265
|
-
function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory =
|
|
1301
|
+
function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory = chunk5JZGGCIW_cjs.createObjectSet, createOntologyProviderFactory = createStandardOntologyProviderFactory) {
|
|
1266
1302
|
if (process.env.NODE_ENV !== "production") {
|
|
1267
1303
|
try {
|
|
1268
1304
|
new URL(baseUrl);
|
|
@@ -1301,17 +1337,12 @@ var fetchMetadataInternal = async (client, definition) => {
|
|
|
1301
1337
|
} else if (definition.type === "action") {
|
|
1302
1338
|
return client.ontologyProvider.getActionDefinition(definition.apiName);
|
|
1303
1339
|
} else if (definition.type === "query") {
|
|
1304
|
-
return client.ontologyProvider.getQueryDefinition(definition.apiName);
|
|
1340
|
+
return client.ontologyProvider.getQueryDefinition(definition.apiName, definition.isFixedVersion ? definition.version : void 0);
|
|
1305
1341
|
} else {
|
|
1306
1342
|
throw new Error("Not implemented for given definition");
|
|
1307
1343
|
}
|
|
1308
1344
|
};
|
|
1309
1345
|
|
|
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
1346
|
// src/util/toDataValueQueries.ts
|
|
1316
1347
|
async function toDataValueQueries(value, client, desiredType) {
|
|
1317
1348
|
if (value == null) {
|
|
@@ -1332,13 +1363,13 @@ async function toDataValueQueries(value, client, desiredType) {
|
|
|
1332
1363
|
switch (desiredType.type) {
|
|
1333
1364
|
case "attachment": {
|
|
1334
1365
|
if (isAttachmentUpload(value)) {
|
|
1335
|
-
const attachment = await
|
|
1366
|
+
const attachment = await chunkHDAQ6JIR_cjs.Attachment_exports.upload(client, value.data, {
|
|
1336
1367
|
filename: value.name
|
|
1337
1368
|
});
|
|
1338
1369
|
return attachment.rid;
|
|
1339
1370
|
}
|
|
1340
1371
|
if (isAttachmentFile(value)) {
|
|
1341
|
-
const attachment = await
|
|
1372
|
+
const attachment = await chunkHDAQ6JIR_cjs.Attachment_exports.upload(client, value, {
|
|
1342
1373
|
filename: value.name
|
|
1343
1374
|
});
|
|
1344
1375
|
return attachment.rid;
|
|
@@ -1363,17 +1394,17 @@ async function toDataValueQueries(value, client, desiredType) {
|
|
|
1363
1394
|
break;
|
|
1364
1395
|
}
|
|
1365
1396
|
case "object": {
|
|
1366
|
-
if (
|
|
1397
|
+
if (isObjectSpecifiersObject(value)) {
|
|
1367
1398
|
return value.$primaryKey;
|
|
1368
1399
|
}
|
|
1369
1400
|
break;
|
|
1370
1401
|
}
|
|
1371
1402
|
case "objectSet": {
|
|
1372
|
-
if (
|
|
1403
|
+
if (chunk5JZGGCIW_cjs.isWireObjectSet(value)) {
|
|
1373
1404
|
return value;
|
|
1374
1405
|
}
|
|
1375
|
-
if (
|
|
1376
|
-
return
|
|
1406
|
+
if (chunk5JZGGCIW_cjs.isObjectSet(value)) {
|
|
1407
|
+
return chunk5JZGGCIW_cjs.getWireObjectSet(value);
|
|
1377
1408
|
}
|
|
1378
1409
|
break;
|
|
1379
1410
|
}
|
|
@@ -1382,7 +1413,7 @@ async function toDataValueQueries(value, client, desiredType) {
|
|
|
1382
1413
|
const entrySet = [];
|
|
1383
1414
|
for (const [key, mapValue] of Object.entries(value)) {
|
|
1384
1415
|
entrySet.push({
|
|
1385
|
-
key: desiredType.keyType.type === "object" ?
|
|
1416
|
+
key: desiredType.keyType.type === "object" ? extractPrimaryKeyFromObjectSpecifier(key) : await toDataValueQueries(key, client, desiredType.keyType),
|
|
1386
1417
|
value: await toDataValueQueries(mapValue, client, desiredType.valueType)
|
|
1387
1418
|
});
|
|
1388
1419
|
}
|
|
@@ -1411,17 +1442,16 @@ async function toDataValueQueries(value, client, desiredType) {
|
|
|
1411
1442
|
}
|
|
1412
1443
|
return value;
|
|
1413
1444
|
}
|
|
1414
|
-
function extractPrimaryKeyFromObjectIdentifier(a) {
|
|
1415
|
-
return a.substring(a.indexOf(":") + 1);
|
|
1416
|
-
}
|
|
1417
1445
|
|
|
1418
1446
|
// src/queries/applyQuery.ts
|
|
1419
1447
|
async function applyQuery(client, query, params) {
|
|
1420
|
-
const qd = await client.ontologyProvider.getQueryDefinition(query.apiName);
|
|
1421
|
-
const response = await
|
|
1448
|
+
const qd = await client.ontologyProvider.getQueryDefinition(query.apiName, query.isFixedVersion ? query.version : void 0);
|
|
1449
|
+
const response = await chunkHDAQ6JIR_cjs.Query_exports.execute(chunkHDAQ6JIR_cjs.addUserAgentAndRequestContextHeaders(chunk5JZGGCIW_cjs.augmentRequestContext(client, (_) => ({
|
|
1422
1450
|
finalMethodCall: "applyQuery"
|
|
1423
1451
|
})), query), await client.ontologyRid, query.apiName, {
|
|
1424
1452
|
parameters: params ? await remapQueryParams(params, client, qd.parameters) : {}
|
|
1453
|
+
}, {
|
|
1454
|
+
version: qd.version
|
|
1425
1455
|
});
|
|
1426
1456
|
const objectOutputDefs = await getRequiredDefinitions(qd.output, client);
|
|
1427
1457
|
const remappedResponse = await remapQueryResponse(client, qd.output, response.value, objectOutputDefs);
|
|
@@ -1437,7 +1467,7 @@ async function remapQueryParams(params, client, paramTypes) {
|
|
|
1437
1467
|
async function remapQueryResponse(client, responseDataType, responseValue, definitions) {
|
|
1438
1468
|
if (responseValue == null) {
|
|
1439
1469
|
if (responseDataType.nullable) {
|
|
1440
|
-
return
|
|
1470
|
+
return void 0;
|
|
1441
1471
|
} else {
|
|
1442
1472
|
throw new Error("Got null response when nullable was not allowed");
|
|
1443
1473
|
}
|
|
@@ -1463,11 +1493,11 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
1463
1493
|
return responseValue;
|
|
1464
1494
|
}
|
|
1465
1495
|
case "attachment": {
|
|
1466
|
-
return
|
|
1496
|
+
return chunk5JZGGCIW_cjs.hydrateAttachmentFromRidInternal(client, responseValue);
|
|
1467
1497
|
}
|
|
1468
1498
|
case "object": {
|
|
1469
1499
|
const def = definitions.get(responseDataType.object);
|
|
1470
|
-
if (!def) {
|
|
1500
|
+
if (!def || def.type !== "object") {
|
|
1471
1501
|
throw new Error(`Missing definition for ${responseDataType.object}`);
|
|
1472
1502
|
}
|
|
1473
1503
|
return createQueryObjectResponse(responseValue, def);
|
|
@@ -1478,7 +1508,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
1478
1508
|
throw new Error(`Missing definition for ${responseDataType.objectSet}`);
|
|
1479
1509
|
}
|
|
1480
1510
|
if (typeof responseValue === "string") {
|
|
1481
|
-
return
|
|
1511
|
+
return chunk5JZGGCIW_cjs.createObjectSet(def, client, {
|
|
1482
1512
|
type: "intersect",
|
|
1483
1513
|
objectSets: [{
|
|
1484
1514
|
type: "base",
|
|
@@ -1489,7 +1519,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
1489
1519
|
}]
|
|
1490
1520
|
});
|
|
1491
1521
|
}
|
|
1492
|
-
return
|
|
1522
|
+
return chunk5JZGGCIW_cjs.createObjectSet(def, client, responseValue);
|
|
1493
1523
|
}
|
|
1494
1524
|
case "struct": {
|
|
1495
1525
|
for (const [key, subtype] of Object.entries(responseDataType.struct)) {
|
|
@@ -1501,10 +1531,10 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
1501
1531
|
}
|
|
1502
1532
|
case "map": {
|
|
1503
1533
|
const map = {};
|
|
1504
|
-
!Array.isArray(responseValue) ? process.env.NODE_ENV !== "production" ? invariant__default.default(false, "Expected array entry") : invariant__default.default(false) :
|
|
1534
|
+
!Array.isArray(responseValue) ? process.env.NODE_ENV !== "production" ? invariant__default.default(false, "Expected array entry") : invariant__default.default(false) : void 0;
|
|
1505
1535
|
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) :
|
|
1536
|
+
!entry.key ? process.env.NODE_ENV !== "production" ? invariant__default.default(false, "Expected key") : invariant__default.default(false) : void 0;
|
|
1537
|
+
!entry.value ? process.env.NODE_ENV !== "production" ? invariant__default.default(false, "Expected value") : invariant__default.default(false) : void 0;
|
|
1508
1538
|
const key = responseDataType.keyType.type === "object" ? getObjectSpecifier(entry.key, responseDataType.keyType.object, definitions) : entry.key;
|
|
1509
1539
|
const value = await remapQueryResponse(client, responseDataType.valueType, entry.value, definitions);
|
|
1510
1540
|
map[key] = value;
|
|
@@ -1614,7 +1644,7 @@ function requiresConversion(dataType) {
|
|
|
1614
1644
|
}
|
|
1615
1645
|
function getObjectSpecifier(primaryKey, objectTypeApiName, definitions) {
|
|
1616
1646
|
const def = definitions.get(objectTypeApiName);
|
|
1617
|
-
if (!def) {
|
|
1647
|
+
if (!def || def.type !== "object") {
|
|
1618
1648
|
throw new Error(`Missing definition for ${objectTypeApiName}`);
|
|
1619
1649
|
}
|
|
1620
1650
|
return createObjectSpecifierFromPrimaryKey(def, primaryKey);
|
|
@@ -1622,7 +1652,7 @@ function getObjectSpecifier(primaryKey, objectTypeApiName, definitions) {
|
|
|
1622
1652
|
function createQueryObjectResponse(primaryKey, objectDef) {
|
|
1623
1653
|
return {
|
|
1624
1654
|
$apiName: objectDef.apiName,
|
|
1625
|
-
$title:
|
|
1655
|
+
$title: void 0,
|
|
1626
1656
|
$objectType: objectDef.apiName,
|
|
1627
1657
|
$primaryKey: primaryKey,
|
|
1628
1658
|
$objectSpecifier: createObjectSpecifierFromPrimaryKey(objectDef, primaryKey)
|
|
@@ -1632,16 +1662,16 @@ function createQueryObjectResponse(primaryKey, objectDef) {
|
|
|
1632
1662
|
// src/createClient.ts
|
|
1633
1663
|
var ActionInvoker = class {
|
|
1634
1664
|
constructor(clientCtx, actionDef) {
|
|
1635
|
-
this.applyAction = applyAction.bind(
|
|
1636
|
-
this.batchApplyAction = applyAction.bind(
|
|
1665
|
+
this.applyAction = applyAction.bind(void 0, clientCtx, actionDef);
|
|
1666
|
+
this.batchApplyAction = applyAction.bind(void 0, clientCtx, actionDef);
|
|
1637
1667
|
}
|
|
1638
1668
|
};
|
|
1639
1669
|
var QueryInvoker = class {
|
|
1640
1670
|
constructor(clientCtx, queryDef) {
|
|
1641
|
-
this.executeFunction = applyQuery.bind(
|
|
1671
|
+
this.executeFunction = applyQuery.bind(void 0, clientCtx, queryDef);
|
|
1642
1672
|
}
|
|
1643
1673
|
};
|
|
1644
|
-
function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvider, options =
|
|
1674
|
+
function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvider, options = void 0, fetchFn = fetch) {
|
|
1645
1675
|
if (typeof ontologyRid === "string") {
|
|
1646
1676
|
if (!ontologyRid.startsWith("ri.")) {
|
|
1647
1677
|
throw new Error("Invalid ontology RID");
|
|
@@ -1655,7 +1685,10 @@ function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvi
|
|
|
1655
1685
|
}
|
|
1656
1686
|
const clientCtx = createMinimalClient({
|
|
1657
1687
|
ontologyRid
|
|
1658
|
-
}, baseUrl, tokenProvider,
|
|
1688
|
+
}, baseUrl, tokenProvider, {
|
|
1689
|
+
...options,
|
|
1690
|
+
logger: options?.logger ?? new chunk5JZGGCIW_cjs.MinimalLogger()
|
|
1691
|
+
}, fetchFn, objectSetFactory);
|
|
1659
1692
|
function clientFn(o) {
|
|
1660
1693
|
if (o.type === "object" || o.type === "interface") {
|
|
1661
1694
|
return objectSetFactory(o, clientCtx);
|
|
@@ -1672,7 +1705,7 @@ function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvi
|
|
|
1672
1705
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid.name:
|
|
1673
1706
|
return {
|
|
1674
1707
|
fetchOneByRid: async (objectType, rid, options2) => {
|
|
1675
|
-
return await
|
|
1708
|
+
return await chunk5JZGGCIW_cjs.fetchSingle(clientCtx, objectType, options2, createWithRid([rid]));
|
|
1676
1709
|
}
|
|
1677
1710
|
};
|
|
1678
1711
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference.name:
|
|
@@ -1684,7 +1717,7 @@ function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvi
|
|
|
1684
1717
|
objectType,
|
|
1685
1718
|
propertyType
|
|
1686
1719
|
} = args;
|
|
1687
|
-
return await
|
|
1720
|
+
return await chunkHDAQ6JIR_cjs.MediaReferenceProperty_exports.upload(clientCtx, await clientCtx.ontologyRid, objectType.apiName, propertyType, data, {
|
|
1688
1721
|
mediaItemPath: fileName,
|
|
1689
1722
|
preview: true
|
|
1690
1723
|
});
|
|
@@ -1693,7 +1726,7 @@ function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvi
|
|
|
1693
1726
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid.name:
|
|
1694
1727
|
return {
|
|
1695
1728
|
fetchPageByRid: async (objectOrInterfaceType, rids, options2 = {}) => {
|
|
1696
|
-
return await
|
|
1729
|
+
return await chunkHDAQ6JIR_cjs.fetchPage(clientCtx, objectOrInterfaceType, options2, createWithRid(rids));
|
|
1697
1730
|
}
|
|
1698
1731
|
};
|
|
1699
1732
|
}
|
|
@@ -1702,16 +1735,16 @@ function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvi
|
|
|
1702
1735
|
throw new Error("not implemented");
|
|
1703
1736
|
}
|
|
1704
1737
|
}
|
|
1705
|
-
const fetchMetadata = fetchMetadataInternal.bind(
|
|
1738
|
+
const fetchMetadata = fetchMetadataInternal.bind(void 0, clientCtx);
|
|
1706
1739
|
const symbolClientContext2 = "__osdkClientContext";
|
|
1707
1740
|
const client = Object.defineProperties(clientFn, {
|
|
1708
|
-
[
|
|
1741
|
+
[chunkHDAQ6JIR_cjs.symbolClientContext]: {
|
|
1709
1742
|
value: clientCtx
|
|
1710
1743
|
},
|
|
1711
1744
|
[symbolClientContext2]: {
|
|
1712
1745
|
value: clientCtx
|
|
1713
1746
|
},
|
|
1714
|
-
[
|
|
1747
|
+
[chunkHDAQ6JIR_cjs.additionalContext]: {
|
|
1715
1748
|
value: clientCtx
|
|
1716
1749
|
},
|
|
1717
1750
|
fetchMetadata: {
|
|
@@ -1720,7 +1753,7 @@ function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvi
|
|
|
1720
1753
|
});
|
|
1721
1754
|
return client;
|
|
1722
1755
|
}
|
|
1723
|
-
var createClient = createClientInternal.bind(
|
|
1756
|
+
var createClient = createClientInternal.bind(void 0, chunk5JZGGCIW_cjs.createObjectSet);
|
|
1724
1757
|
function createWithRid(rids) {
|
|
1725
1758
|
const withRid = {
|
|
1726
1759
|
type: "static",
|
|
@@ -1728,13 +1761,13 @@ function createWithRid(rids) {
|
|
|
1728
1761
|
};
|
|
1729
1762
|
return withRid;
|
|
1730
1763
|
}
|
|
1731
|
-
function createPlatformClient(baseUrl, tokenProvider, options =
|
|
1764
|
+
function createPlatformClient(baseUrl, tokenProvider, options = void 0, fetchFn = fetch) {
|
|
1732
1765
|
return shared_client_impl.createSharedClientContext(baseUrl, tokenProvider, USER_AGENT, fetchFn);
|
|
1733
1766
|
}
|
|
1734
1767
|
var isoRegex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})?$/;
|
|
1735
1768
|
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) :
|
|
1769
|
+
!(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;
|
|
1770
|
+
!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
1771
|
return extractDateFromIsoString(dateTime);
|
|
1739
1772
|
};
|
|
1740
1773
|
var extractDateInUTC = (date) => {
|
|
@@ -1762,7 +1795,6 @@ Object.defineProperty(exports, "PalantirApiError", {
|
|
|
1762
1795
|
exports.ActionValidationError = ActionValidationError;
|
|
1763
1796
|
exports.createAttachmentUpload = createAttachmentUpload;
|
|
1764
1797
|
exports.createClient = createClient;
|
|
1765
|
-
exports.createObjectSpecifierFromPrimaryKey = createObjectSpecifierFromPrimaryKey;
|
|
1766
1798
|
exports.createPlatformClient = createPlatformClient;
|
|
1767
1799
|
exports.extractDate = extractDate;
|
|
1768
1800
|
exports.extractDateInLocalTime = extractDateInLocalTime;
|