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