@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.
@@ -18,14 +18,13 @@ var __export = (target, all) => {
18
18
  __defProp(target, name, { get: all[name], enumerable: true });
19
19
  };
20
20
 
21
- // ../internal.foundry.datasets/build/esm/chunk-CSAU5B4Q.js
21
+ // ../internal.foundry.datasets/build/esm/chunk-PZ5AY32C.js
22
22
  var __defProp2 = Object.defineProperty;
23
23
  var __export2 = (target, all) => {
24
- for (var name in all)
25
- __defProp2(target, name, {
26
- get: all[name],
27
- enumerable: true
28
- });
24
+ for (var name in all) __defProp2(target, name, {
25
+ get: all[name],
26
+ enumerable: true
27
+ });
29
28
  };
30
29
  async function foundryPlatformFetch(client, [httpMethodNum, origPath, flags, contentType, responseContentType], ...args) {
31
30
  const path = origPath.replace(/\{([^}]+)\}/g, () => encodeURIComponent(args.shift()));
@@ -83,7 +82,7 @@ async function apiFetch(clientCtx, method, endpointPath, data, queryArguments, h
83
82
  return response.blob();
84
83
  }
85
84
 
86
- // ../internal.foundry.datasets/build/esm/chunk-YPYY5DPJ.js
85
+ // ../internal.foundry.datasets/build/esm/chunk-3STPFXHE.js
87
86
  var Branch_exports = {};
88
87
  __export2(Branch_exports, {
89
88
  createBranch: () => createBranch,
@@ -108,7 +107,7 @@ function deleteBranch($ctx, ...args) {
108
107
  return foundryPlatformFetch($ctx, _deleteBranch, ...args);
109
108
  }
110
109
 
111
- // ../internal.foundry.datasets/build/esm/chunk-Q6FZUZ4K.js
110
+ // ../internal.foundry.datasets/build/esm/chunk-5ZK5IVCS.js
112
111
  var Dataset_exports = {};
113
112
  __export2(Dataset_exports, {
114
113
  createDataset: () => createDataset,
@@ -143,7 +142,7 @@ function deleteSchema($ctx, ...args) {
143
142
  return foundryPlatformFetch($ctx, _deleteSchema, ...args);
144
143
  }
145
144
 
146
- // ../internal.foundry.datasets/build/esm/chunk-UJYKN4YN.js
145
+ // ../internal.foundry.datasets/build/esm/chunk-N55YZHZU.js
147
146
  var File_exports = {};
148
147
  __export2(File_exports, {
149
148
  deleteFile: () => deleteFile,
@@ -173,7 +172,7 @@ function getFileContent($ctx, ...args) {
173
172
  return foundryPlatformFetch($ctx, _getFileContent, ...args);
174
173
  }
175
174
 
176
- // ../internal.foundry.datasets/build/esm/chunk-5RKMNE66.js
175
+ // ../internal.foundry.datasets/build/esm/chunk-267TDC7H.js
177
176
  var Transaction_exports = {};
178
177
  __export2(Transaction_exports, {
179
178
  abortTransaction: () => abortTransaction,
@@ -198,14 +197,13 @@ function abortTransaction($ctx, ...args) {
198
197
  return foundryPlatformFetch($ctx, _abortTransaction, ...args);
199
198
  }
200
199
 
201
- // ../internal.foundry.models/build/esm/chunk-SJUC7YTI.js
200
+ // ../internal.foundry.models/build/esm/chunk-IOTKXOZ6.js
202
201
  var __defProp3 = Object.defineProperty;
203
202
  var __export3 = (target, all) => {
204
- for (var name in all)
205
- __defProp3(target, name, {
206
- get: all[name],
207
- enumerable: true
208
- });
203
+ for (var name in all) __defProp3(target, name, {
204
+ get: all[name],
205
+ enumerable: true
206
+ });
209
207
  };
210
208
  var LanguageModel_exports = {};
211
209
  __export3(LanguageModel_exports, {
@@ -237,17 +235,16 @@ __export(esm_exports, {
237
235
  QueryTypes: () => QueryType_exports
238
236
  });
239
237
 
240
- // ../internal.foundry.ontologies/build/esm/chunk-CSAU5B4Q.js
238
+ // ../internal.foundry.ontologies/build/esm/chunk-PZ5AY32C.js
241
239
  var __defProp4 = Object.defineProperty;
242
240
  var __export4 = (target, all) => {
243
- for (var name in all)
244
- __defProp4(target, name, {
245
- get: all[name],
246
- enumerable: true
247
- });
241
+ for (var name in all) __defProp4(target, name, {
242
+ get: all[name],
243
+ enumerable: true
244
+ });
248
245
  };
249
246
 
250
- // ../internal.foundry.ontologies/build/esm/chunk-UV55E7D4.js
247
+ // ../internal.foundry.ontologies/build/esm/chunk-LTUKKONO.js
251
248
  var ActionType_exports = {};
252
249
  __export4(ActionType_exports, {
253
250
  applyAction: () => applyAction,
@@ -287,7 +284,7 @@ function validateAction($ctx, ...args) {
287
284
  return foundryPlatformFetch($ctx, _validateAction, ...args);
288
285
  }
289
286
 
290
- // ../internal.foundry.ontologies/build/esm/chunk-KU7N4OS3.js
287
+ // ../internal.foundry.ontologies/build/esm/chunk-67IRYQ4I.js
291
288
  var Attachment_exports = {};
292
289
  __export4(Attachment_exports, {
293
290
  getAttachment: () => getAttachment,
@@ -307,7 +304,7 @@ function getAttachment($ctx, ...args) {
307
304
  return foundryPlatformFetch($ctx, _getAttachment, ...args);
308
305
  }
309
306
 
310
- // ../internal.foundry.ontologies/build/esm/chunk-K2FHVG2O.js
307
+ // ../internal.foundry.ontologies/build/esm/chunk-JDBI2K4S.js
311
308
  var ObjectType_exports = {};
312
309
  __export4(ObjectType_exports, {
313
310
  getObjectType: () => getObjectType,
@@ -332,7 +329,7 @@ function getOutgoingLinkType($ctx, ...args) {
332
329
  return foundryPlatformFetch($ctx, _getOutgoingLinkType, ...args);
333
330
  }
334
331
 
335
- // ../internal.foundry.ontologies/build/esm/chunk-LB4RYVNQ.js
332
+ // ../internal.foundry.ontologies/build/esm/chunk-6OWDPN5M.js
336
333
  var Ontology_exports = {};
337
334
  __export4(Ontology_exports, {
338
335
  getOntology: () => getOntology,
@@ -347,7 +344,7 @@ function getOntology($ctx, ...args) {
347
344
  return foundryPlatformFetch($ctx, _getOntology, ...args);
348
345
  }
349
346
 
350
- // ../internal.foundry.ontologies/build/esm/chunk-FANEAZUW.js
347
+ // ../internal.foundry.ontologies/build/esm/chunk-M2AD7ARN.js
351
348
  var OntologyObject_exports = {};
352
349
  __export4(OntologyObject_exports, {
353
350
  aggregateObjects: () => aggregateObjects,
@@ -382,7 +379,7 @@ function aggregateObjects($ctx, ...args) {
382
379
  return foundryPlatformFetch($ctx, _aggregateObjects, ...args);
383
380
  }
384
381
 
385
- // ../internal.foundry.ontologies/build/esm/chunk-CRDBJVD6.js
382
+ // ../internal.foundry.ontologies/build/esm/chunk-CBKBUZ63.js
386
383
  var QueryType_exports = {};
387
384
  __export4(QueryType_exports, {
388
385
  executeQuery: () => executeQuery,
@@ -414,17 +411,16 @@ __export(esm_exports2, {
414
411
  QueryTypes: () => QueryType_exports2
415
412
  });
416
413
 
417
- // ../internal.foundry.ontologiesv2/build/esm/chunk-CSAU5B4Q.js
414
+ // ../internal.foundry.ontologiesv2/build/esm/chunk-PZ5AY32C.js
418
415
  var __defProp5 = Object.defineProperty;
419
416
  var __export5 = (target, all) => {
420
- for (var name in all)
421
- __defProp5(target, name, {
422
- get: all[name],
423
- enumerable: true
424
- });
417
+ for (var name in all) __defProp5(target, name, {
418
+ get: all[name],
419
+ enumerable: true
420
+ });
425
421
  };
426
422
 
427
- // ../internal.foundry.ontologiesv2/build/esm/chunk-UVEI3RO3.js
423
+ // ../internal.foundry.ontologiesv2/build/esm/chunk-B5JRDCDE.js
428
424
  var Action_exports = {};
429
425
  __export5(Action_exports, {
430
426
  applyActionAsyncV2: () => applyActionAsyncV2,
@@ -444,7 +440,7 @@ function applyActionAsyncV2($ctx, ...args) {
444
440
  return foundryPlatformFetch($ctx, _applyActionAsyncV2, ...args);
445
441
  }
446
442
 
447
- // ../internal.foundry.ontologiesv2/build/esm/chunk-GCLYROAR.js
443
+ // ../internal.foundry.ontologiesv2/build/esm/chunk-G4A4IJCI.js
448
444
  var ActionTypeV2_exports = {};
449
445
  __export5(ActionTypeV2_exports, {
450
446
  getActionTypeV2: () => getActionTypeV2,
@@ -459,7 +455,7 @@ function getActionTypeV2($ctx, ...args) {
459
455
  return foundryPlatformFetch($ctx, _getActionTypeV2, ...args);
460
456
  }
461
457
 
462
- // ../internal.foundry.ontologiesv2/build/esm/chunk-GUSJ3JXB.js
458
+ // ../internal.foundry.ontologiesv2/build/esm/chunk-6LZM4EP4.js
463
459
  var ObjectTypeV2_exports = {};
464
460
  __export5(ObjectTypeV2_exports, {
465
461
  getObjectTypeV2: () => getObjectTypeV2,
@@ -484,7 +480,7 @@ function getOutgoingLinkTypeV2($ctx, ...args) {
484
480
  return foundryPlatformFetch($ctx, _getOutgoingLinkTypeV2, ...args);
485
481
  }
486
482
 
487
- // ../internal.foundry.ontologiesv2/build/esm/chunk-ADT7WVKJ.js
483
+ // ../internal.foundry.ontologiesv2/build/esm/chunk-TJX6RHXS.js
488
484
  var OntologyObjectSet_exports = {};
489
485
  __export5(OntologyObjectSet_exports, {
490
486
  aggregateObjectSetV2: () => aggregateObjectSetV2,
@@ -509,7 +505,7 @@ function aggregateObjectSetV2($ctx, ...args) {
509
505
  return foundryPlatformFetch($ctx, _aggregateObjectSetV2, ...args);
510
506
  }
511
507
 
512
- // ../internal.foundry.ontologiesv2/build/esm/chunk-S2FR63YP.js
508
+ // ../internal.foundry.ontologiesv2/build/esm/chunk-U2YDEYVP.js
513
509
  var OntologyObjectV2_exports = {};
514
510
  __export5(OntologyObjectV2_exports, {
515
511
  aggregateObjectsForInterface: () => aggregateObjectsForInterface,
@@ -609,7 +605,7 @@ function getObjectTypeFullMetadata($ctx, ...args) {
609
605
  return foundryPlatformFetch($ctx, _getObjectTypeFullMetadata, ...args);
610
606
  }
611
607
 
612
- // ../internal.foundry.ontologiesv2/build/esm/chunk-QZMDTH3J.js
608
+ // ../internal.foundry.ontologiesv2/build/esm/chunk-5MBQRC34.js
613
609
  var OntologyV2_exports = {};
614
610
  __export5(OntologyV2_exports, {
615
611
  getOntologyFullMetadata: () => getOntologyFullMetadata,
@@ -629,7 +625,7 @@ function getOntologyFullMetadata($ctx, ...args) {
629
625
  return foundryPlatformFetch($ctx, _getOntologyFullMetadata, ...args);
630
626
  }
631
627
 
632
- // ../internal.foundry.ontologiesv2/build/esm/chunk-HLZX6UUL.js
628
+ // ../internal.foundry.ontologiesv2/build/esm/chunk-ASYINYCV.js
633
629
  var QueryType_exports2 = {};
634
630
  __export5(QueryType_exports2, {
635
631
  executeQueryV2: () => executeQueryV2,
@@ -678,10 +674,10 @@ function addUserAgent(client, withMetadata) {
678
674
  function createClientCache(fn) {
679
675
  const cache = /* @__PURE__ */ new WeakMap();
680
676
  function get(client, key) {
681
- if (cache.get(client) == null) {
682
- cache.set(client, /* @__PURE__ */ new Map());
677
+ if (cache.get(client.clientCacheKey) == null) {
678
+ cache.set(client.clientCacheKey, /* @__PURE__ */ new Map());
683
679
  }
684
- let r = cache.get(client).get(key);
680
+ let r = cache.get(client.clientCacheKey).get(key);
685
681
  if (r === void 0 && fn !== void 0) {
686
682
  return set(client, key, fn(client, key));
687
683
  } else {
@@ -689,16 +685,15 @@ function createClientCache(fn) {
689
685
  }
690
686
  }
691
687
  function set(client, key, value) {
692
- if (cache.get(client) == null) {
693
- cache.set(client, /* @__PURE__ */ new Map());
688
+ if (cache.get(client.clientCacheKey) == null) {
689
+ cache.set(client.clientCacheKey, /* @__PURE__ */ new Map());
694
690
  }
695
- cache.get(client).set(key, value);
691
+ cache.get(client.clientCacheKey).set(key, value);
696
692
  return value;
697
693
  }
698
694
  function remove(client, key) {
699
- if (cache.get(client) == null)
700
- return false;
701
- return cache.get(client).delete(key);
695
+ if (cache.get(client.clientCacheKey) == null) return false;
696
+ return cache.get(client.clientCacheKey).delete(key);
702
697
  }
703
698
  return {
704
699
  get,
@@ -803,8 +798,7 @@ function customInspect(_depth, options, localInspect) {
803
798
  let ret = `Osdk<${options.stylize(this[ObjectDefRef]?.apiName ?? this[InterfaceDefRef]?.apiName, "special")}> {
804
799
  `;
805
800
  for (const k of /* @__PURE__ */ new Set(["$apiName", "$objectType", "$primaryKey", ...Reflect.ownKeys(this)])) {
806
- if (typeof k === "symbol")
807
- continue;
801
+ if (typeof k === "symbol") continue;
808
802
  ret += ` ${options.stylize(k.toString(), "undefined")}: ${localInspect(this[k], newOptions)}
809
803
  `;
810
804
  }
@@ -911,8 +905,7 @@ function $asFactory(objDef) {
911
905
  }
912
906
  const underlying = this[UnderlyingOsdkObject];
913
907
  const existing = osdkObjectToInterfaceView.get(underlying).get(newDef.apiName);
914
- if (existing)
915
- return existing;
908
+ if (existing) return existing;
916
909
  const osdkInterface = createOsdkInterface(underlying, newDef);
917
910
  osdkObjectToInterfaceView.get(underlying).set(newDef.apiName, osdkInterface);
918
911
  return osdkInterface;
@@ -1080,8 +1073,7 @@ function modernToLegacyAggregationClause(select) {
1080
1073
  });
1081
1074
  }
1082
1075
  function modernToLegacyGroupByClause(groupByClause) {
1083
- if (!groupByClause)
1084
- return [];
1076
+ if (!groupByClause) return [];
1085
1077
  return Object.entries(groupByClause).flatMap(([field, type]) => {
1086
1078
  if (type === "exact") {
1087
1079
  return [{
@@ -1115,8 +1107,7 @@ function modernToLegacyGroupByClause(groupByClause) {
1115
1107
  value: type.$duration[0],
1116
1108
  unit: client_api.DurationMapping[type.$duration[1]]
1117
1109
  }];
1118
- } else
1119
- return [];
1110
+ } else return [];
1120
1111
  });
1121
1112
  }
1122
1113
  function convertRange(range) {
@@ -1142,7 +1133,7 @@ async function aggregate(clientCtx, objectType, objectSet = {
1142
1133
  if (req.$where) {
1143
1134
  body.where = modernToLegacyWhereClause(req.$where);
1144
1135
  }
1145
- const result = await esm_exports2.OntologyObjectSets.aggregateObjectSetV2(addUserAgent(clientCtx, objectType), clientCtx.ontologyRid, {
1136
+ const result = await esm_exports2.OntologyObjectSets.aggregateObjectSetV2(addUserAgent(clientCtx, objectType), await clientCtx.ontologyRid, {
1146
1137
  objectSet,
1147
1138
  groupBy: body.groupBy,
1148
1139
  aggregation: body.aggregation
@@ -1386,8 +1377,7 @@ function createOsdkObject(client, objectDef, rawObj) {
1386
1377
  case UnderlyingOsdkObject:
1387
1378
  return receiver;
1388
1379
  }
1389
- if (p in target)
1390
- return target[p];
1380
+ if (p in target) return target[p];
1391
1381
  if (p in rawObj) {
1392
1382
  const rawValue = target[RawObject][p];
1393
1383
  const propDef = objectDef.properties[p];
@@ -1454,8 +1444,7 @@ async function convertWireToOsdkObjects(client, objects, interfaceApiName, force
1454
1444
  continue;
1455
1445
  }
1456
1446
  let osdkObject = createOsdkObject(client, objectDef, rawObj);
1457
- if (interfaceApiName)
1458
- osdkObject = osdkObject.$as(interfaceApiName);
1447
+ if (interfaceApiName) osdkObject = osdkObject.$as(interfaceApiName);
1459
1448
  ret.push(osdkObject);
1460
1449
  }
1461
1450
  client.logger?.debug(`END convertWireToOsdkObjects()`);
@@ -1548,7 +1537,7 @@ function objectSetToSearchJsonV2(objectSet, expectedApiName, existingWhere = voi
1548
1537
  throw new Error(`Unsupported objectSet type: ${objectSet.type}`);
1549
1538
  }
1550
1539
  async function fetchInterfacePage(client, interfaceType, args, objectSet) {
1551
- const result = await esm_exports2.OntologyObjectsV2.searchObjectsForInterface(addUserAgent(client, interfaceType), client.ontologyRid, interfaceType.apiName, applyFetchArgs(args, {
1540
+ const result = await esm_exports2.OntologyObjectsV2.searchObjectsForInterface(addUserAgent(client, interfaceType), await client.ontologyRid, interfaceType.apiName, applyFetchArgs(args, {
1552
1541
  augmentedProperties: args.$augment ?? {},
1553
1542
  augmentedSharedPropertyTypes: {},
1554
1543
  otherInterfaceTypes: [],
@@ -1615,7 +1604,7 @@ function applyFetchArgs(args, body) {
1615
1604
  return body;
1616
1605
  }
1617
1606
  async function fetchObjectPage(client, objectType, args, objectSet) {
1618
- const r = await esm_exports2.OntologyObjectSets.loadObjectSetV2(addUserAgent(client, objectType), client.ontologyRid, applyFetchArgs(args, {
1607
+ const r = await esm_exports2.OntologyObjectSets.loadObjectSetV2(addUserAgent(client, objectType), await client.ontologyRid, applyFetchArgs(args, {
1619
1608
  objectSet,
1620
1609
  // We have to do the following case because LoadObjectSetRequestV2 isnt readonly
1621
1610
  select: args?.$select ?? [],
@@ -1686,7 +1675,7 @@ async function toDataValue(value, client) {
1686
1675
  // src/actions/applyAction.ts
1687
1676
  async function applyAction2(client, action, parameters, options = {}) {
1688
1677
  if (Array.isArray(parameters)) {
1689
- const response = await esm_exports2.Actions.applyActionBatchV2(addUserAgent(client, action), client.ontologyRid, action.apiName, {
1678
+ const response = await esm_exports2.Actions.applyActionBatchV2(addUserAgent(client, action), await client.ontologyRid, action.apiName, {
1690
1679
  requests: parameters ? await remapBatchActionParams(parameters, client) : [],
1691
1680
  options: {
1692
1681
  returnEdits: options?.$returnEdits ? "ALL" : "NONE"
@@ -1694,7 +1683,7 @@ async function applyAction2(client, action, parameters, options = {}) {
1694
1683
  });
1695
1684
  return options?.$returnEdits ? response.edits : void 0;
1696
1685
  } else {
1697
- const response = await esm_exports2.Actions.applyActionV2(addUserAgent(client, action), client.ontologyRid, action.apiName, {
1686
+ const response = await esm_exports2.Actions.applyActionV2(addUserAgent(client, action), await client.ontologyRid, action.apiName, {
1698
1687
  parameters: await remapActionParams(parameters, client),
1699
1688
  options: {
1700
1689
  mode: options?.$validateOnly ? "VALIDATE_ONLY" : "VALIDATE_AND_EXECUTE",
@@ -1729,7 +1718,7 @@ async function remapBatchActionParams(params, client) {
1729
1718
  return remappedParams;
1730
1719
  }
1731
1720
  async function loadFullObjectMetadata(client, objtype) {
1732
- const full = await esm_exports2.OntologyObjectsV2.getObjectTypeFullMetadata(client, client.ontologyRid, objtype, {
1721
+ const full = await esm_exports2.OntologyObjectsV2.getObjectTypeFullMetadata(client, await client.ontologyRid, objtype, {
1733
1722
  preview: true
1734
1723
  });
1735
1724
  const ret = generatorConverters.wireObjectTypeFullMetadataToSdkObjectTypeDefinition(full, true);
@@ -1740,7 +1729,7 @@ async function loadFullObjectMetadata(client, objtype) {
1740
1729
  };
1741
1730
  }
1742
1731
  async function loadInterfaceDefinition(client, objtype) {
1743
- const r = await esm_exports2.OntologyObjectsV2.getInterfaceType(client, client.ontologyRid, objtype, {
1732
+ const r = await esm_exports2.OntologyObjectsV2.getInterfaceType(client, await client.ontologyRid, objtype, {
1744
1733
  preview: true
1745
1734
  });
1746
1735
  return generatorConverters.__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(r, true);
@@ -1781,7 +1770,7 @@ var createStandardOntologyProviderFactory = (client) => {
1781
1770
  };
1782
1771
 
1783
1772
  // src/util/UserAgent.ts
1784
- var USER_AGENT = `osdk-client/${"0.20.0-beta.2"}`;
1773
+ var USER_AGENT = `osdk-client/${"0.20.0-beta.3"}`;
1785
1774
 
1786
1775
  // src/createMinimalClient.ts
1787
1776
  function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory = createObjectSet) {
@@ -1797,7 +1786,8 @@ function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fet
1797
1786
  ...shared_client_impl.createSharedClientContext(baseUrl, tokenProvider, USER_AGENT, fetchFn),
1798
1787
  objectSetFactory,
1799
1788
  ontologyRid: metadata.ontologyRid,
1800
- logger: options.logger
1789
+ logger: options.logger,
1790
+ clientCacheKey: {}
1801
1791
  };
1802
1792
  return Object.assign(minimalClient, {
1803
1793
  ontologyProvider: createStandardOntologyProviderFactory()(minimalClient)
@@ -1845,4 +1835,4 @@ exports.createObjectSet = createObjectSet;
1845
1835
  exports.createSimpleAsyncCache = createSimpleAsyncCache;
1846
1836
  exports.esm_exports = esm_exports2;
1847
1837
  //# sourceMappingURL=out.js.map
1848
- //# sourceMappingURL=chunk-VG5EKGOO.cjs.map
1838
+ //# sourceMappingURL=chunk-EP4KLU3N.cjs.map