@osdk/client 2.3.0-rc.11 → 2.3.1

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 (46) hide show
  1. package/CHANGELOG.md +169 -0
  2. package/build/browser/Client.js +1 -1
  3. package/build/browser/Client.js.map +1 -1
  4. package/build/browser/MinimalClientContext.js.map +1 -1
  5. package/build/browser/createClient.js +5 -5
  6. package/build/browser/createClient.js.map +1 -1
  7. package/build/browser/createMinimalClient.js +1 -0
  8. package/build/browser/createMinimalClient.js.map +1 -1
  9. package/build/browser/index.js.map +1 -1
  10. package/build/browser/public/unstable-do-not-use.js +1 -0
  11. package/build/browser/public/unstable-do-not-use.js.map +1 -1
  12. package/build/browser/util/UserAgent.js +2 -2
  13. package/build/browser/util/UserAgent.js.map +1 -1
  14. package/build/cjs/{chunk-LZ4GFSOQ.cjs → chunk-FWYXUSCF.cjs} +54 -50
  15. package/build/cjs/chunk-FWYXUSCF.cjs.map +1 -0
  16. package/build/cjs/{chunk-QHPACIXZ.cjs → chunk-T5KGTBH2.cjs} +2 -2
  17. package/build/cjs/{chunk-QHPACIXZ.cjs.map → chunk-T5KGTBH2.cjs.map} +1 -1
  18. package/build/cjs/createClient-DJq2ecGM.d.cts +9 -0
  19. package/build/cjs/index.cjs +6 -6
  20. package/build/cjs/index.d.cts +5 -8
  21. package/build/cjs/public/internal.cjs +8 -8
  22. package/build/cjs/public/unstable-do-not-use.cjs +19 -15
  23. package/build/cjs/public/unstable-do-not-use.d.cts +1 -0
  24. package/build/esm/Client.js +1 -1
  25. package/build/esm/Client.js.map +1 -1
  26. package/build/esm/MinimalClientContext.js.map +1 -1
  27. package/build/esm/createClient.js +5 -5
  28. package/build/esm/createClient.js.map +1 -1
  29. package/build/esm/createMinimalClient.js +1 -0
  30. package/build/esm/createMinimalClient.js.map +1 -1
  31. package/build/esm/index.js.map +1 -1
  32. package/build/esm/public/unstable-do-not-use.js +1 -0
  33. package/build/esm/public/unstable-do-not-use.js.map +1 -1
  34. package/build/esm/util/UserAgent.js +2 -2
  35. package/build/esm/util/UserAgent.js.map +1 -1
  36. package/build/types/Client.d.ts +1 -1
  37. package/build/types/MinimalClientContext.d.ts +1 -0
  38. package/build/types/MinimalClientContext.d.ts.map +1 -1
  39. package/build/types/createClient.d.ts +1 -0
  40. package/build/types/createClient.d.ts.map +1 -1
  41. package/build/types/index.d.ts +1 -1
  42. package/build/types/index.d.ts.map +1 -1
  43. package/build/types/public/unstable-do-not-use.d.ts +1 -0
  44. package/build/types/public/unstable-do-not-use.d.ts.map +1 -1
  45. package/package.json +11 -11
  46. package/build/cjs/chunk-LZ4GFSOQ.cjs.map +0 -1
@@ -0,0 +1,9 @@
1
+ import { Logger } from '@osdk/api';
2
+ import { C as Client } from './Client-CgL2LKN9.cjs';
3
+
4
+ declare const createClient: (baseUrl: string, ontologyRid: string | Promise<string>, tokenProvider: () => Promise<string>, options?: {
5
+ logger?: Logger;
6
+ } | undefined, fetchFn?: typeof fetch | undefined) => Client;
7
+ declare const createClientWithTransaction: (transactionRid: string, ...args: Parameters<typeof createClient>) => Client;
8
+
9
+ export { createClientWithTransaction as a, createClient as c };
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunkLZ4GFSOQ_cjs = require('./chunk-LZ4GFSOQ.cjs');
4
- require('./chunk-QHPACIXZ.cjs');
3
+ var chunkFWYXUSCF_cjs = require('./chunk-FWYXUSCF.cjs');
4
+ require('./chunk-T5KGTBH2.cjs');
5
5
  var api = require('@osdk/api');
6
6
  var shared_net_errors = require('@osdk/shared.net.errors');
7
7
  var shared_client_impl = require('@osdk/shared.client.impl');
@@ -12,7 +12,7 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
12
12
  var invariant__default = /*#__PURE__*/_interopDefault(invariant);
13
13
 
14
14
  function createPlatformClient(baseUrl, tokenProvider, options = void 0, fetchFn = fetch) {
15
- return shared_client_impl.createSharedClientContext(baseUrl, tokenProvider, chunkLZ4GFSOQ_cjs.USER_AGENT, fetchFn);
15
+ return shared_client_impl.createSharedClientContext(baseUrl, tokenProvider, chunkFWYXUSCF_cjs.USER_AGENT, fetchFn);
16
16
  }
17
17
  var isoRegex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})?$/;
18
18
  var extractDate = (dateTime) => {
@@ -36,15 +36,15 @@ var extractDateFromIsoString = (dateTime) => {
36
36
 
37
37
  Object.defineProperty(exports, "ActionValidationError", {
38
38
  enumerable: true,
39
- get: function () { return chunkLZ4GFSOQ_cjs.ActionValidationError; }
39
+ get: function () { return chunkFWYXUSCF_cjs.ActionValidationError; }
40
40
  });
41
41
  Object.defineProperty(exports, "createAttachmentUpload", {
42
42
  enumerable: true,
43
- get: function () { return chunkLZ4GFSOQ_cjs.createAttachmentUpload; }
43
+ get: function () { return chunkFWYXUSCF_cjs.createAttachmentUpload; }
44
44
  });
45
45
  Object.defineProperty(exports, "createClient", {
46
46
  enumerable: true,
47
- get: function () { return chunkLZ4GFSOQ_cjs.createClient; }
47
+ get: function () { return chunkFWYXUSCF_cjs.createClient; }
48
48
  });
49
49
  Object.defineProperty(exports, "isOk", {
50
50
  enumerable: true,
@@ -1,8 +1,9 @@
1
- import { Logger, AttachmentUpload } from '@osdk/api';
2
- export { ActionDefinition, ActionEditResponse, ActionMetadata, ActionParam, ActionReturnTypeForOptions, ActionValidationResponse, ApplyActionOptions, ApplyBatchActionOptions, Attachment, CompileTimeMetadata, InterfaceDefinition, Logger, ObjectMetadata, ObjectSet, ObjectSpecifier, ObjectTypeDefinition, Osdk, OsdkObject, OsdkObjectPropertyType, PageResult, PropertyDef, PropertyKeys, PropertyValueWireToClient, QueryDefinition, QueryParam, QueryResult, Range, Result, SingleLinkAccessor, ThreeDimensionalAggregation, TwoDimensionalAggregation, VersionBound, WhereClause, isOk } from '@osdk/api';
1
+ import { AttachmentUpload } from '@osdk/api';
2
+ export { ActionDefinition, ActionEditResponse, ActionMetadata, ActionParam, ActionReturnTypeForOptions, ActionValidationResponse, ApplyActionOptions, ApplyBatchActionOptions, Attachment, CompileTimeMetadata, InterfaceDefinition, Logger, ObjectMetadata, ObjectSet, ObjectSpecifier, ObjectTypeDefinition, Osdk, OsdkObject, OsdkObjectCreatePropertyType, OsdkObjectPropertyType, PageResult, PropertyDef, PropertyKeys, PropertyValueWireToClient, QueryDefinition, QueryParam, QueryResult, Range, Result, SingleLinkAccessor, ThreeDimensionalAggregation, TwoDimensionalAggregation, VersionBound, WhereClause, isOk } from '@osdk/api';
3
3
  export { PalantirApiError } from '@osdk/shared.net.errors';
4
4
  import { ValidateActionResponseV2 } from '@osdk/foundry.ontologies';
5
- import { C as Client } from './Client-CgL2LKN9.cjs';
5
+ export { C as Client } from './Client-CgL2LKN9.cjs';
6
+ export { c as createClient } from './createClient-DJq2ecGM.cjs';
6
7
  import { SharedClientContext } from '@osdk/shared.client2';
7
8
  import '@osdk/shared.client';
8
9
  import '@osdk/api/unstable';
@@ -12,10 +13,6 @@ declare class ActionValidationError extends Error {
12
13
  constructor(validation: ValidateActionResponseV2);
13
14
  }
14
15
 
15
- declare const createClient: (baseUrl: string, ontologyRid: string | Promise<string>, tokenProvider: () => Promise<string>, options?: {
16
- logger?: Logger;
17
- } | undefined, fetchFn?: typeof fetch | undefined) => Client;
18
-
19
16
  interface PlatformClient extends SharedClientContext {
20
17
  }
21
18
  /**
@@ -65,4 +62,4 @@ declare const extractDateInUTC: (date: Date) => string;
65
62
  */
66
63
  declare const extractDateInLocalTime: (date: Date) => string;
67
64
 
68
- export { ActionValidationError, Client, type PlatformClient, type ResultOrError, createAttachmentUpload, createClient, createPlatformClient, extractDate, extractDateInLocalTime, extractDateInUTC };
65
+ export { ActionValidationError, type PlatformClient, type ResultOrError, createAttachmentUpload, createPlatformClient, extractDate, extractDateInLocalTime, extractDateInUTC };
@@ -1,18 +1,18 @@
1
1
  'use strict';
2
2
 
3
- var chunkQHPACIXZ_cjs = require('../chunk-QHPACIXZ.cjs');
3
+ var chunkT5KGTBH2_cjs = require('../chunk-T5KGTBH2.cjs');
4
4
 
5
5
  // src/public-utils/createAndFetchTempObjectSetRid.ts
6
6
  async function createAndFetchTempObjectSetRid(client, objectSet) {
7
- const response = await chunkQHPACIXZ_cjs.OntologyObjectSet_exports.createTemporary(client, await client[chunkQHPACIXZ_cjs.additionalContext].ontologyRid, {
8
- objectSet: chunkQHPACIXZ_cjs.getWireObjectSet(objectSet)
7
+ const response = await chunkT5KGTBH2_cjs.OntologyObjectSet_exports.createTemporary(client, await client[chunkT5KGTBH2_cjs.additionalContext].ontologyRid, {
8
+ objectSet: chunkT5KGTBH2_cjs.getWireObjectSet(objectSet)
9
9
  });
10
10
  return response.objectSetRid;
11
11
  }
12
12
 
13
13
  // src/public-utils/hydrateObjectSetFromObjectRids.ts
14
14
  function hydrateObjectSetFromObjectRids(client, definition, rids) {
15
- return chunkQHPACIXZ_cjs.createObjectSet(definition, client[chunkQHPACIXZ_cjs.additionalContext], {
15
+ return chunkT5KGTBH2_cjs.createObjectSet(definition, client[chunkT5KGTBH2_cjs.additionalContext], {
16
16
  type: "intersect",
17
17
  objectSets: [{
18
18
  type: "base",
@@ -26,7 +26,7 @@ function hydrateObjectSetFromObjectRids(client, definition, rids) {
26
26
 
27
27
  // src/public-utils/hydrateObjectSetFromRid.ts
28
28
  function hydrateObjectSetFromRid(client, definition, rid) {
29
- return chunkQHPACIXZ_cjs.createObjectSet(definition, client[chunkQHPACIXZ_cjs.additionalContext], {
29
+ return chunkT5KGTBH2_cjs.createObjectSet(definition, client[chunkT5KGTBH2_cjs.additionalContext], {
30
30
  type: "intersect",
31
31
  objectSets: [{
32
32
  type: "base",
@@ -64,7 +64,7 @@ var levelStyles = {
64
64
  color: "orange"
65
65
  })
66
66
  };
67
- var BrowserLogger = class _BrowserLogger extends chunkQHPACIXZ_cjs.BaseLogger {
67
+ var BrowserLogger = class _BrowserLogger extends chunkT5KGTBH2_cjs.BaseLogger {
68
68
  constructor(bindings = {}, options = {}) {
69
69
  super(bindings, {
70
70
  ...options,
@@ -90,11 +90,11 @@ var BrowserLogger = class _BrowserLogger extends chunkQHPACIXZ_cjs.BaseLogger {
90
90
 
91
91
  Object.defineProperty(exports, "MinimalLogger", {
92
92
  enumerable: true,
93
- get: function () { return chunkQHPACIXZ_cjs.MinimalLogger; }
93
+ get: function () { return chunkT5KGTBH2_cjs.MinimalLogger; }
94
94
  });
95
95
  Object.defineProperty(exports, "hydrateAttachmentFromRid", {
96
96
  enumerable: true,
97
- get: function () { return chunkQHPACIXZ_cjs.hydrateAttachmentFromRid; }
97
+ get: function () { return chunkT5KGTBH2_cjs.hydrateAttachmentFromRid; }
98
98
  });
99
99
  exports.BrowserLogger = BrowserLogger;
100
100
  exports.createAndFetchTempObjectSetRid = createAndFetchTempObjectSetRid;
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunkLZ4GFSOQ_cjs = require('../chunk-LZ4GFSOQ.cjs');
4
- var chunkQHPACIXZ_cjs = require('../chunk-QHPACIXZ.cjs');
3
+ var chunkFWYXUSCF_cjs = require('../chunk-FWYXUSCF.cjs');
4
+ var chunkT5KGTBH2_cjs = require('../chunk-T5KGTBH2.cjs');
5
5
  var shared_net_fetch = require('@osdk/shared.net.fetch');
6
6
  var rxjs = require('rxjs');
7
7
  var invariant2 = require('tiny-invariant');
@@ -138,7 +138,7 @@ var OptimisticJob = class {
138
138
  return this;
139
139
  },
140
140
  createObject(type, pk, properties) {
141
- const create = store.client[chunkQHPACIXZ_cjs.additionalContext].objectFactory2(store.client[chunkQHPACIXZ_cjs.additionalContext], [{
141
+ const create = store.client[chunkT5KGTBH2_cjs.additionalContext].objectFactory2(store.client[chunkT5KGTBH2_cjs.additionalContext], [{
142
142
  $primaryKey: pk,
143
143
  $apiName: type.apiName,
144
144
  $objectType: type.apiName,
@@ -618,7 +618,7 @@ var BulkObjectLoader = class {
618
618
  #maxEntries;
619
619
  constructor(client, maxWait = 25, maxEntries = 100) {
620
620
  this.#client = client;
621
- this.#logger = client[chunkQHPACIXZ_cjs.additionalContext].logger;
621
+ this.#logger = client[chunkT5KGTBH2_cjs.additionalContext].logger;
622
622
  this.#maxWait = maxWait;
623
623
  this.#maxEntries = maxEntries;
624
624
  }
@@ -688,7 +688,7 @@ var Query = class {
688
688
  this.cacheKey = cacheKey;
689
689
  this.store = store;
690
690
  this.#subject = observable;
691
- this.logger = logger ?? (process.env.NODE_ENV === "production" ? store.client[chunkQHPACIXZ_cjs.additionalContext].logger : store.client[chunkQHPACIXZ_cjs.additionalContext].logger?.child({}, {
691
+ this.logger = logger ?? (process.env.NODE_ENV === "production" ? store.client[chunkT5KGTBH2_cjs.additionalContext].logger : store.client[chunkT5KGTBH2_cjs.additionalContext].logger?.child({}, {
692
692
  msgPrefix: process.env.NODE_ENV !== "production" ? `Query<${cacheKey.type}, ${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>` : "Query"
693
693
  }));
694
694
  }
@@ -798,7 +798,7 @@ var ObjectQuery = class extends Query {
798
798
  #apiName;
799
799
  #pk;
800
800
  constructor(store, subject, type, pk, cacheKey, opts) {
801
- super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunkQHPACIXZ_cjs.additionalContext].logger?.child({}, {
801
+ super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunkT5KGTBH2_cjs.additionalContext].logger?.child({}, {
802
802
  msgPrefix: `ObjectQuery<${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>`
803
803
  }) : void 0);
804
804
  this.#apiName = type;
@@ -983,7 +983,7 @@ var ListQuery = class extends BaseListQuery {
983
983
  #objectSet;
984
984
  #sortFns;
985
985
  constructor(store, subject, apiType, apiName, whereClause, orderBy, cacheKey, opts) {
986
- super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunkQHPACIXZ_cjs.additionalContext].logger?.child({}, {
986
+ super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunkT5KGTBH2_cjs.additionalContext].logger?.child({}, {
987
987
  msgPrefix: `ListQuery<${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>`
988
988
  }) : void 0);
989
989
  this.#type = apiType;
@@ -1228,7 +1228,7 @@ var ListQuery = class extends BaseListQuery {
1228
1228
  }
1229
1229
  #extractRelevantObjectsForTypeInterface(changes) {
1230
1230
  const matchesApiName = ([, object]) => {
1231
- return this.#apiName in object[chunkLZ4GFSOQ_cjs.ObjectDefRef].interfaceMap;
1231
+ return this.#apiName in object[chunkFWYXUSCF_cjs.ObjectDefRef].interfaceMap;
1232
1232
  };
1233
1233
  const added = Array.from(changes.addedObjects).filter(matchesApiName).map(([, object]) => object.$as(this.#apiName));
1234
1234
  const modified = Array.from(changes.modifiedObjects).filter(matchesApiName).map(([, object]) => object.$as(this.#apiName));
@@ -1404,7 +1404,7 @@ function createOrderBySortFns(orderBy) {
1404
1404
  async function reloadDataAsFullObjects(client, data) {
1405
1405
  const groups = groupBy__default.default(data, (x) => x.$objectType);
1406
1406
  const objectTypeToPrimaryKeyToObject = Object.fromEntries(await Promise.all(Object.entries(groups).map(async ([apiName, objects]) => {
1407
- const objectDef = objects[0][chunkLZ4GFSOQ_cjs.UnderlyingOsdkObject][chunkLZ4GFSOQ_cjs.ObjectDefRef];
1407
+ const objectDef = objects[0][chunkFWYXUSCF_cjs.UnderlyingOsdkObject][chunkFWYXUSCF_cjs.ObjectDefRef];
1408
1408
  const where = {
1409
1409
  [objectDef.primaryKeyApiName]: {
1410
1410
  $in: objects.map((x) => x.$primaryKey)
@@ -1612,7 +1612,7 @@ var Store = class {
1612
1612
  #finalizationRegistry;
1613
1613
  constructor(client) {
1614
1614
  this.client = client;
1615
- this.logger = client[chunkQHPACIXZ_cjs.additionalContext].logger?.child({}, {
1615
+ this.logger = client[chunkT5KGTBH2_cjs.additionalContext].logger?.child({}, {
1616
1616
  msgPrefix: "Store"
1617
1617
  });
1618
1618
  this.#topLayer = this.#truthLayer;
@@ -1906,10 +1906,10 @@ var Store = class {
1906
1906
 
1907
1907
  // src/observable/ObservableClient.ts
1908
1908
  function createObservableClient(client) {
1909
- const tweakedClient = chunkLZ4GFSOQ_cjs.createClientFromContext({
1910
- ...client[chunkQHPACIXZ_cjs.additionalContext],
1911
- fetch: shared_net_fetch.createFetchHeaderMutator(client[chunkQHPACIXZ_cjs.additionalContext].fetch, (headers) => {
1912
- headers.set("Fetch-User-Agent", [headers.get("Fetch-User-Agent"), chunkLZ4GFSOQ_cjs.OBSERVABLE_USER_AGENT].filter((x) => x && x?.length > 0).join(" "));
1909
+ const tweakedClient = chunkFWYXUSCF_cjs.createClientFromContext({
1910
+ ...client[chunkT5KGTBH2_cjs.additionalContext],
1911
+ fetch: shared_net_fetch.createFetchHeaderMutator(client[chunkT5KGTBH2_cjs.additionalContext].fetch, (headers) => {
1912
+ headers.set("Fetch-User-Agent", [headers.get("Fetch-User-Agent"), chunkFWYXUSCF_cjs.OBSERVABLE_USER_AGENT].filter((x) => x && x?.length > 0).join(" "));
1913
1913
  return headers;
1914
1914
  })
1915
1915
  });
@@ -1950,9 +1950,13 @@ function getOsdkConfig(ontologyRid) {
1950
1950
  };
1951
1951
  }
1952
1952
 
1953
+ Object.defineProperty(exports, "createClientWithTransaction", {
1954
+ enumerable: true,
1955
+ get: function () { return chunkFWYXUSCF_cjs.createClientWithTransaction; }
1956
+ });
1953
1957
  Object.defineProperty(exports, "augment", {
1954
1958
  enumerable: true,
1955
- get: function () { return chunkQHPACIXZ_cjs.augment; }
1959
+ get: function () { return chunkT5KGTBH2_cjs.augment; }
1956
1960
  });
1957
1961
  exports.createObservableClient = createObservableClient;
1958
1962
  exports.getMetaTagContent = getMetaTagContent;
@@ -1,5 +1,6 @@
1
1
  import { ObjectOrInterfaceDefinition, PropertyKeys, Augment, ObjectTypeDefinition, Osdk, PrimaryKeyType, InterfaceDefinition, WhereClause, ActionDefinition } from '@osdk/api';
2
2
  import { C as Client, A as ActionSignatureFromDef } from '../Client-CgL2LKN9.cjs';
3
+ export { a as createClientWithTransaction } from '../createClient-DJq2ecGM.cjs';
3
4
  import '@osdk/shared.client';
4
5
  import '@osdk/api/unstable';
5
6
  import '@osdk/shared.client2';
@@ -21,7 +21,7 @@
21
21
  export const additionalContext = Symbol("additionalContext");
22
22
 
23
23
  // BEGIN: THIS IS GENERATED CODE. DO NOT EDIT.
24
- const MaxOsdkVersion = "2.3.0";
24
+ const MaxOsdkVersion = "2.3.1";
25
25
  // END: THIS IS GENERATED CODE. DO NOT EDIT.
26
26
 
27
27
  const ErrorMessage = Symbol("ErrorMessage");
@@ -1 +1 @@
1
- {"version":3,"file":"Client.js","names":["additionalContext","Symbol","MaxOsdkVersion","ErrorMessage"],"sources":["Client.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ActionDefinition,\n ActionMetadata,\n CompileTimeMetadata,\n InterfaceDefinition,\n InterfaceMetadata,\n ObjectMetadata,\n ObjectSet,\n ObjectTypeDefinition,\n QueryDefinition,\n QueryMetadata,\n VersionBound,\n} from \"@osdk/api\";\nimport type {\n Experiment,\n ExperimentFns,\n MinimalObjectSet,\n} from \"@osdk/api/unstable\";\nimport type { SharedClient } from \"@osdk/shared.client2\";\nimport type { ActionSignatureFromDef } from \"./actions/applyAction.js\";\nimport type { MinimalClient } from \"./MinimalClientContext.js\";\nimport type { QuerySignatureFromDef } from \"./queries/types.js\";\nimport type { SatisfiesSemver } from \"./SatisfiesSemver.js\";\n\n// eslint-disable-next-line @typescript-eslint/consistent-type-imports\ntype OldSharedClient = import(\"@osdk/shared.client\").SharedClient;\n\nexport type CheckVersionBound<Q> = Q extends VersionBound<infer V> ? (\n SatisfiesSemver<V, MaxOsdkVersion> extends true ? Q\n : Q & {\n [ErrorMessage]:\n `Your SDK requires a semver compatible version with ${V}. You have ${MaxOsdkVersion}. Update your package.json`;\n }\n )\n : Q;\n\nexport interface Client extends SharedClient, OldSharedClient {\n <Q extends ObjectTypeDefinition>(\n o: Q,\n ): unknown extends CompileTimeMetadata<Q>[\"objectSet\"] ? ObjectSet<Q>\n : CompileTimeMetadata<Q>[\"objectSet\"];\n\n <Q extends (InterfaceDefinition)>(\n o: Q,\n ): unknown extends CompileTimeMetadata<Q>[\"objectSet\"] ? MinimalObjectSet<Q>\n : CompileTimeMetadata<Q>[\"objectSet\"];\n\n <Q extends ActionDefinition<any>>(\n o: Q,\n ): ActionSignatureFromDef<Q>;\n\n <Q extends QueryDefinition<any>>(\n o: Q,\n ): QuerySignatureFromDef<Q>;\n\n <Q extends Experiment<\"2.0.8\"> | Experiment<\"2.1.0\"> | Experiment<\"2.2.0\">>(\n experiment: Q,\n ): ExperimentFns<Q>;\n\n fetchMetadata<\n Q extends (\n | ObjectTypeDefinition\n | InterfaceDefinition\n | ActionDefinition<any>\n | QueryDefinition<any>\n ),\n >(o: Q): Promise<\n Q extends ObjectTypeDefinition ? ObjectMetadata\n : Q extends InterfaceDefinition ? InterfaceMetadata\n : Q extends ActionDefinition<any> ? ActionMetadata\n : Q extends QueryDefinition<any> ? QueryMetadata\n : never\n >;\n\n /** @internal */\n [additionalContext]: MinimalClient;\n}\n\n// DO NOT EXPORT FROM PACKAGE\n/** @internal */\nexport const additionalContext: unique symbol = Symbol(\"additionalContext\");\n\n// BEGIN: THIS IS GENERATED CODE. DO NOT EDIT.\nconst MaxOsdkVersion = \"2.3.0\";\n// END: THIS IS GENERATED CODE. DO NOT EDIT.\nexport type MaxOsdkVersion = typeof MaxOsdkVersion;\nconst ErrorMessage: unique symbol = Symbol(\"ErrorMessage\");\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA0BA;;AAsDA;AACA;AACA,OAAO,MAAMA,iBAAgC,GAAGC,MAAM,CAAC,mBAAmB,CAAC;;AAE3E;AACA,MAAMC,cAAc,GAAG,OAAO;AAC9B;;AAEA,MAAMC,YAA2B,GAAGF,MAAM,CAAC,cAAc,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"Client.js","names":["additionalContext","Symbol","MaxOsdkVersion","ErrorMessage"],"sources":["Client.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ActionDefinition,\n ActionMetadata,\n CompileTimeMetadata,\n InterfaceDefinition,\n InterfaceMetadata,\n ObjectMetadata,\n ObjectSet,\n ObjectTypeDefinition,\n QueryDefinition,\n QueryMetadata,\n VersionBound,\n} from \"@osdk/api\";\nimport type {\n Experiment,\n ExperimentFns,\n MinimalObjectSet,\n} from \"@osdk/api/unstable\";\nimport type { SharedClient } from \"@osdk/shared.client2\";\nimport type { ActionSignatureFromDef } from \"./actions/applyAction.js\";\nimport type { MinimalClient } from \"./MinimalClientContext.js\";\nimport type { QuerySignatureFromDef } from \"./queries/types.js\";\nimport type { SatisfiesSemver } from \"./SatisfiesSemver.js\";\n\n// eslint-disable-next-line @typescript-eslint/consistent-type-imports\ntype OldSharedClient = import(\"@osdk/shared.client\").SharedClient;\n\nexport type CheckVersionBound<Q> = Q extends VersionBound<infer V> ? (\n SatisfiesSemver<V, MaxOsdkVersion> extends true ? Q\n : Q & {\n [ErrorMessage]:\n `Your SDK requires a semver compatible version with ${V}. You have ${MaxOsdkVersion}. Update your package.json`;\n }\n )\n : Q;\n\nexport interface Client extends SharedClient, OldSharedClient {\n <Q extends ObjectTypeDefinition>(\n o: Q,\n ): unknown extends CompileTimeMetadata<Q>[\"objectSet\"] ? ObjectSet<Q>\n : CompileTimeMetadata<Q>[\"objectSet\"];\n\n <Q extends (InterfaceDefinition)>(\n o: Q,\n ): unknown extends CompileTimeMetadata<Q>[\"objectSet\"] ? MinimalObjectSet<Q>\n : CompileTimeMetadata<Q>[\"objectSet\"];\n\n <Q extends ActionDefinition<any>>(\n o: Q,\n ): ActionSignatureFromDef<Q>;\n\n <Q extends QueryDefinition<any>>(\n o: Q,\n ): QuerySignatureFromDef<Q>;\n\n <Q extends Experiment<\"2.0.8\"> | Experiment<\"2.1.0\"> | Experiment<\"2.2.0\">>(\n experiment: Q,\n ): ExperimentFns<Q>;\n\n fetchMetadata<\n Q extends (\n | ObjectTypeDefinition\n | InterfaceDefinition\n | ActionDefinition<any>\n | QueryDefinition<any>\n ),\n >(o: Q): Promise<\n Q extends ObjectTypeDefinition ? ObjectMetadata\n : Q extends InterfaceDefinition ? InterfaceMetadata\n : Q extends ActionDefinition<any> ? ActionMetadata\n : Q extends QueryDefinition<any> ? QueryMetadata\n : never\n >;\n\n /** @internal */\n [additionalContext]: MinimalClient;\n}\n\n// DO NOT EXPORT FROM PACKAGE\n/** @internal */\nexport const additionalContext: unique symbol = Symbol(\"additionalContext\");\n\n// BEGIN: THIS IS GENERATED CODE. DO NOT EDIT.\nconst MaxOsdkVersion = \"2.3.1\";\n// END: THIS IS GENERATED CODE. DO NOT EDIT.\nexport type MaxOsdkVersion = typeof MaxOsdkVersion;\nconst ErrorMessage: unique symbol = Symbol(\"ErrorMessage\");\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA0BA;;AAsDA;AACA;AACA,OAAO,MAAMA,iBAAgC,GAAGC,MAAM,CAAC,mBAAmB,CAAC;;AAE3E;AACA,MAAMC,cAAc,GAAG,OAAO;AAC9B;;AAEA,MAAMC,YAA2B,GAAGF,MAAM,CAAC,cAAc,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"MinimalClientContext.js","names":[],"sources":["MinimalClientContext.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { Logger } from \"@osdk/api\";\nimport type { SharedClientContext } from \"@osdk/shared.client2\";\nimport type {\n convertWireToOsdkObjects,\n convertWireToOsdkObjects2,\n} from \"./object/convertWireToOsdkObjects.js\";\nimport type { ObjectSetFactory } from \"./objectSet/ObjectSetFactory.js\";\nimport type { OntologyProvider } from \"./ontology/OntologyProvider.js\";\n\ndeclare const tag: unique symbol;\n\nexport type ClientCacheKey = {} & { readonly [tag]: void };\n\nexport type RequestContext = {\n finalMethodCall?: string;\n};\n\nexport interface MinimalClient extends SharedClientContext {\n ontologyRid: string | Promise<string>;\n ontologyProvider: OntologyProvider;\n logger?: Logger;\n /** @internal */\n objectSetFactory: ObjectSetFactory<any, any>;\n /** @internal */\n objectFactory: typeof convertWireToOsdkObjects;\n /** @internal */\n objectFactory2: typeof convertWireToOsdkObjects2;\n\n clientCacheKey: ClientCacheKey;\n requestContext: RequestContext;\n}\n\nexport type MinimalClientParams = {\n metadata: MinimalClientMetadata;\n provider: OntologyProvider;\n};\n\nexport interface MinimalClientMetadata {\n ontologyRid: string | Promise<string>;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"MinimalClientContext.js","names":[],"sources":["MinimalClientContext.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { Logger } from \"@osdk/api\";\nimport type { SharedClientContext } from \"@osdk/shared.client2\";\nimport type {\n convertWireToOsdkObjects,\n convertWireToOsdkObjects2,\n} from \"./object/convertWireToOsdkObjects.js\";\nimport type { ObjectSetFactory } from \"./objectSet/ObjectSetFactory.js\";\nimport type { OntologyProvider } from \"./ontology/OntologyProvider.js\";\n\ndeclare const tag: unique symbol;\n\nexport type ClientCacheKey = {} & { readonly [tag]: void };\n\nexport type RequestContext = {\n finalMethodCall?: string;\n};\n\nexport interface MinimalClient extends SharedClientContext {\n ontologyRid: string | Promise<string>;\n ontologyProvider: OntologyProvider;\n logger?: Logger;\n transactionRid?: string;\n /** @internal */\n objectSetFactory: ObjectSetFactory<any, any>;\n /** @internal */\n objectFactory: typeof convertWireToOsdkObjects;\n /** @internal */\n objectFactory2: typeof convertWireToOsdkObjects2;\n\n clientCacheKey: ClientCacheKey;\n requestContext: RequestContext;\n}\n\nexport type MinimalClientParams = {\n metadata: MinimalClientMetadata;\n provider: OntologyProvider;\n};\n\nexport interface MinimalClientMetadata {\n ontologyRid: string | Promise<string>;\n}\n"],"mappings":"","ignoreList":[]}
@@ -51,9 +51,7 @@ class QueryInvoker {
51
51
  }
52
52
 
53
53
  /** @internal */
54
- export function createClientInternal(objectSetFactory,
55
- // first so i can bind
56
- baseUrl, ontologyRid, tokenProvider, options = undefined, fetchFn = fetch) {
54
+ export function createClientInternal(objectSetFactory, transactionRid, baseUrl, ontologyRid, tokenProvider, options = undefined, fetchFn = fetch) {
57
55
  if (typeof ontologyRid === "string") {
58
56
  if (!ontologyRid.startsWith("ri.")) {
59
57
  throw new Error("Invalid ontology RID");
@@ -71,7 +69,8 @@ baseUrl, ontologyRid, tokenProvider, options = undefined, fetchFn = fetch) {
71
69
  ontologyRid
72
70
  }, baseUrl, tokenProvider, {
73
71
  ...options,
74
- logger: options?.logger ?? new MinimalLogger()
72
+ logger: options?.logger ?? new MinimalLogger(),
73
+ transactionRid: transactionRid
75
74
  }, fetchFn, objectSetFactory);
76
75
  return createClientFromContext(clientCtx);
77
76
  }
@@ -142,7 +141,8 @@ export function createClientFromContext(clientCtx) {
142
141
  });
143
142
  return client;
144
143
  }
145
- export const createClient = createClientInternal.bind(undefined, createObjectSet);
144
+ export const createClient = createClientInternal.bind(undefined, createObjectSet, undefined);
145
+ export const createClientWithTransaction = (transactionRid, ...args) => createClientInternal(createObjectSet, transactionRid, ...args);
146
146
  function createWithRid(rids) {
147
147
  return {
148
148
  type: "static",
@@ -1 +1 @@
1
- {"version":3,"file":"createClient.js","names":["__EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference","__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid","__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid","__EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks","OntologiesV2","symbolClientContext","oldSymbolClientContext","createBulkLinksAsyncIterFactory","applyAction","additionalContext","createMinimalClient","fetchMetadataInternal","MinimalLogger","fetchPage","fetchSingle","createObjectSet","applyQuery","ActionInvoker","constructor","clientCtx","actionDef","bind","undefined","batchApplyAction","QueryInvoker","queryDef","executeFunction","createClientInternal","objectSetFactory","baseUrl","ontologyRid","tokenProvider","options","fetchFn","fetch","startsWith","Error","then","logger","createClientFromContext","fetchMetadata","client","Object","defineProperties","o","type","name","getBulkLinks","fetchOneByRid","objectType","rid","createWithRid","createMediaReference","args","data","fileName","propertyType","MediaReferenceProperties","upload","apiName","mediaItemPath","preview","fetchPageByRid","objectOrInterfaceType","rids","value","createClient"],"sources":["createClient.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ActionDefinition,\n FetchPageArgs,\n InterfaceDefinition,\n Logger,\n NullabilityAdherence,\n ObjectOrInterfaceDefinition,\n ObjectSet,\n ObjectTypeDefinition,\n Osdk,\n PropertyKeys,\n QueryDefinition,\n SelectArg,\n} from \"@osdk/api\";\nimport type {\n Experiment,\n ExperimentFns,\n MinimalObjectSet,\n} from \"@osdk/api/unstable\";\nimport {\n __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference,\n __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid,\n __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid,\n __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks,\n} from \"@osdk/api/unstable\";\nimport type { ObjectSet as WireObjectSet } from \"@osdk/foundry.ontologies\";\nimport * as OntologiesV2 from \"@osdk/foundry.ontologies\";\nimport { symbolClientContext as oldSymbolClientContext } from \"@osdk/shared.client\";\nimport { createBulkLinksAsyncIterFactory } from \"./__unstable/createBulkLinksAsyncIterFactory.js\";\nimport type { ActionSignatureFromDef } from \"./actions/applyAction.js\";\nimport { applyAction } from \"./actions/applyAction.js\";\nimport { additionalContext, type Client } from \"./Client.js\";\nimport { createMinimalClient } from \"./createMinimalClient.js\";\nimport { fetchMetadataInternal } from \"./fetchMetadata.js\";\nimport { MinimalLogger } from \"./logger/MinimalLogger.js\";\nimport type { MinimalClient } from \"./MinimalClientContext.js\";\nimport { fetchPage } from \"./object/fetchPage.js\";\nimport { fetchSingle } from \"./object/fetchSingle.js\";\nimport { createObjectSet } from \"./objectSet/createObjectSet.js\";\nimport type { ObjectSetFactory } from \"./objectSet/ObjectSetFactory.js\";\nimport { applyQuery } from \"./queries/applyQuery.js\";\nimport type { QuerySignatureFromDef } from \"./queries/types.js\";\n\n// We import it this way to keep compatible with CJS. If we referenced the\n// value of `symbolClientContext` directly, then we would have to a dynamic import\n// in `createClientInternal` which would make it async and a break.\n// Since this is just a string in `@osdk/shared.client2` instead of a symbol,\n// we can safely perform this trick.\ntype newSymbolClientContext =\n // eslint-disable-next-line @typescript-eslint/consistent-type-imports\n typeof import(\"@osdk/shared.client2\").symbolClientContext;\n\nclass ActionInvoker<Q extends ActionDefinition<any>>\n implements ActionSignatureFromDef<Q>\n{\n constructor(\n clientCtx: MinimalClient,\n actionDef: ActionDefinition<any>,\n ) {\n // We type the property as a generic function as binding `applyAction`\n // doesn't return a type thats all that useful anyway\n // The implements covers us for the most part here as this exact type doesn't\n // escape this file\n this.applyAction = applyAction.bind(undefined, clientCtx, actionDef);\n this.batchApplyAction = applyAction.bind(undefined, clientCtx, actionDef);\n }\n\n applyAction: (...args: any[]) => any;\n batchApplyAction: (...args: any[]) => any;\n}\n\nclass QueryInvoker<Q extends QueryDefinition<any>>\n implements QuerySignatureFromDef<Q>\n{\n constructor(\n clientCtx: MinimalClient,\n queryDef: QueryDefinition<any>,\n ) {\n this.executeFunction = applyQuery.bind(undefined, clientCtx, queryDef);\n }\n\n executeFunction: (...args: any[]) => any;\n}\n\n/** @internal */\nexport function createClientInternal(\n objectSetFactory: ObjectSetFactory<any, any>, // first so i can bind\n baseUrl: string,\n ontologyRid: string | Promise<string>,\n tokenProvider: () => Promise<string>,\n options: { logger?: Logger } | undefined = undefined,\n fetchFn: typeof globalThis.fetch = fetch,\n): Client {\n if (typeof ontologyRid === \"string\") {\n if (!ontologyRid.startsWith(\"ri.\")) {\n throw new Error(\"Invalid ontology RID\");\n }\n } else {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n ontologyRid.then((ontologyRid) => {\n if (!ontologyRid.startsWith(\"ri.\")) {\n // FIXME this promise is not await so this just shows up as an unhandled promise rejection\n throw new Error(\"Invalid ontology RID\");\n }\n });\n }\n\n const clientCtx: MinimalClient = createMinimalClient(\n { ontologyRid },\n baseUrl,\n tokenProvider,\n { ...options, logger: options?.logger ?? new MinimalLogger() },\n fetchFn,\n objectSetFactory,\n );\n\n return createClientFromContext(clientCtx);\n}\n\n/**\n * @internal\n */\nexport function createClientFromContext(clientCtx: MinimalClient) {\n function clientFn<\n T extends\n | ObjectOrInterfaceDefinition\n | ActionDefinition<any>\n | QueryDefinition<any>\n | Experiment<\"2.0.8\">\n | Experiment<\"2.1.0\">,\n >(o: T): T extends ObjectTypeDefinition ? ObjectSet<T>\n : T extends InterfaceDefinition ? MinimalObjectSet<T>\n : T extends ActionDefinition<any> ? ActionSignatureFromDef<T>\n : T extends QueryDefinition<any> ? QuerySignatureFromDef<T>\n : T extends Experiment<\"2.0.8\"> | Experiment<\"2.1.0\">\n ? { invoke: ExperimentFns<T> }\n : never\n {\n if (o.type === \"object\" || o.type === \"interface\") {\n return clientCtx.objectSetFactory(o, clientCtx) as any;\n } else if (o.type === \"action\") {\n return new ActionInvoker(\n clientCtx,\n o,\n ) as (T extends ActionDefinition<any>\n // first `as` to the action definition for our \"real\" typecheck\n ? ActionSignatureFromDef<T>\n : never) as any; // then as any for dealing with the conditional return value\n } else if (o.type === \"query\") {\n return new QueryInvoker(\n clientCtx,\n o,\n ) as (T extends QueryDefinition<any> ? QuerySignatureFromDef<T>\n : never) as any;\n } else if (o.type === \"experiment\") {\n switch (o.name) {\n case __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks.name:\n return {\n getBulkLinks: createBulkLinksAsyncIterFactory(\n clientCtx,\n ),\n } as any;\n case __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid.name:\n return {\n fetchOneByRid: async <\n Q extends ObjectTypeDefinition,\n const L extends PropertyKeys<Q>,\n const R extends boolean,\n const S extends false | \"throw\" = NullabilityAdherence.Default,\n >(\n objectType: Q,\n rid: string,\n options: SelectArg<Q, L, R, S>,\n ) => {\n return await fetchSingle(\n clientCtx,\n objectType,\n options,\n createWithRid(\n [rid],\n ),\n ) as Osdk<Q>;\n },\n } as any;\n case __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference.name:\n return {\n createMediaReference: async <\n Q extends ObjectTypeDefinition,\n const L extends PropertyKeys.Filtered<Q, \"mediaReference\">,\n >(args: {\n data: Blob;\n fileName: string;\n objectType: Q;\n propertyType: L;\n }) => {\n const { data, fileName, objectType, propertyType } = args;\n return await OntologiesV2.MediaReferenceProperties.upload(\n clientCtx,\n await clientCtx.ontologyRid,\n objectType.apiName,\n propertyType as string,\n data,\n {\n mediaItemPath: fileName,\n preview: true,\n },\n );\n },\n } as any;\n\n case __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid.name:\n return {\n fetchPageByRid: async <\n Q extends ObjectOrInterfaceDefinition,\n const L extends PropertyKeys<Q>,\n const R extends boolean,\n const S extends false | \"throw\" = NullabilityAdherence.Default,\n >(\n objectOrInterfaceType: Q,\n rids: string[],\n options: FetchPageArgs<Q, L, R, any, S> = {},\n ) => {\n return await fetchPage(\n clientCtx,\n objectOrInterfaceType,\n options,\n createWithRid(rids),\n );\n },\n } as any;\n }\n\n throw new Error(\"not implemented\");\n } else {\n throw new Error(\"not implemented\");\n }\n }\n\n const fetchMetadata = fetchMetadataInternal.bind(\n undefined,\n clientCtx,\n );\n\n const symbolClientContext: newSymbolClientContext = \"__osdkClientContext\";\n\n const client: Client = Object.defineProperties<Client>(\n clientFn as Client,\n {\n [oldSymbolClientContext]: {\n value: clientCtx,\n },\n [symbolClientContext]: {\n value: clientCtx,\n },\n [additionalContext]: {\n value: clientCtx,\n },\n fetchMetadata: {\n value: fetchMetadata,\n },\n } satisfies Record<keyof Client, PropertyDescriptor>,\n );\n\n return client;\n}\n\nexport const createClient: (\n baseUrl: string,\n ontologyRid: string | Promise<string>,\n tokenProvider: () => Promise<string>,\n options?: {\n logger?: Logger;\n } | undefined,\n fetchFn?: typeof fetch | undefined,\n) => Client = createClientInternal.bind(\n undefined,\n createObjectSet,\n);\n\nfunction createWithRid(\n rids: string[],\n) {\n const withRid: WireObjectSet = {\n type: \"static\",\n \"objects\": rids,\n };\n\n return withRid;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAqBA,SACEA,uDAAuD,EACvDC,gDAAgD,EAChDC,iDAAiD,EACjDC,+CAA+C,QAC1C,oBAAoB;AAE3B,OAAO,KAAKC,YAAY,MAAM,0BAA0B;AACxD,SAASC,mBAAmB,IAAIC,sBAAsB,QAAQ,qBAAqB;AACnF,SAASC,+BAA+B,QAAQ,iDAAiD;AAEjG,SAASC,WAAW,QAAQ,0BAA0B;AACtD,SAASC,iBAAiB,QAAqB,aAAa;AAC5D,SAASC,mBAAmB,QAAQ,0BAA0B;AAC9D,SAASC,qBAAqB,QAAQ,oBAAoB;AAC1D,SAASC,aAAa,QAAQ,2BAA2B;AAEzD,SAASC,SAAS,QAAQ,uBAAuB;AACjD,SAASC,WAAW,QAAQ,yBAAyB;AACrD,SAASC,eAAe,QAAQ,gCAAgC;AAEhE,SAASC,UAAU,QAAQ,yBAAyB;;AAGpD;AACA;AACA;AACA;AACA;;AAKA,MAAMC,aAAa,CAEnB;EACEC,WAAWA,CACTC,SAAwB,EACxBC,SAAgC,EAChC;IACA;IACA;IACA;IACA;IACA,IAAI,CAACZ,WAAW,GAAGA,WAAW,CAACa,IAAI,CAACC,SAAS,EAAEH,SAAS,EAAEC,SAAS,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EAClBH,YAAY,EACZF,IAAI,EACJ;gBACEM,aAAa,EAAEL,QAAQ;gBACvBM,OAAO,EAAE;cACX,CACF,CAAC;YACH;UACF,CAAC;QAEH,KAAK3D,iDAAiD,CAAC4C,IAAI;UACzD,OAAO;YACLgB,cAAc,EAAE,MAAAA,CAMdC,qBAAwB,EACxBC,IAAc,EACdhC,OAAuC,GAAG,CAAC,CAAC,KACzC;cACH,OAAO,MAAMnB,SAAS,CACpBM,SAAS,EACT4C,qBAAqB,EACrB/B,OAAO,EACPmB,aAAa,CAACa,IAAI,CACpB,CAAC;YACH;UACF,CAAC;MACL;MAEA,MAAM,IAAI5B,KAAK,CAAC,iBAAiB,CAAC;IACpC,CAAC,MAAM;MACL,MAAM,IAAIA,KAAK,CAAC,iBAAiB,CAAC;IACpC;EACF,CAAC,EAWC;IACE,CAAC9B,sBAAsB,GAAG;MACxB2D,KAAK,EAAE9C;IACT,CAAC;IACD,CARgD,qBAAqB,GAQ9C;MACrB8C,KAAK,EAAE9C;IACT,CAAC;IACD,CAACV,iBAAiB,GAAG;MACnBwD,KAAK,EAAE9C;IACT,CAAC;IACDqB,aAAa,EAAE;MACbyB,KAAK,EAAEzB;IACT;EACF,CACF,CAAC;EAED,OAAOC,MAAM;AACf;AAEA,OAAO,MAAMyB,YAQF,GAAGvC,oBAAoB,CAACN,IAAI,CACrCC,SAAS,EACTP,eACF,CAAC;AAED,SAASoC,aAAaA,CACpBa,IAAc,EACd;EAMA,OAL+B;IAC7BnB,IAAI,EAAE,QAAQ;IACd,SAAS,EAAEmB;EACb,CAAC;AAGH","ignoreList":[]}
1
+ {"version":3,"file":"createClient.js","names":["__EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference","__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid","__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid","__EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks","OntologiesV2","symbolClientContext","oldSymbolClientContext","createBulkLinksAsyncIterFactory","applyAction","additionalContext","createMinimalClient","fetchMetadataInternal","MinimalLogger","fetchPage","fetchSingle","createObjectSet","applyQuery","ActionInvoker","constructor","clientCtx","actionDef","bind","undefined","batchApplyAction","QueryInvoker","queryDef","executeFunction","createClientInternal","objectSetFactory","transactionRid","baseUrl","ontologyRid","tokenProvider","options","fetchFn","fetch","startsWith","Error","then","logger","createClientFromContext","fetchMetadata","client","Object","defineProperties","o","type","name","getBulkLinks","fetchOneByRid","objectType","rid","createWithRid","createMediaReference","args","data","fileName","propertyType","MediaReferenceProperties","upload","apiName","mediaItemPath","preview","fetchPageByRid","objectOrInterfaceType","rids","value","createClient","createClientWithTransaction"],"sources":["createClient.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ActionDefinition,\n FetchPageArgs,\n InterfaceDefinition,\n Logger,\n NullabilityAdherence,\n ObjectOrInterfaceDefinition,\n ObjectSet,\n ObjectTypeDefinition,\n Osdk,\n PropertyKeys,\n QueryDefinition,\n SelectArg,\n} from \"@osdk/api\";\nimport type {\n Experiment,\n ExperimentFns,\n MinimalObjectSet,\n} from \"@osdk/api/unstable\";\nimport {\n __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference,\n __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid,\n __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid,\n __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks,\n} from \"@osdk/api/unstable\";\nimport type { ObjectSet as WireObjectSet } from \"@osdk/foundry.ontologies\";\nimport * as OntologiesV2 from \"@osdk/foundry.ontologies\";\nimport { symbolClientContext as oldSymbolClientContext } from \"@osdk/shared.client\";\nimport { createBulkLinksAsyncIterFactory } from \"./__unstable/createBulkLinksAsyncIterFactory.js\";\nimport type { ActionSignatureFromDef } from \"./actions/applyAction.js\";\nimport { applyAction } from \"./actions/applyAction.js\";\nimport { additionalContext, type Client } from \"./Client.js\";\nimport { createMinimalClient } from \"./createMinimalClient.js\";\nimport { fetchMetadataInternal } from \"./fetchMetadata.js\";\nimport { MinimalLogger } from \"./logger/MinimalLogger.js\";\nimport type { MinimalClient } from \"./MinimalClientContext.js\";\nimport { fetchPage } from \"./object/fetchPage.js\";\nimport { fetchSingle } from \"./object/fetchSingle.js\";\nimport { createObjectSet } from \"./objectSet/createObjectSet.js\";\nimport type { ObjectSetFactory } from \"./objectSet/ObjectSetFactory.js\";\nimport { applyQuery } from \"./queries/applyQuery.js\";\nimport type { QuerySignatureFromDef } from \"./queries/types.js\";\n\n// We import it this way to keep compatible with CJS. If we referenced the\n// value of `symbolClientContext` directly, then we would have to a dynamic import\n// in `createClientInternal` which would make it async and a break.\n// Since this is just a string in `@osdk/shared.client2` instead of a symbol,\n// we can safely perform this trick.\ntype newSymbolClientContext =\n // eslint-disable-next-line @typescript-eslint/consistent-type-imports\n typeof import(\"@osdk/shared.client2\").symbolClientContext;\n\nclass ActionInvoker<Q extends ActionDefinition<any>>\n implements ActionSignatureFromDef<Q>\n{\n constructor(\n clientCtx: MinimalClient,\n actionDef: ActionDefinition<any>,\n ) {\n // We type the property as a generic function as binding `applyAction`\n // doesn't return a type thats all that useful anyway\n // The implements covers us for the most part here as this exact type doesn't\n // escape this file\n this.applyAction = applyAction.bind(undefined, clientCtx, actionDef);\n this.batchApplyAction = applyAction.bind(undefined, clientCtx, actionDef);\n }\n\n applyAction: (...args: any[]) => any;\n batchApplyAction: (...args: any[]) => any;\n}\n\nclass QueryInvoker<Q extends QueryDefinition<any>>\n implements QuerySignatureFromDef<Q>\n{\n constructor(\n clientCtx: MinimalClient,\n queryDef: QueryDefinition<any>,\n ) {\n this.executeFunction = applyQuery.bind(undefined, clientCtx, queryDef);\n }\n\n executeFunction: (...args: any[]) => any;\n}\n\n/** @internal */\nexport function createClientInternal(\n objectSetFactory: ObjectSetFactory<any, any>,\n transactionRid: string | undefined,\n baseUrl: string,\n ontologyRid: string | Promise<string>,\n tokenProvider: () => Promise<string>,\n options: { logger?: Logger } | undefined = undefined,\n fetchFn: typeof globalThis.fetch = fetch,\n): Client {\n if (typeof ontologyRid === \"string\") {\n if (!ontologyRid.startsWith(\"ri.\")) {\n throw new Error(\"Invalid ontology RID\");\n }\n } else {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n ontologyRid.then((ontologyRid) => {\n if (!ontologyRid.startsWith(\"ri.\")) {\n // FIXME this promise is not await so this just shows up as an unhandled promise rejection\n throw new Error(\"Invalid ontology RID\");\n }\n });\n }\n\n const clientCtx: MinimalClient = createMinimalClient(\n { ontologyRid },\n baseUrl,\n tokenProvider,\n {\n ...options,\n logger: options?.logger ?? new MinimalLogger(),\n transactionRid: transactionRid,\n },\n fetchFn,\n objectSetFactory,\n );\n\n return createClientFromContext(clientCtx);\n}\n\n/**\n * @internal\n */\nexport function createClientFromContext(clientCtx: MinimalClient) {\n function clientFn<\n T extends\n | ObjectOrInterfaceDefinition\n | ActionDefinition<any>\n | QueryDefinition<any>\n | Experiment<\"2.0.8\">\n | Experiment<\"2.1.0\">,\n >(o: T): T extends ObjectTypeDefinition ? ObjectSet<T>\n : T extends InterfaceDefinition ? MinimalObjectSet<T>\n : T extends ActionDefinition<any> ? ActionSignatureFromDef<T>\n : T extends QueryDefinition<any> ? QuerySignatureFromDef<T>\n : T extends Experiment<\"2.0.8\"> | Experiment<\"2.1.0\">\n ? { invoke: ExperimentFns<T> }\n : never\n {\n if (o.type === \"object\" || o.type === \"interface\") {\n return clientCtx.objectSetFactory(o, clientCtx) as any;\n } else if (o.type === \"action\") {\n return new ActionInvoker(\n clientCtx,\n o,\n ) as (T extends ActionDefinition<any>\n // first `as` to the action definition for our \"real\" typecheck\n ? ActionSignatureFromDef<T>\n : never) as any; // then as any for dealing with the conditional return value\n } else if (o.type === \"query\") {\n return new QueryInvoker(\n clientCtx,\n o,\n ) as (T extends QueryDefinition<any> ? QuerySignatureFromDef<T>\n : never) as any;\n } else if (o.type === \"experiment\") {\n switch (o.name) {\n case __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks.name:\n return {\n getBulkLinks: createBulkLinksAsyncIterFactory(\n clientCtx,\n ),\n } as any;\n case __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid.name:\n return {\n fetchOneByRid: async <\n Q extends ObjectTypeDefinition,\n const L extends PropertyKeys<Q>,\n const R extends boolean,\n const S extends false | \"throw\" = NullabilityAdherence.Default,\n >(\n objectType: Q,\n rid: string,\n options: SelectArg<Q, L, R, S>,\n ) => {\n return await fetchSingle(\n clientCtx,\n objectType,\n options,\n createWithRid(\n [rid],\n ),\n ) as Osdk<Q>;\n },\n } as any;\n case __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference.name:\n return {\n createMediaReference: async <\n Q extends ObjectTypeDefinition,\n const L extends PropertyKeys.Filtered<Q, \"mediaReference\">,\n >(args: {\n data: Blob;\n fileName: string;\n objectType: Q;\n propertyType: L;\n }) => {\n const { data, fileName, objectType, propertyType } = args;\n return await OntologiesV2.MediaReferenceProperties.upload(\n clientCtx,\n await clientCtx.ontologyRid,\n objectType.apiName,\n propertyType as string,\n data,\n {\n mediaItemPath: fileName,\n preview: true,\n },\n );\n },\n } as any;\n\n case __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid.name:\n return {\n fetchPageByRid: async <\n Q extends ObjectOrInterfaceDefinition,\n const L extends PropertyKeys<Q>,\n const R extends boolean,\n const S extends false | \"throw\" = NullabilityAdherence.Default,\n >(\n objectOrInterfaceType: Q,\n rids: string[],\n options: FetchPageArgs<Q, L, R, any, S> = {},\n ) => {\n return await fetchPage(\n clientCtx,\n objectOrInterfaceType,\n options,\n createWithRid(rids),\n );\n },\n } as any;\n }\n\n throw new Error(\"not implemented\");\n } else {\n throw new Error(\"not implemented\");\n }\n }\n\n const fetchMetadata = fetchMetadataInternal.bind(\n undefined,\n clientCtx,\n );\n\n const symbolClientContext: newSymbolClientContext = \"__osdkClientContext\";\n\n const client: Client = Object.defineProperties<Client>(\n clientFn as Client,\n {\n [oldSymbolClientContext]: {\n value: clientCtx,\n },\n [symbolClientContext]: {\n value: clientCtx,\n },\n [additionalContext]: {\n value: clientCtx,\n },\n fetchMetadata: {\n value: fetchMetadata,\n },\n } satisfies Record<keyof Client, PropertyDescriptor>,\n );\n\n return client;\n}\n\nexport const createClient: (\n baseUrl: string,\n ontologyRid: string | Promise<string>,\n tokenProvider: () => Promise<string>,\n options?: {\n logger?: Logger;\n } | undefined,\n fetchFn?: typeof fetch | undefined,\n) => Client = createClientInternal.bind(\n undefined,\n createObjectSet,\n undefined,\n);\n\nexport const createClientWithTransaction: (\n transactionRid: string,\n ...args: Parameters<typeof createClient>\n) => Client = (transactionRid, ...args) =>\n createClientInternal(\n createObjectSet,\n transactionRid,\n ...args,\n ) as Client;\n\nfunction createWithRid(\n rids: string[],\n) {\n const withRid: WireObjectSet = {\n type: \"static\",\n \"objects\": rids,\n };\n\n return withRid;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAqBA,SACEA,uDAAuD,EACvDC,gDAAgD,EAChDC,iDAAiD,EACjDC,+CAA+C,QAC1C,oBAAoB;AAE3B,OAAO,KAAKC,YAAY,MAAM,0BAA0B;AACxD,SAASC,mBAAmB,IAAIC,sBAAsB,QAAQ,qBAAqB;AACnF,SAASC,+BAA+B,QAAQ,iDAAiD;AAEjG,SAASC,WAAW,QAAQ,0BAA0B;AACtD,SAASC,iBAAiB,QAAqB,aAAa;AAC5D,SAASC,mBAAmB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,MAAM;AACf;AAEA,OAAO,MAAMyB,YAQF,GAAGxC,oBAAoB,CAACN,IAAI,CACrCC,SAAS,EACTP,eAAe,EACfO,SACF,CAAC;AAED,OAAO,MAAM8C,2BAGF,GAAGA,CAACvC,cAAc,EAAE,GAAGyB,IAAI,KACpC3B,oBAAoB,CAClBZ,eAAe,EACfc,cAAc,EACd,GAAGyB,IACL,CAAW;AAEb,SAASF,aAAaA,CACpBa,IAAc,EACd;EAMA,OAL+B;IAC7BnB,IAAI,EAAE,QAAQ;IACd,SAAS,EAAEmB;EACb,CAAC;AAGH","ignoreList":[]}
@@ -39,6 +39,7 @@ export function createMinimalClient(metadata, baseUrl, tokenProvider, options =
39
39
  objectFactory2: convertWireToOsdkObjects2,
40
40
  ontologyRid: metadata.ontologyRid,
41
41
  logger: options.logger,
42
+ transactionRid: options.transactionRid,
42
43
  clientCacheKey: {},
43
44
  requestContext: {}
44
45
  };
@@ -1 +1 @@
1
- {"version":3,"file":"createMinimalClient.js","names":["createSharedClientContext","convertWireToOsdkObjects","convertWireToOsdkObjects2","createObjectSet","createStandardOntologyProviderFactory","USER_AGENT","createMinimalClient","metadata","baseUrl","tokenProvider","options","fetchFn","global","fetch","objectSetFactory","createOntologyProviderFactory","process","env","NODE_ENV","URL","e","hint","startsWith","Error","processedBaseUrl","pathname","endsWith","minimalClient","toString","objectFactory","objectFactory2","ontologyRid","logger","clientCacheKey","requestContext","Object","freeze","assign","ontologyProvider"],"sources":["createMinimalClient.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { Logger } from \"@osdk/api\";\nimport { createSharedClientContext } from \"@osdk/shared.client.impl\";\nimport type {\n ClientCacheKey,\n MinimalClient,\n MinimalClientParams,\n} from \"./MinimalClientContext.js\";\nimport {\n convertWireToOsdkObjects,\n convertWireToOsdkObjects2,\n} from \"./object/convertWireToOsdkObjects.js\";\nimport { createObjectSet } from \"./objectSet/createObjectSet.js\";\nimport type { ObjectSetFactory } from \"./objectSet/ObjectSetFactory.js\";\nimport type { OntologyProvider } from \"./ontology/OntologyProvider.js\";\nimport {\n createStandardOntologyProviderFactory,\n type OntologyCachingOptions,\n} from \"./ontology/StandardOntologyProvider.js\";\nimport { USER_AGENT } from \"./util/UserAgent.js\";\n\n/** @internal */\nexport function createMinimalClient(\n metadata: MinimalClientParams[\"metadata\"],\n baseUrl: string,\n tokenProvider: () => Promise<string>,\n options: OntologyCachingOptions & { logger?: Logger } = {},\n fetchFn: (\n input: Request | URL | string,\n init?: RequestInit | undefined,\n ) => Promise<Response> = global.fetch,\n objectSetFactory: ObjectSetFactory<any, any> = createObjectSet,\n createOntologyProviderFactory: (\n a: OntologyCachingOptions & { logger?: Logger },\n ) => (minimalClient: MinimalClient) => OntologyProvider =\n createStandardOntologyProviderFactory,\n) {\n if (process.env.NODE_ENV !== \"production\") {\n try {\n new URL(baseUrl);\n } catch (e) {\n const hint =\n !baseUrl.startsWith(\"http://\") || !baseUrl.startsWith(\"https://\")\n ? \". Did you forget to add 'http://' or 'https://'?\"\n : \"\";\n throw new Error(`Invalid stack URL: ${baseUrl}${hint}`);\n }\n }\n const processedBaseUrl = new URL(baseUrl);\n processedBaseUrl.pathname += processedBaseUrl.pathname.endsWith(\"/\")\n ? \"\"\n : \"/\";\n const minimalClient: MinimalClient = {\n ...createSharedClientContext(\n processedBaseUrl.toString(),\n tokenProvider,\n USER_AGENT,\n fetchFn,\n ),\n objectSetFactory,\n objectFactory: convertWireToOsdkObjects,\n objectFactory2: convertWireToOsdkObjects2,\n ontologyRid: metadata.ontologyRid,\n logger: options.logger,\n clientCacheKey: {} as ClientCacheKey,\n requestContext: {},\n } satisfies Omit<\n MinimalClient,\n \"ontologyProvider\"\n > as any;\n\n return Object.freeze(Object.assign(minimalClient, {\n ontologyProvider: createOntologyProviderFactory(\n options,\n )(minimalClient),\n }));\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,yBAAyB,QAAQ,0BAA0B;AAMpE,SACEC,wBAAwB,EACxBC,yBAAyB,QACpB,sCAAsC;AAC7C,SAASC,eAAe,QAAQ,gCAAgC;AAGhE,SACEC,qCAAqC,QAEhC,wCAAwC;AAC/C,SAASC,UAAU,QAAQ,qBAAqB;;AAEhD;AACA,OAAO,SAASC,mBAAmBA,CACjCC,QAAyC,EACzCC,OAAe,EACfC,aAAoC,EACpCC,OAAqD,GAAG,CAAC,CAAC,EAC1DC,OAGsB,GAAGC,MAAM,CAACC,KAAK,EACrCC,gBAA4C,GAAGX,eAAe,EAC9DY,6BAEuD,GACrDX,qCAAqC,EACvC;EACA,IAAIY,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,EAAE;IACzC,IAAI;MACF,IAAIC,GAAG,CAACX,OAAO,CAAC;IAClB,CAAC,CAAC,OAAOY,CAAC,EAAE;MACV,MAAMC,IAAI,GACR,CAACb,OAAO,CAACc,UAAU,CAAC,SAAS,CAAC,IAAI,CAACd,OAAO,CAACc,UAAU,CAAC,UAAU,CAAC,GAC7D,kDAAkD,GAClD,EAAE;MACR,MAAM,IAAIC,KAAK,CAAC,sBAAsBf,OAAO,GAAGa,IAAI,EAAE,CAAC;IACzD;EACF;EACA,MAAMG,gBAAgB,GAAG,IAAIL,GAAG,CAACX,OAAO,CAAC;EACzCgB,gBAAgB,CAACC,QAAQ,IAAID,gBAAgB,CAACC,QAAQ,CAACC,QAAQ,CAAC,GAAG,CAAC,GAChE,EAAE,GACF,GAAG;EACP,MAAMC,aAA4B,GAAG;IACnC,GAAG3B,yBAAyB,CAC1BwB,gBAAgB,CAACI,QAAQ,CAAC,CAAC,EAC3BnB,aAAa,EACbJ,UAAU,EACVM,OACF,CAAC;IACDG,gBAAgB;IAChBe,aAAa,EAAE5B,wBAAwB;IACvC6B,cAAc,EAAE5B,yBAAyB;IACzC6B,WAAW,EAAExB,QAAQ,CAACwB,WAAW;IACjCC,MAAM,EAAEtB,OAAO,CAACsB,MAAM;IACtBC,cAAc,EAAE,CAAC,CAAmB;IACpCC,cAAc,EAAE,CAAC;EACnB,CAGQ;EAER,OAAOC,MAAM,CAACC,MAAM,CAACD,MAAM,CAACE,MAAM,CAACV,aAAa,EAAE;IAChDW,gBAAgB,EAAEvB,6BAA6B,CAC7CL,OACF,CAAC,CAACiB,aAAa;EACjB,CAAC,CAAC,CAAC;AACL","ignoreList":[]}
1
+ {"version":3,"file":"createMinimalClient.js","names":["createSharedClientContext","convertWireToOsdkObjects","convertWireToOsdkObjects2","createObjectSet","createStandardOntologyProviderFactory","USER_AGENT","createMinimalClient","metadata","baseUrl","tokenProvider","options","fetchFn","global","fetch","objectSetFactory","createOntologyProviderFactory","process","env","NODE_ENV","URL","e","hint","startsWith","Error","processedBaseUrl","pathname","endsWith","minimalClient","toString","objectFactory","objectFactory2","ontologyRid","logger","transactionRid","clientCacheKey","requestContext","Object","freeze","assign","ontologyProvider"],"sources":["createMinimalClient.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { Logger } from \"@osdk/api\";\nimport { createSharedClientContext } from \"@osdk/shared.client.impl\";\nimport type {\n ClientCacheKey,\n MinimalClient,\n MinimalClientParams,\n} from \"./MinimalClientContext.js\";\nimport {\n convertWireToOsdkObjects,\n convertWireToOsdkObjects2,\n} from \"./object/convertWireToOsdkObjects.js\";\nimport { createObjectSet } from \"./objectSet/createObjectSet.js\";\nimport type { ObjectSetFactory } from \"./objectSet/ObjectSetFactory.js\";\nimport type { OntologyProvider } from \"./ontology/OntologyProvider.js\";\nimport {\n createStandardOntologyProviderFactory,\n type OntologyCachingOptions,\n} from \"./ontology/StandardOntologyProvider.js\";\nimport { USER_AGENT } from \"./util/UserAgent.js\";\n\n/** @internal */\nexport function createMinimalClient(\n metadata: MinimalClientParams[\"metadata\"],\n baseUrl: string,\n tokenProvider: () => Promise<string>,\n options: OntologyCachingOptions & {\n logger?: Logger;\n transactionRid?: string;\n } = {},\n fetchFn: (\n input: Request | URL | string,\n init?: RequestInit | undefined,\n ) => Promise<Response> = global.fetch,\n objectSetFactory: ObjectSetFactory<any, any> = createObjectSet,\n createOntologyProviderFactory: (\n a: OntologyCachingOptions & { logger?: Logger },\n ) => (minimalClient: MinimalClient) => OntologyProvider =\n createStandardOntologyProviderFactory,\n) {\n if (process.env.NODE_ENV !== \"production\") {\n try {\n new URL(baseUrl);\n } catch (e) {\n const hint =\n !baseUrl.startsWith(\"http://\") || !baseUrl.startsWith(\"https://\")\n ? \". Did you forget to add 'http://' or 'https://'?\"\n : \"\";\n throw new Error(`Invalid stack URL: ${baseUrl}${hint}`);\n }\n }\n const processedBaseUrl = new URL(baseUrl);\n processedBaseUrl.pathname += processedBaseUrl.pathname.endsWith(\"/\")\n ? \"\"\n : \"/\";\n const minimalClient: MinimalClient = {\n ...createSharedClientContext(\n processedBaseUrl.toString(),\n tokenProvider,\n USER_AGENT,\n fetchFn,\n ),\n objectSetFactory,\n objectFactory: convertWireToOsdkObjects,\n objectFactory2: convertWireToOsdkObjects2,\n ontologyRid: metadata.ontologyRid,\n logger: options.logger,\n transactionRid: options.transactionRid,\n clientCacheKey: {} as ClientCacheKey,\n requestContext: {},\n } satisfies Omit<\n MinimalClient,\n \"ontologyProvider\"\n > as any;\n\n return Object.freeze(Object.assign(minimalClient, {\n ontologyProvider: createOntologyProviderFactory(\n options,\n )(minimalClient),\n }));\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,yBAAyB,QAAQ,0BAA0B;AAMpE,SACEC,wBAAwB,EACxBC,yBAAyB,QACpB,sCAAsC;AAC7C,SAASC,eAAe,QAAQ,gCAAgC;AAGhE,SACEC,qCAAqC,QAEhC,wCAAwC;AAC/C,SAASC,UAAU,QAAQ,qBAAqB;;AAEhD;AACA,OAAO,SAASC,mBAAmBA,CACjCC,QAAyC,EACzCC,OAAe,EACfC,aAAoC,EACpCC,OAGC,GAAG,CAAC,CAAC,EACNC,OAGsB,GAAGC,MAAM,CAACC,KAAK,EACrCC,gBAA4C,GAAGX,eAAe,EAC9DY,6BAEuD,GACrDX,qCAAqC,EACvC;EACA,IAAIY,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,EAAE;IACzC,IAAI;MACF,IAAIC,GAAG,CAACX,OAAO,CAAC;IAClB,CAAC,CAAC,OAAOY,CAAC,EAAE;MACV,MAAMC,IAAI,GACR,CAACb,OAAO,CAACc,UAAU,CAAC,SAAS,CAAC,IAAI,CAACd,OAAO,CAACc,UAAU,CAAC,UAAU,CAAC,GAC7D,kDAAkD,GAClD,EAAE;MACR,MAAM,IAAIC,KAAK,CAAC,sBAAsBf,OAAO,GAAGa,IAAI,EAAE,CAAC;IACzD;EACF;EACA,MAAMG,gBAAgB,GAAG,IAAIL,GAAG,CAACX,OAAO,CAAC;EACzCgB,gBAAgB,CAACC,QAAQ,IAAID,gBAAgB,CAACC,QAAQ,CAACC,QAAQ,CAAC,GAAG,CAAC,GAChE,EAAE,GACF,GAAG;EACP,MAAMC,aAA4B,GAAG;IACnC,GAAG3B,yBAAyB,CAC1BwB,gBAAgB,CAACI,QAAQ,CAAC,CAAC,EAC3BnB,aAAa,EACbJ,UAAU,EACVM,OACF,CAAC;IACDG,gBAAgB;IAChBe,aAAa,EAAE5B,wBAAwB;IACvC6B,cAAc,EAAE5B,yBAAyB;IACzC6B,WAAW,EAAExB,QAAQ,CAACwB,WAAW;IACjCC,MAAM,EAAEtB,OAAO,CAACsB,MAAM;IACtBC,cAAc,EAAEvB,OAAO,CAACuB,cAAc;IACtCC,cAAc,EAAE,CAAC,CAAmB;IACpCC,cAAc,EAAE,CAAC;EACnB,CAGQ;EAER,OAAOC,MAAM,CAACC,MAAM,CAACD,MAAM,CAACE,MAAM,CAACX,aAAa,EAAE;IAChDY,gBAAgB,EAAExB,6BAA6B,CAC7CL,OACF,CAAC,CAACiB,aAAa;EACjB,CAAC,CAAC,CAAC;AACL","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["isOk","PalantirApiError","ActionValidationError","createClient","createPlatformClient","createAttachmentUpload","extractDate","extractDateInLocalTime","extractDateInUTC"],"sources":["index.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport type {\n ActionDefinition,\n ActionEditResponse,\n ActionMetadata,\n ActionParam,\n ActionReturnTypeForOptions,\n ActionValidationResponse,\n ApplyActionOptions,\n ApplyBatchActionOptions,\n Attachment,\n CompileTimeMetadata,\n InterfaceDefinition,\n Logger,\n ObjectMetadata,\n ObjectSet,\n ObjectSpecifier,\n ObjectTypeDefinition,\n Osdk,\n OsdkObject,\n OsdkObjectPropertyType,\n PageResult,\n PropertyDef,\n PropertyKeys,\n PropertyValueWireToClient,\n QueryDefinition,\n QueryParam,\n QueryResult,\n Range,\n Result,\n SingleLinkAccessor,\n ThreeDimensionalAggregation,\n TwoDimensionalAggregation,\n VersionBound,\n WhereClause,\n} from \"@osdk/api\";\nexport { isOk } from \"@osdk/api\";\nexport { PalantirApiError } from \"@osdk/shared.net.errors\";\n\nexport { ActionValidationError } from \"./actions/ActionValidationError.js\";\nexport type { Client } from \"./Client.js\";\nexport { createClient } from \"./createClient.js\";\nexport { createPlatformClient } from \"./createPlatformClient.js\";\nexport type { PlatformClient } from \"./createPlatformClient.js\";\nexport { createAttachmentUpload } from \"./object/AttachmentUpload.js\";\nexport type { ResultOrError } from \"./ResultOrError.js\";\n\nexport {\n extractDate,\n extractDateInLocalTime,\n extractDateInUTC,\n} from \"./util/datetimeConverters.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAqCA,SAASA,IAAI,QAAQ,WAAW;AAChC,SAASC,gBAAgB,QAAQ,yBAAyB;AAE1D,SAASC,qBAAqB,QAAQ,oCAAoC;AAE1E,SAASC,YAAY,QAAQ,mBAAmB;AAChD,SAASC,oBAAoB,QAAQ,2BAA2B;AAEhE,SAASC,sBAAsB,QAAQ,8BAA8B;AAGrE,SACEC,WAAW,EACXC,sBAAsB,EACtBC,gBAAgB,QACX,8BAA8B","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["isOk","PalantirApiError","ActionValidationError","createClient","createPlatformClient","createAttachmentUpload","extractDate","extractDateInLocalTime","extractDateInUTC"],"sources":["index.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport type {\n ActionDefinition,\n ActionEditResponse,\n ActionMetadata,\n ActionParam,\n ActionReturnTypeForOptions,\n ActionValidationResponse,\n ApplyActionOptions,\n ApplyBatchActionOptions,\n Attachment,\n CompileTimeMetadata,\n InterfaceDefinition,\n Logger,\n ObjectMetadata,\n ObjectSet,\n ObjectSpecifier,\n ObjectTypeDefinition,\n Osdk,\n OsdkObject,\n OsdkObjectCreatePropertyType,\n OsdkObjectPropertyType,\n PageResult,\n PropertyDef,\n PropertyKeys,\n PropertyValueWireToClient,\n QueryDefinition,\n QueryParam,\n QueryResult,\n Range,\n Result,\n SingleLinkAccessor,\n ThreeDimensionalAggregation,\n TwoDimensionalAggregation,\n VersionBound,\n WhereClause,\n} from \"@osdk/api\";\nexport { isOk } from \"@osdk/api\";\nexport { PalantirApiError } from \"@osdk/shared.net.errors\";\n\nexport { ActionValidationError } from \"./actions/ActionValidationError.js\";\nexport type { Client } from \"./Client.js\";\nexport { createClient } from \"./createClient.js\";\nexport { createPlatformClient } from \"./createPlatformClient.js\";\nexport type { PlatformClient } from \"./createPlatformClient.js\";\nexport { createAttachmentUpload } from \"./object/AttachmentUpload.js\";\nexport type { ResultOrError } from \"./ResultOrError.js\";\n\nexport {\n extractDate,\n extractDateInLocalTime,\n extractDateInUTC,\n} from \"./util/datetimeConverters.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAsCA,SAASA,IAAI,QAAQ,WAAW;AAChC,SAASC,gBAAgB,QAAQ,yBAAyB;AAE1D,SAASC,qBAAqB,QAAQ,oCAAoC;AAE1E,SAASC,YAAY,QAAQ,mBAAmB;AAChD,SAASC,oBAAoB,QAAQ,2BAA2B;AAEhE,SAASC,sBAAsB,QAAQ,8BAA8B;AAGrE,SACEC,WAAW,EACXC,sBAAsB,EACtBC,gBAAgB,QACX,8BAA8B","ignoreList":[]}
@@ -20,4 +20,5 @@ export { augment } from "../object/fetchPage.js";
20
20
 
21
21
  export { createObservableClient } from "../observable/ObservableClient.js";
22
22
  export { getMetaTagContent, getOsdkConfig } from "../public-utils/osdkConfig.js";
23
+ export { createClientWithTransaction } from "../createClient.js";
23
24
  //# sourceMappingURL=unstable-do-not-use.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"unstable-do-not-use.js","names":["augment","createObservableClient","getMetaTagContent","getOsdkConfig"],"sources":["unstable-do-not-use.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { augment } from \"../object/fetchPage.js\";\n\n// THIS IS NOT THE FINAL NAME DO NOT SHIP LIKE THIS\nexport type { ActionSignatureFromDef } from \"../actions/applyAction.js\";\nexport { createObservableClient } from \"../observable/ObservableClient.js\";\nexport type {\n ObservableClient,\n ObserveObjectArgs,\n ObserveObjectsArgs,\n Observer,\n Unsubscribable,\n} from \"../observable/ObservableClient.js\";\nexport type { OsdkConfig } from \"../public-utils/osdkConfig.js\";\nexport {\n getMetaTagContent,\n getOsdkConfig,\n} from \"../public-utils/osdkConfig.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,OAAO,QAAQ,wBAAwB;;AAEhD;;AAEA,SAASC,sBAAsB,QAAQ,mCAAmC;AAS1E,SACEC,iBAAiB,EACjBC,aAAa,QACR,+BAA+B","ignoreList":[]}
1
+ {"version":3,"file":"unstable-do-not-use.js","names":["augment","createObservableClient","getMetaTagContent","getOsdkConfig","createClientWithTransaction"],"sources":["unstable-do-not-use.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { augment } from \"../object/fetchPage.js\";\n\n// THIS IS NOT THE FINAL NAME DO NOT SHIP LIKE THIS\nexport type { ActionSignatureFromDef } from \"../actions/applyAction.js\";\nexport { createObservableClient } from \"../observable/ObservableClient.js\";\nexport type {\n ObservableClient,\n ObserveObjectArgs,\n ObserveObjectsArgs,\n Observer,\n Unsubscribable,\n} from \"../observable/ObservableClient.js\";\nexport type { OsdkConfig } from \"../public-utils/osdkConfig.js\";\nexport {\n getMetaTagContent,\n getOsdkConfig,\n} from \"../public-utils/osdkConfig.js\";\n\nexport { createClientWithTransaction } from \"../createClient.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,OAAO,QAAQ,wBAAwB;;AAEhD;;AAEA,SAASC,sBAAsB,QAAQ,mCAAmC;AAS1E,SACEC,iBAAiB,EACjBC,aAAa,QACR,+BAA+B;AAEtC,SAASC,2BAA2B,QAAQ,oBAAoB","ignoreList":[]}
@@ -14,6 +14,6 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- export const USER_AGENT = `osdk-client/${"2.3.0-rc.11"}`;
18
- export const OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.3.0-rc.11"}`;
17
+ export const USER_AGENT = `osdk-client/${"2.3.1"}`;
18
+ export const OBSERVABLE_USER_AGENT = `osdk-observable-client/${"2.3.1"}`;
19
19
  //# sourceMappingURL=UserAgent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"UserAgent.js","names":["USER_AGENT","OBSERVABLE_USER_AGENT"],"sources":["UserAgent.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const USER_AGENT: string = `osdk-client/${process.env.PACKAGE_VERSION}`;\nexport const OBSERVABLE_USER_AGENT: string =\n `osdk-observable-client/${process.env.PACKAGE_VERSION}`;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMA,UAAkB,GAAG,8BAA4C;AAC9E,OAAO,MAAMC,qBAA6B,GACxC,yCAAuD","ignoreList":[]}
1
+ {"version":3,"file":"UserAgent.js","names":["USER_AGENT","OBSERVABLE_USER_AGENT"],"sources":["UserAgent.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const USER_AGENT: string = `osdk-client/${process.env.PACKAGE_VERSION}`;\nexport const OBSERVABLE_USER_AGENT: string =\n `osdk-observable-client/${process.env.PACKAGE_VERSION}`;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMA,UAAkB,GAAG,wBAA4C;AAC9E,OAAO,MAAMC,qBAA6B,GACxC,mCAAuD","ignoreList":[]}
@@ -16,7 +16,7 @@ export interface Client extends SharedClient, OldSharedClient {
16
16
  <Q extends Experiment<"2.0.8"> | Experiment<"2.1.0"> | Experiment<"2.2.0">>(experiment: Q): ExperimentFns<Q>;
17
17
  fetchMetadata<Q extends (ObjectTypeDefinition | InterfaceDefinition | ActionDefinition<any> | QueryDefinition<any>)>(o: Q): Promise<Q extends ObjectTypeDefinition ? ObjectMetadata : Q extends InterfaceDefinition ? InterfaceMetadata : Q extends ActionDefinition<any> ? ActionMetadata : Q extends QueryDefinition<any> ? QueryMetadata : never>;
18
18
  }
19
- declare const MaxOsdkVersion = "2.3.0";
19
+ declare const MaxOsdkVersion = "2.3.1";
20
20
  export type MaxOsdkVersion = typeof MaxOsdkVersion;
21
21
  declare const ErrorMessage: unique symbol;
22
22
  export {};
@@ -12,6 +12,7 @@ export interface MinimalClient extends SharedClientContext {
12
12
  ontologyRid: string | Promise<string>;
13
13
  ontologyProvider: OntologyProvider;
14
14
  logger?: Logger;
15
+ transactionRid?: string;
15
16
  clientCacheKey: ClientCacheKey;
16
17
  requestContext: RequestContext;
17
18
  }
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cAAc,cAAc,WAAY;AACxC,cAAc,2BAA2B,sBAAuB;AAMhE,cAAc,wBAAwB,gCAAiC;AAEvE,cAAcA;AAEd,YAAY,iBAAiB,CAAE,IAAG;WAAY;AAAY;AAE1D,YAAY,iBAAiB;CAC3B;AACD;AAED,iBAAiB,sBAAsB,oBAAoB;CACzD,sBAAsB;CACtB,kBAAkB;CAClB,SAAS;CAQT,gBAAgB;CAChB,gBAAgB;AACjB;AAED,YAAY,sBAAsB;CAChC,UAAU;CACV,UAAU;AACX;AAED,iBAAiB,sBAAsB;CACrC,sBAAsB;AACvB","names":["tag: unique symbol"],"sources":["../../src/MinimalClientContext.ts"],"version":3,"file":"MinimalClientContext.d.ts"}
1
+ {"mappings":"AAgBA,cAAc,cAAc,WAAY;AACxC,cAAc,2BAA2B,sBAAuB;AAMhE,cAAc,wBAAwB,gCAAiC;AAEvE,cAAcA;AAEd,YAAY,iBAAiB,CAAE,IAAG;WAAY;AAAY;AAE1D,YAAY,iBAAiB;CAC3B;AACD;AAED,iBAAiB,sBAAsB,oBAAoB;CACzD,sBAAsB;CACtB,kBAAkB;CAClB,SAAS;CACT;CAQA,gBAAgB;CAChB,gBAAgB;AACjB;AAED,YAAY,sBAAsB;CAChC,UAAU;CACV,UAAU;AACX;AAED,iBAAiB,sBAAsB;CACrC,sBAAsB;AACvB","names":["tag: unique symbol"],"sources":["../../src/MinimalClientContext.ts"],"version":3,"file":"MinimalClientContext.d.ts"}
@@ -3,3 +3,4 @@ import { type Client } from "./Client.js";
3
3
  export declare const createClient: (baseUrl: string, ontologyRid: string | Promise<string>, tokenProvider: () => Promise<string>, options?: {
4
4
  logger?: Logger
5
5
  } | undefined, fetchFn?: typeof fetch | undefined) => Client;
6
+ export declare const createClientWithTransaction: (transactionRid: string, ...args: Parameters<typeof createClient>) => Client;
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cAIE,cASK,WAAY;AAkBnB,cAAiC,cAAc,aAAc;AA2O7D,OAAO,cAAMA,eACXC,iBACAC,sBAAsB,iBACtBC,qBAAqB,iBACrBC,UAAU;CACR,SAAS;AACV,eACDC,iBAAiB,sBACd","names":["createClient: (\n baseUrl: string,\n ontologyRid: string | Promise<string>,\n tokenProvider: () => Promise<string>,\n options?: {\n logger?: Logger;\n } | undefined,\n fetchFn?: typeof fetch | undefined,\n) => Client","baseUrl: string","ontologyRid: string | Promise<string>","tokenProvider: () => Promise<string>","options?: {\n logger?: Logger;\n } | undefined","fetchFn?: typeof fetch | undefined"],"sources":["../../src/createClient.ts"],"version":3,"file":"createClient.d.ts"}
1
+ {"mappings":"AAgBA,cAIE,cASK,WAAY;AAkBnB,cAAiC,cAAc,aAAc;AAgP7D,OAAO,cAAMA,eACXC,iBACAC,sBAAsB,iBACtBC,qBAAqB,iBACrBC,UAAU;CACR,SAAS;AACV,eACDC,iBAAiB,sBACd;AAML,OAAO,cAAMC,8BACXC,wBACA,GAAG,MAAM,kBAAkB,kBACxB","names":["createClient: (\n baseUrl: string,\n ontologyRid: string | Promise<string>,\n tokenProvider: () => Promise<string>,\n options?: {\n logger?: Logger;\n } | undefined,\n fetchFn?: typeof fetch | undefined,\n) => Client","baseUrl: string","ontologyRid: string | Promise<string>","tokenProvider: () => Promise<string>","options?: {\n logger?: Logger;\n } | undefined","fetchFn?: typeof fetch | undefined","createClientWithTransaction: (\n transactionRid: string,\n ...args: Parameters<typeof createClient>\n) => Client","transactionRid: string"],"sources":["../../src/createClient.ts"],"version":3,"file":"createClient.d.ts"}
@@ -1,4 +1,4 @@
1
- export type { ActionDefinition, ActionEditResponse, ActionMetadata, ActionParam, ActionReturnTypeForOptions, ActionValidationResponse, ApplyActionOptions, ApplyBatchActionOptions, Attachment, CompileTimeMetadata, InterfaceDefinition, Logger, ObjectMetadata, ObjectSet, ObjectSpecifier, ObjectTypeDefinition, Osdk, OsdkObject, OsdkObjectPropertyType, PageResult, PropertyDef, PropertyKeys, PropertyValueWireToClient, QueryDefinition, QueryParam, QueryResult, Range, Result, SingleLinkAccessor, ThreeDimensionalAggregation, TwoDimensionalAggregation, VersionBound, WhereClause } from "@osdk/api";
1
+ export type { ActionDefinition, ActionEditResponse, ActionMetadata, ActionParam, ActionReturnTypeForOptions, ActionValidationResponse, ApplyActionOptions, ApplyBatchActionOptions, Attachment, CompileTimeMetadata, InterfaceDefinition, Logger, ObjectMetadata, ObjectSet, ObjectSpecifier, ObjectTypeDefinition, Osdk, OsdkObject, OsdkObjectCreatePropertyType, OsdkObjectPropertyType, PageResult, PropertyDef, PropertyKeys, PropertyValueWireToClient, QueryDefinition, QueryParam, QueryResult, Range, Result, SingleLinkAccessor, ThreeDimensionalAggregation, TwoDimensionalAggregation, VersionBound, WhereClause } from "@osdk/api";
2
2
  export { isOk } from "@osdk/api";
3
3
  export { PalantirApiError } from "@osdk/shared.net.errors";
4
4
  export { ActionValidationError } from "./actions/ActionValidationError.js";
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cACE,kBACA,oBACA,gBACA,aACA,4BACA,0BACA,oBACA,yBACA,YACA,qBACA,qBACA,QACA,gBACA,WACA,iBACA,sBACA,MACA,YACA,wBACA,YACA,aACA,cACA,2BACA,iBACA,YACA,aACA,OACA,QACA,oBACA,6BACA,2BACA,cACA,mBACK;AACP,SAAS,YAAY;AACrB,SAAS,wBAAwB;AAEjC,SAAS,6BAA6B;AACtC,cAAc,cAAc;AAC5B,SAAS,oBAAoB;AAC7B,SAAS,4BAA4B;AACrC,cAAc,sBAAsB;AACpC,SAAS,8BAA8B;AACvC,cAAc,qBAAqB;AAEnC,SACE,aACA,wBACA,wBACK","names":[],"sources":["../../src/index.ts"],"version":3,"file":"index.d.ts"}
1
+ {"mappings":"AAgBA,cACE,kBACA,oBACA,gBACA,aACA,4BACA,0BACA,oBACA,yBACA,YACA,qBACA,qBACA,QACA,gBACA,WACA,iBACA,sBACA,MACA,YACA,8BACA,wBACA,YACA,aACA,cACA,2BACA,iBACA,YACA,aACA,OACA,QACA,oBACA,6BACA,2BACA,cACA,mBACK;AACP,SAAS,YAAY;AACrB,SAAS,wBAAwB;AAEjC,SAAS,6BAA6B;AACtC,cAAc,cAAc;AAC5B,SAAS,oBAAoB;AAC7B,SAAS,4BAA4B;AACrC,cAAc,sBAAsB;AACpC,SAAS,8BAA8B;AACvC,cAAc,qBAAqB;AAEnC,SACE,aACA,wBACA,wBACK","names":[],"sources":["../../src/index.ts"],"version":3,"file":"index.d.ts"}
@@ -4,3 +4,4 @@ export { createObservableClient } from "../observable/ObservableClient.js";
4
4
  export type { ObservableClient, ObserveObjectArgs, ObserveObjectsArgs, Observer, Unsubscribable } from "../observable/ObservableClient.js";
5
5
  export type { OsdkConfig } from "../public-utils/osdkConfig.js";
6
6
  export { getMetaTagContent, getOsdkConfig } from "../public-utils/osdkConfig.js";
7
+ export { createClientWithTransaction } from "../createClient.js";
@@ -1 +1 @@
1
- {"mappings":"AAgBA,SAAS,eAAe;AAGxB,cAAc,8BAA8B;AAC5C,SAAS,8BAA8B;AACvC,cACE,kBACA,mBACA,oBACA,UACA,sBACK;AACP,cAAc,kBAAkB;AAChC,SACE,mBACA,qBACK","names":[],"sources":["../../../src/public/unstable-do-not-use.ts"],"version":3,"file":"unstable-do-not-use.d.ts"}
1
+ {"mappings":"AAgBA,SAAS,eAAe;AAGxB,cAAc,8BAA8B;AAC5C,SAAS,8BAA8B;AACvC,cACE,kBACA,mBACA,oBACA,UACA,sBACK;AACP,cAAc,kBAAkB;AAChC,SACE,mBACA,qBACK;AAEP,SAAS,mCAAmC","names":[],"sources":["../../../src/public/unstable-do-not-use.ts"],"version":3,"file":"unstable-do-not-use.d.ts"}