@osdk/client 2.5.0-rc.15 → 2.6.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -6
- package/build/browser/Client.js +1 -1
- package/build/browser/Client.js.map +1 -1
- package/build/browser/MinimalClientContext.js.map +1 -1
- package/build/browser/actions/applyAction.js +4 -0
- package/build/browser/actions/applyAction.js.map +1 -1
- package/build/browser/createClient.js +2 -1
- package/build/browser/createClient.js.map +1 -1
- package/build/browser/createMinimalClient.js +3 -1
- package/build/browser/createMinimalClient.js.map +1 -1
- package/build/browser/derivedProperties/createWithPropertiesObjectSet.js +17 -0
- package/build/browser/derivedProperties/createWithPropertiesObjectSet.js.map +1 -1
- package/build/browser/fetchMetadata.test.js +11 -0
- package/build/browser/fetchMetadata.test.js.map +1 -1
- package/build/browser/index.js +2 -2
- package/build/browser/index.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/aggregate.js +2 -0
- package/build/browser/object/aggregate.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/fetchPage.js +8 -4
- package/build/browser/object/fetchPage.js.map +1 -1
- package/build/browser/object/formatting/applyPropertyFormatter.js +52 -0
- package/build/browser/object/formatting/applyPropertyFormatter.js.map +1 -0
- package/build/browser/object/formatting/applyPropertyFormatter.test.js +423 -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/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/object/mediaUpload.js +3 -0
- package/build/browser/object/mediaUpload.js.map +1 -1
- package/build/browser/objectSet/createObjectSet.js +11 -0
- package/build/browser/objectSet/createObjectSet.js.map +1 -1
- package/build/browser/observable/internal/objectMatchesWhereClause.test.js +2 -1
- package/build/browser/observable/internal/objectMatchesWhereClause.test.js.map +1 -1
- package/build/browser/observable/internal/testUtils.js +2 -1
- package/build/browser/observable/internal/testUtils.js.map +1 -1
- package/build/browser/ontology/loadActionMetadata.js +3 -1
- package/build/browser/ontology/loadActionMetadata.js.map +1 -1
- package/build/browser/ontology/loadFullObjectMetadata.js +2 -1
- package/build/browser/ontology/loadFullObjectMetadata.js.map +1 -1
- package/build/browser/ontology/loadInterfaceMetadata.js +2 -1
- package/build/browser/ontology/loadInterfaceMetadata.js.map +1 -1
- package/build/browser/queries/applyQuery.js +5 -4
- package/build/browser/queries/applyQuery.js.map +1 -1
- package/build/browser/util/UserAgent.js +2 -2
- package/build/browser/util/UserAgent.js.map +1 -1
- package/build/browser/util/extractObjectOrInterfaceType.js +5 -1
- package/build/browser/util/extractObjectOrInterfaceType.js.map +1 -1
- package/build/browser/util/extractObjectOrInterfaceType.test.js +21 -2
- package/build/browser/util/extractObjectOrInterfaceType.test.js.map +1 -1
- package/build/browser/util/toDataValue.js +15 -1
- package/build/browser/util/toDataValue.js.map +1 -1
- package/build/browser/util/toDataValue.test.js +42 -2
- package/build/browser/util/toDataValue.test.js.map +1 -1
- package/build/cjs/{chunk-KODTFRP3.cjs → chunk-6L3MX4LH.cjs} +106 -49
- package/build/cjs/chunk-6L3MX4LH.cjs.map +1 -0
- package/build/cjs/{chunk-56O6U7K6.cjs → chunk-X7WMWKLM.cjs} +341 -72
- package/build/cjs/chunk-X7WMWKLM.cjs.map +1 -0
- package/build/cjs/{createClient-BJo8T7Js.d.cts → createClient-mOlFts15.d.cts} +1 -0
- package/build/cjs/index.cjs +15 -7
- package/build/cjs/index.d.cts +10 -3
- package/build/cjs/public/internal.cjs +8 -8
- package/build/cjs/public/unstable-do-not-use.cjs +31 -31
- package/build/cjs/public/unstable-do-not-use.d.cts +1 -1
- package/build/esm/Client.js +1 -1
- package/build/esm/Client.js.map +1 -1
- package/build/esm/MinimalClientContext.js.map +1 -1
- package/build/esm/actions/applyAction.js +4 -0
- package/build/esm/actions/applyAction.js.map +1 -1
- package/build/esm/createClient.js +2 -1
- package/build/esm/createClient.js.map +1 -1
- package/build/esm/createMinimalClient.js +3 -1
- package/build/esm/createMinimalClient.js.map +1 -1
- package/build/esm/derivedProperties/createWithPropertiesObjectSet.js +17 -0
- package/build/esm/derivedProperties/createWithPropertiesObjectSet.js.map +1 -1
- package/build/esm/fetchMetadata.test.js +11 -0
- package/build/esm/fetchMetadata.test.js.map +1 -1
- package/build/esm/index.js +2 -2
- package/build/esm/index.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/aggregate.js +2 -0
- package/build/esm/object/aggregate.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/fetchPage.js +8 -4
- package/build/esm/object/fetchPage.js.map +1 -1
- package/build/esm/object/formatting/applyPropertyFormatter.js +52 -0
- package/build/esm/object/formatting/applyPropertyFormatter.js.map +1 -0
- package/build/esm/object/formatting/applyPropertyFormatter.test.js +423 -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/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/object/mediaUpload.js +3 -0
- package/build/esm/object/mediaUpload.js.map +1 -1
- package/build/esm/objectSet/createObjectSet.js +11 -0
- package/build/esm/objectSet/createObjectSet.js.map +1 -1
- package/build/esm/observable/internal/objectMatchesWhereClause.test.js +2 -1
- package/build/esm/observable/internal/objectMatchesWhereClause.test.js.map +1 -1
- package/build/esm/observable/internal/testUtils.js +2 -1
- package/build/esm/observable/internal/testUtils.js.map +1 -1
- package/build/esm/ontology/loadActionMetadata.js +3 -1
- package/build/esm/ontology/loadActionMetadata.js.map +1 -1
- package/build/esm/ontology/loadFullObjectMetadata.js +2 -1
- package/build/esm/ontology/loadFullObjectMetadata.js.map +1 -1
- package/build/esm/ontology/loadInterfaceMetadata.js +2 -1
- package/build/esm/ontology/loadInterfaceMetadata.js.map +1 -1
- package/build/esm/queries/applyQuery.js +5 -4
- package/build/esm/queries/applyQuery.js.map +1 -1
- package/build/esm/util/UserAgent.js +2 -2
- package/build/esm/util/UserAgent.js.map +1 -1
- package/build/esm/util/extractObjectOrInterfaceType.js +5 -1
- package/build/esm/util/extractObjectOrInterfaceType.js.map +1 -1
- package/build/esm/util/extractObjectOrInterfaceType.test.js +21 -2
- package/build/esm/util/extractObjectOrInterfaceType.test.js.map +1 -1
- package/build/esm/util/toDataValue.js +15 -1
- package/build/esm/util/toDataValue.js.map +1 -1
- package/build/esm/util/toDataValue.test.js +42 -2
- package/build/esm/util/toDataValue.test.js.map +1 -1
- package/build/types/Client.d.ts +1 -1
- package/build/types/MinimalClientContext.d.ts +2 -0
- package/build/types/MinimalClientContext.d.ts.map +1 -1
- package/build/types/actions/applyAction.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 -2
- package/build/types/index.d.ts.map +1 -1
- package/build/types/object/fetchPage.d.ts.map +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/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/build/types/object/mediaUpload.d.ts +2 -1
- package/build/types/object/mediaUpload.d.ts.map +1 -1
- package/build/types/observable/internal/testUtils.d.ts.map +1 -1
- package/build/types/queries/applyQuery.d.ts.map +1 -1
- package/package.json +12 -12
- package/build/cjs/chunk-56O6U7K6.cjs.map +0 -1
- package/build/cjs/chunk-KODTFRP3.cjs.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
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');
|
|
7
|
-
var shared_client_impl = require('@osdk/shared.client.impl');
|
|
8
7
|
var api = require('@osdk/api');
|
|
8
|
+
var shared_client_impl = require('@osdk/shared.client.impl');
|
|
9
9
|
var generatorConverters = require('@osdk/generator-converters');
|
|
10
10
|
|
|
11
11
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -395,6 +395,9 @@ function getPrimaryKeyOrThrow(ref) {
|
|
|
395
395
|
function isMediaReference(o) {
|
|
396
396
|
return typeof o === `object` && typeof o.mimeType === "string" && "reference" in o && typeof o.reference === "object" && o.reference.type === "mediaSetViewItem" && "mediaSetViewItem" in o.reference && typeof o.reference.mediaSetViewItem === "object" && typeof o.reference.mediaSetViewItem.mediaSetRid === "string" && typeof o.reference.mediaSetViewItem.mediaSetViewRid === "string" && typeof o.reference.mediaSetViewItem.mediaItemRid === "string";
|
|
397
397
|
}
|
|
398
|
+
function isMediaUpload(o) {
|
|
399
|
+
return typeof o === "object" && "path" in o && typeof o.path === "string" && "data" in o && typeof o.data === "object" && o.data instanceof Blob;
|
|
400
|
+
}
|
|
398
401
|
|
|
399
402
|
// src/util/interfaceUtils.ts
|
|
400
403
|
function isInterfaceActionParam(o) {
|
|
@@ -427,44 +430,54 @@ async function toDataValue(value, client, actionMetadata) {
|
|
|
427
430
|
if (value == null) {
|
|
428
431
|
return value;
|
|
429
432
|
}
|
|
433
|
+
if (value === api.NULL_VALUE) {
|
|
434
|
+
return null;
|
|
435
|
+
}
|
|
430
436
|
if (Array.isArray(value) || value instanceof Set) {
|
|
431
437
|
const values = Array.from(value);
|
|
432
438
|
if (values.some((dataValue) => isAttachmentUpload(dataValue) || isAttachmentFile(dataValue))) {
|
|
433
439
|
const converted = [];
|
|
434
440
|
for (const value2 of values) {
|
|
435
|
-
converted.push(await toDataValue(value2, client));
|
|
441
|
+
converted.push(await toDataValue(value2, client, actionMetadata));
|
|
436
442
|
}
|
|
437
443
|
return converted;
|
|
438
444
|
}
|
|
439
|
-
const promiseArray = Array.from(value, async (innerValue) => await toDataValue(innerValue, client));
|
|
445
|
+
const promiseArray = Array.from(value, async (innerValue) => await toDataValue(innerValue, client, actionMetadata));
|
|
440
446
|
return Promise.all(promiseArray);
|
|
441
447
|
}
|
|
442
448
|
if (isAttachmentUpload(value)) {
|
|
443
|
-
const attachment = await
|
|
449
|
+
const attachment = await chunk6L3MX4LH_cjs.Attachment_exports.upload(client, value.data, {
|
|
444
450
|
filename: value.name
|
|
445
451
|
});
|
|
446
|
-
return await toDataValue(attachment.rid, client);
|
|
452
|
+
return await toDataValue(attachment.rid, client, actionMetadata);
|
|
447
453
|
}
|
|
448
454
|
if (isAttachmentFile(value)) {
|
|
449
|
-
const attachment = await
|
|
455
|
+
const attachment = await chunk6L3MX4LH_cjs.Attachment_exports.upload(client, value, {
|
|
450
456
|
filename: value.name
|
|
451
457
|
});
|
|
452
|
-
return await toDataValue(attachment.rid, client);
|
|
458
|
+
return await toDataValue(attachment.rid, client, actionMetadata);
|
|
459
|
+
}
|
|
460
|
+
if (isMediaUpload(value)) {
|
|
461
|
+
const mediaRef = await chunk6L3MX4LH_cjs.MediaReferenceProperty_exports.uploadMedia(client, await client.ontologyRid, actionMetadata.apiName, value.data, {
|
|
462
|
+
mediaItemPath: value.path,
|
|
463
|
+
preview: true
|
|
464
|
+
});
|
|
465
|
+
return await toDataValue(mediaRef, client, actionMetadata);
|
|
453
466
|
}
|
|
454
467
|
if (isOntologyObjectV2(value)) {
|
|
455
|
-
return await toDataValue(value.__primaryKey, client);
|
|
468
|
+
return await toDataValue(value.__primaryKey, client, actionMetadata);
|
|
456
469
|
}
|
|
457
470
|
if (isObjectSpecifiersObject(value)) {
|
|
458
|
-
return await toDataValue(value.$primaryKey, client);
|
|
471
|
+
return await toDataValue(value.$primaryKey, client, actionMetadata);
|
|
459
472
|
}
|
|
460
473
|
if (isPoint(value)) {
|
|
461
|
-
return await toDataValue(`${value.coordinates[1]},${value.coordinates[0]}`, client);
|
|
474
|
+
return await toDataValue(`${value.coordinates[1]},${value.coordinates[0]}`, client, actionMetadata);
|
|
462
475
|
}
|
|
463
|
-
if (
|
|
476
|
+
if (chunk6L3MX4LH_cjs.isWireObjectSet(value)) {
|
|
464
477
|
return value;
|
|
465
478
|
}
|
|
466
|
-
if (
|
|
467
|
-
return
|
|
479
|
+
if (chunk6L3MX4LH_cjs.isObjectSet(value)) {
|
|
480
|
+
return chunk6L3MX4LH_cjs.getWireObjectSet(value);
|
|
468
481
|
}
|
|
469
482
|
if (isMediaReference(value)) {
|
|
470
483
|
return value;
|
|
@@ -478,7 +491,7 @@ async function toDataValue(value, client, actionMetadata) {
|
|
|
478
491
|
if (typeof value === "object") {
|
|
479
492
|
return Object.entries(value).reduce(async (promisedAcc, [key, structValue]) => {
|
|
480
493
|
const acc = await promisedAcc;
|
|
481
|
-
acc[key] = await toDataValue(structValue, client);
|
|
494
|
+
acc[key] = await toDataValue(structValue, client, actionMetadata);
|
|
482
495
|
return acc;
|
|
483
496
|
}, Promise.resolve({}));
|
|
484
497
|
}
|
|
@@ -487,25 +500,29 @@ async function toDataValue(value, client, actionMetadata) {
|
|
|
487
500
|
|
|
488
501
|
// src/actions/applyAction.ts
|
|
489
502
|
async function applyAction(client, action, parameters, options = {}) {
|
|
490
|
-
const clientWithHeaders =
|
|
503
|
+
const clientWithHeaders = chunk6L3MX4LH_cjs.addUserAgentAndRequestContextHeaders(chunk6L3MX4LH_cjs.augmentRequestContext(client, (_) => ({
|
|
491
504
|
finalMethodCall: "applyAction"
|
|
492
505
|
})), action);
|
|
493
506
|
if (Array.isArray(parameters)) {
|
|
494
|
-
const response = await
|
|
507
|
+
const response = await chunk6L3MX4LH_cjs.Action_exports.applyBatch(clientWithHeaders, await client.ontologyRid, action.apiName, {
|
|
495
508
|
requests: parameters ? await remapBatchActionParams(parameters, client, await client.ontologyProvider.getActionDefinition(action.apiName)) : [],
|
|
496
509
|
options: {
|
|
497
510
|
returnEdits: options?.$returnEdits ? "ALL" : "NONE"
|
|
498
511
|
}
|
|
512
|
+
}, {
|
|
513
|
+
branch: client.branch
|
|
499
514
|
});
|
|
500
515
|
const edits = response.edits;
|
|
501
516
|
return options?.$returnEdits ? edits?.type === "edits" ? remapActionResponse(response) : edits : void 0;
|
|
502
517
|
} else {
|
|
503
|
-
const response = await
|
|
518
|
+
const response = await chunk6L3MX4LH_cjs.Action_exports.apply(clientWithHeaders, await client.ontologyRid, action.apiName, {
|
|
504
519
|
parameters: await remapActionParams(parameters, client, await client.ontologyProvider.getActionDefinition(action.apiName)),
|
|
505
520
|
options: {
|
|
506
521
|
mode: options?.$validateOnly ? "VALIDATE_ONLY" : "VALIDATE_AND_EXECUTE",
|
|
507
522
|
returnEdits: options?.$returnEdits ? "ALL_V2_WITH_DELETIONS" : "NONE"
|
|
508
523
|
}
|
|
524
|
+
}, {
|
|
525
|
+
branch: client.branch
|
|
509
526
|
});
|
|
510
527
|
if (options?.$validateOnly) {
|
|
511
528
|
return response.validation;
|
|
@@ -524,14 +541,14 @@ async function remapActionParams(params, client, actionMetadata) {
|
|
|
524
541
|
}
|
|
525
542
|
const parameterMap = {};
|
|
526
543
|
for (const [key, value] of Object.entries(params)) {
|
|
527
|
-
parameterMap[key] = await toDataValue(value, client);
|
|
544
|
+
parameterMap[key] = await toDataValue(value, client, actionMetadata);
|
|
528
545
|
}
|
|
529
546
|
return parameterMap;
|
|
530
547
|
}
|
|
531
548
|
async function remapBatchActionParams(params, client, actionMetadata) {
|
|
532
549
|
const remappedParams = await Promise.all(params.map(async (param) => {
|
|
533
550
|
return {
|
|
534
|
-
parameters: await remapActionParams(param, client)
|
|
551
|
+
parameters: await remapActionParams(param, client, actionMetadata)
|
|
535
552
|
};
|
|
536
553
|
}));
|
|
537
554
|
return remappedParams;
|
|
@@ -705,7 +722,7 @@ var GeotimeSeriesPropertyImpl = class {
|
|
|
705
722
|
}
|
|
706
723
|
}
|
|
707
724
|
async getLatestValue() {
|
|
708
|
-
const latestPointPromise =
|
|
725
|
+
const latestPointPromise = chunk6L3MX4LH_cjs.TimeSeriesValueBankProperty_exports.getLatestValue(this.#client, await this.#client.ontologyRid, ...this.#triplet);
|
|
709
726
|
latestPointPromise.then(
|
|
710
727
|
(latestPoint) => this.lastFetchedValue = latestPoint,
|
|
711
728
|
// eslint-disable-next-line no-console
|
|
@@ -721,7 +738,7 @@ var GeotimeSeriesPropertyImpl = class {
|
|
|
721
738
|
return allPoints;
|
|
722
739
|
}
|
|
723
740
|
async *asyncIterValues(query) {
|
|
724
|
-
const streamPointsIterator = await
|
|
741
|
+
const streamPointsIterator = await chunk6L3MX4LH_cjs.TimeSeriesValueBankProperty_exports.streamValues(this.#client, await this.#client.ontologyRid, ...this.#triplet, query ? {
|
|
725
742
|
range: getTimeRange(query)
|
|
726
743
|
} : {});
|
|
727
744
|
for await (const timeseriesPoint of asyncIterPointsHelper(streamPointsIterator)) {
|
|
@@ -748,13 +765,13 @@ var MediaReferencePropertyImpl = class {
|
|
|
748
765
|
this.#mediaReference = mediaReference;
|
|
749
766
|
}
|
|
750
767
|
async fetchContents() {
|
|
751
|
-
return
|
|
768
|
+
return chunk6L3MX4LH_cjs.MediaReferenceProperty_exports.getMediaContent(this.#client, await this.#client.ontologyRid, ...this.#triplet, {
|
|
752
769
|
preview: true
|
|
753
770
|
// TODO: Can turn this back off when backend is no longer in beta.
|
|
754
771
|
});
|
|
755
772
|
}
|
|
756
773
|
async fetchMetadata() {
|
|
757
|
-
const r = await
|
|
774
|
+
const r = await chunk6L3MX4LH_cjs.MediaReferenceProperty_exports.getMediaMetadata(this.#client, await this.#client.ontologyRid, ...this.#triplet, {
|
|
758
775
|
preview: true
|
|
759
776
|
// TODO: Can turn this back off when backend is no longer in beta.
|
|
760
777
|
});
|
|
@@ -778,10 +795,10 @@ var TimeSeriesPropertyImpl = class {
|
|
|
778
795
|
this.#triplet = [objectApiName, primaryKey, propertyName];
|
|
779
796
|
}
|
|
780
797
|
async getFirstPoint() {
|
|
781
|
-
return
|
|
798
|
+
return chunk6L3MX4LH_cjs.TimeSeriesPropertyV2_exports.getFirstPoint(this.#client, await this.#client.ontologyRid, ...this.#triplet);
|
|
782
799
|
}
|
|
783
800
|
async getLastPoint() {
|
|
784
|
-
return
|
|
801
|
+
return chunk6L3MX4LH_cjs.TimeSeriesPropertyV2_exports.getLastPoint(this.#client, await this.#client.ontologyRid, ...this.#triplet);
|
|
785
802
|
}
|
|
786
803
|
async getAllPoints(query) {
|
|
787
804
|
const allPoints = [];
|
|
@@ -791,7 +808,7 @@ var TimeSeriesPropertyImpl = class {
|
|
|
791
808
|
return allPoints;
|
|
792
809
|
}
|
|
793
810
|
async *asyncIterPoints(query) {
|
|
794
|
-
const streamPointsIterator = await
|
|
811
|
+
const streamPointsIterator = await chunk6L3MX4LH_cjs.TimeSeriesPropertyV2_exports.streamPoints(this.#client, await this.#client.ontologyRid, ...this.#triplet, query ? {
|
|
795
812
|
range: getTimeRange(query)
|
|
796
813
|
} : {});
|
|
797
814
|
for await (const timeseriesPoint of asyncIterPointsHelper(streamPointsIterator)) {
|
|
@@ -800,6 +817,237 @@ var TimeSeriesPropertyImpl = class {
|
|
|
800
817
|
}
|
|
801
818
|
};
|
|
802
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/formatNumber.ts
|
|
843
|
+
function formatNumber(value, numberType, objectData, locale) {
|
|
844
|
+
switch (numberType.type) {
|
|
845
|
+
case "standard":
|
|
846
|
+
return formatStandardNumber(value, numberType.baseFormatOptions, locale);
|
|
847
|
+
case "fixedValues":
|
|
848
|
+
return numberType.values[value];
|
|
849
|
+
case "currency":
|
|
850
|
+
return formatCurrency(value, numberType, objectData, locale);
|
|
851
|
+
case "standardUnit":
|
|
852
|
+
return formatStandardUnit(value, numberType, objectData, locale);
|
|
853
|
+
case "customUnit":
|
|
854
|
+
return formatCustomUnit(value, numberType, objectData, locale);
|
|
855
|
+
case "affix":
|
|
856
|
+
return formatAffix(value, numberType, objectData, locale);
|
|
857
|
+
case "duration":
|
|
858
|
+
return void 0;
|
|
859
|
+
case "scale":
|
|
860
|
+
return formatScale(value, numberType, locale);
|
|
861
|
+
case "ratio":
|
|
862
|
+
return formatRatio(value, numberType, locale);
|
|
863
|
+
default:
|
|
864
|
+
return void 0;
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
function formatStandardNumber(value, options, locale) {
|
|
868
|
+
return formatNumberWithAffixes(value, options, locale);
|
|
869
|
+
}
|
|
870
|
+
function formatCurrency(value, rule, objectData, locale) {
|
|
871
|
+
const currencyCode = resolvePropertyReference(rule.currencyCode, objectData);
|
|
872
|
+
if (currencyCode == null) {
|
|
873
|
+
return formatStandardNumber(value, rule.baseFormatOptions, locale);
|
|
874
|
+
}
|
|
875
|
+
const options = {
|
|
876
|
+
...convertToIntlOptions(rule.baseFormatOptions),
|
|
877
|
+
style: "currency",
|
|
878
|
+
currency: currencyCode,
|
|
879
|
+
currencyDisplay: rule.style === "COMPACT" ? "narrowSymbol" : "symbol"
|
|
880
|
+
};
|
|
881
|
+
return formatWithIntl(value, options, locale);
|
|
882
|
+
}
|
|
883
|
+
function formatStandardUnit(value, rule, objectData, locale) {
|
|
884
|
+
const unit = resolvePropertyReference(rule.unit, objectData);
|
|
885
|
+
if (unit == null) {
|
|
886
|
+
return formatStandardNumber(value, rule.baseFormatOptions, locale);
|
|
887
|
+
}
|
|
888
|
+
const options = {
|
|
889
|
+
...convertToIntlOptions(rule.baseFormatOptions),
|
|
890
|
+
style: "unit",
|
|
891
|
+
unit
|
|
892
|
+
};
|
|
893
|
+
try {
|
|
894
|
+
return formatWithIntl(value, options, locale);
|
|
895
|
+
} catch (error) {
|
|
896
|
+
const suffix = ` ${unit}`;
|
|
897
|
+
return formatNumberWithAffixes(value, rule.baseFormatOptions, locale, "", suffix);
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
function formatCustomUnit(value, rule, objectData, locale) {
|
|
901
|
+
const unit = resolvePropertyReference(rule.unit, objectData);
|
|
902
|
+
const suffix = unit != null ? ` ${unit}` : "";
|
|
903
|
+
return formatNumberWithAffixes(value, rule.baseFormatOptions, locale, "", suffix);
|
|
904
|
+
}
|
|
905
|
+
function formatAffix(value, rule, objectData, locale) {
|
|
906
|
+
const prefix = rule.affix.prefix != null ? resolvePropertyReference(rule.affix.prefix, objectData) ?? "" : "";
|
|
907
|
+
const suffix = rule.affix.postfix != null ? resolvePropertyReference(rule.affix.postfix, objectData) ?? "" : "";
|
|
908
|
+
return formatNumberWithAffixes(value, rule.baseFormatOptions, locale, prefix, suffix);
|
|
909
|
+
}
|
|
910
|
+
function getScaleDivisor(scaleType) {
|
|
911
|
+
switch (scaleType) {
|
|
912
|
+
case "THOUSANDS":
|
|
913
|
+
return 1e3;
|
|
914
|
+
case "MILLIONS":
|
|
915
|
+
return 1e6;
|
|
916
|
+
case "BILLIONS":
|
|
917
|
+
return 1e9;
|
|
918
|
+
default:
|
|
919
|
+
throw new Error(`Unknown scale type: ${scaleType}`);
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
function getLocalizedCompactSuffix(scaleDivisor, locale) {
|
|
923
|
+
const compactFormatter = new Intl.NumberFormat(locale, {
|
|
924
|
+
notation: "compact",
|
|
925
|
+
compactDisplay: "short"
|
|
926
|
+
});
|
|
927
|
+
const parts = compactFormatter.formatToParts(scaleDivisor);
|
|
928
|
+
const compactPart = parts.find((p) => p.type === "compact");
|
|
929
|
+
return compactPart?.value ?? "";
|
|
930
|
+
}
|
|
931
|
+
function formatScale(value, rule, locale) {
|
|
932
|
+
const scaleDivisor = getScaleDivisor(rule.scaleType);
|
|
933
|
+
const scaledValue = value / scaleDivisor;
|
|
934
|
+
const suffix = getLocalizedCompactSuffix(scaleDivisor, locale);
|
|
935
|
+
return formatNumberWithAffixes(scaledValue, rule.baseFormatOptions, locale, "", suffix);
|
|
936
|
+
}
|
|
937
|
+
function getRatioScaledValue(value, ratioType) {
|
|
938
|
+
switch (ratioType) {
|
|
939
|
+
case "PERCENTAGE":
|
|
940
|
+
return value * 100;
|
|
941
|
+
case "PER_MILLE":
|
|
942
|
+
return value * 1e3;
|
|
943
|
+
case "BASIS_POINTS":
|
|
944
|
+
return value * 1e4;
|
|
945
|
+
default:
|
|
946
|
+
throw new Error(`Unknown ratio type: ${ratioType}`);
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
function formatRatio(value, rule, locale) {
|
|
950
|
+
if (rule.ratioType === "PERCENTAGE") {
|
|
951
|
+
const options = {
|
|
952
|
+
...convertToIntlOptions(rule.baseFormatOptions),
|
|
953
|
+
style: "percent"
|
|
954
|
+
};
|
|
955
|
+
return formatWithIntl(value, options, locale);
|
|
956
|
+
}
|
|
957
|
+
const scaledValue = getRatioScaledValue(value, rule.ratioType);
|
|
958
|
+
let suffix;
|
|
959
|
+
switch (rule.ratioType) {
|
|
960
|
+
case "PER_MILLE":
|
|
961
|
+
suffix = "\u2030";
|
|
962
|
+
break;
|
|
963
|
+
case "BASIS_POINTS":
|
|
964
|
+
suffix = " bps";
|
|
965
|
+
break;
|
|
966
|
+
default:
|
|
967
|
+
rule.ratioType;
|
|
968
|
+
throw new Error(`Unknown ratio type: ${rule.ratioType}`);
|
|
969
|
+
}
|
|
970
|
+
return formatNumberWithAffixes(scaledValue, rule.baseFormatOptions, locale, "", suffix);
|
|
971
|
+
}
|
|
972
|
+
function mapNotation(notation) {
|
|
973
|
+
switch (notation) {
|
|
974
|
+
case "STANDARD":
|
|
975
|
+
return "standard";
|
|
976
|
+
case "SCIENTIFIC":
|
|
977
|
+
return "scientific";
|
|
978
|
+
case "ENGINEERING":
|
|
979
|
+
return "engineering";
|
|
980
|
+
case "COMPACT":
|
|
981
|
+
return "compact";
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
function mapRoundingMode(mode) {
|
|
985
|
+
switch (mode) {
|
|
986
|
+
case "CEIL":
|
|
987
|
+
return "ceil";
|
|
988
|
+
case "FLOOR":
|
|
989
|
+
return "floor";
|
|
990
|
+
case "ROUND_CLOSEST":
|
|
991
|
+
return "halfExpand";
|
|
992
|
+
default:
|
|
993
|
+
return void 0;
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
function convertToIntlOptions(options) {
|
|
997
|
+
return {
|
|
998
|
+
useGrouping: options.useGrouping,
|
|
999
|
+
minimumIntegerDigits: options.minimumIntegerDigits,
|
|
1000
|
+
minimumFractionDigits: options.minimumFractionDigits,
|
|
1001
|
+
maximumFractionDigits: options.maximumFractionDigits,
|
|
1002
|
+
minimumSignificantDigits: options.minimumSignificantDigits,
|
|
1003
|
+
maximumSignificantDigits: options.maximumSignificantDigits,
|
|
1004
|
+
notation: options.notation ? mapNotation(options.notation) : void 0,
|
|
1005
|
+
roundingMode: options.roundingMode ? mapRoundingMode(options.roundingMode) : void 0,
|
|
1006
|
+
convertNegativeToParenthesis: options.convertNegativeToParenthesis
|
|
1007
|
+
};
|
|
1008
|
+
}
|
|
1009
|
+
function maybeConvertNegativeToParenthesis(formatted, value, shouldConvert) {
|
|
1010
|
+
if (shouldConvert && value < 0) {
|
|
1011
|
+
return formatted.replace(/^-/, "(") + ")";
|
|
1012
|
+
}
|
|
1013
|
+
return formatted;
|
|
1014
|
+
}
|
|
1015
|
+
function formatWithIntl(value, options, locale) {
|
|
1016
|
+
const formatter = new Intl.NumberFormat(locale, options);
|
|
1017
|
+
const formatted = formatter.format(value);
|
|
1018
|
+
return maybeConvertNegativeToParenthesis(formatted, value, options.convertNegativeToParenthesis ?? false);
|
|
1019
|
+
}
|
|
1020
|
+
function formatNumberWithAffixes(value, baseOptions, locale, prefix, suffix) {
|
|
1021
|
+
const intlOptions = convertToIntlOptions(baseOptions);
|
|
1022
|
+
const formatted = formatWithIntl(value, intlOptions, locale);
|
|
1023
|
+
return `${prefix || ""}${formatted}${suffix || ""}`;
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
// src/object/formatting/applyPropertyFormatter.ts
|
|
1027
|
+
function applyPropertyFormatter(propertyValue, propertyDefinition, objectData, options = {}) {
|
|
1028
|
+
if (propertyDefinition?.valueFormatting == null || propertyValue == null) {
|
|
1029
|
+
return void 0;
|
|
1030
|
+
}
|
|
1031
|
+
return formatPropertyValue(propertyValue, propertyDefinition.valueFormatting, objectData, options);
|
|
1032
|
+
}
|
|
1033
|
+
function formatPropertyValue(value, rule, objectData, options) {
|
|
1034
|
+
switch (rule.type) {
|
|
1035
|
+
case "boolean":
|
|
1036
|
+
if (typeof value !== "boolean") {
|
|
1037
|
+
return void 0;
|
|
1038
|
+
}
|
|
1039
|
+
return formatBoolean(value, rule);
|
|
1040
|
+
case "number":
|
|
1041
|
+
if (typeof value !== "number") {
|
|
1042
|
+
return void 0;
|
|
1043
|
+
}
|
|
1044
|
+
return formatNumber(value, rule.numberType, objectData, options.locale ?? getBrowserLocale());
|
|
1045
|
+
// TODO - implement rest of formatters
|
|
1046
|
+
default:
|
|
1047
|
+
return void 0;
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
|
|
803
1051
|
// src/ontology/OntologyProvider.ts
|
|
804
1052
|
var InterfaceDefinitions = Symbol("InterfaceDefinitions" );
|
|
805
1053
|
|
|
@@ -820,8 +1068,8 @@ function get$link(holder) {
|
|
|
820
1068
|
[objDef.primaryKeyApiName]: rawObj.$primaryKey
|
|
821
1069
|
}).pivotTo(linkName);
|
|
822
1070
|
const value = !linkDef.multiplicity ? {
|
|
823
|
-
fetchOne: (options) =>
|
|
824
|
-
fetchOneWithErrors: (options) =>
|
|
1071
|
+
fetchOne: (options) => chunk6L3MX4LH_cjs.fetchSingle(client, objDef, options ?? {}, chunk6L3MX4LH_cjs.getWireObjectSet(objectSet)),
|
|
1072
|
+
fetchOneWithErrors: (options) => chunk6L3MX4LH_cjs.fetchSingleWithErrors(client, objDef, options ?? {}, chunk6L3MX4LH_cjs.getWireObjectSet(objectSet))
|
|
825
1073
|
} : objectSet;
|
|
826
1074
|
return [linkName, value];
|
|
827
1075
|
})));
|
|
@@ -837,8 +1085,8 @@ function get$linkForInterface(holder) {
|
|
|
837
1085
|
[objDef.primaryKeyApiName]: rawObj.$primaryKey
|
|
838
1086
|
})).pivotTo(linkName);
|
|
839
1087
|
const value = !linkDef.multiplicity ? {
|
|
840
|
-
fetchOne: (options) =>
|
|
841
|
-
fetchOneWithErrors: (options) =>
|
|
1088
|
+
fetchOne: (options) => chunk6L3MX4LH_cjs.fetchSingle(client, objDef, options ?? {}, chunk6L3MX4LH_cjs.getWireObjectSet(objectSet)),
|
|
1089
|
+
fetchOneWithErrors: (options) => chunk6L3MX4LH_cjs.fetchSingleWithErrors(client, objDef, options ?? {}, chunk6L3MX4LH_cjs.getWireObjectSet(objectSet))
|
|
842
1090
|
} : objectSet;
|
|
843
1091
|
return [linkName, value];
|
|
844
1092
|
})));
|
|
@@ -846,7 +1094,7 @@ function get$linkForInterface(holder) {
|
|
|
846
1094
|
|
|
847
1095
|
// src/object/convertWireToOsdkObjects/createOsdkInterface.ts
|
|
848
1096
|
function createOsdkInterface(underlying, interfaceDef) {
|
|
849
|
-
const [objApiNamespace] =
|
|
1097
|
+
const [objApiNamespace] = chunk6L3MX4LH_cjs.extractNamespace(interfaceDef.apiName);
|
|
850
1098
|
return Object.freeze(Object.defineProperties({}, {
|
|
851
1099
|
// first to minimize hidden classes
|
|
852
1100
|
[UnderlyingOsdkObject]: {
|
|
@@ -891,6 +1139,10 @@ function createOsdkInterface(underlying, interfaceDef) {
|
|
|
891
1139
|
},
|
|
892
1140
|
enumerable: false
|
|
893
1141
|
},
|
|
1142
|
+
"$__EXPERIMENTAL__NOT_SUPPORTED_YET__getFormattedValue": {
|
|
1143
|
+
value: underlying.$__EXPERIMENTAL__NOT_SUPPORTED_YET__getFormattedValue,
|
|
1144
|
+
enumerable: false
|
|
1145
|
+
},
|
|
894
1146
|
"$link": {
|
|
895
1147
|
get: function() {
|
|
896
1148
|
return get$linkForInterface(this);
|
|
@@ -901,7 +1153,7 @@ function createOsdkInterface(underlying, interfaceDef) {
|
|
|
901
1153
|
},
|
|
902
1154
|
...Object.fromEntries(Object.keys(interfaceDef.properties).map((p) => {
|
|
903
1155
|
const objDef = underlying[ObjectDefRef];
|
|
904
|
-
const [apiNamespace, apiName] =
|
|
1156
|
+
const [apiNamespace, apiName] = chunk6L3MX4LH_cjs.extractNamespace(p);
|
|
905
1157
|
const targetPropName = objDef.interfaceMap[interfaceDef.apiName][p];
|
|
906
1158
|
return [apiNamespace === objApiNamespace ? apiName : p, {
|
|
907
1159
|
enumerable: targetPropName in underlying,
|
|
@@ -1015,6 +1267,15 @@ var basePropDefs = {
|
|
|
1015
1267
|
};
|
|
1016
1268
|
},
|
|
1017
1269
|
enumerable: false
|
|
1270
|
+
},
|
|
1271
|
+
"$__EXPERIMENTAL__NOT_SUPPORTED_YET__getFormattedValue": {
|
|
1272
|
+
value: function(propertyApiName, options) {
|
|
1273
|
+
const rawObj = this[UnderlyingOsdkObject];
|
|
1274
|
+
const def = this[ObjectDefRef];
|
|
1275
|
+
const propertyValue = rawObj[propertyApiName];
|
|
1276
|
+
return applyPropertyFormatter(propertyValue, def.properties[propertyApiName], rawObj, options);
|
|
1277
|
+
},
|
|
1278
|
+
enumerable: false
|
|
1018
1279
|
}
|
|
1019
1280
|
};
|
|
1020
1281
|
function createOsdkObject(client, objectDef, simpleOsdkProperties, derivedPropertyTypeByName = {}) {
|
|
@@ -1053,9 +1314,9 @@ function modifyRdpProperties(client, derivedPropertyTypeByName, rawValue, propKe
|
|
|
1053
1314
|
switch (derivedPropertyTypeByName[propKey].selectedOrCollectedPropertyType?.type) {
|
|
1054
1315
|
case "attachment":
|
|
1055
1316
|
if (Array.isArray(rawValue)) {
|
|
1056
|
-
return rawValue.map((a) =>
|
|
1317
|
+
return rawValue.map((a) => chunk6L3MX4LH_cjs.hydrateAttachmentFromRidInternal(client, a.rid));
|
|
1057
1318
|
} else {
|
|
1058
|
-
return
|
|
1319
|
+
return chunk6L3MX4LH_cjs.hydrateAttachmentFromRidInternal(client, rawValue.rid);
|
|
1059
1320
|
}
|
|
1060
1321
|
default:
|
|
1061
1322
|
process.env.NODE_ENV !== "production" ? invariant__default.default(false, "Derived property aggregations for Timeseries and Media are not supported") : invariant__default.default(false) ;
|
|
@@ -1071,9 +1332,9 @@ function createSpecialProperty(client, objectDef, rawObject, p) {
|
|
|
1071
1332
|
}
|
|
1072
1333
|
if (propDef.type === "attachment") {
|
|
1073
1334
|
if (Array.isArray(rawValue)) {
|
|
1074
|
-
return rawValue.map((a) =>
|
|
1335
|
+
return rawValue.map((a) => chunk6L3MX4LH_cjs.hydrateAttachmentFromRidInternal(client, a.rid));
|
|
1075
1336
|
}
|
|
1076
|
-
return
|
|
1337
|
+
return chunk6L3MX4LH_cjs.hydrateAttachmentFromRidInternal(client, rawValue.rid);
|
|
1077
1338
|
}
|
|
1078
1339
|
if (propDef.type === "numericTimeseries" || propDef.type === "stringTimeseries" || propDef.type === "sensorTimeseries") {
|
|
1079
1340
|
return new TimeSeriesPropertyImpl(client, objectDef.apiName, rawObject[objectDef.primaryKeyApiName], p);
|
|
@@ -1297,12 +1558,15 @@ function deepFreeze(obj) {
|
|
|
1297
1558
|
return Object.freeze(obj);
|
|
1298
1559
|
}
|
|
1299
1560
|
async function loadActionMetadata(client, actionType) {
|
|
1300
|
-
const r = await
|
|
1561
|
+
const r = await chunk6L3MX4LH_cjs.ActionTypeV2_exports.get(client, await client.ontologyRid, actionType, {
|
|
1562
|
+
branch: client.branch
|
|
1563
|
+
});
|
|
1301
1564
|
return generatorConverters.wireActionTypeV2ToSdkActionMetadata(r);
|
|
1302
1565
|
}
|
|
1303
1566
|
async function loadFullObjectMetadata(client, objectType) {
|
|
1304
|
-
const full = await
|
|
1305
|
-
preview: true
|
|
1567
|
+
const full = await chunk6L3MX4LH_cjs.ObjectTypeV2_exports.getFullMetadata(client, await client.ontologyRid, objectType, {
|
|
1568
|
+
preview: true,
|
|
1569
|
+
branch: client.branch
|
|
1306
1570
|
});
|
|
1307
1571
|
const ret = generatorConverters.wireObjectTypeFullMetadataToSdkObjectMetadata(full, true);
|
|
1308
1572
|
return {
|
|
@@ -1310,14 +1574,15 @@ async function loadFullObjectMetadata(client, objectType) {
|
|
|
1310
1574
|
};
|
|
1311
1575
|
}
|
|
1312
1576
|
async function loadInterfaceMetadata(client, objectType) {
|
|
1313
|
-
const r = await
|
|
1314
|
-
preview: true
|
|
1577
|
+
const r = await chunk6L3MX4LH_cjs.OntologyInterface_exports.get(client, await client.ontologyRid, objectType, {
|
|
1578
|
+
preview: true,
|
|
1579
|
+
branch: client.branch
|
|
1315
1580
|
});
|
|
1316
1581
|
return generatorConverters.__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(r, true);
|
|
1317
1582
|
}
|
|
1318
1583
|
async function loadQueryMetadata(client, queryTypeApiNameAndVersion) {
|
|
1319
1584
|
const [apiName, version] = queryTypeApiNameAndVersion.split(":");
|
|
1320
|
-
const r = await
|
|
1585
|
+
const r = await chunk6L3MX4LH_cjs.QueryType_exports.get(client, await client.ontologyRid, apiName, {
|
|
1321
1586
|
version
|
|
1322
1587
|
});
|
|
1323
1588
|
return generatorConverters.wireQueryTypeV2ToSdkQueryMetadata(r);
|
|
@@ -1374,11 +1639,11 @@ var createStandardOntologyProviderFactory = (client) => {
|
|
|
1374
1639
|
};
|
|
1375
1640
|
|
|
1376
1641
|
// src/util/UserAgent.ts
|
|
1377
|
-
var USER_AGENT = `osdk-client/${"2.
|
|
1378
|
-
var OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.
|
|
1642
|
+
var USER_AGENT = `osdk-client/${"2.6.0-beta.2"}`;
|
|
1643
|
+
var OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.6.0-beta.2"}`;
|
|
1379
1644
|
|
|
1380
1645
|
// src/createMinimalClient.ts
|
|
1381
|
-
function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory =
|
|
1646
|
+
function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory = chunk6L3MX4LH_cjs.createObjectSet, createOntologyProviderFactory = createStandardOntologyProviderFactory) {
|
|
1382
1647
|
if (process.env.NODE_ENV !== "production") {
|
|
1383
1648
|
try {
|
|
1384
1649
|
new URL(baseUrl);
|
|
@@ -1398,7 +1663,9 @@ function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fet
|
|
|
1398
1663
|
logger: options.logger,
|
|
1399
1664
|
transactionRid: options.transactionRid,
|
|
1400
1665
|
clientCacheKey: {},
|
|
1401
|
-
requestContext: {}
|
|
1666
|
+
requestContext: {},
|
|
1667
|
+
branch: options.branch,
|
|
1668
|
+
asTypeInterfaceOrObjectMapping: {}
|
|
1402
1669
|
};
|
|
1403
1670
|
return Object.freeze(Object.assign(minimalClient, {
|
|
1404
1671
|
ontologyProvider: createOntologyProviderFactory(options)(minimalClient)
|
|
@@ -1444,13 +1711,13 @@ async function toDataValueQueries(value, client, desiredType) {
|
|
|
1444
1711
|
switch (desiredType.type) {
|
|
1445
1712
|
case "attachment": {
|
|
1446
1713
|
if (isAttachmentUpload(value)) {
|
|
1447
|
-
const attachment = await
|
|
1714
|
+
const attachment = await chunk6L3MX4LH_cjs.Attachment_exports.upload(client, value.data, {
|
|
1448
1715
|
filename: value.name
|
|
1449
1716
|
});
|
|
1450
1717
|
return attachment.rid;
|
|
1451
1718
|
}
|
|
1452
1719
|
if (isAttachmentFile(value)) {
|
|
1453
|
-
const attachment = await
|
|
1720
|
+
const attachment = await chunk6L3MX4LH_cjs.Attachment_exports.upload(client, value, {
|
|
1454
1721
|
filename: value.name
|
|
1455
1722
|
});
|
|
1456
1723
|
return attachment.rid;
|
|
@@ -1490,11 +1757,11 @@ async function toDataValueQueries(value, client, desiredType) {
|
|
|
1490
1757
|
}
|
|
1491
1758
|
case "objectSet":
|
|
1492
1759
|
case "interfaceObjectSet": {
|
|
1493
|
-
if (
|
|
1760
|
+
if (chunk6L3MX4LH_cjs.isWireObjectSet(value)) {
|
|
1494
1761
|
return value;
|
|
1495
1762
|
}
|
|
1496
|
-
if (
|
|
1497
|
-
return
|
|
1763
|
+
if (chunk6L3MX4LH_cjs.isObjectSet(value)) {
|
|
1764
|
+
return chunk6L3MX4LH_cjs.getWireObjectSet(value);
|
|
1498
1765
|
}
|
|
1499
1766
|
break;
|
|
1500
1767
|
}
|
|
@@ -1535,16 +1802,16 @@ async function toDataValueQueries(value, client, desiredType) {
|
|
|
1535
1802
|
|
|
1536
1803
|
// src/queries/applyQuery.ts
|
|
1537
1804
|
async function applyQuery(client, query, params) {
|
|
1538
|
-
const qd =
|
|
1539
|
-
const response = await
|
|
1805
|
+
const qd = client.ontologyProvider.getQueryDefinition(query.apiName, query.isFixedVersion ? query.version : void 0);
|
|
1806
|
+
const response = await chunk6L3MX4LH_cjs.Query_exports.execute(chunk6L3MX4LH_cjs.addUserAgentAndRequestContextHeaders(chunk6L3MX4LH_cjs.augmentRequestContext(client, (_) => ({
|
|
1540
1807
|
finalMethodCall: "applyQuery"
|
|
1541
1808
|
})), query), await client.ontologyRid, query.apiName, {
|
|
1542
|
-
parameters: params ? await remapQueryParams(params, client, qd.parameters) : {}
|
|
1809
|
+
parameters: params ? await remapQueryParams(params, client, (await qd).parameters) : {}
|
|
1543
1810
|
}, {
|
|
1544
1811
|
version: query.isFixedVersion ? query.version : void 0
|
|
1545
1812
|
});
|
|
1546
|
-
const objectOutputDefs = await getRequiredDefinitions(qd.output, client);
|
|
1547
|
-
const remappedResponse = await remapQueryResponse(client, qd.output, response.value, objectOutputDefs);
|
|
1813
|
+
const objectOutputDefs = await getRequiredDefinitions((await qd).output, client);
|
|
1814
|
+
const remappedResponse = await remapQueryResponse(client, (await qd).output, response.value, objectOutputDefs);
|
|
1548
1815
|
return remappedResponse;
|
|
1549
1816
|
}
|
|
1550
1817
|
async function remapQueryParams(params, client, paramTypes) {
|
|
@@ -1583,7 +1850,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
1583
1850
|
return responseValue;
|
|
1584
1851
|
}
|
|
1585
1852
|
case "attachment": {
|
|
1586
|
-
return
|
|
1853
|
+
return chunk6L3MX4LH_cjs.hydrateAttachmentFromRidInternal(client, responseValue);
|
|
1587
1854
|
}
|
|
1588
1855
|
case "object": {
|
|
1589
1856
|
const def = definitions.get(responseDataType.object);
|
|
@@ -1605,7 +1872,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
1605
1872
|
throw new Error(`Missing definition for ${responseDataType.objectSet}`);
|
|
1606
1873
|
}
|
|
1607
1874
|
if (typeof responseValue === "string") {
|
|
1608
|
-
return
|
|
1875
|
+
return chunk6L3MX4LH_cjs.createObjectSet(def, client, {
|
|
1609
1876
|
type: "intersect",
|
|
1610
1877
|
objectSets: [{
|
|
1611
1878
|
type: "base",
|
|
@@ -1616,7 +1883,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
1616
1883
|
}]
|
|
1617
1884
|
});
|
|
1618
1885
|
}
|
|
1619
|
-
return
|
|
1886
|
+
return chunk6L3MX4LH_cjs.createObjectSet(def, client, responseValue);
|
|
1620
1887
|
}
|
|
1621
1888
|
case "struct": {
|
|
1622
1889
|
for (const [key, subtype] of Object.entries(responseDataType.struct)) {
|
|
@@ -1802,8 +2069,9 @@ function createClientInternal(objectSetFactory, transactionRid, baseUrl, ontolog
|
|
|
1802
2069
|
ontologyRid
|
|
1803
2070
|
}, baseUrl, tokenProvider, {
|
|
1804
2071
|
...options,
|
|
1805
|
-
logger: options?.logger ?? new
|
|
1806
|
-
transactionRid
|
|
2072
|
+
logger: options?.logger ?? new chunk6L3MX4LH_cjs.MinimalLogger(),
|
|
2073
|
+
transactionRid,
|
|
2074
|
+
branch: options?.branch
|
|
1807
2075
|
}, fetchFn, objectSetFactory);
|
|
1808
2076
|
return createClientFromContext(clientCtx);
|
|
1809
2077
|
}
|
|
@@ -1824,7 +2092,7 @@ function createClientFromContext(clientCtx) {
|
|
|
1824
2092
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid.name:
|
|
1825
2093
|
return {
|
|
1826
2094
|
fetchOneByRid: async (objectType, rid, options) => {
|
|
1827
|
-
return await
|
|
2095
|
+
return await chunk6L3MX4LH_cjs.fetchSingle(clientCtx, objectType, options, createWithRid([rid]));
|
|
1828
2096
|
}
|
|
1829
2097
|
};
|
|
1830
2098
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference.name:
|
|
@@ -1836,7 +2104,7 @@ function createClientFromContext(clientCtx) {
|
|
|
1836
2104
|
objectType,
|
|
1837
2105
|
propertyType
|
|
1838
2106
|
} = args;
|
|
1839
|
-
return await
|
|
2107
|
+
return await chunk6L3MX4LH_cjs.MediaReferenceProperty_exports.upload(clientCtx, await clientCtx.ontologyRid, objectType.apiName, propertyType, data, {
|
|
1840
2108
|
mediaItemPath: fileName,
|
|
1841
2109
|
preview: true
|
|
1842
2110
|
});
|
|
@@ -1845,10 +2113,10 @@ function createClientFromContext(clientCtx) {
|
|
|
1845
2113
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid.name:
|
|
1846
2114
|
return {
|
|
1847
2115
|
fetchPageByRid: async (objectOrInterfaceType, rids, options = {}) => {
|
|
1848
|
-
return await
|
|
2116
|
+
return await chunk6L3MX4LH_cjs.fetchPage(clientCtx, objectOrInterfaceType, options, createWithRid(rids));
|
|
1849
2117
|
},
|
|
1850
2118
|
fetchPageByRidNoType: async (rids, options) => {
|
|
1851
|
-
return await
|
|
2119
|
+
return await chunk6L3MX4LH_cjs.fetchStaticRidPage(clientCtx, rids, options ?? {});
|
|
1852
2120
|
}
|
|
1853
2121
|
};
|
|
1854
2122
|
}
|
|
@@ -1860,13 +2128,13 @@ function createClientFromContext(clientCtx) {
|
|
|
1860
2128
|
const fetchMetadata = fetchMetadataInternal.bind(void 0, clientCtx);
|
|
1861
2129
|
const symbolClientContext2 = "__osdkClientContext";
|
|
1862
2130
|
const client = Object.defineProperties(clientFn, {
|
|
1863
|
-
[
|
|
2131
|
+
[chunk6L3MX4LH_cjs.symbolClientContext]: {
|
|
1864
2132
|
value: clientCtx
|
|
1865
2133
|
},
|
|
1866
2134
|
[symbolClientContext2]: {
|
|
1867
2135
|
value: clientCtx
|
|
1868
2136
|
},
|
|
1869
|
-
[
|
|
2137
|
+
[chunk6L3MX4LH_cjs.additionalContext]: {
|
|
1870
2138
|
value: clientCtx
|
|
1871
2139
|
},
|
|
1872
2140
|
fetchMetadata: {
|
|
@@ -1875,8 +2143,8 @@ function createClientFromContext(clientCtx) {
|
|
|
1875
2143
|
});
|
|
1876
2144
|
return client;
|
|
1877
2145
|
}
|
|
1878
|
-
var createClient = createClientInternal.bind(void 0,
|
|
1879
|
-
var createClientWithTransaction = (transactionRid, ...args) => createClientInternal(
|
|
2146
|
+
var createClient = createClientInternal.bind(void 0, chunk6L3MX4LH_cjs.createObjectSet, void 0);
|
|
2147
|
+
var createClientWithTransaction = (transactionRid, ...args) => createClientInternal(chunk6L3MX4LH_cjs.createObjectSet, transactionRid, ...args);
|
|
1880
2148
|
function createWithRid(rids) {
|
|
1881
2149
|
const withRid = {
|
|
1882
2150
|
type: "static",
|
|
@@ -1895,5 +2163,6 @@ exports.createClient = createClient;
|
|
|
1895
2163
|
exports.createClientFromContext = createClientFromContext;
|
|
1896
2164
|
exports.createClientWithTransaction = createClientWithTransaction;
|
|
1897
2165
|
exports.createObjectSpecifierFromPrimaryKey = createObjectSpecifierFromPrimaryKey;
|
|
1898
|
-
|
|
1899
|
-
//# sourceMappingURL=chunk-
|
|
2166
|
+
exports.extractPrimaryKeyFromObjectSpecifier = extractPrimaryKeyFromObjectSpecifier;
|
|
2167
|
+
//# sourceMappingURL=chunk-X7WMWKLM.cjs.map
|
|
2168
|
+
//# sourceMappingURL=chunk-X7WMWKLM.cjs.map
|