@osdk/client 2.2.0-beta.19 → 2.2.0-beta.20
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.
- package/CHANGELOG.md +13 -0
- package/build/browser/util/UserAgent.js +1 -1
- package/build/cjs/{Client-C6Gohd1t.d.cts → Client-CgL2LKN9.d.cts} +1 -1
- package/build/cjs/chunk-33GHS3X4.cjs +35 -37
- package/build/cjs/chunk-33GHS3X4.cjs.map +1 -1
- package/build/cjs/chunk-37QC7LR3.cjs +12 -12
- package/build/cjs/chunk-37QC7LR3.cjs.map +1 -1
- package/build/cjs/index.cjs +47 -47
- package/build/cjs/index.cjs.map +1 -1
- package/build/cjs/index.d.cts +1 -1
- package/build/cjs/public/internal.d.cts +1 -1
- package/build/cjs/public/unstable-do-not-use.cjs +35 -35
- package/build/cjs/public/unstable-do-not-use.cjs.map +1 -1
- package/build/cjs/public/unstable-do-not-use.d.cts +2 -2
- package/build/esm/util/UserAgent.js +1 -1
- package/build/types/index.d.ts +4 -4
- package/build/types/index.d.ts.map +1 -1
- package/build/types/public/unstable-do-not-use.d.ts +3 -3
- package/build/types/public/unstable-do-not-use.d.ts.map +1 -1
- package/package.json +8 -8
package/build/cjs/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ActionValidationResponse, Logger, AttachmentUpload, ObjectTypeDefinition, PrimaryKeyType, ObjectSpecifier } from '@osdk/api';
|
|
2
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';
|
|
3
3
|
export { PalantirApiError } from '@osdk/shared.net.errors';
|
|
4
|
-
import { C as Client } from './Client-
|
|
4
|
+
import { C as Client } from './Client-CgL2LKN9.cjs';
|
|
5
5
|
import { SharedClientContext } from '@osdk/shared.client2';
|
|
6
6
|
import '@osdk/shared.client';
|
|
7
7
|
import '@osdk/api/unstable';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ObjectOrInterfaceDefinition, CompileTimeMetadata, ObjectSet, Attachment, Logger } from '@osdk/api';
|
|
2
|
-
import { C as Client } from '../Client-
|
|
2
|
+
import { C as Client } from '../Client-CgL2LKN9.cjs';
|
|
3
3
|
import '@osdk/shared.client';
|
|
4
4
|
import '@osdk/api/unstable';
|
|
5
5
|
import '@osdk/shared.client2';
|
|
@@ -147,7 +147,7 @@ function multimapHelper(multimap) {
|
|
|
147
147
|
// src/observable/internal/OptimisticId.ts
|
|
148
148
|
function createOptimisticId() {
|
|
149
149
|
if (process.env.NODE_ENV !== "production") {
|
|
150
|
-
if (createOptimisticId.counter ===
|
|
150
|
+
if (createOptimisticId.counter === void 0) {
|
|
151
151
|
createOptimisticId.counter = 0;
|
|
152
152
|
}
|
|
153
153
|
return {
|
|
@@ -196,7 +196,7 @@ var OptimisticJob = class {
|
|
|
196
196
|
$apiName: type.apiName,
|
|
197
197
|
$objectType: type.apiName,
|
|
198
198
|
...properties
|
|
199
|
-
}],
|
|
199
|
+
}], void 0, {}).then((objs) => {
|
|
200
200
|
return objs[0];
|
|
201
201
|
});
|
|
202
202
|
addedObjectPromises.push(create);
|
|
@@ -216,7 +216,7 @@ function runOptimisticJob(store, optimisticUpdate) {
|
|
|
216
216
|
return () => {
|
|
217
217
|
return optimisticApplicationDone.then(
|
|
218
218
|
// we don't want to leak the result
|
|
219
|
-
() =>
|
|
219
|
+
() => void 0
|
|
220
220
|
).finally(() => {
|
|
221
221
|
store.removeLayer(optimisticId);
|
|
222
222
|
});
|
|
@@ -321,7 +321,7 @@ var CacheKeys = class {
|
|
|
321
321
|
}
|
|
322
322
|
get(type, ...args) {
|
|
323
323
|
const factory = this.#cacheKeyFactories.get(type);
|
|
324
|
-
!factory ? process.env.NODE_ENV !== "production" ? invariant2__default.default(false, `no cache key factory for type "${type}"`) : invariant2__default.default(false) :
|
|
324
|
+
!factory ? process.env.NODE_ENV !== "production" ? invariant2__default.default(false, `no cache key factory for type "${type}"`) : invariant2__default.default(false) : void 0;
|
|
325
325
|
return factory(...args);
|
|
326
326
|
}
|
|
327
327
|
remove(cacheKey) {
|
|
@@ -353,7 +353,7 @@ var WeakMapWithEntries = class {
|
|
|
353
353
|
}, 1e3);
|
|
354
354
|
}
|
|
355
355
|
#clean() {
|
|
356
|
-
this.#list = this.#list.filter((ref) => ref.deref() !==
|
|
356
|
+
this.#list = this.#list.filter((ref) => ref.deref() !== void 0);
|
|
357
357
|
}
|
|
358
358
|
// functions for WeakMap
|
|
359
359
|
delete(key) {
|
|
@@ -393,7 +393,7 @@ var WeakMapWithEntries = class {
|
|
|
393
393
|
function* iter() {
|
|
394
394
|
for (const ref of self.#list) {
|
|
395
395
|
const key = ref.deref();
|
|
396
|
-
if (key !==
|
|
396
|
+
if (key !== void 0) {
|
|
397
397
|
yield [key, self.#map.get(key)];
|
|
398
398
|
}
|
|
399
399
|
}
|
|
@@ -408,7 +408,7 @@ var WeakMapWithEntries = class {
|
|
|
408
408
|
function* iter() {
|
|
409
409
|
for (const ref of self.#list) {
|
|
410
410
|
const key = ref.deref();
|
|
411
|
-
if (key !==
|
|
411
|
+
if (key !== void 0) {
|
|
412
412
|
yield key;
|
|
413
413
|
}
|
|
414
414
|
}
|
|
@@ -423,9 +423,9 @@ var WeakMapWithEntries = class {
|
|
|
423
423
|
function* iter() {
|
|
424
424
|
for (const ref of self.#list) {
|
|
425
425
|
const key = ref.deref();
|
|
426
|
-
if (key !==
|
|
426
|
+
if (key !== void 0) {
|
|
427
427
|
const value = self.#map.get(key);
|
|
428
|
-
if (value !==
|
|
428
|
+
if (value !== void 0) {
|
|
429
429
|
yield value;
|
|
430
430
|
}
|
|
431
431
|
}
|
|
@@ -487,8 +487,8 @@ var Entry = class {
|
|
|
487
487
|
function is$and(whereClause) {
|
|
488
488
|
if (process.env.NODE_ENV !== "production") {
|
|
489
489
|
if ("$and" in whereClause) {
|
|
490
|
-
!Array.isArray(whereClause.$and) ? process.env.NODE_ENV !== "production" ? invariant2__default.default(false, "expected $and to be an array") : invariant2__default.default(false) :
|
|
491
|
-
!(Object.keys(whereClause).length === 1) ? process.env.NODE_ENV !== "production" ? invariant2__default.default(false, "expected only $and to be present") : invariant2__default.default(false) :
|
|
490
|
+
!Array.isArray(whereClause.$and) ? process.env.NODE_ENV !== "production" ? invariant2__default.default(false, "expected $and to be an array") : invariant2__default.default(false) : void 0;
|
|
491
|
+
!(Object.keys(whereClause).length === 1) ? process.env.NODE_ENV !== "production" ? invariant2__default.default(false, "expected only $and to be present") : invariant2__default.default(false) : void 0;
|
|
492
492
|
}
|
|
493
493
|
}
|
|
494
494
|
return "$and" in whereClause;
|
|
@@ -496,8 +496,8 @@ function is$and(whereClause) {
|
|
|
496
496
|
function is$or(whereClause) {
|
|
497
497
|
if (process.env.NODE_ENV !== "production") {
|
|
498
498
|
if ("$or" in whereClause) {
|
|
499
|
-
!Array.isArray(whereClause.$or) ? process.env.NODE_ENV !== "production" ? invariant2__default.default(false, "expected $or to be an array") : invariant2__default.default(false) :
|
|
500
|
-
!(Object.keys(whereClause).length === 1) ? process.env.NODE_ENV !== "production" ? invariant2__default.default(false, "expected only $or to be present") : invariant2__default.default(false) :
|
|
499
|
+
!Array.isArray(whereClause.$or) ? process.env.NODE_ENV !== "production" ? invariant2__default.default(false, "expected $or to be an array") : invariant2__default.default(false) : void 0;
|
|
500
|
+
!(Object.keys(whereClause).length === 1) ? process.env.NODE_ENV !== "production" ? invariant2__default.default(false, "expected only $or to be present") : invariant2__default.default(false) : void 0;
|
|
501
501
|
}
|
|
502
502
|
}
|
|
503
503
|
return "$or" in whereClause;
|
|
@@ -505,7 +505,7 @@ function is$or(whereClause) {
|
|
|
505
505
|
function is$not(whereClause) {
|
|
506
506
|
if (process.env.NODE_ENV !== "production") {
|
|
507
507
|
if ("$not" in whereClause) {
|
|
508
|
-
!(Object.keys(whereClause).length === 1) ? process.env.NODE_ENV !== "production" ? invariant2__default.default(false, "expected only $not to be present") : invariant2__default.default(false) :
|
|
508
|
+
!(Object.keys(whereClause).length === 1) ? process.env.NODE_ENV !== "production" ? invariant2__default.default(false, "expected only $not to be present") : invariant2__default.default(false) : void 0;
|
|
509
509
|
}
|
|
510
510
|
}
|
|
511
511
|
return "$not" in whereClause;
|
|
@@ -589,7 +589,7 @@ var BulkObjectLoader = class {
|
|
|
589
589
|
#client;
|
|
590
590
|
#m = new mnemonist.DefaultMap(() => ({
|
|
591
591
|
data: [],
|
|
592
|
-
timer:
|
|
592
|
+
timer: void 0
|
|
593
593
|
}));
|
|
594
594
|
#logger;
|
|
595
595
|
#maxWait;
|
|
@@ -716,7 +716,7 @@ var Query = class {
|
|
|
716
716
|
}
|
|
717
717
|
this.pendingFetch = this._fetchAndStore().finally(() => {
|
|
718
718
|
logger?.info("finally _fetchAndStore()");
|
|
719
|
-
this.pendingFetch =
|
|
719
|
+
this.pendingFetch = void 0;
|
|
720
720
|
});
|
|
721
721
|
await this.pendingFetch;
|
|
722
722
|
return;
|
|
@@ -775,7 +775,7 @@ var ObjectQuery = class extends Query {
|
|
|
775
775
|
constructor(store, subject, type, pk, cacheKey, opts) {
|
|
776
776
|
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunk37QC7LR3_cjs.additionalContext].logger?.child({}, {
|
|
777
777
|
msgPrefix: `ObjectQuery<${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>`
|
|
778
|
-
}) :
|
|
778
|
+
}) : void 0);
|
|
779
779
|
this.#apiName = type;
|
|
780
780
|
this.#pk = pk;
|
|
781
781
|
}
|
|
@@ -790,7 +790,7 @@ var ObjectQuery = class extends Query {
|
|
|
790
790
|
})), {
|
|
791
791
|
connector: () => new rxjs.BehaviorSubject({
|
|
792
792
|
status: "init",
|
|
793
|
-
object:
|
|
793
|
+
object: void 0,
|
|
794
794
|
lastUpdated: 0,
|
|
795
795
|
isOptimistic: false
|
|
796
796
|
})
|
|
@@ -936,7 +936,7 @@ var ListQuery = class extends BaseListQuery {
|
|
|
936
936
|
constructor(store, subject, apiType, apiName, whereClause, orderBy, cacheKey, opts) {
|
|
937
937
|
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunk37QC7LR3_cjs.additionalContext].logger?.child({}, {
|
|
938
938
|
msgPrefix: `ListQuery<${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>`
|
|
939
|
-
}) :
|
|
939
|
+
}) : void 0);
|
|
940
940
|
this.#type = apiType;
|
|
941
941
|
this.#apiName = apiName;
|
|
942
942
|
this.#whereClause = whereClause;
|
|
@@ -970,7 +970,7 @@ var ListQuery = class extends BaseListQuery {
|
|
|
970
970
|
});
|
|
971
971
|
}
|
|
972
972
|
_preFetch() {
|
|
973
|
-
this.#nextPageToken =
|
|
973
|
+
this.#nextPageToken = void 0;
|
|
974
974
|
}
|
|
975
975
|
async _fetchAndStore() {
|
|
976
976
|
if (process.env.NODE_ENV !== "production") {
|
|
@@ -983,7 +983,7 @@ var ListQuery = class extends BaseListQuery {
|
|
|
983
983
|
if (!entry) {
|
|
984
984
|
return;
|
|
985
985
|
}
|
|
986
|
-
!entry.value?.data ? process.env.NODE_ENV !== "production" ? invariant2__default.default(false) : invariant2__default.default(false) :
|
|
986
|
+
!entry.value?.data ? process.env.NODE_ENV !== "production" ? invariant2__default.default(false) : invariant2__default.default(false) : void 0;
|
|
987
987
|
const count = entry.value.data.length;
|
|
988
988
|
if (count > this.#minNumResults || this.#nextPageToken == null) {
|
|
989
989
|
break;
|
|
@@ -1012,7 +1012,7 @@ var ListQuery = class extends BaseListQuery {
|
|
|
1012
1012
|
this.setStatus("loading", batch);
|
|
1013
1013
|
});
|
|
1014
1014
|
this.pendingFetch = this.#fetchPageAndUpdate(this.#objectSet, "loaded", this.abortController?.signal).finally(() => {
|
|
1015
|
-
this.#pendingPageFetch =
|
|
1015
|
+
this.#pendingPageFetch = void 0;
|
|
1016
1016
|
});
|
|
1017
1017
|
return this.pendingFetch;
|
|
1018
1018
|
};
|
|
@@ -1293,7 +1293,7 @@ var ListQuery = class extends BaseListQuery {
|
|
|
1293
1293
|
#onOswRemoved(objOrIface, logger) {
|
|
1294
1294
|
this.store.batch({}, (batch) => {
|
|
1295
1295
|
const existing = batch.read(this.cacheKey);
|
|
1296
|
-
!existing ? process.env.NODE_ENV !== "production" ? invariant2__default.default(false, "the truth value for our list should exist as we already subscribed") : invariant2__default.default(false) :
|
|
1296
|
+
!existing ? process.env.NODE_ENV !== "production" ? invariant2__default.default(false, "the truth value for our list should exist as we already subscribed") : invariant2__default.default(false) : void 0;
|
|
1297
1297
|
if (existing.status === "loaded") {
|
|
1298
1298
|
const objectCacheKey = this.store.getCacheKey("object", objOrIface.$objectType, objOrIface.$primaryKey);
|
|
1299
1299
|
const newObjects = existing.value?.data.filter((o) => o !== objectCacheKey);
|
|
@@ -1365,7 +1365,7 @@ async function reloadDataAsFullObjects(client, data) {
|
|
|
1365
1365
|
return [apiName, Object.fromEntries(result.data.map((x) => [x.$primaryKey, x]))];
|
|
1366
1366
|
})));
|
|
1367
1367
|
data = data.map((obj) => {
|
|
1368
|
-
!objectTypeToPrimaryKeyToObject[obj.$objectType][obj.$primaryKey] ? process.env.NODE_ENV !== "production" ? invariant2__default.default(false, `Could not find object ${obj.$objectType} ${obj.$primaryKey}`) : invariant2__default.default(false) :
|
|
1368
|
+
!objectTypeToPrimaryKeyToObject[obj.$objectType][obj.$primaryKey] ? process.env.NODE_ENV !== "production" ? invariant2__default.default(false, `Could not find object ${obj.$objectType} ${obj.$primaryKey}`) : invariant2__default.default(false) : void 0;
|
|
1369
1369
|
return objectTypeToPrimaryKeyToObject[obj.$objectType][obj.$primaryKey];
|
|
1370
1370
|
});
|
|
1371
1371
|
return data;
|
|
@@ -1452,7 +1452,7 @@ var RefCounts = class {
|
|
|
1452
1452
|
}
|
|
1453
1453
|
release(key) {
|
|
1454
1454
|
const count = this.refCounts.get(key);
|
|
1455
|
-
if (count ===
|
|
1455
|
+
if (count === void 0) ; else if (count === 1) {
|
|
1456
1456
|
this.refCounts.delete(key);
|
|
1457
1457
|
this.gcMap.set(key, Date.now() + this.keepAlive);
|
|
1458
1458
|
} else {
|
|
@@ -1514,8 +1514,8 @@ var WhereClauseCanonicalizer = class {
|
|
|
1514
1514
|
#toCanon = (where, set = /* @__PURE__ */ new Set()) => {
|
|
1515
1515
|
if ("$and" in where) {
|
|
1516
1516
|
if (process.env.NODE_ENV !== "production") {
|
|
1517
|
-
!Array.isArray(where.$and) ? process.env.NODE_ENV !== "production" ? invariant2__default.default(false, "expected $and to be an array") : invariant2__default.default(false) :
|
|
1518
|
-
!(Object.keys(where).length === 1) ? process.env.NODE_ENV !== "production" ? invariant2__default.default(false, "expected only $and to be present") : invariant2__default.default(false) :
|
|
1517
|
+
!Array.isArray(where.$and) ? process.env.NODE_ENV !== "production" ? invariant2__default.default(false, "expected $and to be an array") : invariant2__default.default(false) : void 0;
|
|
1518
|
+
!(Object.keys(where).length === 1) ? process.env.NODE_ENV !== "production" ? invariant2__default.default(false, "expected only $and to be present") : invariant2__default.default(false) : void 0;
|
|
1519
1519
|
}
|
|
1520
1520
|
if (where.$and.length === 0) {
|
|
1521
1521
|
return {};
|
|
@@ -1542,14 +1542,14 @@ function createInitEntry(cacheKey) {
|
|
|
1542
1542
|
return {
|
|
1543
1543
|
cacheKey,
|
|
1544
1544
|
status: "init",
|
|
1545
|
-
value:
|
|
1545
|
+
value: void 0,
|
|
1546
1546
|
lastUpdated: 0
|
|
1547
1547
|
};
|
|
1548
1548
|
}
|
|
1549
1549
|
var Store = class {
|
|
1550
1550
|
whereCanonicalizer = new WhereClauseCanonicalizer();
|
|
1551
1551
|
orderByCanonicalizer = new OrderByCanonicalizer();
|
|
1552
|
-
#truthLayer = new Layer(
|
|
1552
|
+
#truthLayer = new Layer(void 0, void 0);
|
|
1553
1553
|
#topLayer;
|
|
1554
1554
|
/** @internal */
|
|
1555
1555
|
// we can use a regular Map here because the refCounting will
|
|
@@ -1589,7 +1589,7 @@ var Store = class {
|
|
|
1589
1589
|
const subject = this.peekSubject(key);
|
|
1590
1590
|
this.#cacheKeys.remove(key);
|
|
1591
1591
|
if (process.env.NODE_ENV !== "production") {
|
|
1592
|
-
!subject ? process.env.NODE_ENV !== "production" ? invariant2__default.default(false) : invariant2__default.default(false) :
|
|
1592
|
+
!subject ? process.env.NODE_ENV !== "production" ? invariant2__default.default(false) : invariant2__default.default(false) : void 0;
|
|
1593
1593
|
}
|
|
1594
1594
|
if (subject) {
|
|
1595
1595
|
subject.complete();
|
|
@@ -1602,7 +1602,7 @@ var Store = class {
|
|
|
1602
1602
|
return await new ActionApplication(this).applyAction(action, args, opts);
|
|
1603
1603
|
};
|
|
1604
1604
|
removeLayer(layerId) {
|
|
1605
|
-
!(layerId != null) ? process.env.NODE_ENV !== "production" ? invariant2__default.default(false, "undefined is the reserved layerId for the truth layer") : invariant2__default.default(false) :
|
|
1605
|
+
!(layerId != null) ? process.env.NODE_ENV !== "production" ? invariant2__default.default(false, "undefined is the reserved layerId for the truth layer") : invariant2__default.default(false) : void 0;
|
|
1606
1606
|
let currentLayer = this.#topLayer;
|
|
1607
1607
|
const cacheKeys = /* @__PURE__ */ new Map();
|
|
1608
1608
|
while (currentLayer != null && currentLayer.parentLayer != null) {
|
|
@@ -1730,8 +1730,8 @@ var Store = class {
|
|
|
1730
1730
|
optimisticId,
|
|
1731
1731
|
changes = createChangedObjects()
|
|
1732
1732
|
}, batchFn) => {
|
|
1733
|
-
!(optimisticId ===
|
|
1734
|
-
let needsLayer = optimisticId !==
|
|
1733
|
+
!(optimisticId === void 0 || !!optimisticId) ? process.env.NODE_ENV !== "production" ? invariant2__default.default(false, "optimistic must be undefined or not falsy") : invariant2__default.default(false) : void 0;
|
|
1734
|
+
let needsLayer = optimisticId !== void 0;
|
|
1735
1735
|
const batchContext = {
|
|
1736
1736
|
changes,
|
|
1737
1737
|
createLayerIfNeeded: () => {
|
|
@@ -1828,7 +1828,7 @@ var Store = class {
|
|
|
1828
1828
|
if (process.env.NODE_ENV !== "production") {
|
|
1829
1829
|
this.logger?.child({
|
|
1830
1830
|
methodName: "invalidateObjectType"
|
|
1831
|
-
}).info(changes ? DEBUG_ONLY__changesToString(changes) :
|
|
1831
|
+
}).info(changes ? DEBUG_ONLY__changesToString(changes) : void 0);
|
|
1832
1832
|
}
|
|
1833
1833
|
const promises = [];
|
|
1834
1834
|
for (const cacheKey of this.#truthLayer.keys()) {
|
|
@@ -1842,7 +1842,7 @@ var Store = class {
|
|
|
1842
1842
|
}
|
|
1843
1843
|
}
|
|
1844
1844
|
}
|
|
1845
|
-
return Promise.all(promises).then(() =>
|
|
1845
|
+
return Promise.all(promises).then(() => void 0);
|
|
1846
1846
|
}
|
|
1847
1847
|
retain(cacheKey) {
|
|
1848
1848
|
this.#refCounts.retain(cacheKey);
|