@osdk/client 2.8.0-beta.11 → 2.8.0-beta.12

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.
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunk2MMKVFIE_cjs = require('./chunk-2MMKVFIE.cjs');
3
+ var chunk22QZVXHI_cjs = require('./chunk-22QZVXHI.cjs');
4
4
  require('./chunk-YVZM2JPW.cjs');
5
5
  var chunkLDTMSHUZ_cjs = require('./chunk-LDTMSHUZ.cjs');
6
6
  var api = require('@osdk/api');
@@ -18,7 +18,7 @@ chunkLDTMSHUZ_cjs.init_cjs_shims();
18
18
  // src/createPlatformClient.ts
19
19
  chunkLDTMSHUZ_cjs.init_cjs_shims();
20
20
  function createPlatformClient(baseUrl, tokenProvider, options = void 0, fetchFn = fetch) {
21
- return shared_client_impl.createSharedClientContext(baseUrl, tokenProvider, chunk2MMKVFIE_cjs.USER_AGENT, fetchFn);
21
+ return shared_client_impl.createSharedClientContext(baseUrl, tokenProvider, chunk22QZVXHI_cjs.USER_AGENT, fetchFn);
22
22
  }
23
23
 
24
24
  // src/util/datetimeConverters.ts
@@ -45,23 +45,23 @@ var extractDateFromIsoString = (dateTime) => {
45
45
 
46
46
  Object.defineProperty(exports, "ActionValidationError", {
47
47
  enumerable: true,
48
- get: function () { return chunk2MMKVFIE_cjs.ActionValidationError; }
48
+ get: function () { return chunk22QZVXHI_cjs.ActionValidationError; }
49
49
  });
50
50
  Object.defineProperty(exports, "createAttachmentUpload", {
51
51
  enumerable: true,
52
- get: function () { return chunk2MMKVFIE_cjs.createAttachmentUpload; }
52
+ get: function () { return chunk22QZVXHI_cjs.createAttachmentUpload; }
53
53
  });
54
54
  Object.defineProperty(exports, "createClient", {
55
55
  enumerable: true,
56
- get: function () { return chunk2MMKVFIE_cjs.createClient; }
56
+ get: function () { return chunk22QZVXHI_cjs.createClient; }
57
57
  });
58
58
  Object.defineProperty(exports, "createObjectSpecifierFromPrimaryKey", {
59
59
  enumerable: true,
60
- get: function () { return chunk2MMKVFIE_cjs.createObjectSpecifierFromPrimaryKey; }
60
+ get: function () { return chunk22QZVXHI_cjs.createObjectSpecifierFromPrimaryKey; }
61
61
  });
62
62
  Object.defineProperty(exports, "extractPrimaryKeyFromObjectSpecifier", {
63
63
  enumerable: true,
64
- get: function () { return chunk2MMKVFIE_cjs.extractPrimaryKeyFromObjectSpecifier; }
64
+ get: function () { return chunk22QZVXHI_cjs.extractPrimaryKeyFromObjectSpecifier; }
65
65
  });
66
66
  Object.defineProperty(exports, "isOk", {
67
67
  enumerable: true,
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunk2MMKVFIE_cjs = require('../chunk-2MMKVFIE.cjs');
3
+ var chunk22QZVXHI_cjs = require('../chunk-22QZVXHI.cjs');
4
4
  var chunkYVZM2JPW_cjs = require('../chunk-YVZM2JPW.cjs');
5
5
  var chunkLDTMSHUZ_cjs = require('../chunk-LDTMSHUZ.cjs');
6
6
  var trie = require('@wry/trie');
@@ -1550,7 +1550,7 @@ var FunctionParamsCanonicalizer = class {
1550
1550
  path.push("$:map_end");
1551
1551
  return arr;
1552
1552
  }
1553
- if (chunk2MMKVFIE_cjs.isObjectSpecifiersObject(value)) {
1553
+ if (chunk22QZVXHI_cjs.isObjectSpecifiersObject(value)) {
1554
1554
  const objectType = value.$objectType ?? value.$apiName;
1555
1555
  path.push("$:osdk", objectType, value.$primaryKey);
1556
1556
  return {
@@ -1679,7 +1679,7 @@ var FunctionQuery = class extends Query {
1679
1679
  }).debug("calling _fetchAndStore");
1680
1680
  }
1681
1681
  try {
1682
- const result = await chunk2MMKVFIE_cjs.applyQuery(this.store.client[chunkYVZM2JPW_cjs.additionalContext], this.#queryDef, this.#params);
1682
+ const result = await chunk22QZVXHI_cjs.applyQuery(this.store.client[chunkYVZM2JPW_cjs.additionalContext], this.#queryDef, this.#params);
1683
1683
  const executedAt = Date.now();
1684
1684
  this.store.batch({}, (batch) => {
1685
1685
  this.writeToStore({
@@ -3435,29 +3435,34 @@ var InterfaceListQuery = class extends ListQuery {
3435
3435
  createObjectSet(store) {
3436
3436
  const rdpConfig = this.cacheKey.otherKeys[RDP_IDX2];
3437
3437
  const pivotInfo = this.cacheKey.otherKeys[PIVOT_IDX];
3438
+ const rids = this.cacheKey.otherKeys[RIDS_IDX];
3438
3439
  if (pivotInfo != null) {
3439
- const sourceSet = pivotInfo.sourceTypeKind === "interface" ? store.client({
3440
- type: "interface",
3441
- apiName: pivotInfo.sourceType
3442
- }) : store.client({
3443
- type: "object",
3444
- apiName: pivotInfo.sourceType
3445
- });
3446
- let objectSet = sourceSet.where(this.canonicalWhere).pivotTo(pivotInfo.linkName);
3440
+ const sourceSet = createSourceSetForPivot(store, pivotInfo, rids);
3441
+ let objectSet2 = sourceSet.where(this.canonicalWhere).pivotTo(pivotInfo.linkName);
3447
3442
  if (rdpConfig != null) {
3448
- objectSet = objectSet.withProperties(rdpConfig);
3443
+ objectSet2 = objectSet2.withProperties(rdpConfig);
3449
3444
  }
3450
- return objectSet;
3445
+ return objectSet2;
3451
3446
  }
3452
3447
  const type = "interface";
3453
3448
  const objectTypeDef = {
3454
3449
  type,
3455
3450
  apiName: this.apiName
3456
3451
  };
3452
+ const clientCtx = store.client[chunkYVZM2JPW_cjs.additionalContext];
3453
+ let objectSet;
3454
+ if (rids != null) {
3455
+ objectSet = clientCtx.objectSetFactory(objectTypeDef, clientCtx, {
3456
+ type: "static",
3457
+ objects: [...rids]
3458
+ });
3459
+ } else {
3460
+ objectSet = store.client(objectTypeDef);
3461
+ }
3457
3462
  if (rdpConfig != null) {
3458
- return store.client(objectTypeDef).withProperties(rdpConfig).where(this.canonicalWhere);
3463
+ objectSet = objectSet.withProperties(rdpConfig);
3459
3464
  }
3460
- return store.client(objectTypeDef).where(this.canonicalWhere);
3465
+ return objectSet.where(this.canonicalWhere);
3461
3466
  }
3462
3467
  async revalidateObjectType(apiName) {
3463
3468
  const objectMetadata = await this.store.client.fetchMetadata({
@@ -3487,7 +3492,7 @@ var InterfaceListQuery = class extends ListQuery {
3487
3492
  }
3488
3493
  extractRelevantObjects(changes) {
3489
3494
  const matchesApiName = ([, object]) => {
3490
- return this.apiName in object[chunk2MMKVFIE_cjs.ObjectDefRef].interfaceMap;
3495
+ return this.apiName in object[chunk22QZVXHI_cjs.ObjectDefRef].interfaceMap;
3491
3496
  };
3492
3497
  const added = Array.from(changes.addedObjects).filter(matchesApiName).map(([, object]) => object.$as(this.apiName));
3493
3498
  const modified = Array.from(changes.modifiedObjects).filter(matchesApiName).map(([, object]) => object.$as(this.apiName));
@@ -3505,6 +3510,28 @@ var InterfaceListQuery = class extends ListQuery {
3505
3510
  };
3506
3511
  }
3507
3512
  };
3513
+ function createSourceSetForPivot(store, pivotInfo, rids) {
3514
+ const clientCtx = store.client[chunkYVZM2JPW_cjs.additionalContext];
3515
+ if (rids != null) {
3516
+ return clientCtx.objectSetFactory({
3517
+ type: "object",
3518
+ apiName: pivotInfo.sourceType
3519
+ }, clientCtx, {
3520
+ type: "static",
3521
+ objects: [...rids]
3522
+ });
3523
+ }
3524
+ if (pivotInfo.sourceTypeKind === "interface") {
3525
+ return store.client({
3526
+ type: "interface",
3527
+ apiName: pivotInfo.sourceType
3528
+ });
3529
+ }
3530
+ return store.client({
3531
+ type: "object",
3532
+ apiName: pivotInfo.sourceType
3533
+ });
3534
+ }
3508
3535
  async function reloadDataAsFullObjects(client, data) {
3509
3536
  if (data.length === 0) {
3510
3537
  return data;
@@ -3691,8 +3718,8 @@ function stripRdpFields(value, rdpFields) {
3691
3718
  if (rdpFields.size === 0) {
3692
3719
  return value;
3693
3720
  }
3694
- const underlying = value[chunk2MMKVFIE_cjs.UnderlyingOsdkObject];
3695
- const objectDef = value[chunk2MMKVFIE_cjs.ObjectDefRef];
3721
+ const underlying = value[chunk22QZVXHI_cjs.UnderlyingOsdkObject];
3722
+ const objectDef = value[chunk22QZVXHI_cjs.ObjectDefRef];
3696
3723
  const newProps = {
3697
3724
  $apiName: underlying.$apiName,
3698
3725
  $objectType: underlying.$objectType,
@@ -3705,7 +3732,7 @@ function stripRdpFields(value, rdpFields) {
3705
3732
  newProps[key] = underlying[key];
3706
3733
  }
3707
3734
  }
3708
- return chunk2MMKVFIE_cjs.createOsdkObject(value[chunk2MMKVFIE_cjs.ClientRef], objectDef, newProps);
3735
+ return chunk22QZVXHI_cjs.createOsdkObject(value[chunk22QZVXHI_cjs.ClientRef], objectDef, newProps);
3709
3736
  }
3710
3737
  function isSuperset(superset, subset) {
3711
3738
  for (const field of subset) {
@@ -3716,8 +3743,8 @@ function isSuperset(superset, subset) {
3716
3743
  return true;
3717
3744
  }
3718
3745
  function filterToRdpFields(value, rdpFieldsToKeep, sourceRdpFields) {
3719
- const underlying = value[chunk2MMKVFIE_cjs.UnderlyingOsdkObject];
3720
- const objectDef = value[chunk2MMKVFIE_cjs.ObjectDefRef];
3746
+ const underlying = value[chunk22QZVXHI_cjs.UnderlyingOsdkObject];
3747
+ const objectDef = value[chunk22QZVXHI_cjs.ObjectDefRef];
3721
3748
  const newProps = {
3722
3749
  $apiName: underlying.$apiName,
3723
3750
  $objectType: underlying.$objectType,
@@ -3733,7 +3760,7 @@ function filterToRdpFields(value, rdpFieldsToKeep, sourceRdpFields) {
3733
3760
  }
3734
3761
  }
3735
3762
  }
3736
- return chunk2MMKVFIE_cjs.createOsdkObject(value[chunk2MMKVFIE_cjs.ClientRef], objectDef, newProps);
3763
+ return chunk22QZVXHI_cjs.createOsdkObject(value[chunk22QZVXHI_cjs.ClientRef], objectDef, newProps);
3737
3764
  }
3738
3765
  function mergeObjectFields(sourceValue, sourceRdpFields, targetRdpFields, targetCurrentValue) {
3739
3766
  if (targetRdpFields.size === 0) {
@@ -3745,8 +3772,8 @@ function mergeObjectFields(sourceValue, sourceRdpFields, targetRdpFields, target
3745
3772
  }
3746
3773
  return filterToRdpFields(sourceValue, targetRdpFields, sourceRdpFields);
3747
3774
  }
3748
- const sourceUnderlying = sourceValue[chunk2MMKVFIE_cjs.UnderlyingOsdkObject];
3749
- const objectDef = sourceValue[chunk2MMKVFIE_cjs.ObjectDefRef];
3775
+ const sourceUnderlying = sourceValue[chunk22QZVXHI_cjs.UnderlyingOsdkObject];
3776
+ const objectDef = sourceValue[chunk22QZVXHI_cjs.ObjectDefRef];
3750
3777
  const newProps = {
3751
3778
  $apiName: sourceUnderlying.$apiName,
3752
3779
  $objectType: sourceUnderlying.$objectType,
@@ -3760,7 +3787,7 @@ function mergeObjectFields(sourceValue, sourceRdpFields, targetRdpFields, target
3760
3787
  }
3761
3788
  }
3762
3789
  if (targetCurrentValue) {
3763
- const targetUnderlying = targetCurrentValue[chunk2MMKVFIE_cjs.UnderlyingOsdkObject];
3790
+ const targetUnderlying = targetCurrentValue[chunk22QZVXHI_cjs.UnderlyingOsdkObject];
3764
3791
  for (const field of targetRdpFields) {
3765
3792
  if (field in targetUnderlying) {
3766
3793
  if (!sourceRdpFields.has(field) || newProps[field] === void 0) {
@@ -3769,7 +3796,7 @@ function mergeObjectFields(sourceValue, sourceRdpFields, targetRdpFields, target
3769
3796
  }
3770
3797
  }
3771
3798
  }
3772
- return chunk2MMKVFIE_cjs.createOsdkObject(sourceValue[chunk2MMKVFIE_cjs.ClientRef], objectDef, newProps);
3799
+ return chunk22QZVXHI_cjs.createOsdkObject(sourceValue[chunk22QZVXHI_cjs.ClientRef], objectDef, newProps);
3773
3800
  }
3774
3801
 
3775
3802
  // src/observable/internal/object/ObjectCacheKeyRegistry.ts
@@ -4132,7 +4159,7 @@ var ObjectsHelper = class extends AbstractHelper {
4132
4159
  const {
4133
4160
  pk
4134
4161
  } = options;
4135
- const defType = chunk2MMKVFIE_cjs.getDefType(options.apiName);
4162
+ const defType = chunk22QZVXHI_cjs.getDefType(options.apiName);
4136
4163
  const objectCacheKey = this.cacheKeys.get("object", apiName, pk, rdpConfig ?? void 0);
4137
4164
  return this.store.queries.get(objectCacheKey, () => new ObjectQuery(this.store, this.store.subjects.get(objectCacheKey), apiName, pk, objectCacheKey, {
4138
4165
  dedupeInterval: 0
@@ -4830,10 +4857,10 @@ var Store = class {
4830
4857
 
4831
4858
  // src/observable/ObservableClient.ts
4832
4859
  function createObservableClient(client) {
4833
- const tweakedClient = chunk2MMKVFIE_cjs.createClientFromContext({
4860
+ const tweakedClient = chunk22QZVXHI_cjs.createClientFromContext({
4834
4861
  ...client[chunkYVZM2JPW_cjs.additionalContext],
4835
4862
  fetch: shared_net_fetch.createFetchHeaderMutator(client[chunkYVZM2JPW_cjs.additionalContext].fetch, (headers) => {
4836
- headers.set("Fetch-User-Agent", [headers.get("Fetch-User-Agent"), chunk2MMKVFIE_cjs.OBSERVABLE_USER_AGENT].filter((x) => x && x?.length > 0).join(" "));
4863
+ headers.set("Fetch-User-Agent", [headers.get("Fetch-User-Agent"), chunk22QZVXHI_cjs.OBSERVABLE_USER_AGENT].filter((x) => x && x?.length > 0).join(" "));
4837
4864
  return headers;
4838
4865
  })
4839
4866
  });
@@ -4877,7 +4904,7 @@ function getOsdkConfig(ontologyRid) {
4877
4904
 
4878
4905
  Object.defineProperty(exports, "createClientWithTransaction", {
4879
4906
  enumerable: true,
4880
- get: function () { return chunk2MMKVFIE_cjs.createClientWithTransaction; }
4907
+ get: function () { return chunk22QZVXHI_cjs.createClientWithTransaction; }
4881
4908
  });
4882
4909
  Object.defineProperty(exports, "augment", {
4883
4910
  enumerable: true,