@osdk/client 2.7.0-rc.15 → 2.8.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +0 -105
- 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 +1 -0
- package/build/browser/createMinimalClient.js.map +1 -1
- package/build/browser/derivedProperties/createWithPropertiesObjectSet.js +17 -1
- package/build/browser/derivedProperties/createWithPropertiesObjectSet.js.map +1 -1
- package/build/browser/fetchMetadata.test.js +9 -0
- package/build/browser/fetchMetadata.test.js.map +1 -1
- package/build/browser/intellisense.test.js +1 -1
- package/build/browser/intellisense.test.js.map +1 -1
- package/build/browser/object/aggregate.js +1 -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/InternalSymbols.js +3 -0
- package/build/browser/object/convertWireToOsdkObjects/InternalSymbols.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 +85 -3
- package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects.js +4 -4
- package/build/browser/object/convertWireToOsdkObjects.js.map +1 -1
- package/build/browser/object/convertWireToOsdkObjects.test.js +48 -27
- package/build/browser/object/convertWireToOsdkObjects.test.js.map +1 -1
- package/build/browser/object/fetchPage.js +18 -5
- package/build/browser/object/fetchPage.js.map +1 -1
- package/build/browser/object/object.test.js +123 -0
- package/build/browser/object/object.test.js.map +1 -1
- package/build/browser/objectSet/ObjectSet.test.js +6 -6
- package/build/browser/objectSet/ObjectSet.test.js.map +1 -1
- package/build/browser/objectSet/ObjectSetListenerWebsocket.js +2 -2
- package/build/browser/objectSet/ObjectSetListenerWebsocket.js.map +1 -1
- package/build/browser/objectSet/ObjectSetListenerWebsocket.test.js +3 -1
- package/build/browser/objectSet/ObjectSetListenerWebsocket.test.js.map +1 -1
- package/build/browser/objectSet/createObjectSet.js.map +1 -1
- package/build/browser/objectSet/fetchLinksPage.js +1 -0
- package/build/browser/objectSet/fetchLinksPage.js.map +1 -1
- package/build/browser/observable/internal/Store.test.js +1 -0
- package/build/browser/observable/internal/Store.test.js.map +1 -1
- package/build/browser/observable/internal/actions/OptimisticJob.js +1 -1
- package/build/browser/observable/internal/actions/OptimisticJob.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/util/UserAgent.js +2 -2
- package/build/browser/util/UserAgent.js.map +1 -1
- package/build/cjs/{chunk-CDUYWOVQ.cjs → chunk-7543GRIE.cjs} +185 -91
- package/build/cjs/chunk-7543GRIE.cjs.map +1 -0
- package/build/cjs/{chunk-Y362HOIZ.cjs → chunk-VVKEXIIO.cjs} +97 -65
- package/build/cjs/chunk-VVKEXIIO.cjs.map +1 -0
- package/build/cjs/{createClient-BDmrDOzZ.d.cts → createClient-BPK4om7e.d.cts} +1 -0
- package/build/cjs/index.cjs +8 -8
- package/build/cjs/index.d.cts +1 -1
- package/build/cjs/public/internal.cjs +8 -8
- package/build/cjs/public/unstable-do-not-use.cjs +53 -53
- package/build/cjs/public/unstable-do-not-use.cjs.map +1 -1
- package/build/cjs/public/unstable-do-not-use.d.cts +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 +1 -0
- package/build/esm/createMinimalClient.js.map +1 -1
- package/build/esm/derivedProperties/createWithPropertiesObjectSet.js +17 -1
- package/build/esm/derivedProperties/createWithPropertiesObjectSet.js.map +1 -1
- package/build/esm/fetchMetadata.test.js +9 -0
- package/build/esm/fetchMetadata.test.js.map +1 -1
- package/build/esm/intellisense.test.js +1 -1
- package/build/esm/intellisense.test.js.map +1 -1
- package/build/esm/object/aggregate.js +1 -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/InternalSymbols.js +3 -0
- package/build/esm/object/convertWireToOsdkObjects/InternalSymbols.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 +85 -3
- package/build/esm/object/convertWireToOsdkObjects/createOsdkObject.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects.js +4 -4
- package/build/esm/object/convertWireToOsdkObjects.js.map +1 -1
- package/build/esm/object/convertWireToOsdkObjects.test.js +48 -27
- package/build/esm/object/convertWireToOsdkObjects.test.js.map +1 -1
- package/build/esm/object/fetchPage.js +18 -5
- package/build/esm/object/fetchPage.js.map +1 -1
- package/build/esm/object/object.test.js +123 -0
- package/build/esm/object/object.test.js.map +1 -1
- package/build/esm/objectSet/ObjectSet.test.js +6 -6
- package/build/esm/objectSet/ObjectSet.test.js.map +1 -1
- package/build/esm/objectSet/ObjectSetListenerWebsocket.js +2 -2
- package/build/esm/objectSet/ObjectSetListenerWebsocket.js.map +1 -1
- package/build/esm/objectSet/ObjectSetListenerWebsocket.test.js +3 -1
- package/build/esm/objectSet/ObjectSetListenerWebsocket.test.js.map +1 -1
- package/build/esm/objectSet/createObjectSet.js.map +1 -1
- package/build/esm/objectSet/fetchLinksPage.js +1 -0
- package/build/esm/objectSet/fetchLinksPage.js.map +1 -1
- package/build/esm/observable/internal/Store.test.js +1 -0
- package/build/esm/observable/internal/Store.test.js.map +1 -1
- package/build/esm/observable/internal/actions/OptimisticJob.js +1 -1
- package/build/esm/observable/internal/actions/OptimisticJob.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/util/UserAgent.js +2 -2
- package/build/esm/util/UserAgent.js.map +1 -1
- package/build/types/MinimalClientContext.d.ts +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/object/convertWireToOsdkObjects/InternalSymbols.d.ts +2 -0
- package/build/types/object/convertWireToOsdkObjects/InternalSymbols.d.ts.map +1 -1
- package/build/types/object/convertWireToOsdkObjects.d.ts +4 -4
- package/build/types/object/convertWireToOsdkObjects.d.ts.map +1 -1
- package/build/types/object/fetchPage.d.ts.map +1 -1
- package/build/types/object/object.test.d.ts.map +1 -1
- package/build/types/objectSet/createObjectSet.d.ts +1 -14
- package/build/types/objectSet/createObjectSet.d.ts.map +1 -1
- package/build/types/objectSet/fetchLinksPage.d.ts +1 -9
- package/build/types/objectSet/fetchLinksPage.d.ts.map +1 -1
- package/build/types/observable/internal/Store.test.d.ts.map +1 -1
- package/build/types/observable/internal/actions/OptimisticJob.d.ts.map +1 -1
- package/package.json +14 -14
- package/build/cjs/chunk-CDUYWOVQ.cjs.map +0 -1
- package/build/cjs/chunk-Y362HOIZ.cjs.map +0 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkVVKEXIIO_cjs = require('./chunk-VVKEXIIO.cjs');
|
|
4
4
|
var chunkLDTMSHUZ_cjs = require('./chunk-LDTMSHUZ.cjs');
|
|
5
5
|
var unstable = require('@osdk/api/unstable');
|
|
6
6
|
var client_unstable = require('@osdk/client.unstable');
|
|
7
|
-
var
|
|
7
|
+
var invariant3 = require('tiny-invariant');
|
|
8
8
|
var shared_client_impl = require('@osdk/shared.client.impl');
|
|
9
9
|
var api = require('@osdk/api');
|
|
10
10
|
var generatorConverters = require('@osdk/generator-converters');
|
|
11
11
|
|
|
12
12
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var invariant3__default = /*#__PURE__*/_interopDefault(invariant3);
|
|
15
15
|
|
|
16
16
|
// src/actions/ActionValidationError.ts
|
|
17
17
|
chunkLDTMSHUZ_cjs.init_cjs_shims();
|
|
@@ -159,7 +159,7 @@ function createSimpleAsyncCache(type, fn, createCacheLocal = createSimpleCache)
|
|
|
159
159
|
var cachedAllOntologies;
|
|
160
160
|
async function getOntologyVersionForRid(ctx, ontologyRid) {
|
|
161
161
|
cachedAllOntologies ??= await client_unstable.loadAllOntologies(ctx, {});
|
|
162
|
-
!cachedAllOntologies.ontologies[ontologyRid] ? process.env.NODE_ENV !== "production" ?
|
|
162
|
+
!cachedAllOntologies.ontologies[ontologyRid] ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "ontology should be loaded") : invariant3__default.default(false) : void 0;
|
|
163
163
|
return cachedAllOntologies.ontologies[ontologyRid].currentOntologyVersion;
|
|
164
164
|
}
|
|
165
165
|
var strongMemoAsync = (fn) => createSimpleAsyncCache("strong", fn).get;
|
|
@@ -201,7 +201,7 @@ var MetadataClient = class {
|
|
|
201
201
|
[objectTypeRid]: await this.ontologyVersion("")
|
|
202
202
|
}
|
|
203
203
|
});
|
|
204
|
-
!linkTypes.linkTypes[objectTypeRid] ? process.env.NODE_ENV !== "production" ?
|
|
204
|
+
!linkTypes.linkTypes[objectTypeRid] ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "link type should be loaded") : invariant3__default.default(false) : void 0;
|
|
205
205
|
const ret = {};
|
|
206
206
|
for (const l of linkTypes.linkTypes[objectTypeRid]) {
|
|
207
207
|
const helper = ({
|
|
@@ -279,14 +279,14 @@ var MetadataClient = class {
|
|
|
279
279
|
entityMetadata: void 0
|
|
280
280
|
};
|
|
281
281
|
const entities = await client_unstable.bulkLoadOntologyEntities(this.#ctx, void 0, body);
|
|
282
|
-
!entities.objectTypes[0]?.objectType ? process.env.NODE_ENV !== "production" ?
|
|
282
|
+
!entities.objectTypes[0]?.objectType ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "object type should be loaded") : invariant3__default.default(false) : void 0;
|
|
283
283
|
return entities.objectTypes[0].objectType;
|
|
284
284
|
});
|
|
285
285
|
ontologyVersion = strongMemoAsync(async (_) => getOntologyVersionForRid(this.#ctx, await this.#client.ontologyRid));
|
|
286
286
|
};
|
|
287
287
|
var metadataCacheClient = weakMemoAsync((client) => Promise.resolve(new MetadataClient(client)));
|
|
288
288
|
function createObjectPropertyMapping(conjureOT) {
|
|
289
|
-
!(conjureOT.primaryKeys.length === 1) ? process.env.NODE_ENV !== "production" ?
|
|
289
|
+
!(conjureOT.primaryKeys.length === 1) ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, `only one primary key supported, got ${conjureOT.primaryKeys.length}`) : invariant3__default.default(false) : void 0;
|
|
290
290
|
const pkRid = conjureOT.primaryKeys[0];
|
|
291
291
|
const pkProperty = Object.values(conjureOT.propertyTypes).find((a) => a.rid === pkRid);
|
|
292
292
|
if (!pkProperty) {
|
|
@@ -318,7 +318,7 @@ function createBulkLinksAsyncIterFactory(ctx) {
|
|
|
318
318
|
return;
|
|
319
319
|
}
|
|
320
320
|
ctx.logger?.debug("Preparing to fetch bulk links");
|
|
321
|
-
!objs.every((a) => a.$objectType === objs[0].$objectType) ? process.env.NODE_ENV !== "production" ?
|
|
321
|
+
!objs.every((a) => a.$objectType === objs[0].$objectType) ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false) : invariant3__default.default(false) : void 0;
|
|
322
322
|
const mcc = await metadataCacheClient(ctx);
|
|
323
323
|
const helper = await mcc.forObjectByApiName(objs[0].$objectType);
|
|
324
324
|
const [objectTypeRid, propertyMapping, fullLinkMapping] = await Promise.all([helper.getRid(), helper.getPropertyMapping(), helper.getLinkMapping()]);
|
|
@@ -414,10 +414,10 @@ chunkLDTMSHUZ_cjs.init_cjs_shims();
|
|
|
414
414
|
// src/util/toDataValue.ts
|
|
415
415
|
chunkLDTMSHUZ_cjs.init_cjs_shims();
|
|
416
416
|
|
|
417
|
-
// ../../node_modules/.pnpm/@osdk+foundry.mediasets@2.
|
|
417
|
+
// ../../node_modules/.pnpm/@osdk+foundry.mediasets@2.45.0/node_modules/@osdk/foundry.mediasets/build/esm/index.js
|
|
418
418
|
chunkLDTMSHUZ_cjs.init_cjs_shims();
|
|
419
419
|
|
|
420
|
-
// ../../node_modules/.pnpm/@osdk+foundry.mediasets@2.
|
|
420
|
+
// ../../node_modules/.pnpm/@osdk+foundry.mediasets@2.45.0/node_modules/@osdk/foundry.mediasets/build/esm/public/MediaSet.js
|
|
421
421
|
var MediaSet_exports = {};
|
|
422
422
|
chunkLDTMSHUZ_cjs.__export(MediaSet_exports, {
|
|
423
423
|
abort: () => abort,
|
|
@@ -436,51 +436,51 @@ chunkLDTMSHUZ_cjs.__export(MediaSet_exports, {
|
|
|
436
436
|
chunkLDTMSHUZ_cjs.init_cjs_shims();
|
|
437
437
|
var _abort = [1, "/v2/mediasets/{0}/transactions/{1}/abort", 2];
|
|
438
438
|
function abort($ctx, ...args) {
|
|
439
|
-
return
|
|
439
|
+
return chunkVVKEXIIO_cjs.foundryPlatformFetch($ctx, _abort, ...args);
|
|
440
440
|
}
|
|
441
441
|
var _calculate = [0, "/v2/mediasets/{0}/items/{1}/transform/imagery/thumbnail/calculate", 6];
|
|
442
442
|
function calculate($ctx, ...args) {
|
|
443
|
-
return
|
|
443
|
+
return chunkVVKEXIIO_cjs.foundryPlatformFetch($ctx, _calculate, ...args);
|
|
444
444
|
}
|
|
445
445
|
var _commit = [1, "/v2/mediasets/{0}/transactions/{1}/commit", 2];
|
|
446
446
|
function commit($ctx, ...args) {
|
|
447
|
-
return
|
|
447
|
+
return chunkVVKEXIIO_cjs.foundryPlatformFetch($ctx, _commit, ...args);
|
|
448
448
|
}
|
|
449
449
|
var _create = [1, "/v2/mediasets/{0}/transactions", 2];
|
|
450
450
|
function create($ctx, ...args) {
|
|
451
|
-
return
|
|
451
|
+
return chunkVVKEXIIO_cjs.foundryPlatformFetch($ctx, _create, ...args);
|
|
452
452
|
}
|
|
453
453
|
var _info = [0, "/v2/mediasets/{0}/items/{1}", 6];
|
|
454
454
|
function info($ctx, ...args) {
|
|
455
|
-
return
|
|
455
|
+
return chunkVVKEXIIO_cjs.foundryPlatformFetch($ctx, _info, ...args);
|
|
456
456
|
}
|
|
457
457
|
var _reference = [0, "/v2/mediasets/{0}/items/{1}/reference", 6];
|
|
458
458
|
function reference($ctx, ...args) {
|
|
459
|
-
return
|
|
459
|
+
return chunkVVKEXIIO_cjs.foundryPlatformFetch($ctx, _reference, ...args);
|
|
460
460
|
}
|
|
461
461
|
var _getRidByPath = [0, "/v2/mediasets/{0}/items/getRidByPath", 2];
|
|
462
462
|
function getRidByPath($ctx, ...args) {
|
|
463
|
-
return
|
|
463
|
+
return chunkVVKEXIIO_cjs.foundryPlatformFetch($ctx, _getRidByPath, ...args);
|
|
464
464
|
}
|
|
465
465
|
var _upload = [1, "/v2/mediasets/{0}/items", 3, "*/*"];
|
|
466
466
|
function upload($ctx, ...args) {
|
|
467
|
-
return
|
|
467
|
+
return chunkVVKEXIIO_cjs.foundryPlatformFetch($ctx, _upload, ...args);
|
|
468
468
|
}
|
|
469
469
|
var _read = [0, "/v2/mediasets/{0}/items/{1}/content", 6, , "*/*"];
|
|
470
470
|
function read($ctx, ...args) {
|
|
471
|
-
return
|
|
471
|
+
return chunkVVKEXIIO_cjs.foundryPlatformFetch($ctx, _read, ...args);
|
|
472
472
|
}
|
|
473
473
|
var _readOriginal = [0, "/v2/mediasets/{0}/items/{1}/original", 6, , "*/*"];
|
|
474
474
|
function readOriginal($ctx, ...args) {
|
|
475
|
-
return
|
|
475
|
+
return chunkVVKEXIIO_cjs.foundryPlatformFetch($ctx, _readOriginal, ...args);
|
|
476
476
|
}
|
|
477
477
|
var _retrieve = [0, "/v2/mediasets/{0}/items/{1}/transform/imagery/thumbnail/retrieve", 6, , "*/*"];
|
|
478
478
|
function retrieve($ctx, ...args) {
|
|
479
|
-
return
|
|
479
|
+
return chunkVVKEXIIO_cjs.foundryPlatformFetch($ctx, _retrieve, ...args);
|
|
480
480
|
}
|
|
481
481
|
var _uploadMedia = [2, "/v2/mediasets/media/upload", 7, "*/*"];
|
|
482
482
|
function uploadMedia($ctx, ...args) {
|
|
483
|
-
return
|
|
483
|
+
return chunkVVKEXIIO_cjs.foundryPlatformFetch($ctx, _uploadMedia, ...args);
|
|
484
484
|
}
|
|
485
485
|
|
|
486
486
|
// src/object/mediaUpload.ts
|
|
@@ -540,13 +540,13 @@ async function toDataValue(value, client, actionMetadata) {
|
|
|
540
540
|
return Promise.all(promiseArray);
|
|
541
541
|
}
|
|
542
542
|
if (isAttachmentUpload(value)) {
|
|
543
|
-
const attachment = await
|
|
543
|
+
const attachment = await chunkVVKEXIIO_cjs.Attachment_exports.upload(client, value.data, {
|
|
544
544
|
filename: value.name
|
|
545
545
|
});
|
|
546
546
|
return await toDataValue(attachment.rid, client);
|
|
547
547
|
}
|
|
548
548
|
if (isAttachmentFile(value)) {
|
|
549
|
-
const attachment = await
|
|
549
|
+
const attachment = await chunkVVKEXIIO_cjs.Attachment_exports.upload(client, value, {
|
|
550
550
|
filename: value.name
|
|
551
551
|
});
|
|
552
552
|
return await toDataValue(attachment.rid, client);
|
|
@@ -567,11 +567,11 @@ async function toDataValue(value, client, actionMetadata) {
|
|
|
567
567
|
if (isPoint(value)) {
|
|
568
568
|
return await toDataValue(`${value.coordinates[1]},${value.coordinates[0]}`, client);
|
|
569
569
|
}
|
|
570
|
-
if (
|
|
570
|
+
if (chunkVVKEXIIO_cjs.isWireObjectSet(value)) {
|
|
571
571
|
return value;
|
|
572
572
|
}
|
|
573
|
-
if (
|
|
574
|
-
return
|
|
573
|
+
if (chunkVVKEXIIO_cjs.isObjectSet(value)) {
|
|
574
|
+
return chunkVVKEXIIO_cjs.getWireObjectSet(value);
|
|
575
575
|
}
|
|
576
576
|
if (isMediaReference(value)) {
|
|
577
577
|
return value;
|
|
@@ -594,25 +594,29 @@ async function toDataValue(value, client, actionMetadata) {
|
|
|
594
594
|
|
|
595
595
|
// src/actions/applyAction.ts
|
|
596
596
|
async function applyAction(client, action, parameters, options = {}) {
|
|
597
|
-
const clientWithHeaders =
|
|
597
|
+
const clientWithHeaders = chunkVVKEXIIO_cjs.addUserAgentAndRequestContextHeaders(chunkVVKEXIIO_cjs.augmentRequestContext(client, (_) => ({
|
|
598
598
|
finalMethodCall: "applyAction"
|
|
599
599
|
})), action);
|
|
600
600
|
if (Array.isArray(parameters)) {
|
|
601
|
-
const response = await
|
|
601
|
+
const response = await chunkVVKEXIIO_cjs.Action_exports.applyBatch(clientWithHeaders, await client.ontologyRid, action.apiName, {
|
|
602
602
|
requests: parameters ? await remapBatchActionParams(parameters, client, await client.ontologyProvider.getActionDefinition(action.apiName)) : [],
|
|
603
603
|
options: {
|
|
604
604
|
returnEdits: options?.$returnEdits ? "ALL" : "NONE"
|
|
605
605
|
}
|
|
606
|
+
}, {
|
|
607
|
+
branch: client.branch
|
|
606
608
|
});
|
|
607
609
|
const edits = response.edits;
|
|
608
610
|
return options?.$returnEdits ? edits?.type === "edits" ? remapActionResponse(response) : edits : void 0;
|
|
609
611
|
} else {
|
|
610
|
-
const response = await
|
|
612
|
+
const response = await chunkVVKEXIIO_cjs.Action_exports.apply(clientWithHeaders, await client.ontologyRid, action.apiName, {
|
|
611
613
|
parameters: await remapActionParams(parameters, client, await client.ontologyProvider.getActionDefinition(action.apiName)),
|
|
612
614
|
options: {
|
|
613
615
|
mode: options?.$validateOnly ? "VALIDATE_ONLY" : "VALIDATE_AND_EXECUTE",
|
|
614
616
|
returnEdits: options?.$returnEdits ? "ALL_V2_WITH_DELETIONS" : "NONE"
|
|
615
617
|
}
|
|
618
|
+
}, {
|
|
619
|
+
branch: client.branch
|
|
616
620
|
});
|
|
617
621
|
if (options?.$validateOnly) {
|
|
618
622
|
return response.validation;
|
|
@@ -828,7 +832,7 @@ var GeotimeSeriesPropertyImpl = class {
|
|
|
828
832
|
}
|
|
829
833
|
}
|
|
830
834
|
async getLatestValue() {
|
|
831
|
-
const latestPointPromise =
|
|
835
|
+
const latestPointPromise = chunkVVKEXIIO_cjs.TimeSeriesValueBankProperty_exports.getLatestValue(this.#client, await this.#client.ontologyRid, ...this.#triplet);
|
|
832
836
|
latestPointPromise.then(
|
|
833
837
|
(latestPoint) => this.lastFetchedValue = latestPoint,
|
|
834
838
|
// eslint-disable-next-line no-console
|
|
@@ -844,7 +848,7 @@ var GeotimeSeriesPropertyImpl = class {
|
|
|
844
848
|
return allPoints;
|
|
845
849
|
}
|
|
846
850
|
async *asyncIterValues(query) {
|
|
847
|
-
const streamPointsIterator = await
|
|
851
|
+
const streamPointsIterator = await chunkVVKEXIIO_cjs.TimeSeriesValueBankProperty_exports.streamValues(this.#client, await this.#client.ontologyRid, ...this.#triplet, query ? {
|
|
848
852
|
range: getTimeRange(query)
|
|
849
853
|
} : {});
|
|
850
854
|
for await (const timeseriesPoint of asyncIterPointsHelper(streamPointsIterator)) {
|
|
@@ -872,13 +876,13 @@ var MediaReferencePropertyImpl = class {
|
|
|
872
876
|
this.#mediaReference = mediaReference;
|
|
873
877
|
}
|
|
874
878
|
async fetchContents() {
|
|
875
|
-
return
|
|
879
|
+
return chunkVVKEXIIO_cjs.MediaReferenceProperty_exports.getMediaContent(this.#client, await this.#client.ontologyRid, ...this.#triplet, {
|
|
876
880
|
preview: true
|
|
877
881
|
// TODO: Can turn this back off when backend is no longer in beta.
|
|
878
882
|
});
|
|
879
883
|
}
|
|
880
884
|
async fetchMetadata() {
|
|
881
|
-
const r = await
|
|
885
|
+
const r = await chunkVVKEXIIO_cjs.MediaReferenceProperty_exports.getMediaMetadata(this.#client, await this.#client.ontologyRid, ...this.#triplet, {
|
|
882
886
|
preview: true
|
|
883
887
|
// TODO: Can turn this back off when backend is no longer in beta.
|
|
884
888
|
});
|
|
@@ -903,10 +907,10 @@ var TimeSeriesPropertyImpl = class {
|
|
|
903
907
|
this.#triplet = [objectApiName, primaryKey, propertyName];
|
|
904
908
|
}
|
|
905
909
|
async getFirstPoint() {
|
|
906
|
-
return
|
|
910
|
+
return chunkVVKEXIIO_cjs.TimeSeriesPropertyV2_exports.getFirstPoint(this.#client, await this.#client.ontologyRid, ...this.#triplet);
|
|
907
911
|
}
|
|
908
912
|
async getLastPoint() {
|
|
909
|
-
return
|
|
913
|
+
return chunkVVKEXIIO_cjs.TimeSeriesPropertyV2_exports.getLastPoint(this.#client, await this.#client.ontologyRid, ...this.#triplet);
|
|
910
914
|
}
|
|
911
915
|
async getAllPoints(query) {
|
|
912
916
|
const allPoints = [];
|
|
@@ -916,7 +920,7 @@ var TimeSeriesPropertyImpl = class {
|
|
|
916
920
|
return allPoints;
|
|
917
921
|
}
|
|
918
922
|
async *asyncIterPoints(query) {
|
|
919
|
-
const streamPointsIterator = await
|
|
923
|
+
const streamPointsIterator = await chunkVVKEXIIO_cjs.TimeSeriesPropertyV2_exports.streamPoints(this.#client, await this.#client.ontologyRid, ...this.#triplet, query ? {
|
|
920
924
|
range: getTimeRange(query)
|
|
921
925
|
} : {});
|
|
922
926
|
for await (const timeseriesPoint of asyncIterPointsHelper(streamPointsIterator)) {
|
|
@@ -1321,6 +1325,7 @@ var UnderlyingOsdkObject = Symbol("Underlying Object" );
|
|
|
1321
1325
|
var ObjectDefRef = Symbol("ObjectDefinition" );
|
|
1322
1326
|
var InterfaceDefRef = Symbol("InterfaceDefinition" );
|
|
1323
1327
|
var ClientRef = Symbol("ClientRef" );
|
|
1328
|
+
var PropertySecuritiesRef = Symbol("Property Securities" );
|
|
1324
1329
|
|
|
1325
1330
|
// src/object/convertWireToOsdkObjects/getDollarLink.ts
|
|
1326
1331
|
function get$link(holder) {
|
|
@@ -1333,8 +1338,8 @@ function get$link(holder) {
|
|
|
1333
1338
|
[objDef.primaryKeyApiName]: rawObj.$primaryKey
|
|
1334
1339
|
}).pivotTo(linkName);
|
|
1335
1340
|
const value = !linkDef.multiplicity ? {
|
|
1336
|
-
fetchOne: (options) =>
|
|
1337
|
-
fetchOneWithErrors: (options) =>
|
|
1341
|
+
fetchOne: (options) => chunkVVKEXIIO_cjs.fetchSingle(client, objDef, options ?? {}, chunkVVKEXIIO_cjs.getWireObjectSet(objectSet)),
|
|
1342
|
+
fetchOneWithErrors: (options) => chunkVVKEXIIO_cjs.fetchSingleWithErrors(client, objDef, options ?? {}, chunkVVKEXIIO_cjs.getWireObjectSet(objectSet))
|
|
1338
1343
|
} : objectSet;
|
|
1339
1344
|
return [linkName, value];
|
|
1340
1345
|
})));
|
|
@@ -1350,8 +1355,8 @@ function get$linkForInterface(holder) {
|
|
|
1350
1355
|
[objDef.primaryKeyApiName]: rawObj.$primaryKey
|
|
1351
1356
|
})).pivotTo(linkName);
|
|
1352
1357
|
const value = !linkDef.multiplicity ? {
|
|
1353
|
-
fetchOne: (options) =>
|
|
1354
|
-
fetchOneWithErrors: (options) =>
|
|
1358
|
+
fetchOne: (options) => chunkVVKEXIIO_cjs.fetchSingle(client, objDef, options ?? {}, chunkVVKEXIIO_cjs.getWireObjectSet(objectSet)),
|
|
1359
|
+
fetchOneWithErrors: (options) => chunkVVKEXIIO_cjs.fetchSingleWithErrors(client, objDef, options ?? {}, chunkVVKEXIIO_cjs.getWireObjectSet(objectSet))
|
|
1355
1360
|
} : objectSet;
|
|
1356
1361
|
return [linkName, value];
|
|
1357
1362
|
})));
|
|
@@ -1359,7 +1364,7 @@ function get$linkForInterface(holder) {
|
|
|
1359
1364
|
|
|
1360
1365
|
// src/object/convertWireToOsdkObjects/createOsdkInterface.ts
|
|
1361
1366
|
function createOsdkInterface(underlying, interfaceDef) {
|
|
1362
|
-
const [objApiNamespace] =
|
|
1367
|
+
const [objApiNamespace] = chunkVVKEXIIO_cjs.extractNamespace(interfaceDef.apiName);
|
|
1363
1368
|
return Object.freeze(Object.defineProperties({}, {
|
|
1364
1369
|
// first to minimize hidden classes
|
|
1365
1370
|
[UnderlyingOsdkObject]: {
|
|
@@ -1397,6 +1402,10 @@ function createOsdkInterface(underlying, interfaceDef) {
|
|
|
1397
1402
|
value: clone,
|
|
1398
1403
|
enumerable: false
|
|
1399
1404
|
},
|
|
1405
|
+
"$propertySecurities": {
|
|
1406
|
+
value: underlying.$propertySecurities,
|
|
1407
|
+
enumerable: "$propertySecurities" in underlying
|
|
1408
|
+
},
|
|
1400
1409
|
"$__EXPERIMENTAL__NOT_SUPPORTED_YET__metadata": {
|
|
1401
1410
|
value: {
|
|
1402
1411
|
"ObjectMetadata": underlying[ObjectDefRef],
|
|
@@ -1418,7 +1427,7 @@ function createOsdkInterface(underlying, interfaceDef) {
|
|
|
1418
1427
|
},
|
|
1419
1428
|
...Object.fromEntries(Object.keys(interfaceDef.properties).map((p) => {
|
|
1420
1429
|
const objDef = underlying[ObjectDefRef];
|
|
1421
|
-
const [apiNamespace, apiName] =
|
|
1430
|
+
const [apiNamespace, apiName] = chunkVVKEXIIO_cjs.extractNamespace(p);
|
|
1422
1431
|
const targetPropName = objDef.interfaceMap[interfaceDef.apiName][p];
|
|
1423
1432
|
return [apiNamespace === objApiNamespace ? apiName : p, {
|
|
1424
1433
|
enumerable: targetPropName in underlying,
|
|
@@ -1525,6 +1534,12 @@ var basePropDefs = {
|
|
|
1525
1534
|
},
|
|
1526
1535
|
enumerable: true
|
|
1527
1536
|
},
|
|
1537
|
+
"$propertySecurities": {
|
|
1538
|
+
get: function() {
|
|
1539
|
+
return this[PropertySecuritiesRef];
|
|
1540
|
+
},
|
|
1541
|
+
enumerable: true
|
|
1542
|
+
},
|
|
1528
1543
|
"$__EXPERIMENTAL__NOT_SUPPORTED_YET__metadata": {
|
|
1529
1544
|
get: function() {
|
|
1530
1545
|
return {
|
|
@@ -1543,13 +1558,21 @@ var basePropDefs = {
|
|
|
1543
1558
|
enumerable: false
|
|
1544
1559
|
}
|
|
1545
1560
|
};
|
|
1546
|
-
function createOsdkObject(client, objectDef, simpleOsdkProperties, derivedPropertyTypeByName = {}) {
|
|
1547
|
-
const
|
|
1561
|
+
function createOsdkObject(client, objectDef, simpleOsdkProperties, derivedPropertyTypeByName = {}, wirePropertySecurities = []) {
|
|
1562
|
+
const {
|
|
1563
|
+
parsedObject,
|
|
1564
|
+
clientPropertySecurities
|
|
1565
|
+
} = parseWhenSecuritiesLoaded(wirePropertySecurities, simpleOsdkProperties, objectDef, derivedPropertyTypeByName);
|
|
1566
|
+
const rawObj = parsedObject;
|
|
1548
1567
|
Object.defineProperties(rawObj, {
|
|
1549
1568
|
[UnderlyingOsdkObject]: {
|
|
1550
1569
|
enumerable: false,
|
|
1551
1570
|
value: simpleOsdkProperties
|
|
1552
1571
|
},
|
|
1572
|
+
[PropertySecuritiesRef]: {
|
|
1573
|
+
enumerable: false,
|
|
1574
|
+
value: clientPropertySecurities
|
|
1575
|
+
},
|
|
1553
1576
|
[ObjectDefRef]: {
|
|
1554
1577
|
value: objectDef,
|
|
1555
1578
|
enumerable: false
|
|
@@ -1573,18 +1596,18 @@ function createOsdkObject(client, objectDef, simpleOsdkProperties, derivedProper
|
|
|
1573
1596
|
function modifyRdpProperties(client, derivedPropertyTypeByName, rawValue, propKey) {
|
|
1574
1597
|
if (derivedPropertyTypeByName[propKey].definition.type === "selection" && derivedPropertyTypeByName[propKey].definition.operation.type === "count") {
|
|
1575
1598
|
const num = Number(rawValue);
|
|
1576
|
-
!Number.isSafeInteger(num) ? process.env.NODE_ENV !== "production" ?
|
|
1599
|
+
!Number.isSafeInteger(num) ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "Count aggregation for derived property " + propKey + " returned a value larger than safe integer.") : invariant3__default.default(false) : void 0;
|
|
1577
1600
|
return num;
|
|
1578
1601
|
} else if (derivedPropertyTypeByName[propKey].selectedOrCollectedPropertyType != null && typeof derivedPropertyTypeByName[propKey].selectedOrCollectedPropertyType.type === "string" && specialPropertyTypes.has(derivedPropertyTypeByName[propKey].selectedOrCollectedPropertyType.type)) {
|
|
1579
1602
|
switch (derivedPropertyTypeByName[propKey].selectedOrCollectedPropertyType?.type) {
|
|
1580
1603
|
case "attachment":
|
|
1581
1604
|
if (Array.isArray(rawValue)) {
|
|
1582
|
-
return rawValue.map((a) =>
|
|
1605
|
+
return rawValue.map((a) => chunkVVKEXIIO_cjs.hydrateAttachmentFromRidInternal(client, a.rid));
|
|
1583
1606
|
} else {
|
|
1584
|
-
return
|
|
1607
|
+
return chunkVVKEXIIO_cjs.hydrateAttachmentFromRidInternal(client, rawValue.rid);
|
|
1585
1608
|
}
|
|
1586
1609
|
default:
|
|
1587
|
-
process.env.NODE_ENV !== "production" ?
|
|
1610
|
+
process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "Derived property aggregations for Timeseries and Media are not supported") : invariant3__default.default(false) ;
|
|
1588
1611
|
}
|
|
1589
1612
|
}
|
|
1590
1613
|
return rawValue;
|
|
@@ -1593,13 +1616,13 @@ function createSpecialProperty(client, objectDef, rawObject, p) {
|
|
|
1593
1616
|
const rawValue = rawObject[p];
|
|
1594
1617
|
const propDef = objectDef.properties[p];
|
|
1595
1618
|
if (process.env.NODE_ENV !== "production") {
|
|
1596
|
-
!(propDef != null && typeof propDef.type === "string" && specialPropertyTypes.has(propDef.type)) ? process.env.NODE_ENV !== "production" ?
|
|
1619
|
+
!(propDef != null && typeof propDef.type === "string" && specialPropertyTypes.has(propDef.type)) ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false) : invariant3__default.default(false) : void 0;
|
|
1597
1620
|
}
|
|
1598
1621
|
if (propDef.type === "attachment") {
|
|
1599
1622
|
if (Array.isArray(rawValue)) {
|
|
1600
|
-
return rawValue.map((a) =>
|
|
1623
|
+
return rawValue.map((a) => chunkVVKEXIIO_cjs.hydrateAttachmentFromRidInternal(client, a.rid));
|
|
1601
1624
|
}
|
|
1602
|
-
return
|
|
1625
|
+
return chunkVVKEXIIO_cjs.hydrateAttachmentFromRidInternal(client, rawValue.rid);
|
|
1603
1626
|
}
|
|
1604
1627
|
if (propDef.type === "numericTimeseries" || propDef.type === "stringTimeseries" || propDef.type === "sensorTimeseries") {
|
|
1605
1628
|
return new TimeSeriesPropertyImpl(client, objectDef.apiName, rawObject[objectDef.primaryKeyApiName], p);
|
|
@@ -1623,16 +1646,81 @@ function createSpecialProperty(client, objectDef, rawObject, p) {
|
|
|
1623
1646
|
});
|
|
1624
1647
|
}
|
|
1625
1648
|
}
|
|
1649
|
+
function parseWhenSecuritiesLoaded(wirePropertySecurities, rawObject, objectDef, derivedPropertyTypeByName = {}) {
|
|
1650
|
+
if (wirePropertySecurities == null || wirePropertySecurities.length === 0) {
|
|
1651
|
+
return {
|
|
1652
|
+
parsedObject: rawObject,
|
|
1653
|
+
clientPropertySecurities: void 0
|
|
1654
|
+
};
|
|
1655
|
+
}
|
|
1656
|
+
const parsedObject = {
|
|
1657
|
+
...rawObject
|
|
1658
|
+
};
|
|
1659
|
+
const clientPropertySecurities = {};
|
|
1660
|
+
for (const propKey of Object.keys(rawObject)) {
|
|
1661
|
+
if (propKey in objectDef.properties || propKey in derivedPropertyTypeByName) {
|
|
1662
|
+
const value = rawObject[propKey];
|
|
1663
|
+
if (Array.isArray(value)) {
|
|
1664
|
+
const newVal = [];
|
|
1665
|
+
const newSecurities = [];
|
|
1666
|
+
value.forEach((spv) => {
|
|
1667
|
+
!(typeof spv === "object" && spv != null && "value" in spv && "propertySecurityIndex" in spv) ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "Expected destructured secured property value object in array") : invariant3__default.default(false) : void 0;
|
|
1668
|
+
const securedValue = spv;
|
|
1669
|
+
newVal.push(securedValue.value);
|
|
1670
|
+
const securityIndex = securedValue.propertySecurityIndex;
|
|
1671
|
+
!(securityIndex != null) ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "Expected property security index to be defined") : invariant3__default.default(false) : void 0;
|
|
1672
|
+
!(securityIndex < wirePropertySecurities.length) ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "Expected property security index to be within bounds") : invariant3__default.default(false) : void 0;
|
|
1673
|
+
newSecurities.push(wirePropertySecurities[securityIndex].disjunction.map(wireToClientPropertySecurities));
|
|
1674
|
+
});
|
|
1675
|
+
parsedObject[propKey] = newVal;
|
|
1676
|
+
clientPropertySecurities[propKey] = newSecurities;
|
|
1677
|
+
} else if (typeof value === "object" && value != null && "value" in value && "propertySecurityIndex" in value) {
|
|
1678
|
+
const securedValue = value;
|
|
1679
|
+
parsedObject[propKey] = securedValue.value;
|
|
1680
|
+
const securityIndex = securedValue.propertySecurityIndex;
|
|
1681
|
+
!(securityIndex != null) ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "Expected property security index to be defined") : invariant3__default.default(false) : void 0;
|
|
1682
|
+
!(securityIndex < wirePropertySecurities.length) ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "Expected property security index to be within bounds") : invariant3__default.default(false) : void 0;
|
|
1683
|
+
clientPropertySecurities[propKey] = wirePropertySecurities[securityIndex].disjunction.map(wireToClientPropertySecurities);
|
|
1684
|
+
} else {
|
|
1685
|
+
parsedObject[propKey] = value;
|
|
1686
|
+
}
|
|
1687
|
+
}
|
|
1688
|
+
}
|
|
1689
|
+
return {
|
|
1690
|
+
parsedObject,
|
|
1691
|
+
clientPropertySecurities
|
|
1692
|
+
};
|
|
1693
|
+
}
|
|
1694
|
+
function wireToClientPropertySecurities(propertySecurity) {
|
|
1695
|
+
switch (propertySecurity.type) {
|
|
1696
|
+
case "propertyMarkingSummary":
|
|
1697
|
+
return {
|
|
1698
|
+
type: "propertyMarkings",
|
|
1699
|
+
conjunctive: propertySecurity.conjunctive,
|
|
1700
|
+
containerConjunctive: propertySecurity.containerConjunctive,
|
|
1701
|
+
disjunctive: propertySecurity.disjunctive,
|
|
1702
|
+
containerDisjunctive: propertySecurity.containerDisjunctive
|
|
1703
|
+
};
|
|
1704
|
+
case "errorComputingSecurity":
|
|
1705
|
+
return {
|
|
1706
|
+
type: "errorComputingSecurity"
|
|
1707
|
+
};
|
|
1708
|
+
case "unsupportedPolicy":
|
|
1709
|
+
return {
|
|
1710
|
+
type: "unsupportedPolicy"
|
|
1711
|
+
};
|
|
1712
|
+
}
|
|
1713
|
+
}
|
|
1626
1714
|
|
|
1627
1715
|
// src/object/convertWireToOsdkObjects.ts
|
|
1628
|
-
async function convertWireToOsdkObjects(client, objects, interfaceApiName, forceRemoveRid = false, derivedPropertyTypesByName, selectedProps, strictNonNull = false) {
|
|
1716
|
+
async function convertWireToOsdkObjects(client, objects, interfaceApiName, forceRemoveRid = false, derivedPropertyTypesByName, propertySecurities, selectedProps, strictNonNull = false) {
|
|
1629
1717
|
fixObjectPropertiesInPlace(objects, forceRemoveRid);
|
|
1630
1718
|
const ifaceDef = interfaceApiName ? await client.ontologyProvider.getInterfaceDefinition(interfaceApiName) : void 0;
|
|
1631
1719
|
const ifaceSelected = ifaceDef ? selectedProps ?? Object.keys(ifaceDef.properties) : void 0;
|
|
1632
1720
|
const ret = [];
|
|
1633
1721
|
for (const rawObj of objects) {
|
|
1634
1722
|
const objectDef = await client.ontologyProvider.getObjectDefinition(rawObj.$apiName);
|
|
1635
|
-
!objectDef ? process.env.NODE_ENV !== "production" ?
|
|
1723
|
+
!objectDef ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, `Missing definition for '${rawObj.$apiName}'`) : invariant3__default.default(false) : void 0;
|
|
1636
1724
|
let objProps;
|
|
1637
1725
|
let conforming = true;
|
|
1638
1726
|
if (ifaceDef && ifaceSelected) {
|
|
@@ -1649,20 +1737,20 @@ async function convertWireToOsdkObjects(client, objects, interfaceApiName, force
|
|
|
1649
1737
|
} else if (strictNonNull === "drop" && !conforming) {
|
|
1650
1738
|
continue;
|
|
1651
1739
|
}
|
|
1652
|
-
let osdkObject = createOsdkObject(client, objectDef, rawObj, derivedPropertyTypesByName);
|
|
1740
|
+
let osdkObject = createOsdkObject(client, objectDef, rawObj, derivedPropertyTypesByName, propertySecurities);
|
|
1653
1741
|
if (interfaceApiName) osdkObject = osdkObject.$as(interfaceApiName);
|
|
1654
1742
|
ret.push(osdkObject);
|
|
1655
1743
|
}
|
|
1656
1744
|
return ret;
|
|
1657
1745
|
}
|
|
1658
|
-
async function convertWireToOsdkObjects2(client, objects, interfaceApiName, derivedPropertyTypeByName, forceRemoveRid = false, selectedProps, strictNonNull = false, interfaceToObjectTypeMappings = {}, interfaceToObjectTypeMappingsV2 = {}) {
|
|
1746
|
+
async function convertWireToOsdkObjects2(client, objects, interfaceApiName, derivedPropertyTypeByName, propertySecurities, forceRemoveRid = false, selectedProps, strictNonNull = false, interfaceToObjectTypeMappings = {}, interfaceToObjectTypeMappingsV2 = {}) {
|
|
1659
1747
|
fixObjectPropertiesInPlace(objects, forceRemoveRid);
|
|
1660
1748
|
const effectiveMappings = Object.keys(interfaceToObjectTypeMappingsV2).length > 0 ? convertInterfaceToObjectTypeMappingsV2ToV1(interfaceToObjectTypeMappingsV2) : interfaceToObjectTypeMappings;
|
|
1661
1749
|
const isInterfaceScoped = Object.keys(effectiveMappings).length > 0;
|
|
1662
1750
|
const ret = [];
|
|
1663
1751
|
for (const rawObj of objects) {
|
|
1664
1752
|
const objectDef = await client.ontologyProvider.getObjectDefinition(rawObj.$apiName);
|
|
1665
|
-
!objectDef ? process.env.NODE_ENV !== "production" ?
|
|
1753
|
+
!objectDef ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, `Missing definition for '${rawObj.$apiName}'`) : invariant3__default.default(false) : void 0;
|
|
1666
1754
|
const interfaceToObjMapping = interfaceApiName && isInterfaceScoped ? effectiveMappings[interfaceApiName][rawObj.$apiName] : void 0;
|
|
1667
1755
|
const ifaceSelected = interfaceApiName && interfaceToObjMapping ? selectedProps ? Object.keys(interfaceToObjMapping).filter((val) => {
|
|
1668
1756
|
selectedProps?.includes(interfaceToObjMapping[val]);
|
|
@@ -1681,7 +1769,7 @@ async function convertWireToOsdkObjects2(client, objects, interfaceApiName, deri
|
|
|
1681
1769
|
} else if (strictNonNull === "drop" && !conforming) {
|
|
1682
1770
|
continue;
|
|
1683
1771
|
}
|
|
1684
|
-
let osdkObject = createOsdkObject(client, objectDef, rawObj, derivedPropertyTypeByName);
|
|
1772
|
+
let osdkObject = createOsdkObject(client, objectDef, rawObj, derivedPropertyTypeByName, propertySecurities);
|
|
1685
1773
|
if (interfaceApiName && isInterfaceScoped) osdkObject = osdkObject.$as(interfaceApiName);
|
|
1686
1774
|
ret.push(osdkObject);
|
|
1687
1775
|
}
|
|
@@ -1835,15 +1923,18 @@ function deepFreeze(obj) {
|
|
|
1835
1923
|
// src/ontology/loadActionMetadata.ts
|
|
1836
1924
|
chunkLDTMSHUZ_cjs.init_cjs_shims();
|
|
1837
1925
|
async function loadActionMetadata(client, actionType) {
|
|
1838
|
-
const r = await
|
|
1926
|
+
const r = await chunkVVKEXIIO_cjs.ActionTypeV2_exports.get(client, await client.ontologyRid, actionType, {
|
|
1927
|
+
branch: client.branch
|
|
1928
|
+
});
|
|
1839
1929
|
return generatorConverters.wireActionTypeV2ToSdkActionMetadata(r);
|
|
1840
1930
|
}
|
|
1841
1931
|
|
|
1842
1932
|
// src/ontology/loadFullObjectMetadata.ts
|
|
1843
1933
|
chunkLDTMSHUZ_cjs.init_cjs_shims();
|
|
1844
1934
|
async function loadFullObjectMetadata(client, objectType) {
|
|
1845
|
-
const full = await
|
|
1846
|
-
preview: true
|
|
1935
|
+
const full = await chunkVVKEXIIO_cjs.ObjectTypeV2_exports.getFullMetadata(client, await client.ontologyRid, objectType, {
|
|
1936
|
+
preview: true,
|
|
1937
|
+
branch: client.branch
|
|
1847
1938
|
});
|
|
1848
1939
|
const ret = generatorConverters.wireObjectTypeFullMetadataToSdkObjectMetadata(full, true);
|
|
1849
1940
|
return {
|
|
@@ -1854,8 +1945,9 @@ async function loadFullObjectMetadata(client, objectType) {
|
|
|
1854
1945
|
// src/ontology/loadInterfaceMetadata.ts
|
|
1855
1946
|
chunkLDTMSHUZ_cjs.init_cjs_shims();
|
|
1856
1947
|
async function loadInterfaceMetadata(client, objectType) {
|
|
1857
|
-
const r = await
|
|
1858
|
-
preview: true
|
|
1948
|
+
const r = await chunkVVKEXIIO_cjs.OntologyInterface_exports.get(client, await client.ontologyRid, objectType, {
|
|
1949
|
+
preview: true,
|
|
1950
|
+
branch: client.branch
|
|
1859
1951
|
});
|
|
1860
1952
|
return generatorConverters.__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(r, true);
|
|
1861
1953
|
}
|
|
@@ -1864,7 +1956,7 @@ async function loadInterfaceMetadata(client, objectType) {
|
|
|
1864
1956
|
chunkLDTMSHUZ_cjs.init_cjs_shims();
|
|
1865
1957
|
async function loadQueryMetadata(client, queryTypeApiNameAndVersion) {
|
|
1866
1958
|
const [apiName, version] = queryTypeApiNameAndVersion.split(":");
|
|
1867
|
-
const r = await
|
|
1959
|
+
const r = await chunkVVKEXIIO_cjs.QueryType_exports.get(client, await client.ontologyRid, apiName, {
|
|
1868
1960
|
version
|
|
1869
1961
|
});
|
|
1870
1962
|
return generatorConverters.wireQueryTypeV2ToSdkQueryMetadata(r);
|
|
@@ -1922,11 +2014,11 @@ var createStandardOntologyProviderFactory = (client) => {
|
|
|
1922
2014
|
|
|
1923
2015
|
// src/util/UserAgent.ts
|
|
1924
2016
|
chunkLDTMSHUZ_cjs.init_cjs_shims();
|
|
1925
|
-
var USER_AGENT = `osdk-client/${"2.
|
|
1926
|
-
var OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.
|
|
2017
|
+
var USER_AGENT = `osdk-client/${"2.8.0-beta.1"}`;
|
|
2018
|
+
var OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.8.0-beta.1"}`;
|
|
1927
2019
|
|
|
1928
2020
|
// src/createMinimalClient.ts
|
|
1929
|
-
function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory =
|
|
2021
|
+
function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory = chunkVVKEXIIO_cjs.createObjectSet, createOntologyProviderFactory = createStandardOntologyProviderFactory) {
|
|
1930
2022
|
if (process.env.NODE_ENV !== "production") {
|
|
1931
2023
|
try {
|
|
1932
2024
|
new URL(baseUrl);
|
|
@@ -1947,6 +2039,7 @@ function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fet
|
|
|
1947
2039
|
transactionId: options.transactionId,
|
|
1948
2040
|
clientCacheKey: {},
|
|
1949
2041
|
requestContext: {},
|
|
2042
|
+
branch: options.branch,
|
|
1950
2043
|
narrowTypeInterfaceOrObjectMapping: {}
|
|
1951
2044
|
};
|
|
1952
2045
|
return Object.freeze(Object.assign(minimalClient, {
|
|
@@ -1998,13 +2091,13 @@ async function toDataValueQueries(value, client, desiredType) {
|
|
|
1998
2091
|
switch (desiredType.type) {
|
|
1999
2092
|
case "attachment": {
|
|
2000
2093
|
if (isAttachmentUpload(value)) {
|
|
2001
|
-
const attachment = await
|
|
2094
|
+
const attachment = await chunkVVKEXIIO_cjs.Attachment_exports.upload(client, value.data, {
|
|
2002
2095
|
filename: value.name
|
|
2003
2096
|
});
|
|
2004
2097
|
return attachment.rid;
|
|
2005
2098
|
}
|
|
2006
2099
|
if (isAttachmentFile(value)) {
|
|
2007
|
-
const attachment = await
|
|
2100
|
+
const attachment = await chunkVVKEXIIO_cjs.Attachment_exports.upload(client, value, {
|
|
2008
2101
|
filename: value.name
|
|
2009
2102
|
});
|
|
2010
2103
|
return attachment.rid;
|
|
@@ -2044,11 +2137,11 @@ async function toDataValueQueries(value, client, desiredType) {
|
|
|
2044
2137
|
}
|
|
2045
2138
|
case "objectSet":
|
|
2046
2139
|
case "interfaceObjectSet": {
|
|
2047
|
-
if (
|
|
2140
|
+
if (chunkVVKEXIIO_cjs.isWireObjectSet(value)) {
|
|
2048
2141
|
return value;
|
|
2049
2142
|
}
|
|
2050
|
-
if (
|
|
2051
|
-
return
|
|
2143
|
+
if (chunkVVKEXIIO_cjs.isObjectSet(value)) {
|
|
2144
|
+
return chunkVVKEXIIO_cjs.getWireObjectSet(value);
|
|
2052
2145
|
}
|
|
2053
2146
|
break;
|
|
2054
2147
|
}
|
|
@@ -2093,7 +2186,7 @@ async function applyQuery(client, query, params) {
|
|
|
2093
2186
|
if (client.flushEdits != null) {
|
|
2094
2187
|
await client.flushEdits();
|
|
2095
2188
|
}
|
|
2096
|
-
const response = await
|
|
2189
|
+
const response = await chunkVVKEXIIO_cjs.Query_exports.execute(chunkVVKEXIIO_cjs.addUserAgentAndRequestContextHeaders(chunkVVKEXIIO_cjs.augmentRequestContext(client, (_) => ({
|
|
2097
2190
|
finalMethodCall: "applyQuery"
|
|
2098
2191
|
})), query), await client.ontologyRid, query.apiName, {
|
|
2099
2192
|
parameters: params ? await remapQueryParams(params, client, (await qd).parameters) : {}
|
|
@@ -2137,7 +2230,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
2137
2230
|
return responseValue;
|
|
2138
2231
|
}
|
|
2139
2232
|
case "attachment": {
|
|
2140
|
-
return
|
|
2233
|
+
return chunkVVKEXIIO_cjs.hydrateAttachmentFromRidInternal(client, responseValue);
|
|
2141
2234
|
}
|
|
2142
2235
|
case "object": {
|
|
2143
2236
|
const def = definitions.get(responseDataType.object);
|
|
@@ -2159,7 +2252,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
2159
2252
|
throw new Error(`Missing definition for ${responseDataType.objectSet}`);
|
|
2160
2253
|
}
|
|
2161
2254
|
if (typeof responseValue === "string") {
|
|
2162
|
-
return
|
|
2255
|
+
return chunkVVKEXIIO_cjs.createObjectSet(def, client, {
|
|
2163
2256
|
type: "intersect",
|
|
2164
2257
|
objectSets: [{
|
|
2165
2258
|
type: "base",
|
|
@@ -2170,7 +2263,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
2170
2263
|
}]
|
|
2171
2264
|
});
|
|
2172
2265
|
}
|
|
2173
|
-
return
|
|
2266
|
+
return chunkVVKEXIIO_cjs.createObjectSet(def, client, responseValue);
|
|
2174
2267
|
}
|
|
2175
2268
|
case "struct": {
|
|
2176
2269
|
for (const [key, subtype] of Object.entries(responseDataType.struct)) {
|
|
@@ -2182,10 +2275,10 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
|
|
|
2182
2275
|
}
|
|
2183
2276
|
case "map": {
|
|
2184
2277
|
const map = {};
|
|
2185
|
-
!Array.isArray(responseValue) ? process.env.NODE_ENV !== "production" ?
|
|
2278
|
+
!Array.isArray(responseValue) ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "Expected array entry") : invariant3__default.default(false) : void 0;
|
|
2186
2279
|
for (const entry of responseValue) {
|
|
2187
|
-
!(entry.key != null) ? process.env.NODE_ENV !== "production" ?
|
|
2188
|
-
!(entry.value != null) ? process.env.NODE_ENV !== "production" ?
|
|
2280
|
+
!(entry.key != null) ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "Expected key") : invariant3__default.default(false) : void 0;
|
|
2281
|
+
!(entry.value != null) ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "Expected value") : invariant3__default.default(false) : void 0;
|
|
2189
2282
|
const key = responseDataType.keyType.type === "object" ? getObjectSpecifier(entry.key, responseDataType.keyType.object, definitions) : entry.key;
|
|
2190
2283
|
const value = await remapQueryResponse(client, responseDataType.valueType, entry.value, definitions);
|
|
2191
2284
|
map[key] = value;
|
|
@@ -2364,9 +2457,10 @@ function createClientInternal(objectSetFactory, transactionRid, flushEdits, base
|
|
|
2364
2457
|
ontologyRid
|
|
2365
2458
|
}, baseUrl, tokenProvider, {
|
|
2366
2459
|
...options,
|
|
2367
|
-
logger: options?.logger ?? new
|
|
2460
|
+
logger: options?.logger ?? new chunkVVKEXIIO_cjs.MinimalLogger(),
|
|
2368
2461
|
transactionId: transactionRid,
|
|
2369
|
-
flushEdits
|
|
2462
|
+
flushEdits,
|
|
2463
|
+
branch: options?.branch
|
|
2370
2464
|
}, fetchFn, objectSetFactory);
|
|
2371
2465
|
return createClientFromContext(clientCtx);
|
|
2372
2466
|
}
|
|
@@ -2387,7 +2481,7 @@ function createClientFromContext(clientCtx) {
|
|
|
2387
2481
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid.name:
|
|
2388
2482
|
return {
|
|
2389
2483
|
fetchOneByRid: async (objectType, rid, options) => {
|
|
2390
|
-
return await
|
|
2484
|
+
return await chunkVVKEXIIO_cjs.fetchSingle(clientCtx, objectType, options, createWithRid([rid]));
|
|
2391
2485
|
}
|
|
2392
2486
|
};
|
|
2393
2487
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference.name:
|
|
@@ -2399,7 +2493,7 @@ function createClientFromContext(clientCtx) {
|
|
|
2399
2493
|
objectType,
|
|
2400
2494
|
propertyType
|
|
2401
2495
|
} = args;
|
|
2402
|
-
return await
|
|
2496
|
+
return await chunkVVKEXIIO_cjs.MediaReferenceProperty_exports.upload(clientCtx, await clientCtx.ontologyRid, objectType.apiName, propertyType, data, {
|
|
2403
2497
|
mediaItemPath: fileName,
|
|
2404
2498
|
preview: true
|
|
2405
2499
|
});
|
|
@@ -2408,10 +2502,10 @@ function createClientFromContext(clientCtx) {
|
|
|
2408
2502
|
case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid.name:
|
|
2409
2503
|
return {
|
|
2410
2504
|
fetchPageByRid: async (objectOrInterfaceType, rids, options = {}) => {
|
|
2411
|
-
return await
|
|
2505
|
+
return await chunkVVKEXIIO_cjs.fetchPage(clientCtx, objectOrInterfaceType, options, createWithRid(rids));
|
|
2412
2506
|
},
|
|
2413
2507
|
fetchPageByRidNoType: async (rids, options) => {
|
|
2414
|
-
return await
|
|
2508
|
+
return await chunkVVKEXIIO_cjs.fetchStaticRidPage(clientCtx, rids, options ?? {});
|
|
2415
2509
|
}
|
|
2416
2510
|
};
|
|
2417
2511
|
}
|
|
@@ -2423,13 +2517,13 @@ function createClientFromContext(clientCtx) {
|
|
|
2423
2517
|
const fetchMetadata = fetchMetadataInternal.bind(void 0, clientCtx);
|
|
2424
2518
|
const symbolClientContext2 = "__osdkClientContext";
|
|
2425
2519
|
const client = Object.defineProperties(clientFn, {
|
|
2426
|
-
[
|
|
2520
|
+
[chunkVVKEXIIO_cjs.symbolClientContext]: {
|
|
2427
2521
|
value: clientCtx
|
|
2428
2522
|
},
|
|
2429
2523
|
[symbolClientContext2]: {
|
|
2430
2524
|
value: clientCtx
|
|
2431
2525
|
},
|
|
2432
|
-
[
|
|
2526
|
+
[chunkVVKEXIIO_cjs.additionalContext]: {
|
|
2433
2527
|
value: clientCtx
|
|
2434
2528
|
},
|
|
2435
2529
|
fetchMetadata: {
|
|
@@ -2438,8 +2532,8 @@ function createClientFromContext(clientCtx) {
|
|
|
2438
2532
|
});
|
|
2439
2533
|
return client;
|
|
2440
2534
|
}
|
|
2441
|
-
var createClient = createClientInternal.bind(void 0,
|
|
2442
|
-
var createClientWithTransaction = (transactionRid, flushEdits, ...args) => createClientInternal(
|
|
2535
|
+
var createClient = createClientInternal.bind(void 0, chunkVVKEXIIO_cjs.createObjectSet, void 0, void 0);
|
|
2536
|
+
var createClientWithTransaction = (transactionRid, flushEdits, ...args) => createClientInternal(chunkVVKEXIIO_cjs.createObjectSet, transactionRid, flushEdits, ...args);
|
|
2443
2537
|
function createWithRid(rids) {
|
|
2444
2538
|
const withRid = {
|
|
2445
2539
|
type: "static",
|
|
@@ -2463,5 +2557,5 @@ exports.createObjectSpecifierFromPrimaryKey = createObjectSpecifierFromPrimaryKe
|
|
|
2463
2557
|
exports.createOsdkObject = createOsdkObject;
|
|
2464
2558
|
exports.extractPrimaryKeyFromObjectSpecifier = extractPrimaryKeyFromObjectSpecifier;
|
|
2465
2559
|
exports.isObjectSpecifiersObject = isObjectSpecifiersObject;
|
|
2466
|
-
//# sourceMappingURL=chunk-
|
|
2467
|
-
//# sourceMappingURL=chunk-
|
|
2560
|
+
//# sourceMappingURL=chunk-7543GRIE.cjs.map
|
|
2561
|
+
//# sourceMappingURL=chunk-7543GRIE.cjs.map
|