@osdk/client 2.4.0-beta.16 → 2.4.0-beta.18
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 +24 -0
- package/build/browser/index.js +1 -0
- package/build/browser/index.js.map +1 -1
- package/build/browser/object/fetchPage.js +4 -2
- package/build/browser/object/fetchPage.js.map +1 -1
- package/build/browser/queries/applyQuery.js +24 -1
- package/build/browser/queries/applyQuery.js.map +1 -1
- package/build/browser/queries/queries.test.js +27 -2
- package/build/browser/queries/queries.test.js.map +1 -1
- package/build/browser/queries/types.js.map +1 -1
- package/build/browser/util/UserAgent.js +2 -2
- package/build/browser/util/WireObjectSet.js +1 -1
- package/build/browser/util/WireObjectSet.js.map +1 -1
- package/build/browser/util/extractObjectOrInterfaceType.js +96 -0
- package/build/browser/util/extractObjectOrInterfaceType.js.map +1 -0
- package/build/browser/util/extractObjectOrInterfaceType.test.js +135 -0
- package/build/browser/util/extractObjectOrInterfaceType.test.js.map +1 -0
- package/build/browser/util/interfaceUtils.js +10 -0
- package/build/browser/util/interfaceUtils.js.map +1 -1
- package/build/browser/util/objectSpecifierUtils.js +12 -0
- package/build/browser/util/objectSpecifierUtils.js.map +1 -1
- package/build/browser/util/toDataValueQueries.js +11 -0
- package/build/browser/util/toDataValueQueries.js.map +1 -1
- package/build/cjs/{Client-CgL2LKN9.d.cts → Client-CF85LpFu.d.cts} +2 -2
- package/build/cjs/{chunk-GLEZ4Z7K.cjs → chunk-TIAQODA6.cjs} +100 -60
- package/build/cjs/chunk-TIAQODA6.cjs.map +1 -0
- package/build/cjs/{chunk-L3OU54Q5.cjs → chunk-XZOADDY6.cjs} +107 -34
- package/build/cjs/chunk-XZOADDY6.cjs.map +1 -0
- package/build/cjs/{createClient-DJq2ecGM.d.cts → createClient-BJo8T7Js.d.cts} +1 -1
- package/build/cjs/index.cjs +10 -6
- package/build/cjs/index.d.cts +14 -4
- package/build/cjs/public/internal.cjs +8 -8
- package/build/cjs/public/internal.d.cts +1 -1
- package/build/cjs/public/unstable-do-not-use.cjs +16 -16
- package/build/cjs/public/unstable-do-not-use.d.cts +2 -2
- package/build/esm/index.js +1 -0
- package/build/esm/index.js.map +1 -1
- package/build/esm/object/fetchPage.js +4 -2
- package/build/esm/object/fetchPage.js.map +1 -1
- package/build/esm/queries/applyQuery.js +24 -1
- package/build/esm/queries/applyQuery.js.map +1 -1
- package/build/esm/queries/queries.test.js +27 -2
- package/build/esm/queries/queries.test.js.map +1 -1
- package/build/esm/queries/types.js.map +1 -1
- package/build/esm/util/UserAgent.js +2 -2
- package/build/esm/util/WireObjectSet.js +1 -1
- package/build/esm/util/WireObjectSet.js.map +1 -1
- package/build/esm/util/extractObjectOrInterfaceType.js +96 -0
- package/build/esm/util/extractObjectOrInterfaceType.js.map +1 -0
- package/build/esm/util/extractObjectOrInterfaceType.test.js +135 -0
- package/build/esm/util/extractObjectOrInterfaceType.test.js.map +1 -0
- package/build/esm/util/interfaceUtils.js +10 -0
- package/build/esm/util/interfaceUtils.js.map +1 -1
- package/build/esm/util/objectSpecifierUtils.js +12 -0
- package/build/esm/util/objectSpecifierUtils.js.map +1 -1
- package/build/esm/util/toDataValueQueries.js +11 -0
- package/build/esm/util/toDataValueQueries.js.map +1 -1
- package/build/types/index.d.ts +1 -0
- package/build/types/index.d.ts.map +1 -1
- package/build/types/object/fetchPage.d.ts.map +1 -1
- package/build/types/queries/applyQuery.d.ts +5 -1
- package/build/types/queries/applyQuery.d.ts.map +1 -1
- package/build/types/queries/types.d.ts +2 -2
- package/build/types/queries/types.d.ts.map +1 -1
- package/build/types/util/extractObjectOrInterfaceType.d.ts +1 -0
- package/build/types/util/extractObjectOrInterfaceType.d.ts.map +1 -0
- package/build/types/util/extractObjectOrInterfaceType.test.d.ts +1 -0
- package/build/types/util/extractObjectOrInterfaceType.test.d.ts.map +1 -0
- package/build/types/util/objectSpecifierUtils.d.ts +13 -1
- package/build/types/util/objectSpecifierUtils.d.ts.map +1 -1
- package/package.json +8 -8
- package/build/cjs/chunk-GLEZ4Z7K.cjs.map +0 -1
- package/build/cjs/chunk-L3OU54Q5.cjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkXZOADDY6_cjs = require('./chunk-XZOADDY6.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');
|
|
@@ -34,6 +34,17 @@ function createAttachmentUpload(data, name) {
|
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
// src/util/objectSpecifierUtils.ts
|
|
38
|
+
function createObjectSpecifierFromPrimaryKey(objectDef, primaryKey) {
|
|
39
|
+
return `${objectDef.apiName}:${primaryKey}`;
|
|
40
|
+
}
|
|
41
|
+
function createObjectSpecifierFromInterfaceSpecifier(interfaceDef, interfaceSpecifier) {
|
|
42
|
+
return `${interfaceSpecifier.objectTypeApiName}:${interfaceSpecifier.primaryKeyValue}`;
|
|
43
|
+
}
|
|
44
|
+
function extractPrimaryKeyFromObjectSpecifier(ObjectSpecifier) {
|
|
45
|
+
return ObjectSpecifier.split(":")[1];
|
|
46
|
+
}
|
|
47
|
+
|
|
37
48
|
// src/objectSet/conjureUnionType.ts
|
|
38
49
|
function conjureUnionType(type, value) {
|
|
39
50
|
return {
|
|
@@ -392,6 +403,12 @@ function isMediaUpload(o) {
|
|
|
392
403
|
function isInterfaceActionParam(o) {
|
|
393
404
|
return o != null && typeof o === "object" && "$objectType" in o && "$primaryKey" in o;
|
|
394
405
|
}
|
|
406
|
+
function isInterfaceQueryParam(o) {
|
|
407
|
+
return o != null && typeof o === "object" && "$objectType" in o && "$primaryKey" in o;
|
|
408
|
+
}
|
|
409
|
+
function isInterfaceSpecifier(o) {
|
|
410
|
+
return o != null && typeof o === "object" && "$objectType" in o && "$primaryKey" in o && o.$objectType !== o.$apiName;
|
|
411
|
+
}
|
|
395
412
|
|
|
396
413
|
// src/util/isObjectSpecifiersObject.ts
|
|
397
414
|
function isObjectSpecifiersObject(o) {
|
|
@@ -429,19 +446,19 @@ async function toDataValue(value, client, actionMetadata) {
|
|
|
429
446
|
return Promise.all(promiseArray);
|
|
430
447
|
}
|
|
431
448
|
if (isAttachmentUpload(value)) {
|
|
432
|
-
const attachment = await
|
|
449
|
+
const attachment = await chunkXZOADDY6_cjs.Attachment_exports.upload(client, value.data, {
|
|
433
450
|
filename: value.name
|
|
434
451
|
});
|
|
435
452
|
return await toDataValue(attachment.rid, client, actionMetadata);
|
|
436
453
|
}
|
|
437
454
|
if (isAttachmentFile(value)) {
|
|
438
|
-
const attachment = await
|
|
455
|
+
const attachment = await chunkXZOADDY6_cjs.Attachment_exports.upload(client, value, {
|
|
439
456
|
filename: value.name
|
|
440
457
|
});
|
|
441
458
|
return await toDataValue(attachment.rid, client, actionMetadata);
|
|
442
459
|
}
|
|
443
460
|
if (isMediaUpload(value)) {
|
|
444
|
-
const mediaRef = await
|
|
461
|
+
const mediaRef = await chunkXZOADDY6_cjs.MediaReferenceProperty_exports.uploadMedia(client, await client.ontologyRid, actionMetadata.apiName, value.data, {
|
|
445
462
|
mediaItemPath: value.path,
|
|
446
463
|
preview: true
|
|
447
464
|
});
|
|
@@ -456,11 +473,11 @@ async function toDataValue(value, client, actionMetadata) {
|
|
|
456
473
|
if (isPoint(value)) {
|
|
457
474
|
return await toDataValue(`${value.coordinates[1]},${value.coordinates[0]}`, client, actionMetadata);
|
|
458
475
|
}
|
|
459
|
-
if (
|
|
476
|
+
if (chunkXZOADDY6_cjs.isWireObjectSet(value)) {
|
|
460
477
|
return value;
|
|
461
478
|
}
|
|
462
|
-
if (
|
|
463
|
-
return
|
|
479
|
+
if (chunkXZOADDY6_cjs.isObjectSet(value)) {
|
|
480
|
+
return chunkXZOADDY6_cjs.getWireObjectSet(value);
|
|
464
481
|
}
|
|
465
482
|
if (isMediaReference(value)) {
|
|
466
483
|
return value;
|
|
@@ -483,11 +500,11 @@ async function toDataValue(value, client, actionMetadata) {
|
|
|
483
500
|
|
|
484
501
|
// src/actions/applyAction.ts
|
|
485
502
|
async function applyAction(client, action, parameters, options = {}) {
|
|
486
|
-
const clientWithHeaders =
|
|
503
|
+
const clientWithHeaders = chunkXZOADDY6_cjs.addUserAgentAndRequestContextHeaders(chunkXZOADDY6_cjs.augmentRequestContext(client, (_) => ({
|
|
487
504
|
finalMethodCall: "applyAction"
|
|
488
505
|
})), action);
|
|
489
506
|
if (Array.isArray(parameters)) {
|
|
490
|
-
const response = await
|
|
507
|
+
const response = await chunkXZOADDY6_cjs.Action_exports.applyBatch(clientWithHeaders, await client.ontologyRid, action.apiName, {
|
|
491
508
|
requests: parameters ? await remapBatchActionParams(parameters, client, await client.ontologyProvider.getActionDefinition(action.apiName)) : [],
|
|
492
509
|
options: {
|
|
493
510
|
returnEdits: options?.$returnEdits ? "ALL" : "NONE"
|
|
@@ -496,7 +513,7 @@ async function applyAction(client, action, parameters, options = {}) {
|
|
|
496
513
|
const edits = response.edits;
|
|
497
514
|
return options?.$returnEdits ? edits?.type === "edits" ? remapActionResponse(response) : edits : void 0;
|
|
498
515
|
} else {
|
|
499
|
-
const response = await
|
|
516
|
+
const response = await chunkXZOADDY6_cjs.Action_exports.apply(clientWithHeaders, await client.ontologyRid, action.apiName, {
|
|
500
517
|
parameters: await remapActionParams(parameters, client, await client.ontologyProvider.getActionDefinition(action.apiName)),
|
|
501
518
|
options: {
|
|
502
519
|
mode: options?.$validateOnly ? "VALIDATE_ONLY" : "VALIDATE_AND_EXECUTE",
|
|
@@ -701,7 +718,7 @@ var GeotimeSeriesPropertyImpl = class {
|
|
|
701
718
|
}
|
|
702
719
|
}
|
|
703
720
|
async getLatestValue() {
|
|
704
|
-
const latestPointPromise =
|
|
721
|
+
const latestPointPromise = chunkXZOADDY6_cjs.TimeSeriesValueBankProperty_exports.getLatestValue(this.#client, await this.#client.ontologyRid, ...this.#triplet);
|
|
705
722
|
latestPointPromise.then(
|
|
706
723
|
(latestPoint) => this.lastFetchedValue = latestPoint,
|
|
707
724
|
// eslint-disable-next-line no-console
|
|
@@ -717,7 +734,7 @@ var GeotimeSeriesPropertyImpl = class {
|
|
|
717
734
|
return allPoints;
|
|
718
735
|
}
|
|
719
736
|
async *asyncIterValues(query) {
|
|
720
|
-
const streamPointsIterator = await
|
|
737
|
+
const streamPointsIterator = await chunkXZOADDY6_cjs.TimeSeriesValueBankProperty_exports.streamValues(this.#client, await this.#client.ontologyRid, ...this.#triplet, query ? {
|
|
721
738
|
range: getTimeRange(query)
|
|
722
739
|
} : {});
|
|
723
740
|
for await (const timeseriesPoint of asyncIterPointsHelper(streamPointsIterator)) {
|
|
@@ -744,13 +761,13 @@ var MediaReferencePropertyImpl = class {
|
|
|
744
761
|
this.#mediaReference = mediaReference;
|
|
745
762
|
}
|
|
746
763
|
async fetchContents() {
|
|
747
|
-
return
|
|
764
|
+
return chunkXZOADDY6_cjs.MediaReferenceProperty_exports.getMediaContent(this.#client, await this.#client.ontologyRid, ...this.#triplet, {
|
|
748
765
|
preview: true
|
|
749
766
|
// TODO: Can turn this back off when backend is no longer in beta.
|
|
750
767
|
});
|
|
751
768
|
}
|
|
752
769
|
async fetchMetadata() {
|
|
753
|
-
const r = await
|
|
770
|
+
const r = await chunkXZOADDY6_cjs.MediaReferenceProperty_exports.getMediaMetadata(this.#client, await this.#client.ontologyRid, ...this.#triplet, {
|
|
754
771
|
preview: true
|
|
755
772
|
// TODO: Can turn this back off when backend is no longer in beta.
|
|
756
773
|
});
|
|
@@ -774,10 +791,10 @@ var TimeSeriesPropertyImpl = class {
|
|
|
774
791
|
this.#triplet = [objectApiName, primaryKey, propertyName];
|
|
775
792
|
}
|
|
776
793
|
async getFirstPoint() {
|
|
777
|
-
return
|
|
794
|
+
return chunkXZOADDY6_cjs.TimeSeriesPropertyV2_exports.getFirstPoint(this.#client, await this.#client.ontologyRid, ...this.#triplet);
|
|
778
795
|
}
|
|
779
796
|
async getLastPoint() {
|
|
780
|
-
return
|
|
797
|
+
return chunkXZOADDY6_cjs.TimeSeriesPropertyV2_exports.getLastPoint(this.#client, await this.#client.ontologyRid, ...this.#triplet);
|
|
781
798
|
}
|
|
782
799
|
async getAllPoints(query) {
|
|
783
800
|
const allPoints = [];
|
|
@@ -787,7 +804,7 @@ var TimeSeriesPropertyImpl = class {
|
|
|
787
804
|
return allPoints;
|
|
788
805
|
}
|
|
789
806
|
async *asyncIterPoints(query) {
|
|
790
|
-
const streamPointsIterator = await
|
|
807
|
+
const streamPointsIterator = await chunkXZOADDY6_cjs.TimeSeriesPropertyV2_exports.streamPoints(this.#client, await this.#client.ontologyRid, ...this.#triplet, query ? {
|
|
791
808
|
range: getTimeRange(query)
|
|
792
809
|
} : {});
|
|
793
810
|
for await (const timeseriesPoint of asyncIterPointsHelper(streamPointsIterator)) {
|
|
@@ -796,14 +813,6 @@ var TimeSeriesPropertyImpl = class {
|
|
|
796
813
|
}
|
|
797
814
|
};
|
|
798
815
|
|
|
799
|
-
// src/util/objectSpecifierUtils.ts
|
|
800
|
-
function createObjectSpecifierFromPrimaryKey(objectDef, primaryKey) {
|
|
801
|
-
return `${objectDef.apiName}:${primaryKey}`;
|
|
802
|
-
}
|
|
803
|
-
function extractPrimaryKeyFromObjectSpecifier(ObjectSpecifier) {
|
|
804
|
-
return ObjectSpecifier.split(":")[1];
|
|
805
|
-
}
|
|
806
|
-
|
|
807
816
|
// src/ontology/OntologyProvider.ts
|
|
808
817
|
var InterfaceDefinitions = Symbol("InterfaceDefinitions" );
|
|
809
818
|
|
|
@@ -815,7 +824,7 @@ var ClientRef = Symbol("ClientRef" );
|
|
|
815
824
|
|
|
816
825
|
// src/object/convertWireToOsdkObjects/createOsdkInterface.ts
|
|
817
826
|
function createOsdkInterface(underlying, interfaceDef) {
|
|
818
|
-
const [objApiNamespace] =
|
|
827
|
+
const [objApiNamespace] = chunkXZOADDY6_cjs.extractNamespace(interfaceDef.apiName);
|
|
819
828
|
return Object.freeze(Object.defineProperties({}, {
|
|
820
829
|
// first to minimize hidden classes
|
|
821
830
|
[UnderlyingOsdkObject]: {
|
|
@@ -865,7 +874,7 @@ function createOsdkInterface(underlying, interfaceDef) {
|
|
|
865
874
|
},
|
|
866
875
|
...Object.fromEntries(Object.keys(interfaceDef.properties).map((p) => {
|
|
867
876
|
const objDef = underlying[ObjectDefRef];
|
|
868
|
-
const [apiNamespace, apiName] =
|
|
877
|
+
const [apiNamespace, apiName] = chunkXZOADDY6_cjs.extractNamespace(p);
|
|
869
878
|
const targetPropName = objDef.interfaceMap[interfaceDef.apiName][p];
|
|
870
879
|
return [apiNamespace === objApiNamespace ? apiName : p, {
|
|
871
880
|
enumerable: targetPropName in underlying,
|
|
@@ -941,8 +950,8 @@ function get$link(holder) {
|
|
|
941
950
|
[objDef.primaryKeyApiName]: rawObj.$primaryKey
|
|
942
951
|
}).pivotTo(linkName);
|
|
943
952
|
const value = !linkDef.multiplicity ? {
|
|
944
|
-
fetchOne: (options) =>
|
|
945
|
-
fetchOneWithErrors: (options) =>
|
|
953
|
+
fetchOne: (options) => chunkXZOADDY6_cjs.fetchSingle(client, objDef, options ?? {}, chunkXZOADDY6_cjs.getWireObjectSet(objectSet)),
|
|
954
|
+
fetchOneWithErrors: (options) => chunkXZOADDY6_cjs.fetchSingleWithErrors(client, objDef, options ?? {}, chunkXZOADDY6_cjs.getWireObjectSet(objectSet))
|
|
946
955
|
} : objectSet;
|
|
947
956
|
return [linkName, value];
|
|
948
957
|
})));
|
|
@@ -1035,9 +1044,9 @@ function modifyRdpProperties(client, derivedPropertyTypeByName, rawValue, propKe
|
|
|
1035
1044
|
switch (derivedPropertyTypeByName[propKey].selectedOrCollectedPropertyType?.type) {
|
|
1036
1045
|
case "attachment":
|
|
1037
1046
|
if (Array.isArray(rawValue)) {
|
|
1038
|
-
return rawValue.map((a) =>
|
|
1047
|
+
return rawValue.map((a) => chunkXZOADDY6_cjs.hydrateAttachmentFromRidInternal(client, a.rid));
|
|
1039
1048
|
} else {
|
|
1040
|
-
return
|
|
1049
|
+
return chunkXZOADDY6_cjs.hydrateAttachmentFromRidInternal(client, rawValue.rid);
|
|
1041
1050
|
}
|
|
1042
1051
|
default:
|
|
1043
1052
|
process.env.NODE_ENV !== "production" ? invariant__default.default(false, "Derived property aggregations for Timeseries and Media are not supported") : invariant__default.default(false) ;
|
|
@@ -1053,9 +1062,9 @@ function createSpecialProperty(client, objectDef, rawObject, p) {
|
|
|
1053
1062
|
}
|
|
1054
1063
|
if (propDef.type === "attachment") {
|
|
1055
1064
|
if (Array.isArray(rawValue)) {
|
|
1056
|
-
return rawValue.map((a) =>
|
|
1065
|
+
return rawValue.map((a) => chunkXZOADDY6_cjs.hydrateAttachmentFromRidInternal(client, a.rid));
|
|
1057
1066
|
}
|
|
1058
|
-
return
|
|
1067
|
+
return chunkXZOADDY6_cjs.hydrateAttachmentFromRidInternal(client, rawValue.rid);
|
|
1059
1068
|
}
|
|
1060
1069
|
if (propDef.type === "numericTimeseries" || propDef.type === "stringTimeseries" || propDef.type === "sensorTimeseries") {
|
|
1061
1070
|
return new TimeSeriesPropertyImpl(client, objectDef.apiName, rawObject[objectDef.primaryKeyApiName], p);
|
|
@@ -1275,11 +1284,11 @@ function deepFreeze(obj) {
|
|
|
1275
1284
|
return Object.freeze(obj);
|
|
1276
1285
|
}
|
|
1277
1286
|
async function loadActionMetadata(client, actionType) {
|
|
1278
|
-
const r = await
|
|
1287
|
+
const r = await chunkXZOADDY6_cjs.ActionTypeV2_exports.get(client, await client.ontologyRid, actionType);
|
|
1279
1288
|
return generatorConverters.wireActionTypeV2ToSdkActionMetadata(r);
|
|
1280
1289
|
}
|
|
1281
1290
|
async function loadFullObjectMetadata(client, objectType) {
|
|
1282
|
-
const full = await
|
|
1291
|
+
const full = await chunkXZOADDY6_cjs.ObjectTypeV2_exports.getFullMetadata(client, await client.ontologyRid, objectType, {
|
|
1283
1292
|
preview: true
|
|
1284
1293
|
});
|
|
1285
1294
|
const ret = generatorConverters.wireObjectTypeFullMetadataToSdkObjectMetadata(full, true);
|
|
@@ -1288,14 +1297,14 @@ async function loadFullObjectMetadata(client, objectType) {
|
|
|
1288
1297
|
};
|
|
1289
1298
|
}
|
|
1290
1299
|
async function loadInterfaceMetadata(client, objectType) {
|
|
1291
|
-
const r = await
|
|
1300
|
+
const r = await chunkXZOADDY6_cjs.OntologyInterface_exports.get(client, await client.ontologyRid, objectType, {
|
|
1292
1301
|
preview: true
|
|
1293
1302
|
});
|
|
1294
1303
|
return generatorConverters.__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(r, true);
|
|
1295
1304
|
}
|
|
1296
1305
|
async function loadQueryMetadata(client, queryTypeApiNameAndVersion) {
|
|
1297
1306
|
const [apiName, version] = queryTypeApiNameAndVersion.split(":");
|
|
1298
|
-
const r = await
|
|
1307
|
+
const r = await chunkXZOADDY6_cjs.QueryType_exports.get(client, await client.ontologyRid, apiName, {
|
|
1299
1308
|
version
|
|
1300
1309
|
});
|
|
1301
1310
|
return generatorConverters.wireQueryTypeV2ToSdkQueryMetadata(r);
|
|
@@ -1352,11 +1361,11 @@ var createStandardOntologyProviderFactory = (client) => {
|
|
|
1352
1361
|
};
|
|
1353
1362
|
|
|
1354
1363
|
// src/util/UserAgent.ts
|
|
1355
|
-
var USER_AGENT = `osdk-client/${"2.4.0-beta.
|
|
1356
|
-
var OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.4.0-beta.
|
|
1364
|
+
var USER_AGENT = `osdk-client/${"2.4.0-beta.18"}`;
|
|
1365
|
+
var OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.4.0-beta.18"}`;
|
|
1357
1366
|
|
|
1358
1367
|
// src/createMinimalClient.ts
|
|
1359
|
-
function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory =
|
|
1368
|
+
function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory = chunkXZOADDY6_cjs.createObjectSet, createOntologyProviderFactory = createStandardOntologyProviderFactory) {
|
|
1360
1369
|
if (process.env.NODE_ENV !== "production") {
|
|
1361
1370
|
try {
|
|
1362
1371
|
new URL(baseUrl);
|
|
@@ -1422,13 +1431,13 @@ async function toDataValueQueries(value, client, desiredType) {
|
|
|
1422
1431
|
switch (desiredType.type) {
|
|
1423
1432
|
case "attachment": {
|
|
1424
1433
|
if (isAttachmentUpload(value)) {
|
|
1425
|
-
const attachment = await
|
|
1434
|
+
const attachment = await chunkXZOADDY6_cjs.Attachment_exports.upload(client, value.data, {
|
|
1426
1435
|
filename: value.name
|
|
1427
1436
|
});
|
|
1428
1437
|
return attachment.rid;
|
|
1429
1438
|
}
|
|
1430
1439
|
if (isAttachmentFile(value)) {
|
|
1431
|
-
const attachment = await
|
|
1440
|
+
const attachment = await chunkXZOADDY6_cjs.Attachment_exports.upload(client, value, {
|
|
1432
1441
|
filename: value.name
|
|
1433
1442
|
});
|
|
1434
1443
|
return attachment.rid;
|
|
@@ -1458,12 +1467,21 @@ async function toDataValueQueries(value, client, desiredType) {
|
|
|
1458
1467
|
}
|
|
1459
1468
|
break;
|
|
1460
1469
|
}
|
|
1461
|
-
case "
|
|
1462
|
-
if (
|
|
1470
|
+
case "interface": {
|
|
1471
|
+
if (isInterfaceSpecifier(value) || isInterfaceQueryParam(value)) {
|
|
1472
|
+
return {
|
|
1473
|
+
objectTypeApiName: value.$objectType,
|
|
1474
|
+
primaryKeyValue: value.$primaryKey
|
|
1475
|
+
};
|
|
1476
|
+
}
|
|
1477
|
+
}
|
|
1478
|
+
case "objectSet":
|
|
1479
|
+
case "interfaceObjectSet": {
|
|
1480
|
+
if (chunkXZOADDY6_cjs.isWireObjectSet(value)) {
|
|
1463
1481
|
return value;
|
|
1464
1482
|
}
|
|
1465
|
-
if (
|
|
1466
|
-
return
|
|
1483
|
+
if (chunkXZOADDY6_cjs.isObjectSet(value)) {
|
|
1484
|
+
return chunkXZOADDY6_cjs.getWireObjectSet(value);
|
|
1467
1485
|
}
|
|
1468
1486
|
break;
|
|
1469
1487
|
}
|
|
@@ -1505,7 +1523,7 @@ async function toDataValueQueries(value, client, desiredType) {
|
|
|
1505
1523
|
// src/queries/applyQuery.ts
|
|
1506
1524
|
async function applyQuery(client, query, params) {
|
|
1507
1525
|
const qd = await client.ontologyProvider.getQueryDefinition(query.apiName, query.isFixedVersion ? query.version : void 0);
|
|
1508
|
-
const response = await
|
|
1526
|
+
const response = await chunkXZOADDY6_cjs.Query_exports.execute(chunkXZOADDY6_cjs.addUserAgentAndRequestContextHeaders(chunkXZOADDY6_cjs.augmentRequestContext(client, (_) => ({
|
|
1509
1527
|
finalMethodCall: "applyQuery"
|
|
1510
1528
|
})), query), await client.ontologyRid, query.apiName, {
|
|
1511
1529
|
parameters: params ? await remapQueryParams(params, client, qd.parameters) : {}
|
|
@@ -1552,7 +1570,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
1552
1570
|
return responseValue;
|
|
1553
1571
|
}
|
|
1554
1572
|
case "attachment": {
|
|
1555
|
-
return
|
|
1573
|
+
return chunkXZOADDY6_cjs.hydrateAttachmentFromRidInternal(client, responseValue);
|
|
1556
1574
|
}
|
|
1557
1575
|
case "object": {
|
|
1558
1576
|
const def = definitions.get(responseDataType.object);
|
|
@@ -1561,13 +1579,20 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
1561
1579
|
}
|
|
1562
1580
|
return createQueryObjectResponse(responseValue, def);
|
|
1563
1581
|
}
|
|
1582
|
+
case "interface": {
|
|
1583
|
+
const def = definitions.get(responseDataType.interface);
|
|
1584
|
+
if (!def || def.type !== "interface") {
|
|
1585
|
+
throw new Error(`Missing definition for ${responseDataType.interface}`);
|
|
1586
|
+
}
|
|
1587
|
+
return createQueryInterfaceResponse(responseValue, def);
|
|
1588
|
+
}
|
|
1564
1589
|
case "objectSet": {
|
|
1565
1590
|
const def = definitions.get(responseDataType.objectSet);
|
|
1566
1591
|
if (!def) {
|
|
1567
1592
|
throw new Error(`Missing definition for ${responseDataType.objectSet}`);
|
|
1568
1593
|
}
|
|
1569
1594
|
if (typeof responseValue === "string") {
|
|
1570
|
-
return
|
|
1595
|
+
return chunkXZOADDY6_cjs.createObjectSet(def, client, {
|
|
1571
1596
|
type: "intersect",
|
|
1572
1597
|
objectSets: [{
|
|
1573
1598
|
type: "base",
|
|
@@ -1578,7 +1603,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
1578
1603
|
}]
|
|
1579
1604
|
});
|
|
1580
1605
|
}
|
|
1581
|
-
return
|
|
1606
|
+
return chunkXZOADDY6_cjs.createObjectSet(def, client, responseValue);
|
|
1582
1607
|
}
|
|
1583
1608
|
case "struct": {
|
|
1584
1609
|
for (const [key, subtype] of Object.entries(responseDataType.struct)) {
|
|
@@ -1652,6 +1677,11 @@ async function getRequiredDefinitions(dataType, client) {
|
|
|
1652
1677
|
result.set(dataType.object, objectDef);
|
|
1653
1678
|
break;
|
|
1654
1679
|
}
|
|
1680
|
+
case "interface": {
|
|
1681
|
+
const interfaceDef = await client.ontologyProvider.getInterfaceDefinition(dataType.interface);
|
|
1682
|
+
result.set(dataType.interface, interfaceDef);
|
|
1683
|
+
break;
|
|
1684
|
+
}
|
|
1655
1685
|
case "set": {
|
|
1656
1686
|
return getRequiredDefinitions(dataType.set, client);
|
|
1657
1687
|
}
|
|
@@ -1721,6 +1751,15 @@ function createQueryObjectResponse(primaryKey, objectDef) {
|
|
|
1721
1751
|
$objectSpecifier: createObjectSpecifierFromPrimaryKey(objectDef, primaryKey)
|
|
1722
1752
|
};
|
|
1723
1753
|
}
|
|
1754
|
+
function createQueryInterfaceResponse(interfaceSpecifier, interfaceDef) {
|
|
1755
|
+
return {
|
|
1756
|
+
$apiName: interfaceDef.apiName,
|
|
1757
|
+
$title: void 0,
|
|
1758
|
+
$objectType: interfaceSpecifier.objectTypeApiName,
|
|
1759
|
+
$primaryKey: interfaceSpecifier.primaryKeyValue,
|
|
1760
|
+
$objectSpecifier: createObjectSpecifierFromInterfaceSpecifier(interfaceDef, interfaceSpecifier)
|
|
1761
|
+
};
|
|
1762
|
+
}
|
|
1724
1763
|
|
|
1725
1764
|
// src/createClient.ts
|
|
1726
1765
|
var ActionInvoker = class {
|
|
@@ -1750,7 +1789,7 @@ function createClientInternal(objectSetFactory, transactionRid, baseUrl, ontolog
|
|
|
1750
1789
|
ontologyRid
|
|
1751
1790
|
}, baseUrl, tokenProvider, {
|
|
1752
1791
|
...options,
|
|
1753
|
-
logger: options?.logger ?? new
|
|
1792
|
+
logger: options?.logger ?? new chunkXZOADDY6_cjs.MinimalLogger(),
|
|
1754
1793
|
transactionRid
|
|
1755
1794
|
}, fetchFn, objectSetFactory);
|
|
1756
1795
|
return createClientFromContext(clientCtx);
|
|
@@ -1772,7 +1811,7 @@ function createClientFromContext(clientCtx) {
|
|
|
1772
1811
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid.name:
|
|
1773
1812
|
return {
|
|
1774
1813
|
fetchOneByRid: async (objectType, rid, options) => {
|
|
1775
|
-
return await
|
|
1814
|
+
return await chunkXZOADDY6_cjs.fetchSingle(clientCtx, objectType, options, createWithRid([rid]));
|
|
1776
1815
|
}
|
|
1777
1816
|
};
|
|
1778
1817
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference.name:
|
|
@@ -1784,7 +1823,7 @@ function createClientFromContext(clientCtx) {
|
|
|
1784
1823
|
objectType,
|
|
1785
1824
|
propertyType
|
|
1786
1825
|
} = args;
|
|
1787
|
-
return await
|
|
1826
|
+
return await chunkXZOADDY6_cjs.MediaReferenceProperty_exports.upload(clientCtx, await clientCtx.ontologyRid, objectType.apiName, propertyType, data, {
|
|
1788
1827
|
mediaItemPath: fileName,
|
|
1789
1828
|
preview: true
|
|
1790
1829
|
});
|
|
@@ -1793,7 +1832,7 @@ function createClientFromContext(clientCtx) {
|
|
|
1793
1832
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid.name:
|
|
1794
1833
|
return {
|
|
1795
1834
|
fetchPageByRid: async (objectOrInterfaceType, rids, options = {}) => {
|
|
1796
|
-
return await
|
|
1835
|
+
return await chunkXZOADDY6_cjs.fetchPage(clientCtx, objectOrInterfaceType, options, createWithRid(rids));
|
|
1797
1836
|
}
|
|
1798
1837
|
};
|
|
1799
1838
|
}
|
|
@@ -1805,13 +1844,13 @@ function createClientFromContext(clientCtx) {
|
|
|
1805
1844
|
const fetchMetadata = fetchMetadataInternal.bind(void 0, clientCtx);
|
|
1806
1845
|
const symbolClientContext2 = "__osdkClientContext";
|
|
1807
1846
|
const client = Object.defineProperties(clientFn, {
|
|
1808
|
-
[
|
|
1847
|
+
[chunkXZOADDY6_cjs.symbolClientContext]: {
|
|
1809
1848
|
value: clientCtx
|
|
1810
1849
|
},
|
|
1811
1850
|
[symbolClientContext2]: {
|
|
1812
1851
|
value: clientCtx
|
|
1813
1852
|
},
|
|
1814
|
-
[
|
|
1853
|
+
[chunkXZOADDY6_cjs.additionalContext]: {
|
|
1815
1854
|
value: clientCtx
|
|
1816
1855
|
},
|
|
1817
1856
|
fetchMetadata: {
|
|
@@ -1820,8 +1859,8 @@ function createClientFromContext(clientCtx) {
|
|
|
1820
1859
|
});
|
|
1821
1860
|
return client;
|
|
1822
1861
|
}
|
|
1823
|
-
var createClient = createClientInternal.bind(void 0,
|
|
1824
|
-
var createClientWithTransaction = (transactionRid, ...args) => createClientInternal(
|
|
1862
|
+
var createClient = createClientInternal.bind(void 0, chunkXZOADDY6_cjs.createObjectSet, void 0);
|
|
1863
|
+
var createClientWithTransaction = (transactionRid, ...args) => createClientInternal(chunkXZOADDY6_cjs.createObjectSet, transactionRid, ...args);
|
|
1825
1864
|
function createWithRid(rids) {
|
|
1826
1865
|
const withRid = {
|
|
1827
1866
|
type: "static",
|
|
@@ -1839,5 +1878,6 @@ exports.createAttachmentUpload = createAttachmentUpload;
|
|
|
1839
1878
|
exports.createClient = createClient;
|
|
1840
1879
|
exports.createClientFromContext = createClientFromContext;
|
|
1841
1880
|
exports.createClientWithTransaction = createClientWithTransaction;
|
|
1842
|
-
|
|
1843
|
-
//# sourceMappingURL=chunk-
|
|
1881
|
+
exports.createObjectSpecifierFromPrimaryKey = createObjectSpecifierFromPrimaryKey;
|
|
1882
|
+
//# sourceMappingURL=chunk-TIAQODA6.cjs.map
|
|
1883
|
+
//# sourceMappingURL=chunk-TIAQODA6.cjs.map
|