@osdk/client 2.2.0-beta.5 → 2.2.0-beta.7

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 (57) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/build/browser/actions/actions.test.js +52 -4
  3. package/build/browser/actions/actions.test.js.map +1 -1
  4. package/build/browser/actions/applyAction.js +21 -15
  5. package/build/browser/actions/applyAction.js.map +1 -1
  6. package/build/browser/internal/conversions/modernToLegacyGroupByClause.js +7 -0
  7. package/build/browser/internal/conversions/modernToLegacyGroupByClause.js.map +1 -1
  8. package/build/browser/internal/conversions/modernToLegacyWhereClause.js +1 -1
  9. package/build/browser/internal/conversions/modernToLegacyWhereClause.js.map +1 -1
  10. package/build/browser/object/AttachmentUpload.js +3 -0
  11. package/build/browser/object/AttachmentUpload.js.map +1 -1
  12. package/build/browser/object/aggregate.test.js +12 -2
  13. package/build/browser/object/aggregate.test.js.map +1 -1
  14. package/build/browser/observable/internal/testUtils.js +2 -0
  15. package/build/browser/observable/internal/testUtils.js.map +1 -1
  16. package/build/browser/util/UserAgent.js +1 -1
  17. package/build/browser/util/toDataValue.js +10 -2
  18. package/build/browser/util/toDataValue.js.map +1 -1
  19. package/build/browser/util/toDataValueQueries.js +10 -2
  20. package/build/browser/util/toDataValueQueries.js.map +1 -1
  21. package/build/cjs/{chunk-T5UE6BI7.cjs → chunk-IU47QMYO.cjs} +22 -15
  22. package/build/cjs/chunk-IU47QMYO.cjs.map +1 -0
  23. package/build/cjs/{chunk-X7WGNFZ4.cjs → chunk-JPENHIJB.cjs} +14 -14
  24. package/build/cjs/{chunk-X7WGNFZ4.cjs.map → chunk-JPENHIJB.cjs.map} +1 -1
  25. package/build/cjs/{graphql-JJX5MZPQ.cjs → graphql-RGM5SRWV.cjs} +43 -2
  26. package/build/cjs/graphql-RGM5SRWV.cjs.map +1 -0
  27. package/build/cjs/index.cjs +84 -59
  28. package/build/cjs/index.cjs.map +1 -1
  29. package/build/cjs/public/internal.cjs +6 -6
  30. package/build/cjs/public/unstable-do-not-use.cjs +8 -8
  31. package/build/cjs/public/unstable-do-not-use.cjs.map +1 -1
  32. package/build/esm/actions/actions.test.js +52 -4
  33. package/build/esm/actions/actions.test.js.map +1 -1
  34. package/build/esm/actions/applyAction.js +21 -15
  35. package/build/esm/actions/applyAction.js.map +1 -1
  36. package/build/esm/internal/conversions/modernToLegacyGroupByClause.js +7 -0
  37. package/build/esm/internal/conversions/modernToLegacyGroupByClause.js.map +1 -1
  38. package/build/esm/internal/conversions/modernToLegacyWhereClause.js +1 -1
  39. package/build/esm/internal/conversions/modernToLegacyWhereClause.js.map +1 -1
  40. package/build/esm/object/AttachmentUpload.js +3 -0
  41. package/build/esm/object/AttachmentUpload.js.map +1 -1
  42. package/build/esm/object/aggregate.test.js +12 -2
  43. package/build/esm/object/aggregate.test.js.map +1 -1
  44. package/build/esm/observable/internal/testUtils.js +2 -0
  45. package/build/esm/observable/internal/testUtils.js.map +1 -1
  46. package/build/esm/util/UserAgent.js +1 -1
  47. package/build/esm/util/toDataValue.js +10 -2
  48. package/build/esm/util/toDataValue.js.map +1 -1
  49. package/build/esm/util/toDataValueQueries.js +10 -2
  50. package/build/esm/util/toDataValueQueries.js.map +1 -1
  51. package/build/types/actions/applyAction.d.ts.map +1 -1
  52. package/build/types/object/AttachmentUpload.d.ts +3 -0
  53. package/build/types/object/AttachmentUpload.d.ts.map +1 -1
  54. package/build/types/observable/internal/testUtils.d.ts.map +1 -1
  55. package/package.json +9 -9
  56. package/build/cjs/chunk-T5UE6BI7.cjs.map +0 -1
  57. package/build/cjs/graphql-JJX5MZPQ.cjs.map +0 -1
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunkT5UE6BI7_cjs = require('./chunk-T5UE6BI7.cjs');
4
- var chunkX7WGNFZ4_cjs = require('./chunk-X7WGNFZ4.cjs');
3
+ var chunkIU47QMYO_cjs = require('./chunk-IU47QMYO.cjs');
4
+ var chunkJPENHIJB_cjs = require('./chunk-JPENHIJB.cjs');
5
5
  require('./chunk-Q7SFCCGT.cjs');
6
6
  var api = require('@osdk/api');
7
7
  var shared_net_errors = require('@osdk/shared.net.errors');
@@ -368,6 +368,9 @@ function getPrimaryKeyOrThrow(ref) {
368
368
  function isAttachmentUpload(o) {
369
369
  return typeof o === `object` && "name" in o && "data" in o && o.data instanceof Blob;
370
370
  }
371
+ function isAttachmentFile(o) {
372
+ return typeof o === "object" && o instanceof Blob && "name" in o;
373
+ }
371
374
  function createAttachmentUpload(data, name) {
372
375
  return {
373
376
  data,
@@ -401,17 +404,25 @@ async function toDataValue(value, client) {
401
404
  return value;
402
405
  }
403
406
  if (Array.isArray(value) || value instanceof Set) {
407
+ const values = Array.from(value);
408
+ if (values.some((dataValue) => isAttachmentUpload(dataValue) || isAttachmentFile(dataValue))) {
409
+ const converted = [];
410
+ for (const value2 of values) {
411
+ converted.push(await toDataValue(value2, client));
412
+ }
413
+ return converted;
414
+ }
404
415
  const promiseArray = Array.from(value, async (innerValue) => await toDataValue(innerValue, client));
405
416
  return Promise.all(promiseArray);
406
417
  }
407
418
  if (isAttachmentUpload(value)) {
408
- const attachment = await chunkX7WGNFZ4_cjs.Attachment_exports.upload(client, value.data, {
419
+ const attachment = await chunkJPENHIJB_cjs.Attachment_exports.upload(client, value.data, {
409
420
  filename: value.name
410
421
  });
411
422
  return await toDataValue(attachment.rid, client);
412
423
  }
413
- if (typeof value === "object" && value instanceof Blob && "name" in value) {
414
- const attachment = await chunkX7WGNFZ4_cjs.Attachment_exports.upload(client, value, {
424
+ if (isAttachmentFile(value)) {
425
+ const attachment = await chunkJPENHIJB_cjs.Attachment_exports.upload(client, value, {
415
426
  filename: value.name
416
427
  });
417
428
  return await toDataValue(attachment.rid, client);
@@ -422,11 +433,11 @@ async function toDataValue(value, client) {
422
433
  if (isOsdkBaseObject(value)) {
423
434
  return await toDataValue(value.$primaryKey, client);
424
435
  }
425
- if (chunkT5UE6BI7_cjs.isWireObjectSet(value)) {
436
+ if (chunkIU47QMYO_cjs.isWireObjectSet(value)) {
426
437
  return value;
427
438
  }
428
- if (chunkT5UE6BI7_cjs.isObjectSet(value)) {
429
- return chunkT5UE6BI7_cjs.getWireObjectSet(value);
439
+ if (chunkIU47QMYO_cjs.isObjectSet(value)) {
440
+ return chunkIU47QMYO_cjs.getWireObjectSet(value);
430
441
  }
431
442
  if (isMediaReference(value)) {
432
443
  return value;
@@ -449,11 +460,11 @@ async function toDataValue(value, client) {
449
460
 
450
461
  // src/actions/applyAction.ts
451
462
  async function applyAction(client, action, parameters, options = {}) {
452
- const clientWithHeaders = chunkX7WGNFZ4_cjs.addUserAgentAndRequestContextHeaders(chunkT5UE6BI7_cjs.augmentRequestContext(client, (_) => ({
463
+ const clientWithHeaders = chunkJPENHIJB_cjs.addUserAgentAndRequestContextHeaders(chunkIU47QMYO_cjs.augmentRequestContext(client, (_) => ({
453
464
  finalMethodCall: "applyAction"
454
465
  })), action);
455
466
  if (Array.isArray(parameters)) {
456
- const response = await chunkX7WGNFZ4_cjs.Action_exports.applyBatch(clientWithHeaders, await client.ontologyRid, action.apiName, {
467
+ const response = await chunkJPENHIJB_cjs.Action_exports.applyBatch(clientWithHeaders, await client.ontologyRid, action.apiName, {
457
468
  requests: parameters ? await remapBatchActionParams(parameters, client) : [],
458
469
  options: {
459
470
  returnEdits: options?.$returnEdits ? "ALL" : "NONE"
@@ -462,11 +473,11 @@ async function applyAction(client, action, parameters, options = {}) {
462
473
  const edits = response.edits;
463
474
  return options?.$returnEdits ? edits?.type === "edits" ? remapActionResponse(response) : edits : undefined;
464
475
  } else {
465
- const response = await chunkX7WGNFZ4_cjs.Action_exports.apply(clientWithHeaders, await client.ontologyRid, action.apiName, {
476
+ const response = await chunkJPENHIJB_cjs.Action_exports.apply(clientWithHeaders, await client.ontologyRid, action.apiName, {
466
477
  parameters: await remapActionParams(parameters, client),
467
478
  options: {
468
479
  mode: options?.$validateOnly ? "VALIDATE_ONLY" : "VALIDATE_AND_EXECUTE",
469
- returnEdits: options?.$returnEdits ? "ALL" : "NONE"
480
+ returnEdits: options?.$returnEdits ? "ALL_V2_WITH_DELETIONS" : "NONE"
470
481
  }
471
482
  });
472
483
  if (options?.$validateOnly) {
@@ -505,35 +516,41 @@ function remapActionResponse(response) {
505
516
  deletedLinksCount: editResponses.deletedLinksCount,
506
517
  deletedObjectsCount: editResponses.deletedObjectsCount,
507
518
  addedLinks: [],
519
+ deletedLinks: [],
508
520
  addedObjects: [],
521
+ deletedObjects: [],
509
522
  modifiedObjects: [],
510
523
  editedObjectTypes: []
511
524
  };
512
525
  const editedObjectTypesSet = /* @__PURE__ */ new Set();
513
526
  for (const edit of editResponses.edits) {
514
- if (edit.type === "addLink") {
515
- remappedActionResponse.addedLinks.push({
527
+ if (edit.type === "addLink" || edit.type === "deleteLink") {
528
+ const osdkEdit = {
516
529
  linkTypeApiNameAtoB: edit.linkTypeApiNameAtoB,
517
530
  linkTypeApiNameBtoA: edit.linkTypeApiNameBtoA,
518
531
  aSideObject: edit.aSideObject,
519
532
  bSideObject: edit.bSideObject
520
- });
533
+ };
534
+ edit.type === "addLink" ? remappedActionResponse.addedLinks.push(osdkEdit) : remappedActionResponse.deletedLinks?.push(osdkEdit);
521
535
  editedObjectTypesSet.add(edit.aSideObject.objectType);
522
536
  editedObjectTypesSet.add(edit.bSideObject.objectType);
523
- } else if (edit.type === "addObject") {
524
- remappedActionResponse.addedObjects.push({
525
- objectType: edit.objectType,
526
- primaryKey: edit.primaryKey
527
- });
528
- editedObjectTypesSet.add(edit.objectType);
529
- } else if (edit.type === "modifyObject") {
530
- remappedActionResponse.modifiedObjects.push({
537
+ } else if (edit.type === "addObject" || edit.type === "deleteObject" || edit.type === "modifyObject") {
538
+ const osdkEdit = {
531
539
  objectType: edit.objectType,
532
540
  primaryKey: edit.primaryKey
533
- });
541
+ };
542
+ if (edit.type === "addObject") {
543
+ remappedActionResponse.addedObjects.push(osdkEdit);
544
+ } else if (edit.type === "deleteObject") {
545
+ remappedActionResponse.deletedObjects?.push(osdkEdit);
546
+ } else if (edit.type === "modifyObject") {
547
+ remappedActionResponse.modifiedObjects.push(osdkEdit);
548
+ }
534
549
  editedObjectTypesSet.add(edit.objectType);
535
550
  } else {
536
- process.env.NODE_ENV !== "production" ? invariant__default.default(false, "Unknown edit type") : invariant__default.default(false) ;
551
+ if (process.env.NODE_ENV !== "production") {
552
+ console.warn(`Unexpected edit type: ${JSON.stringify(edit)}`);
553
+ }
537
554
  }
538
555
  }
539
556
  remappedActionResponse.editedObjectTypes = [...editedObjectTypesSet];
@@ -660,7 +677,7 @@ var GeotimeSeriesPropertyImpl = class {
660
677
  }
661
678
  }
662
679
  async getLatestValue() {
663
- const latestPointPromise = chunkX7WGNFZ4_cjs.TimeSeriesValueBankProperty_exports.getLatestValue(this.#client, await this.#client.ontologyRid, ...this.#triplet);
680
+ const latestPointPromise = chunkJPENHIJB_cjs.TimeSeriesValueBankProperty_exports.getLatestValue(this.#client, await this.#client.ontologyRid, ...this.#triplet);
664
681
  latestPointPromise.then(
665
682
  (latestPoint) => this.lastFetchedValue = latestPoint,
666
683
  // eslint-disable-next-line no-console
@@ -676,7 +693,7 @@ var GeotimeSeriesPropertyImpl = class {
676
693
  return allPoints;
677
694
  }
678
695
  async *asyncIterValues(query) {
679
- const streamPointsIterator = await chunkX7WGNFZ4_cjs.TimeSeriesValueBankProperty_exports.streamValues(this.#client, await this.#client.ontologyRid, ...this.#triplet, query ? {
696
+ const streamPointsIterator = await chunkJPENHIJB_cjs.TimeSeriesValueBankProperty_exports.streamValues(this.#client, await this.#client.ontologyRid, ...this.#triplet, query ? {
680
697
  range: getTimeRange(query)
681
698
  } : {});
682
699
  for await (const timeseriesPoint of asyncIterPointsHelper(streamPointsIterator)) {
@@ -700,13 +717,13 @@ var MediaReferencePropertyImpl = class {
700
717
  this.#triplet = [objectApiName, primaryKey, propertyName];
701
718
  }
702
719
  async fetchContents() {
703
- return chunkX7WGNFZ4_cjs.MediaReferenceProperty_exports.getMediaContent(this.#client, await this.#client.ontologyRid, ...this.#triplet, {
720
+ return chunkJPENHIJB_cjs.MediaReferenceProperty_exports.getMediaContent(this.#client, await this.#client.ontologyRid, ...this.#triplet, {
704
721
  preview: true
705
722
  // TODO: Can turn this back off when backend is no longer in beta.
706
723
  });
707
724
  }
708
725
  async fetchMetadata() {
709
- const r = await chunkX7WGNFZ4_cjs.MediaReferenceProperty_exports.getMediaMetadata(this.#client, await this.#client.ontologyRid, ...this.#triplet, {
726
+ const r = await chunkJPENHIJB_cjs.MediaReferenceProperty_exports.getMediaMetadata(this.#client, await this.#client.ontologyRid, ...this.#triplet, {
710
727
  preview: true
711
728
  // TODO: Can turn this back off when backend is no longer in beta.
712
729
  });
@@ -727,10 +744,10 @@ var TimeSeriesPropertyImpl = class {
727
744
  this.#triplet = [objectApiName, primaryKey, propertyName];
728
745
  }
729
746
  async getFirstPoint() {
730
- return chunkX7WGNFZ4_cjs.TimeSeriesPropertyV2_exports.getFirstPoint(this.#client, await this.#client.ontologyRid, ...this.#triplet);
747
+ return chunkJPENHIJB_cjs.TimeSeriesPropertyV2_exports.getFirstPoint(this.#client, await this.#client.ontologyRid, ...this.#triplet);
731
748
  }
732
749
  async getLastPoint() {
733
- return chunkX7WGNFZ4_cjs.TimeSeriesPropertyV2_exports.getLastPoint(this.#client, await this.#client.ontologyRid, ...this.#triplet);
750
+ return chunkJPENHIJB_cjs.TimeSeriesPropertyV2_exports.getLastPoint(this.#client, await this.#client.ontologyRid, ...this.#triplet);
734
751
  }
735
752
  async getAllPoints(query) {
736
753
  const allPoints = [];
@@ -740,7 +757,7 @@ var TimeSeriesPropertyImpl = class {
740
757
  return allPoints;
741
758
  }
742
759
  async *asyncIterPoints(query) {
743
- const streamPointsIterator = await chunkX7WGNFZ4_cjs.TimeSeriesPropertyV2_exports.streamPoints(this.#client, await this.#client.ontologyRid, ...this.#triplet, query ? {
760
+ const streamPointsIterator = await chunkJPENHIJB_cjs.TimeSeriesPropertyV2_exports.streamPoints(this.#client, await this.#client.ontologyRid, ...this.#triplet, query ? {
744
761
  range: getTimeRange(query)
745
762
  } : {});
746
763
  for await (const timeseriesPoint of asyncIterPointsHelper(streamPointsIterator)) {
@@ -760,7 +777,7 @@ var ClientRef = Symbol("ClientRef" );
760
777
 
761
778
  // src/object/convertWireToOsdkObjects/createOsdkInterface.ts
762
779
  function createOsdkInterface(underlying, interfaceDef) {
763
- const [objApiNamespace] = chunkT5UE6BI7_cjs.extractNamespace(interfaceDef.apiName);
780
+ const [objApiNamespace] = chunkIU47QMYO_cjs.extractNamespace(interfaceDef.apiName);
764
781
  return Object.freeze(Object.defineProperties({}, {
765
782
  // first to minimize hidden classes
766
783
  [UnderlyingOsdkObject]: {
@@ -795,7 +812,7 @@ function createOsdkInterface(underlying, interfaceDef) {
795
812
  },
796
813
  ...Object.fromEntries(Object.keys(interfaceDef.properties).map((p) => {
797
814
  const objDef = underlying[ObjectDefRef];
798
- const [apiNamespace, apiName] = chunkT5UE6BI7_cjs.extractNamespace(p);
815
+ const [apiNamespace, apiName] = chunkIU47QMYO_cjs.extractNamespace(p);
799
816
  const targetPropName = objDef.interfaceMap[interfaceDef.apiName][p];
800
817
  return [apiNamespace === objApiNamespace ? apiName : p, {
801
818
  enumerable: targetPropName in underlying,
@@ -851,8 +868,8 @@ function get$link(holder) {
851
868
  [objDef.primaryKeyApiName]: rawObj.$primaryKey
852
869
  }).pivotTo(linkName);
853
870
  const value = !linkDef.multiplicity ? {
854
- fetchOne: (options) => chunkT5UE6BI7_cjs.fetchSingle(client, objDef, options ?? {}, chunkT5UE6BI7_cjs.getWireObjectSet(objectSet)),
855
- fetchOneWithErrors: (options) => chunkT5UE6BI7_cjs.fetchSingleWithErrors(client, objDef, options ?? {}, chunkT5UE6BI7_cjs.getWireObjectSet(objectSet))
871
+ fetchOne: (options) => chunkIU47QMYO_cjs.fetchSingle(client, objDef, options ?? {}, chunkIU47QMYO_cjs.getWireObjectSet(objectSet)),
872
+ fetchOneWithErrors: (options) => chunkIU47QMYO_cjs.fetchSingleWithErrors(client, objDef, options ?? {}, chunkIU47QMYO_cjs.getWireObjectSet(objectSet))
856
873
  } : objectSet;
857
874
  return [linkName, value];
858
875
  })));
@@ -929,9 +946,9 @@ function createSpecialProperty(client, objectDef, rawObject, p) {
929
946
  {
930
947
  if (propDef.type === "attachment") {
931
948
  if (Array.isArray(rawValue)) {
932
- return rawValue.map((a) => chunkT5UE6BI7_cjs.hydrateAttachmentFromRidInternal(client, a.rid));
949
+ return rawValue.map((a) => chunkIU47QMYO_cjs.hydrateAttachmentFromRidInternal(client, a.rid));
933
950
  }
934
- return chunkT5UE6BI7_cjs.hydrateAttachmentFromRidInternal(client, rawValue.rid);
951
+ return chunkIU47QMYO_cjs.hydrateAttachmentFromRidInternal(client, rawValue.rid);
935
952
  }
936
953
  if (propDef.type === "numericTimeseries" || propDef.type === "stringTimeseries" || propDef.type === "sensorTimeseries") {
937
954
  return new TimeSeriesPropertyImpl(client, objectDef.apiName, rawObject[objectDef.primaryKeyApiName], p);
@@ -1145,11 +1162,11 @@ function createAsyncClientCache(fn, createCacheLocal = createClientCache) {
1145
1162
  return ret;
1146
1163
  }
1147
1164
  async function loadActionMetadata(client, actionType) {
1148
- const r = await chunkX7WGNFZ4_cjs.ActionTypeV2_exports.get(client, await client.ontologyRid, actionType);
1165
+ const r = await chunkJPENHIJB_cjs.ActionTypeV2_exports.get(client, await client.ontologyRid, actionType);
1149
1166
  return generatorConverters.wireActionTypeV2ToSdkActionMetadata(r);
1150
1167
  }
1151
1168
  async function loadFullObjectMetadata(client, objectType) {
1152
- const full = await chunkX7WGNFZ4_cjs.ObjectTypeV2_exports.getFullMetadata(client, await client.ontologyRid, objectType, {
1169
+ const full = await chunkJPENHIJB_cjs.ObjectTypeV2_exports.getFullMetadata(client, await client.ontologyRid, objectType, {
1153
1170
  preview: true
1154
1171
  });
1155
1172
  const ret = generatorConverters.wireObjectTypeFullMetadataToSdkObjectMetadata(full, true);
@@ -1159,13 +1176,13 @@ async function loadFullObjectMetadata(client, objectType) {
1159
1176
  };
1160
1177
  }
1161
1178
  async function loadInterfaceMetadata(client, objectType) {
1162
- const r = await chunkX7WGNFZ4_cjs.OntologyInterface_exports.get(client, await client.ontologyRid, objectType, {
1179
+ const r = await chunkJPENHIJB_cjs.OntologyInterface_exports.get(client, await client.ontologyRid, objectType, {
1163
1180
  preview: true
1164
1181
  });
1165
1182
  return generatorConverters.__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(r, true);
1166
1183
  }
1167
1184
  async function loadQueryMetadata(client, queryType) {
1168
- const r = await chunkX7WGNFZ4_cjs.QueryType_exports.get(client, await client.ontologyRid, queryType);
1185
+ const r = await chunkJPENHIJB_cjs.QueryType_exports.get(client, await client.ontologyRid, queryType);
1169
1186
  return generatorConverters.wireQueryTypeV2ToSdkQueryMetadata(r);
1170
1187
  }
1171
1188
 
@@ -1212,10 +1229,10 @@ var createStandardOntologyProviderFactory = (client) => {
1212
1229
  };
1213
1230
 
1214
1231
  // src/util/UserAgent.ts
1215
- var USER_AGENT = `osdk-client/${"2.2.0-beta.5"}`;
1232
+ var USER_AGENT = `osdk-client/${"2.2.0-beta.7"}`;
1216
1233
 
1217
1234
  // src/createMinimalClient.ts
1218
- function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory = chunkT5UE6BI7_cjs.createObjectSet) {
1235
+ function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory = chunkIU47QMYO_cjs.createObjectSet) {
1219
1236
  if (process.env.NODE_ENV !== "production") {
1220
1237
  try {
1221
1238
  new URL(baseUrl);
@@ -1271,19 +1288,27 @@ async function toDataValueQueries(value, client, desiredType) {
1271
1288
  return value;
1272
1289
  }
1273
1290
  if (Array.isArray(value) && desiredType.multiplicity) {
1291
+ const values = Array.from(value);
1292
+ if (values.some((dataValue) => isAttachmentUpload(dataValue) || isAttachmentFile(dataValue))) {
1293
+ const converted = [];
1294
+ for (const value2 of values) {
1295
+ converted.push(await toDataValueQueries(value2, client, desiredType));
1296
+ }
1297
+ return converted;
1298
+ }
1274
1299
  const promiseArray = Array.from(value, async (innerValue) => await toDataValueQueries(innerValue, client, desiredType));
1275
1300
  return Promise.all(promiseArray);
1276
1301
  }
1277
1302
  switch (desiredType.type) {
1278
1303
  case "attachment": {
1279
1304
  if (isAttachmentUpload(value)) {
1280
- const attachment = await chunkX7WGNFZ4_cjs.Attachment_exports.upload(client, value.data, {
1305
+ const attachment = await chunkJPENHIJB_cjs.Attachment_exports.upload(client, value.data, {
1281
1306
  filename: value.name
1282
1307
  });
1283
1308
  return attachment.rid;
1284
1309
  }
1285
- if (typeof value === "object" && value instanceof Blob && "name" in value) {
1286
- const attachment = await chunkX7WGNFZ4_cjs.Attachment_exports.upload(client, value, {
1310
+ if (isAttachmentFile(value)) {
1311
+ const attachment = await chunkJPENHIJB_cjs.Attachment_exports.upload(client, value, {
1287
1312
  filename: value.name
1288
1313
  });
1289
1314
  return attachment.rid;
@@ -1314,11 +1339,11 @@ async function toDataValueQueries(value, client, desiredType) {
1314
1339
  break;
1315
1340
  }
1316
1341
  case "objectSet": {
1317
- if (chunkT5UE6BI7_cjs.isWireObjectSet(value)) {
1342
+ if (chunkIU47QMYO_cjs.isWireObjectSet(value)) {
1318
1343
  return value;
1319
1344
  }
1320
- if (chunkT5UE6BI7_cjs.isObjectSet(value)) {
1321
- return chunkT5UE6BI7_cjs.getWireObjectSet(value);
1345
+ if (chunkIU47QMYO_cjs.isObjectSet(value)) {
1346
+ return chunkIU47QMYO_cjs.getWireObjectSet(value);
1322
1347
  }
1323
1348
  break;
1324
1349
  }
@@ -1347,7 +1372,7 @@ async function toDataValueQueries(value, client, desiredType) {
1347
1372
  // src/queries/applyQuery.ts
1348
1373
  async function applyQuery(client, query, params) {
1349
1374
  const qd = await client.ontologyProvider.getQueryDefinition(query.apiName);
1350
- const response = await chunkX7WGNFZ4_cjs.Query_exports.execute(chunkX7WGNFZ4_cjs.addUserAgentAndRequestContextHeaders(chunkT5UE6BI7_cjs.augmentRequestContext(client, (_) => ({
1375
+ const response = await chunkJPENHIJB_cjs.Query_exports.execute(chunkJPENHIJB_cjs.addUserAgentAndRequestContextHeaders(chunkIU47QMYO_cjs.augmentRequestContext(client, (_) => ({
1351
1376
  finalMethodCall: "applyQuery"
1352
1377
  })), query), await client.ontologyRid, query.apiName, {
1353
1378
  parameters: params ? await remapQueryParams(params, client, qd.parameters) : {}
@@ -1392,7 +1417,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
1392
1417
  return responseValue;
1393
1418
  }
1394
1419
  case "attachment": {
1395
- return chunkT5UE6BI7_cjs.hydrateAttachmentFromRidInternal(client, responseValue);
1420
+ return chunkIU47QMYO_cjs.hydrateAttachmentFromRidInternal(client, responseValue);
1396
1421
  }
1397
1422
  case "object": {
1398
1423
  const def = definitions.get(responseDataType.object);
@@ -1407,7 +1432,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
1407
1432
  throw new Error(`Missing definition for ${responseDataType.objectSet}`);
1408
1433
  }
1409
1434
  if (typeof responseValue === "string") {
1410
- return chunkT5UE6BI7_cjs.createObjectSet(def, client, {
1435
+ return chunkIU47QMYO_cjs.createObjectSet(def, client, {
1411
1436
  type: "intersect",
1412
1437
  objectSets: [{
1413
1438
  type: "base",
@@ -1418,7 +1443,7 @@ async function remapQueryResponse(client, responseDataType, responseValue, defin
1418
1443
  }]
1419
1444
  });
1420
1445
  }
1421
- return chunkT5UE6BI7_cjs.createObjectSet(def, client, responseValue);
1446
+ return chunkIU47QMYO_cjs.createObjectSet(def, client, responseValue);
1422
1447
  }
1423
1448
  case "struct": {
1424
1449
  for (const [key, subtype] of Object.entries(responseDataType.struct)) {
@@ -1573,7 +1598,7 @@ function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvi
1573
1598
  case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid.name:
1574
1599
  return {
1575
1600
  fetchOneByRid: async (objectType, rid, options2) => {
1576
- return await chunkT5UE6BI7_cjs.fetchSingle(clientCtx, objectType, options2, createWithRid(rid));
1601
+ return await chunkIU47QMYO_cjs.fetchSingle(clientCtx, objectType, options2, createWithRid(rid));
1577
1602
  }
1578
1603
  };
1579
1604
  case unstable.__EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference.name:
@@ -1585,7 +1610,7 @@ function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvi
1585
1610
  objectType,
1586
1611
  propertyType
1587
1612
  } = args;
1588
- return await chunkX7WGNFZ4_cjs.MediaReferenceProperty_exports.upload(clientCtx, await clientCtx.ontologyRid, objectType.apiName, propertyType, data, {
1613
+ return await chunkJPENHIJB_cjs.MediaReferenceProperty_exports.upload(clientCtx, await clientCtx.ontologyRid, objectType.apiName, propertyType, data, {
1589
1614
  mediaItemPath: fileName,
1590
1615
  preview: true
1591
1616
  });
@@ -1600,13 +1625,13 @@ function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvi
1600
1625
  const fetchMetadata = fetchMetadataInternal.bind(undefined, clientCtx);
1601
1626
  const symbolClientContext2 = "__osdkClientContext";
1602
1627
  const client = Object.defineProperties(clientFn, {
1603
- [chunkX7WGNFZ4_cjs.symbolClientContext]: {
1628
+ [chunkJPENHIJB_cjs.symbolClientContext]: {
1604
1629
  value: clientCtx
1605
1630
  },
1606
1631
  [symbolClientContext2]: {
1607
1632
  value: clientCtx
1608
1633
  },
1609
- [chunkX7WGNFZ4_cjs.additionalContext]: {
1634
+ [chunkJPENHIJB_cjs.additionalContext]: {
1610
1635
  value: clientCtx
1611
1636
  },
1612
1637
  fetchMetadata: {
@@ -1615,7 +1640,7 @@ function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvi
1615
1640
  });
1616
1641
  return client;
1617
1642
  }
1618
- var createClient = createClientInternal.bind(undefined, chunkT5UE6BI7_cjs.createObjectSet);
1643
+ var createClient = createClientInternal.bind(undefined, chunkIU47QMYO_cjs.createObjectSet);
1619
1644
  function createWithRid(rid) {
1620
1645
  const withRid = {
1621
1646
  type: "static",