@osdk/client 2.2.0-beta.12 → 2.2.0-beta.13

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.
Files changed (151) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/build/browser/actions/actions.test.js +1 -1
  3. package/build/browser/actions/actions.test.js.map +1 -1
  4. package/build/browser/index.js +1 -1
  5. package/build/browser/index.js.map +1 -1
  6. package/build/browser/logger/TestLogger.js +59 -0
  7. package/build/browser/logger/TestLogger.js.map +1 -0
  8. package/build/browser/object/attachment.test.js.map +1 -1
  9. package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.js +4 -0
  10. package/build/browser/object/convertWireToOsdkObjects/createOsdkInterface.js.map +1 -1
  11. package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.js +44 -33
  12. package/build/browser/object/convertWireToOsdkObjects/createOsdkObject.js.map +1 -1
  13. package/build/browser/object/convertWireToOsdkObjects.js +4 -9
  14. package/build/browser/object/convertWireToOsdkObjects.js.map +1 -1
  15. package/build/browser/object/convertWireToOsdkObjects.test.js +29 -25
  16. package/build/browser/object/convertWireToOsdkObjects.test.js.map +1 -1
  17. package/build/browser/object/fetchPage.js +4 -3
  18. package/build/browser/object/fetchPage.js.map +1 -1
  19. package/build/browser/object/object.test.js +17 -1
  20. package/build/browser/object/object.test.js.map +1 -1
  21. package/build/browser/object/timeseries.test.js.map +1 -1
  22. package/build/browser/objectSet/ObjectSet.test.js +98 -1
  23. package/build/browser/objectSet/ObjectSet.test.js.map +1 -1
  24. package/build/browser/objectSet/ObjectSetListenerWebsocket.js +2 -2
  25. package/build/browser/objectSet/ObjectSetListenerWebsocket.js.map +1 -1
  26. package/build/browser/objectSet/ObjectSetListenerWebsocket.test.js +2 -3
  27. package/build/browser/objectSet/ObjectSetListenerWebsocket.test.js.map +1 -1
  28. package/build/browser/objectSet/createObjectSet.js +1 -0
  29. package/build/browser/objectSet/createObjectSet.js.map +1 -1
  30. package/build/browser/observable/internal/ActionApplication.js +4 -4
  31. package/build/browser/observable/internal/ActionApplication.js.map +1 -1
  32. package/build/browser/observable/internal/ObjectQuery.js +1 -1
  33. package/build/browser/observable/internal/ObjectQuery.js.map +1 -1
  34. package/build/browser/observable/internal/OptimisticJob.js +1 -1
  35. package/build/browser/observable/internal/OptimisticJob.js.map +1 -1
  36. package/build/browser/observable/internal/Store.js +2 -2
  37. package/build/browser/observable/internal/Store.js.map +1 -1
  38. package/build/browser/observable/internal/Store.test.js +173 -216
  39. package/build/browser/observable/internal/Store.test.js.map +1 -1
  40. package/build/browser/queries/applyQuery.js +3 -3
  41. package/build/browser/queries/applyQuery.js.map +1 -1
  42. package/build/browser/util/UserAgent.js +1 -1
  43. package/build/browser/util/extractRdpDefinition.js +87 -0
  44. package/build/browser/util/extractRdpDefinition.js.map +1 -0
  45. package/build/browser/util/extractRdpDefinition.test.js +144 -0
  46. package/build/browser/util/extractRdpDefinition.test.js.map +1 -0
  47. package/build/browser/util/objectSpecifierUtils.js +48 -0
  48. package/build/browser/util/objectSpecifierUtils.js.map +1 -0
  49. package/build/browser/util/objectSpecifierUtils.test.js +42 -0
  50. package/build/browser/util/objectSpecifierUtils.test.js.map +1 -0
  51. package/build/browser/util/toDataValueQueries.js +2 -4
  52. package/build/browser/util/toDataValueQueries.js.map +1 -1
  53. package/build/cjs/{chunk-EY52J5Z4.cjs → chunk-USHAX4EP.cjs} +89 -17
  54. package/build/cjs/chunk-USHAX4EP.cjs.map +1 -0
  55. package/build/cjs/{chunk-MCQVHD2F.cjs → chunk-VT3UM6EP.cjs} +17 -16
  56. package/build/cjs/chunk-VT3UM6EP.cjs.map +1 -0
  57. package/build/cjs/index.cjs +104 -95
  58. package/build/cjs/index.cjs.map +1 -1
  59. package/build/cjs/index.d.cts +11 -3
  60. package/build/cjs/public/internal.cjs +6 -7
  61. package/build/cjs/public/internal.cjs.map +1 -1
  62. package/build/cjs/public/unstable-do-not-use.cjs +67 -66
  63. package/build/cjs/public/unstable-do-not-use.cjs.map +1 -1
  64. package/build/esm/actions/actions.test.js +1 -1
  65. package/build/esm/actions/actions.test.js.map +1 -1
  66. package/build/esm/index.js +1 -1
  67. package/build/esm/index.js.map +1 -1
  68. package/build/esm/logger/TestLogger.js +59 -0
  69. package/build/esm/logger/TestLogger.js.map +1 -0
  70. package/build/esm/object/attachment.test.js.map +1 -1
  71. package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.js +4 -0
  72. package/build/esm/object/convertWireToOsdkObjects/createOsdkInterface.js.map +1 -1
  73. package/build/esm/object/convertWireToOsdkObjects/createOsdkObject.js +44 -33
  74. package/build/esm/object/convertWireToOsdkObjects/createOsdkObject.js.map +1 -1
  75. package/build/esm/object/convertWireToOsdkObjects.js +4 -9
  76. package/build/esm/object/convertWireToOsdkObjects.js.map +1 -1
  77. package/build/esm/object/convertWireToOsdkObjects.test.js +29 -25
  78. package/build/esm/object/convertWireToOsdkObjects.test.js.map +1 -1
  79. package/build/esm/object/fetchPage.js +4 -3
  80. package/build/esm/object/fetchPage.js.map +1 -1
  81. package/build/esm/object/object.test.js +17 -1
  82. package/build/esm/object/object.test.js.map +1 -1
  83. package/build/esm/object/timeseries.test.js.map +1 -1
  84. package/build/esm/objectSet/ObjectSet.test.js +98 -1
  85. package/build/esm/objectSet/ObjectSet.test.js.map +1 -1
  86. package/build/esm/objectSet/ObjectSetListenerWebsocket.js +2 -2
  87. package/build/esm/objectSet/ObjectSetListenerWebsocket.js.map +1 -1
  88. package/build/esm/objectSet/ObjectSetListenerWebsocket.test.js +2 -3
  89. package/build/esm/objectSet/ObjectSetListenerWebsocket.test.js.map +1 -1
  90. package/build/esm/objectSet/createObjectSet.js +1 -0
  91. package/build/esm/objectSet/createObjectSet.js.map +1 -1
  92. package/build/esm/observable/internal/ActionApplication.js +4 -4
  93. package/build/esm/observable/internal/ActionApplication.js.map +1 -1
  94. package/build/esm/observable/internal/ObjectQuery.js +1 -1
  95. package/build/esm/observable/internal/ObjectQuery.js.map +1 -1
  96. package/build/esm/observable/internal/OptimisticJob.js +1 -1
  97. package/build/esm/observable/internal/OptimisticJob.js.map +1 -1
  98. package/build/esm/observable/internal/Store.js +2 -2
  99. package/build/esm/observable/internal/Store.js.map +1 -1
  100. package/build/esm/observable/internal/Store.test.js +173 -216
  101. package/build/esm/observable/internal/Store.test.js.map +1 -1
  102. package/build/esm/queries/applyQuery.js +3 -3
  103. package/build/esm/queries/applyQuery.js.map +1 -1
  104. package/build/esm/util/UserAgent.js +1 -1
  105. package/build/esm/util/extractRdpDefinition.js +87 -0
  106. package/build/esm/util/extractRdpDefinition.js.map +1 -0
  107. package/build/esm/util/extractRdpDefinition.test.js +144 -0
  108. package/build/esm/util/extractRdpDefinition.test.js.map +1 -0
  109. package/build/esm/util/objectSpecifierUtils.js +48 -0
  110. package/build/esm/util/objectSpecifierUtils.js.map +1 -0
  111. package/build/esm/util/objectSpecifierUtils.test.js +42 -0
  112. package/build/esm/util/objectSpecifierUtils.test.js.map +1 -0
  113. package/build/esm/util/toDataValueQueries.js +2 -4
  114. package/build/esm/util/toDataValueQueries.js.map +1 -1
  115. package/build/types/index.d.ts +1 -1
  116. package/build/types/index.d.ts.map +1 -1
  117. package/build/types/logger/TestLogger.d.ts +14 -0
  118. package/build/types/logger/TestLogger.d.ts.map +1 -0
  119. package/build/types/object/convertWireToOsdkObjects.d.ts +4 -4
  120. package/build/types/object/convertWireToOsdkObjects.d.ts.map +1 -1
  121. package/build/types/object/fetchPage.d.ts.map +1 -1
  122. package/build/types/object/object.test.d.ts.map +1 -1
  123. package/build/types/objectSet/ObjectSet.test.d.ts.map +1 -1
  124. package/build/types/observable/internal/ActionApplication.d.ts +2 -2
  125. package/build/types/observable/internal/ActionApplication.d.ts.map +1 -1
  126. package/build/types/observable/internal/OptimisticJob.d.ts.map +1 -1
  127. package/build/types/observable/internal/Store.d.ts +2 -2
  128. package/build/types/observable/internal/Store.d.ts.map +1 -1
  129. package/build/types/queries/applyQuery.d.ts +2 -2
  130. package/build/types/queries/applyQuery.d.ts.map +1 -1
  131. package/build/types/util/extractRdpDefinition.d.ts +4 -0
  132. package/build/types/util/extractRdpDefinition.d.ts.map +1 -0
  133. package/build/types/util/extractRdpDefinition.test.d.ts +1 -0
  134. package/build/types/util/extractRdpDefinition.test.d.ts.map +1 -0
  135. package/build/types/util/objectSpecifierUtils.d.ts +24 -0
  136. package/build/types/util/objectSpecifierUtils.d.ts.map +1 -0
  137. package/build/types/util/objectSpecifierUtils.test.d.ts +1 -0
  138. package/build/types/util/objectSpecifierUtils.test.d.ts.map +1 -0
  139. package/package.json +11 -11
  140. package/build/browser/object/createObjectSpecifierFromPrimaryKey.js +0 -20
  141. package/build/browser/object/createObjectSpecifierFromPrimaryKey.js.map +0 -1
  142. package/build/cjs/chunk-EY52J5Z4.cjs.map +0 -1
  143. package/build/cjs/chunk-MCQVHD2F.cjs.map +0 -1
  144. package/build/cjs/chunk-Q7SFCCGT.cjs +0 -11
  145. package/build/cjs/chunk-Q7SFCCGT.cjs.map +0 -1
  146. package/build/cjs/graphql-RGM5SRWV.cjs +0 -10532
  147. package/build/cjs/graphql-RGM5SRWV.cjs.map +0 -1
  148. package/build/esm/object/createObjectSpecifierFromPrimaryKey.js +0 -20
  149. package/build/esm/object/createObjectSpecifierFromPrimaryKey.js.map +0 -1
  150. package/build/types/object/createObjectSpecifierFromPrimaryKey.d.ts +0 -2
  151. package/build/types/object/createObjectSpecifierFromPrimaryKey.d.ts.map +0 -1
@@ -1,9 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var chunkMCQVHD2F_cjs = require('./chunk-MCQVHD2F.cjs');
3
+ var chunkVT3UM6EP_cjs = require('./chunk-VT3UM6EP.cjs');
4
4
  var chunkT4NIFYZS_cjs = require('./chunk-T4NIFYZS.cjs');
5
- var chunkEY52J5Z4_cjs = require('./chunk-EY52J5Z4.cjs');
6
- require('./chunk-Q7SFCCGT.cjs');
5
+ var chunkUSHAX4EP_cjs = require('./chunk-USHAX4EP.cjs');
7
6
  var api = require('@osdk/api');
8
7
  var shared_net_errors = require('@osdk/shared.net.errors');
9
8
  var unstable = require('@osdk/api/unstable');
@@ -417,13 +416,13 @@ async function toDataValue(value, client) {
417
416
  return Promise.all(promiseArray);
418
417
  }
419
418
  if (isAttachmentUpload(value)) {
420
- const attachment = await chunkEY52J5Z4_cjs.Attachment_exports.upload(client, value.data, {
419
+ const attachment = await chunkUSHAX4EP_cjs.Attachment_exports.upload(client, value.data, {
421
420
  filename: value.name
422
421
  });
423
422
  return await toDataValue(attachment.rid, client);
424
423
  }
425
424
  if (isAttachmentFile(value)) {
426
- const attachment = await chunkEY52J5Z4_cjs.Attachment_exports.upload(client, value, {
425
+ const attachment = await chunkUSHAX4EP_cjs.Attachment_exports.upload(client, value, {
427
426
  filename: value.name
428
427
  });
429
428
  return await toDataValue(attachment.rid, client);
@@ -434,11 +433,11 @@ async function toDataValue(value, client) {
434
433
  if (isOsdkBaseObject(value)) {
435
434
  return await toDataValue(value.$primaryKey, client);
436
435
  }
437
- if (chunkMCQVHD2F_cjs.isWireObjectSet(value)) {
436
+ if (chunkVT3UM6EP_cjs.isWireObjectSet(value)) {
438
437
  return value;
439
438
  }
440
- if (chunkMCQVHD2F_cjs.isObjectSet(value)) {
441
- return chunkMCQVHD2F_cjs.getWireObjectSet(value);
439
+ if (chunkVT3UM6EP_cjs.isObjectSet(value)) {
440
+ return chunkVT3UM6EP_cjs.getWireObjectSet(value);
442
441
  }
443
442
  if (isMediaReference(value)) {
444
443
  return value;
@@ -461,11 +460,11 @@ async function toDataValue(value, client) {
461
460
 
462
461
  // src/actions/applyAction.ts
463
462
  async function applyAction(client, action, parameters, options = {}) {
464
- const clientWithHeaders = chunkEY52J5Z4_cjs.addUserAgentAndRequestContextHeaders(chunkMCQVHD2F_cjs.augmentRequestContext(client, (_) => ({
463
+ const clientWithHeaders = chunkUSHAX4EP_cjs.addUserAgentAndRequestContextHeaders(chunkVT3UM6EP_cjs.augmentRequestContext(client, (_) => ({
465
464
  finalMethodCall: "applyAction"
466
465
  })), action);
467
466
  if (Array.isArray(parameters)) {
468
- const response = await chunkEY52J5Z4_cjs.Action_exports.applyBatch(clientWithHeaders, await client.ontologyRid, action.apiName, {
467
+ const response = await chunkUSHAX4EP_cjs.Action_exports.applyBatch(clientWithHeaders, await client.ontologyRid, action.apiName, {
469
468
  requests: parameters ? await remapBatchActionParams(parameters, client) : [],
470
469
  options: {
471
470
  returnEdits: options?.$returnEdits ? "ALL" : "NONE"
@@ -474,7 +473,7 @@ async function applyAction(client, action, parameters, options = {}) {
474
473
  const edits = response.edits;
475
474
  return options?.$returnEdits ? edits?.type === "edits" ? remapActionResponse(response) : edits : undefined;
476
475
  } else {
477
- const response = await chunkEY52J5Z4_cjs.Action_exports.apply(clientWithHeaders, await client.ontologyRid, action.apiName, {
476
+ const response = await chunkUSHAX4EP_cjs.Action_exports.apply(clientWithHeaders, await client.ontologyRid, action.apiName, {
478
477
  parameters: await remapActionParams(parameters, client),
479
478
  options: {
480
479
  mode: options?.$validateOnly ? "VALIDATE_ONLY" : "VALIDATE_AND_EXECUTE",
@@ -678,7 +677,7 @@ var GeotimeSeriesPropertyImpl = class {
678
677
  }
679
678
  }
680
679
  async getLatestValue() {
681
- const latestPointPromise = chunkEY52J5Z4_cjs.TimeSeriesValueBankProperty_exports.getLatestValue(this.#client, await this.#client.ontologyRid, ...this.#triplet);
680
+ const latestPointPromise = chunkUSHAX4EP_cjs.TimeSeriesValueBankProperty_exports.getLatestValue(this.#client, await this.#client.ontologyRid, ...this.#triplet);
682
681
  latestPointPromise.then(
683
682
  (latestPoint) => this.lastFetchedValue = latestPoint,
684
683
  // eslint-disable-next-line no-console
@@ -694,7 +693,7 @@ var GeotimeSeriesPropertyImpl = class {
694
693
  return allPoints;
695
694
  }
696
695
  async *asyncIterValues(query) {
697
- const streamPointsIterator = await chunkEY52J5Z4_cjs.TimeSeriesValueBankProperty_exports.streamValues(this.#client, await this.#client.ontologyRid, ...this.#triplet, query ? {
696
+ const streamPointsIterator = await chunkUSHAX4EP_cjs.TimeSeriesValueBankProperty_exports.streamValues(this.#client, await this.#client.ontologyRid, ...this.#triplet, query ? {
698
697
  range: getTimeRange(query)
699
698
  } : {});
700
699
  for await (const timeseriesPoint of asyncIterPointsHelper(streamPointsIterator)) {
@@ -718,13 +717,13 @@ var MediaReferencePropertyImpl = class {
718
717
  this.#triplet = [objectApiName, primaryKey, propertyName];
719
718
  }
720
719
  async fetchContents() {
721
- return chunkEY52J5Z4_cjs.MediaReferenceProperty_exports.getMediaContent(this.#client, await this.#client.ontologyRid, ...this.#triplet, {
720
+ return chunkUSHAX4EP_cjs.MediaReferenceProperty_exports.getMediaContent(this.#client, await this.#client.ontologyRid, ...this.#triplet, {
722
721
  preview: true
723
722
  // TODO: Can turn this back off when backend is no longer in beta.
724
723
  });
725
724
  }
726
725
  async fetchMetadata() {
727
- const r = await chunkEY52J5Z4_cjs.MediaReferenceProperty_exports.getMediaMetadata(this.#client, await this.#client.ontologyRid, ...this.#triplet, {
726
+ const r = await chunkUSHAX4EP_cjs.MediaReferenceProperty_exports.getMediaMetadata(this.#client, await this.#client.ontologyRid, ...this.#triplet, {
728
727
  preview: true
729
728
  // TODO: Can turn this back off when backend is no longer in beta.
730
729
  });
@@ -745,10 +744,10 @@ var TimeSeriesPropertyImpl = class {
745
744
  this.#triplet = [objectApiName, primaryKey, propertyName];
746
745
  }
747
746
  async getFirstPoint() {
748
- return chunkEY52J5Z4_cjs.TimeSeriesPropertyV2_exports.getFirstPoint(this.#client, await this.#client.ontologyRid, ...this.#triplet);
747
+ return chunkUSHAX4EP_cjs.TimeSeriesPropertyV2_exports.getFirstPoint(this.#client, await this.#client.ontologyRid, ...this.#triplet);
749
748
  }
750
749
  async getLastPoint() {
751
- return chunkEY52J5Z4_cjs.TimeSeriesPropertyV2_exports.getLastPoint(this.#client, await this.#client.ontologyRid, ...this.#triplet);
750
+ return chunkUSHAX4EP_cjs.TimeSeriesPropertyV2_exports.getLastPoint(this.#client, await this.#client.ontologyRid, ...this.#triplet);
752
751
  }
753
752
  async getAllPoints(query) {
754
753
  const allPoints = [];
@@ -758,7 +757,7 @@ var TimeSeriesPropertyImpl = class {
758
757
  return allPoints;
759
758
  }
760
759
  async *asyncIterPoints(query) {
761
- const streamPointsIterator = await chunkEY52J5Z4_cjs.TimeSeriesPropertyV2_exports.streamPoints(this.#client, await this.#client.ontologyRid, ...this.#triplet, query ? {
760
+ const streamPointsIterator = await chunkUSHAX4EP_cjs.TimeSeriesPropertyV2_exports.streamPoints(this.#client, await this.#client.ontologyRid, ...this.#triplet, query ? {
762
761
  range: getTimeRange(query)
763
762
  } : {});
764
763
  for await (const timeseriesPoint of asyncIterPointsHelper(streamPointsIterator)) {
@@ -767,12 +766,20 @@ var TimeSeriesPropertyImpl = class {
767
766
  }
768
767
  };
769
768
 
769
+ // src/util/objectSpecifierUtils.ts
770
+ function createObjectSpecifierFromPrimaryKey(objectDef, primaryKey) {
771
+ return `${objectDef.apiName}:${primaryKey}`;
772
+ }
773
+ function extractPrimaryKeyFromObjectSpecifier(ObjectSpecifier) {
774
+ return ObjectSpecifier.split(":")[1];
775
+ }
776
+
770
777
  // src/ontology/OntologyProvider.ts
771
778
  var InterfaceDefinitions = Symbol("InterfaceDefinitions" );
772
779
 
773
780
  // src/object/convertWireToOsdkObjects/createOsdkInterface.ts
774
781
  function createOsdkInterface(underlying, interfaceDef) {
775
- const [objApiNamespace] = chunkMCQVHD2F_cjs.extractNamespace(interfaceDef.apiName);
782
+ const [objApiNamespace] = chunkVT3UM6EP_cjs.extractNamespace(interfaceDef.apiName);
776
783
  return Object.freeze(Object.defineProperties({}, {
777
784
  // first to minimize hidden classes
778
785
  [chunkT4NIFYZS_cjs.UnderlyingOsdkObject]: {
@@ -794,6 +801,10 @@ function createOsdkInterface(underlying, interfaceDef) {
794
801
  value: underlying.$primaryKey,
795
802
  enumerable: "$primaryKey" in underlying
796
803
  },
804
+ "$objectSpecifier": {
805
+ value: underlying.$objectSpecifier,
806
+ enumerable: "$objectSpecifier" in underlying
807
+ },
797
808
  "$title": {
798
809
  value: underlying.$title,
799
810
  enumerable: "$title" in underlying
@@ -811,7 +822,7 @@ function createOsdkInterface(underlying, interfaceDef) {
811
822
  },
812
823
  ...Object.fromEntries(Object.keys(interfaceDef.properties).map((p) => {
813
824
  const objDef = underlying[chunkT4NIFYZS_cjs.ObjectDefRef];
814
- const [apiNamespace, apiName] = chunkMCQVHD2F_cjs.extractNamespace(p);
825
+ const [apiNamespace, apiName] = chunkVT3UM6EP_cjs.extractNamespace(p);
815
826
  const targetPropName = objDef.interfaceMap[interfaceDef.apiName][p];
816
827
  return [apiNamespace === objApiNamespace ? apiName : p, {
817
828
  enumerable: targetPropName in underlying,
@@ -887,8 +898,8 @@ function get$link(holder) {
887
898
  [objDef.primaryKeyApiName]: rawObj.$primaryKey
888
899
  }).pivotTo(linkName);
889
900
  const value = !linkDef.multiplicity ? {
890
- fetchOne: (options) => chunkMCQVHD2F_cjs.fetchSingle(client, objDef, options ?? {}, chunkMCQVHD2F_cjs.getWireObjectSet(objectSet)),
891
- fetchOneWithErrors: (options) => chunkMCQVHD2F_cjs.fetchSingleWithErrors(client, objDef, options ?? {}, chunkMCQVHD2F_cjs.getWireObjectSet(objectSet))
901
+ fetchOne: (options) => chunkVT3UM6EP_cjs.fetchSingle(client, objDef, options ?? {}, chunkVT3UM6EP_cjs.getWireObjectSet(objectSet)),
902
+ fetchOneWithErrors: (options) => chunkVT3UM6EP_cjs.fetchSingleWithErrors(client, objDef, options ?? {}, chunkVT3UM6EP_cjs.getWireObjectSet(objectSet))
892
903
  } : objectSet;
893
904
  return [linkName, value];
894
905
  })));
@@ -928,9 +939,16 @@ var basePropDefs = {
928
939
  };
929
940
  return createOsdkObject(this[chunkT4NIFYZS_cjs.ClientRef], this[chunkT4NIFYZS_cjs.ObjectDefRef], newObject);
930
941
  }
942
+ },
943
+ "$objectSpecifier": {
944
+ get: function() {
945
+ const rawObj = this[chunkT4NIFYZS_cjs.UnderlyingOsdkObject];
946
+ return createObjectSpecifierFromPrimaryKey(this[chunkT4NIFYZS_cjs.ObjectDefRef], rawObj.$primaryKey);
947
+ },
948
+ enumerable: true
931
949
  }
932
950
  };
933
- function createOsdkObject(client, objectDef, simpleOsdkProperties) {
951
+ function createOsdkObject(client, objectDef, simpleOsdkProperties, derivedPropertyTypeByName = {}) {
934
952
  const rawObj = simpleOsdkProperties;
935
953
  Object.defineProperties(rawObj, {
936
954
  [chunkT4NIFYZS_cjs.UnderlyingOsdkObject]: {
@@ -950,6 +968,17 @@ function createOsdkObject(client, objectDef, simpleOsdkProperties) {
950
968
  for (const propKey of Object.keys(rawObj)) {
951
969
  if (propKey in objectDef.properties && typeof objectDef.properties[propKey].type === "string" && specialPropertyTypes.has(objectDef.properties[propKey].type)) {
952
970
  rawObj[propKey] = createSpecialProperty(client, objectDef, rawObj, propKey);
971
+ } else if (propKey in derivedPropertyTypeByName && typeof derivedPropertyTypeByName[propKey].type === "string" && specialPropertyTypes.has(derivedPropertyTypeByName[propKey].type)) {
972
+ const rawValue = rawObj[propKey];
973
+ if (derivedPropertyTypeByName[propKey].type === "attachment") {
974
+ if (Array.isArray(rawValue)) {
975
+ rawObj[propKey] = rawValue.map((a) => chunkVT3UM6EP_cjs.hydrateAttachmentFromRidInternal(client, a.rid));
976
+ } else {
977
+ rawObj[propKey] = chunkVT3UM6EP_cjs.hydrateAttachmentFromRidInternal(client, rawValue.rid);
978
+ }
979
+ } else {
980
+ process.env.NODE_ENV !== "production" ? invariant__default.default(false, "Derived property aggregations for Timeseries and Media are not supported") : invariant__default.default(false) ;
981
+ }
953
982
  }
954
983
  }
955
984
  return Object.freeze(rawObj);
@@ -960,49 +989,36 @@ function createSpecialProperty(client, objectDef, rawObject, p) {
960
989
  if (process.env.NODE_ENV !== "production") {
961
990
  !(propDef != null && typeof propDef.type === "string" && specialPropertyTypes.has(propDef.type)) ? process.env.NODE_ENV !== "production" ? invariant__default.default(false) : invariant__default.default(false) : undefined;
962
991
  }
963
- {
964
- {
965
- {
966
- {
967
- if (propDef.type === "attachment") {
968
- if (Array.isArray(rawValue)) {
969
- return rawValue.map((a) => chunkMCQVHD2F_cjs.hydrateAttachmentFromRidInternal(client, a.rid));
970
- }
971
- return chunkMCQVHD2F_cjs.hydrateAttachmentFromRidInternal(client, rawValue.rid);
972
- }
973
- if (propDef.type === "numericTimeseries" || propDef.type === "stringTimeseries" || propDef.type === "sensorTimeseries") {
974
- return new TimeSeriesPropertyImpl(client, objectDef.apiName, rawObject[objectDef.primaryKeyApiName], p);
975
- }
976
- if (propDef.type === "geotimeSeriesReference") {
977
- return new GeotimeSeriesPropertyImpl(client, objectDef.apiName, rawObject[objectDef.primaryKeyApiName], p, rawValue.type === "geotimeSeriesValue" ? {
978
- time: rawValue.timestamp,
979
- value: {
980
- type: "Point",
981
- coordinates: rawValue.position
982
- }
983
- } : undefined);
984
- }
985
- if (propDef.type === "mediaReference") {
986
- return new MediaReferencePropertyImpl({
987
- client,
988
- objectApiName: objectDef.apiName,
989
- primaryKey: rawObject[objectDef.primaryKeyApiName],
990
- propertyName: p
991
- });
992
- }
993
- }
994
- }
992
+ if (propDef.type === "attachment") {
993
+ if (Array.isArray(rawValue)) {
994
+ return rawValue.map((a) => chunkVT3UM6EP_cjs.hydrateAttachmentFromRidInternal(client, a.rid));
995
995
  }
996
+ return chunkVT3UM6EP_cjs.hydrateAttachmentFromRidInternal(client, rawValue.rid);
997
+ }
998
+ if (propDef.type === "numericTimeseries" || propDef.type === "stringTimeseries" || propDef.type === "sensorTimeseries") {
999
+ return new TimeSeriesPropertyImpl(client, objectDef.apiName, rawObject[objectDef.primaryKeyApiName], p);
1000
+ }
1001
+ if (propDef.type === "geotimeSeriesReference") {
1002
+ return new GeotimeSeriesPropertyImpl(client, objectDef.apiName, rawObject[objectDef.primaryKeyApiName], p, rawValue.type === "geotimeSeriesValue" ? {
1003
+ time: rawValue.timestamp,
1004
+ value: {
1005
+ type: "Point",
1006
+ coordinates: rawValue.position
1007
+ }
1008
+ } : undefined);
1009
+ }
1010
+ if (propDef.type === "mediaReference") {
1011
+ return new MediaReferencePropertyImpl({
1012
+ client,
1013
+ objectApiName: objectDef.apiName,
1014
+ primaryKey: rawObject[objectDef.primaryKeyApiName],
1015
+ propertyName: p
1016
+ });
996
1017
  }
997
- }
998
-
999
- // src/object/createObjectSpecifierFromPrimaryKey.ts
1000
- function createObjectSpecifierFromPrimaryKey(def, primaryKey) {
1001
- return `${def.apiName}:${primaryKey}`;
1002
1018
  }
1003
1019
 
1004
1020
  // src/object/convertWireToOsdkObjects.ts
1005
- async function convertWireToOsdkObjects(client, objects, interfaceApiName, forceRemoveRid = false, selectedProps, strictNonNull = false) {
1021
+ async function convertWireToOsdkObjects(client, objects, interfaceApiName, forceRemoveRid = false, derivedPropertyTypesByName, selectedProps, strictNonNull = false) {
1006
1022
  client.logger?.debug(`START convertWireToOsdkObjects()`);
1007
1023
  fixObjectPropertiesInPlace(objects, forceRemoveRid);
1008
1024
  const ifaceDef = interfaceApiName ? await client.ontologyProvider.getInterfaceDefinition(interfaceApiName) : undefined;
@@ -1027,14 +1043,14 @@ async function convertWireToOsdkObjects(client, objects, interfaceApiName, force
1027
1043
  } else if (strictNonNull === "drop" && !conforming) {
1028
1044
  continue;
1029
1045
  }
1030
- let osdkObject = createOsdkObject(client, objectDef, rawObj);
1046
+ let osdkObject = createOsdkObject(client, objectDef, rawObj, derivedPropertyTypesByName);
1031
1047
  if (interfaceApiName) osdkObject = osdkObject.$as(interfaceApiName);
1032
1048
  ret.push(osdkObject);
1033
1049
  }
1034
1050
  client.logger?.debug(`END convertWireToOsdkObjects()`);
1035
1051
  return ret;
1036
1052
  }
1037
- async function convertWireToOsdkObjects2(client, objects, interfaceApiName, forceRemoveRid = false, selectedProps, strictNonNull = false, interfaceToObjectTypeMappings = {}) {
1053
+ async function convertWireToOsdkObjects2(client, objects, interfaceApiName, derivedPropertyTypeByName, forceRemoveRid = false, selectedProps, strictNonNull = false, interfaceToObjectTypeMappings = {}) {
1038
1054
  client.logger?.debug(`START convertWireToOsdkObjects2()`);
1039
1055
  fixObjectPropertiesInPlace(objects, forceRemoveRid);
1040
1056
  const ret = [];
@@ -1059,7 +1075,7 @@ async function convertWireToOsdkObjects2(client, objects, interfaceApiName, forc
1059
1075
  } else if (strictNonNull === "drop" && !conforming) {
1060
1076
  continue;
1061
1077
  }
1062
- let osdkObject = createOsdkObject(client, objectDef, rawObj);
1078
+ let osdkObject = createOsdkObject(client, objectDef, rawObj, derivedPropertyTypeByName);
1063
1079
  if (interfaceApiName) osdkObject = osdkObject.$as(interfaceApiName);
1064
1080
  ret.push(osdkObject);
1065
1081
  }
@@ -1126,10 +1142,6 @@ function fixObjectPropertiesInPlace(objs, forceRemoveRid) {
1126
1142
  obj.$objectType = obj.$apiName;
1127
1143
  obj.$primaryKey ??= obj.__primaryKey;
1128
1144
  obj.$title ??= obj.__title;
1129
- obj.$objectSpecifier = createObjectSpecifierFromPrimaryKey({
1130
- apiName: obj.$apiName,
1131
- type: "object"
1132
- }, obj.$primaryKey);
1133
1145
  delete obj.__apiName;
1134
1146
  delete obj.__primaryKey;
1135
1147
  delete obj.__title;
@@ -1192,11 +1204,11 @@ function createAsyncClientCache(fn, createCacheLocal = createClientCache) {
1192
1204
  return ret;
1193
1205
  }
1194
1206
  async function loadActionMetadata(client, actionType) {
1195
- const r = await chunkEY52J5Z4_cjs.ActionTypeV2_exports.get(client, await client.ontologyRid, actionType);
1207
+ const r = await chunkUSHAX4EP_cjs.ActionTypeV2_exports.get(client, await client.ontologyRid, actionType);
1196
1208
  return generatorConverters.wireActionTypeV2ToSdkActionMetadata(r);
1197
1209
  }
1198
1210
  async function loadFullObjectMetadata(client, objectType) {
1199
- const full = await chunkEY52J5Z4_cjs.ObjectTypeV2_exports.getFullMetadata(client, await client.ontologyRid, objectType, {
1211
+ const full = await chunkUSHAX4EP_cjs.ObjectTypeV2_exports.getFullMetadata(client, await client.ontologyRid, objectType, {
1200
1212
  preview: true
1201
1213
  });
1202
1214
  const ret = generatorConverters.wireObjectTypeFullMetadataToSdkObjectMetadata(full, true);
@@ -1206,13 +1218,13 @@ async function loadFullObjectMetadata(client, objectType) {
1206
1218
  };
1207
1219
  }
1208
1220
  async function loadInterfaceMetadata(client, objectType) {
1209
- const r = await chunkEY52J5Z4_cjs.OntologyInterface_exports.get(client, await client.ontologyRid, objectType, {
1221
+ const r = await chunkUSHAX4EP_cjs.OntologyInterface_exports.get(client, await client.ontologyRid, objectType, {
1210
1222
  preview: true
1211
1223
  });
1212
1224
  return generatorConverters.__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(r, true);
1213
1225
  }
1214
1226
  async function loadQueryMetadata(client, queryType) {
1215
- const r = await chunkEY52J5Z4_cjs.QueryType_exports.get(client, await client.ontologyRid, queryType);
1227
+ const r = await chunkUSHAX4EP_cjs.QueryType_exports.get(client, await client.ontologyRid, queryType);
1216
1228
  return generatorConverters.wireQueryTypeV2ToSdkQueryMetadata(r);
1217
1229
  }
1218
1230
 
@@ -1259,10 +1271,10 @@ var createStandardOntologyProviderFactory = (client) => {
1259
1271
  };
1260
1272
 
1261
1273
  // src/util/UserAgent.ts
1262
- var USER_AGENT = `osdk-client/${"2.2.0-beta.12"}`;
1274
+ var USER_AGENT = `osdk-client/${"2.2.0-beta.13"}`;
1263
1275
 
1264
1276
  // src/createMinimalClient.ts
1265
- function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory = chunkMCQVHD2F_cjs.createObjectSet, createOntologyProviderFactory = createStandardOntologyProviderFactory) {
1277
+ function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory = chunkVT3UM6EP_cjs.createObjectSet, createOntologyProviderFactory = createStandardOntologyProviderFactory) {
1266
1278
  if (process.env.NODE_ENV !== "production") {
1267
1279
  try {
1268
1280
  new URL(baseUrl);
@@ -1394,13 +1406,13 @@ async function toDataValueQueries(value, client, desiredType) {
1394
1406
  switch (desiredType.type) {
1395
1407
  case "attachment": {
1396
1408
  if (isAttachmentUpload(value)) {
1397
- const attachment = await chunkEY52J5Z4_cjs.Attachment_exports.upload(client, value.data, {
1409
+ const attachment = await chunkUSHAX4EP_cjs.Attachment_exports.upload(client, value.data, {
1398
1410
  filename: value.name
1399
1411
  });
1400
1412
  return attachment.rid;
1401
1413
  }
1402
1414
  if (isAttachmentFile(value)) {
1403
- const attachment = await chunkEY52J5Z4_cjs.Attachment_exports.upload(client, value, {
1415
+ const attachment = await chunkUSHAX4EP_cjs.Attachment_exports.upload(client, value, {
1404
1416
  filename: value.name
1405
1417
  });
1406
1418
  return attachment.rid;
@@ -1431,11 +1443,11 @@ async function toDataValueQueries(value, client, desiredType) {
1431
1443
  break;
1432
1444
  }
1433
1445
  case "objectSet": {
1434
- if (chunkMCQVHD2F_cjs.isWireObjectSet(value)) {
1446
+ if (chunkVT3UM6EP_cjs.isWireObjectSet(value)) {
1435
1447
  return value;
1436
1448
  }
1437
- if (chunkMCQVHD2F_cjs.isObjectSet(value)) {
1438
- return chunkMCQVHD2F_cjs.getWireObjectSet(value);
1449
+ if (chunkVT3UM6EP_cjs.isObjectSet(value)) {
1450
+ return chunkVT3UM6EP_cjs.getWireObjectSet(value);
1439
1451
  }
1440
1452
  break;
1441
1453
  }
@@ -1444,7 +1456,7 @@ async function toDataValueQueries(value, client, desiredType) {
1444
1456
  const entrySet = [];
1445
1457
  for (const [key, mapValue] of Object.entries(value)) {
1446
1458
  entrySet.push({
1447
- key: desiredType.keyType.type === "object" ? extractPrimaryKeyFromObjectIdentifier(key) : await toDataValueQueries(key, client, desiredType.keyType),
1459
+ key: desiredType.keyType.type === "object" ? extractPrimaryKeyFromObjectSpecifier(key) : await toDataValueQueries(key, client, desiredType.keyType),
1448
1460
  value: await toDataValueQueries(mapValue, client, desiredType.valueType)
1449
1461
  });
1450
1462
  }
@@ -1473,14 +1485,11 @@ async function toDataValueQueries(value, client, desiredType) {
1473
1485
  }
1474
1486
  return value;
1475
1487
  }
1476
- function extractPrimaryKeyFromObjectIdentifier(a) {
1477
- return a.substring(a.indexOf(":") + 1);
1478
- }
1479
1488
 
1480
1489
  // src/queries/applyQuery.ts
1481
1490
  async function applyQuery(client, query, params) {
1482
1491
  const qd = await client.ontologyProvider.getQueryDefinition(query.apiName);
1483
- const response = await chunkEY52J5Z4_cjs.Query_exports.execute(chunkEY52J5Z4_cjs.addUserAgentAndRequestContextHeaders(chunkMCQVHD2F_cjs.augmentRequestContext(client, (_) => ({
1492
+ const response = await chunkUSHAX4EP_cjs.Query_exports.execute(chunkUSHAX4EP_cjs.addUserAgentAndRequestContextHeaders(chunkVT3UM6EP_cjs.augmentRequestContext(client, (_) => ({
1484
1493
  finalMethodCall: "applyQuery"
1485
1494
  })), query), await client.ontologyRid, query.apiName, {
1486
1495
  parameters: params ? await remapQueryParams(params, client, qd.parameters) : {}
@@ -1525,11 +1534,11 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
1525
1534
  return responseValue;
1526
1535
  }
1527
1536
  case "attachment": {
1528
- return chunkMCQVHD2F_cjs.hydrateAttachmentFromRidInternal(client, responseValue);
1537
+ return chunkVT3UM6EP_cjs.hydrateAttachmentFromRidInternal(client, responseValue);
1529
1538
  }
1530
1539
  case "object": {
1531
1540
  const def = definitions.get(responseDataType.object);
1532
- if (!def) {
1541
+ if (!def || def.type !== "object") {
1533
1542
  throw new Error(`Missing definition for ${responseDataType.object}`);
1534
1543
  }
1535
1544
  return createQueryObjectResponse(responseValue, def);
@@ -1540,7 +1549,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
1540
1549
  throw new Error(`Missing definition for ${responseDataType.objectSet}`);
1541
1550
  }
1542
1551
  if (typeof responseValue === "string") {
1543
- return chunkMCQVHD2F_cjs.createObjectSet(def, client, {
1552
+ return chunkVT3UM6EP_cjs.createObjectSet(def, client, {
1544
1553
  type: "intersect",
1545
1554
  objectSets: [{
1546
1555
  type: "base",
@@ -1551,7 +1560,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
1551
1560
  }]
1552
1561
  });
1553
1562
  }
1554
- return chunkMCQVHD2F_cjs.createObjectSet(def, client, responseValue);
1563
+ return chunkVT3UM6EP_cjs.createObjectSet(def, client, responseValue);
1555
1564
  }
1556
1565
  case "struct": {
1557
1566
  for (const [key, subtype] of Object.entries(responseDataType.struct)) {
@@ -1676,7 +1685,7 @@ function requiresConversion(dataType) {
1676
1685
  }
1677
1686
  function getObjectSpecifier(primaryKey, objectTypeApiName, definitions) {
1678
1687
  const def = definitions.get(objectTypeApiName);
1679
- if (!def) {
1688
+ if (!def || def.type !== "object") {
1680
1689
  throw new Error(`Missing definition for ${objectTypeApiName}`);
1681
1690
  }
1682
1691
  return createObjectSpecifierFromPrimaryKey(def, primaryKey);
@@ -1737,7 +1746,7 @@ function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvi
1737
1746
  case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid.name:
1738
1747
  return {
1739
1748
  fetchOneByRid: async (objectType, rid, options2) => {
1740
- return await chunkMCQVHD2F_cjs.fetchSingle(clientCtx, objectType, options2, createWithRid([rid]));
1749
+ return await chunkVT3UM6EP_cjs.fetchSingle(clientCtx, objectType, options2, createWithRid([rid]));
1741
1750
  }
1742
1751
  };
1743
1752
  case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference.name:
@@ -1749,7 +1758,7 @@ function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvi
1749
1758
  objectType,
1750
1759
  propertyType
1751
1760
  } = args;
1752
- return await chunkEY52J5Z4_cjs.MediaReferenceProperty_exports.upload(clientCtx, await clientCtx.ontologyRid, objectType.apiName, propertyType, data, {
1761
+ return await chunkUSHAX4EP_cjs.MediaReferenceProperty_exports.upload(clientCtx, await clientCtx.ontologyRid, objectType.apiName, propertyType, data, {
1753
1762
  mediaItemPath: fileName,
1754
1763
  preview: true
1755
1764
  });
@@ -1758,7 +1767,7 @@ function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvi
1758
1767
  case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid.name:
1759
1768
  return {
1760
1769
  fetchPageByRid: async (objectOrInterfaceType, rids, options2 = {}) => {
1761
- return await chunkEY52J5Z4_cjs.fetchPage(clientCtx, objectOrInterfaceType, options2, createWithRid(rids));
1770
+ return await chunkUSHAX4EP_cjs.fetchPage(clientCtx, objectOrInterfaceType, options2, createWithRid(rids));
1762
1771
  }
1763
1772
  };
1764
1773
  }
@@ -1770,13 +1779,13 @@ function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvi
1770
1779
  const fetchMetadata = fetchMetadataInternal.bind(undefined, clientCtx);
1771
1780
  const symbolClientContext2 = "__osdkClientContext";
1772
1781
  const client = Object.defineProperties(clientFn, {
1773
- [chunkEY52J5Z4_cjs.symbolClientContext]: {
1782
+ [chunkUSHAX4EP_cjs.symbolClientContext]: {
1774
1783
  value: clientCtx
1775
1784
  },
1776
1785
  [symbolClientContext2]: {
1777
1786
  value: clientCtx
1778
1787
  },
1779
- [chunkEY52J5Z4_cjs.additionalContext]: {
1788
+ [chunkUSHAX4EP_cjs.additionalContext]: {
1780
1789
  value: clientCtx
1781
1790
  },
1782
1791
  fetchMetadata: {
@@ -1785,7 +1794,7 @@ function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvi
1785
1794
  });
1786
1795
  return client;
1787
1796
  }
1788
- var createClient = createClientInternal.bind(undefined, chunkMCQVHD2F_cjs.createObjectSet);
1797
+ var createClient = createClientInternal.bind(undefined, chunkVT3UM6EP_cjs.createObjectSet);
1789
1798
  function createWithRid(rids) {
1790
1799
  const withRid = {
1791
1800
  type: "static",