@osdk/client 2.6.0-beta.1 → 2.6.0-beta.3
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 +32 -0
- package/build/browser/Client.js +1 -1
- package/build/browser/Client.js.map +1 -1
- package/build/browser/fetchMetadata.test.js +11 -0
- package/build/browser/fetchMetadata.test.js.map +1 -1
- package/build/browser/internal/conversions/modernToLegacyWhereClause.js +15 -0
- package/build/browser/internal/conversions/modernToLegacyWhereClause.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 +4 -0
- package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.js +10 -0
- package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects.test.js +12 -0
- package/build/browser/object/convertWireToOsdkObjects.test.js.map +1 -1
- package/build/browser/object/formatting/applyPropertyFormatter.js +58 -0
- package/build/browser/object/formatting/applyPropertyFormatter.js.map +1 -0
- package/build/browser/object/formatting/applyPropertyFormatter.test.js +726 -0
- package/build/browser/object/formatting/applyPropertyFormatter.test.js.map +1 -0
- package/build/browser/object/formatting/formatBoolean.js +23 -0
- package/build/browser/object/formatting/formatBoolean.js.map +1 -0
- package/build/browser/object/formatting/formatDateTime.js +158 -0
- package/build/browser/object/formatting/formatDateTime.js.map +1 -0
- package/build/browser/object/formatting/formatNumber.js +242 -0
- package/build/browser/object/formatting/formatNumber.js.map +1 -0
- package/build/browser/object/formatting/propertyFormattingUtils.js +39 -0
- package/build/browser/object/formatting/propertyFormattingUtils.js.map +1 -0
- package/build/browser/util/UserAgent.js +2 -2
- package/build/cjs/{chunk-DCEFUXFS.cjs → chunk-6L3MX4LH.cjs} +35 -15
- package/build/cjs/chunk-6L3MX4LH.cjs.map +1 -0
- package/build/cjs/{chunk-BP7BR5FZ.cjs → chunk-BRYZR53E.cjs} +435 -54
- package/build/cjs/chunk-BRYZR53E.cjs.map +1 -0
- package/build/cjs/index.cjs +8 -8
- package/build/cjs/public/internal.cjs +8 -8
- package/build/cjs/public/unstable-do-not-use.cjs +31 -31
- package/build/esm/Client.js +1 -1
- package/build/esm/Client.js.map +1 -1
- package/build/esm/fetchMetadata.test.js +11 -0
- package/build/esm/fetchMetadata.test.js.map +1 -1
- package/build/esm/internal/conversions/modernToLegacyWhereClause.js +15 -0
- package/build/esm/internal/conversions/modernToLegacyWhereClause.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 +4 -0
- package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects/createOsdkObject.js +10 -0
- package/build/esm/object/convertWireToOsdkObjects/createOsdkObject.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects.test.js +12 -0
- package/build/esm/object/convertWireToOsdkObjects.test.js.map +1 -1
- package/build/esm/object/formatting/applyPropertyFormatter.js +58 -0
- package/build/esm/object/formatting/applyPropertyFormatter.js.map +1 -0
- package/build/esm/object/formatting/applyPropertyFormatter.test.js +726 -0
- package/build/esm/object/formatting/applyPropertyFormatter.test.js.map +1 -0
- package/build/esm/object/formatting/formatBoolean.js +23 -0
- package/build/esm/object/formatting/formatBoolean.js.map +1 -0
- package/build/esm/object/formatting/formatDateTime.js +158 -0
- package/build/esm/object/formatting/formatDateTime.js.map +1 -0
- package/build/esm/object/formatting/formatNumber.js +242 -0
- package/build/esm/object/formatting/formatNumber.js.map +1 -0
- package/build/esm/object/formatting/propertyFormattingUtils.js +39 -0
- package/build/esm/object/formatting/propertyFormattingUtils.js.map +1 -0
- package/build/esm/util/UserAgent.js +2 -2
- package/build/types/Client.d.ts +1 -1
- package/build/types/object/formatting/applyPropertyFormatter.d.ts +18 -0
- package/build/types/object/formatting/applyPropertyFormatter.d.ts.map +1 -0
- package/build/types/object/formatting/applyPropertyFormatter.test.d.ts +1 -0
- package/build/types/object/formatting/applyPropertyFormatter.test.d.ts.map +1 -0
- package/build/types/object/formatting/formatBoolean.d.ts +5 -0
- package/build/types/object/formatting/formatBoolean.d.ts.map +1 -0
- package/build/types/object/formatting/formatDateTime.d.ts +6 -0
- package/build/types/object/formatting/formatDateTime.d.ts.map +1 -0
- package/build/types/object/formatting/formatNumber.d.ts +15 -0
- package/build/types/object/formatting/formatNumber.d.ts.map +1 -0
- package/build/types/object/formatting/propertyFormattingUtils.d.ts +10 -0
- package/build/types/object/formatting/propertyFormattingUtils.d.ts.map +1 -0
- package/package.json +8 -8
- package/build/cjs/chunk-BP7BR5FZ.cjs.map +0 -1
- package/build/cjs/chunk-DCEFUXFS.cjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk6L3MX4LH_cjs = require('./chunk-6L3MX4LH.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');
|
|
@@ -446,19 +446,19 @@ async function toDataValue(value, client, actionMetadata) {
|
|
|
446
446
|
return Promise.all(promiseArray);
|
|
447
447
|
}
|
|
448
448
|
if (isAttachmentUpload(value)) {
|
|
449
|
-
const attachment = await
|
|
449
|
+
const attachment = await chunk6L3MX4LH_cjs.Attachment_exports.upload(client, value.data, {
|
|
450
450
|
filename: value.name
|
|
451
451
|
});
|
|
452
452
|
return await toDataValue(attachment.rid, client, actionMetadata);
|
|
453
453
|
}
|
|
454
454
|
if (isAttachmentFile(value)) {
|
|
455
|
-
const attachment = await
|
|
455
|
+
const attachment = await chunk6L3MX4LH_cjs.Attachment_exports.upload(client, value, {
|
|
456
456
|
filename: value.name
|
|
457
457
|
});
|
|
458
458
|
return await toDataValue(attachment.rid, client, actionMetadata);
|
|
459
459
|
}
|
|
460
460
|
if (isMediaUpload(value)) {
|
|
461
|
-
const mediaRef = await
|
|
461
|
+
const mediaRef = await chunk6L3MX4LH_cjs.MediaReferenceProperty_exports.uploadMedia(client, await client.ontologyRid, actionMetadata.apiName, value.data, {
|
|
462
462
|
mediaItemPath: value.path,
|
|
463
463
|
preview: true
|
|
464
464
|
});
|
|
@@ -473,11 +473,11 @@ async function toDataValue(value, client, actionMetadata) {
|
|
|
473
473
|
if (isPoint(value)) {
|
|
474
474
|
return await toDataValue(`${value.coordinates[1]},${value.coordinates[0]}`, client, actionMetadata);
|
|
475
475
|
}
|
|
476
|
-
if (
|
|
476
|
+
if (chunk6L3MX4LH_cjs.isWireObjectSet(value)) {
|
|
477
477
|
return value;
|
|
478
478
|
}
|
|
479
|
-
if (
|
|
480
|
-
return
|
|
479
|
+
if (chunk6L3MX4LH_cjs.isObjectSet(value)) {
|
|
480
|
+
return chunk6L3MX4LH_cjs.getWireObjectSet(value);
|
|
481
481
|
}
|
|
482
482
|
if (isMediaReference(value)) {
|
|
483
483
|
return value;
|
|
@@ -500,11 +500,11 @@ async function toDataValue(value, client, actionMetadata) {
|
|
|
500
500
|
|
|
501
501
|
// src/actions/applyAction.ts
|
|
502
502
|
async function applyAction(client, action, parameters, options = {}) {
|
|
503
|
-
const clientWithHeaders =
|
|
503
|
+
const clientWithHeaders = chunk6L3MX4LH_cjs.addUserAgentAndRequestContextHeaders(chunk6L3MX4LH_cjs.augmentRequestContext(client, (_) => ({
|
|
504
504
|
finalMethodCall: "applyAction"
|
|
505
505
|
})), action);
|
|
506
506
|
if (Array.isArray(parameters)) {
|
|
507
|
-
const response = await
|
|
507
|
+
const response = await chunk6L3MX4LH_cjs.Action_exports.applyBatch(clientWithHeaders, await client.ontologyRid, action.apiName, {
|
|
508
508
|
requests: parameters ? await remapBatchActionParams(parameters, client, await client.ontologyProvider.getActionDefinition(action.apiName)) : [],
|
|
509
509
|
options: {
|
|
510
510
|
returnEdits: options?.$returnEdits ? "ALL" : "NONE"
|
|
@@ -515,7 +515,7 @@ async function applyAction(client, action, parameters, options = {}) {
|
|
|
515
515
|
const edits = response.edits;
|
|
516
516
|
return options?.$returnEdits ? edits?.type === "edits" ? remapActionResponse(response) : edits : void 0;
|
|
517
517
|
} else {
|
|
518
|
-
const response = await
|
|
518
|
+
const response = await chunk6L3MX4LH_cjs.Action_exports.apply(clientWithHeaders, await client.ontologyRid, action.apiName, {
|
|
519
519
|
parameters: await remapActionParams(parameters, client, await client.ontologyProvider.getActionDefinition(action.apiName)),
|
|
520
520
|
options: {
|
|
521
521
|
mode: options?.$validateOnly ? "VALIDATE_ONLY" : "VALIDATE_AND_EXECUTE",
|
|
@@ -722,7 +722,7 @@ var GeotimeSeriesPropertyImpl = class {
|
|
|
722
722
|
}
|
|
723
723
|
}
|
|
724
724
|
async getLatestValue() {
|
|
725
|
-
const latestPointPromise =
|
|
725
|
+
const latestPointPromise = chunk6L3MX4LH_cjs.TimeSeriesValueBankProperty_exports.getLatestValue(this.#client, await this.#client.ontologyRid, ...this.#triplet);
|
|
726
726
|
latestPointPromise.then(
|
|
727
727
|
(latestPoint) => this.lastFetchedValue = latestPoint,
|
|
728
728
|
// eslint-disable-next-line no-console
|
|
@@ -738,7 +738,7 @@ var GeotimeSeriesPropertyImpl = class {
|
|
|
738
738
|
return allPoints;
|
|
739
739
|
}
|
|
740
740
|
async *asyncIterValues(query) {
|
|
741
|
-
const streamPointsIterator = await
|
|
741
|
+
const streamPointsIterator = await chunk6L3MX4LH_cjs.TimeSeriesValueBankProperty_exports.streamValues(this.#client, await this.#client.ontologyRid, ...this.#triplet, query ? {
|
|
742
742
|
range: getTimeRange(query)
|
|
743
743
|
} : {});
|
|
744
744
|
for await (const timeseriesPoint of asyncIterPointsHelper(streamPointsIterator)) {
|
|
@@ -765,13 +765,13 @@ var MediaReferencePropertyImpl = class {
|
|
|
765
765
|
this.#mediaReference = mediaReference;
|
|
766
766
|
}
|
|
767
767
|
async fetchContents() {
|
|
768
|
-
return
|
|
768
|
+
return chunk6L3MX4LH_cjs.MediaReferenceProperty_exports.getMediaContent(this.#client, await this.#client.ontologyRid, ...this.#triplet, {
|
|
769
769
|
preview: true
|
|
770
770
|
// TODO: Can turn this back off when backend is no longer in beta.
|
|
771
771
|
});
|
|
772
772
|
}
|
|
773
773
|
async fetchMetadata() {
|
|
774
|
-
const r = await
|
|
774
|
+
const r = await chunk6L3MX4LH_cjs.MediaReferenceProperty_exports.getMediaMetadata(this.#client, await this.#client.ontologyRid, ...this.#triplet, {
|
|
775
775
|
preview: true
|
|
776
776
|
// TODO: Can turn this back off when backend is no longer in beta.
|
|
777
777
|
});
|
|
@@ -795,10 +795,10 @@ var TimeSeriesPropertyImpl = class {
|
|
|
795
795
|
this.#triplet = [objectApiName, primaryKey, propertyName];
|
|
796
796
|
}
|
|
797
797
|
async getFirstPoint() {
|
|
798
|
-
return
|
|
798
|
+
return chunk6L3MX4LH_cjs.TimeSeriesPropertyV2_exports.getFirstPoint(this.#client, await this.#client.ontologyRid, ...this.#triplet);
|
|
799
799
|
}
|
|
800
800
|
async getLastPoint() {
|
|
801
|
-
return
|
|
801
|
+
return chunk6L3MX4LH_cjs.TimeSeriesPropertyV2_exports.getLastPoint(this.#client, await this.#client.ontologyRid, ...this.#triplet);
|
|
802
802
|
}
|
|
803
803
|
async getAllPoints(query) {
|
|
804
804
|
const allPoints = [];
|
|
@@ -808,7 +808,7 @@ var TimeSeriesPropertyImpl = class {
|
|
|
808
808
|
return allPoints;
|
|
809
809
|
}
|
|
810
810
|
async *asyncIterPoints(query) {
|
|
811
|
-
const streamPointsIterator = await
|
|
811
|
+
const streamPointsIterator = await chunk6L3MX4LH_cjs.TimeSeriesPropertyV2_exports.streamPoints(this.#client, await this.#client.ontologyRid, ...this.#triplet, query ? {
|
|
812
812
|
range: getTimeRange(query)
|
|
813
813
|
} : {});
|
|
814
814
|
for await (const timeseriesPoint of asyncIterPointsHelper(streamPointsIterator)) {
|
|
@@ -817,6 +817,374 @@ var TimeSeriesPropertyImpl = class {
|
|
|
817
817
|
}
|
|
818
818
|
};
|
|
819
819
|
|
|
820
|
+
// src/object/formatting/formatBoolean.ts
|
|
821
|
+
function formatBoolean(value, rule) {
|
|
822
|
+
return value ? rule.valueIfTrue : rule.valueIfFalse;
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
// src/object/formatting/propertyFormattingUtils.ts
|
|
826
|
+
function resolvePropertyReference(ref, objectData) {
|
|
827
|
+
if (ref.type === "constant") {
|
|
828
|
+
return ref.value;
|
|
829
|
+
} else if (ref.type === "propertyType") {
|
|
830
|
+
const value = objectData[ref.propertyApiName];
|
|
831
|
+
return value != null ? String(value) : void 0;
|
|
832
|
+
}
|
|
833
|
+
return void 0;
|
|
834
|
+
}
|
|
835
|
+
function getBrowserLocale() {
|
|
836
|
+
if (typeof navigator !== "undefined" && navigator.language != null) {
|
|
837
|
+
return navigator.language;
|
|
838
|
+
}
|
|
839
|
+
return "en-US";
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
// src/object/formatting/formatDateTime.ts
|
|
843
|
+
function formatDateTime(value, format, timezone, objectData, locale, userTimezoneOverride) {
|
|
844
|
+
const date = value instanceof Date ? value : new Date(value);
|
|
845
|
+
if (isNaN(date.getTime())) {
|
|
846
|
+
return void 0;
|
|
847
|
+
}
|
|
848
|
+
const resolvedTimezone = resolveTimezone(timezone, objectData, userTimezoneOverride);
|
|
849
|
+
switch (format.type) {
|
|
850
|
+
case "localizedFormat":
|
|
851
|
+
return formatLocalized(date, format, locale, resolvedTimezone);
|
|
852
|
+
case "stringFormat":
|
|
853
|
+
return void 0;
|
|
854
|
+
default:
|
|
855
|
+
return void 0;
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
var INVALID_DATE_STRING = "Invalid date or timezone";
|
|
859
|
+
function formatLocalized(date, format, locale, timezone) {
|
|
860
|
+
if (format.format === "DATE_FORMAT_ISO_INSTANT") {
|
|
861
|
+
return date.toISOString();
|
|
862
|
+
}
|
|
863
|
+
if (format.format === "DATE_FORMAT_RELATIVE_TO_NOW") {
|
|
864
|
+
return formatRelativeToNow(date, locale, timezone);
|
|
865
|
+
}
|
|
866
|
+
const options = getLocalizedFormatOptions(format.format);
|
|
867
|
+
try {
|
|
868
|
+
return new Intl.DateTimeFormat(locale, timezone ? {
|
|
869
|
+
...options,
|
|
870
|
+
timeZone: timezone
|
|
871
|
+
} : options).format(date);
|
|
872
|
+
} catch (_e) {
|
|
873
|
+
return INVALID_DATE_STRING;
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
function getLocalizedFormatOptions(format) {
|
|
877
|
+
switch (format) {
|
|
878
|
+
case "DATE_FORMAT_DATE":
|
|
879
|
+
return FORMAT_DATE;
|
|
880
|
+
case "DATE_FORMAT_YEAR_AND_MONTH":
|
|
881
|
+
return FORMAT_YEAR_AND_MONTH;
|
|
882
|
+
case "DATE_FORMAT_DATE_TIME":
|
|
883
|
+
return FORMAT_DATE_TIME;
|
|
884
|
+
case "DATE_FORMAT_DATE_TIME_SHORT":
|
|
885
|
+
return FORMAT_DATE_TIME_SHORT;
|
|
886
|
+
case "DATE_FORMAT_TIME":
|
|
887
|
+
return FORMAT_TIME;
|
|
888
|
+
default:
|
|
889
|
+
return {};
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
var FORMAT_DATE = {
|
|
893
|
+
day: "numeric",
|
|
894
|
+
month: "short",
|
|
895
|
+
weekday: "short",
|
|
896
|
+
year: "numeric"
|
|
897
|
+
};
|
|
898
|
+
var FORMAT_YEAR_AND_MONTH = {
|
|
899
|
+
month: "short",
|
|
900
|
+
year: "numeric"
|
|
901
|
+
};
|
|
902
|
+
var FORMAT_DATE_TIME = {
|
|
903
|
+
day: "numeric",
|
|
904
|
+
month: "short",
|
|
905
|
+
weekday: "short",
|
|
906
|
+
year: "numeric",
|
|
907
|
+
hour: "numeric",
|
|
908
|
+
minute: "numeric",
|
|
909
|
+
second: "numeric"
|
|
910
|
+
};
|
|
911
|
+
var FORMAT_DATE_TIME_SHORT = {
|
|
912
|
+
day: "numeric",
|
|
913
|
+
month: "short",
|
|
914
|
+
year: "numeric",
|
|
915
|
+
hour: "numeric",
|
|
916
|
+
minute: "numeric"
|
|
917
|
+
};
|
|
918
|
+
var FORMAT_TIME = {
|
|
919
|
+
hour: "numeric",
|
|
920
|
+
minute: "numeric",
|
|
921
|
+
second: "numeric"
|
|
922
|
+
};
|
|
923
|
+
var DATE_TIME_SHORT_WITH_WEEKDAY = {
|
|
924
|
+
day: "numeric",
|
|
925
|
+
month: "short",
|
|
926
|
+
weekday: "short",
|
|
927
|
+
year: "numeric",
|
|
928
|
+
hour: "numeric",
|
|
929
|
+
minute: "numeric"
|
|
930
|
+
};
|
|
931
|
+
function resolveTimezone(timezone, objectData, userTimezoneOverride) {
|
|
932
|
+
if (userTimezoneOverride != null) {
|
|
933
|
+
return userTimezoneOverride;
|
|
934
|
+
}
|
|
935
|
+
if (timezone == null) {
|
|
936
|
+
return void 0;
|
|
937
|
+
}
|
|
938
|
+
switch (timezone.type) {
|
|
939
|
+
case "user":
|
|
940
|
+
return void 0;
|
|
941
|
+
case "static":
|
|
942
|
+
return resolvePropertyReference(timezone.zoneId, objectData);
|
|
943
|
+
default:
|
|
944
|
+
return void 0;
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
var SECOND_MS = 1e3;
|
|
948
|
+
var MINUTE_MS = 60 * SECOND_MS;
|
|
949
|
+
var HOUR_MS = 60 * MINUTE_MS;
|
|
950
|
+
var DAY_MS = 24 * HOUR_MS;
|
|
951
|
+
function formatRelativeToNow(date, locale, timezone) {
|
|
952
|
+
const now = Date.now();
|
|
953
|
+
const diff = date.valueOf() - now;
|
|
954
|
+
const absDiff = Math.abs(diff);
|
|
955
|
+
if (absDiff >= DAY_MS) {
|
|
956
|
+
const dtf = new Intl.DateTimeFormat(locale, {
|
|
957
|
+
...DATE_TIME_SHORT_WITH_WEEKDAY,
|
|
958
|
+
timeZone: timezone
|
|
959
|
+
});
|
|
960
|
+
return dtf.format(date);
|
|
961
|
+
}
|
|
962
|
+
const rtf = new Intl.RelativeTimeFormat(locale, {
|
|
963
|
+
numeric: "auto"
|
|
964
|
+
});
|
|
965
|
+
const units = [["hour", HOUR_MS], ["minute", MINUTE_MS], ["second", SECOND_MS]];
|
|
966
|
+
for (const [unit, ms] of units) {
|
|
967
|
+
if (absDiff >= ms) {
|
|
968
|
+
return rtf.format(Math.floor(diff / ms), unit);
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
return rtf.format(0, "second");
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
// src/object/formatting/formatNumber.ts
|
|
975
|
+
function formatNumber(value, numberType, objectData, locale) {
|
|
976
|
+
switch (numberType.type) {
|
|
977
|
+
case "standard":
|
|
978
|
+
return formatStandardNumber(value, numberType.baseFormatOptions, locale);
|
|
979
|
+
case "fixedValues":
|
|
980
|
+
return numberType.values[value];
|
|
981
|
+
case "currency":
|
|
982
|
+
return formatCurrency(value, numberType, objectData, locale);
|
|
983
|
+
case "standardUnit":
|
|
984
|
+
return formatStandardUnit(value, numberType, objectData, locale);
|
|
985
|
+
case "customUnit":
|
|
986
|
+
return formatCustomUnit(value, numberType, objectData, locale);
|
|
987
|
+
case "affix":
|
|
988
|
+
return formatAffix(value, numberType, objectData, locale);
|
|
989
|
+
case "duration":
|
|
990
|
+
return void 0;
|
|
991
|
+
case "scale":
|
|
992
|
+
return formatScale(value, numberType, locale);
|
|
993
|
+
case "ratio":
|
|
994
|
+
return formatRatio(value, numberType, locale);
|
|
995
|
+
default:
|
|
996
|
+
return void 0;
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
function formatStandardNumber(value, options, locale) {
|
|
1000
|
+
return formatNumberWithAffixes(value, options, locale);
|
|
1001
|
+
}
|
|
1002
|
+
function formatCurrency(value, rule, objectData, locale) {
|
|
1003
|
+
const currencyCode = resolvePropertyReference(rule.currencyCode, objectData);
|
|
1004
|
+
if (currencyCode == null) {
|
|
1005
|
+
return formatStandardNumber(value, rule.baseFormatOptions, locale);
|
|
1006
|
+
}
|
|
1007
|
+
const options = {
|
|
1008
|
+
...convertToIntlOptions(rule.baseFormatOptions),
|
|
1009
|
+
style: "currency",
|
|
1010
|
+
currency: currencyCode,
|
|
1011
|
+
currencyDisplay: rule.style === "COMPACT" ? "narrowSymbol" : "symbol"
|
|
1012
|
+
};
|
|
1013
|
+
return formatWithIntl(value, options, locale);
|
|
1014
|
+
}
|
|
1015
|
+
function formatStandardUnit(value, rule, objectData, locale) {
|
|
1016
|
+
const unit = resolvePropertyReference(rule.unit, objectData);
|
|
1017
|
+
if (unit == null) {
|
|
1018
|
+
return formatStandardNumber(value, rule.baseFormatOptions, locale);
|
|
1019
|
+
}
|
|
1020
|
+
const options = {
|
|
1021
|
+
...convertToIntlOptions(rule.baseFormatOptions),
|
|
1022
|
+
style: "unit",
|
|
1023
|
+
unit
|
|
1024
|
+
};
|
|
1025
|
+
try {
|
|
1026
|
+
return formatWithIntl(value, options, locale);
|
|
1027
|
+
} catch (error) {
|
|
1028
|
+
const suffix = ` ${unit}`;
|
|
1029
|
+
return formatNumberWithAffixes(value, rule.baseFormatOptions, locale, "", suffix);
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
function formatCustomUnit(value, rule, objectData, locale) {
|
|
1033
|
+
const unit = resolvePropertyReference(rule.unit, objectData);
|
|
1034
|
+
const suffix = unit != null ? ` ${unit}` : "";
|
|
1035
|
+
return formatNumberWithAffixes(value, rule.baseFormatOptions, locale, "", suffix);
|
|
1036
|
+
}
|
|
1037
|
+
function formatAffix(value, rule, objectData, locale) {
|
|
1038
|
+
const prefix = rule.affix.prefix != null ? resolvePropertyReference(rule.affix.prefix, objectData) ?? "" : "";
|
|
1039
|
+
const suffix = rule.affix.postfix != null ? resolvePropertyReference(rule.affix.postfix, objectData) ?? "" : "";
|
|
1040
|
+
return formatNumberWithAffixes(value, rule.baseFormatOptions, locale, prefix, suffix);
|
|
1041
|
+
}
|
|
1042
|
+
function getScaleDivisor(scaleType) {
|
|
1043
|
+
switch (scaleType) {
|
|
1044
|
+
case "THOUSANDS":
|
|
1045
|
+
return 1e3;
|
|
1046
|
+
case "MILLIONS":
|
|
1047
|
+
return 1e6;
|
|
1048
|
+
case "BILLIONS":
|
|
1049
|
+
return 1e9;
|
|
1050
|
+
default:
|
|
1051
|
+
throw new Error(`Unknown scale type: ${scaleType}`);
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
function getLocalizedCompactSuffix(scaleDivisor, locale) {
|
|
1055
|
+
const compactFormatter = new Intl.NumberFormat(locale, {
|
|
1056
|
+
notation: "compact",
|
|
1057
|
+
compactDisplay: "short"
|
|
1058
|
+
});
|
|
1059
|
+
const parts = compactFormatter.formatToParts(scaleDivisor);
|
|
1060
|
+
const compactPart = parts.find((p) => p.type === "compact");
|
|
1061
|
+
return compactPart?.value ?? "";
|
|
1062
|
+
}
|
|
1063
|
+
function formatScale(value, rule, locale) {
|
|
1064
|
+
const scaleDivisor = getScaleDivisor(rule.scaleType);
|
|
1065
|
+
const scaledValue = value / scaleDivisor;
|
|
1066
|
+
const suffix = getLocalizedCompactSuffix(scaleDivisor, locale);
|
|
1067
|
+
return formatNumberWithAffixes(scaledValue, rule.baseFormatOptions, locale, "", suffix);
|
|
1068
|
+
}
|
|
1069
|
+
function getRatioScaledValue(value, ratioType) {
|
|
1070
|
+
switch (ratioType) {
|
|
1071
|
+
case "PERCENTAGE":
|
|
1072
|
+
return value * 100;
|
|
1073
|
+
case "PER_MILLE":
|
|
1074
|
+
return value * 1e3;
|
|
1075
|
+
case "BASIS_POINTS":
|
|
1076
|
+
return value * 1e4;
|
|
1077
|
+
default:
|
|
1078
|
+
throw new Error(`Unknown ratio type: ${ratioType}`);
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
function formatRatio(value, rule, locale) {
|
|
1082
|
+
if (rule.ratioType === "PERCENTAGE") {
|
|
1083
|
+
const options = {
|
|
1084
|
+
...convertToIntlOptions(rule.baseFormatOptions),
|
|
1085
|
+
style: "percent"
|
|
1086
|
+
};
|
|
1087
|
+
return formatWithIntl(value, options, locale);
|
|
1088
|
+
}
|
|
1089
|
+
const scaledValue = getRatioScaledValue(value, rule.ratioType);
|
|
1090
|
+
let suffix;
|
|
1091
|
+
switch (rule.ratioType) {
|
|
1092
|
+
case "PER_MILLE":
|
|
1093
|
+
suffix = "\u2030";
|
|
1094
|
+
break;
|
|
1095
|
+
case "BASIS_POINTS":
|
|
1096
|
+
suffix = " bps";
|
|
1097
|
+
break;
|
|
1098
|
+
default:
|
|
1099
|
+
rule.ratioType;
|
|
1100
|
+
throw new Error(`Unknown ratio type: ${rule.ratioType}`);
|
|
1101
|
+
}
|
|
1102
|
+
return formatNumberWithAffixes(scaledValue, rule.baseFormatOptions, locale, "", suffix);
|
|
1103
|
+
}
|
|
1104
|
+
function mapNotation(notation) {
|
|
1105
|
+
switch (notation) {
|
|
1106
|
+
case "STANDARD":
|
|
1107
|
+
return "standard";
|
|
1108
|
+
case "SCIENTIFIC":
|
|
1109
|
+
return "scientific";
|
|
1110
|
+
case "ENGINEERING":
|
|
1111
|
+
return "engineering";
|
|
1112
|
+
case "COMPACT":
|
|
1113
|
+
return "compact";
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
function mapRoundingMode(mode) {
|
|
1117
|
+
switch (mode) {
|
|
1118
|
+
case "CEIL":
|
|
1119
|
+
return "ceil";
|
|
1120
|
+
case "FLOOR":
|
|
1121
|
+
return "floor";
|
|
1122
|
+
case "ROUND_CLOSEST":
|
|
1123
|
+
return "halfExpand";
|
|
1124
|
+
default:
|
|
1125
|
+
return void 0;
|
|
1126
|
+
}
|
|
1127
|
+
}
|
|
1128
|
+
function convertToIntlOptions(options) {
|
|
1129
|
+
return {
|
|
1130
|
+
useGrouping: options.useGrouping,
|
|
1131
|
+
minimumIntegerDigits: options.minimumIntegerDigits,
|
|
1132
|
+
minimumFractionDigits: options.minimumFractionDigits,
|
|
1133
|
+
maximumFractionDigits: options.maximumFractionDigits,
|
|
1134
|
+
minimumSignificantDigits: options.minimumSignificantDigits,
|
|
1135
|
+
maximumSignificantDigits: options.maximumSignificantDigits,
|
|
1136
|
+
notation: options.notation ? mapNotation(options.notation) : void 0,
|
|
1137
|
+
roundingMode: options.roundingMode ? mapRoundingMode(options.roundingMode) : void 0,
|
|
1138
|
+
convertNegativeToParenthesis: options.convertNegativeToParenthesis
|
|
1139
|
+
};
|
|
1140
|
+
}
|
|
1141
|
+
function maybeConvertNegativeToParenthesis(formatted, value, shouldConvert) {
|
|
1142
|
+
if (shouldConvert && value < 0) {
|
|
1143
|
+
return formatted.replace(/^-/, "(") + ")";
|
|
1144
|
+
}
|
|
1145
|
+
return formatted;
|
|
1146
|
+
}
|
|
1147
|
+
function formatWithIntl(value, options, locale) {
|
|
1148
|
+
const formatter = new Intl.NumberFormat(locale, options);
|
|
1149
|
+
const formatted = formatter.format(value);
|
|
1150
|
+
return maybeConvertNegativeToParenthesis(formatted, value, options.convertNegativeToParenthesis ?? false);
|
|
1151
|
+
}
|
|
1152
|
+
function formatNumberWithAffixes(value, baseOptions, locale, prefix, suffix) {
|
|
1153
|
+
const intlOptions = convertToIntlOptions(baseOptions);
|
|
1154
|
+
const formatted = formatWithIntl(value, intlOptions, locale);
|
|
1155
|
+
return `${prefix || ""}${formatted}${suffix || ""}`;
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
// src/object/formatting/applyPropertyFormatter.ts
|
|
1159
|
+
function applyPropertyFormatter(propertyValue, propertyDefinition, objectData, options = {}) {
|
|
1160
|
+
if (propertyDefinition?.valueFormatting == null || propertyValue == null) {
|
|
1161
|
+
return void 0;
|
|
1162
|
+
}
|
|
1163
|
+
return formatPropertyValue(propertyValue, propertyDefinition.valueFormatting, objectData, options);
|
|
1164
|
+
}
|
|
1165
|
+
function formatPropertyValue(value, rule, objectData, options) {
|
|
1166
|
+
switch (rule.type) {
|
|
1167
|
+
case "boolean":
|
|
1168
|
+
if (typeof value !== "boolean") {
|
|
1169
|
+
return void 0;
|
|
1170
|
+
}
|
|
1171
|
+
return formatBoolean(value, rule);
|
|
1172
|
+
case "number":
|
|
1173
|
+
if (typeof value !== "number") {
|
|
1174
|
+
return void 0;
|
|
1175
|
+
}
|
|
1176
|
+
return formatNumber(value, rule.numberType, objectData, options.locale ?? getBrowserLocale());
|
|
1177
|
+
case "date":
|
|
1178
|
+
case "timestamp":
|
|
1179
|
+
if (typeof value !== "string") {
|
|
1180
|
+
return void 0;
|
|
1181
|
+
}
|
|
1182
|
+
return formatDateTime(new Date(value), rule.format, rule.type === "timestamp" ? rule.displayTimezone : void 0, objectData, options.locale ?? getBrowserLocale(), options.timezoneId);
|
|
1183
|
+
default:
|
|
1184
|
+
return void 0;
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1187
|
+
|
|
820
1188
|
// src/ontology/OntologyProvider.ts
|
|
821
1189
|
var InterfaceDefinitions = Symbol("InterfaceDefinitions" );
|
|
822
1190
|
|
|
@@ -837,8 +1205,8 @@ function get$link(holder) {
|
|
|
837
1205
|
[objDef.primaryKeyApiName]: rawObj.$primaryKey
|
|
838
1206
|
}).pivotTo(linkName);
|
|
839
1207
|
const value = !linkDef.multiplicity ? {
|
|
840
|
-
fetchOne: (options) =>
|
|
841
|
-
fetchOneWithErrors: (options) =>
|
|
1208
|
+
fetchOne: (options) => chunk6L3MX4LH_cjs.fetchSingle(client, objDef, options ?? {}, chunk6L3MX4LH_cjs.getWireObjectSet(objectSet)),
|
|
1209
|
+
fetchOneWithErrors: (options) => chunk6L3MX4LH_cjs.fetchSingleWithErrors(client, objDef, options ?? {}, chunk6L3MX4LH_cjs.getWireObjectSet(objectSet))
|
|
842
1210
|
} : objectSet;
|
|
843
1211
|
return [linkName, value];
|
|
844
1212
|
})));
|
|
@@ -854,8 +1222,8 @@ function get$linkForInterface(holder) {
|
|
|
854
1222
|
[objDef.primaryKeyApiName]: rawObj.$primaryKey
|
|
855
1223
|
})).pivotTo(linkName);
|
|
856
1224
|
const value = !linkDef.multiplicity ? {
|
|
857
|
-
fetchOne: (options) =>
|
|
858
|
-
fetchOneWithErrors: (options) =>
|
|
1225
|
+
fetchOne: (options) => chunk6L3MX4LH_cjs.fetchSingle(client, objDef, options ?? {}, chunk6L3MX4LH_cjs.getWireObjectSet(objectSet)),
|
|
1226
|
+
fetchOneWithErrors: (options) => chunk6L3MX4LH_cjs.fetchSingleWithErrors(client, objDef, options ?? {}, chunk6L3MX4LH_cjs.getWireObjectSet(objectSet))
|
|
859
1227
|
} : objectSet;
|
|
860
1228
|
return [linkName, value];
|
|
861
1229
|
})));
|
|
@@ -863,7 +1231,7 @@ function get$linkForInterface(holder) {
|
|
|
863
1231
|
|
|
864
1232
|
// src/object/convertWireToOsdkObjects/createOsdkInterface.ts
|
|
865
1233
|
function createOsdkInterface(underlying, interfaceDef) {
|
|
866
|
-
const [objApiNamespace] =
|
|
1234
|
+
const [objApiNamespace] = chunk6L3MX4LH_cjs.extractNamespace(interfaceDef.apiName);
|
|
867
1235
|
return Object.freeze(Object.defineProperties({}, {
|
|
868
1236
|
// first to minimize hidden classes
|
|
869
1237
|
[UnderlyingOsdkObject]: {
|
|
@@ -908,6 +1276,10 @@ function createOsdkInterface(underlying, interfaceDef) {
|
|
|
908
1276
|
},
|
|
909
1277
|
enumerable: false
|
|
910
1278
|
},
|
|
1279
|
+
"$__EXPERIMENTAL__NOT_SUPPORTED_YET__getFormattedValue": {
|
|
1280
|
+
value: underlying.$__EXPERIMENTAL__NOT_SUPPORTED_YET__getFormattedValue,
|
|
1281
|
+
enumerable: false
|
|
1282
|
+
},
|
|
911
1283
|
"$link": {
|
|
912
1284
|
get: function() {
|
|
913
1285
|
return get$linkForInterface(this);
|
|
@@ -918,7 +1290,7 @@ function createOsdkInterface(underlying, interfaceDef) {
|
|
|
918
1290
|
},
|
|
919
1291
|
...Object.fromEntries(Object.keys(interfaceDef.properties).map((p) => {
|
|
920
1292
|
const objDef = underlying[ObjectDefRef];
|
|
921
|
-
const [apiNamespace, apiName] =
|
|
1293
|
+
const [apiNamespace, apiName] = chunk6L3MX4LH_cjs.extractNamespace(p);
|
|
922
1294
|
const targetPropName = objDef.interfaceMap[interfaceDef.apiName][p];
|
|
923
1295
|
return [apiNamespace === objApiNamespace ? apiName : p, {
|
|
924
1296
|
enumerable: targetPropName in underlying,
|
|
@@ -1032,6 +1404,15 @@ var basePropDefs = {
|
|
|
1032
1404
|
};
|
|
1033
1405
|
},
|
|
1034
1406
|
enumerable: false
|
|
1407
|
+
},
|
|
1408
|
+
"$__EXPERIMENTAL__NOT_SUPPORTED_YET__getFormattedValue": {
|
|
1409
|
+
value: function(propertyApiName, options) {
|
|
1410
|
+
const rawObj = this[UnderlyingOsdkObject];
|
|
1411
|
+
const def = this[ObjectDefRef];
|
|
1412
|
+
const propertyValue = rawObj[propertyApiName];
|
|
1413
|
+
return applyPropertyFormatter(propertyValue, def.properties[propertyApiName], rawObj, options);
|
|
1414
|
+
},
|
|
1415
|
+
enumerable: false
|
|
1035
1416
|
}
|
|
1036
1417
|
};
|
|
1037
1418
|
function createOsdkObject(client, objectDef, simpleOsdkProperties, derivedPropertyTypeByName = {}) {
|
|
@@ -1070,9 +1451,9 @@ function modifyRdpProperties(client, derivedPropertyTypeByName, rawValue, propKe
|
|
|
1070
1451
|
switch (derivedPropertyTypeByName[propKey].selectedOrCollectedPropertyType?.type) {
|
|
1071
1452
|
case "attachment":
|
|
1072
1453
|
if (Array.isArray(rawValue)) {
|
|
1073
|
-
return rawValue.map((a) =>
|
|
1454
|
+
return rawValue.map((a) => chunk6L3MX4LH_cjs.hydrateAttachmentFromRidInternal(client, a.rid));
|
|
1074
1455
|
} else {
|
|
1075
|
-
return
|
|
1456
|
+
return chunk6L3MX4LH_cjs.hydrateAttachmentFromRidInternal(client, rawValue.rid);
|
|
1076
1457
|
}
|
|
1077
1458
|
default:
|
|
1078
1459
|
process.env.NODE_ENV !== "production" ? invariant__default.default(false, "Derived property aggregations for Timeseries and Media are not supported") : invariant__default.default(false) ;
|
|
@@ -1088,9 +1469,9 @@ function createSpecialProperty(client, objectDef, rawObject, p) {
|
|
|
1088
1469
|
}
|
|
1089
1470
|
if (propDef.type === "attachment") {
|
|
1090
1471
|
if (Array.isArray(rawValue)) {
|
|
1091
|
-
return rawValue.map((a) =>
|
|
1472
|
+
return rawValue.map((a) => chunk6L3MX4LH_cjs.hydrateAttachmentFromRidInternal(client, a.rid));
|
|
1092
1473
|
}
|
|
1093
|
-
return
|
|
1474
|
+
return chunk6L3MX4LH_cjs.hydrateAttachmentFromRidInternal(client, rawValue.rid);
|
|
1094
1475
|
}
|
|
1095
1476
|
if (propDef.type === "numericTimeseries" || propDef.type === "stringTimeseries" || propDef.type === "sensorTimeseries") {
|
|
1096
1477
|
return new TimeSeriesPropertyImpl(client, objectDef.apiName, rawObject[objectDef.primaryKeyApiName], p);
|
|
@@ -1314,13 +1695,13 @@ function deepFreeze(obj) {
|
|
|
1314
1695
|
return Object.freeze(obj);
|
|
1315
1696
|
}
|
|
1316
1697
|
async function loadActionMetadata(client, actionType) {
|
|
1317
|
-
const r = await
|
|
1698
|
+
const r = await chunk6L3MX4LH_cjs.ActionTypeV2_exports.get(client, await client.ontologyRid, actionType, {
|
|
1318
1699
|
branch: client.branch
|
|
1319
1700
|
});
|
|
1320
1701
|
return generatorConverters.wireActionTypeV2ToSdkActionMetadata(r);
|
|
1321
1702
|
}
|
|
1322
1703
|
async function loadFullObjectMetadata(client, objectType) {
|
|
1323
|
-
const full = await
|
|
1704
|
+
const full = await chunk6L3MX4LH_cjs.ObjectTypeV2_exports.getFullMetadata(client, await client.ontologyRid, objectType, {
|
|
1324
1705
|
preview: true,
|
|
1325
1706
|
branch: client.branch
|
|
1326
1707
|
});
|
|
@@ -1330,7 +1711,7 @@ async function loadFullObjectMetadata(client, objectType) {
|
|
|
1330
1711
|
};
|
|
1331
1712
|
}
|
|
1332
1713
|
async function loadInterfaceMetadata(client, objectType) {
|
|
1333
|
-
const r = await
|
|
1714
|
+
const r = await chunk6L3MX4LH_cjs.OntologyInterface_exports.get(client, await client.ontologyRid, objectType, {
|
|
1334
1715
|
preview: true,
|
|
1335
1716
|
branch: client.branch
|
|
1336
1717
|
});
|
|
@@ -1338,7 +1719,7 @@ async function loadInterfaceMetadata(client, objectType) {
|
|
|
1338
1719
|
}
|
|
1339
1720
|
async function loadQueryMetadata(client, queryTypeApiNameAndVersion) {
|
|
1340
1721
|
const [apiName, version] = queryTypeApiNameAndVersion.split(":");
|
|
1341
|
-
const r = await
|
|
1722
|
+
const r = await chunk6L3MX4LH_cjs.QueryType_exports.get(client, await client.ontologyRid, apiName, {
|
|
1342
1723
|
version
|
|
1343
1724
|
});
|
|
1344
1725
|
return generatorConverters.wireQueryTypeV2ToSdkQueryMetadata(r);
|
|
@@ -1395,11 +1776,11 @@ var createStandardOntologyProviderFactory = (client) => {
|
|
|
1395
1776
|
};
|
|
1396
1777
|
|
|
1397
1778
|
// src/util/UserAgent.ts
|
|
1398
|
-
var USER_AGENT = `osdk-client/${"2.6.0-beta.
|
|
1399
|
-
var OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.6.0-beta.
|
|
1779
|
+
var USER_AGENT = `osdk-client/${"2.6.0-beta.3"}`;
|
|
1780
|
+
var OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.6.0-beta.3"}`;
|
|
1400
1781
|
|
|
1401
1782
|
// src/createMinimalClient.ts
|
|
1402
|
-
function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory =
|
|
1783
|
+
function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory = chunk6L3MX4LH_cjs.createObjectSet, createOntologyProviderFactory = createStandardOntologyProviderFactory) {
|
|
1403
1784
|
if (process.env.NODE_ENV !== "production") {
|
|
1404
1785
|
try {
|
|
1405
1786
|
new URL(baseUrl);
|
|
@@ -1467,13 +1848,13 @@ async function toDataValueQueries(value, client, desiredType) {
|
|
|
1467
1848
|
switch (desiredType.type) {
|
|
1468
1849
|
case "attachment": {
|
|
1469
1850
|
if (isAttachmentUpload(value)) {
|
|
1470
|
-
const attachment = await
|
|
1851
|
+
const attachment = await chunk6L3MX4LH_cjs.Attachment_exports.upload(client, value.data, {
|
|
1471
1852
|
filename: value.name
|
|
1472
1853
|
});
|
|
1473
1854
|
return attachment.rid;
|
|
1474
1855
|
}
|
|
1475
1856
|
if (isAttachmentFile(value)) {
|
|
1476
|
-
const attachment = await
|
|
1857
|
+
const attachment = await chunk6L3MX4LH_cjs.Attachment_exports.upload(client, value, {
|
|
1477
1858
|
filename: value.name
|
|
1478
1859
|
});
|
|
1479
1860
|
return attachment.rid;
|
|
@@ -1513,11 +1894,11 @@ async function toDataValueQueries(value, client, desiredType) {
|
|
|
1513
1894
|
}
|
|
1514
1895
|
case "objectSet":
|
|
1515
1896
|
case "interfaceObjectSet": {
|
|
1516
|
-
if (
|
|
1897
|
+
if (chunk6L3MX4LH_cjs.isWireObjectSet(value)) {
|
|
1517
1898
|
return value;
|
|
1518
1899
|
}
|
|
1519
|
-
if (
|
|
1520
|
-
return
|
|
1900
|
+
if (chunk6L3MX4LH_cjs.isObjectSet(value)) {
|
|
1901
|
+
return chunk6L3MX4LH_cjs.getWireObjectSet(value);
|
|
1521
1902
|
}
|
|
1522
1903
|
break;
|
|
1523
1904
|
}
|
|
@@ -1559,7 +1940,7 @@ async function toDataValueQueries(value, client, desiredType) {
|
|
|
1559
1940
|
// src/queries/applyQuery.ts
|
|
1560
1941
|
async function applyQuery(client, query, params) {
|
|
1561
1942
|
const qd = client.ontologyProvider.getQueryDefinition(query.apiName, query.isFixedVersion ? query.version : void 0);
|
|
1562
|
-
const response = await
|
|
1943
|
+
const response = await chunk6L3MX4LH_cjs.Query_exports.execute(chunk6L3MX4LH_cjs.addUserAgentAndRequestContextHeaders(chunk6L3MX4LH_cjs.augmentRequestContext(client, (_) => ({
|
|
1563
1944
|
finalMethodCall: "applyQuery"
|
|
1564
1945
|
})), query), await client.ontologyRid, query.apiName, {
|
|
1565
1946
|
parameters: params ? await remapQueryParams(params, client, (await qd).parameters) : {}
|
|
@@ -1606,7 +1987,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
1606
1987
|
return responseValue;
|
|
1607
1988
|
}
|
|
1608
1989
|
case "attachment": {
|
|
1609
|
-
return
|
|
1990
|
+
return chunk6L3MX4LH_cjs.hydrateAttachmentFromRidInternal(client, responseValue);
|
|
1610
1991
|
}
|
|
1611
1992
|
case "object": {
|
|
1612
1993
|
const def = definitions.get(responseDataType.object);
|
|
@@ -1628,7 +2009,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
1628
2009
|
throw new Error(`Missing definition for ${responseDataType.objectSet}`);
|
|
1629
2010
|
}
|
|
1630
2011
|
if (typeof responseValue === "string") {
|
|
1631
|
-
return
|
|
2012
|
+
return chunk6L3MX4LH_cjs.createObjectSet(def, client, {
|
|
1632
2013
|
type: "intersect",
|
|
1633
2014
|
objectSets: [{
|
|
1634
2015
|
type: "base",
|
|
@@ -1639,7 +2020,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
1639
2020
|
}]
|
|
1640
2021
|
});
|
|
1641
2022
|
}
|
|
1642
|
-
return
|
|
2023
|
+
return chunk6L3MX4LH_cjs.createObjectSet(def, client, responseValue);
|
|
1643
2024
|
}
|
|
1644
2025
|
case "struct": {
|
|
1645
2026
|
for (const [key, subtype] of Object.entries(responseDataType.struct)) {
|
|
@@ -1825,7 +2206,7 @@ function createClientInternal(objectSetFactory, transactionRid, baseUrl, ontolog
|
|
|
1825
2206
|
ontologyRid
|
|
1826
2207
|
}, baseUrl, tokenProvider, {
|
|
1827
2208
|
...options,
|
|
1828
|
-
logger: options?.logger ?? new
|
|
2209
|
+
logger: options?.logger ?? new chunk6L3MX4LH_cjs.MinimalLogger(),
|
|
1829
2210
|
transactionRid,
|
|
1830
2211
|
branch: options?.branch
|
|
1831
2212
|
}, fetchFn, objectSetFactory);
|
|
@@ -1848,7 +2229,7 @@ function createClientFromContext(clientCtx) {
|
|
|
1848
2229
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid.name:
|
|
1849
2230
|
return {
|
|
1850
2231
|
fetchOneByRid: async (objectType, rid, options) => {
|
|
1851
|
-
return await
|
|
2232
|
+
return await chunk6L3MX4LH_cjs.fetchSingle(clientCtx, objectType, options, createWithRid([rid]));
|
|
1852
2233
|
}
|
|
1853
2234
|
};
|
|
1854
2235
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference.name:
|
|
@@ -1860,7 +2241,7 @@ function createClientFromContext(clientCtx) {
|
|
|
1860
2241
|
objectType,
|
|
1861
2242
|
propertyType
|
|
1862
2243
|
} = args;
|
|
1863
|
-
return await
|
|
2244
|
+
return await chunk6L3MX4LH_cjs.MediaReferenceProperty_exports.upload(clientCtx, await clientCtx.ontologyRid, objectType.apiName, propertyType, data, {
|
|
1864
2245
|
mediaItemPath: fileName,
|
|
1865
2246
|
preview: true
|
|
1866
2247
|
});
|
|
@@ -1869,10 +2250,10 @@ function createClientFromContext(clientCtx) {
|
|
|
1869
2250
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid.name:
|
|
1870
2251
|
return {
|
|
1871
2252
|
fetchPageByRid: async (objectOrInterfaceType, rids, options = {}) => {
|
|
1872
|
-
return await
|
|
2253
|
+
return await chunk6L3MX4LH_cjs.fetchPage(clientCtx, objectOrInterfaceType, options, createWithRid(rids));
|
|
1873
2254
|
},
|
|
1874
2255
|
fetchPageByRidNoType: async (rids, options) => {
|
|
1875
|
-
return await
|
|
2256
|
+
return await chunk6L3MX4LH_cjs.fetchStaticRidPage(clientCtx, rids, options ?? {});
|
|
1876
2257
|
}
|
|
1877
2258
|
};
|
|
1878
2259
|
}
|
|
@@ -1884,13 +2265,13 @@ function createClientFromContext(clientCtx) {
|
|
|
1884
2265
|
const fetchMetadata = fetchMetadataInternal.bind(void 0, clientCtx);
|
|
1885
2266
|
const symbolClientContext2 = "__osdkClientContext";
|
|
1886
2267
|
const client = Object.defineProperties(clientFn, {
|
|
1887
|
-
[
|
|
2268
|
+
[chunk6L3MX4LH_cjs.symbolClientContext]: {
|
|
1888
2269
|
value: clientCtx
|
|
1889
2270
|
},
|
|
1890
2271
|
[symbolClientContext2]: {
|
|
1891
2272
|
value: clientCtx
|
|
1892
2273
|
},
|
|
1893
|
-
[
|
|
2274
|
+
[chunk6L3MX4LH_cjs.additionalContext]: {
|
|
1894
2275
|
value: clientCtx
|
|
1895
2276
|
},
|
|
1896
2277
|
fetchMetadata: {
|
|
@@ -1899,8 +2280,8 @@ function createClientFromContext(clientCtx) {
|
|
|
1899
2280
|
});
|
|
1900
2281
|
return client;
|
|
1901
2282
|
}
|
|
1902
|
-
var createClient = createClientInternal.bind(void 0,
|
|
1903
|
-
var createClientWithTransaction = (transactionRid, ...args) => createClientInternal(
|
|
2283
|
+
var createClient = createClientInternal.bind(void 0, chunk6L3MX4LH_cjs.createObjectSet, void 0);
|
|
2284
|
+
var createClientWithTransaction = (transactionRid, ...args) => createClientInternal(chunk6L3MX4LH_cjs.createObjectSet, transactionRid, ...args);
|
|
1904
2285
|
function createWithRid(rids) {
|
|
1905
2286
|
const withRid = {
|
|
1906
2287
|
type: "static",
|
|
@@ -1920,5 +2301,5 @@ exports.createClientFromContext = createClientFromContext;
|
|
|
1920
2301
|
exports.createClientWithTransaction = createClientWithTransaction;
|
|
1921
2302
|
exports.createObjectSpecifierFromPrimaryKey = createObjectSpecifierFromPrimaryKey;
|
|
1922
2303
|
exports.extractPrimaryKeyFromObjectSpecifier = extractPrimaryKeyFromObjectSpecifier;
|
|
1923
|
-
//# sourceMappingURL=chunk-
|
|
1924
|
-
//# sourceMappingURL=chunk-
|
|
2304
|
+
//# sourceMappingURL=chunk-BRYZR53E.cjs.map
|
|
2305
|
+
//# sourceMappingURL=chunk-BRYZR53E.cjs.map
|