@osdk/client 2.4.0-beta.1 → 2.4.0-beta.11
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 +138 -0
- package/build/browser/Client.js +1 -1
- package/build/browser/Client.js.map +1 -1
- package/build/browser/MinimalClientContext.js.map +1 -1
- package/build/browser/createClient.js +5 -5
- package/build/browser/createClient.js.map +1 -1
- package/build/browser/createMinimalClient.js +1 -0
- package/build/browser/createMinimalClient.js.map +1 -1
- package/build/browser/fetchMetadata.test.js +14 -0
- package/build/browser/fetchMetadata.test.js.map +1 -1
- package/build/browser/index.js.map +1 -1
- package/build/browser/intellisense.test.js +1 -1
- package/build/browser/intellisense.test.js.map +1 -1
- package/build/browser/internal/conversions/modernToLegacyGroupByClause.js +2 -1
- package/build/browser/internal/conversions/modernToLegacyGroupByClause.js.map +1 -1
- package/build/browser/object/aggregate.test.js +85 -0
- package/build/browser/object/aggregate.test.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/BaseHolder.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/InterfaceHolder.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.js +7 -0
- package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.js +9 -0
- package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects.test.js +241 -1
- package/build/browser/object/convertWireToOsdkObjects.test.js.map +1 -1
- package/build/browser/objectSet/ObjectSet.test.js +20 -0
- package/build/browser/objectSet/ObjectSet.test.js.map +1 -1
- package/build/browser/objectSet/ObjectSetListenerWebsocket.js.map +1 -1
- package/build/browser/objectSet/ObjectSetListenerWebsocket.test.js +1 -1
- package/build/browser/objectSet/ObjectSetListenerWebsocket.test.js.map +1 -1
- package/build/browser/objectSet/createObjectSet.js +22 -0
- package/build/browser/objectSet/createObjectSet.js.map +1 -1
- package/build/browser/observable/ObservableClient.js.map +1 -1
- package/build/browser/observable/internal/ObservableClientImpl.js +1 -0
- package/build/browser/observable/internal/ObservableClientImpl.js.map +1 -1
- package/build/browser/observable/internal/Store.js +7 -0
- package/build/browser/observable/internal/Store.js.map +1 -1
- package/build/browser/ontology/StandardOntologyProvider.js +3 -2
- package/build/browser/ontology/StandardOntologyProvider.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/hydrateObjectSetFromRid.js +4 -1
- package/build/browser/public-utils/hydrateObjectSetFromRid.js.map +1 -1
- package/build/browser/util/UserAgent.js +2 -2
- package/build/browser/util/UserAgent.js.map +1 -1
- package/build/browser/util/deepFreeze.js +26 -0
- package/build/browser/util/deepFreeze.js.map +1 -0
- package/build/cjs/{chunk-YGJRXE4F.cjs → chunk-E5BQ7757.cjs} +53 -16
- package/build/cjs/chunk-E5BQ7757.cjs.map +1 -0
- package/build/cjs/{chunk-Z6X7WQDP.cjs → chunk-NKDL5OWO.cjs} +84 -53
- package/build/cjs/chunk-NKDL5OWO.cjs.map +1 -0
- package/build/cjs/createClient-DJq2ecGM.d.cts +9 -0
- package/build/cjs/index.cjs +6 -6
- package/build/cjs/index.d.cts +5 -8
- package/build/cjs/public/internal.cjs +12 -9
- package/build/cjs/public/internal.cjs.map +1 -1
- package/build/cjs/public/unstable-do-not-use.cjs +27 -15
- package/build/cjs/public/unstable-do-not-use.cjs.map +1 -1
- package/build/cjs/public/unstable-do-not-use.d.cts +3 -1
- package/build/esm/Client.js +1 -1
- package/build/esm/Client.js.map +1 -1
- package/build/esm/MinimalClientContext.js.map +1 -1
- package/build/esm/createClient.js +5 -5
- package/build/esm/createClient.js.map +1 -1
- package/build/esm/createMinimalClient.js +1 -0
- package/build/esm/createMinimalClient.js.map +1 -1
- package/build/esm/fetchMetadata.test.js +14 -0
- package/build/esm/fetchMetadata.test.js.map +1 -1
- package/build/esm/index.js.map +1 -1
- package/build/esm/intellisense.test.js +1 -1
- package/build/esm/intellisense.test.js.map +1 -1
- package/build/esm/internal/conversions/modernToLegacyGroupByClause.js +2 -1
- package/build/esm/internal/conversions/modernToLegacyGroupByClause.js.map +1 -1
- package/build/esm/object/aggregate.test.js +85 -0
- package/build/esm/object/aggregate.test.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/BaseHolder.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/InterfaceHolder.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.js +7 -0
- package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/createOsdkObject.js +9 -0
- package/build/esm/object/convertWireToOsdkObjects/createOsdkObject.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects.test.js +241 -1
- package/build/esm/object/convertWireToOsdkObjects.test.js.map +1 -1
- package/build/esm/objectSet/ObjectSet.test.js +20 -0
- package/build/esm/objectSet/ObjectSet.test.js.map +1 -1
- package/build/esm/objectSet/ObjectSetListenerWebsocket.js.map +1 -1
- package/build/esm/objectSet/ObjectSetListenerWebsocket.test.js +1 -1
- package/build/esm/objectSet/ObjectSetListenerWebsocket.test.js.map +1 -1
- package/build/esm/objectSet/createObjectSet.js +22 -0
- package/build/esm/objectSet/createObjectSet.js.map +1 -1
- package/build/esm/observable/ObservableClient.js.map +1 -1
- package/build/esm/observable/internal/ObservableClientImpl.js +1 -0
- package/build/esm/observable/internal/ObservableClientImpl.js.map +1 -1
- package/build/esm/observable/internal/Store.js +7 -0
- package/build/esm/observable/internal/Store.js.map +1 -1
- package/build/esm/ontology/StandardOntologyProvider.js +3 -2
- package/build/esm/ontology/StandardOntologyProvider.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/hydrateObjectSetFromRid.js +4 -1
- package/build/esm/public-utils/hydrateObjectSetFromRid.js.map +1 -1
- package/build/esm/util/UserAgent.js +2 -2
- package/build/esm/util/UserAgent.js.map +1 -1
- package/build/esm/util/deepFreeze.js +26 -0
- package/build/esm/util/deepFreeze.js.map +1 -0
- package/build/types/Client.d.ts +1 -1
- package/build/types/MinimalClientContext.d.ts +1 -0
- package/build/types/MinimalClientContext.d.ts.map +1 -1
- package/build/types/createClient.d.ts +1 -0
- package/build/types/createClient.d.ts.map +1 -1
- package/build/types/index.d.ts +1 -1
- package/build/types/index.d.ts.map +1 -1
- package/build/types/observable/ObservableClient.d.ts +2 -1
- package/build/types/observable/ObservableClient.d.ts.map +1 -1
- package/build/types/observable/internal/Store.d.ts +2 -1
- package/build/types/observable/internal/Store.d.ts.map +1 -1
- package/build/types/ontology/StandardOntologyProvider.d.ts.map +1 -1
- package/build/types/public/unstable-do-not-use.d.ts +1 -0
- package/build/types/public/unstable-do-not-use.d.ts.map +1 -1
- package/build/types/util/deepFreeze.d.ts +1 -0
- package/build/types/util/deepFreeze.d.ts.map +1 -0
- package/package.json +10 -10
- package/build/cjs/chunk-YGJRXE4F.cjs.map +0 -1
- package/build/cjs/chunk-Z6X7WQDP.cjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkE5BQ7757_cjs = require('./chunk-E5BQ7757.cjs');
|
|
4
4
|
var unstable = require('@osdk/api/unstable');
|
|
5
5
|
var client_unstable = require('@osdk/client.unstable');
|
|
6
6
|
var invariant = require('tiny-invariant');
|
|
@@ -429,19 +429,19 @@ async function toDataValue(value, client, actionMetadata) {
|
|
|
429
429
|
return Promise.all(promiseArray);
|
|
430
430
|
}
|
|
431
431
|
if (isAttachmentUpload(value)) {
|
|
432
|
-
const attachment = await
|
|
432
|
+
const attachment = await chunkE5BQ7757_cjs.Attachment_exports.upload(client, value.data, {
|
|
433
433
|
filename: value.name
|
|
434
434
|
});
|
|
435
435
|
return await toDataValue(attachment.rid, client, actionMetadata);
|
|
436
436
|
}
|
|
437
437
|
if (isAttachmentFile(value)) {
|
|
438
|
-
const attachment = await
|
|
438
|
+
const attachment = await chunkE5BQ7757_cjs.Attachment_exports.upload(client, value, {
|
|
439
439
|
filename: value.name
|
|
440
440
|
});
|
|
441
441
|
return await toDataValue(attachment.rid, client, actionMetadata);
|
|
442
442
|
}
|
|
443
443
|
if (isMediaUpload(value)) {
|
|
444
|
-
const mediaRef = await
|
|
444
|
+
const mediaRef = await chunkE5BQ7757_cjs.MediaReferenceProperty_exports.uploadMedia(client, await client.ontologyRid, actionMetadata.apiName, value.data, {
|
|
445
445
|
mediaItemPath: value.path,
|
|
446
446
|
preview: true
|
|
447
447
|
});
|
|
@@ -456,11 +456,11 @@ async function toDataValue(value, client, actionMetadata) {
|
|
|
456
456
|
if (isPoint(value)) {
|
|
457
457
|
return await toDataValue(`${value.coordinates[1]},${value.coordinates[0]}`, client, actionMetadata);
|
|
458
458
|
}
|
|
459
|
-
if (
|
|
459
|
+
if (chunkE5BQ7757_cjs.isWireObjectSet(value)) {
|
|
460
460
|
return value;
|
|
461
461
|
}
|
|
462
|
-
if (
|
|
463
|
-
return
|
|
462
|
+
if (chunkE5BQ7757_cjs.isObjectSet(value)) {
|
|
463
|
+
return chunkE5BQ7757_cjs.getWireObjectSet(value);
|
|
464
464
|
}
|
|
465
465
|
if (isMediaReference(value)) {
|
|
466
466
|
return value;
|
|
@@ -483,11 +483,11 @@ async function toDataValue(value, client, actionMetadata) {
|
|
|
483
483
|
|
|
484
484
|
// src/actions/applyAction.ts
|
|
485
485
|
async function applyAction(client, action, parameters, options = {}) {
|
|
486
|
-
const clientWithHeaders =
|
|
486
|
+
const clientWithHeaders = chunkE5BQ7757_cjs.addUserAgentAndRequestContextHeaders(chunkE5BQ7757_cjs.augmentRequestContext(client, (_) => ({
|
|
487
487
|
finalMethodCall: "applyAction"
|
|
488
488
|
})), action);
|
|
489
489
|
if (Array.isArray(parameters)) {
|
|
490
|
-
const response = await
|
|
490
|
+
const response = await chunkE5BQ7757_cjs.Action_exports.applyBatch(clientWithHeaders, await client.ontologyRid, action.apiName, {
|
|
491
491
|
requests: parameters ? await remapBatchActionParams(parameters, client, await client.ontologyProvider.getActionDefinition(action.apiName)) : [],
|
|
492
492
|
options: {
|
|
493
493
|
returnEdits: options?.$returnEdits ? "ALL" : "NONE"
|
|
@@ -496,7 +496,7 @@ async function applyAction(client, action, parameters, options = {}) {
|
|
|
496
496
|
const edits = response.edits;
|
|
497
497
|
return options?.$returnEdits ? edits?.type === "edits" ? remapActionResponse(response) : edits : void 0;
|
|
498
498
|
} else {
|
|
499
|
-
const response = await
|
|
499
|
+
const response = await chunkE5BQ7757_cjs.Action_exports.apply(clientWithHeaders, await client.ontologyRid, action.apiName, {
|
|
500
500
|
parameters: await remapActionParams(parameters, client, await client.ontologyProvider.getActionDefinition(action.apiName)),
|
|
501
501
|
options: {
|
|
502
502
|
mode: options?.$validateOnly ? "VALIDATE_ONLY" : "VALIDATE_AND_EXECUTE",
|
|
@@ -701,7 +701,7 @@ var GeotimeSeriesPropertyImpl = class {
|
|
|
701
701
|
}
|
|
702
702
|
}
|
|
703
703
|
async getLatestValue() {
|
|
704
|
-
const latestPointPromise =
|
|
704
|
+
const latestPointPromise = chunkE5BQ7757_cjs.TimeSeriesValueBankProperty_exports.getLatestValue(this.#client, await this.#client.ontologyRid, ...this.#triplet);
|
|
705
705
|
latestPointPromise.then(
|
|
706
706
|
(latestPoint) => this.lastFetchedValue = latestPoint,
|
|
707
707
|
// eslint-disable-next-line no-console
|
|
@@ -717,7 +717,7 @@ var GeotimeSeriesPropertyImpl = class {
|
|
|
717
717
|
return allPoints;
|
|
718
718
|
}
|
|
719
719
|
async *asyncIterValues(query) {
|
|
720
|
-
const streamPointsIterator = await
|
|
720
|
+
const streamPointsIterator = await chunkE5BQ7757_cjs.TimeSeriesValueBankProperty_exports.streamValues(this.#client, await this.#client.ontologyRid, ...this.#triplet, query ? {
|
|
721
721
|
range: getTimeRange(query)
|
|
722
722
|
} : {});
|
|
723
723
|
for await (const timeseriesPoint of asyncIterPointsHelper(streamPointsIterator)) {
|
|
@@ -744,13 +744,13 @@ var MediaReferencePropertyImpl = class {
|
|
|
744
744
|
this.#mediaReference = mediaReference;
|
|
745
745
|
}
|
|
746
746
|
async fetchContents() {
|
|
747
|
-
return
|
|
747
|
+
return chunkE5BQ7757_cjs.MediaReferenceProperty_exports.getMediaContent(this.#client, await this.#client.ontologyRid, ...this.#triplet, {
|
|
748
748
|
preview: true
|
|
749
749
|
// TODO: Can turn this back off when backend is no longer in beta.
|
|
750
750
|
});
|
|
751
751
|
}
|
|
752
752
|
async fetchMetadata() {
|
|
753
|
-
const r = await
|
|
753
|
+
const r = await chunkE5BQ7757_cjs.MediaReferenceProperty_exports.getMediaMetadata(this.#client, await this.#client.ontologyRid, ...this.#triplet, {
|
|
754
754
|
preview: true
|
|
755
755
|
// TODO: Can turn this back off when backend is no longer in beta.
|
|
756
756
|
});
|
|
@@ -774,10 +774,10 @@ var TimeSeriesPropertyImpl = class {
|
|
|
774
774
|
this.#triplet = [objectApiName, primaryKey, propertyName];
|
|
775
775
|
}
|
|
776
776
|
async getFirstPoint() {
|
|
777
|
-
return
|
|
777
|
+
return chunkE5BQ7757_cjs.TimeSeriesPropertyV2_exports.getFirstPoint(this.#client, await this.#client.ontologyRid, ...this.#triplet);
|
|
778
778
|
}
|
|
779
779
|
async getLastPoint() {
|
|
780
|
-
return
|
|
780
|
+
return chunkE5BQ7757_cjs.TimeSeriesPropertyV2_exports.getLastPoint(this.#client, await this.#client.ontologyRid, ...this.#triplet);
|
|
781
781
|
}
|
|
782
782
|
async getAllPoints(query) {
|
|
783
783
|
const allPoints = [];
|
|
@@ -787,7 +787,7 @@ var TimeSeriesPropertyImpl = class {
|
|
|
787
787
|
return allPoints;
|
|
788
788
|
}
|
|
789
789
|
async *asyncIterPoints(query) {
|
|
790
|
-
const streamPointsIterator = await
|
|
790
|
+
const streamPointsIterator = await chunkE5BQ7757_cjs.TimeSeriesPropertyV2_exports.streamPoints(this.#client, await this.#client.ontologyRid, ...this.#triplet, query ? {
|
|
791
791
|
range: getTimeRange(query)
|
|
792
792
|
} : {});
|
|
793
793
|
for await (const timeseriesPoint of asyncIterPointsHelper(streamPointsIterator)) {
|
|
@@ -815,7 +815,7 @@ var ClientRef = Symbol("ClientRef" );
|
|
|
815
815
|
|
|
816
816
|
// src/object/convertWireToOsdkObjects/createOsdkInterface.ts
|
|
817
817
|
function createOsdkInterface(underlying, interfaceDef) {
|
|
818
|
-
const [objApiNamespace] =
|
|
818
|
+
const [objApiNamespace] = chunkE5BQ7757_cjs.extractNamespace(interfaceDef.apiName);
|
|
819
819
|
return Object.freeze(Object.defineProperties({}, {
|
|
820
820
|
// first to minimize hidden classes
|
|
821
821
|
[UnderlyingOsdkObject]: {
|
|
@@ -853,12 +853,19 @@ function createOsdkInterface(underlying, interfaceDef) {
|
|
|
853
853
|
value: clone,
|
|
854
854
|
enumerable: false
|
|
855
855
|
},
|
|
856
|
+
"$__EXPERIMENTAL__NOT_SUPPORTED_YET__metadata": {
|
|
857
|
+
value: {
|
|
858
|
+
"ObjectMetadata": underlying[ObjectDefRef],
|
|
859
|
+
"InterfaceMetadata": interfaceDef
|
|
860
|
+
},
|
|
861
|
+
enumerable: false
|
|
862
|
+
},
|
|
856
863
|
[InterfaceDefRef]: {
|
|
857
864
|
value: interfaceDef
|
|
858
865
|
},
|
|
859
866
|
...Object.fromEntries(Object.keys(interfaceDef.properties).map((p) => {
|
|
860
867
|
const objDef = underlying[ObjectDefRef];
|
|
861
|
-
const [apiNamespace, apiName] =
|
|
868
|
+
const [apiNamespace, apiName] = chunkE5BQ7757_cjs.extractNamespace(p);
|
|
862
869
|
const targetPropName = objDef.interfaceMap[interfaceDef.apiName][p];
|
|
863
870
|
return [apiNamespace === objApiNamespace ? apiName : p, {
|
|
864
871
|
enumerable: targetPropName in underlying,
|
|
@@ -934,8 +941,8 @@ function get$link(holder) {
|
|
|
934
941
|
[objDef.primaryKeyApiName]: rawObj.$primaryKey
|
|
935
942
|
}).pivotTo(linkName);
|
|
936
943
|
const value = !linkDef.multiplicity ? {
|
|
937
|
-
fetchOne: (options) =>
|
|
938
|
-
fetchOneWithErrors: (options) =>
|
|
944
|
+
fetchOne: (options) => chunkE5BQ7757_cjs.fetchSingle(client, objDef, options ?? {}, chunkE5BQ7757_cjs.getWireObjectSet(objectSet)),
|
|
945
|
+
fetchOneWithErrors: (options) => chunkE5BQ7757_cjs.fetchSingleWithErrors(client, objDef, options ?? {}, chunkE5BQ7757_cjs.getWireObjectSet(objectSet))
|
|
939
946
|
} : objectSet;
|
|
940
947
|
return [linkName, value];
|
|
941
948
|
})));
|
|
@@ -982,6 +989,14 @@ var basePropDefs = {
|
|
|
982
989
|
return createObjectSpecifierFromPrimaryKey(this[ObjectDefRef], rawObj.$primaryKey);
|
|
983
990
|
},
|
|
984
991
|
enumerable: true
|
|
992
|
+
},
|
|
993
|
+
"$__EXPERIMENTAL__NOT_SUPPORTED_YET__metadata": {
|
|
994
|
+
get: function() {
|
|
995
|
+
return {
|
|
996
|
+
ObjectMetadata: this[ObjectDefRef]
|
|
997
|
+
};
|
|
998
|
+
},
|
|
999
|
+
enumerable: false
|
|
985
1000
|
}
|
|
986
1001
|
};
|
|
987
1002
|
function createOsdkObject(client, objectDef, simpleOsdkProperties, derivedPropertyTypeByName = {}) {
|
|
@@ -995,6 +1010,7 @@ function createOsdkObject(client, objectDef, simpleOsdkProperties, derivedProper
|
|
|
995
1010
|
value: objectDef,
|
|
996
1011
|
enumerable: false
|
|
997
1012
|
},
|
|
1013
|
+
// TODO: Potentially update when GA metadata field
|
|
998
1014
|
[ClientRef]: {
|
|
999
1015
|
value: client,
|
|
1000
1016
|
enumerable: false
|
|
@@ -1019,9 +1035,9 @@ function modifyRdpProperties(client, derivedPropertyTypeByName, rawValue, propKe
|
|
|
1019
1035
|
switch (derivedPropertyTypeByName[propKey].selectedOrCollectedPropertyType?.type) {
|
|
1020
1036
|
case "attachment":
|
|
1021
1037
|
if (Array.isArray(rawValue)) {
|
|
1022
|
-
return rawValue.map((a) =>
|
|
1038
|
+
return rawValue.map((a) => chunkE5BQ7757_cjs.hydrateAttachmentFromRidInternal(client, a.rid));
|
|
1023
1039
|
} else {
|
|
1024
|
-
return
|
|
1040
|
+
return chunkE5BQ7757_cjs.hydrateAttachmentFromRidInternal(client, rawValue.rid);
|
|
1025
1041
|
}
|
|
1026
1042
|
default:
|
|
1027
1043
|
process.env.NODE_ENV !== "production" ? invariant__default.default(false, "Derived property aggregations for Timeseries and Media are not supported") : invariant__default.default(false) ;
|
|
@@ -1037,9 +1053,9 @@ function createSpecialProperty(client, objectDef, rawObject, p) {
|
|
|
1037
1053
|
}
|
|
1038
1054
|
if (propDef.type === "attachment") {
|
|
1039
1055
|
if (Array.isArray(rawValue)) {
|
|
1040
|
-
return rawValue.map((a) =>
|
|
1056
|
+
return rawValue.map((a) => chunkE5BQ7757_cjs.hydrateAttachmentFromRidInternal(client, a.rid));
|
|
1041
1057
|
}
|
|
1042
|
-
return
|
|
1058
|
+
return chunkE5BQ7757_cjs.hydrateAttachmentFromRidInternal(client, rawValue.rid);
|
|
1043
1059
|
}
|
|
1044
1060
|
if (propDef.type === "numericTimeseries" || propDef.type === "stringTimeseries" || propDef.type === "sensorTimeseries") {
|
|
1045
1061
|
return new TimeSeriesPropertyImpl(client, objectDef.apiName, rawObject[objectDef.primaryKeyApiName], p);
|
|
@@ -1246,12 +1262,23 @@ function createAsyncClientCache(fn, createCacheLocal = createClientCache) {
|
|
|
1246
1262
|
};
|
|
1247
1263
|
return ret;
|
|
1248
1264
|
}
|
|
1265
|
+
|
|
1266
|
+
// src/util/deepFreeze.ts
|
|
1267
|
+
function deepFreeze(obj) {
|
|
1268
|
+
Object.getOwnPropertyNames(obj).forEach((name) => {
|
|
1269
|
+
const prop = obj[name];
|
|
1270
|
+
if (typeof prop === "object" && prop != null && !Object.isFrozen(prop)) {
|
|
1271
|
+
deepFreeze(prop);
|
|
1272
|
+
}
|
|
1273
|
+
});
|
|
1274
|
+
return Object.freeze(obj);
|
|
1275
|
+
}
|
|
1249
1276
|
async function loadActionMetadata(client, actionType) {
|
|
1250
|
-
const r = await
|
|
1277
|
+
const r = await chunkE5BQ7757_cjs.ActionTypeV2_exports.get(client, await client.ontologyRid, actionType);
|
|
1251
1278
|
return generatorConverters.wireActionTypeV2ToSdkActionMetadata(r);
|
|
1252
1279
|
}
|
|
1253
1280
|
async function loadFullObjectMetadata(client, objectType) {
|
|
1254
|
-
const full = await
|
|
1281
|
+
const full = await chunkE5BQ7757_cjs.ObjectTypeV2_exports.getFullMetadata(client, await client.ontologyRid, objectType, {
|
|
1255
1282
|
preview: true
|
|
1256
1283
|
});
|
|
1257
1284
|
const ret = generatorConverters.wireObjectTypeFullMetadataToSdkObjectMetadata(full, true);
|
|
@@ -1260,14 +1287,14 @@ async function loadFullObjectMetadata(client, objectType) {
|
|
|
1260
1287
|
};
|
|
1261
1288
|
}
|
|
1262
1289
|
async function loadInterfaceMetadata(client, objectType) {
|
|
1263
|
-
const r = await
|
|
1290
|
+
const r = await chunkE5BQ7757_cjs.OntologyInterface_exports.get(client, await client.ontologyRid, objectType, {
|
|
1264
1291
|
preview: true
|
|
1265
1292
|
});
|
|
1266
1293
|
return generatorConverters.__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(r, true);
|
|
1267
1294
|
}
|
|
1268
1295
|
async function loadQueryMetadata(client, queryTypeApiNameAndVersion) {
|
|
1269
1296
|
const [apiName, version] = queryTypeApiNameAndVersion.split(":");
|
|
1270
|
-
const r = await
|
|
1297
|
+
const r = await chunkE5BQ7757_cjs.QueryType_exports.get(client, await client.ontologyRid, apiName, {
|
|
1271
1298
|
version
|
|
1272
1299
|
});
|
|
1273
1300
|
return generatorConverters.wireQueryTypeV2ToSdkQueryMetadata(r);
|
|
@@ -1286,10 +1313,10 @@ var createStandardOntologyProviderFactory = (client) => {
|
|
|
1286
1313
|
...objectDef,
|
|
1287
1314
|
[InterfaceDefinitions]: interfaceDefs
|
|
1288
1315
|
};
|
|
1289
|
-
return fullObjectDef;
|
|
1316
|
+
return deepFreeze(fullObjectDef);
|
|
1290
1317
|
}
|
|
1291
1318
|
async function loadInterface(client3, key) {
|
|
1292
|
-
return loadInterfaceMetadata(client3, key);
|
|
1319
|
+
return deepFreeze(await loadInterfaceMetadata(client3, key));
|
|
1293
1320
|
}
|
|
1294
1321
|
async function loadQuery(client3, key) {
|
|
1295
1322
|
return loadQueryMetadata(client3, key);
|
|
@@ -1324,11 +1351,11 @@ var createStandardOntologyProviderFactory = (client) => {
|
|
|
1324
1351
|
};
|
|
1325
1352
|
|
|
1326
1353
|
// src/util/UserAgent.ts
|
|
1327
|
-
var USER_AGENT = `osdk-client/${"2.4.0-beta.
|
|
1328
|
-
var OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.4.0-beta.
|
|
1354
|
+
var USER_AGENT = `osdk-client/${"2.4.0-beta.11"}`;
|
|
1355
|
+
var OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.4.0-beta.11"}`;
|
|
1329
1356
|
|
|
1330
1357
|
// src/createMinimalClient.ts
|
|
1331
|
-
function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory =
|
|
1358
|
+
function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory = chunkE5BQ7757_cjs.createObjectSet, createOntologyProviderFactory = createStandardOntologyProviderFactory) {
|
|
1332
1359
|
if (process.env.NODE_ENV !== "production") {
|
|
1333
1360
|
try {
|
|
1334
1361
|
new URL(baseUrl);
|
|
@@ -1346,6 +1373,7 @@ function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fet
|
|
|
1346
1373
|
objectFactory2: convertWireToOsdkObjects2,
|
|
1347
1374
|
ontologyRid: metadata.ontologyRid,
|
|
1348
1375
|
logger: options.logger,
|
|
1376
|
+
transactionRid: options.transactionRid,
|
|
1349
1377
|
clientCacheKey: {},
|
|
1350
1378
|
requestContext: {}
|
|
1351
1379
|
};
|
|
@@ -1393,13 +1421,13 @@ async function toDataValueQueries(value, client, desiredType) {
|
|
|
1393
1421
|
switch (desiredType.type) {
|
|
1394
1422
|
case "attachment": {
|
|
1395
1423
|
if (isAttachmentUpload(value)) {
|
|
1396
|
-
const attachment = await
|
|
1424
|
+
const attachment = await chunkE5BQ7757_cjs.Attachment_exports.upload(client, value.data, {
|
|
1397
1425
|
filename: value.name
|
|
1398
1426
|
});
|
|
1399
1427
|
return attachment.rid;
|
|
1400
1428
|
}
|
|
1401
1429
|
if (isAttachmentFile(value)) {
|
|
1402
|
-
const attachment = await
|
|
1430
|
+
const attachment = await chunkE5BQ7757_cjs.Attachment_exports.upload(client, value, {
|
|
1403
1431
|
filename: value.name
|
|
1404
1432
|
});
|
|
1405
1433
|
return attachment.rid;
|
|
@@ -1430,11 +1458,11 @@ async function toDataValueQueries(value, client, desiredType) {
|
|
|
1430
1458
|
break;
|
|
1431
1459
|
}
|
|
1432
1460
|
case "objectSet": {
|
|
1433
|
-
if (
|
|
1461
|
+
if (chunkE5BQ7757_cjs.isWireObjectSet(value)) {
|
|
1434
1462
|
return value;
|
|
1435
1463
|
}
|
|
1436
|
-
if (
|
|
1437
|
-
return
|
|
1464
|
+
if (chunkE5BQ7757_cjs.isObjectSet(value)) {
|
|
1465
|
+
return chunkE5BQ7757_cjs.getWireObjectSet(value);
|
|
1438
1466
|
}
|
|
1439
1467
|
break;
|
|
1440
1468
|
}
|
|
@@ -1476,7 +1504,7 @@ async function toDataValueQueries(value, client, desiredType) {
|
|
|
1476
1504
|
// src/queries/applyQuery.ts
|
|
1477
1505
|
async function applyQuery(client, query, params) {
|
|
1478
1506
|
const qd = await client.ontologyProvider.getQueryDefinition(query.apiName, query.isFixedVersion ? query.version : void 0);
|
|
1479
|
-
const response = await
|
|
1507
|
+
const response = await chunkE5BQ7757_cjs.Query_exports.execute(chunkE5BQ7757_cjs.addUserAgentAndRequestContextHeaders(chunkE5BQ7757_cjs.augmentRequestContext(client, (_) => ({
|
|
1480
1508
|
finalMethodCall: "applyQuery"
|
|
1481
1509
|
})), query), await client.ontologyRid, query.apiName, {
|
|
1482
1510
|
parameters: params ? await remapQueryParams(params, client, qd.parameters) : {}
|
|
@@ -1523,7 +1551,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
1523
1551
|
return responseValue;
|
|
1524
1552
|
}
|
|
1525
1553
|
case "attachment": {
|
|
1526
|
-
return
|
|
1554
|
+
return chunkE5BQ7757_cjs.hydrateAttachmentFromRidInternal(client, responseValue);
|
|
1527
1555
|
}
|
|
1528
1556
|
case "object": {
|
|
1529
1557
|
const def = definitions.get(responseDataType.object);
|
|
@@ -1538,7 +1566,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
1538
1566
|
throw new Error(`Missing definition for ${responseDataType.objectSet}`);
|
|
1539
1567
|
}
|
|
1540
1568
|
if (typeof responseValue === "string") {
|
|
1541
|
-
return
|
|
1569
|
+
return chunkE5BQ7757_cjs.createObjectSet(def, client, {
|
|
1542
1570
|
type: "intersect",
|
|
1543
1571
|
objectSets: [{
|
|
1544
1572
|
type: "base",
|
|
@@ -1549,7 +1577,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
1549
1577
|
}]
|
|
1550
1578
|
});
|
|
1551
1579
|
}
|
|
1552
|
-
return
|
|
1580
|
+
return chunkE5BQ7757_cjs.createObjectSet(def, client, responseValue);
|
|
1553
1581
|
}
|
|
1554
1582
|
case "struct": {
|
|
1555
1583
|
for (const [key, subtype] of Object.entries(responseDataType.struct)) {
|
|
@@ -1705,7 +1733,7 @@ var QueryInvoker = class {
|
|
|
1705
1733
|
this.executeFunction = applyQuery.bind(void 0, clientCtx, queryDef);
|
|
1706
1734
|
}
|
|
1707
1735
|
};
|
|
1708
|
-
function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvider, options = void 0, fetchFn = fetch) {
|
|
1736
|
+
function createClientInternal(objectSetFactory, transactionRid, baseUrl, ontologyRid, tokenProvider, options = void 0, fetchFn = fetch) {
|
|
1709
1737
|
if (typeof ontologyRid === "string") {
|
|
1710
1738
|
if (!ontologyRid.startsWith("ri.")) {
|
|
1711
1739
|
throw new Error("Invalid ontology RID");
|
|
@@ -1721,7 +1749,8 @@ function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvi
|
|
|
1721
1749
|
ontologyRid
|
|
1722
1750
|
}, baseUrl, tokenProvider, {
|
|
1723
1751
|
...options,
|
|
1724
|
-
logger: options?.logger ?? new
|
|
1752
|
+
logger: options?.logger ?? new chunkE5BQ7757_cjs.MinimalLogger(),
|
|
1753
|
+
transactionRid
|
|
1725
1754
|
}, fetchFn, objectSetFactory);
|
|
1726
1755
|
return createClientFromContext(clientCtx);
|
|
1727
1756
|
}
|
|
@@ -1742,7 +1771,7 @@ function createClientFromContext(clientCtx) {
|
|
|
1742
1771
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid.name:
|
|
1743
1772
|
return {
|
|
1744
1773
|
fetchOneByRid: async (objectType, rid, options) => {
|
|
1745
|
-
return await
|
|
1774
|
+
return await chunkE5BQ7757_cjs.fetchSingle(clientCtx, objectType, options, createWithRid([rid]));
|
|
1746
1775
|
}
|
|
1747
1776
|
};
|
|
1748
1777
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference.name:
|
|
@@ -1754,7 +1783,7 @@ function createClientFromContext(clientCtx) {
|
|
|
1754
1783
|
objectType,
|
|
1755
1784
|
propertyType
|
|
1756
1785
|
} = args;
|
|
1757
|
-
return await
|
|
1786
|
+
return await chunkE5BQ7757_cjs.MediaReferenceProperty_exports.upload(clientCtx, await clientCtx.ontologyRid, objectType.apiName, propertyType, data, {
|
|
1758
1787
|
mediaItemPath: fileName,
|
|
1759
1788
|
preview: true
|
|
1760
1789
|
});
|
|
@@ -1763,7 +1792,7 @@ function createClientFromContext(clientCtx) {
|
|
|
1763
1792
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid.name:
|
|
1764
1793
|
return {
|
|
1765
1794
|
fetchPageByRid: async (objectOrInterfaceType, rids, options = {}) => {
|
|
1766
|
-
return await
|
|
1795
|
+
return await chunkE5BQ7757_cjs.fetchPage(clientCtx, objectOrInterfaceType, options, createWithRid(rids));
|
|
1767
1796
|
}
|
|
1768
1797
|
};
|
|
1769
1798
|
}
|
|
@@ -1775,13 +1804,13 @@ function createClientFromContext(clientCtx) {
|
|
|
1775
1804
|
const fetchMetadata = fetchMetadataInternal.bind(void 0, clientCtx);
|
|
1776
1805
|
const symbolClientContext2 = "__osdkClientContext";
|
|
1777
1806
|
const client = Object.defineProperties(clientFn, {
|
|
1778
|
-
[
|
|
1807
|
+
[chunkE5BQ7757_cjs.symbolClientContext]: {
|
|
1779
1808
|
value: clientCtx
|
|
1780
1809
|
},
|
|
1781
1810
|
[symbolClientContext2]: {
|
|
1782
1811
|
value: clientCtx
|
|
1783
1812
|
},
|
|
1784
|
-
[
|
|
1813
|
+
[chunkE5BQ7757_cjs.additionalContext]: {
|
|
1785
1814
|
value: clientCtx
|
|
1786
1815
|
},
|
|
1787
1816
|
fetchMetadata: {
|
|
@@ -1790,7 +1819,8 @@ function createClientFromContext(clientCtx) {
|
|
|
1790
1819
|
});
|
|
1791
1820
|
return client;
|
|
1792
1821
|
}
|
|
1793
|
-
var createClient = createClientInternal.bind(void 0,
|
|
1822
|
+
var createClient = createClientInternal.bind(void 0, chunkE5BQ7757_cjs.createObjectSet, void 0);
|
|
1823
|
+
var createClientWithTransaction = (transactionRid, ...args) => createClientInternal(chunkE5BQ7757_cjs.createObjectSet, transactionRid, ...args);
|
|
1794
1824
|
function createWithRid(rids) {
|
|
1795
1825
|
const withRid = {
|
|
1796
1826
|
type: "static",
|
|
@@ -1807,5 +1837,6 @@ exports.UnderlyingOsdkObject = UnderlyingOsdkObject;
|
|
|
1807
1837
|
exports.createAttachmentUpload = createAttachmentUpload;
|
|
1808
1838
|
exports.createClient = createClient;
|
|
1809
1839
|
exports.createClientFromContext = createClientFromContext;
|
|
1810
|
-
|
|
1811
|
-
//# sourceMappingURL=chunk-
|
|
1840
|
+
exports.createClientWithTransaction = createClientWithTransaction;
|
|
1841
|
+
//# sourceMappingURL=chunk-NKDL5OWO.cjs.map
|
|
1842
|
+
//# sourceMappingURL=chunk-NKDL5OWO.cjs.map
|