@osdk/client 0.20.0-beta.2 → 0.20.0-beta.3

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.
@@ -12,14 +12,13 @@ var __export = (target, all) => {
12
12
  __defProp(target, name, { get: all[name], enumerable: true });
13
13
  };
14
14
 
15
- // ../internal.foundry.datasets/build/esm/chunk-CSAU5B4Q.js
15
+ // ../internal.foundry.datasets/build/esm/chunk-PZ5AY32C.js
16
16
  var __defProp2 = Object.defineProperty;
17
17
  var __export2 = (target, all) => {
18
- for (var name in all)
19
- __defProp2(target, name, {
20
- get: all[name],
21
- enumerable: true
22
- });
18
+ for (var name in all) __defProp2(target, name, {
19
+ get: all[name],
20
+ enumerable: true
21
+ });
23
22
  };
24
23
  async function foundryPlatformFetch(client, [httpMethodNum, origPath, flags, contentType, responseContentType], ...args) {
25
24
  const path = origPath.replace(/\{([^}]+)\}/g, () => encodeURIComponent(args.shift()));
@@ -77,7 +76,7 @@ async function apiFetch(clientCtx, method, endpointPath, data, queryArguments, h
77
76
  return response.blob();
78
77
  }
79
78
 
80
- // ../internal.foundry.datasets/build/esm/chunk-YPYY5DPJ.js
79
+ // ../internal.foundry.datasets/build/esm/chunk-3STPFXHE.js
81
80
  var Branch_exports = {};
82
81
  __export2(Branch_exports, {
83
82
  createBranch: () => createBranch,
@@ -102,7 +101,7 @@ function deleteBranch($ctx, ...args) {
102
101
  return foundryPlatformFetch($ctx, _deleteBranch, ...args);
103
102
  }
104
103
 
105
- // ../internal.foundry.datasets/build/esm/chunk-Q6FZUZ4K.js
104
+ // ../internal.foundry.datasets/build/esm/chunk-5ZK5IVCS.js
106
105
  var Dataset_exports = {};
107
106
  __export2(Dataset_exports, {
108
107
  createDataset: () => createDataset,
@@ -137,7 +136,7 @@ function deleteSchema($ctx, ...args) {
137
136
  return foundryPlatformFetch($ctx, _deleteSchema, ...args);
138
137
  }
139
138
 
140
- // ../internal.foundry.datasets/build/esm/chunk-UJYKN4YN.js
139
+ // ../internal.foundry.datasets/build/esm/chunk-N55YZHZU.js
141
140
  var File_exports = {};
142
141
  __export2(File_exports, {
143
142
  deleteFile: () => deleteFile,
@@ -167,7 +166,7 @@ function getFileContent($ctx, ...args) {
167
166
  return foundryPlatformFetch($ctx, _getFileContent, ...args);
168
167
  }
169
168
 
170
- // ../internal.foundry.datasets/build/esm/chunk-5RKMNE66.js
169
+ // ../internal.foundry.datasets/build/esm/chunk-267TDC7H.js
171
170
  var Transaction_exports = {};
172
171
  __export2(Transaction_exports, {
173
172
  abortTransaction: () => abortTransaction,
@@ -192,14 +191,13 @@ function abortTransaction($ctx, ...args) {
192
191
  return foundryPlatformFetch($ctx, _abortTransaction, ...args);
193
192
  }
194
193
 
195
- // ../internal.foundry.models/build/esm/chunk-SJUC7YTI.js
194
+ // ../internal.foundry.models/build/esm/chunk-IOTKXOZ6.js
196
195
  var __defProp3 = Object.defineProperty;
197
196
  var __export3 = (target, all) => {
198
- for (var name in all)
199
- __defProp3(target, name, {
200
- get: all[name],
201
- enumerable: true
202
- });
197
+ for (var name in all) __defProp3(target, name, {
198
+ get: all[name],
199
+ enumerable: true
200
+ });
203
201
  };
204
202
  var LanguageModel_exports = {};
205
203
  __export3(LanguageModel_exports, {
@@ -231,17 +229,16 @@ __export(esm_exports, {
231
229
  QueryTypes: () => QueryType_exports
232
230
  });
233
231
 
234
- // ../internal.foundry.ontologies/build/esm/chunk-CSAU5B4Q.js
232
+ // ../internal.foundry.ontologies/build/esm/chunk-PZ5AY32C.js
235
233
  var __defProp4 = Object.defineProperty;
236
234
  var __export4 = (target, all) => {
237
- for (var name in all)
238
- __defProp4(target, name, {
239
- get: all[name],
240
- enumerable: true
241
- });
235
+ for (var name in all) __defProp4(target, name, {
236
+ get: all[name],
237
+ enumerable: true
238
+ });
242
239
  };
243
240
 
244
- // ../internal.foundry.ontologies/build/esm/chunk-UV55E7D4.js
241
+ // ../internal.foundry.ontologies/build/esm/chunk-LTUKKONO.js
245
242
  var ActionType_exports = {};
246
243
  __export4(ActionType_exports, {
247
244
  applyAction: () => applyAction,
@@ -281,7 +278,7 @@ function validateAction($ctx, ...args) {
281
278
  return foundryPlatformFetch($ctx, _validateAction, ...args);
282
279
  }
283
280
 
284
- // ../internal.foundry.ontologies/build/esm/chunk-KU7N4OS3.js
281
+ // ../internal.foundry.ontologies/build/esm/chunk-67IRYQ4I.js
285
282
  var Attachment_exports = {};
286
283
  __export4(Attachment_exports, {
287
284
  getAttachment: () => getAttachment,
@@ -301,7 +298,7 @@ function getAttachment($ctx, ...args) {
301
298
  return foundryPlatformFetch($ctx, _getAttachment, ...args);
302
299
  }
303
300
 
304
- // ../internal.foundry.ontologies/build/esm/chunk-K2FHVG2O.js
301
+ // ../internal.foundry.ontologies/build/esm/chunk-JDBI2K4S.js
305
302
  var ObjectType_exports = {};
306
303
  __export4(ObjectType_exports, {
307
304
  getObjectType: () => getObjectType,
@@ -326,7 +323,7 @@ function getOutgoingLinkType($ctx, ...args) {
326
323
  return foundryPlatformFetch($ctx, _getOutgoingLinkType, ...args);
327
324
  }
328
325
 
329
- // ../internal.foundry.ontologies/build/esm/chunk-LB4RYVNQ.js
326
+ // ../internal.foundry.ontologies/build/esm/chunk-6OWDPN5M.js
330
327
  var Ontology_exports = {};
331
328
  __export4(Ontology_exports, {
332
329
  getOntology: () => getOntology,
@@ -341,7 +338,7 @@ function getOntology($ctx, ...args) {
341
338
  return foundryPlatformFetch($ctx, _getOntology, ...args);
342
339
  }
343
340
 
344
- // ../internal.foundry.ontologies/build/esm/chunk-FANEAZUW.js
341
+ // ../internal.foundry.ontologies/build/esm/chunk-M2AD7ARN.js
345
342
  var OntologyObject_exports = {};
346
343
  __export4(OntologyObject_exports, {
347
344
  aggregateObjects: () => aggregateObjects,
@@ -376,7 +373,7 @@ function aggregateObjects($ctx, ...args) {
376
373
  return foundryPlatformFetch($ctx, _aggregateObjects, ...args);
377
374
  }
378
375
 
379
- // ../internal.foundry.ontologies/build/esm/chunk-CRDBJVD6.js
376
+ // ../internal.foundry.ontologies/build/esm/chunk-CBKBUZ63.js
380
377
  var QueryType_exports = {};
381
378
  __export4(QueryType_exports, {
382
379
  executeQuery: () => executeQuery,
@@ -408,17 +405,16 @@ __export(esm_exports2, {
408
405
  QueryTypes: () => QueryType_exports2
409
406
  });
410
407
 
411
- // ../internal.foundry.ontologiesv2/build/esm/chunk-CSAU5B4Q.js
408
+ // ../internal.foundry.ontologiesv2/build/esm/chunk-PZ5AY32C.js
412
409
  var __defProp5 = Object.defineProperty;
413
410
  var __export5 = (target, all) => {
414
- for (var name in all)
415
- __defProp5(target, name, {
416
- get: all[name],
417
- enumerable: true
418
- });
411
+ for (var name in all) __defProp5(target, name, {
412
+ get: all[name],
413
+ enumerable: true
414
+ });
419
415
  };
420
416
 
421
- // ../internal.foundry.ontologiesv2/build/esm/chunk-UVEI3RO3.js
417
+ // ../internal.foundry.ontologiesv2/build/esm/chunk-B5JRDCDE.js
422
418
  var Action_exports = {};
423
419
  __export5(Action_exports, {
424
420
  applyActionAsyncV2: () => applyActionAsyncV2,
@@ -438,7 +434,7 @@ function applyActionAsyncV2($ctx, ...args) {
438
434
  return foundryPlatformFetch($ctx, _applyActionAsyncV2, ...args);
439
435
  }
440
436
 
441
- // ../internal.foundry.ontologiesv2/build/esm/chunk-GCLYROAR.js
437
+ // ../internal.foundry.ontologiesv2/build/esm/chunk-G4A4IJCI.js
442
438
  var ActionTypeV2_exports = {};
443
439
  __export5(ActionTypeV2_exports, {
444
440
  getActionTypeV2: () => getActionTypeV2,
@@ -453,7 +449,7 @@ function getActionTypeV2($ctx, ...args) {
453
449
  return foundryPlatformFetch($ctx, _getActionTypeV2, ...args);
454
450
  }
455
451
 
456
- // ../internal.foundry.ontologiesv2/build/esm/chunk-GUSJ3JXB.js
452
+ // ../internal.foundry.ontologiesv2/build/esm/chunk-6LZM4EP4.js
457
453
  var ObjectTypeV2_exports = {};
458
454
  __export5(ObjectTypeV2_exports, {
459
455
  getObjectTypeV2: () => getObjectTypeV2,
@@ -478,7 +474,7 @@ function getOutgoingLinkTypeV2($ctx, ...args) {
478
474
  return foundryPlatformFetch($ctx, _getOutgoingLinkTypeV2, ...args);
479
475
  }
480
476
 
481
- // ../internal.foundry.ontologiesv2/build/esm/chunk-ADT7WVKJ.js
477
+ // ../internal.foundry.ontologiesv2/build/esm/chunk-TJX6RHXS.js
482
478
  var OntologyObjectSet_exports = {};
483
479
  __export5(OntologyObjectSet_exports, {
484
480
  aggregateObjectSetV2: () => aggregateObjectSetV2,
@@ -503,7 +499,7 @@ function aggregateObjectSetV2($ctx, ...args) {
503
499
  return foundryPlatformFetch($ctx, _aggregateObjectSetV2, ...args);
504
500
  }
505
501
 
506
- // ../internal.foundry.ontologiesv2/build/esm/chunk-S2FR63YP.js
502
+ // ../internal.foundry.ontologiesv2/build/esm/chunk-U2YDEYVP.js
507
503
  var OntologyObjectV2_exports = {};
508
504
  __export5(OntologyObjectV2_exports, {
509
505
  aggregateObjectsForInterface: () => aggregateObjectsForInterface,
@@ -603,7 +599,7 @@ function getObjectTypeFullMetadata($ctx, ...args) {
603
599
  return foundryPlatformFetch($ctx, _getObjectTypeFullMetadata, ...args);
604
600
  }
605
601
 
606
- // ../internal.foundry.ontologiesv2/build/esm/chunk-QZMDTH3J.js
602
+ // ../internal.foundry.ontologiesv2/build/esm/chunk-5MBQRC34.js
607
603
  var OntologyV2_exports = {};
608
604
  __export5(OntologyV2_exports, {
609
605
  getOntologyFullMetadata: () => getOntologyFullMetadata,
@@ -623,7 +619,7 @@ function getOntologyFullMetadata($ctx, ...args) {
623
619
  return foundryPlatformFetch($ctx, _getOntologyFullMetadata, ...args);
624
620
  }
625
621
 
626
- // ../internal.foundry.ontologiesv2/build/esm/chunk-HLZX6UUL.js
622
+ // ../internal.foundry.ontologiesv2/build/esm/chunk-ASYINYCV.js
627
623
  var QueryType_exports2 = {};
628
624
  __export5(QueryType_exports2, {
629
625
  executeQueryV2: () => executeQueryV2,
@@ -672,10 +668,10 @@ function addUserAgent(client, withMetadata) {
672
668
  function createClientCache(fn) {
673
669
  const cache = /* @__PURE__ */ new WeakMap();
674
670
  function get(client, key) {
675
- if (cache.get(client) == null) {
676
- cache.set(client, /* @__PURE__ */ new Map());
671
+ if (cache.get(client.clientCacheKey) == null) {
672
+ cache.set(client.clientCacheKey, /* @__PURE__ */ new Map());
677
673
  }
678
- let r = cache.get(client).get(key);
674
+ let r = cache.get(client.clientCacheKey).get(key);
679
675
  if (r === void 0 && fn !== void 0) {
680
676
  return set(client, key, fn(client, key));
681
677
  } else {
@@ -683,16 +679,15 @@ function createClientCache(fn) {
683
679
  }
684
680
  }
685
681
  function set(client, key, value) {
686
- if (cache.get(client) == null) {
687
- cache.set(client, /* @__PURE__ */ new Map());
682
+ if (cache.get(client.clientCacheKey) == null) {
683
+ cache.set(client.clientCacheKey, /* @__PURE__ */ new Map());
688
684
  }
689
- cache.get(client).set(key, value);
685
+ cache.get(client.clientCacheKey).set(key, value);
690
686
  return value;
691
687
  }
692
688
  function remove(client, key) {
693
- if (cache.get(client) == null)
694
- return false;
695
- return cache.get(client).delete(key);
689
+ if (cache.get(client.clientCacheKey) == null) return false;
690
+ return cache.get(client.clientCacheKey).delete(key);
696
691
  }
697
692
  return {
698
693
  get,
@@ -797,8 +792,7 @@ function customInspect(_depth, options, localInspect) {
797
792
  let ret = `Osdk<${options.stylize(this[ObjectDefRef]?.apiName ?? this[InterfaceDefRef]?.apiName, "special")}> {
798
793
  `;
799
794
  for (const k of /* @__PURE__ */ new Set(["$apiName", "$objectType", "$primaryKey", ...Reflect.ownKeys(this)])) {
800
- if (typeof k === "symbol")
801
- continue;
795
+ if (typeof k === "symbol") continue;
802
796
  ret += ` ${options.stylize(k.toString(), "undefined")}: ${localInspect(this[k], newOptions)}
803
797
  `;
804
798
  }
@@ -905,8 +899,7 @@ function $asFactory(objDef) {
905
899
  }
906
900
  const underlying = this[UnderlyingOsdkObject];
907
901
  const existing = osdkObjectToInterfaceView.get(underlying).get(newDef.apiName);
908
- if (existing)
909
- return existing;
902
+ if (existing) return existing;
910
903
  const osdkInterface = createOsdkInterface(underlying, newDef);
911
904
  osdkObjectToInterfaceView.get(underlying).set(newDef.apiName, osdkInterface);
912
905
  return osdkInterface;
@@ -1074,8 +1067,7 @@ function modernToLegacyAggregationClause(select) {
1074
1067
  });
1075
1068
  }
1076
1069
  function modernToLegacyGroupByClause(groupByClause) {
1077
- if (!groupByClause)
1078
- return [];
1070
+ if (!groupByClause) return [];
1079
1071
  return Object.entries(groupByClause).flatMap(([field, type]) => {
1080
1072
  if (type === "exact") {
1081
1073
  return [{
@@ -1109,8 +1101,7 @@ function modernToLegacyGroupByClause(groupByClause) {
1109
1101
  value: type.$duration[0],
1110
1102
  unit: DurationMapping[type.$duration[1]]
1111
1103
  }];
1112
- } else
1113
- return [];
1104
+ } else return [];
1114
1105
  });
1115
1106
  }
1116
1107
  function convertRange(range) {
@@ -1136,7 +1127,7 @@ async function aggregate(clientCtx, objectType, objectSet = {
1136
1127
  if (req.$where) {
1137
1128
  body.where = modernToLegacyWhereClause(req.$where);
1138
1129
  }
1139
- const result = await esm_exports2.OntologyObjectSets.aggregateObjectSetV2(addUserAgent(clientCtx, objectType), clientCtx.ontologyRid, {
1130
+ const result = await esm_exports2.OntologyObjectSets.aggregateObjectSetV2(addUserAgent(clientCtx, objectType), await clientCtx.ontologyRid, {
1140
1131
  objectSet,
1141
1132
  groupBy: body.groupBy,
1142
1133
  aggregation: body.aggregation
@@ -1380,8 +1371,7 @@ function createOsdkObject(client, objectDef, rawObj) {
1380
1371
  case UnderlyingOsdkObject:
1381
1372
  return receiver;
1382
1373
  }
1383
- if (p in target)
1384
- return target[p];
1374
+ if (p in target) return target[p];
1385
1375
  if (p in rawObj) {
1386
1376
  const rawValue = target[RawObject][p];
1387
1377
  const propDef = objectDef.properties[p];
@@ -1448,8 +1438,7 @@ async function convertWireToOsdkObjects(client, objects, interfaceApiName, force
1448
1438
  continue;
1449
1439
  }
1450
1440
  let osdkObject = createOsdkObject(client, objectDef, rawObj);
1451
- if (interfaceApiName)
1452
- osdkObject = osdkObject.$as(interfaceApiName);
1441
+ if (interfaceApiName) osdkObject = osdkObject.$as(interfaceApiName);
1453
1442
  ret.push(osdkObject);
1454
1443
  }
1455
1444
  client.logger?.debug(`END convertWireToOsdkObjects()`);
@@ -1542,7 +1531,7 @@ function objectSetToSearchJsonV2(objectSet, expectedApiName, existingWhere = voi
1542
1531
  throw new Error(`Unsupported objectSet type: ${objectSet.type}`);
1543
1532
  }
1544
1533
  async function fetchInterfacePage(client, interfaceType, args, objectSet) {
1545
- const result = await esm_exports2.OntologyObjectsV2.searchObjectsForInterface(addUserAgent(client, interfaceType), client.ontologyRid, interfaceType.apiName, applyFetchArgs(args, {
1534
+ const result = await esm_exports2.OntologyObjectsV2.searchObjectsForInterface(addUserAgent(client, interfaceType), await client.ontologyRid, interfaceType.apiName, applyFetchArgs(args, {
1546
1535
  augmentedProperties: args.$augment ?? {},
1547
1536
  augmentedSharedPropertyTypes: {},
1548
1537
  otherInterfaceTypes: [],
@@ -1609,7 +1598,7 @@ function applyFetchArgs(args, body) {
1609
1598
  return body;
1610
1599
  }
1611
1600
  async function fetchObjectPage(client, objectType, args, objectSet) {
1612
- const r = await esm_exports2.OntologyObjectSets.loadObjectSetV2(addUserAgent(client, objectType), client.ontologyRid, applyFetchArgs(args, {
1601
+ const r = await esm_exports2.OntologyObjectSets.loadObjectSetV2(addUserAgent(client, objectType), await client.ontologyRid, applyFetchArgs(args, {
1613
1602
  objectSet,
1614
1603
  // We have to do the following case because LoadObjectSetRequestV2 isnt readonly
1615
1604
  select: args?.$select ?? [],
@@ -1680,7 +1669,7 @@ async function toDataValue(value, client) {
1680
1669
  // src/actions/applyAction.ts
1681
1670
  async function applyAction2(client, action, parameters, options = {}) {
1682
1671
  if (Array.isArray(parameters)) {
1683
- const response = await esm_exports2.Actions.applyActionBatchV2(addUserAgent(client, action), client.ontologyRid, action.apiName, {
1672
+ const response = await esm_exports2.Actions.applyActionBatchV2(addUserAgent(client, action), await client.ontologyRid, action.apiName, {
1684
1673
  requests: parameters ? await remapBatchActionParams(parameters, client) : [],
1685
1674
  options: {
1686
1675
  returnEdits: options?.$returnEdits ? "ALL" : "NONE"
@@ -1688,7 +1677,7 @@ async function applyAction2(client, action, parameters, options = {}) {
1688
1677
  });
1689
1678
  return options?.$returnEdits ? response.edits : void 0;
1690
1679
  } else {
1691
- const response = await esm_exports2.Actions.applyActionV2(addUserAgent(client, action), client.ontologyRid, action.apiName, {
1680
+ const response = await esm_exports2.Actions.applyActionV2(addUserAgent(client, action), await client.ontologyRid, action.apiName, {
1692
1681
  parameters: await remapActionParams(parameters, client),
1693
1682
  options: {
1694
1683
  mode: options?.$validateOnly ? "VALIDATE_ONLY" : "VALIDATE_AND_EXECUTE",
@@ -1723,7 +1712,7 @@ async function remapBatchActionParams(params, client) {
1723
1712
  return remappedParams;
1724
1713
  }
1725
1714
  async function loadFullObjectMetadata(client, objtype) {
1726
- const full = await esm_exports2.OntologyObjectsV2.getObjectTypeFullMetadata(client, client.ontologyRid, objtype, {
1715
+ const full = await esm_exports2.OntologyObjectsV2.getObjectTypeFullMetadata(client, await client.ontologyRid, objtype, {
1727
1716
  preview: true
1728
1717
  });
1729
1718
  const ret = wireObjectTypeFullMetadataToSdkObjectTypeDefinition(full, true);
@@ -1734,7 +1723,7 @@ async function loadFullObjectMetadata(client, objtype) {
1734
1723
  };
1735
1724
  }
1736
1725
  async function loadInterfaceDefinition(client, objtype) {
1737
- const r = await esm_exports2.OntologyObjectsV2.getInterfaceType(client, client.ontologyRid, objtype, {
1726
+ const r = await esm_exports2.OntologyObjectsV2.getInterfaceType(client, await client.ontologyRid, objtype, {
1738
1727
  preview: true
1739
1728
  });
1740
1729
  return __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(r, true);
@@ -1775,7 +1764,7 @@ var createStandardOntologyProviderFactory = (client) => {
1775
1764
  };
1776
1765
 
1777
1766
  // src/util/UserAgent.ts
1778
- var USER_AGENT = `osdk-client/${"0.20.0-beta.2"}`;
1767
+ var USER_AGENT = `osdk-client/${"0.20.0-beta.3"}`;
1779
1768
 
1780
1769
  // src/createMinimalClient.ts
1781
1770
  function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory = createObjectSet) {
@@ -1791,7 +1780,8 @@ function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fet
1791
1780
  ...createSharedClientContext(baseUrl, tokenProvider, USER_AGENT, fetchFn),
1792
1781
  objectSetFactory,
1793
1782
  ontologyRid: metadata.ontologyRid,
1794
- logger: options.logger
1783
+ logger: options.logger,
1784
+ clientCacheKey: {}
1795
1785
  };
1796
1786
  return Object.assign(minimalClient, {
1797
1787
  ontologyProvider: createStandardOntologyProviderFactory()(minimalClient)
@@ -1830,4 +1820,4 @@ var createClient = createClientInternal.bind(void 0, createObjectSet);
1830
1820
 
1831
1821
  export { ActionValidationError, USER_AGENT, augment, convertWireToOsdkObjects, createAttachmentFromRid, createClient, createClientInternal, createObjectSet, createSimpleAsyncCache, esm_exports2 as esm_exports };
1832
1822
  //# sourceMappingURL=out.js.map
1833
- //# sourceMappingURL=chunk-2XJ62QSF.js.map
1823
+ //# sourceMappingURL=chunk-JRG5V55N.js.map