@osdk/client 2.3.0-beta.9 → 2.3.0
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 +186 -0
- package/build/browser/derivedProperties/createWithPropertiesObjectSet.js +1 -41
- package/build/browser/derivedProperties/createWithPropertiesObjectSet.js.map +1 -1
- package/build/browser/derivedProperties/createWithPropertiesObjectSet.test.js +12 -145
- package/build/browser/derivedProperties/createWithPropertiesObjectSet.test.js.map +1 -1
- package/build/browser/index.js.map +1 -1
- package/build/browser/object/fetchPage.js +9 -7
- package/build/browser/object/fetchPage.js.map +1 -1
- package/build/browser/object/mediaUpload.js +0 -3
- package/build/browser/object/mediaUpload.js.map +1 -1
- package/build/browser/objectSet/ObjectSet.test.js +106 -85
- package/build/browser/objectSet/ObjectSet.test.js.map +1 -1
- package/build/browser/objectSet/createObjectSet.js +1 -1
- package/build/browser/objectSet/createObjectSet.js.map +1 -1
- package/build/browser/public/internal.js +1 -0
- package/build/browser/public/internal.js.map +1 -1
- package/build/browser/public-utils/hydrateObjectSetFromObjectRids.js +39 -0
- package/build/browser/public-utils/hydrateObjectSetFromObjectRids.js.map +1 -0
- package/build/browser/queries/applyQuery.js +8 -4
- package/build/browser/queries/applyQuery.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/toDataValue.js +1 -11
- package/build/browser/util/toDataValue.js.map +1 -1
- package/build/browser/util/toDataValue.test.js +2 -33
- package/build/browser/util/toDataValue.test.js.map +1 -1
- package/build/cjs/{chunk-6OJ3OWCR.cjs → chunk-2MTGADU5.cjs} +67 -73
- package/build/cjs/chunk-2MTGADU5.cjs.map +1 -0
- package/build/cjs/{chunk-HTPVXLYY.cjs → chunk-QHPACIXZ.cjs} +34 -144
- package/build/cjs/chunk-QHPACIXZ.cjs.map +1 -0
- package/build/cjs/index.cjs +6 -6
- package/build/cjs/index.d.cts +1 -1
- package/build/cjs/public/internal.cjs +22 -7
- package/build/cjs/public/internal.cjs.map +1 -1
- package/build/cjs/public/internal.d.cts +10 -1
- package/build/cjs/public/unstable-do-not-use.cjs +15 -15
- package/build/esm/derivedProperties/createWithPropertiesObjectSet.js +1 -41
- package/build/esm/derivedProperties/createWithPropertiesObjectSet.js.map +1 -1
- package/build/esm/derivedProperties/createWithPropertiesObjectSet.test.js +12 -145
- package/build/esm/derivedProperties/createWithPropertiesObjectSet.test.js.map +1 -1
- package/build/esm/index.js.map +1 -1
- package/build/esm/object/fetchPage.js +9 -7
- package/build/esm/object/fetchPage.js.map +1 -1
- package/build/esm/object/mediaUpload.js +0 -3
- package/build/esm/object/mediaUpload.js.map +1 -1
- package/build/esm/objectSet/ObjectSet.test.js +106 -85
- package/build/esm/objectSet/ObjectSet.test.js.map +1 -1
- package/build/esm/objectSet/createObjectSet.js +1 -1
- package/build/esm/objectSet/createObjectSet.js.map +1 -1
- package/build/esm/public/internal.js +1 -0
- package/build/esm/public/internal.js.map +1 -1
- package/build/esm/public-utils/hydrateObjectSetFromObjectRids.js +39 -0
- package/build/esm/public-utils/hydrateObjectSetFromObjectRids.js.map +1 -0
- package/build/esm/queries/applyQuery.js +8 -4
- package/build/esm/queries/applyQuery.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/toDataValue.js +1 -11
- package/build/esm/util/toDataValue.js.map +1 -1
- package/build/esm/util/toDataValue.test.js +2 -33
- package/build/esm/util/toDataValue.test.js.map +1 -1
- package/build/types/index.d.ts +1 -1
- package/build/types/index.d.ts.map +1 -1
- package/build/types/object/mediaUpload.d.ts +1 -2
- package/build/types/object/mediaUpload.d.ts.map +1 -1
- package/build/types/public/internal.d.ts +1 -0
- package/build/types/public/internal.d.ts.map +1 -1
- package/build/types/public-utils/hydrateObjectSetFromObjectRids.d.ts +10 -0
- package/build/types/public-utils/hydrateObjectSetFromObjectRids.d.ts.map +1 -0
- package/build/types/queries/applyQuery.d.ts.map +1 -1
- package/package.json +11 -11
- package/build/browser/derivedProperties/derivedPropertyDefinitionFactory.js +0 -93
- package/build/browser/derivedProperties/derivedPropertyDefinitionFactory.js.map +0 -1
- package/build/cjs/chunk-6OJ3OWCR.cjs.map +0 -1
- package/build/cjs/chunk-HTPVXLYY.cjs.map +0 -1
- package/build/esm/derivedProperties/derivedPropertyDefinitionFactory.js +0 -93
- package/build/esm/derivedProperties/derivedPropertyDefinitionFactory.js.map +0 -1
- package/build/types/derivedProperties/derivedPropertyDefinitionFactory.d.ts +0 -1
- package/build/types/derivedProperties/derivedPropertyDefinitionFactory.d.ts.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkQHPACIXZ_cjs = require('./chunk-QHPACIXZ.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');
|
|
@@ -384,9 +384,6 @@ function getPrimaryKeyOrThrow(ref) {
|
|
|
384
384
|
function isMediaReference(o) {
|
|
385
385
|
return typeof o === `object` && typeof o.mimeType === "string" && "reference" in o && typeof o.reference === "object" && o.reference.type === "mediaSetViewItem" && "mediaSetViewItem" in o.reference && typeof o.reference.mediaSetViewItem === "object" && typeof o.reference.mediaSetViewItem.mediaSetRid === "string" && typeof o.reference.mediaSetViewItem.mediaSetViewRid === "string" && typeof o.reference.mediaSetViewItem.mediaItemRid === "string";
|
|
386
386
|
}
|
|
387
|
-
function isMediaUpload(o) {
|
|
388
|
-
return typeof o === "object" && "path" in o && typeof o.path === "string" && "data" in o && typeof o.data === "object" && o.data instanceof Blob;
|
|
389
|
-
}
|
|
390
387
|
|
|
391
388
|
// src/util/interfaceUtils.ts
|
|
392
389
|
function isInterfaceActionParam(o) {
|
|
@@ -418,46 +415,39 @@ async function toDataValue(value, client, actionMetadata) {
|
|
|
418
415
|
if (values.some((dataValue) => isAttachmentUpload(dataValue) || isAttachmentFile(dataValue))) {
|
|
419
416
|
const converted = [];
|
|
420
417
|
for (const value2 of values) {
|
|
421
|
-
converted.push(await toDataValue(value2, client
|
|
418
|
+
converted.push(await toDataValue(value2, client));
|
|
422
419
|
}
|
|
423
420
|
return converted;
|
|
424
421
|
}
|
|
425
|
-
const promiseArray = Array.from(value, async (innerValue) => await toDataValue(innerValue, client
|
|
422
|
+
const promiseArray = Array.from(value, async (innerValue) => await toDataValue(innerValue, client));
|
|
426
423
|
return Promise.all(promiseArray);
|
|
427
424
|
}
|
|
428
425
|
if (isAttachmentUpload(value)) {
|
|
429
|
-
const attachment = await
|
|
426
|
+
const attachment = await chunkQHPACIXZ_cjs.Attachment_exports.upload(client, value.data, {
|
|
430
427
|
filename: value.name
|
|
431
428
|
});
|
|
432
|
-
return await toDataValue(attachment.rid, client
|
|
429
|
+
return await toDataValue(attachment.rid, client);
|
|
433
430
|
}
|
|
434
431
|
if (isAttachmentFile(value)) {
|
|
435
|
-
const attachment = await
|
|
432
|
+
const attachment = await chunkQHPACIXZ_cjs.Attachment_exports.upload(client, value, {
|
|
436
433
|
filename: value.name
|
|
437
434
|
});
|
|
438
|
-
return await toDataValue(attachment.rid, client
|
|
439
|
-
}
|
|
440
|
-
if (isMediaUpload(value)) {
|
|
441
|
-
const mediaRef = await chunkHTPVXLYY_cjs.MediaReferenceProperty_exports.uploadMedia(client, await client.ontologyRid, actionMetadata.apiName, value.data, {
|
|
442
|
-
mediaItemPath: value.path,
|
|
443
|
-
preview: true
|
|
444
|
-
});
|
|
445
|
-
return await toDataValue(mediaRef, client, actionMetadata);
|
|
435
|
+
return await toDataValue(attachment.rid, client);
|
|
446
436
|
}
|
|
447
437
|
if (isOntologyObjectV2(value)) {
|
|
448
|
-
return await toDataValue(value.__primaryKey, client
|
|
438
|
+
return await toDataValue(value.__primaryKey, client);
|
|
449
439
|
}
|
|
450
440
|
if (isObjectSpecifiersObject(value)) {
|
|
451
|
-
return await toDataValue(value.$primaryKey, client
|
|
441
|
+
return await toDataValue(value.$primaryKey, client);
|
|
452
442
|
}
|
|
453
443
|
if (isPoint(value)) {
|
|
454
|
-
return await toDataValue(`${value.coordinates[1]},${value.coordinates[0]}`, client
|
|
444
|
+
return await toDataValue(`${value.coordinates[1]},${value.coordinates[0]}`, client);
|
|
455
445
|
}
|
|
456
|
-
if (
|
|
446
|
+
if (chunkQHPACIXZ_cjs.isWireObjectSet(value)) {
|
|
457
447
|
return value;
|
|
458
448
|
}
|
|
459
|
-
if (
|
|
460
|
-
return
|
|
449
|
+
if (chunkQHPACIXZ_cjs.isObjectSet(value)) {
|
|
450
|
+
return chunkQHPACIXZ_cjs.getWireObjectSet(value);
|
|
461
451
|
}
|
|
462
452
|
if (isMediaReference(value)) {
|
|
463
453
|
return value;
|
|
@@ -471,7 +461,7 @@ async function toDataValue(value, client, actionMetadata) {
|
|
|
471
461
|
if (typeof value === "object") {
|
|
472
462
|
return Object.entries(value).reduce(async (promisedAcc, [key, structValue]) => {
|
|
473
463
|
const acc = await promisedAcc;
|
|
474
|
-
acc[key] = await toDataValue(structValue, client
|
|
464
|
+
acc[key] = await toDataValue(structValue, client);
|
|
475
465
|
return acc;
|
|
476
466
|
}, Promise.resolve({}));
|
|
477
467
|
}
|
|
@@ -480,11 +470,11 @@ async function toDataValue(value, client, actionMetadata) {
|
|
|
480
470
|
|
|
481
471
|
// src/actions/applyAction.ts
|
|
482
472
|
async function applyAction(client, action, parameters, options = {}) {
|
|
483
|
-
const clientWithHeaders =
|
|
473
|
+
const clientWithHeaders = chunkQHPACIXZ_cjs.addUserAgentAndRequestContextHeaders(chunkQHPACIXZ_cjs.augmentRequestContext(client, (_) => ({
|
|
484
474
|
finalMethodCall: "applyAction"
|
|
485
475
|
})), action);
|
|
486
476
|
if (Array.isArray(parameters)) {
|
|
487
|
-
const response = await
|
|
477
|
+
const response = await chunkQHPACIXZ_cjs.Action_exports.applyBatch(clientWithHeaders, await client.ontologyRid, action.apiName, {
|
|
488
478
|
requests: parameters ? await remapBatchActionParams(parameters, client, await client.ontologyProvider.getActionDefinition(action.apiName)) : [],
|
|
489
479
|
options: {
|
|
490
480
|
returnEdits: options?.$returnEdits ? "ALL" : "NONE"
|
|
@@ -493,7 +483,7 @@ async function applyAction(client, action, parameters, options = {}) {
|
|
|
493
483
|
const edits = response.edits;
|
|
494
484
|
return options?.$returnEdits ? edits?.type === "edits" ? remapActionResponse(response) : edits : void 0;
|
|
495
485
|
} else {
|
|
496
|
-
const response = await
|
|
486
|
+
const response = await chunkQHPACIXZ_cjs.Action_exports.apply(clientWithHeaders, await client.ontologyRid, action.apiName, {
|
|
497
487
|
parameters: await remapActionParams(parameters, client, await client.ontologyProvider.getActionDefinition(action.apiName)),
|
|
498
488
|
options: {
|
|
499
489
|
mode: options?.$validateOnly ? "VALIDATE_ONLY" : "VALIDATE_AND_EXECUTE",
|
|
@@ -517,14 +507,14 @@ async function remapActionParams(params, client, actionMetadata) {
|
|
|
517
507
|
}
|
|
518
508
|
const parameterMap = {};
|
|
519
509
|
for (const [key, value] of Object.entries(params)) {
|
|
520
|
-
parameterMap[key] = await toDataValue(value, client
|
|
510
|
+
parameterMap[key] = await toDataValue(value, client);
|
|
521
511
|
}
|
|
522
512
|
return parameterMap;
|
|
523
513
|
}
|
|
524
514
|
async function remapBatchActionParams(params, client, actionMetadata) {
|
|
525
515
|
const remappedParams = await Promise.all(params.map(async (param) => {
|
|
526
516
|
return {
|
|
527
|
-
parameters: await remapActionParams(param, client
|
|
517
|
+
parameters: await remapActionParams(param, client)
|
|
528
518
|
};
|
|
529
519
|
}));
|
|
530
520
|
return remappedParams;
|
|
@@ -698,7 +688,7 @@ var GeotimeSeriesPropertyImpl = class {
|
|
|
698
688
|
}
|
|
699
689
|
}
|
|
700
690
|
async getLatestValue() {
|
|
701
|
-
const latestPointPromise =
|
|
691
|
+
const latestPointPromise = chunkQHPACIXZ_cjs.TimeSeriesValueBankProperty_exports.getLatestValue(this.#client, await this.#client.ontologyRid, ...this.#triplet);
|
|
702
692
|
latestPointPromise.then(
|
|
703
693
|
(latestPoint) => this.lastFetchedValue = latestPoint,
|
|
704
694
|
// eslint-disable-next-line no-console
|
|
@@ -714,7 +704,7 @@ var GeotimeSeriesPropertyImpl = class {
|
|
|
714
704
|
return allPoints;
|
|
715
705
|
}
|
|
716
706
|
async *asyncIterValues(query) {
|
|
717
|
-
const streamPointsIterator = await
|
|
707
|
+
const streamPointsIterator = await chunkQHPACIXZ_cjs.TimeSeriesValueBankProperty_exports.streamValues(this.#client, await this.#client.ontologyRid, ...this.#triplet, query ? {
|
|
718
708
|
range: getTimeRange(query)
|
|
719
709
|
} : {});
|
|
720
710
|
for await (const timeseriesPoint of asyncIterPointsHelper(streamPointsIterator)) {
|
|
@@ -741,13 +731,13 @@ var MediaReferencePropertyImpl = class {
|
|
|
741
731
|
this.#mediaReference = mediaReference;
|
|
742
732
|
}
|
|
743
733
|
async fetchContents() {
|
|
744
|
-
return
|
|
734
|
+
return chunkQHPACIXZ_cjs.MediaReferenceProperty_exports.getMediaContent(this.#client, await this.#client.ontologyRid, ...this.#triplet, {
|
|
745
735
|
preview: true
|
|
746
736
|
// TODO: Can turn this back off when backend is no longer in beta.
|
|
747
737
|
});
|
|
748
738
|
}
|
|
749
739
|
async fetchMetadata() {
|
|
750
|
-
const r = await
|
|
740
|
+
const r = await chunkQHPACIXZ_cjs.MediaReferenceProperty_exports.getMediaMetadata(this.#client, await this.#client.ontologyRid, ...this.#triplet, {
|
|
751
741
|
preview: true
|
|
752
742
|
// TODO: Can turn this back off when backend is no longer in beta.
|
|
753
743
|
});
|
|
@@ -771,10 +761,10 @@ var TimeSeriesPropertyImpl = class {
|
|
|
771
761
|
this.#triplet = [objectApiName, primaryKey, propertyName];
|
|
772
762
|
}
|
|
773
763
|
async getFirstPoint() {
|
|
774
|
-
return
|
|
764
|
+
return chunkQHPACIXZ_cjs.TimeSeriesPropertyV2_exports.getFirstPoint(this.#client, await this.#client.ontologyRid, ...this.#triplet);
|
|
775
765
|
}
|
|
776
766
|
async getLastPoint() {
|
|
777
|
-
return
|
|
767
|
+
return chunkQHPACIXZ_cjs.TimeSeriesPropertyV2_exports.getLastPoint(this.#client, await this.#client.ontologyRid, ...this.#triplet);
|
|
778
768
|
}
|
|
779
769
|
async getAllPoints(query) {
|
|
780
770
|
const allPoints = [];
|
|
@@ -784,7 +774,7 @@ var TimeSeriesPropertyImpl = class {
|
|
|
784
774
|
return allPoints;
|
|
785
775
|
}
|
|
786
776
|
async *asyncIterPoints(query) {
|
|
787
|
-
const streamPointsIterator = await
|
|
777
|
+
const streamPointsIterator = await chunkQHPACIXZ_cjs.TimeSeriesPropertyV2_exports.streamPoints(this.#client, await this.#client.ontologyRid, ...this.#triplet, query ? {
|
|
788
778
|
range: getTimeRange(query)
|
|
789
779
|
} : {});
|
|
790
780
|
for await (const timeseriesPoint of asyncIterPointsHelper(streamPointsIterator)) {
|
|
@@ -812,7 +802,7 @@ var ClientRef = Symbol("ClientRef" );
|
|
|
812
802
|
|
|
813
803
|
// src/object/convertWireToOsdkObjects/createOsdkInterface.ts
|
|
814
804
|
function createOsdkInterface(underlying, interfaceDef) {
|
|
815
|
-
const [objApiNamespace] =
|
|
805
|
+
const [objApiNamespace] = chunkQHPACIXZ_cjs.extractNamespace(interfaceDef.apiName);
|
|
816
806
|
return Object.freeze(Object.defineProperties({}, {
|
|
817
807
|
// first to minimize hidden classes
|
|
818
808
|
[UnderlyingOsdkObject]: {
|
|
@@ -855,7 +845,7 @@ function createOsdkInterface(underlying, interfaceDef) {
|
|
|
855
845
|
},
|
|
856
846
|
...Object.fromEntries(Object.keys(interfaceDef.properties).map((p) => {
|
|
857
847
|
const objDef = underlying[ObjectDefRef];
|
|
858
|
-
const [apiNamespace, apiName] =
|
|
848
|
+
const [apiNamespace, apiName] = chunkQHPACIXZ_cjs.extractNamespace(p);
|
|
859
849
|
const targetPropName = objDef.interfaceMap[interfaceDef.apiName][p];
|
|
860
850
|
return [apiNamespace === objApiNamespace ? apiName : p, {
|
|
861
851
|
enumerable: targetPropName in underlying,
|
|
@@ -931,8 +921,8 @@ function get$link(holder) {
|
|
|
931
921
|
[objDef.primaryKeyApiName]: rawObj.$primaryKey
|
|
932
922
|
}).pivotTo(linkName);
|
|
933
923
|
const value = !linkDef.multiplicity ? {
|
|
934
|
-
fetchOne: (options) =>
|
|
935
|
-
fetchOneWithErrors: (options) =>
|
|
924
|
+
fetchOne: (options) => chunkQHPACIXZ_cjs.fetchSingle(client, objDef, options ?? {}, chunkQHPACIXZ_cjs.getWireObjectSet(objectSet)),
|
|
925
|
+
fetchOneWithErrors: (options) => chunkQHPACIXZ_cjs.fetchSingleWithErrors(client, objDef, options ?? {}, chunkQHPACIXZ_cjs.getWireObjectSet(objectSet))
|
|
936
926
|
} : objectSet;
|
|
937
927
|
return [linkName, value];
|
|
938
928
|
})));
|
|
@@ -1016,9 +1006,9 @@ function modifyRdpProperties(client, derivedPropertyTypeByName, rawValue, propKe
|
|
|
1016
1006
|
switch (derivedPropertyTypeByName[propKey].selectedOrCollectedPropertyType?.type) {
|
|
1017
1007
|
case "attachment":
|
|
1018
1008
|
if (Array.isArray(rawValue)) {
|
|
1019
|
-
return rawValue.map((a) =>
|
|
1009
|
+
return rawValue.map((a) => chunkQHPACIXZ_cjs.hydrateAttachmentFromRidInternal(client, a.rid));
|
|
1020
1010
|
} else {
|
|
1021
|
-
return
|
|
1011
|
+
return chunkQHPACIXZ_cjs.hydrateAttachmentFromRidInternal(client, rawValue.rid);
|
|
1022
1012
|
}
|
|
1023
1013
|
default:
|
|
1024
1014
|
process.env.NODE_ENV !== "production" ? invariant__default.default(false, "Derived property aggregations for Timeseries and Media are not supported") : invariant__default.default(false) ;
|
|
@@ -1034,9 +1024,9 @@ function createSpecialProperty(client, objectDef, rawObject, p) {
|
|
|
1034
1024
|
}
|
|
1035
1025
|
if (propDef.type === "attachment") {
|
|
1036
1026
|
if (Array.isArray(rawValue)) {
|
|
1037
|
-
return rawValue.map((a) =>
|
|
1027
|
+
return rawValue.map((a) => chunkQHPACIXZ_cjs.hydrateAttachmentFromRidInternal(client, a.rid));
|
|
1038
1028
|
}
|
|
1039
|
-
return
|
|
1029
|
+
return chunkQHPACIXZ_cjs.hydrateAttachmentFromRidInternal(client, rawValue.rid);
|
|
1040
1030
|
}
|
|
1041
1031
|
if (propDef.type === "numericTimeseries" || propDef.type === "stringTimeseries" || propDef.type === "sensorTimeseries") {
|
|
1042
1032
|
return new TimeSeriesPropertyImpl(client, objectDef.apiName, rawObject[objectDef.primaryKeyApiName], p);
|
|
@@ -1244,11 +1234,11 @@ function createAsyncClientCache(fn, createCacheLocal = createClientCache) {
|
|
|
1244
1234
|
return ret;
|
|
1245
1235
|
}
|
|
1246
1236
|
async function loadActionMetadata(client, actionType) {
|
|
1247
|
-
const r = await
|
|
1237
|
+
const r = await chunkQHPACIXZ_cjs.ActionTypeV2_exports.get(client, await client.ontologyRid, actionType);
|
|
1248
1238
|
return generatorConverters.wireActionTypeV2ToSdkActionMetadata(r);
|
|
1249
1239
|
}
|
|
1250
1240
|
async function loadFullObjectMetadata(client, objectType) {
|
|
1251
|
-
const full = await
|
|
1241
|
+
const full = await chunkQHPACIXZ_cjs.ObjectTypeV2_exports.getFullMetadata(client, await client.ontologyRid, objectType, {
|
|
1252
1242
|
preview: true
|
|
1253
1243
|
});
|
|
1254
1244
|
const ret = generatorConverters.wireObjectTypeFullMetadataToSdkObjectMetadata(full, true);
|
|
@@ -1257,14 +1247,14 @@ async function loadFullObjectMetadata(client, objectType) {
|
|
|
1257
1247
|
};
|
|
1258
1248
|
}
|
|
1259
1249
|
async function loadInterfaceMetadata(client, objectType) {
|
|
1260
|
-
const r = await
|
|
1250
|
+
const r = await chunkQHPACIXZ_cjs.OntologyInterface_exports.get(client, await client.ontologyRid, objectType, {
|
|
1261
1251
|
preview: true
|
|
1262
1252
|
});
|
|
1263
1253
|
return generatorConverters.__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(r, true);
|
|
1264
1254
|
}
|
|
1265
1255
|
async function loadQueryMetadata(client, queryTypeApiNameAndVersion) {
|
|
1266
1256
|
const [apiName, version] = queryTypeApiNameAndVersion.split(":");
|
|
1267
|
-
const r = await
|
|
1257
|
+
const r = await chunkQHPACIXZ_cjs.QueryType_exports.get(client, await client.ontologyRid, apiName, {
|
|
1268
1258
|
version
|
|
1269
1259
|
});
|
|
1270
1260
|
return generatorConverters.wireQueryTypeV2ToSdkQueryMetadata(r);
|
|
@@ -1321,11 +1311,11 @@ var createStandardOntologyProviderFactory = (client) => {
|
|
|
1321
1311
|
};
|
|
1322
1312
|
|
|
1323
1313
|
// src/util/UserAgent.ts
|
|
1324
|
-
var USER_AGENT = `osdk-client/${"2.3.0
|
|
1325
|
-
var OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.3.0
|
|
1314
|
+
var USER_AGENT = `osdk-client/${"2.3.0"}`;
|
|
1315
|
+
var OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.3.0"}`;
|
|
1326
1316
|
|
|
1327
1317
|
// src/createMinimalClient.ts
|
|
1328
|
-
function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory =
|
|
1318
|
+
function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory = chunkQHPACIXZ_cjs.createObjectSet, createOntologyProviderFactory = createStandardOntologyProviderFactory) {
|
|
1329
1319
|
if (process.env.NODE_ENV !== "production") {
|
|
1330
1320
|
try {
|
|
1331
1321
|
new URL(baseUrl);
|
|
@@ -1390,13 +1380,13 @@ async function toDataValueQueries(value, client, desiredType) {
|
|
|
1390
1380
|
switch (desiredType.type) {
|
|
1391
1381
|
case "attachment": {
|
|
1392
1382
|
if (isAttachmentUpload(value)) {
|
|
1393
|
-
const attachment = await
|
|
1383
|
+
const attachment = await chunkQHPACIXZ_cjs.Attachment_exports.upload(client, value.data, {
|
|
1394
1384
|
filename: value.name
|
|
1395
1385
|
});
|
|
1396
1386
|
return attachment.rid;
|
|
1397
1387
|
}
|
|
1398
1388
|
if (isAttachmentFile(value)) {
|
|
1399
|
-
const attachment = await
|
|
1389
|
+
const attachment = await chunkQHPACIXZ_cjs.Attachment_exports.upload(client, value, {
|
|
1400
1390
|
filename: value.name
|
|
1401
1391
|
});
|
|
1402
1392
|
return attachment.rid;
|
|
@@ -1427,11 +1417,11 @@ async function toDataValueQueries(value, client, desiredType) {
|
|
|
1427
1417
|
break;
|
|
1428
1418
|
}
|
|
1429
1419
|
case "objectSet": {
|
|
1430
|
-
if (
|
|
1420
|
+
if (chunkQHPACIXZ_cjs.isWireObjectSet(value)) {
|
|
1431
1421
|
return value;
|
|
1432
1422
|
}
|
|
1433
|
-
if (
|
|
1434
|
-
return
|
|
1423
|
+
if (chunkQHPACIXZ_cjs.isObjectSet(value)) {
|
|
1424
|
+
return chunkQHPACIXZ_cjs.getWireObjectSet(value);
|
|
1435
1425
|
}
|
|
1436
1426
|
break;
|
|
1437
1427
|
}
|
|
@@ -1473,7 +1463,7 @@ async function toDataValueQueries(value, client, desiredType) {
|
|
|
1473
1463
|
// src/queries/applyQuery.ts
|
|
1474
1464
|
async function applyQuery(client, query, params) {
|
|
1475
1465
|
const qd = await client.ontologyProvider.getQueryDefinition(query.apiName, query.isFixedVersion ? query.version : void 0);
|
|
1476
|
-
const response = await
|
|
1466
|
+
const response = await chunkQHPACIXZ_cjs.Query_exports.execute(chunkQHPACIXZ_cjs.addUserAgentAndRequestContextHeaders(chunkQHPACIXZ_cjs.augmentRequestContext(client, (_) => ({
|
|
1477
1467
|
finalMethodCall: "applyQuery"
|
|
1478
1468
|
})), query), await client.ontologyRid, query.apiName, {
|
|
1479
1469
|
parameters: params ? await remapQueryParams(params, client, qd.parameters) : {}
|
|
@@ -1520,7 +1510,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
1520
1510
|
return responseValue;
|
|
1521
1511
|
}
|
|
1522
1512
|
case "attachment": {
|
|
1523
|
-
return
|
|
1513
|
+
return chunkQHPACIXZ_cjs.hydrateAttachmentFromRidInternal(client, responseValue);
|
|
1524
1514
|
}
|
|
1525
1515
|
case "object": {
|
|
1526
1516
|
const def = definitions.get(responseDataType.object);
|
|
@@ -1535,7 +1525,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
1535
1525
|
throw new Error(`Missing definition for ${responseDataType.objectSet}`);
|
|
1536
1526
|
}
|
|
1537
1527
|
if (typeof responseValue === "string") {
|
|
1538
|
-
return
|
|
1528
|
+
return chunkQHPACIXZ_cjs.createObjectSet(def, client, {
|
|
1539
1529
|
type: "intersect",
|
|
1540
1530
|
objectSets: [{
|
|
1541
1531
|
type: "base",
|
|
@@ -1546,7 +1536,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
1546
1536
|
}]
|
|
1547
1537
|
});
|
|
1548
1538
|
}
|
|
1549
|
-
return
|
|
1539
|
+
return chunkQHPACIXZ_cjs.createObjectSet(def, client, responseValue);
|
|
1550
1540
|
}
|
|
1551
1541
|
case "struct": {
|
|
1552
1542
|
for (const [key, subtype] of Object.entries(responseDataType.struct)) {
|
|
@@ -1624,16 +1614,20 @@ async function getRequiredDefinitions(dataType, client) {
|
|
|
1624
1614
|
return getRequiredDefinitions(dataType.set, client);
|
|
1625
1615
|
}
|
|
1626
1616
|
case "map": {
|
|
1627
|
-
|
|
1628
|
-
|
|
1617
|
+
const types = [dataType.keyType, dataType.valueType];
|
|
1618
|
+
const allDefs = await Promise.all(types.map((value) => getRequiredDefinitions(value, client)));
|
|
1619
|
+
for (const defs of allDefs) {
|
|
1620
|
+
for (const [type, objectDef] of defs) {
|
|
1629
1621
|
result.set(type, objectDef);
|
|
1630
1622
|
}
|
|
1631
1623
|
}
|
|
1632
1624
|
break;
|
|
1633
1625
|
}
|
|
1634
1626
|
case "struct": {
|
|
1635
|
-
|
|
1636
|
-
|
|
1627
|
+
const structValues = Object.values(dataType.struct);
|
|
1628
|
+
const allDefs = await Promise.all(structValues.map((value) => getRequiredDefinitions(value, client)));
|
|
1629
|
+
for (const defs of allDefs) {
|
|
1630
|
+
for (const [type, objectDef] of defs) {
|
|
1637
1631
|
result.set(type, objectDef);
|
|
1638
1632
|
}
|
|
1639
1633
|
}
|
|
@@ -1714,7 +1708,7 @@ function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvi
|
|
|
1714
1708
|
ontologyRid
|
|
1715
1709
|
}, baseUrl, tokenProvider, {
|
|
1716
1710
|
...options,
|
|
1717
|
-
logger: options?.logger ?? new
|
|
1711
|
+
logger: options?.logger ?? new chunkQHPACIXZ_cjs.MinimalLogger()
|
|
1718
1712
|
}, fetchFn, objectSetFactory);
|
|
1719
1713
|
return createClientFromContext(clientCtx);
|
|
1720
1714
|
}
|
|
@@ -1735,7 +1729,7 @@ function createClientFromContext(clientCtx) {
|
|
|
1735
1729
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid.name:
|
|
1736
1730
|
return {
|
|
1737
1731
|
fetchOneByRid: async (objectType, rid, options) => {
|
|
1738
|
-
return await
|
|
1732
|
+
return await chunkQHPACIXZ_cjs.fetchSingle(clientCtx, objectType, options, createWithRid([rid]));
|
|
1739
1733
|
}
|
|
1740
1734
|
};
|
|
1741
1735
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference.name:
|
|
@@ -1747,7 +1741,7 @@ function createClientFromContext(clientCtx) {
|
|
|
1747
1741
|
objectType,
|
|
1748
1742
|
propertyType
|
|
1749
1743
|
} = args;
|
|
1750
|
-
return await
|
|
1744
|
+
return await chunkQHPACIXZ_cjs.MediaReferenceProperty_exports.upload(clientCtx, await clientCtx.ontologyRid, objectType.apiName, propertyType, data, {
|
|
1751
1745
|
mediaItemPath: fileName,
|
|
1752
1746
|
preview: true
|
|
1753
1747
|
});
|
|
@@ -1756,7 +1750,7 @@ function createClientFromContext(clientCtx) {
|
|
|
1756
1750
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid.name:
|
|
1757
1751
|
return {
|
|
1758
1752
|
fetchPageByRid: async (objectOrInterfaceType, rids, options = {}) => {
|
|
1759
|
-
return await
|
|
1753
|
+
return await chunkQHPACIXZ_cjs.fetchPage(clientCtx, objectOrInterfaceType, options, createWithRid(rids));
|
|
1760
1754
|
}
|
|
1761
1755
|
};
|
|
1762
1756
|
}
|
|
@@ -1768,13 +1762,13 @@ function createClientFromContext(clientCtx) {
|
|
|
1768
1762
|
const fetchMetadata = fetchMetadataInternal.bind(void 0, clientCtx);
|
|
1769
1763
|
const symbolClientContext2 = "__osdkClientContext";
|
|
1770
1764
|
const client = Object.defineProperties(clientFn, {
|
|
1771
|
-
[
|
|
1765
|
+
[chunkQHPACIXZ_cjs.symbolClientContext]: {
|
|
1772
1766
|
value: clientCtx
|
|
1773
1767
|
},
|
|
1774
1768
|
[symbolClientContext2]: {
|
|
1775
1769
|
value: clientCtx
|
|
1776
1770
|
},
|
|
1777
|
-
[
|
|
1771
|
+
[chunkQHPACIXZ_cjs.additionalContext]: {
|
|
1778
1772
|
value: clientCtx
|
|
1779
1773
|
},
|
|
1780
1774
|
fetchMetadata: {
|
|
@@ -1783,7 +1777,7 @@ function createClientFromContext(clientCtx) {
|
|
|
1783
1777
|
});
|
|
1784
1778
|
return client;
|
|
1785
1779
|
}
|
|
1786
|
-
var createClient = createClientInternal.bind(void 0,
|
|
1780
|
+
var createClient = createClientInternal.bind(void 0, chunkQHPACIXZ_cjs.createObjectSet);
|
|
1787
1781
|
function createWithRid(rids) {
|
|
1788
1782
|
const withRid = {
|
|
1789
1783
|
type: "static",
|
|
@@ -1800,5 +1794,5 @@ exports.UnderlyingOsdkObject = UnderlyingOsdkObject;
|
|
|
1800
1794
|
exports.createAttachmentUpload = createAttachmentUpload;
|
|
1801
1795
|
exports.createClient = createClient;
|
|
1802
1796
|
exports.createClientFromContext = createClientFromContext;
|
|
1803
|
-
//# sourceMappingURL=chunk-
|
|
1804
|
-
//# sourceMappingURL=chunk-
|
|
1797
|
+
//# sourceMappingURL=chunk-2MTGADU5.cjs.map
|
|
1798
|
+
//# sourceMappingURL=chunk-2MTGADU5.cjs.map
|