@osdk/client 2.2.0-beta.16 → 2.2.0-beta.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +38 -0
- package/build/browser/MinimalClientContext.js.map +1 -1
- package/build/browser/actions/actions.test.js +18 -2
- package/build/browser/actions/actions.test.js.map +1 -1
- package/build/browser/actions/applyAction.js.map +1 -1
- package/build/browser/createClient.js.map +1 -1
- package/build/browser/createMinimalClient.js.map +1 -1
- package/build/browser/derivedProperties/createWithPropertiesObjectSet.js +36 -13
- package/build/browser/derivedProperties/createWithPropertiesObjectSet.js.map +1 -1
- package/build/browser/derivedProperties/createWithPropertiesObjectSet.test.js +133 -0
- package/build/browser/derivedProperties/createWithPropertiesObjectSet.test.js.map +1 -1
- package/build/browser/derivedProperties/derivedPropertyDefinitionFactory.js +94 -0
- package/build/browser/derivedProperties/derivedPropertyDefinitionFactory.js.map +1 -0
- package/build/browser/index.js.map +1 -1
- package/build/browser/intellisense.test.helpers/showsObjectPropertyJsdoc.js +25 -0
- package/build/browser/intellisense.test.helpers/showsObjectPropertyJsdoc.js.map +1 -0
- package/build/browser/intellisense.test.js +12 -0
- package/build/browser/intellisense.test.js.map +1 -1
- package/build/browser/logger/BaseLogger.js.map +1 -1
- package/build/browser/logger/BrowserLogger.js.map +1 -1
- package/build/browser/logger/MinimalLogger.js.map +1 -1
- package/build/browser/logger/TestLogger.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/BaseHolder.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/getDollarLink.js.map +1 -1
- package/build/browser/objectSet/ObjectSet.test.js +1 -6
- 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 +4 -1
- package/build/browser/objectSet/ObjectSetListenerWebsocket.test.js.map +1 -1
- package/build/browser/objectSet/createObjectSet.js +1 -1
- package/build/browser/objectSet/createObjectSet.js.map +1 -1
- package/build/browser/observable/internal/BulkObjectLoader.js.map +1 -1
- package/build/browser/observable/internal/ListQuery.js.map +1 -1
- package/build/browser/observable/internal/Query.js.map +1 -1
- package/build/browser/observable/internal/Store.js.map +1 -1
- package/build/browser/observable/internal/testUtils.js +2 -2
- package/build/browser/observable/internal/testUtils.js.map +1 -1
- package/build/browser/queries/applyQuery.js.map +1 -1
- package/build/browser/queries/queries.test.js.map +1 -1
- package/build/browser/queries/types.js.map +1 -1
- package/build/browser/tsserver.js.map +1 -1
- package/build/browser/util/UserAgent.js +1 -1
- package/build/browser/util/isPoint.js +20 -0
- package/build/browser/util/isPoint.js.map +1 -0
- package/build/browser/util/toDataValue.js +4 -0
- package/build/browser/util/toDataValue.js.map +1 -1
- package/build/cjs/{Client-DBTcM9gB.d.cts → Client-C6Gohd1t.d.cts} +6 -7
- package/build/cjs/{chunk-6KYD7ZWT.cjs → chunk-33GHS3X4.cjs} +141 -44
- package/build/cjs/chunk-33GHS3X4.cjs.map +1 -0
- package/build/cjs/{chunk-KAJABLKV.cjs → chunk-37QC7LR3.cjs} +14 -14
- package/build/cjs/{chunk-KAJABLKV.cjs.map → chunk-37QC7LR3.cjs.map} +1 -1
- package/build/cjs/index.cjs +55 -47
- package/build/cjs/index.cjs.map +1 -1
- package/build/cjs/index.d.cts +4 -5
- package/build/cjs/public/internal.cjs +8 -8
- package/build/cjs/public/internal.d.cts +11 -12
- package/build/cjs/public/unstable-do-not-use.cjs +8 -8
- package/build/cjs/public/unstable-do-not-use.d.cts +1 -1
- package/build/esm/MinimalClientContext.js.map +1 -1
- package/build/esm/actions/actions.test.js +18 -2
- package/build/esm/actions/actions.test.js.map +1 -1
- package/build/esm/actions/applyAction.js.map +1 -1
- package/build/esm/createClient.js.map +1 -1
- package/build/esm/createMinimalClient.js.map +1 -1
- package/build/esm/derivedProperties/createWithPropertiesObjectSet.js +36 -13
- package/build/esm/derivedProperties/createWithPropertiesObjectSet.js.map +1 -1
- package/build/esm/derivedProperties/createWithPropertiesObjectSet.test.js +133 -0
- package/build/esm/derivedProperties/createWithPropertiesObjectSet.test.js.map +1 -1
- package/build/esm/derivedProperties/derivedPropertyDefinitionFactory.js +94 -0
- package/build/esm/derivedProperties/derivedPropertyDefinitionFactory.js.map +1 -0
- package/build/esm/index.js.map +1 -1
- package/build/esm/intellisense.test.helpers/showsObjectPropertyJsdoc.js +25 -0
- package/build/esm/intellisense.test.helpers/showsObjectPropertyJsdoc.js.map +1 -0
- package/build/esm/intellisense.test.js +12 -0
- package/build/esm/intellisense.test.js.map +1 -1
- package/build/esm/logger/BaseLogger.js.map +1 -1
- package/build/esm/logger/BrowserLogger.js.map +1 -1
- package/build/esm/logger/MinimalLogger.js.map +1 -1
- package/build/esm/logger/TestLogger.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/BaseHolder.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/getDollarLink.js.map +1 -1
- package/build/esm/objectSet/ObjectSet.test.js +1 -6
- 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 +4 -1
- package/build/esm/objectSet/ObjectSetListenerWebsocket.test.js.map +1 -1
- package/build/esm/objectSet/createObjectSet.js +1 -1
- package/build/esm/objectSet/createObjectSet.js.map +1 -1
- package/build/esm/observable/internal/BulkObjectLoader.js.map +1 -1
- package/build/esm/observable/internal/ListQuery.js.map +1 -1
- package/build/esm/observable/internal/Query.js.map +1 -1
- package/build/esm/observable/internal/Store.js.map +1 -1
- package/build/esm/observable/internal/testUtils.js +2 -2
- package/build/esm/observable/internal/testUtils.js.map +1 -1
- package/build/esm/queries/applyQuery.js.map +1 -1
- package/build/esm/queries/queries.test.js.map +1 -1
- package/build/esm/queries/types.js.map +1 -1
- package/build/esm/tsserver.js.map +1 -1
- package/build/esm/util/UserAgent.js +1 -1
- package/build/esm/util/isPoint.js +20 -0
- package/build/esm/util/isPoint.js.map +1 -0
- package/build/esm/util/toDataValue.js +4 -0
- package/build/esm/util/toDataValue.js.map +1 -1
- package/build/types/MinimalClientContext.d.ts +1 -1
- package/build/types/MinimalClientContext.d.ts.map +1 -1
- package/build/types/actions/applyAction.d.ts +1 -2
- package/build/types/actions/applyAction.d.ts.map +1 -1
- package/build/types/createClient.d.ts +1 -1
- package/build/types/createClient.d.ts.map +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 -2
- package/build/types/index.d.ts.map +1 -1
- package/build/types/intellisense.test.helpers/showsObjectPropertyJsdoc.d.ts +1 -0
- package/build/types/intellisense.test.helpers/showsObjectPropertyJsdoc.d.ts.map +1 -0
- package/build/types/logger/BaseLogger.d.ts +7 -8
- package/build/types/logger/BaseLogger.d.ts.map +1 -1
- package/build/types/logger/BrowserLogger.d.ts +1 -2
- package/build/types/logger/BrowserLogger.d.ts.map +1 -1
- package/build/types/logger/MinimalLogger.d.ts +2 -2
- package/build/types/logger/MinimalLogger.d.ts.map +1 -1
- package/build/types/logger/TestLogger.d.ts +2 -2
- package/build/types/logger/TestLogger.d.ts.map +1 -1
- package/build/types/observable/internal/BulkObjectLoader.d.ts.map +1 -1
- package/build/types/observable/internal/ListQuery.d.ts.map +1 -1
- package/build/types/observable/internal/Query.d.ts +1 -1
- package/build/types/observable/internal/Query.d.ts.map +1 -1
- package/build/types/observable/internal/Store.d.ts.map +1 -1
- package/build/types/observable/internal/testUtils.d.ts +1 -2
- package/build/types/observable/internal/testUtils.d.ts.map +1 -1
- package/build/types/queries/applyQuery.d.ts +4 -2
- package/build/types/queries/applyQuery.d.ts.map +1 -1
- package/build/types/queries/types.d.ts +1 -1
- package/build/types/queries/types.d.ts.map +1 -1
- package/build/types/tsserver.d.ts +1 -1
- package/build/types/tsserver.d.ts.map +1 -1
- package/build/types/util/isPoint.d.ts +1 -0
- package/build/types/util/isPoint.d.ts.map +1 -0
- package/package.json +9 -9
- package/build/browser/logger/Logger.js +0 -2
- package/build/browser/logger/Logger.js.map +0 -1
- package/build/cjs/Logger-a5UcHtrk.d.cts +0 -19
- package/build/cjs/chunk-6KYD7ZWT.cjs.map +0 -1
- package/build/esm/logger/Logger.js +0 -2
- package/build/esm/logger/Logger.js.map +0 -1
- package/build/types/logger/Logger.d.ts +0 -17
- package/build/types/logger/Logger.d.ts.map +0 -1
package/build/cjs/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk33GHS3X4_cjs = require('./chunk-33GHS3X4.cjs');
|
|
4
4
|
var chunkT4NIFYZS_cjs = require('./chunk-T4NIFYZS.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunk37QC7LR3_cjs = require('./chunk-37QC7LR3.cjs');
|
|
6
6
|
var api = require('@osdk/api');
|
|
7
7
|
var shared_net_errors = require('@osdk/shared.net.errors');
|
|
8
8
|
var unstable = require('@osdk/api/unstable');
|
|
@@ -398,6 +398,11 @@ function isOsdkBaseObject(o) {
|
|
|
398
398
|
return o && typeof o === "object" && typeof o.$apiName === "string" && o.$primaryKey != null;
|
|
399
399
|
}
|
|
400
400
|
|
|
401
|
+
// src/util/isPoint.ts
|
|
402
|
+
function isPoint(o) {
|
|
403
|
+
return o && typeof o === "object" && "type" in o && o.type === "Point" && "coordinates" in o && o.coordinates.length === 2;
|
|
404
|
+
}
|
|
405
|
+
|
|
401
406
|
// src/util/toDataValue.ts
|
|
402
407
|
async function toDataValue(value, client) {
|
|
403
408
|
if (value == null) {
|
|
@@ -416,13 +421,13 @@ async function toDataValue(value, client) {
|
|
|
416
421
|
return Promise.all(promiseArray);
|
|
417
422
|
}
|
|
418
423
|
if (isAttachmentUpload(value)) {
|
|
419
|
-
const attachment = await
|
|
424
|
+
const attachment = await chunk37QC7LR3_cjs.Attachment_exports.upload(client, value.data, {
|
|
420
425
|
filename: value.name
|
|
421
426
|
});
|
|
422
427
|
return await toDataValue(attachment.rid, client);
|
|
423
428
|
}
|
|
424
429
|
if (isAttachmentFile(value)) {
|
|
425
|
-
const attachment = await
|
|
430
|
+
const attachment = await chunk37QC7LR3_cjs.Attachment_exports.upload(client, value, {
|
|
426
431
|
filename: value.name
|
|
427
432
|
});
|
|
428
433
|
return await toDataValue(attachment.rid, client);
|
|
@@ -433,11 +438,14 @@ async function toDataValue(value, client) {
|
|
|
433
438
|
if (isOsdkBaseObject(value)) {
|
|
434
439
|
return await toDataValue(value.$primaryKey, client);
|
|
435
440
|
}
|
|
436
|
-
if (
|
|
441
|
+
if (isPoint(value)) {
|
|
442
|
+
return await toDataValue(value.coordinates.join(), client);
|
|
443
|
+
}
|
|
444
|
+
if (chunk33GHS3X4_cjs.isWireObjectSet(value)) {
|
|
437
445
|
return value;
|
|
438
446
|
}
|
|
439
|
-
if (
|
|
440
|
-
return
|
|
447
|
+
if (chunk33GHS3X4_cjs.isObjectSet(value)) {
|
|
448
|
+
return chunk33GHS3X4_cjs.getWireObjectSet(value);
|
|
441
449
|
}
|
|
442
450
|
if (isMediaReference(value)) {
|
|
443
451
|
return value;
|
|
@@ -460,11 +468,11 @@ async function toDataValue(value, client) {
|
|
|
460
468
|
|
|
461
469
|
// src/actions/applyAction.ts
|
|
462
470
|
async function applyAction(client, action, parameters, options = {}) {
|
|
463
|
-
const clientWithHeaders =
|
|
471
|
+
const clientWithHeaders = chunk37QC7LR3_cjs.addUserAgentAndRequestContextHeaders(chunk33GHS3X4_cjs.augmentRequestContext(client, (_) => ({
|
|
464
472
|
finalMethodCall: "applyAction"
|
|
465
473
|
})), action);
|
|
466
474
|
if (Array.isArray(parameters)) {
|
|
467
|
-
const response = await
|
|
475
|
+
const response = await chunk37QC7LR3_cjs.Action_exports.applyBatch(clientWithHeaders, await client.ontologyRid, action.apiName, {
|
|
468
476
|
requests: parameters ? await remapBatchActionParams(parameters, client) : [],
|
|
469
477
|
options: {
|
|
470
478
|
returnEdits: options?.$returnEdits ? "ALL" : "NONE"
|
|
@@ -473,7 +481,7 @@ async function applyAction(client, action, parameters, options = {}) {
|
|
|
473
481
|
const edits = response.edits;
|
|
474
482
|
return options?.$returnEdits ? edits?.type === "edits" ? remapActionResponse(response) : edits : undefined;
|
|
475
483
|
} else {
|
|
476
|
-
const response = await
|
|
484
|
+
const response = await chunk37QC7LR3_cjs.Action_exports.apply(clientWithHeaders, await client.ontologyRid, action.apiName, {
|
|
477
485
|
parameters: await remapActionParams(parameters, client),
|
|
478
486
|
options: {
|
|
479
487
|
mode: options?.$validateOnly ? "VALIDATE_ONLY" : "VALIDATE_AND_EXECUTE",
|
|
@@ -677,7 +685,7 @@ var GeotimeSeriesPropertyImpl = class {
|
|
|
677
685
|
}
|
|
678
686
|
}
|
|
679
687
|
async getLatestValue() {
|
|
680
|
-
const latestPointPromise =
|
|
688
|
+
const latestPointPromise = chunk37QC7LR3_cjs.TimeSeriesValueBankProperty_exports.getLatestValue(this.#client, await this.#client.ontologyRid, ...this.#triplet);
|
|
681
689
|
latestPointPromise.then(
|
|
682
690
|
(latestPoint) => this.lastFetchedValue = latestPoint,
|
|
683
691
|
// eslint-disable-next-line no-console
|
|
@@ -693,7 +701,7 @@ var GeotimeSeriesPropertyImpl = class {
|
|
|
693
701
|
return allPoints;
|
|
694
702
|
}
|
|
695
703
|
async *asyncIterValues(query) {
|
|
696
|
-
const streamPointsIterator = await
|
|
704
|
+
const streamPointsIterator = await chunk37QC7LR3_cjs.TimeSeriesValueBankProperty_exports.streamValues(this.#client, await this.#client.ontologyRid, ...this.#triplet, query ? {
|
|
697
705
|
range: getTimeRange(query)
|
|
698
706
|
} : {});
|
|
699
707
|
for await (const timeseriesPoint of asyncIterPointsHelper(streamPointsIterator)) {
|
|
@@ -717,13 +725,13 @@ var MediaReferencePropertyImpl = class {
|
|
|
717
725
|
this.#triplet = [objectApiName, primaryKey, propertyName];
|
|
718
726
|
}
|
|
719
727
|
async fetchContents() {
|
|
720
|
-
return
|
|
728
|
+
return chunk37QC7LR3_cjs.MediaReferenceProperty_exports.getMediaContent(this.#client, await this.#client.ontologyRid, ...this.#triplet, {
|
|
721
729
|
preview: true
|
|
722
730
|
// TODO: Can turn this back off when backend is no longer in beta.
|
|
723
731
|
});
|
|
724
732
|
}
|
|
725
733
|
async fetchMetadata() {
|
|
726
|
-
const r = await
|
|
734
|
+
const r = await chunk37QC7LR3_cjs.MediaReferenceProperty_exports.getMediaMetadata(this.#client, await this.#client.ontologyRid, ...this.#triplet, {
|
|
727
735
|
preview: true
|
|
728
736
|
// TODO: Can turn this back off when backend is no longer in beta.
|
|
729
737
|
});
|
|
@@ -744,10 +752,10 @@ var TimeSeriesPropertyImpl = class {
|
|
|
744
752
|
this.#triplet = [objectApiName, primaryKey, propertyName];
|
|
745
753
|
}
|
|
746
754
|
async getFirstPoint() {
|
|
747
|
-
return
|
|
755
|
+
return chunk37QC7LR3_cjs.TimeSeriesPropertyV2_exports.getFirstPoint(this.#client, await this.#client.ontologyRid, ...this.#triplet);
|
|
748
756
|
}
|
|
749
757
|
async getLastPoint() {
|
|
750
|
-
return
|
|
758
|
+
return chunk37QC7LR3_cjs.TimeSeriesPropertyV2_exports.getLastPoint(this.#client, await this.#client.ontologyRid, ...this.#triplet);
|
|
751
759
|
}
|
|
752
760
|
async getAllPoints(query) {
|
|
753
761
|
const allPoints = [];
|
|
@@ -757,7 +765,7 @@ var TimeSeriesPropertyImpl = class {
|
|
|
757
765
|
return allPoints;
|
|
758
766
|
}
|
|
759
767
|
async *asyncIterPoints(query) {
|
|
760
|
-
const streamPointsIterator = await
|
|
768
|
+
const streamPointsIterator = await chunk37QC7LR3_cjs.TimeSeriesPropertyV2_exports.streamPoints(this.#client, await this.#client.ontologyRid, ...this.#triplet, query ? {
|
|
761
769
|
range: getTimeRange(query)
|
|
762
770
|
} : {});
|
|
763
771
|
for await (const timeseriesPoint of asyncIterPointsHelper(streamPointsIterator)) {
|
|
@@ -779,7 +787,7 @@ var InterfaceDefinitions = Symbol("InterfaceDefinitions" );
|
|
|
779
787
|
|
|
780
788
|
// src/object/convertWireToOsdkObjects/createOsdkInterface.ts
|
|
781
789
|
function createOsdkInterface(underlying, interfaceDef) {
|
|
782
|
-
const [objApiNamespace] =
|
|
790
|
+
const [objApiNamespace] = chunk33GHS3X4_cjs.extractNamespace(interfaceDef.apiName);
|
|
783
791
|
return Object.freeze(Object.defineProperties({}, {
|
|
784
792
|
// first to minimize hidden classes
|
|
785
793
|
[chunkT4NIFYZS_cjs.UnderlyingOsdkObject]: {
|
|
@@ -822,7 +830,7 @@ function createOsdkInterface(underlying, interfaceDef) {
|
|
|
822
830
|
},
|
|
823
831
|
...Object.fromEntries(Object.keys(interfaceDef.properties).map((p) => {
|
|
824
832
|
const objDef = underlying[chunkT4NIFYZS_cjs.ObjectDefRef];
|
|
825
|
-
const [apiNamespace, apiName] =
|
|
833
|
+
const [apiNamespace, apiName] = chunk33GHS3X4_cjs.extractNamespace(p);
|
|
826
834
|
const targetPropName = objDef.interfaceMap[interfaceDef.apiName][p];
|
|
827
835
|
return [apiNamespace === objApiNamespace ? apiName : p, {
|
|
828
836
|
enumerable: targetPropName in underlying,
|
|
@@ -898,8 +906,8 @@ function get$link(holder) {
|
|
|
898
906
|
[objDef.primaryKeyApiName]: rawObj.$primaryKey
|
|
899
907
|
}).pivotTo(linkName);
|
|
900
908
|
const value = !linkDef.multiplicity ? {
|
|
901
|
-
fetchOne: (options) =>
|
|
902
|
-
fetchOneWithErrors: (options) =>
|
|
909
|
+
fetchOne: (options) => chunk33GHS3X4_cjs.fetchSingle(client, objDef, options ?? {}, chunk33GHS3X4_cjs.getWireObjectSet(objectSet)),
|
|
910
|
+
fetchOneWithErrors: (options) => chunk33GHS3X4_cjs.fetchSingleWithErrors(client, objDef, options ?? {}, chunk33GHS3X4_cjs.getWireObjectSet(objectSet))
|
|
903
911
|
} : objectSet;
|
|
904
912
|
return [linkName, value];
|
|
905
913
|
})));
|
|
@@ -972,9 +980,9 @@ function createOsdkObject(client, objectDef, simpleOsdkProperties, derivedProper
|
|
|
972
980
|
const rawValue = rawObj[propKey];
|
|
973
981
|
if (derivedPropertyTypeByName[propKey].type === "attachment") {
|
|
974
982
|
if (Array.isArray(rawValue)) {
|
|
975
|
-
rawObj[propKey] = rawValue.map((a) =>
|
|
983
|
+
rawObj[propKey] = rawValue.map((a) => chunk33GHS3X4_cjs.hydrateAttachmentFromRidInternal(client, a.rid));
|
|
976
984
|
} else {
|
|
977
|
-
rawObj[propKey] =
|
|
985
|
+
rawObj[propKey] = chunk33GHS3X4_cjs.hydrateAttachmentFromRidInternal(client, rawValue.rid);
|
|
978
986
|
}
|
|
979
987
|
} else {
|
|
980
988
|
process.env.NODE_ENV !== "production" ? invariant__default.default(false, "Derived property aggregations for Timeseries and Media are not supported") : invariant__default.default(false) ;
|
|
@@ -991,9 +999,9 @@ function createSpecialProperty(client, objectDef, rawObject, p) {
|
|
|
991
999
|
}
|
|
992
1000
|
if (propDef.type === "attachment") {
|
|
993
1001
|
if (Array.isArray(rawValue)) {
|
|
994
|
-
return rawValue.map((a) =>
|
|
1002
|
+
return rawValue.map((a) => chunk33GHS3X4_cjs.hydrateAttachmentFromRidInternal(client, a.rid));
|
|
995
1003
|
}
|
|
996
|
-
return
|
|
1004
|
+
return chunk33GHS3X4_cjs.hydrateAttachmentFromRidInternal(client, rawValue.rid);
|
|
997
1005
|
}
|
|
998
1006
|
if (propDef.type === "numericTimeseries" || propDef.type === "stringTimeseries" || propDef.type === "sensorTimeseries") {
|
|
999
1007
|
return new TimeSeriesPropertyImpl(client, objectDef.apiName, rawObject[objectDef.primaryKeyApiName], p);
|
|
@@ -1200,11 +1208,11 @@ function createAsyncClientCache(fn, createCacheLocal = createClientCache) {
|
|
|
1200
1208
|
return ret;
|
|
1201
1209
|
}
|
|
1202
1210
|
async function loadActionMetadata(client, actionType) {
|
|
1203
|
-
const r = await
|
|
1211
|
+
const r = await chunk37QC7LR3_cjs.ActionTypeV2_exports.get(client, await client.ontologyRid, actionType);
|
|
1204
1212
|
return generatorConverters.wireActionTypeV2ToSdkActionMetadata(r);
|
|
1205
1213
|
}
|
|
1206
1214
|
async function loadFullObjectMetadata(client, objectType) {
|
|
1207
|
-
const full = await
|
|
1215
|
+
const full = await chunk37QC7LR3_cjs.ObjectTypeV2_exports.getFullMetadata(client, await client.ontologyRid, objectType, {
|
|
1208
1216
|
preview: true
|
|
1209
1217
|
});
|
|
1210
1218
|
const ret = generatorConverters.wireObjectTypeFullMetadataToSdkObjectMetadata(full, true);
|
|
@@ -1213,13 +1221,13 @@ async function loadFullObjectMetadata(client, objectType) {
|
|
|
1213
1221
|
};
|
|
1214
1222
|
}
|
|
1215
1223
|
async function loadInterfaceMetadata(client, objectType) {
|
|
1216
|
-
const r = await
|
|
1224
|
+
const r = await chunk37QC7LR3_cjs.OntologyInterface_exports.get(client, await client.ontologyRid, objectType, {
|
|
1217
1225
|
preview: true
|
|
1218
1226
|
});
|
|
1219
1227
|
return generatorConverters.__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(r, true);
|
|
1220
1228
|
}
|
|
1221
1229
|
async function loadQueryMetadata(client, queryType) {
|
|
1222
|
-
const r = await
|
|
1230
|
+
const r = await chunk37QC7LR3_cjs.QueryType_exports.get(client, await client.ontologyRid, queryType);
|
|
1223
1231
|
return generatorConverters.wireQueryTypeV2ToSdkQueryMetadata(r);
|
|
1224
1232
|
}
|
|
1225
1233
|
|
|
@@ -1266,10 +1274,10 @@ var createStandardOntologyProviderFactory = (client) => {
|
|
|
1266
1274
|
};
|
|
1267
1275
|
|
|
1268
1276
|
// src/util/UserAgent.ts
|
|
1269
|
-
var USER_AGENT = `osdk-client/${"2.2.0-beta.
|
|
1277
|
+
var USER_AGENT = `osdk-client/${"2.2.0-beta.18"}`;
|
|
1270
1278
|
|
|
1271
1279
|
// src/createMinimalClient.ts
|
|
1272
|
-
function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory =
|
|
1280
|
+
function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory = chunk33GHS3X4_cjs.createObjectSet, createOntologyProviderFactory = createStandardOntologyProviderFactory) {
|
|
1273
1281
|
if (process.env.NODE_ENV !== "production") {
|
|
1274
1282
|
try {
|
|
1275
1283
|
new URL(baseUrl);
|
|
@@ -1339,13 +1347,13 @@ async function toDataValueQueries(value, client, desiredType) {
|
|
|
1339
1347
|
switch (desiredType.type) {
|
|
1340
1348
|
case "attachment": {
|
|
1341
1349
|
if (isAttachmentUpload(value)) {
|
|
1342
|
-
const attachment = await
|
|
1350
|
+
const attachment = await chunk37QC7LR3_cjs.Attachment_exports.upload(client, value.data, {
|
|
1343
1351
|
filename: value.name
|
|
1344
1352
|
});
|
|
1345
1353
|
return attachment.rid;
|
|
1346
1354
|
}
|
|
1347
1355
|
if (isAttachmentFile(value)) {
|
|
1348
|
-
const attachment = await
|
|
1356
|
+
const attachment = await chunk37QC7LR3_cjs.Attachment_exports.upload(client, value, {
|
|
1349
1357
|
filename: value.name
|
|
1350
1358
|
});
|
|
1351
1359
|
return attachment.rid;
|
|
@@ -1376,11 +1384,11 @@ async function toDataValueQueries(value, client, desiredType) {
|
|
|
1376
1384
|
break;
|
|
1377
1385
|
}
|
|
1378
1386
|
case "objectSet": {
|
|
1379
|
-
if (
|
|
1387
|
+
if (chunk33GHS3X4_cjs.isWireObjectSet(value)) {
|
|
1380
1388
|
return value;
|
|
1381
1389
|
}
|
|
1382
|
-
if (
|
|
1383
|
-
return
|
|
1390
|
+
if (chunk33GHS3X4_cjs.isObjectSet(value)) {
|
|
1391
|
+
return chunk33GHS3X4_cjs.getWireObjectSet(value);
|
|
1384
1392
|
}
|
|
1385
1393
|
break;
|
|
1386
1394
|
}
|
|
@@ -1422,7 +1430,7 @@ async function toDataValueQueries(value, client, desiredType) {
|
|
|
1422
1430
|
// src/queries/applyQuery.ts
|
|
1423
1431
|
async function applyQuery(client, query, params) {
|
|
1424
1432
|
const qd = await client.ontologyProvider.getQueryDefinition(query.apiName);
|
|
1425
|
-
const response = await
|
|
1433
|
+
const response = await chunk37QC7LR3_cjs.Query_exports.execute(chunk37QC7LR3_cjs.addUserAgentAndRequestContextHeaders(chunk33GHS3X4_cjs.augmentRequestContext(client, (_) => ({
|
|
1426
1434
|
finalMethodCall: "applyQuery"
|
|
1427
1435
|
})), query), await client.ontologyRid, query.apiName, {
|
|
1428
1436
|
parameters: params ? await remapQueryParams(params, client, qd.parameters) : {}
|
|
@@ -1467,7 +1475,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
1467
1475
|
return responseValue;
|
|
1468
1476
|
}
|
|
1469
1477
|
case "attachment": {
|
|
1470
|
-
return
|
|
1478
|
+
return chunk33GHS3X4_cjs.hydrateAttachmentFromRidInternal(client, responseValue);
|
|
1471
1479
|
}
|
|
1472
1480
|
case "object": {
|
|
1473
1481
|
const def = definitions.get(responseDataType.object);
|
|
@@ -1482,7 +1490,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
1482
1490
|
throw new Error(`Missing definition for ${responseDataType.objectSet}`);
|
|
1483
1491
|
}
|
|
1484
1492
|
if (typeof responseValue === "string") {
|
|
1485
|
-
return
|
|
1493
|
+
return chunk33GHS3X4_cjs.createObjectSet(def, client, {
|
|
1486
1494
|
type: "intersect",
|
|
1487
1495
|
objectSets: [{
|
|
1488
1496
|
type: "base",
|
|
@@ -1493,7 +1501,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
1493
1501
|
}]
|
|
1494
1502
|
});
|
|
1495
1503
|
}
|
|
1496
|
-
return
|
|
1504
|
+
return chunk33GHS3X4_cjs.createObjectSet(def, client, responseValue);
|
|
1497
1505
|
}
|
|
1498
1506
|
case "struct": {
|
|
1499
1507
|
for (const [key, subtype] of Object.entries(responseDataType.struct)) {
|
|
@@ -1661,7 +1669,7 @@ function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvi
|
|
|
1661
1669
|
ontologyRid
|
|
1662
1670
|
}, baseUrl, tokenProvider, {
|
|
1663
1671
|
...options,
|
|
1664
|
-
logger: options?.logger ?? new
|
|
1672
|
+
logger: options?.logger ?? new chunk33GHS3X4_cjs.MinimalLogger()
|
|
1665
1673
|
}, fetchFn, objectSetFactory);
|
|
1666
1674
|
function clientFn(o) {
|
|
1667
1675
|
if (o.type === "object" || o.type === "interface") {
|
|
@@ -1679,7 +1687,7 @@ function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvi
|
|
|
1679
1687
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid.name:
|
|
1680
1688
|
return {
|
|
1681
1689
|
fetchOneByRid: async (objectType, rid, options2) => {
|
|
1682
|
-
return await
|
|
1690
|
+
return await chunk33GHS3X4_cjs.fetchSingle(clientCtx, objectType, options2, createWithRid([rid]));
|
|
1683
1691
|
}
|
|
1684
1692
|
};
|
|
1685
1693
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference.name:
|
|
@@ -1691,7 +1699,7 @@ function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvi
|
|
|
1691
1699
|
objectType,
|
|
1692
1700
|
propertyType
|
|
1693
1701
|
} = args;
|
|
1694
|
-
return await
|
|
1702
|
+
return await chunk37QC7LR3_cjs.MediaReferenceProperty_exports.upload(clientCtx, await clientCtx.ontologyRid, objectType.apiName, propertyType, data, {
|
|
1695
1703
|
mediaItemPath: fileName,
|
|
1696
1704
|
preview: true
|
|
1697
1705
|
});
|
|
@@ -1700,7 +1708,7 @@ function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvi
|
|
|
1700
1708
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid.name:
|
|
1701
1709
|
return {
|
|
1702
1710
|
fetchPageByRid: async (objectOrInterfaceType, rids, options2 = {}) => {
|
|
1703
|
-
return await
|
|
1711
|
+
return await chunk37QC7LR3_cjs.fetchPage(clientCtx, objectOrInterfaceType, options2, createWithRid(rids));
|
|
1704
1712
|
}
|
|
1705
1713
|
};
|
|
1706
1714
|
}
|
|
@@ -1712,13 +1720,13 @@ function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvi
|
|
|
1712
1720
|
const fetchMetadata = fetchMetadataInternal.bind(undefined, clientCtx);
|
|
1713
1721
|
const symbolClientContext2 = "__osdkClientContext";
|
|
1714
1722
|
const client = Object.defineProperties(clientFn, {
|
|
1715
|
-
[
|
|
1723
|
+
[chunk37QC7LR3_cjs.symbolClientContext]: {
|
|
1716
1724
|
value: clientCtx
|
|
1717
1725
|
},
|
|
1718
1726
|
[symbolClientContext2]: {
|
|
1719
1727
|
value: clientCtx
|
|
1720
1728
|
},
|
|
1721
|
-
[
|
|
1729
|
+
[chunk37QC7LR3_cjs.additionalContext]: {
|
|
1722
1730
|
value: clientCtx
|
|
1723
1731
|
},
|
|
1724
1732
|
fetchMetadata: {
|
|
@@ -1727,7 +1735,7 @@ function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvi
|
|
|
1727
1735
|
});
|
|
1728
1736
|
return client;
|
|
1729
1737
|
}
|
|
1730
|
-
var createClient = createClientInternal.bind(undefined,
|
|
1738
|
+
var createClient = createClientInternal.bind(undefined, chunk33GHS3X4_cjs.createObjectSet);
|
|
1731
1739
|
function createWithRid(rids) {
|
|
1732
1740
|
const withRid = {
|
|
1733
1741
|
type: "static",
|