@osdk/client 2.4.0-beta.9 → 2.5.0-beta.1
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 +91 -0
- package/build/browser/MinimalClientContext.js.map +1 -1
- package/build/browser/createClient.js +5 -5
- package/build/browser/createClient.js.map +1 -1
- package/build/browser/createClient.test.js +3 -3
- package/build/browser/createClient.test.js.map +1 -1
- package/build/browser/createMinimalClient.js +1 -0
- package/build/browser/createMinimalClient.js.map +1 -1
- package/build/browser/fetchMetadata.test.js +7 -1
- package/build/browser/fetchMetadata.test.js.map +1 -1
- package/build/browser/index.js +1 -0
- package/build/browser/index.js.map +1 -1
- package/build/browser/object/aggregate.test.js +30 -0
- package/build/browser/object/aggregate.test.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects.js +3 -2
- package/build/browser/object/convertWireToOsdkObjects.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects.test.js +36 -24
- package/build/browser/object/convertWireToOsdkObjects.test.js.map +1 -1
- package/build/browser/object/fetchPage.js +9 -2
- package/build/browser/object/fetchPage.js.map +1 -1
- package/build/browser/objectSet/InterfaceObjectSet.test.js +5 -1
- package/build/browser/objectSet/InterfaceObjectSet.test.js.map +1 -1
- package/build/browser/objectSet/createObjectSet.js +5 -1
- package/build/browser/objectSet/createObjectSet.js.map +1 -1
- package/build/browser/observable/internal/ActionApplication.js +1 -1
- package/build/browser/observable/internal/ActionApplication.js.map +1 -1
- package/build/browser/observable/internal/Store.test.js +3 -0
- package/build/browser/observable/internal/Store.test.js.map +1 -1
- package/build/browser/ontology/StandardOntologyProvider.test.js +1 -1
- package/build/browser/ontology/StandardOntologyProvider.test.js.map +1 -1
- package/build/browser/public/unstable-do-not-use.js +1 -0
- package/build/browser/public/unstable-do-not-use.js.map +1 -1
- package/build/browser/public-utils/hydrateObjectSetFromObjectRids.js +4 -1
- package/build/browser/public-utils/hydrateObjectSetFromObjectRids.js.map +1 -1
- package/build/browser/public-utils/hydrateObjectSetFromRid.js +4 -1
- package/build/browser/public-utils/hydrateObjectSetFromRid.js.map +1 -1
- package/build/browser/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-E5BQ7757.cjs → chunk-BJYCRD5Y.cjs} +125 -52
- package/build/cjs/chunk-BJYCRD5Y.cjs.map +1 -0
- package/build/cjs/chunk-Q7SFCCGT.cjs +11 -0
- package/build/cjs/chunk-Q7SFCCGT.cjs.map +1 -0
- package/build/cjs/{chunk-YZHCDIYC.cjs → chunk-URDXPIRU.cjs} +107 -62
- package/build/cjs/chunk-URDXPIRU.cjs.map +1 -0
- package/build/cjs/createClient-BJo8T7Js.d.cts +9 -0
- package/build/cjs/delay-QK4T7RVX.cjs +74 -0
- package/build/cjs/delay-QK4T7RVX.cjs.map +1 -0
- package/build/cjs/index.cjs +11 -6
- package/build/cjs/index.cjs.map +1 -1
- package/build/cjs/index.d.cts +15 -8
- package/build/cjs/public/internal.cjs +17 -10
- 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 +22 -71
- 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/MinimalClientContext.js.map +1 -1
- package/build/esm/createClient.js +5 -5
- package/build/esm/createClient.js.map +1 -1
- package/build/esm/createClient.test.js +3 -3
- package/build/esm/createClient.test.js.map +1 -1
- package/build/esm/createMinimalClient.js +1 -0
- package/build/esm/createMinimalClient.js.map +1 -1
- package/build/esm/fetchMetadata.test.js +7 -1
- package/build/esm/fetchMetadata.test.js.map +1 -1
- package/build/esm/index.js +1 -0
- package/build/esm/index.js.map +1 -1
- package/build/esm/object/aggregate.test.js +30 -0
- package/build/esm/object/aggregate.test.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects.js +3 -2
- package/build/esm/object/convertWireToOsdkObjects.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects.test.js +36 -24
- package/build/esm/object/convertWireToOsdkObjects.test.js.map +1 -1
- package/build/esm/object/fetchPage.js +9 -2
- package/build/esm/object/fetchPage.js.map +1 -1
- package/build/esm/objectSet/InterfaceObjectSet.test.js +5 -1
- package/build/esm/objectSet/InterfaceObjectSet.test.js.map +1 -1
- package/build/esm/objectSet/createObjectSet.js +5 -1
- package/build/esm/objectSet/createObjectSet.js.map +1 -1
- package/build/esm/observable/internal/ActionApplication.js +1 -1
- package/build/esm/observable/internal/ActionApplication.js.map +1 -1
- package/build/esm/observable/internal/Store.test.js +3 -0
- package/build/esm/observable/internal/Store.test.js.map +1 -1
- package/build/esm/ontology/StandardOntologyProvider.test.js +1 -1
- package/build/esm/ontology/StandardOntologyProvider.test.js.map +1 -1
- package/build/esm/public/unstable-do-not-use.js +1 -0
- package/build/esm/public/unstable-do-not-use.js.map +1 -1
- package/build/esm/public-utils/hydrateObjectSetFromObjectRids.js +4 -1
- package/build/esm/public-utils/hydrateObjectSetFromObjectRids.js.map +1 -1
- package/build/esm/public-utils/hydrateObjectSetFromRid.js +4 -1
- package/build/esm/public-utils/hydrateObjectSetFromRid.js.map +1 -1
- package/build/esm/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/MinimalClientContext.d.ts +1 -0
- package/build/types/MinimalClientContext.d.ts.map +1 -1
- package/build/types/createClient.d.ts +1 -0
- package/build/types/createClient.d.ts.map +1 -1
- package/build/types/index.d.ts +2 -1
- package/build/types/index.d.ts.map +1 -1
- package/build/types/object/fetchPage.d.ts.map +1 -1
- package/build/types/observable/internal/ActionApplication.d.ts.map +1 -1
- package/build/types/public/unstable-do-not-use.d.ts +1 -0
- package/build/types/public/unstable-do-not-use.d.ts.map +1 -1
- package/build/types/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 +11 -11
- package/build/cjs/chunk-E5BQ7757.cjs.map +0 -1
- package/build/cjs/chunk-YZHCDIYC.cjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkBJYCRD5Y_cjs = require('./chunk-BJYCRD5Y.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 chunkBJYCRD5Y_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 chunkBJYCRD5Y_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 chunkBJYCRD5Y_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 (chunkBJYCRD5Y_cjs.isWireObjectSet(value)) {
|
|
460
477
|
return value;
|
|
461
478
|
}
|
|
462
|
-
if (
|
|
463
|
-
return
|
|
479
|
+
if (chunkBJYCRD5Y_cjs.isObjectSet(value)) {
|
|
480
|
+
return chunkBJYCRD5Y_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 = chunkBJYCRD5Y_cjs.addUserAgentAndRequestContextHeaders(chunkBJYCRD5Y_cjs.augmentRequestContext(client, (_) => ({
|
|
487
504
|
finalMethodCall: "applyAction"
|
|
488
505
|
})), action);
|
|
489
506
|
if (Array.isArray(parameters)) {
|
|
490
|
-
const response = await
|
|
507
|
+
const response = await chunkBJYCRD5Y_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 chunkBJYCRD5Y_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 = chunkBJYCRD5Y_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 chunkBJYCRD5Y_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 chunkBJYCRD5Y_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 chunkBJYCRD5Y_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 chunkBJYCRD5Y_cjs.TimeSeriesPropertyV2_exports.getFirstPoint(this.#client, await this.#client.ontologyRid, ...this.#triplet);
|
|
778
795
|
}
|
|
779
796
|
async getLastPoint() {
|
|
780
|
-
return
|
|
797
|
+
return chunkBJYCRD5Y_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 chunkBJYCRD5Y_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] = chunkBJYCRD5Y_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] = chunkBJYCRD5Y_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) => chunkBJYCRD5Y_cjs.fetchSingle(client, objDef, options ?? {}, chunkBJYCRD5Y_cjs.getWireObjectSet(objectSet)),
|
|
954
|
+
fetchOneWithErrors: (options) => chunkBJYCRD5Y_cjs.fetchSingleWithErrors(client, objDef, options ?? {}, chunkBJYCRD5Y_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) => chunkBJYCRD5Y_cjs.hydrateAttachmentFromRidInternal(client, a.rid));
|
|
1039
1048
|
} else {
|
|
1040
|
-
return
|
|
1049
|
+
return chunkBJYCRD5Y_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) => chunkBJYCRD5Y_cjs.hydrateAttachmentFromRidInternal(client, a.rid));
|
|
1057
1066
|
}
|
|
1058
|
-
return
|
|
1067
|
+
return chunkBJYCRD5Y_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);
|
|
@@ -1113,11 +1122,12 @@ async function convertWireToOsdkObjects(client, objects, interfaceApiName, force
|
|
|
1113
1122
|
}
|
|
1114
1123
|
async function convertWireToOsdkObjects2(client, objects, interfaceApiName, derivedPropertyTypeByName, forceRemoveRid = false, selectedProps, strictNonNull = false, interfaceToObjectTypeMappings = {}) {
|
|
1115
1124
|
fixObjectPropertiesInPlace(objects, forceRemoveRid);
|
|
1125
|
+
const isInterfaceScoped = Object.keys(interfaceToObjectTypeMappings).length > 0;
|
|
1116
1126
|
const ret = [];
|
|
1117
1127
|
for (const rawObj of objects) {
|
|
1118
1128
|
const objectDef = await client.ontologyProvider.getObjectDefinition(rawObj.$apiName);
|
|
1119
1129
|
!objectDef ? process.env.NODE_ENV !== "production" ? invariant__default.default(false, `Missing definition for '${rawObj.$apiName}'`) : invariant__default.default(false) : void 0;
|
|
1120
|
-
const interfaceToObjMapping = interfaceApiName ? interfaceToObjectTypeMappings[interfaceApiName][rawObj.$apiName] : void 0;
|
|
1130
|
+
const interfaceToObjMapping = interfaceApiName && isInterfaceScoped ? interfaceToObjectTypeMappings[interfaceApiName][rawObj.$apiName] : void 0;
|
|
1121
1131
|
const ifaceSelected = interfaceApiName && interfaceToObjMapping ? selectedProps ? Object.keys(interfaceToObjMapping).filter((val) => {
|
|
1122
1132
|
selectedProps?.includes(interfaceToObjMapping[val]);
|
|
1123
1133
|
}) : [...Object.values(interfaceToObjMapping), objectDef.primaryKeyApiName] : void 0;
|
|
@@ -1136,7 +1146,7 @@ async function convertWireToOsdkObjects2(client, objects, interfaceApiName, deri
|
|
|
1136
1146
|
continue;
|
|
1137
1147
|
}
|
|
1138
1148
|
let osdkObject = createOsdkObject(client, objectDef, rawObj, derivedPropertyTypeByName);
|
|
1139
|
-
if (interfaceApiName) osdkObject = osdkObject.$as(interfaceApiName);
|
|
1149
|
+
if (interfaceApiName && isInterfaceScoped) osdkObject = osdkObject.$as(interfaceApiName);
|
|
1140
1150
|
ret.push(osdkObject);
|
|
1141
1151
|
}
|
|
1142
1152
|
return ret;
|
|
@@ -1274,11 +1284,11 @@ function deepFreeze(obj) {
|
|
|
1274
1284
|
return Object.freeze(obj);
|
|
1275
1285
|
}
|
|
1276
1286
|
async function loadActionMetadata(client, actionType) {
|
|
1277
|
-
const r = await
|
|
1287
|
+
const r = await chunkBJYCRD5Y_cjs.ActionTypeV2_exports.get(client, await client.ontologyRid, actionType);
|
|
1278
1288
|
return generatorConverters.wireActionTypeV2ToSdkActionMetadata(r);
|
|
1279
1289
|
}
|
|
1280
1290
|
async function loadFullObjectMetadata(client, objectType) {
|
|
1281
|
-
const full = await
|
|
1291
|
+
const full = await chunkBJYCRD5Y_cjs.ObjectTypeV2_exports.getFullMetadata(client, await client.ontologyRid, objectType, {
|
|
1282
1292
|
preview: true
|
|
1283
1293
|
});
|
|
1284
1294
|
const ret = generatorConverters.wireObjectTypeFullMetadataToSdkObjectMetadata(full, true);
|
|
@@ -1287,14 +1297,14 @@ async function loadFullObjectMetadata(client, objectType) {
|
|
|
1287
1297
|
};
|
|
1288
1298
|
}
|
|
1289
1299
|
async function loadInterfaceMetadata(client, objectType) {
|
|
1290
|
-
const r = await
|
|
1300
|
+
const r = await chunkBJYCRD5Y_cjs.OntologyInterface_exports.get(client, await client.ontologyRid, objectType, {
|
|
1291
1301
|
preview: true
|
|
1292
1302
|
});
|
|
1293
1303
|
return generatorConverters.__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(r, true);
|
|
1294
1304
|
}
|
|
1295
1305
|
async function loadQueryMetadata(client, queryTypeApiNameAndVersion) {
|
|
1296
1306
|
const [apiName, version] = queryTypeApiNameAndVersion.split(":");
|
|
1297
|
-
const r = await
|
|
1307
|
+
const r = await chunkBJYCRD5Y_cjs.QueryType_exports.get(client, await client.ontologyRid, apiName, {
|
|
1298
1308
|
version
|
|
1299
1309
|
});
|
|
1300
1310
|
return generatorConverters.wireQueryTypeV2ToSdkQueryMetadata(r);
|
|
@@ -1351,11 +1361,11 @@ var createStandardOntologyProviderFactory = (client) => {
|
|
|
1351
1361
|
};
|
|
1352
1362
|
|
|
1353
1363
|
// src/util/UserAgent.ts
|
|
1354
|
-
var USER_AGENT = `osdk-client/${"2.
|
|
1355
|
-
var OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.
|
|
1364
|
+
var USER_AGENT = `osdk-client/${"2.5.0-beta.1"}`;
|
|
1365
|
+
var OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.5.0-beta.1"}`;
|
|
1356
1366
|
|
|
1357
1367
|
// src/createMinimalClient.ts
|
|
1358
|
-
function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory =
|
|
1368
|
+
function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory = chunkBJYCRD5Y_cjs.createObjectSet, createOntologyProviderFactory = createStandardOntologyProviderFactory) {
|
|
1359
1369
|
if (process.env.NODE_ENV !== "production") {
|
|
1360
1370
|
try {
|
|
1361
1371
|
new URL(baseUrl);
|
|
@@ -1373,6 +1383,7 @@ function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fet
|
|
|
1373
1383
|
objectFactory2: convertWireToOsdkObjects2,
|
|
1374
1384
|
ontologyRid: metadata.ontologyRid,
|
|
1375
1385
|
logger: options.logger,
|
|
1386
|
+
transactionRid: options.transactionRid,
|
|
1376
1387
|
clientCacheKey: {},
|
|
1377
1388
|
requestContext: {}
|
|
1378
1389
|
};
|
|
@@ -1420,13 +1431,13 @@ async function toDataValueQueries(value, client, desiredType) {
|
|
|
1420
1431
|
switch (desiredType.type) {
|
|
1421
1432
|
case "attachment": {
|
|
1422
1433
|
if (isAttachmentUpload(value)) {
|
|
1423
|
-
const attachment = await
|
|
1434
|
+
const attachment = await chunkBJYCRD5Y_cjs.Attachment_exports.upload(client, value.data, {
|
|
1424
1435
|
filename: value.name
|
|
1425
1436
|
});
|
|
1426
1437
|
return attachment.rid;
|
|
1427
1438
|
}
|
|
1428
1439
|
if (isAttachmentFile(value)) {
|
|
1429
|
-
const attachment = await
|
|
1440
|
+
const attachment = await chunkBJYCRD5Y_cjs.Attachment_exports.upload(client, value, {
|
|
1430
1441
|
filename: value.name
|
|
1431
1442
|
});
|
|
1432
1443
|
return attachment.rid;
|
|
@@ -1456,12 +1467,21 @@ async function toDataValueQueries(value, client, desiredType) {
|
|
|
1456
1467
|
}
|
|
1457
1468
|
break;
|
|
1458
1469
|
}
|
|
1459
|
-
case "
|
|
1460
|
-
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 (chunkBJYCRD5Y_cjs.isWireObjectSet(value)) {
|
|
1461
1481
|
return value;
|
|
1462
1482
|
}
|
|
1463
|
-
if (
|
|
1464
|
-
return
|
|
1483
|
+
if (chunkBJYCRD5Y_cjs.isObjectSet(value)) {
|
|
1484
|
+
return chunkBJYCRD5Y_cjs.getWireObjectSet(value);
|
|
1465
1485
|
}
|
|
1466
1486
|
break;
|
|
1467
1487
|
}
|
|
@@ -1503,7 +1523,7 @@ async function toDataValueQueries(value, client, desiredType) {
|
|
|
1503
1523
|
// src/queries/applyQuery.ts
|
|
1504
1524
|
async function applyQuery(client, query, params) {
|
|
1505
1525
|
const qd = await client.ontologyProvider.getQueryDefinition(query.apiName, query.isFixedVersion ? query.version : void 0);
|
|
1506
|
-
const response = await
|
|
1526
|
+
const response = await chunkBJYCRD5Y_cjs.Query_exports.execute(chunkBJYCRD5Y_cjs.addUserAgentAndRequestContextHeaders(chunkBJYCRD5Y_cjs.augmentRequestContext(client, (_) => ({
|
|
1507
1527
|
finalMethodCall: "applyQuery"
|
|
1508
1528
|
})), query), await client.ontologyRid, query.apiName, {
|
|
1509
1529
|
parameters: params ? await remapQueryParams(params, client, qd.parameters) : {}
|
|
@@ -1550,7 +1570,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
1550
1570
|
return responseValue;
|
|
1551
1571
|
}
|
|
1552
1572
|
case "attachment": {
|
|
1553
|
-
return
|
|
1573
|
+
return chunkBJYCRD5Y_cjs.hydrateAttachmentFromRidInternal(client, responseValue);
|
|
1554
1574
|
}
|
|
1555
1575
|
case "object": {
|
|
1556
1576
|
const def = definitions.get(responseDataType.object);
|
|
@@ -1559,13 +1579,20 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
1559
1579
|
}
|
|
1560
1580
|
return createQueryObjectResponse(responseValue, def);
|
|
1561
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
|
+
}
|
|
1562
1589
|
case "objectSet": {
|
|
1563
1590
|
const def = definitions.get(responseDataType.objectSet);
|
|
1564
1591
|
if (!def) {
|
|
1565
1592
|
throw new Error(`Missing definition for ${responseDataType.objectSet}`);
|
|
1566
1593
|
}
|
|
1567
1594
|
if (typeof responseValue === "string") {
|
|
1568
|
-
return
|
|
1595
|
+
return chunkBJYCRD5Y_cjs.createObjectSet(def, client, {
|
|
1569
1596
|
type: "intersect",
|
|
1570
1597
|
objectSets: [{
|
|
1571
1598
|
type: "base",
|
|
@@ -1576,7 +1603,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
1576
1603
|
}]
|
|
1577
1604
|
});
|
|
1578
1605
|
}
|
|
1579
|
-
return
|
|
1606
|
+
return chunkBJYCRD5Y_cjs.createObjectSet(def, client, responseValue);
|
|
1580
1607
|
}
|
|
1581
1608
|
case "struct": {
|
|
1582
1609
|
for (const [key, subtype] of Object.entries(responseDataType.struct)) {
|
|
@@ -1650,6 +1677,11 @@ async function getRequiredDefinitions(dataType, client) {
|
|
|
1650
1677
|
result.set(dataType.object, objectDef);
|
|
1651
1678
|
break;
|
|
1652
1679
|
}
|
|
1680
|
+
case "interface": {
|
|
1681
|
+
const interfaceDef = await client.ontologyProvider.getInterfaceDefinition(dataType.interface);
|
|
1682
|
+
result.set(dataType.interface, interfaceDef);
|
|
1683
|
+
break;
|
|
1684
|
+
}
|
|
1653
1685
|
case "set": {
|
|
1654
1686
|
return getRequiredDefinitions(dataType.set, client);
|
|
1655
1687
|
}
|
|
@@ -1719,6 +1751,15 @@ function createQueryObjectResponse(primaryKey, objectDef) {
|
|
|
1719
1751
|
$objectSpecifier: createObjectSpecifierFromPrimaryKey(objectDef, primaryKey)
|
|
1720
1752
|
};
|
|
1721
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
|
+
}
|
|
1722
1763
|
|
|
1723
1764
|
// src/createClient.ts
|
|
1724
1765
|
var ActionInvoker = class {
|
|
@@ -1732,7 +1773,7 @@ var QueryInvoker = class {
|
|
|
1732
1773
|
this.executeFunction = applyQuery.bind(void 0, clientCtx, queryDef);
|
|
1733
1774
|
}
|
|
1734
1775
|
};
|
|
1735
|
-
function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvider, options = void 0, fetchFn = fetch) {
|
|
1776
|
+
function createClientInternal(objectSetFactory, transactionRid, baseUrl, ontologyRid, tokenProvider, options = void 0, fetchFn = fetch) {
|
|
1736
1777
|
if (typeof ontologyRid === "string") {
|
|
1737
1778
|
if (!ontologyRid.startsWith("ri.")) {
|
|
1738
1779
|
throw new Error("Invalid ontology RID");
|
|
@@ -1748,7 +1789,8 @@ function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvi
|
|
|
1748
1789
|
ontologyRid
|
|
1749
1790
|
}, baseUrl, tokenProvider, {
|
|
1750
1791
|
...options,
|
|
1751
|
-
logger: options?.logger ?? new
|
|
1792
|
+
logger: options?.logger ?? new chunkBJYCRD5Y_cjs.MinimalLogger(),
|
|
1793
|
+
transactionRid
|
|
1752
1794
|
}, fetchFn, objectSetFactory);
|
|
1753
1795
|
return createClientFromContext(clientCtx);
|
|
1754
1796
|
}
|
|
@@ -1769,7 +1811,7 @@ function createClientFromContext(clientCtx) {
|
|
|
1769
1811
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid.name:
|
|
1770
1812
|
return {
|
|
1771
1813
|
fetchOneByRid: async (objectType, rid, options) => {
|
|
1772
|
-
return await
|
|
1814
|
+
return await chunkBJYCRD5Y_cjs.fetchSingle(clientCtx, objectType, options, createWithRid([rid]));
|
|
1773
1815
|
}
|
|
1774
1816
|
};
|
|
1775
1817
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference.name:
|
|
@@ -1781,7 +1823,7 @@ function createClientFromContext(clientCtx) {
|
|
|
1781
1823
|
objectType,
|
|
1782
1824
|
propertyType
|
|
1783
1825
|
} = args;
|
|
1784
|
-
return await
|
|
1826
|
+
return await chunkBJYCRD5Y_cjs.MediaReferenceProperty_exports.upload(clientCtx, await clientCtx.ontologyRid, objectType.apiName, propertyType, data, {
|
|
1785
1827
|
mediaItemPath: fileName,
|
|
1786
1828
|
preview: true
|
|
1787
1829
|
});
|
|
@@ -1790,7 +1832,7 @@ function createClientFromContext(clientCtx) {
|
|
|
1790
1832
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid.name:
|
|
1791
1833
|
return {
|
|
1792
1834
|
fetchPageByRid: async (objectOrInterfaceType, rids, options = {}) => {
|
|
1793
|
-
return await
|
|
1835
|
+
return await chunkBJYCRD5Y_cjs.fetchPage(clientCtx, objectOrInterfaceType, options, createWithRid(rids));
|
|
1794
1836
|
}
|
|
1795
1837
|
};
|
|
1796
1838
|
}
|
|
@@ -1802,13 +1844,13 @@ function createClientFromContext(clientCtx) {
|
|
|
1802
1844
|
const fetchMetadata = fetchMetadataInternal.bind(void 0, clientCtx);
|
|
1803
1845
|
const symbolClientContext2 = "__osdkClientContext";
|
|
1804
1846
|
const client = Object.defineProperties(clientFn, {
|
|
1805
|
-
[
|
|
1847
|
+
[chunkBJYCRD5Y_cjs.symbolClientContext]: {
|
|
1806
1848
|
value: clientCtx
|
|
1807
1849
|
},
|
|
1808
1850
|
[symbolClientContext2]: {
|
|
1809
1851
|
value: clientCtx
|
|
1810
1852
|
},
|
|
1811
|
-
[
|
|
1853
|
+
[chunkBJYCRD5Y_cjs.additionalContext]: {
|
|
1812
1854
|
value: clientCtx
|
|
1813
1855
|
},
|
|
1814
1856
|
fetchMetadata: {
|
|
@@ -1817,7 +1859,8 @@ function createClientFromContext(clientCtx) {
|
|
|
1817
1859
|
});
|
|
1818
1860
|
return client;
|
|
1819
1861
|
}
|
|
1820
|
-
var createClient = createClientInternal.bind(void 0,
|
|
1862
|
+
var createClient = createClientInternal.bind(void 0, chunkBJYCRD5Y_cjs.createObjectSet, void 0);
|
|
1863
|
+
var createClientWithTransaction = (transactionRid, ...args) => createClientInternal(chunkBJYCRD5Y_cjs.createObjectSet, transactionRid, ...args);
|
|
1821
1864
|
function createWithRid(rids) {
|
|
1822
1865
|
const withRid = {
|
|
1823
1866
|
type: "static",
|
|
@@ -1834,5 +1877,7 @@ exports.UnderlyingOsdkObject = UnderlyingOsdkObject;
|
|
|
1834
1877
|
exports.createAttachmentUpload = createAttachmentUpload;
|
|
1835
1878
|
exports.createClient = createClient;
|
|
1836
1879
|
exports.createClientFromContext = createClientFromContext;
|
|
1837
|
-
|
|
1838
|
-
|
|
1880
|
+
exports.createClientWithTransaction = createClientWithTransaction;
|
|
1881
|
+
exports.createObjectSpecifierFromPrimaryKey = createObjectSpecifierFromPrimaryKey;
|
|
1882
|
+
//# sourceMappingURL=chunk-URDXPIRU.cjs.map
|
|
1883
|
+
//# sourceMappingURL=chunk-URDXPIRU.cjs.map
|