@osdk/client 2.0.0-beta.6 → 2.0.0-beta.8

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.
@@ -221,7 +221,7 @@ var __export3 = (target, all) => {
221
221
  });
222
222
  };
223
223
 
224
- // ../internal.foundry.ontologies/build/esm/chunk-Y7POOFVF.js
224
+ // ../internal.foundry.ontologies/build/esm/chunk-UM4N5F6D.js
225
225
  var QueryType_exports = {};
226
226
  __export3(QueryType_exports, {
227
227
  getQueryType: () => getQueryType,
@@ -231,7 +231,7 @@ var _listQueryTypes = [0, "/v1/ontologies/{0}/queryTypes", 2];
231
231
  function listQueryTypes($ctx, ...args) {
232
232
  return foundryPlatformFetch($ctx, _listQueryTypes, ...args);
233
233
  }
234
- var _getQueryType = [0, "/v1/ontologies/{0}/queryTypes/{1}", 2];
234
+ var _getQueryType = [0, "/v1/ontologies/{0}/queryTypes/{1}"];
235
235
  function getQueryType($ctx, ...args) {
236
236
  return foundryPlatformFetch($ctx, _getQueryType, ...args);
237
237
  }
@@ -381,12 +381,12 @@ function aggregateObjects($ctx, ...args) {
381
381
  return foundryPlatformFetch($ctx, _aggregateObjects, ...args);
382
382
  }
383
383
 
384
- // ../internal.foundry.ontologies/build/esm/chunk-SO7SXCWR.js
384
+ // ../internal.foundry.ontologies/build/esm/chunk-SALCOSHR.js
385
385
  var Query_exports = {};
386
386
  __export3(Query_exports, {
387
387
  executeQuery: () => executeQuery
388
388
  });
389
- var _executeQuery = [1, "/v1/ontologies/{0}/queries/{1}/execute", 3];
389
+ var _executeQuery = [1, "/v1/ontologies/{0}/queries/{1}/execute", 1];
390
390
  function executeQuery($ctx, ...args) {
391
391
  return foundryPlatformFetch($ctx, _executeQuery, ...args);
392
392
  }
@@ -701,7 +701,11 @@ function createAttachmentFromRid(client, rid) {
701
701
  return esm_exports.Attachments.getAttachmentContent(client, rid);
702
702
  },
703
703
  async fetchMetadata() {
704
- return esm_exports.Attachments.getAttachment(client, rid);
704
+ const r = await esm_exports.Attachments.getAttachment(client, rid);
705
+ return {
706
+ ...r,
707
+ sizeBytes: Number(r.sizeBytes)
708
+ };
705
709
  }
706
710
  };
707
711
  }
@@ -922,7 +926,7 @@ function createAsyncClientCache(fn, createCacheLocal = createClientCache) {
922
926
  }
923
927
 
924
928
  // src/ontology/OntologyProvider.ts
925
- var InterfaceDefinitions = Symbol(process.env.MODE !== "production" ? "InterfaceDefinitions" : void 0);
929
+ var InterfaceDefinitions = Symbol("InterfaceDefinitions" );
926
930
 
927
931
  // src/object/SimpleCache.ts
928
932
  function createSimpleCache(map = /* @__PURE__ */ new Map(), fn) {
@@ -973,11 +977,11 @@ function createSimpleAsyncCache(type, fn, createCacheLocal = createSimpleCache)
973
977
  }
974
978
 
975
979
  // src/object/convertWireToOsdkObjects/InternalSymbols.ts
976
- var UnderlyingOsdkObject = Symbol(process.env.MODE !== "production" ? "Underlying Object" : void 0);
977
- var ObjectDefRef = Symbol(process.env.MODE !== "production" ? "ObjectDefinition" : void 0);
978
- var InterfaceDefRef = Symbol(process.env.MODE !== "production" ? "InterfaceDefinition" : void 0);
979
- var RawObject = Symbol(process.env.MODE !== "production" ? "RawObject" : void 0);
980
- var ClientRef = Symbol(process.env.MODE !== "production" ? "ClientRef" : void 0);
980
+ var UnderlyingOsdkObject = Symbol("Underlying Object" );
981
+ var ObjectDefRef = Symbol("ObjectDefinition" );
982
+ var InterfaceDefRef = Symbol("InterfaceDefinition" );
983
+ var RawObject = Symbol("RawObject" );
984
+ var ClientRef = Symbol("ClientRef" );
981
985
 
982
986
  // src/object/convertWireToOsdkObjects/createOsdkInterface.ts
983
987
  var handlerCache = createSimpleCache(/* @__PURE__ */ new WeakMap(), createInterfaceProxyHandler);
@@ -1733,7 +1737,7 @@ async function fetchInterfacePage(client, interfaceType, args, objectSet) {
1733
1737
  augmentedProperties: args.$augment ?? {},
1734
1738
  augmentedSharedPropertyTypes: {},
1735
1739
  otherInterfaceTypes: [],
1736
- selectedObjectTypes: [],
1740
+ selectedObjectTypes: args.$__EXPERIMENTAL_selectedObjectTypes ?? [],
1737
1741
  selectedSharedPropertyTypes: args.$select ?? [],
1738
1742
  where: objectSetToSearchJsonV2(objectSet, interfaceType.apiName)
1739
1743
  }), {
@@ -1868,7 +1872,8 @@ async function applyAction2(client, action, parameters, options = {}) {
1868
1872
  returnEdits: options?.$returnEdits ? "ALL" : "NONE"
1869
1873
  }
1870
1874
  });
1871
- return options?.$returnEdits ? response.edits : void 0;
1875
+ const edits = response.edits;
1876
+ return options?.$returnEdits ? edits?.type === "edits" ? remapActionResponse(response) : edits : void 0;
1872
1877
  } else {
1873
1878
  const response = await esm_exports2.Actions.applyActionV2(clientWithHeaders, await client.ontologyRid, action.apiName, {
1874
1879
  parameters: await remapActionParams(parameters, client),
@@ -1883,7 +1888,8 @@ async function applyAction2(client, action, parameters, options = {}) {
1883
1888
  if (response.validation?.result === "INVALID") {
1884
1889
  throw new ActionValidationError(response.validation);
1885
1890
  }
1886
- return options?.$returnEdits ? response.edits : void 0;
1891
+ const edits = response.edits;
1892
+ return options?.$returnEdits ? edits?.type === "edits" ? remapActionResponse(response) : edits : void 0;
1887
1893
  }
1888
1894
  }
1889
1895
  async function remapActionParams(params, client) {
@@ -1904,6 +1910,38 @@ async function remapBatchActionParams(params, client) {
1904
1910
  }));
1905
1911
  return remappedParams;
1906
1912
  }
1913
+ function remapActionResponse(response) {
1914
+ const editResponses = response?.edits;
1915
+ if (editResponses?.type === "edits") {
1916
+ const remappedActionResponse = {
1917
+ type: editResponses.type,
1918
+ deletedLinksCount: editResponses.deletedLinksCount,
1919
+ deletedObjectsCount: editResponses.deletedObjectsCount,
1920
+ addedLinks: [],
1921
+ addedObjects: [],
1922
+ modifiedObjects: [],
1923
+ editedObjectTypes: []
1924
+ };
1925
+ const editedObjectTypesSet = /* @__PURE__ */ new Set();
1926
+ for (const edit of editResponses.edits) {
1927
+ if (edit.type === "addLink") {
1928
+ remappedActionResponse.addedLinks.push(edit);
1929
+ editedObjectTypesSet.add(edit.aSideObject.objectType);
1930
+ editedObjectTypesSet.add(edit.bSideObject.objectType);
1931
+ } else if (edit.type === "addObject") {
1932
+ remappedActionResponse.addedObjects.push(edit);
1933
+ editedObjectTypesSet.add(edit.objectType);
1934
+ } else if (edit.type === "modifyObject") {
1935
+ remappedActionResponse.modifiedObjects.push(edit);
1936
+ editedObjectTypesSet.add(edit.objectType);
1937
+ } else {
1938
+ process.env.NODE_ENV !== "production" ? invariant(false, "Unknown edit type") : invariant(false) ;
1939
+ }
1940
+ }
1941
+ remappedActionResponse.editedObjectTypes = [...editedObjectTypesSet];
1942
+ return remappedActionResponse;
1943
+ }
1944
+ }
1907
1945
  async function loadFullObjectMetadata(client, objectType) {
1908
1946
  const full = await esm_exports2.ObjectTypesV2.getObjectTypeFullMetadata(client, await client.ontologyRid, objectType, {
1909
1947
  preview: true
@@ -1957,7 +1995,7 @@ var createStandardOntologyProviderFactory = (client) => {
1957
1995
  };
1958
1996
 
1959
1997
  // src/util/UserAgent.ts
1960
- var USER_AGENT = `osdk-client/${"2.0.0-beta.6"}`;
1998
+ var USER_AGENT = `osdk-client/${"2.0.0-beta.8"}`;
1961
1999
 
1962
2000
  // src/createMinimalClient.ts
1963
2001
  function createMinimalClient(metadata, baseUrl, tokenProvider, options = {}, fetchFn = global.fetch, objectSetFactory = createObjectSet) {
@@ -2285,5 +2323,5 @@ function createClientInternal(objectSetFactory, baseUrl, ontologyRid, tokenProvi
2285
2323
  var createClient = createClientInternal.bind(void 0, createObjectSet);
2286
2324
 
2287
2325
  export { ActionValidationError, USER_AGENT, augment, convertWireToOsdkObjects, createAttachmentFromRid, createAttachmentUpload, createClient, createClientInternal, createObjectSet, createSimpleAsyncCache, esm_exports2 as esm_exports };
2288
- //# sourceMappingURL=chunk-CCGBSE5A.js.map
2289
- //# sourceMappingURL=chunk-CCGBSE5A.js.map
2326
+ //# sourceMappingURL=chunk-5HUCUBJX.js.map
2327
+ //# sourceMappingURL=chunk-5HUCUBJX.js.map