@osdk/client 2.3.0-rc.11 → 2.4.0-beta.2
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 +155 -7
- package/build/browser/Client.js +1 -1
- package/build/browser/Client.js.map +1 -1
- package/build/browser/derivedProperties/createWithPropertiesObjectSet.js +41 -1
- package/build/browser/derivedProperties/createWithPropertiesObjectSet.js.map +1 -1
- package/build/browser/derivedProperties/createWithPropertiesObjectSet.test.js +145 -12
- package/build/browser/derivedProperties/createWithPropertiesObjectSet.test.js.map +1 -1
- package/build/browser/derivedProperties/derivedPropertyDefinitionFactory.js +93 -0
- package/build/browser/derivedProperties/derivedPropertyDefinitionFactory.js.map +1 -0
- package/build/browser/fetchMetadata.test.js +14 -0
- package/build/browser/fetchMetadata.test.js.map +1 -1
- package/build/browser/index.js +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/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 +240 -0
- package/build/browser/object/convertWireToOsdkObjects.test.js.map +1 -1
- package/build/browser/object/mediaUpload.js +3 -0
- package/build/browser/object/mediaUpload.js.map +1 -1
- package/build/browser/objectSet/ObjectSet.test.js +105 -106
- 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-utils/hydrateObjectSetFromObjectRids.js +4 -1
- package/build/browser/public-utils/hydrateObjectSetFromObjectRids.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/browser/util/toDataValue.js +17 -1
- package/build/browser/util/toDataValue.js.map +1 -1
- package/build/browser/util/toDataValue.test.js +42 -2
- package/build/browser/util/toDataValue.test.js.map +1 -1
- package/build/cjs/{chunk-LZ4GFSOQ.cjs → chunk-NOQSRSD6.cjs} +102 -62
- package/build/cjs/chunk-NOQSRSD6.cjs.map +1 -0
- package/build/cjs/{chunk-QHPACIXZ.cjs → chunk-OKQUXVEK.cjs} +158 -24
- package/build/cjs/chunk-OKQUXVEK.cjs.map +1 -0
- package/build/cjs/index.cjs +10 -6
- package/build/cjs/index.d.cts +1 -1
- package/build/cjs/public/internal.cjs +12 -9
- package/build/cjs/public/internal.cjs.map +1 -1
- package/build/cjs/public/internal.d.cts +1 -1
- package/build/cjs/public/unstable-do-not-use.cjs +23 -15
- package/build/cjs/public/unstable-do-not-use.cjs.map +1 -1
- package/build/cjs/public/unstable-do-not-use.d.cts +2 -1
- package/build/esm/Client.js +1 -1
- package/build/esm/Client.js.map +1 -1
- package/build/esm/derivedProperties/createWithPropertiesObjectSet.js +41 -1
- package/build/esm/derivedProperties/createWithPropertiesObjectSet.js.map +1 -1
- package/build/esm/derivedProperties/createWithPropertiesObjectSet.test.js +145 -12
- package/build/esm/derivedProperties/createWithPropertiesObjectSet.test.js.map +1 -1
- package/build/esm/derivedProperties/derivedPropertyDefinitionFactory.js +93 -0
- package/build/esm/derivedProperties/derivedPropertyDefinitionFactory.js.map +1 -0
- package/build/esm/fetchMetadata.test.js +14 -0
- package/build/esm/fetchMetadata.test.js.map +1 -1
- package/build/esm/index.js +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/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 +240 -0
- package/build/esm/object/convertWireToOsdkObjects.test.js.map +1 -1
- package/build/esm/object/mediaUpload.js +3 -0
- package/build/esm/object/mediaUpload.js.map +1 -1
- package/build/esm/objectSet/ObjectSet.test.js +105 -106
- 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-utils/hydrateObjectSetFromObjectRids.js +4 -1
- package/build/esm/public-utils/hydrateObjectSetFromObjectRids.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/esm/util/toDataValue.js +17 -1
- package/build/esm/util/toDataValue.js.map +1 -1
- package/build/esm/util/toDataValue.test.js +42 -2
- package/build/esm/util/toDataValue.test.js.map +1 -1
- package/build/types/Client.d.ts +1 -1
- package/build/types/derivedProperties/derivedPropertyDefinitionFactory.d.ts +1 -0
- package/build/types/derivedProperties/derivedPropertyDefinitionFactory.d.ts.map +1 -0
- package/build/types/index.d.ts +1 -1
- package/build/types/index.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/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-utils/hydrateObjectSetFromObjectRids.d.ts +1 -1
- package/build/types/public-utils/hydrateObjectSetFromObjectRids.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 +11 -11
- package/build/cjs/chunk-LZ4GFSOQ.cjs.map +0 -1
- package/build/cjs/chunk-QHPACIXZ.cjs.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkOKQUXVEK_cjs = require('./chunk-OKQUXVEK.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');
|
|
7
|
-
var shared_client_impl = require('@osdk/shared.client.impl');
|
|
8
7
|
var api = require('@osdk/api');
|
|
8
|
+
var shared_client_impl = require('@osdk/shared.client.impl');
|
|
9
9
|
var generatorConverters = require('@osdk/generator-converters');
|
|
10
10
|
|
|
11
11
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -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) {
|
|
@@ -410,44 +413,54 @@ async function toDataValue(value, client, actionMetadata) {
|
|
|
410
413
|
if (value == null) {
|
|
411
414
|
return value;
|
|
412
415
|
}
|
|
416
|
+
if (value === api.NULL_VALUE) {
|
|
417
|
+
return null;
|
|
418
|
+
}
|
|
413
419
|
if (Array.isArray(value) || value instanceof Set) {
|
|
414
420
|
const values = Array.from(value);
|
|
415
421
|
if (values.some((dataValue) => isAttachmentUpload(dataValue) || isAttachmentFile(dataValue))) {
|
|
416
422
|
const converted = [];
|
|
417
423
|
for (const value2 of values) {
|
|
418
|
-
converted.push(await toDataValue(value2, client));
|
|
424
|
+
converted.push(await toDataValue(value2, client, actionMetadata));
|
|
419
425
|
}
|
|
420
426
|
return converted;
|
|
421
427
|
}
|
|
422
|
-
const promiseArray = Array.from(value, async (innerValue) => await toDataValue(innerValue, client));
|
|
428
|
+
const promiseArray = Array.from(value, async (innerValue) => await toDataValue(innerValue, client, actionMetadata));
|
|
423
429
|
return Promise.all(promiseArray);
|
|
424
430
|
}
|
|
425
431
|
if (isAttachmentUpload(value)) {
|
|
426
|
-
const attachment = await
|
|
432
|
+
const attachment = await chunkOKQUXVEK_cjs.Attachment_exports.upload(client, value.data, {
|
|
427
433
|
filename: value.name
|
|
428
434
|
});
|
|
429
|
-
return await toDataValue(attachment.rid, client);
|
|
435
|
+
return await toDataValue(attachment.rid, client, actionMetadata);
|
|
430
436
|
}
|
|
431
437
|
if (isAttachmentFile(value)) {
|
|
432
|
-
const attachment = await
|
|
438
|
+
const attachment = await chunkOKQUXVEK_cjs.Attachment_exports.upload(client, value, {
|
|
433
439
|
filename: value.name
|
|
434
440
|
});
|
|
435
|
-
return await toDataValue(attachment.rid, client);
|
|
441
|
+
return await toDataValue(attachment.rid, client, actionMetadata);
|
|
442
|
+
}
|
|
443
|
+
if (isMediaUpload(value)) {
|
|
444
|
+
const mediaRef = await chunkOKQUXVEK_cjs.MediaReferenceProperty_exports.uploadMedia(client, await client.ontologyRid, actionMetadata.apiName, value.data, {
|
|
445
|
+
mediaItemPath: value.path,
|
|
446
|
+
preview: true
|
|
447
|
+
});
|
|
448
|
+
return await toDataValue(mediaRef, client, actionMetadata);
|
|
436
449
|
}
|
|
437
450
|
if (isOntologyObjectV2(value)) {
|
|
438
|
-
return await toDataValue(value.__primaryKey, client);
|
|
451
|
+
return await toDataValue(value.__primaryKey, client, actionMetadata);
|
|
439
452
|
}
|
|
440
453
|
if (isObjectSpecifiersObject(value)) {
|
|
441
|
-
return await toDataValue(value.$primaryKey, client);
|
|
454
|
+
return await toDataValue(value.$primaryKey, client, actionMetadata);
|
|
442
455
|
}
|
|
443
456
|
if (isPoint(value)) {
|
|
444
|
-
return await toDataValue(`${value.coordinates[1]},${value.coordinates[0]}`, client);
|
|
457
|
+
return await toDataValue(`${value.coordinates[1]},${value.coordinates[0]}`, client, actionMetadata);
|
|
445
458
|
}
|
|
446
|
-
if (
|
|
459
|
+
if (chunkOKQUXVEK_cjs.isWireObjectSet(value)) {
|
|
447
460
|
return value;
|
|
448
461
|
}
|
|
449
|
-
if (
|
|
450
|
-
return
|
|
462
|
+
if (chunkOKQUXVEK_cjs.isObjectSet(value)) {
|
|
463
|
+
return chunkOKQUXVEK_cjs.getWireObjectSet(value);
|
|
451
464
|
}
|
|
452
465
|
if (isMediaReference(value)) {
|
|
453
466
|
return value;
|
|
@@ -461,7 +474,7 @@ async function toDataValue(value, client, actionMetadata) {
|
|
|
461
474
|
if (typeof value === "object") {
|
|
462
475
|
return Object.entries(value).reduce(async (promisedAcc, [key, structValue]) => {
|
|
463
476
|
const acc = await promisedAcc;
|
|
464
|
-
acc[key] = await toDataValue(structValue, client);
|
|
477
|
+
acc[key] = await toDataValue(structValue, client, actionMetadata);
|
|
465
478
|
return acc;
|
|
466
479
|
}, Promise.resolve({}));
|
|
467
480
|
}
|
|
@@ -470,11 +483,11 @@ async function toDataValue(value, client, actionMetadata) {
|
|
|
470
483
|
|
|
471
484
|
// src/actions/applyAction.ts
|
|
472
485
|
async function applyAction(client, action, parameters, options = {}) {
|
|
473
|
-
const clientWithHeaders =
|
|
486
|
+
const clientWithHeaders = chunkOKQUXVEK_cjs.addUserAgentAndRequestContextHeaders(chunkOKQUXVEK_cjs.augmentRequestContext(client, (_) => ({
|
|
474
487
|
finalMethodCall: "applyAction"
|
|
475
488
|
})), action);
|
|
476
489
|
if (Array.isArray(parameters)) {
|
|
477
|
-
const response = await
|
|
490
|
+
const response = await chunkOKQUXVEK_cjs.Action_exports.applyBatch(clientWithHeaders, await client.ontologyRid, action.apiName, {
|
|
478
491
|
requests: parameters ? await remapBatchActionParams(parameters, client, await client.ontologyProvider.getActionDefinition(action.apiName)) : [],
|
|
479
492
|
options: {
|
|
480
493
|
returnEdits: options?.$returnEdits ? "ALL" : "NONE"
|
|
@@ -483,7 +496,7 @@ async function applyAction(client, action, parameters, options = {}) {
|
|
|
483
496
|
const edits = response.edits;
|
|
484
497
|
return options?.$returnEdits ? edits?.type === "edits" ? remapActionResponse(response) : edits : void 0;
|
|
485
498
|
} else {
|
|
486
|
-
const response = await
|
|
499
|
+
const response = await chunkOKQUXVEK_cjs.Action_exports.apply(clientWithHeaders, await client.ontologyRid, action.apiName, {
|
|
487
500
|
parameters: await remapActionParams(parameters, client, await client.ontologyProvider.getActionDefinition(action.apiName)),
|
|
488
501
|
options: {
|
|
489
502
|
mode: options?.$validateOnly ? "VALIDATE_ONLY" : "VALIDATE_AND_EXECUTE",
|
|
@@ -507,14 +520,14 @@ async function remapActionParams(params, client, actionMetadata) {
|
|
|
507
520
|
}
|
|
508
521
|
const parameterMap = {};
|
|
509
522
|
for (const [key, value] of Object.entries(params)) {
|
|
510
|
-
parameterMap[key] = await toDataValue(value, client);
|
|
523
|
+
parameterMap[key] = await toDataValue(value, client, actionMetadata);
|
|
511
524
|
}
|
|
512
525
|
return parameterMap;
|
|
513
526
|
}
|
|
514
527
|
async function remapBatchActionParams(params, client, actionMetadata) {
|
|
515
528
|
const remappedParams = await Promise.all(params.map(async (param) => {
|
|
516
529
|
return {
|
|
517
|
-
parameters: await remapActionParams(param, client)
|
|
530
|
+
parameters: await remapActionParams(param, client, actionMetadata)
|
|
518
531
|
};
|
|
519
532
|
}));
|
|
520
533
|
return remappedParams;
|
|
@@ -688,7 +701,7 @@ var GeotimeSeriesPropertyImpl = class {
|
|
|
688
701
|
}
|
|
689
702
|
}
|
|
690
703
|
async getLatestValue() {
|
|
691
|
-
const latestPointPromise =
|
|
704
|
+
const latestPointPromise = chunkOKQUXVEK_cjs.TimeSeriesValueBankProperty_exports.getLatestValue(this.#client, await this.#client.ontologyRid, ...this.#triplet);
|
|
692
705
|
latestPointPromise.then(
|
|
693
706
|
(latestPoint) => this.lastFetchedValue = latestPoint,
|
|
694
707
|
// eslint-disable-next-line no-console
|
|
@@ -704,7 +717,7 @@ var GeotimeSeriesPropertyImpl = class {
|
|
|
704
717
|
return allPoints;
|
|
705
718
|
}
|
|
706
719
|
async *asyncIterValues(query) {
|
|
707
|
-
const streamPointsIterator = await
|
|
720
|
+
const streamPointsIterator = await chunkOKQUXVEK_cjs.TimeSeriesValueBankProperty_exports.streamValues(this.#client, await this.#client.ontologyRid, ...this.#triplet, query ? {
|
|
708
721
|
range: getTimeRange(query)
|
|
709
722
|
} : {});
|
|
710
723
|
for await (const timeseriesPoint of asyncIterPointsHelper(streamPointsIterator)) {
|
|
@@ -731,13 +744,13 @@ var MediaReferencePropertyImpl = class {
|
|
|
731
744
|
this.#mediaReference = mediaReference;
|
|
732
745
|
}
|
|
733
746
|
async fetchContents() {
|
|
734
|
-
return
|
|
747
|
+
return chunkOKQUXVEK_cjs.MediaReferenceProperty_exports.getMediaContent(this.#client, await this.#client.ontologyRid, ...this.#triplet, {
|
|
735
748
|
preview: true
|
|
736
749
|
// TODO: Can turn this back off when backend is no longer in beta.
|
|
737
750
|
});
|
|
738
751
|
}
|
|
739
752
|
async fetchMetadata() {
|
|
740
|
-
const r = await
|
|
753
|
+
const r = await chunkOKQUXVEK_cjs.MediaReferenceProperty_exports.getMediaMetadata(this.#client, await this.#client.ontologyRid, ...this.#triplet, {
|
|
741
754
|
preview: true
|
|
742
755
|
// TODO: Can turn this back off when backend is no longer in beta.
|
|
743
756
|
});
|
|
@@ -761,10 +774,10 @@ var TimeSeriesPropertyImpl = class {
|
|
|
761
774
|
this.#triplet = [objectApiName, primaryKey, propertyName];
|
|
762
775
|
}
|
|
763
776
|
async getFirstPoint() {
|
|
764
|
-
return
|
|
777
|
+
return chunkOKQUXVEK_cjs.TimeSeriesPropertyV2_exports.getFirstPoint(this.#client, await this.#client.ontologyRid, ...this.#triplet);
|
|
765
778
|
}
|
|
766
779
|
async getLastPoint() {
|
|
767
|
-
return
|
|
780
|
+
return chunkOKQUXVEK_cjs.TimeSeriesPropertyV2_exports.getLastPoint(this.#client, await this.#client.ontologyRid, ...this.#triplet);
|
|
768
781
|
}
|
|
769
782
|
async getAllPoints(query) {
|
|
770
783
|
const allPoints = [];
|
|
@@ -774,7 +787,7 @@ var TimeSeriesPropertyImpl = class {
|
|
|
774
787
|
return allPoints;
|
|
775
788
|
}
|
|
776
789
|
async *asyncIterPoints(query) {
|
|
777
|
-
const streamPointsIterator = await
|
|
790
|
+
const streamPointsIterator = await chunkOKQUXVEK_cjs.TimeSeriesPropertyV2_exports.streamPoints(this.#client, await this.#client.ontologyRid, ...this.#triplet, query ? {
|
|
778
791
|
range: getTimeRange(query)
|
|
779
792
|
} : {});
|
|
780
793
|
for await (const timeseriesPoint of asyncIterPointsHelper(streamPointsIterator)) {
|
|
@@ -802,7 +815,7 @@ var ClientRef = Symbol("ClientRef" );
|
|
|
802
815
|
|
|
803
816
|
// src/object/convertWireToOsdkObjects/createOsdkInterface.ts
|
|
804
817
|
function createOsdkInterface(underlying, interfaceDef) {
|
|
805
|
-
const [objApiNamespace] =
|
|
818
|
+
const [objApiNamespace] = chunkOKQUXVEK_cjs.extractNamespace(interfaceDef.apiName);
|
|
806
819
|
return Object.freeze(Object.defineProperties({}, {
|
|
807
820
|
// first to minimize hidden classes
|
|
808
821
|
[UnderlyingOsdkObject]: {
|
|
@@ -840,12 +853,19 @@ function createOsdkInterface(underlying, interfaceDef) {
|
|
|
840
853
|
value: clone,
|
|
841
854
|
enumerable: false
|
|
842
855
|
},
|
|
856
|
+
"$__EXPERIMENTAL__NOT_SUPPORTED_YET__metadata": {
|
|
857
|
+
value: {
|
|
858
|
+
"ObjectMetadata": underlying[ObjectDefRef],
|
|
859
|
+
"InterfaceMetadata": interfaceDef
|
|
860
|
+
},
|
|
861
|
+
enumerable: false
|
|
862
|
+
},
|
|
843
863
|
[InterfaceDefRef]: {
|
|
844
864
|
value: interfaceDef
|
|
845
865
|
},
|
|
846
866
|
...Object.fromEntries(Object.keys(interfaceDef.properties).map((p) => {
|
|
847
867
|
const objDef = underlying[ObjectDefRef];
|
|
848
|
-
const [apiNamespace, apiName] =
|
|
868
|
+
const [apiNamespace, apiName] = chunkOKQUXVEK_cjs.extractNamespace(p);
|
|
849
869
|
const targetPropName = objDef.interfaceMap[interfaceDef.apiName][p];
|
|
850
870
|
return [apiNamespace === objApiNamespace ? apiName : p, {
|
|
851
871
|
enumerable: targetPropName in underlying,
|
|
@@ -921,8 +941,8 @@ function get$link(holder) {
|
|
|
921
941
|
[objDef.primaryKeyApiName]: rawObj.$primaryKey
|
|
922
942
|
}).pivotTo(linkName);
|
|
923
943
|
const value = !linkDef.multiplicity ? {
|
|
924
|
-
fetchOne: (options) =>
|
|
925
|
-
fetchOneWithErrors: (options) =>
|
|
944
|
+
fetchOne: (options) => chunkOKQUXVEK_cjs.fetchSingle(client, objDef, options ?? {}, chunkOKQUXVEK_cjs.getWireObjectSet(objectSet)),
|
|
945
|
+
fetchOneWithErrors: (options) => chunkOKQUXVEK_cjs.fetchSingleWithErrors(client, objDef, options ?? {}, chunkOKQUXVEK_cjs.getWireObjectSet(objectSet))
|
|
926
946
|
} : objectSet;
|
|
927
947
|
return [linkName, value];
|
|
928
948
|
})));
|
|
@@ -969,6 +989,14 @@ var basePropDefs = {
|
|
|
969
989
|
return createObjectSpecifierFromPrimaryKey(this[ObjectDefRef], rawObj.$primaryKey);
|
|
970
990
|
},
|
|
971
991
|
enumerable: true
|
|
992
|
+
},
|
|
993
|
+
"$__EXPERIMENTAL__NOT_SUPPORTED_YET__metadata": {
|
|
994
|
+
get: function() {
|
|
995
|
+
return {
|
|
996
|
+
ObjectMetadata: this[ObjectDefRef]
|
|
997
|
+
};
|
|
998
|
+
},
|
|
999
|
+
enumerable: false
|
|
972
1000
|
}
|
|
973
1001
|
};
|
|
974
1002
|
function createOsdkObject(client, objectDef, simpleOsdkProperties, derivedPropertyTypeByName = {}) {
|
|
@@ -982,6 +1010,7 @@ function createOsdkObject(client, objectDef, simpleOsdkProperties, derivedProper
|
|
|
982
1010
|
value: objectDef,
|
|
983
1011
|
enumerable: false
|
|
984
1012
|
},
|
|
1013
|
+
// TODO: Potentially update when GA metadata field
|
|
985
1014
|
[ClientRef]: {
|
|
986
1015
|
value: client,
|
|
987
1016
|
enumerable: false
|
|
@@ -1006,9 +1035,9 @@ function modifyRdpProperties(client, derivedPropertyTypeByName, rawValue, propKe
|
|
|
1006
1035
|
switch (derivedPropertyTypeByName[propKey].selectedOrCollectedPropertyType?.type) {
|
|
1007
1036
|
case "attachment":
|
|
1008
1037
|
if (Array.isArray(rawValue)) {
|
|
1009
|
-
return rawValue.map((a) =>
|
|
1038
|
+
return rawValue.map((a) => chunkOKQUXVEK_cjs.hydrateAttachmentFromRidInternal(client, a.rid));
|
|
1010
1039
|
} else {
|
|
1011
|
-
return
|
|
1040
|
+
return chunkOKQUXVEK_cjs.hydrateAttachmentFromRidInternal(client, rawValue.rid);
|
|
1012
1041
|
}
|
|
1013
1042
|
default:
|
|
1014
1043
|
process.env.NODE_ENV !== "production" ? invariant__default.default(false, "Derived property aggregations for Timeseries and Media are not supported") : invariant__default.default(false) ;
|
|
@@ -1024,9 +1053,9 @@ function createSpecialProperty(client, objectDef, rawObject, p) {
|
|
|
1024
1053
|
}
|
|
1025
1054
|
if (propDef.type === "attachment") {
|
|
1026
1055
|
if (Array.isArray(rawValue)) {
|
|
1027
|
-
return rawValue.map((a) =>
|
|
1056
|
+
return rawValue.map((a) => chunkOKQUXVEK_cjs.hydrateAttachmentFromRidInternal(client, a.rid));
|
|
1028
1057
|
}
|
|
1029
|
-
return
|
|
1058
|
+
return chunkOKQUXVEK_cjs.hydrateAttachmentFromRidInternal(client, rawValue.rid);
|
|
1030
1059
|
}
|
|
1031
1060
|
if (propDef.type === "numericTimeseries" || propDef.type === "stringTimeseries" || propDef.type === "sensorTimeseries") {
|
|
1032
1061
|
return new TimeSeriesPropertyImpl(client, objectDef.apiName, rawObject[objectDef.primaryKeyApiName], p);
|
|
@@ -1233,12 +1262,23 @@ function createAsyncClientCache(fn, createCacheLocal = createClientCache) {
|
|
|
1233
1262
|
};
|
|
1234
1263
|
return ret;
|
|
1235
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
|
+
}
|
|
1236
1276
|
async function loadActionMetadata(client, actionType) {
|
|
1237
|
-
const r = await
|
|
1277
|
+
const r = await chunkOKQUXVEK_cjs.ActionTypeV2_exports.get(client, await client.ontologyRid, actionType);
|
|
1238
1278
|
return generatorConverters.wireActionTypeV2ToSdkActionMetadata(r);
|
|
1239
1279
|
}
|
|
1240
1280
|
async function loadFullObjectMetadata(client, objectType) {
|
|
1241
|
-
const full = await
|
|
1281
|
+
const full = await chunkOKQUXVEK_cjs.ObjectTypeV2_exports.getFullMetadata(client, await client.ontologyRid, objectType, {
|
|
1242
1282
|
preview: true
|
|
1243
1283
|
});
|
|
1244
1284
|
const ret = generatorConverters.wireObjectTypeFullMetadataToSdkObjectMetadata(full, true);
|
|
@@ -1247,14 +1287,14 @@ async function loadFullObjectMetadata(client, objectType) {
|
|
|
1247
1287
|
};
|
|
1248
1288
|
}
|
|
1249
1289
|
async function loadInterfaceMetadata(client, objectType) {
|
|
1250
|
-
const r = await
|
|
1290
|
+
const r = await chunkOKQUXVEK_cjs.OntologyInterface_exports.get(client, await client.ontologyRid, objectType, {
|
|
1251
1291
|
preview: true
|
|
1252
1292
|
});
|
|
1253
1293
|
return generatorConverters.__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(r, true);
|
|
1254
1294
|
}
|
|
1255
1295
|
async function loadQueryMetadata(client, queryTypeApiNameAndVersion) {
|
|
1256
1296
|
const [apiName, version] = queryTypeApiNameAndVersion.split(":");
|
|
1257
|
-
const r = await
|
|
1297
|
+
const r = await chunkOKQUXVEK_cjs.QueryType_exports.get(client, await client.ontologyRid, apiName, {
|
|
1258
1298
|
version
|
|
1259
1299
|
});
|
|
1260
1300
|
return generatorConverters.wireQueryTypeV2ToSdkQueryMetadata(r);
|
|
@@ -1273,10 +1313,10 @@ var createStandardOntologyProviderFactory = (client) => {
|
|
|
1273
1313
|
...objectDef,
|
|
1274
1314
|
[InterfaceDefinitions]: interfaceDefs
|
|
1275
1315
|
};
|
|
1276
|
-
return fullObjectDef;
|
|
1316
|
+
return deepFreeze(fullObjectDef);
|
|
1277
1317
|
}
|
|
1278
1318
|
async function loadInterface(client3, key) {
|
|
1279
|
-
return loadInterfaceMetadata(client3, key);
|
|
1319
|
+
return deepFreeze(await loadInterfaceMetadata(client3, key));
|
|
1280
1320
|
}
|
|
1281
1321
|
async function loadQuery(client3, key) {
|
|
1282
1322
|
return loadQueryMetadata(client3, key);
|
|
@@ -1311,11 +1351,11 @@ var createStandardOntologyProviderFactory = (client) => {
|
|
|
1311
1351
|
};
|
|
1312
1352
|
|
|
1313
1353
|
// src/util/UserAgent.ts
|
|
1314
|
-
var USER_AGENT = `osdk-client/${"2.
|
|
1315
|
-
var OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.
|
|
1354
|
+
var USER_AGENT = `osdk-client/${"2.4.0-beta.2"}`;
|
|
1355
|
+
var OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.4.0-beta.2"}`;
|
|
1316
1356
|
|
|
1317
1357
|
// src/createMinimalClient.ts
|
|
1318
|
-
function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory =
|
|
1358
|
+
function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory = chunkOKQUXVEK_cjs.createObjectSet, createOntologyProviderFactory = createStandardOntologyProviderFactory) {
|
|
1319
1359
|
if (process.env.NODE_ENV !== "production") {
|
|
1320
1360
|
try {
|
|
1321
1361
|
new URL(baseUrl);
|
|
@@ -1380,13 +1420,13 @@ async function toDataValueQueries(value, client, desiredType) {
|
|
|
1380
1420
|
switch (desiredType.type) {
|
|
1381
1421
|
case "attachment": {
|
|
1382
1422
|
if (isAttachmentUpload(value)) {
|
|
1383
|
-
const attachment = await
|
|
1423
|
+
const attachment = await chunkOKQUXVEK_cjs.Attachment_exports.upload(client, value.data, {
|
|
1384
1424
|
filename: value.name
|
|
1385
1425
|
});
|
|
1386
1426
|
return attachment.rid;
|
|
1387
1427
|
}
|
|
1388
1428
|
if (isAttachmentFile(value)) {
|
|
1389
|
-
const attachment = await
|
|
1429
|
+
const attachment = await chunkOKQUXVEK_cjs.Attachment_exports.upload(client, value, {
|
|
1390
1430
|
filename: value.name
|
|
1391
1431
|
});
|
|
1392
1432
|
return attachment.rid;
|
|
@@ -1417,11 +1457,11 @@ async function toDataValueQueries(value, client, desiredType) {
|
|
|
1417
1457
|
break;
|
|
1418
1458
|
}
|
|
1419
1459
|
case "objectSet": {
|
|
1420
|
-
if (
|
|
1460
|
+
if (chunkOKQUXVEK_cjs.isWireObjectSet(value)) {
|
|
1421
1461
|
return value;
|
|
1422
1462
|
}
|
|
1423
|
-
if (
|
|
1424
|
-
return
|
|
1463
|
+
if (chunkOKQUXVEK_cjs.isObjectSet(value)) {
|
|
1464
|
+
return chunkOKQUXVEK_cjs.getWireObjectSet(value);
|
|
1425
1465
|
}
|
|
1426
1466
|
break;
|
|
1427
1467
|
}
|
|
@@ -1463,7 +1503,7 @@ async function toDataValueQueries(value, client, desiredType) {
|
|
|
1463
1503
|
// src/queries/applyQuery.ts
|
|
1464
1504
|
async function applyQuery(client, query, params) {
|
|
1465
1505
|
const qd = await client.ontologyProvider.getQueryDefinition(query.apiName, query.isFixedVersion ? query.version : void 0);
|
|
1466
|
-
const response = await
|
|
1506
|
+
const response = await chunkOKQUXVEK_cjs.Query_exports.execute(chunkOKQUXVEK_cjs.addUserAgentAndRequestContextHeaders(chunkOKQUXVEK_cjs.augmentRequestContext(client, (_) => ({
|
|
1467
1507
|
finalMethodCall: "applyQuery"
|
|
1468
1508
|
})), query), await client.ontologyRid, query.apiName, {
|
|
1469
1509
|
parameters: params ? await remapQueryParams(params, client, qd.parameters) : {}
|
|
@@ -1510,7 +1550,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
1510
1550
|
return responseValue;
|
|
1511
1551
|
}
|
|
1512
1552
|
case "attachment": {
|
|
1513
|
-
return
|
|
1553
|
+
return chunkOKQUXVEK_cjs.hydrateAttachmentFromRidInternal(client, responseValue);
|
|
1514
1554
|
}
|
|
1515
1555
|
case "object": {
|
|
1516
1556
|
const def = definitions.get(responseDataType.object);
|
|
@@ -1525,7 +1565,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
1525
1565
|
throw new Error(`Missing definition for ${responseDataType.objectSet}`);
|
|
1526
1566
|
}
|
|
1527
1567
|
if (typeof responseValue === "string") {
|
|
1528
|
-
return
|
|
1568
|
+
return chunkOKQUXVEK_cjs.createObjectSet(def, client, {
|
|
1529
1569
|
type: "intersect",
|
|
1530
1570
|
objectSets: [{
|
|
1531
1571
|
type: "base",
|
|
@@ -1536,7 +1576,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
1536
1576
|
}]
|
|
1537
1577
|
});
|
|
1538
1578
|
}
|
|
1539
|
-
return
|
|
1579
|
+
return chunkOKQUXVEK_cjs.createObjectSet(def, client, responseValue);
|
|
1540
1580
|
}
|
|
1541
1581
|
case "struct": {
|
|
1542
1582
|
for (const [key, subtype] of Object.entries(responseDataType.struct)) {
|
|
@@ -1708,7 +1748,7 @@ function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvi
|
|
|
1708
1748
|
ontologyRid
|
|
1709
1749
|
}, baseUrl, tokenProvider, {
|
|
1710
1750
|
...options,
|
|
1711
|
-
logger: options?.logger ?? new
|
|
1751
|
+
logger: options?.logger ?? new chunkOKQUXVEK_cjs.MinimalLogger()
|
|
1712
1752
|
}, fetchFn, objectSetFactory);
|
|
1713
1753
|
return createClientFromContext(clientCtx);
|
|
1714
1754
|
}
|
|
@@ -1729,7 +1769,7 @@ function createClientFromContext(clientCtx) {
|
|
|
1729
1769
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid.name:
|
|
1730
1770
|
return {
|
|
1731
1771
|
fetchOneByRid: async (objectType, rid, options) => {
|
|
1732
|
-
return await
|
|
1772
|
+
return await chunkOKQUXVEK_cjs.fetchSingle(clientCtx, objectType, options, createWithRid([rid]));
|
|
1733
1773
|
}
|
|
1734
1774
|
};
|
|
1735
1775
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference.name:
|
|
@@ -1741,7 +1781,7 @@ function createClientFromContext(clientCtx) {
|
|
|
1741
1781
|
objectType,
|
|
1742
1782
|
propertyType
|
|
1743
1783
|
} = args;
|
|
1744
|
-
return await
|
|
1784
|
+
return await chunkOKQUXVEK_cjs.MediaReferenceProperty_exports.upload(clientCtx, await clientCtx.ontologyRid, objectType.apiName, propertyType, data, {
|
|
1745
1785
|
mediaItemPath: fileName,
|
|
1746
1786
|
preview: true
|
|
1747
1787
|
});
|
|
@@ -1750,7 +1790,7 @@ function createClientFromContext(clientCtx) {
|
|
|
1750
1790
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid.name:
|
|
1751
1791
|
return {
|
|
1752
1792
|
fetchPageByRid: async (objectOrInterfaceType, rids, options = {}) => {
|
|
1753
|
-
return await
|
|
1793
|
+
return await chunkOKQUXVEK_cjs.fetchPage(clientCtx, objectOrInterfaceType, options, createWithRid(rids));
|
|
1754
1794
|
}
|
|
1755
1795
|
};
|
|
1756
1796
|
}
|
|
@@ -1762,13 +1802,13 @@ function createClientFromContext(clientCtx) {
|
|
|
1762
1802
|
const fetchMetadata = fetchMetadataInternal.bind(void 0, clientCtx);
|
|
1763
1803
|
const symbolClientContext2 = "__osdkClientContext";
|
|
1764
1804
|
const client = Object.defineProperties(clientFn, {
|
|
1765
|
-
[
|
|
1805
|
+
[chunkOKQUXVEK_cjs.symbolClientContext]: {
|
|
1766
1806
|
value: clientCtx
|
|
1767
1807
|
},
|
|
1768
1808
|
[symbolClientContext2]: {
|
|
1769
1809
|
value: clientCtx
|
|
1770
1810
|
},
|
|
1771
|
-
[
|
|
1811
|
+
[chunkOKQUXVEK_cjs.additionalContext]: {
|
|
1772
1812
|
value: clientCtx
|
|
1773
1813
|
},
|
|
1774
1814
|
fetchMetadata: {
|
|
@@ -1777,7 +1817,7 @@ function createClientFromContext(clientCtx) {
|
|
|
1777
1817
|
});
|
|
1778
1818
|
return client;
|
|
1779
1819
|
}
|
|
1780
|
-
var createClient = createClientInternal.bind(void 0,
|
|
1820
|
+
var createClient = createClientInternal.bind(void 0, chunkOKQUXVEK_cjs.createObjectSet);
|
|
1781
1821
|
function createWithRid(rids) {
|
|
1782
1822
|
const withRid = {
|
|
1783
1823
|
type: "static",
|
|
@@ -1794,5 +1834,5 @@ exports.UnderlyingOsdkObject = UnderlyingOsdkObject;
|
|
|
1794
1834
|
exports.createAttachmentUpload = createAttachmentUpload;
|
|
1795
1835
|
exports.createClient = createClient;
|
|
1796
1836
|
exports.createClientFromContext = createClientFromContext;
|
|
1797
|
-
//# sourceMappingURL=chunk-
|
|
1798
|
-
//# sourceMappingURL=chunk-
|
|
1837
|
+
//# sourceMappingURL=chunk-NOQSRSD6.cjs.map
|
|
1838
|
+
//# sourceMappingURL=chunk-NOQSRSD6.cjs.map
|