@osdk/client 0.22.0-beta.4 → 2.0.0-beta.10

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 (45) hide show
  1. package/CHANGELOG.md +119 -0
  2. package/build/browser/{chunk-CAIAIF75.js → chunk-ZX7FXI5W.js} +253 -189
  3. package/build/browser/chunk-ZX7FXI5W.js.map +1 -0
  4. package/build/browser/index.js +2 -2
  5. package/build/browser/public/unstable-do-not-use.js +25 -11
  6. package/build/browser/public/unstable-do-not-use.js.map +1 -1
  7. package/build/esm/Client.d.ts +7 -6
  8. package/build/esm/Client.d.ts.map +1 -1
  9. package/build/esm/__unstable/ConjureSupport.d.ts.map +1 -1
  10. package/build/esm/__unstable/UnstableClient.d.ts +3 -3
  11. package/build/esm/__unstable/UnstableClient.d.ts.map +1 -1
  12. package/build/esm/actions/applyAction.d.ts +15 -6
  13. package/build/esm/actions/applyAction.d.ts.map +1 -1
  14. package/build/esm/{chunk-CAIAIF75.js → chunk-ZX7FXI5W.js} +253 -189
  15. package/build/esm/chunk-ZX7FXI5W.js.map +1 -0
  16. package/build/esm/createAttachmentFromRid.d.ts.map +1 -1
  17. package/build/esm/createClient.d.ts.map +1 -1
  18. package/build/esm/createTimeseriesProperty.d.ts +1 -1
  19. package/build/esm/createTimeseriesProperty.d.ts.map +1 -1
  20. package/build/esm/fetchMetadata.d.ts +2 -0
  21. package/build/esm/fetchMetadata.d.ts.map +1 -0
  22. package/build/esm/fetchMetadata.test.d.ts +2 -0
  23. package/build/esm/fetchMetadata.test.d.ts.map +1 -0
  24. package/build/esm/index.js +2 -2
  25. package/build/esm/object/fetchPage.d.ts +2 -2
  26. package/build/esm/object/fetchPage.d.ts.map +1 -1
  27. package/build/esm/object/object.test.d.ts +12 -1
  28. package/build/esm/object/object.test.d.ts.map +1 -1
  29. package/build/esm/objectSet/ObjectSetListener.d.ts +2 -2
  30. package/build/esm/objectSet/ObjectSetListener.d.ts.map +1 -1
  31. package/build/esm/objectSet/createUnstableObjectSet.d.ts.map +1 -1
  32. package/build/esm/ontology/OntologyProvider.d.ts +2 -8
  33. package/build/esm/ontology/OntologyProvider.d.ts.map +1 -1
  34. package/build/esm/ontology/StandardOntologyProvider.d.ts.map +1 -1
  35. package/build/esm/ontology/loadQueryDefinition.d.ts +4 -0
  36. package/build/esm/ontology/loadQueryDefinition.d.ts.map +1 -0
  37. package/build/esm/public/unstable-do-not-use.js +25 -11
  38. package/build/esm/public/unstable-do-not-use.js.map +1 -1
  39. package/build/esm/queries/applyQuery.d.ts +4 -4
  40. package/build/esm/queries/applyQuery.d.ts.map +1 -1
  41. package/build/esm/queries/types.d.ts +4 -4
  42. package/build/esm/queries/types.d.ts.map +1 -1
  43. package/package.json +17 -24
  44. package/build/browser/chunk-CAIAIF75.js.map +0 -1
  45. package/build/esm/chunk-CAIAIF75.js.map +0 -1
@@ -2,9 +2,9 @@ import { symbolClientContext } from '@osdk/shared.client';
2
2
  import { PalantirApiError, UnknownError } from '@osdk/shared.net.errors';
3
3
  import { createFetchHeaderMutator } from '@osdk/shared.net.fetch';
4
4
  import invariant from 'tiny-invariant';
5
- import { DistanceUnitMapping, TimeseriesDurationMapping, DurationMapping } from '@osdk/client.api';
5
+ import { DistanceUnitMapping, TimeSeriesProperty, DurationMapping, TimeseriesDurationMapping } from '@osdk/client.api';
6
6
  import { createSharedClientContext } from '@osdk/shared.client.impl';
7
- import { wireObjectTypeFullMetadataToSdkObjectTypeDefinition, __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition } from '@osdk/generator-converters';
7
+ import { wireObjectTypeFullMetadataToSdkObjectTypeDefinition, __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition, wireQueryTypeV2ToSdkQueryDefinition } from '@osdk/generator-converters';
8
8
 
9
9
  var __defProp = Object.defineProperty;
10
10
  var __export = (target, all) => {
@@ -84,7 +84,7 @@ async function apiFetch(clientCtx, method, endpointPath, data, queryArguments, h
84
84
  return response.blob();
85
85
  }
86
86
 
87
- // ../internal.foundry.datasets/build/esm/chunk-S3RCUT7E.js
87
+ // ../internal.foundry.datasets/build/esm/chunk-JIXOPP3M.js
88
88
  var Branch_exports = {};
89
89
  __export2(Branch_exports, {
90
90
  createBranch: () => createBranch,
@@ -92,10 +92,6 @@ __export2(Branch_exports, {
92
92
  getBranch: () => getBranch,
93
93
  listBranches: () => listBranches
94
94
  });
95
- var _listBranches = [0, "/v1/datasets/{0}/branches", 2];
96
- function listBranches($ctx, ...args) {
97
- return foundryPlatformFetch($ctx, _listBranches, ...args);
98
- }
99
95
  var _createBranch = [1, "/v1/datasets/{0}/branches", 1];
100
96
  function createBranch($ctx, ...args) {
101
97
  return foundryPlatformFetch($ctx, _createBranch, ...args);
@@ -108,8 +104,12 @@ var _deleteBranch = [3, "/v1/datasets/{0}/branches/{1}"];
108
104
  function deleteBranch($ctx, ...args) {
109
105
  return foundryPlatformFetch($ctx, _deleteBranch, ...args);
110
106
  }
107
+ var _listBranches = [0, "/v1/datasets/{0}/branches", 2];
108
+ function listBranches($ctx, ...args) {
109
+ return foundryPlatformFetch($ctx, _listBranches, ...args);
110
+ }
111
111
 
112
- // ../internal.foundry.datasets/build/esm/chunk-LACCW5AJ.js
112
+ // ../internal.foundry.datasets/build/esm/chunk-EDFN5GXZ.js
113
113
  var Dataset_exports = {};
114
114
  __export2(Dataset_exports, {
115
115
  createDataset: () => createDataset,
@@ -131,14 +131,14 @@ var _readTable = [0, "/v1/datasets/{0}/readTable", 2, , "*/*"];
131
131
  function readTable($ctx, ...args) {
132
132
  return foundryPlatformFetch($ctx, _readTable, ...args);
133
133
  }
134
- var _getSchema = [0, "/v1/datasets/{0}/schema", 2];
135
- function getSchema($ctx, ...args) {
136
- return foundryPlatformFetch($ctx, _getSchema, ...args);
137
- }
138
134
  var _putSchema = [2, "/v1/datasets/{0}/schema", 3];
139
135
  function putSchema($ctx, ...args) {
140
136
  return foundryPlatformFetch($ctx, _putSchema, ...args);
141
137
  }
138
+ var _getSchema = [0, "/v1/datasets/{0}/schema", 2];
139
+ function getSchema($ctx, ...args) {
140
+ return foundryPlatformFetch($ctx, _getSchema, ...args);
141
+ }
142
142
  var _deleteSchema = [3, "/v1/datasets/{0}/schema", 2];
143
143
  function deleteSchema($ctx, ...args) {
144
144
  return foundryPlatformFetch($ctx, _deleteSchema, ...args);
@@ -199,7 +199,7 @@ function abortTransaction($ctx, ...args) {
199
199
  return foundryPlatformFetch($ctx, _abortTransaction, ...args);
200
200
  }
201
201
 
202
- // ../internal.foundry.models/build/esm/chunk-6HLC4CVC.js
202
+ // ../internal.foundry.ontologies/build/esm/chunk-PZ5AY32C.js
203
203
  var __defProp3 = Object.defineProperty;
204
204
  var __export3 = (target, all) => {
205
205
  for (var name in all) __defProp3(target, name, {
@@ -207,50 +207,10 @@ var __export3 = (target, all) => {
207
207
  enumerable: true
208
208
  });
209
209
  };
210
- var LanguageModel_exports = {};
211
- __export3(LanguageModel_exports, {
212
- createChatCompletion: () => createChatCompletion,
213
- listLanguageModels: () => listLanguageModels,
214
- streamChatCompletion: () => streamChatCompletion
215
- });
216
- var _createChatCompletion = [1, "/v1/models/languageModels/{0}/chatCompletions", 1];
217
- function createChatCompletion($ctx, ...args) {
218
- return foundryPlatformFetch($ctx, _createChatCompletion, ...args);
219
- }
220
- var _streamChatCompletion = [1, "/v1/models/languageModels/{0}/chatCompletions/stream", 1, , "*/*"];
221
- function streamChatCompletion($ctx, ...args) {
222
- return foundryPlatformFetch($ctx, _streamChatCompletion, ...args);
223
- }
224
- var _listLanguageModels = [0, "/v1/models/languageModels", 2];
225
- function listLanguageModels($ctx, ...args) {
226
- return foundryPlatformFetch($ctx, _listLanguageModels, ...args);
227
- }
228
-
229
- // ../internal.foundry.ontologies/build/esm/index.js
230
- var esm_exports = {};
231
- __export(esm_exports, {
232
- ActionTypes: () => ActionType_exports,
233
- Actions: () => Action_exports,
234
- Attachments: () => Attachment_exports,
235
- ObjectTypes: () => ObjectType_exports,
236
- Ontologies: () => Ontology_exports,
237
- OntologyObjects: () => OntologyObject_exports,
238
- Queries: () => Query_exports,
239
- QueryTypes: () => QueryType_exports
240
- });
241
-
242
- // ../internal.foundry.ontologies/build/esm/chunk-PZ5AY32C.js
243
- var __defProp4 = Object.defineProperty;
244
- var __export4 = (target, all) => {
245
- for (var name in all) __defProp4(target, name, {
246
- get: all[name],
247
- enumerable: true
248
- });
249
- };
250
210
 
251
- // ../internal.foundry.ontologies/build/esm/chunk-Y7POOFVF.js
211
+ // ../internal.foundry.ontologies/build/esm/chunk-UM4N5F6D.js
252
212
  var QueryType_exports = {};
253
- __export4(QueryType_exports, {
213
+ __export3(QueryType_exports, {
254
214
  getQueryType: () => getQueryType,
255
215
  listQueryTypes: () => listQueryTypes
256
216
  });
@@ -258,14 +218,14 @@ var _listQueryTypes = [0, "/v1/ontologies/{0}/queryTypes", 2];
258
218
  function listQueryTypes($ctx, ...args) {
259
219
  return foundryPlatformFetch($ctx, _listQueryTypes, ...args);
260
220
  }
261
- var _getQueryType = [0, "/v1/ontologies/{0}/queryTypes/{1}", 2];
221
+ var _getQueryType = [0, "/v1/ontologies/{0}/queryTypes/{1}"];
262
222
  function getQueryType($ctx, ...args) {
263
223
  return foundryPlatformFetch($ctx, _getQueryType, ...args);
264
224
  }
265
225
 
266
226
  // ../internal.foundry.ontologies/build/esm/chunk-MONAXU3N.js
267
227
  var Action_exports = {};
268
- __export4(Action_exports, {
228
+ __export3(Action_exports, {
269
229
  applyAction: () => applyAction,
270
230
  applyActionAsync: () => applyActionAsync,
271
231
  applyActionBatch: () => applyActionBatch,
@@ -295,7 +255,7 @@ function validateAction($ctx, ...args) {
295
255
 
296
256
  // ../internal.foundry.ontologies/build/esm/chunk-5RUWELWF.js
297
257
  var ActionType_exports = {};
298
- __export4(ActionType_exports, {
258
+ __export3(ActionType_exports, {
299
259
  getActionType: () => getActionType,
300
260
  listActionTypes: () => listActionTypes
301
261
  });
@@ -308,16 +268,21 @@ function getActionType($ctx, ...args) {
308
268
  return foundryPlatformFetch($ctx, _getActionType, ...args);
309
269
  }
310
270
 
311
- // ../internal.foundry.ontologies/build/esm/chunk-3GNJUZCN.js
271
+ // ../internal.foundry.ontologies/build/esm/chunk-YCOLCQXU.js
312
272
  var Attachment_exports = {};
313
- __export4(Attachment_exports, {
273
+ __export3(Attachment_exports, {
314
274
  getAttachment: () => getAttachment,
315
275
  getAttachmentContent: () => getAttachmentContent,
316
276
  uploadAttachment: () => uploadAttachment
317
277
  });
318
278
  var _uploadAttachment = [1, "/v1/attachments/upload", 7, "*/*"];
319
279
  function uploadAttachment($ctx, ...args) {
320
- return foundryPlatformFetch($ctx, _uploadAttachment, ...args);
280
+ const headerParams = {
281
+ ...args[2],
282
+ "Content-Type": args[2]?.["Content-Type"] ?? args[0].type,
283
+ "Content-Length": args[0].size.toString()
284
+ };
285
+ return foundryPlatformFetch($ctx, _uploadAttachment, args[0], args[1], headerParams);
321
286
  }
322
287
  var _getAttachmentContent = [0, "/v1/attachments/{0}/content", , , "*/*"];
323
288
  function getAttachmentContent($ctx, ...args) {
@@ -330,7 +295,7 @@ function getAttachment($ctx, ...args) {
330
295
 
331
296
  // ../internal.foundry.ontologies/build/esm/chunk-ATSSLGFA.js
332
297
  var ObjectType_exports = {};
333
- __export4(ObjectType_exports, {
298
+ __export3(ObjectType_exports, {
334
299
  getObjectType: () => getObjectType,
335
300
  getOutgoingLinkType: () => getOutgoingLinkType,
336
301
  listObjectTypes: () => listObjectTypes,
@@ -355,7 +320,7 @@ function getOutgoingLinkType($ctx, ...args) {
355
320
 
356
321
  // ../internal.foundry.ontologies/build/esm/chunk-ABHCL2BI.js
357
322
  var Ontology_exports = {};
358
- __export4(Ontology_exports, {
323
+ __export3(Ontology_exports, {
359
324
  getOntology: () => getOntology,
360
325
  listOntologies: () => listOntologies
361
326
  });
@@ -370,7 +335,7 @@ function getOntology($ctx, ...args) {
370
335
 
371
336
  // ../internal.foundry.ontologies/build/esm/chunk-VBZZKGHE.js
372
337
  var OntologyObject_exports = {};
373
- __export4(OntologyObject_exports, {
338
+ __export3(OntologyObject_exports, {
374
339
  aggregateObjects: () => aggregateObjects,
375
340
  getLinkedObject: () => getLinkedObject,
376
341
  getObject: () => getObject,
@@ -403,19 +368,19 @@ function aggregateObjects($ctx, ...args) {
403
368
  return foundryPlatformFetch($ctx, _aggregateObjects, ...args);
404
369
  }
405
370
 
406
- // ../internal.foundry.ontologies/build/esm/chunk-SO7SXCWR.js
371
+ // ../internal.foundry.ontologies/build/esm/chunk-SALCOSHR.js
407
372
  var Query_exports = {};
408
- __export4(Query_exports, {
373
+ __export3(Query_exports, {
409
374
  executeQuery: () => executeQuery
410
375
  });
411
- var _executeQuery = [1, "/v1/ontologies/{0}/queries/{1}/execute", 3];
376
+ var _executeQuery = [1, "/v1/ontologies/{0}/queries/{1}/execute", 1];
412
377
  function executeQuery($ctx, ...args) {
413
378
  return foundryPlatformFetch($ctx, _executeQuery, ...args);
414
379
  }
415
380
 
416
381
  // ../internal.foundry.ontologiesv2/build/esm/index.js
417
- var esm_exports2 = {};
418
- __export(esm_exports2, {
382
+ var esm_exports = {};
383
+ __export(esm_exports, {
419
384
  ActionTypesV2: () => ActionTypeV2_exports,
420
385
  Actions: () => Action_exports2,
421
386
  AttachmentPropertiesV2: () => AttachmentPropertyV2_exports,
@@ -432,9 +397,9 @@ __export(esm_exports2, {
432
397
  });
433
398
 
434
399
  // ../internal.foundry.ontologiesv2/build/esm/chunk-PZ5AY32C.js
435
- var __defProp5 = Object.defineProperty;
436
- var __export5 = (target, all) => {
437
- for (var name in all) __defProp5(target, name, {
400
+ var __defProp4 = Object.defineProperty;
401
+ var __export4 = (target, all) => {
402
+ for (var name in all) __defProp4(target, name, {
438
403
  get: all[name],
439
404
  enumerable: true
440
405
  });
@@ -442,7 +407,7 @@ var __export5 = (target, all) => {
442
407
 
443
408
  // ../internal.foundry.ontologiesv2/build/esm/chunk-CTA4DXZF.js
444
409
  var OntologyObjectSet_exports = {};
445
- __export5(OntologyObjectSet_exports, {
410
+ __export4(OntologyObjectSet_exports, {
446
411
  aggregateObjectSetV2: () => aggregateObjectSetV2,
447
412
  createTemporaryObjectSetV2: () => createTemporaryObjectSetV2,
448
413
  getObjectSetV2: () => getObjectSetV2,
@@ -465,12 +430,11 @@ function aggregateObjectSetV2($ctx, ...args) {
465
430
  return foundryPlatformFetch($ctx, _aggregateObjectSetV2, ...args);
466
431
  }
467
432
 
468
- // ../internal.foundry.ontologiesv2/build/esm/chunk-WV7ZDMLQ.js
433
+ // ../internal.foundry.ontologiesv2/build/esm/chunk-U76D6BOW.js
469
434
  var OntologyObjectV2_exports = {};
470
- __export5(OntologyObjectV2_exports, {
435
+ __export4(OntologyObjectV2_exports, {
471
436
  aggregateObjectsV2: () => aggregateObjectsV2,
472
437
  countObjects: () => countObjects,
473
- getObjectTypeFullMetadata: () => getObjectTypeFullMetadata,
474
438
  getObjectV2: () => getObjectV2,
475
439
  listObjectsV2: () => listObjectsV2,
476
440
  searchObjectsV2: () => searchObjectsV2
@@ -495,14 +459,10 @@ var _aggregateObjectsV2 = [1, "/v2/ontologies/{0}/objects/{1}/aggregate", 3];
495
459
  function aggregateObjectsV2($ctx, ...args) {
496
460
  return foundryPlatformFetch($ctx, _aggregateObjectsV2, ...args);
497
461
  }
498
- var _getObjectTypeFullMetadata = [0, "/v2/ontologies/{0}/objectTypes/{1}/fullMetadata", 2];
499
- function getObjectTypeFullMetadata($ctx, ...args) {
500
- return foundryPlatformFetch($ctx, _getObjectTypeFullMetadata, ...args);
501
- }
502
462
 
503
463
  // ../internal.foundry.ontologiesv2/build/esm/chunk-35VM6XLH.js
504
464
  var OntologyV2_exports = {};
505
- __export5(OntologyV2_exports, {
465
+ __export4(OntologyV2_exports, {
506
466
  getOntologyFullMetadata: () => getOntologyFullMetadata,
507
467
  getOntologyV2: () => getOntologyV2,
508
468
  listOntologiesV2: () => listOntologiesV2
@@ -522,7 +482,7 @@ function getOntologyFullMetadata($ctx, ...args) {
522
482
 
523
483
  // ../internal.foundry.ontologiesv2/build/esm/chunk-UFJTKRQC.js
524
484
  var Query_exports2 = {};
525
- __export5(Query_exports2, {
485
+ __export4(Query_exports2, {
526
486
  executeQueryV2: () => executeQueryV2
527
487
  });
528
488
  var _executeQueryV2 = [1, "/v2/ontologies/{0}/queries/{1}/execute", 3];
@@ -532,7 +492,7 @@ function executeQueryV2($ctx, ...args) {
532
492
 
533
493
  // ../internal.foundry.ontologiesv2/build/esm/chunk-GWYI4RKT.js
534
494
  var QueryType_exports2 = {};
535
- __export5(QueryType_exports2, {
495
+ __export4(QueryType_exports2, {
536
496
  getQueryTypeV2: () => getQueryTypeV2,
537
497
  listQueryTypesV2: () => listQueryTypesV2
538
498
  });
@@ -547,7 +507,7 @@ function getQueryTypeV2($ctx, ...args) {
547
507
 
548
508
  // ../internal.foundry.ontologiesv2/build/esm/chunk-KQNF55S5.js
549
509
  var TimeSeriesPropertyV2_exports = {};
550
- __export5(TimeSeriesPropertyV2_exports, {
510
+ __export4(TimeSeriesPropertyV2_exports, {
551
511
  getFirstPoint: () => getFirstPoint,
552
512
  getLastPoint: () => getLastPoint,
553
513
  streamPoints: () => streamPoints
@@ -565,9 +525,9 @@ function streamPoints($ctx, ...args) {
565
525
  return foundryPlatformFetch($ctx, _streamPoints, ...args);
566
526
  }
567
527
 
568
- // ../internal.foundry.ontologiesv2/build/esm/chunk-ZKWJVNUQ.js
528
+ // ../internal.foundry.ontologiesv2/build/esm/chunk-A2ZEBCGI.js
569
529
  var Action_exports2 = {};
570
- __export5(Action_exports2, {
530
+ __export4(Action_exports2, {
571
531
  applyActionAsyncV2: () => applyActionAsyncV2,
572
532
  applyActionBatchV2: () => applyActionBatchV2,
573
533
  applyActionV2: () => applyActionV2
@@ -576,18 +536,18 @@ var _applyActionV2 = [1, "/v2/ontologies/{0}/actions/{1}/apply", 3];
576
536
  function applyActionV2($ctx, ...args) {
577
537
  return foundryPlatformFetch($ctx, _applyActionV2, ...args);
578
538
  }
579
- var _applyActionBatchV2 = [1, "/v2/ontologies/{0}/actions/{1}/applyBatch", 3];
580
- function applyActionBatchV2($ctx, ...args) {
581
- return foundryPlatformFetch($ctx, _applyActionBatchV2, ...args);
582
- }
583
539
  var _applyActionAsyncV2 = [1, "/v2/ontologies/{0}/actions/{1}/applyAsync", 3];
584
540
  function applyActionAsyncV2($ctx, ...args) {
585
541
  return foundryPlatformFetch($ctx, _applyActionAsyncV2, ...args);
586
542
  }
543
+ var _applyActionBatchV2 = [1, "/v2/ontologies/{0}/actions/{1}/applyBatch", 3];
544
+ function applyActionBatchV2($ctx, ...args) {
545
+ return foundryPlatformFetch($ctx, _applyActionBatchV2, ...args);
546
+ }
587
547
 
588
548
  // ../internal.foundry.ontologiesv2/build/esm/chunk-VCCTOHYG.js
589
549
  var ActionTypeV2_exports = {};
590
- __export5(ActionTypeV2_exports, {
550
+ __export4(ActionTypeV2_exports, {
591
551
  getActionTypeV2: () => getActionTypeV2,
592
552
  listActionTypesV2: () => listActionTypesV2
593
553
  });
@@ -600,16 +560,21 @@ function getActionTypeV2($ctx, ...args) {
600
560
  return foundryPlatformFetch($ctx, _getActionTypeV2, ...args);
601
561
  }
602
562
 
603
- // ../internal.foundry.ontologiesv2/build/esm/chunk-BTOEXA2S.js
563
+ // ../internal.foundry.ontologiesv2/build/esm/chunk-EFVOGNPX.js
604
564
  var Attachment_exports2 = {};
605
- __export5(Attachment_exports2, {
565
+ __export4(Attachment_exports2, {
606
566
  getAttachmentContentV2: () => getAttachmentContentV2,
607
567
  getAttachmentV2: () => getAttachmentV2,
608
568
  uploadAttachmentV2: () => uploadAttachmentV2
609
569
  });
610
570
  var _uploadAttachmentV2 = [1, "/v2/ontologies/attachments/upload", 7, "*/*"];
611
571
  function uploadAttachmentV2($ctx, ...args) {
612
- return foundryPlatformFetch($ctx, _uploadAttachmentV2, ...args);
572
+ const headerParams = {
573
+ ...args[2],
574
+ "Content-Type": args[2]?.["Content-Type"] ?? args[0].type,
575
+ "Content-Length": args[0].size.toString()
576
+ };
577
+ return foundryPlatformFetch($ctx, _uploadAttachmentV2, args[0], args[1], headerParams);
613
578
  }
614
579
  var _getAttachmentContentV2 = [0, "/v2/ontologies/attachments/{0}/content", , , "*/*"];
615
580
  function getAttachmentContentV2($ctx, ...args) {
@@ -622,7 +587,7 @@ function getAttachmentV2($ctx, ...args) {
622
587
 
623
588
  // ../internal.foundry.ontologiesv2/build/esm/chunk-3H3SHEFA.js
624
589
  var AttachmentPropertyV2_exports = {};
625
- __export5(AttachmentPropertyV2_exports, {
590
+ __export4(AttachmentPropertyV2_exports, {
626
591
  getAttachmentPropertyByRidV2: () => getAttachmentPropertyByRidV2,
627
592
  getAttachmentPropertyContentByRidV2: () => getAttachmentPropertyContentByRidV2,
628
593
  getAttachmentPropertyContentV2: () => getAttachmentPropertyContentV2,
@@ -647,7 +612,7 @@ function getAttachmentPropertyContentByRidV2($ctx, ...args) {
647
612
 
648
613
  // ../internal.foundry.ontologiesv2/build/esm/chunk-4TOWICL3.js
649
614
  var LinkedObjectV2_exports = {};
650
- __export5(LinkedObjectV2_exports, {
615
+ __export4(LinkedObjectV2_exports, {
651
616
  getLinkedObjectV2: () => getLinkedObjectV2,
652
617
  listLinkedObjectsV2: () => listLinkedObjectsV2
653
618
  });
@@ -660,9 +625,10 @@ function getLinkedObjectV2($ctx, ...args) {
660
625
  return foundryPlatformFetch($ctx, _getLinkedObjectV2, ...args);
661
626
  }
662
627
 
663
- // ../internal.foundry.ontologiesv2/build/esm/chunk-XFVLFZZG.js
628
+ // ../internal.foundry.ontologiesv2/build/esm/chunk-ZNHKEV4X.js
664
629
  var ObjectTypeV2_exports = {};
665
- __export5(ObjectTypeV2_exports, {
630
+ __export4(ObjectTypeV2_exports, {
631
+ getObjectTypeFullMetadata: () => getObjectTypeFullMetadata,
666
632
  getObjectTypeV2: () => getObjectTypeV2,
667
633
  getOutgoingLinkTypeV2: () => getOutgoingLinkTypeV2,
668
634
  listObjectTypesV2: () => listObjectTypesV2,
@@ -676,6 +642,10 @@ var _getObjectTypeV2 = [0, "/v2/ontologies/{0}/objectTypes/{1}"];
676
642
  function getObjectTypeV2($ctx, ...args) {
677
643
  return foundryPlatformFetch($ctx, _getObjectTypeV2, ...args);
678
644
  }
645
+ var _getObjectTypeFullMetadata = [0, "/v2/ontologies/{0}/objectTypes/{1}/fullMetadata", 2];
646
+ function getObjectTypeFullMetadata($ctx, ...args) {
647
+ return foundryPlatformFetch($ctx, _getObjectTypeFullMetadata, ...args);
648
+ }
679
649
  var _listOutgoingLinkTypesV2 = [0, "/v2/ontologies/{0}/objectTypes/{1}/outgoingLinkTypes", 2];
680
650
  function listOutgoingLinkTypesV2($ctx, ...args) {
681
651
  return foundryPlatformFetch($ctx, _listOutgoingLinkTypesV2, ...args);
@@ -687,7 +657,7 @@ function getOutgoingLinkTypeV2($ctx, ...args) {
687
657
 
688
658
  // ../internal.foundry.ontologiesv2/build/esm/chunk-OBKC7XBM.js
689
659
  var OntologyInterface_exports = {};
690
- __export5(OntologyInterface_exports, {
660
+ __export4(OntologyInterface_exports, {
691
661
  aggregateObjectsForInterface: () => aggregateObjectsForInterface,
692
662
  getInterfaceType: () => getInterfaceType,
693
663
  listInterfaceTypes: () => listInterfaceTypes,
@@ -715,10 +685,14 @@ function createAttachmentFromRid(client, rid) {
715
685
  return {
716
686
  rid,
717
687
  async fetchContents() {
718
- return esm_exports.Attachments.getAttachmentContent(client, rid);
688
+ return esm_exports.Attachments.getAttachmentContentV2(client, rid);
719
689
  },
720
690
  async fetchMetadata() {
721
- return esm_exports.Attachments.getAttachment(client, rid);
691
+ const r = await esm_exports.Attachments.getAttachmentV2(client, rid);
692
+ return {
693
+ ...r,
694
+ sizeBytes: Number(r.sizeBytes)
695
+ };
722
696
  }
723
697
  };
724
698
  }
@@ -820,20 +794,19 @@ async function* iterateReadableStream(readableStream) {
820
794
 
821
795
  // src/createTimeseriesProperty.ts
822
796
  function createTimeseriesProperty(client, objectApiName, primaryKey, propertyName) {
823
- return {
824
- async getFirstPoint() {
825
- return esm_exports2.TimeSeriesPropertiesV2.getFirstPoint(client, await client.ontologyRid, objectApiName, primaryKey, propertyName);
826
- },
827
- async getLastPoint() {
828
- return esm_exports2.TimeSeriesPropertiesV2.getLastPoint(client, await client.ontologyRid, objectApiName, primaryKey, propertyName);
829
- },
830
- async getAllPoints(query) {
831
- return getAllTimeSeriesPoints(client, objectApiName, primaryKey, propertyName, query);
832
- },
833
- asyncIterPoints(query) {
834
- return iterateTimeSeriesPoints(client, objectApiName, primaryKey, propertyName, query);
835
- }
797
+ const getFirstPoint2 = async () => {
798
+ return esm_exports.TimeSeriesPropertiesV2.getFirstPoint(client, await client.ontologyRid, objectApiName, primaryKey, propertyName);
836
799
  };
800
+ const getLastPoint2 = async () => {
801
+ return esm_exports.TimeSeriesPropertiesV2.getLastPoint(client, await client.ontologyRid, objectApiName, primaryKey, propertyName);
802
+ };
803
+ const getAllPoints = async (query) => {
804
+ return getAllTimeSeriesPoints(client, objectApiName, primaryKey, propertyName, query);
805
+ };
806
+ const asyncIterPoints = (query) => {
807
+ return iterateTimeSeriesPoints(client, objectApiName, primaryKey, propertyName, query);
808
+ };
809
+ return new TimeSeriesProperty(getFirstPoint2, getLastPoint2, getAllPoints, asyncIterPoints);
837
810
  }
838
811
  async function getAllTimeSeriesPoints(client, objectApiName, primaryKey, propertyName, body) {
839
812
  const allPoints = [];
@@ -847,7 +820,7 @@ async function getAllTimeSeriesPoints(client, objectApiName, primaryKey, propert
847
820
  }
848
821
  async function* iterateTimeSeriesPoints(client, objectApiName, primaryKey, propertyName, body) {
849
822
  new TextDecoder("utf-8");
850
- const streamPointsIterator = await esm_exports2.TimeSeriesPropertiesV2.streamPoints(client, await client.ontologyRid, objectApiName, primaryKey, propertyName, body ? {
823
+ const streamPointsIterator = await esm_exports.TimeSeriesPropertiesV2.streamPoints(client, await client.ontologyRid, objectApiName, primaryKey, propertyName, body ? {
851
824
  range: getTimeRange(body)
852
825
  } : {});
853
826
  const reader = streamPointsIterator.stream().getReader();
@@ -940,7 +913,7 @@ function createAsyncClientCache(fn, createCacheLocal = createClientCache) {
940
913
  }
941
914
 
942
915
  // src/ontology/OntologyProvider.ts
943
- var InterfaceDefinitions = Symbol(process.env.MODE !== "production" ? "InterfaceDefinitions" : void 0);
916
+ var InterfaceDefinitions = Symbol("InterfaceDefinitions" );
944
917
 
945
918
  // src/object/SimpleCache.ts
946
919
  function createSimpleCache(map = /* @__PURE__ */ new Map(), fn) {
@@ -991,11 +964,11 @@ function createSimpleAsyncCache(type, fn, createCacheLocal = createSimpleCache)
991
964
  }
992
965
 
993
966
  // src/object/convertWireToOsdkObjects/InternalSymbols.ts
994
- var UnderlyingOsdkObject = Symbol(process.env.MODE !== "production" ? "Underlying Object" : void 0);
995
- var ObjectDefRef = Symbol(process.env.MODE !== "production" ? "ObjectDefinition" : void 0);
996
- var InterfaceDefRef = Symbol(process.env.MODE !== "production" ? "InterfaceDefinition" : void 0);
997
- var RawObject = Symbol(process.env.MODE !== "production" ? "RawObject" : void 0);
998
- var ClientRef = Symbol(process.env.MODE !== "production" ? "ClientRef" : void 0);
967
+ var UnderlyingOsdkObject = Symbol("Underlying Object" );
968
+ var ObjectDefRef = Symbol("ObjectDefinition" );
969
+ var InterfaceDefRef = Symbol("InterfaceDefinition" );
970
+ var RawObject = Symbol("RawObject" );
971
+ var ClientRef = Symbol("ClientRef" );
999
972
 
1000
973
  // src/object/convertWireToOsdkObjects/createOsdkInterface.ts
1001
974
  var handlerCache = createSimpleCache(/* @__PURE__ */ new WeakMap(), createInterfaceProxyHandler);
@@ -1069,30 +1042,33 @@ function createInterfaceProxyHandler(newDef) {
1069
1042
  var get$as = createSimpleCache(/* @__PURE__ */ new WeakMap(), $asFactory).get;
1070
1043
  var osdkObjectToInterfaceView = createSimpleCache(/* @__PURE__ */ new WeakMap(), () => /* @__PURE__ */ new Map());
1071
1044
  function $asFactory(objDef) {
1072
- return function $as(newDef) {
1073
- if (typeof newDef === "string") {
1074
- if (newDef === objDef.apiName) {
1045
+ return function $as(targetMinDef) {
1046
+ let targetInterfaceApiName;
1047
+ if (typeof targetMinDef === "string") {
1048
+ if (targetMinDef === objDef.apiName) {
1075
1049
  return this[UnderlyingOsdkObject];
1076
1050
  }
1077
- if (objDef.interfaceMap?.[newDef] == null) {
1078
- throw new Error(`Object does not implement interface '${newDef}'.`);
1051
+ if (objDef.interfaceMap?.[targetMinDef] == null) {
1052
+ throw new Error(`Object does not implement interface '${targetMinDef}'.`);
1079
1053
  }
1080
- const def = objDef[InterfaceDefinitions][newDef];
1081
- if (!def) {
1082
- throw new Error(`Object does not implement interface '${newDef}'.`);
1083
- }
1084
- newDef = def.def;
1085
- } else if (newDef.apiName === objDef.apiName) {
1054
+ targetInterfaceApiName = targetMinDef;
1055
+ } else if (targetMinDef.apiName === objDef.apiName) {
1086
1056
  return this[UnderlyingOsdkObject];
1057
+ } else {
1058
+ if (targetMinDef.type === "object") {
1059
+ throw new Error(`'${targetMinDef.apiName}' is not an interface nor is it '${objDef.apiName}', which is the object type.`);
1060
+ }
1061
+ targetInterfaceApiName = targetMinDef.apiName;
1087
1062
  }
1088
- if (newDef.type === "object") {
1089
- throw new Error(`'${newDef.apiName}' is not an interface nor is it '${objDef.apiName}', which is the object type.`);
1063
+ const def = objDef[InterfaceDefinitions][targetInterfaceApiName];
1064
+ if (!def) {
1065
+ throw new Error(`Object does not implement interface '${targetMinDef}'.`);
1090
1066
  }
1091
1067
  const underlying = this[UnderlyingOsdkObject];
1092
- const existing = osdkObjectToInterfaceView.get(underlying).get(newDef.apiName);
1068
+ const existing = osdkObjectToInterfaceView.get(underlying).get(targetInterfaceApiName);
1093
1069
  if (existing) return existing;
1094
- const osdkInterface = createOsdkInterface(underlying, newDef);
1095
- osdkObjectToInterfaceView.get(underlying).set(newDef.apiName, osdkInterface);
1070
+ const osdkInterface = createOsdkInterface(underlying, def.def);
1071
+ osdkObjectToInterfaceView.get(underlying).set(targetInterfaceApiName, osdkInterface);
1096
1072
  return osdkInterface;
1097
1073
  };
1098
1074
  }
@@ -1318,7 +1294,7 @@ async function aggregate(clientCtx, objectType, objectSet = {
1318
1294
  if (req.$where) {
1319
1295
  body.where = modernToLegacyWhereClause(req.$where);
1320
1296
  }
1321
- const result = await esm_exports2.OntologyObjectSets.aggregateObjectSetV2(addUserAgentAndRequestContextHeaders(clientCtx, objectType), await clientCtx.ontologyRid, {
1297
+ const result = await esm_exports.OntologyObjectSets.aggregateObjectSetV2(addUserAgentAndRequestContextHeaders(clientCtx, objectType), await clientCtx.ontologyRid, {
1322
1298
  objectSet,
1323
1299
  groupBy: body.groupBy,
1324
1300
  aggregation: body.aggregation
@@ -1459,32 +1435,14 @@ function createObjectSet(objectType, clientCtx, objectSet = {
1459
1435
  } while ($nextPageToken != null);
1460
1436
  },
1461
1437
  fetchOne: isObjectTypeDefinition(objectType) ? async (primaryKey, options) => {
1462
- const withPk = {
1463
- type: "filter",
1464
- objectSet,
1465
- where: {
1466
- type: "eq",
1467
- field: objectType.primaryKeyApiName,
1468
- value: primaryKey
1469
- }
1470
- };
1471
1438
  return await fetchSingle(augmentRequestContext(clientCtx, (_) => ({
1472
1439
  finalMethodCall: "fetchOne"
1473
- })), objectType, options, withPk);
1440
+ })), objectType, options, await createWithPk(clientCtx, objectType, objectSet, primaryKey));
1474
1441
  } : void 0,
1475
1442
  fetchOneWithErrors: isObjectTypeDefinition(objectType) ? async (primaryKey, options) => {
1476
- const withPk = {
1477
- type: "filter",
1478
- objectSet,
1479
- where: {
1480
- type: "eq",
1481
- field: objectType.primaryKeyApiName,
1482
- value: primaryKey
1483
- }
1484
- };
1485
1443
  return await fetchSingleWithErrors(augmentRequestContext(clientCtx, (_) => ({
1486
1444
  finalMethodCall: "fetchOneWithErrors"
1487
- })), objectType, options, withPk);
1445
+ })), objectType, options, await createWithPk(clientCtx, objectType, objectSet, primaryKey));
1488
1446
  } : void 0
1489
1447
  };
1490
1448
  function createSearchAround(link) {
@@ -1499,6 +1457,19 @@ function createObjectSet(objectType, clientCtx, objectSet = {
1499
1457
  objectSetDefinitions.set(base, objectSet);
1500
1458
  return base;
1501
1459
  }
1460
+ async function createWithPk(clientCtx, objectType, objectSet, primaryKey) {
1461
+ const objDef = await clientCtx.ontologyProvider.getObjectDefinition(objectType.apiName);
1462
+ const withPk = {
1463
+ type: "filter",
1464
+ objectSet,
1465
+ where: {
1466
+ type: "eq",
1467
+ field: objDef.primaryKeyApiName,
1468
+ value: primaryKey
1469
+ }
1470
+ };
1471
+ return withPk;
1472
+ }
1502
1473
 
1503
1474
  // src/object/convertWireToOsdkObjects/getDollarLink.ts
1504
1475
  function get$link(holder) {
@@ -1747,11 +1718,11 @@ function objectSetToSearchJsonV2(objectSet, expectedApiName, existingWhere = voi
1747
1718
  throw new Error(`Unsupported objectSet type: ${objectSet.type}`);
1748
1719
  }
1749
1720
  async function fetchInterfacePage(client, interfaceType, args, objectSet) {
1750
- const result = await esm_exports2.OntologyInterfaces.searchObjectsForInterface(addUserAgentAndRequestContextHeaders(client, interfaceType), await client.ontologyRid, interfaceType.apiName, applyFetchArgs(args, {
1721
+ const result = await esm_exports.OntologyInterfaces.searchObjectsForInterface(addUserAgentAndRequestContextHeaders(client, interfaceType), await client.ontologyRid, interfaceType.apiName, applyFetchArgs(args, {
1751
1722
  augmentedProperties: args.$augment ?? {},
1752
1723
  augmentedSharedPropertyTypes: {},
1753
1724
  otherInterfaceTypes: [],
1754
- selectedObjectTypes: [],
1725
+ selectedObjectTypes: args.$__EXPERIMENTAL_selectedObjectTypes ?? [],
1755
1726
  selectedSharedPropertyTypes: args.$select ?? [],
1756
1727
  where: objectSetToSearchJsonV2(objectSet, interfaceType.apiName)
1757
1728
  }), {
@@ -1814,7 +1785,7 @@ function applyFetchArgs(args, body) {
1814
1785
  return body;
1815
1786
  }
1816
1787
  async function fetchObjectPage(client, objectType, args, objectSet) {
1817
- const r = await esm_exports2.OntologyObjectSets.loadObjectSetV2(addUserAgentAndRequestContextHeaders(client, objectType), await client.ontologyRid, applyFetchArgs(args, {
1788
+ const r = await esm_exports.OntologyObjectSets.loadObjectSetV2(addUserAgentAndRequestContextHeaders(client, objectType), await client.ontologyRid, applyFetchArgs(args, {
1818
1789
  objectSet,
1819
1790
  // We have to do the following case because LoadObjectSetRequestV2 isn't readonly
1820
1791
  select: args?.$select ?? [],
@@ -1823,7 +1794,8 @@ async function fetchObjectPage(client, objectType, args, objectSet) {
1823
1794
  }));
1824
1795
  return Promise.resolve({
1825
1796
  data: await convertWireToOsdkObjects(client, r.data, void 0, void 0, args.$select, args.$__EXPERIMENTAL_strictNonNull),
1826
- nextPageToken: r.nextPageToken
1797
+ nextPageToken: r.nextPageToken,
1798
+ totalCount: r.totalCount
1827
1799
  });
1828
1800
  }
1829
1801
 
@@ -1847,11 +1819,8 @@ async function toDataValue(value, client) {
1847
1819
  return Promise.all(promiseArray);
1848
1820
  }
1849
1821
  if (isAttachmentUpload(value)) {
1850
- const attachment = await esm_exports.Attachments.uploadAttachment(client, value, {
1822
+ const attachment = await esm_exports.Attachments.uploadAttachmentV2(client, value, {
1851
1823
  filename: value.name
1852
- }, {
1853
- "Content-Length": value.size.toString(),
1854
- "Content-Type": value.type
1855
1824
  });
1856
1825
  return await toDataValue(attachment.rid, client);
1857
1826
  }
@@ -1883,15 +1852,16 @@ async function applyAction2(client, action, parameters, options = {}) {
1883
1852
  finalMethodCall: "applyAction"
1884
1853
  })), action);
1885
1854
  if (Array.isArray(parameters)) {
1886
- const response = await esm_exports2.Actions.applyActionBatchV2(clientWithHeaders, await client.ontologyRid, action.apiName, {
1855
+ const response = await esm_exports.Actions.applyActionBatchV2(clientWithHeaders, await client.ontologyRid, action.apiName, {
1887
1856
  requests: parameters ? await remapBatchActionParams(parameters, client) : [],
1888
1857
  options: {
1889
1858
  returnEdits: options?.$returnEdits ? "ALL" : "NONE"
1890
1859
  }
1891
1860
  });
1892
- return options?.$returnEdits ? response.edits : void 0;
1861
+ const edits = response.edits;
1862
+ return options?.$returnEdits ? edits?.type === "edits" ? remapActionResponse(response) : edits : void 0;
1893
1863
  } else {
1894
- const response = await esm_exports2.Actions.applyActionV2(clientWithHeaders, await client.ontologyRid, action.apiName, {
1864
+ const response = await esm_exports.Actions.applyActionV2(clientWithHeaders, await client.ontologyRid, action.apiName, {
1895
1865
  parameters: await remapActionParams(parameters, client),
1896
1866
  options: {
1897
1867
  mode: options?.$validateOnly ? "VALIDATE_ONLY" : "VALIDATE_AND_EXECUTE",
@@ -1904,7 +1874,8 @@ async function applyAction2(client, action, parameters, options = {}) {
1904
1874
  if (response.validation?.result === "INVALID") {
1905
1875
  throw new ActionValidationError(response.validation);
1906
1876
  }
1907
- return options?.$returnEdits ? response.edits : void 0;
1877
+ const edits = response.edits;
1878
+ return options?.$returnEdits ? edits?.type === "edits" ? remapActionResponse(response) : edits : void 0;
1908
1879
  }
1909
1880
  }
1910
1881
  async function remapActionParams(params, client) {
@@ -1925,8 +1896,40 @@ async function remapBatchActionParams(params, client) {
1925
1896
  }));
1926
1897
  return remappedParams;
1927
1898
  }
1899
+ function remapActionResponse(response) {
1900
+ const editResponses = response?.edits;
1901
+ if (editResponses?.type === "edits") {
1902
+ const remappedActionResponse = {
1903
+ type: editResponses.type,
1904
+ deletedLinksCount: editResponses.deletedLinksCount,
1905
+ deletedObjectsCount: editResponses.deletedObjectsCount,
1906
+ addedLinks: [],
1907
+ addedObjects: [],
1908
+ modifiedObjects: [],
1909
+ editedObjectTypes: []
1910
+ };
1911
+ const editedObjectTypesSet = /* @__PURE__ */ new Set();
1912
+ for (const edit of editResponses.edits) {
1913
+ if (edit.type === "addLink") {
1914
+ remappedActionResponse.addedLinks.push(edit);
1915
+ editedObjectTypesSet.add(edit.aSideObject.objectType);
1916
+ editedObjectTypesSet.add(edit.bSideObject.objectType);
1917
+ } else if (edit.type === "addObject") {
1918
+ remappedActionResponse.addedObjects.push(edit);
1919
+ editedObjectTypesSet.add(edit.objectType);
1920
+ } else if (edit.type === "modifyObject") {
1921
+ remappedActionResponse.modifiedObjects.push(edit);
1922
+ editedObjectTypesSet.add(edit.objectType);
1923
+ } else {
1924
+ process.env.NODE_ENV !== "production" ? invariant(false, "Unknown edit type") : invariant(false) ;
1925
+ }
1926
+ }
1927
+ remappedActionResponse.editedObjectTypes = [...editedObjectTypesSet];
1928
+ return remappedActionResponse;
1929
+ }
1930
+ }
1928
1931
  async function loadFullObjectMetadata(client, objectType) {
1929
- const full = await esm_exports2.OntologyObjectsV2.getObjectTypeFullMetadata(client, await client.ontologyRid, objectType, {
1932
+ const full = await esm_exports.ObjectTypesV2.getObjectTypeFullMetadata(client, await client.ontologyRid, objectType, {
1930
1933
  preview: true
1931
1934
  });
1932
1935
  const ret = wireObjectTypeFullMetadataToSdkObjectTypeDefinition(full, true);
@@ -1937,11 +1940,15 @@ async function loadFullObjectMetadata(client, objectType) {
1937
1940
  };
1938
1941
  }
1939
1942
  async function loadInterfaceDefinition(client, objectType) {
1940
- const r = await esm_exports2.OntologyInterfaces.getInterfaceType(client, await client.ontologyRid, objectType, {
1943
+ const r = await esm_exports.OntologyInterfaces.getInterfaceType(client, await client.ontologyRid, objectType, {
1941
1944
  preview: true
1942
1945
  });
1943
1946
  return __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(r, true);
1944
1947
  }
1948
+ async function loadQueryDefinition(client, queryType) {
1949
+ const r = await esm_exports.QueryTypes.getQueryTypeV2(client, await client.ontologyRid, queryType);
1950
+ return wireQueryTypeV2ToSdkQueryDefinition(r);
1951
+ }
1945
1952
 
1946
1953
  // src/ontology/StandardOntologyProvider.ts
1947
1954
  var createStandardOntologyProviderFactory = (client) => {
@@ -1961,6 +1968,10 @@ var createStandardOntologyProviderFactory = (client) => {
1961
1968
  async function loadInterface(client3, key) {
1962
1969
  return loadInterfaceDefinition(client3, key);
1963
1970
  }
1971
+ async function loadQuery(client3, key) {
1972
+ const r = await loadQueryDefinition(client3, key);
1973
+ return r;
1974
+ }
1964
1975
  function makeGetter(fn) {
1965
1976
  const cache = createAsyncClientCache((client3, key) => fn(client3, key, false));
1966
1977
  return async (apiName) => {
@@ -1970,15 +1981,14 @@ var createStandardOntologyProviderFactory = (client) => {
1970
1981
  const ret = {
1971
1982
  getObjectDefinition: makeGetter(loadObject),
1972
1983
  getInterfaceDefinition: makeGetter(loadInterface),
1973
- maybeSeed(definition) {
1974
- }
1984
+ getQueryDefinition: makeGetter(loadQuery)
1975
1985
  };
1976
1986
  return ret;
1977
1987
  };
1978
1988
  };
1979
1989
 
1980
1990
  // src/util/UserAgent.ts
1981
- var USER_AGENT = `osdk-client/${"0.22.0-beta.4"}`;
1991
+ var USER_AGENT = `osdk-client/${"2.0.0-beta.10"}`;
1982
1992
 
1983
1993
  // src/createMinimalClient.ts
1984
1994
  function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory = createObjectSet) {
@@ -2003,6 +2013,61 @@ function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fet
2003
2013
  });
2004
2014
  }
2005
2015
 
2016
+ // src/fetchMetadata.ts
2017
+ var fetchMetadataInternal = async (client, definition) => {
2018
+ if (definition.type === "object") {
2019
+ return fetchObjectMetadata(client, definition);
2020
+ } else if (definition.type === "interface") {
2021
+ return fetchInterfaceMetadata(client, definition);
2022
+ } else if (definition.type === "action") {
2023
+ return fetchActionMetadata(client, definition);
2024
+ } else if (definition.type === "query") {
2025
+ return fetchQueryMetadata(client, definition);
2026
+ } else {
2027
+ throw new Error("Not implemented for given definition");
2028
+ }
2029
+ };
2030
+ var fetchObjectMetadata = async (client, objectType) => {
2031
+ const response = await esm_exports.ObjectTypesV2.getObjectTypeFullMetadata(addUserAgentAndRequestContextHeaders(client, objectType), await client.ontologyRid, objectType.apiName, {
2032
+ preview: true
2033
+ });
2034
+ const supportedIconTypes = ["blueprint"];
2035
+ return {
2036
+ description: response.objectType.description,
2037
+ displayName: response.objectType.displayName,
2038
+ visibility: response.objectType.visibility,
2039
+ pluralDisplayName: response.objectType.pluralDisplayName,
2040
+ icon: supportedIconTypes.includes(response.objectType.icon.type) ? response.objectType.icon : void 0,
2041
+ rid: response.objectType.rid
2042
+ };
2043
+ };
2044
+ var fetchInterfaceMetadata = async (client, interfaceType) => {
2045
+ const response = await esm_exports.OntologyInterfaces.getInterfaceType(addUserAgentAndRequestContextHeaders(client, interfaceType), await client.ontologyRid, interfaceType.apiName, {
2046
+ preview: true
2047
+ });
2048
+ return {
2049
+ displayName: response.displayName,
2050
+ description: response.description,
2051
+ rid: response.rid
2052
+ };
2053
+ };
2054
+ var fetchActionMetadata = async (client, actionType) => {
2055
+ const response = await esm_exports.ActionTypesV2.getActionTypeV2(addUserAgentAndRequestContextHeaders(client, actionType), await client.ontologyRid, actionType.apiName);
2056
+ return {
2057
+ displayName: response.displayName,
2058
+ description: response.description,
2059
+ rid: response.rid
2060
+ };
2061
+ };
2062
+ var fetchQueryMetadata = async (client, queryType) => {
2063
+ const response = await esm_exports.QueryTypes.getQueryTypeV2(addUserAgentAndRequestContextHeaders(client, queryType), await client.ontologyRid, queryType.apiName);
2064
+ return {
2065
+ displayName: response.displayName,
2066
+ description: response.description,
2067
+ rid: response.rid
2068
+ };
2069
+ };
2070
+
2006
2071
  // src/util/isOsdkBaseObject.ts
2007
2072
  function isOsdkBaseObject2(o) {
2008
2073
  return o && typeof o === "object" && typeof o.$apiName === "string" && o.$primaryKey != null;
@@ -2020,11 +2085,8 @@ async function toDataValueQueries(value, client, desiredType) {
2020
2085
  switch (desiredType.type) {
2021
2086
  case "attachment": {
2022
2087
  if (isAttachmentUpload(value)) {
2023
- const attachment = await esm_exports.Attachments.uploadAttachment(client, value, {
2088
+ const attachment = await esm_exports.Attachments.uploadAttachmentV2(client, value, {
2024
2089
  filename: value.name
2025
- }, {
2026
- "Content-Length": value.size.toString(),
2027
- "Content-Type": value.type
2028
2090
  });
2029
2091
  return attachment.rid;
2030
2092
  }
@@ -2086,13 +2148,14 @@ async function toDataValueQueries(value, client, desiredType) {
2086
2148
 
2087
2149
  // src/queries/applyQuery.ts
2088
2150
  async function applyQuery(client, query, params) {
2089
- const response = await esm_exports2.Queries.executeQueryV2(addUserAgentAndRequestContextHeaders(augmentRequestContext(client, (_) => ({
2151
+ const qd = await client.ontologyProvider.getQueryDefinition(query.apiName);
2152
+ const response = await esm_exports.Queries.executeQueryV2(addUserAgentAndRequestContextHeaders(augmentRequestContext(client, (_) => ({
2090
2153
  finalMethodCall: "applyQuery"
2091
2154
  })), query), await client.ontologyRid, query.apiName, {
2092
- parameters: params ? await remapQueryParams(params, client, query.parameters) : {}
2155
+ parameters: params ? await remapQueryParams(params, client, qd.parameters) : {}
2093
2156
  });
2094
- const objectOutputDefs = await getRequiredDefinitions(query.output, client);
2095
- const remappedResponse = await remapQueryResponse(client, query.output, response.value, objectOutputDefs);
2157
+ const objectOutputDefs = await getRequiredDefinitions(qd.output, client);
2158
+ const remappedResponse = await remapQueryResponse(client, qd.output, response.value, objectOutputDefs);
2096
2159
  return remappedResponse;
2097
2160
  }
2098
2161
  async function remapQueryParams(params, client, paramTypes) {
@@ -2287,27 +2350,28 @@ function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvi
2287
2350
  }, baseUrl, tokenProvider, options, fetchFn, objectSetFactory);
2288
2351
  function clientFn(o) {
2289
2352
  if (o.type === "object" || o.type === "interface") {
2290
- clientCtx.ontologyProvider.maybeSeed(o);
2291
2353
  return objectSetFactory(o, clientCtx);
2292
2354
  } else if (o.type === "action") {
2293
- clientCtx.ontologyProvider.maybeSeed(o);
2294
2355
  return new ActionInvoker(clientCtx, o);
2295
2356
  } else if (o.type === "query") {
2296
- clientCtx.ontologyProvider.maybeSeed(o);
2297
2357
  return new QueryInvoker(clientCtx, o);
2298
2358
  } else {
2299
2359
  throw new Error("not implemented");
2300
2360
  }
2301
2361
  }
2362
+ const fetchMetadata = fetchMetadataInternal.bind(void 0, clientCtx);
2302
2363
  const client = Object.defineProperties(clientFn, {
2303
2364
  [symbolClientContext]: {
2304
2365
  value: clientCtx
2366
+ },
2367
+ fetchMetadata: {
2368
+ value: fetchMetadata
2305
2369
  }
2306
2370
  });
2307
2371
  return client;
2308
2372
  }
2309
2373
  var createClient = createClientInternal.bind(void 0, createObjectSet);
2310
2374
 
2311
- export { ActionValidationError, USER_AGENT, augment, convertWireToOsdkObjects, createAttachmentFromRid, createAttachmentUpload, createClient, createClientInternal, createObjectSet, createSimpleAsyncCache, esm_exports2 as esm_exports };
2312
- //# sourceMappingURL=chunk-CAIAIF75.js.map
2313
- //# sourceMappingURL=chunk-CAIAIF75.js.map
2375
+ export { ActionValidationError, USER_AGENT, augment, convertWireToOsdkObjects, createAttachmentFromRid, createAttachmentUpload, createClient, createClientInternal, createObjectSet, createSimpleAsyncCache, esm_exports };
2376
+ //# sourceMappingURL=chunk-ZX7FXI5W.js.map
2377
+ //# sourceMappingURL=chunk-ZX7FXI5W.js.map