@osdk/client 2.5.0-beta.7 → 2.5.0-beta.9
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 +22 -0
- package/build/browser/object/fetchPage.js +71 -25
- package/build/browser/object/fetchPage.js.map +1 -1
- package/build/browser/object/fetchPage.test.js +35 -1
- package/build/browser/object/fetchPage.test.js.map +1 -1
- package/build/browser/observable/internal/list/InterfaceListQuery.js +83 -0
- package/build/browser/observable/internal/list/InterfaceListQuery.js.map +1 -0
- package/build/browser/observable/internal/list/ListQuery.js +33 -108
- package/build/browser/observable/internal/list/ListQuery.js.map +1 -1
- package/build/browser/observable/internal/list/ListsHelper.js +4 -2
- package/build/browser/observable/internal/list/ListsHelper.js.map +1 -1
- package/build/browser/observable/internal/list/ObjectListQuery.js +48 -0
- package/build/browser/observable/internal/list/ObjectListQuery.js.map +1 -0
- package/build/browser/util/UserAgent.js +2 -2
- package/build/cjs/{chunk-BY2PQEYA.cjs → chunk-HCCGD2AP.cjs} +54 -54
- package/build/cjs/{chunk-BY2PQEYA.cjs.map → chunk-HCCGD2AP.cjs.map} +1 -1
- package/build/cjs/{chunk-5KDG5ZET.cjs → chunk-MKL3HEQ5.cjs} +251 -210
- package/build/cjs/chunk-MKL3HEQ5.cjs.map +1 -0
- package/build/cjs/index.cjs +7 -7
- package/build/cjs/public/internal.cjs +8 -8
- package/build/cjs/public/unstable-do-not-use.cjs +126 -103
- package/build/cjs/public/unstable-do-not-use.cjs.map +1 -1
- package/build/esm/object/fetchPage.js +71 -25
- package/build/esm/object/fetchPage.js.map +1 -1
- package/build/esm/object/fetchPage.test.js +35 -1
- package/build/esm/object/fetchPage.test.js.map +1 -1
- package/build/esm/observable/internal/list/InterfaceListQuery.js +83 -0
- package/build/esm/observable/internal/list/InterfaceListQuery.js.map +1 -0
- package/build/esm/observable/internal/list/ListQuery.js +33 -108
- package/build/esm/observable/internal/list/ListQuery.js.map +1 -1
- package/build/esm/observable/internal/list/ListsHelper.js +4 -2
- package/build/esm/observable/internal/list/ListsHelper.js.map +1 -1
- package/build/esm/observable/internal/list/ObjectListQuery.js +48 -0
- package/build/esm/observable/internal/list/ObjectListQuery.js.map +1 -0
- package/build/esm/util/UserAgent.js +2 -2
- package/build/types/observable/internal/list/InterfaceListQuery.d.ts +18 -0
- package/build/types/observable/internal/list/InterfaceListQuery.d.ts.map +1 -0
- package/build/types/observable/internal/list/ListQuery.d.ts +37 -6
- package/build/types/observable/internal/list/ListQuery.d.ts.map +1 -1
- package/build/types/observable/internal/list/ListsHelper.d.ts +1 -1
- package/build/types/observable/internal/list/ListsHelper.d.ts.map +1 -1
- package/build/types/observable/internal/list/ObjectListQuery.d.ts +18 -0
- package/build/types/observable/internal/list/ObjectListQuery.d.ts.map +1 -0
- package/package.json +7 -7
- package/build/cjs/chunk-5KDG5ZET.cjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkHCCGD2AP_cjs = require('../chunk-HCCGD2AP.cjs');
|
|
4
|
+
var chunkMKL3HEQ5_cjs = require('../chunk-MKL3HEQ5.cjs');
|
|
5
5
|
require('../chunk-Q7SFCCGT.cjs');
|
|
6
6
|
var shared_net_fetch = require('@osdk/shared.net.fetch');
|
|
7
7
|
var rxjs = require('rxjs');
|
|
@@ -144,7 +144,7 @@ var OptimisticJob = class {
|
|
|
144
144
|
return this;
|
|
145
145
|
},
|
|
146
146
|
createObject(type, pk, properties) {
|
|
147
|
-
const create = store.client[
|
|
147
|
+
const create = store.client[chunkMKL3HEQ5_cjs.additionalContext].objectFactory2(store.client[chunkMKL3HEQ5_cjs.additionalContext], [{
|
|
148
148
|
$primaryKey: pk,
|
|
149
149
|
$apiName: type.apiName,
|
|
150
150
|
$objectType: type.apiName,
|
|
@@ -825,7 +825,7 @@ var Query = class {
|
|
|
825
825
|
this.store = store;
|
|
826
826
|
this.cacheKeys = store.cacheKeys;
|
|
827
827
|
this.#subject = observable;
|
|
828
|
-
this.logger = logger ?? (process.env.NODE_ENV === "production" ? store.client[
|
|
828
|
+
this.logger = logger ?? (process.env.NODE_ENV === "production" ? store.client[chunkMKL3HEQ5_cjs.additionalContext].logger : store.client[chunkMKL3HEQ5_cjs.additionalContext].logger?.child({}, {
|
|
829
829
|
msgPrefix: process.env.NODE_ENV !== "production" ? `Query<${cacheKey.type}, ${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>` : "Query"
|
|
830
830
|
}));
|
|
831
831
|
}
|
|
@@ -1381,7 +1381,7 @@ var SpecificLinkQuery = class extends BaseListQuery {
|
|
|
1381
1381
|
batch.changes.modified.add(this.cacheKey);
|
|
1382
1382
|
}
|
|
1383
1383
|
constructor(store, subject, cacheKey, opts) {
|
|
1384
|
-
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[
|
|
1384
|
+
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunkMKL3HEQ5_cjs.additionalContext].logger?.child({}, {
|
|
1385
1385
|
msgPrefix: `SpecificLinkQuery<${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>`
|
|
1386
1386
|
}) : void 0);
|
|
1387
1387
|
[this.#sourceApiName, this.#sourcePk, this.#linkName, this.#whereClause, this.#orderBy] = cacheKey.otherKeys;
|
|
@@ -1398,7 +1398,7 @@ var SpecificLinkQuery = class extends BaseListQuery {
|
|
|
1398
1398
|
type: "object",
|
|
1399
1399
|
apiName: this.#sourceApiName
|
|
1400
1400
|
};
|
|
1401
|
-
const sourceMetadata = await client[
|
|
1401
|
+
const sourceMetadata = await client[chunkMKL3HEQ5_cjs.additionalContext].ontologyProvider.getObjectDefinition(this.#sourceApiName);
|
|
1402
1402
|
const sourceQuery = client(sourceObjectDef).where({
|
|
1403
1403
|
[sourceMetadata.primaryKeyApiName]: this.#sourcePk
|
|
1404
1404
|
});
|
|
@@ -1462,7 +1462,7 @@ var SpecificLinkQuery = class extends BaseListQuery {
|
|
|
1462
1462
|
return this.revalidate(true);
|
|
1463
1463
|
} else {
|
|
1464
1464
|
return (async () => {
|
|
1465
|
-
const sourceMetadata = await this.store.client[
|
|
1465
|
+
const sourceMetadata = await this.store.client[chunkMKL3HEQ5_cjs.additionalContext].ontologyProvider.getObjectDefinition(this.#sourceApiName);
|
|
1466
1466
|
const linkDef = sourceMetadata.links?.[this.#linkName];
|
|
1467
1467
|
if (!linkDef || linkDef.targetType !== objectType) return;
|
|
1468
1468
|
const promise = this.revalidate(true);
|
|
@@ -1582,8 +1582,6 @@ function objectSortaMatchesWhereClause(o, whereClause, strict) {
|
|
|
1582
1582
|
var API_NAME_IDX = 1;
|
|
1583
1583
|
var ListQuery = class extends BaseListQuery {
|
|
1584
1584
|
// pageSize?: number; // this is the internal page size. we need to track this properly
|
|
1585
|
-
#type;
|
|
1586
|
-
#apiName;
|
|
1587
1585
|
#whereClause;
|
|
1588
1586
|
// Using base class minResultsToLoad instead of a private property
|
|
1589
1587
|
#orderBy;
|
|
@@ -1594,24 +1592,23 @@ var ListQuery = class extends BaseListQuery {
|
|
|
1594
1592
|
registerCacheChanges(batch) {
|
|
1595
1593
|
batch.changes.registerList(this.cacheKey);
|
|
1596
1594
|
}
|
|
1597
|
-
constructor(store, subject,
|
|
1598
|
-
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[
|
|
1595
|
+
constructor(store, subject, apiName, whereClause, orderBy, cacheKey, opts) {
|
|
1596
|
+
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunkMKL3HEQ5_cjs.additionalContext].logger?.child({}, {
|
|
1599
1597
|
msgPrefix: `ListQuery<${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>`
|
|
1600
1598
|
}) : void 0);
|
|
1601
|
-
this
|
|
1602
|
-
this.#apiName = apiName;
|
|
1599
|
+
this.apiName = apiName;
|
|
1603
1600
|
this.#whereClause = whereClause;
|
|
1604
1601
|
this.#orderBy = orderBy;
|
|
1605
|
-
this.#objectSet =
|
|
1606
|
-
|
|
1607
|
-
apiName: this.#apiName
|
|
1608
|
-
}).where(this.#whereClause);
|
|
1609
|
-
this.sortingStrategy = new OrderBySortingStrategy(this.#apiName, this.#orderBy);
|
|
1602
|
+
this.#objectSet = this.createObjectSet(store);
|
|
1603
|
+
this.sortingStrategy = new OrderBySortingStrategy(this.apiName, this.#orderBy);
|
|
1610
1604
|
this.minResultsToLoad = 0;
|
|
1611
1605
|
}
|
|
1612
1606
|
get canonicalWhere() {
|
|
1613
1607
|
return this.#whereClause;
|
|
1614
1608
|
}
|
|
1609
|
+
/**
|
|
1610
|
+
* Create the ObjectSet for this query.
|
|
1611
|
+
*/
|
|
1615
1612
|
/**
|
|
1616
1613
|
* Implements fetchPageData from BaseCollectionQuery template method
|
|
1617
1614
|
* Fetches a page of data
|
|
@@ -1630,10 +1627,7 @@ var ListQuery = class extends BaseListQuery {
|
|
|
1630
1627
|
throw new Error("Aborted");
|
|
1631
1628
|
}
|
|
1632
1629
|
this.nextPageToken = resp.nextPageToken;
|
|
1633
|
-
|
|
1634
|
-
if (this.#type === "interface") {
|
|
1635
|
-
fetchedData = await reloadDataAsFullObjects(this.store.client, fetchedData);
|
|
1636
|
-
}
|
|
1630
|
+
const fetchedData = await this.postProcessFetchedData(resp.data);
|
|
1637
1631
|
return {
|
|
1638
1632
|
...resp,
|
|
1639
1633
|
data: fetchedData
|
|
@@ -1656,30 +1650,9 @@ var ListQuery = class extends BaseListQuery {
|
|
|
1656
1650
|
* @param apiName to invalidate
|
|
1657
1651
|
* @returns
|
|
1658
1652
|
*/
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
await this.revalidate(
|
|
1663
|
-
/* force */
|
|
1664
|
-
true
|
|
1665
|
-
);
|
|
1666
|
-
return;
|
|
1667
|
-
} else {
|
|
1668
|
-
return;
|
|
1669
|
-
}
|
|
1670
|
-
}
|
|
1671
|
-
const objectMetadata = await this.store.client.fetchMetadata({
|
|
1672
|
-
type: "object",
|
|
1673
|
-
apiName
|
|
1674
|
-
});
|
|
1675
|
-
if (this.#apiName in objectMetadata.interfaceMap) {
|
|
1676
|
-
await this.revalidate(
|
|
1677
|
-
/* force */
|
|
1678
|
-
true
|
|
1679
|
-
);
|
|
1680
|
-
return;
|
|
1681
|
-
}
|
|
1682
|
-
};
|
|
1653
|
+
/**
|
|
1654
|
+
* Postprocess fetched data.
|
|
1655
|
+
*/
|
|
1683
1656
|
invalidateObjectType = async (objectType, changes) => {
|
|
1684
1657
|
if (this.cacheKey.otherKeys[1] === objectType) {
|
|
1685
1658
|
changes?.modified.add(this.cacheKey);
|
|
@@ -1707,7 +1680,7 @@ var ListQuery = class extends BaseListQuery {
|
|
|
1707
1680
|
if (changes.modified.has(this.cacheKey)) return;
|
|
1708
1681
|
changes.modified.add(this.cacheKey);
|
|
1709
1682
|
try {
|
|
1710
|
-
const relevantObjects = this.
|
|
1683
|
+
const relevantObjects = this._extractAndCategorizeRelevantObjects(changes);
|
|
1711
1684
|
const status = optimisticId || relevantObjects.added.sortaMatches.size > 0 || relevantObjects.modified.sortaMatches.size > 0 ? "loading" : "loaded";
|
|
1712
1685
|
const newList = [];
|
|
1713
1686
|
let needsRevalidation = false;
|
|
@@ -1774,8 +1747,8 @@ var ListQuery = class extends BaseListQuery {
|
|
|
1774
1747
|
}
|
|
1775
1748
|
return false;
|
|
1776
1749
|
}
|
|
1777
|
-
|
|
1778
|
-
const relevantObjects = this
|
|
1750
|
+
_extractAndCategorizeRelevantObjects(changes) {
|
|
1751
|
+
const relevantObjects = this.extractRelevantObjects(changes);
|
|
1779
1752
|
for (const group of Object.values(relevantObjects)) {
|
|
1780
1753
|
for (const obj of group.all ?? []) {
|
|
1781
1754
|
const matchType = this.#matchType(obj);
|
|
@@ -1786,39 +1759,9 @@ var ListQuery = class extends BaseListQuery {
|
|
|
1786
1759
|
}
|
|
1787
1760
|
return relevantObjects;
|
|
1788
1761
|
}
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
};
|
|
1793
|
-
const added = Array.from(changes.addedObjects).filter(matchesApiName).map(([, object]) => object.$as(this.#apiName));
|
|
1794
|
-
const modified = Array.from(changes.modifiedObjects).filter(matchesApiName).map(([, object]) => object.$as(this.#apiName));
|
|
1795
|
-
return {
|
|
1796
|
-
added: {
|
|
1797
|
-
all: added,
|
|
1798
|
-
strictMatches: /* @__PURE__ */ new Set(),
|
|
1799
|
-
sortaMatches: /* @__PURE__ */ new Set()
|
|
1800
|
-
},
|
|
1801
|
-
modified: {
|
|
1802
|
-
all: modified,
|
|
1803
|
-
strictMatches: /* @__PURE__ */ new Set(),
|
|
1804
|
-
sortaMatches: /* @__PURE__ */ new Set()
|
|
1805
|
-
}
|
|
1806
|
-
};
|
|
1807
|
-
}
|
|
1808
|
-
#extractRelevantObjectsForTypeObject(changes) {
|
|
1809
|
-
return {
|
|
1810
|
-
added: {
|
|
1811
|
-
all: changes.addedObjects.get(this.cacheKey.otherKeys[API_NAME_IDX]) ?? [],
|
|
1812
|
-
strictMatches: /* @__PURE__ */ new Set(),
|
|
1813
|
-
sortaMatches: /* @__PURE__ */ new Set()
|
|
1814
|
-
},
|
|
1815
|
-
modified: {
|
|
1816
|
-
all: changes.modifiedObjects.get(this.cacheKey.otherKeys[API_NAME_IDX]) ?? [],
|
|
1817
|
-
strictMatches: /* @__PURE__ */ new Set(),
|
|
1818
|
-
sortaMatches: /* @__PURE__ */ new Set()
|
|
1819
|
-
}
|
|
1820
|
-
};
|
|
1821
|
-
}
|
|
1762
|
+
/**
|
|
1763
|
+
* Extract relevant objects for this query type.
|
|
1764
|
+
*/
|
|
1822
1765
|
registerStreamUpdates(sub) {
|
|
1823
1766
|
const logger = process.env.NODE_ENV !== "production" ? this.logger?.child({
|
|
1824
1767
|
methodName: "registerStreamUpdates"
|
|
@@ -1829,10 +1772,10 @@ var ListQuery = class extends BaseListQuery {
|
|
|
1829
1772
|
}).info("Subscribing from websocket");
|
|
1830
1773
|
}
|
|
1831
1774
|
const websocketSubscription = this.#objectSet.subscribe({
|
|
1832
|
-
onChange: this
|
|
1833
|
-
onError: this
|
|
1834
|
-
onOutOfDate: this
|
|
1835
|
-
onSuccessfulSubscription: this
|
|
1775
|
+
onChange: this.onOswChange.bind(this),
|
|
1776
|
+
onError: this.onOswError.bind(this),
|
|
1777
|
+
onOutOfDate: this.onOswOutOfDate.bind(this),
|
|
1778
|
+
onSuccessfulSubscription: this.onOswSuccessfulSubscription.bind(this)
|
|
1836
1779
|
});
|
|
1837
1780
|
sub.add(() => {
|
|
1838
1781
|
if (process.env.NODE_ENV !== "production") {
|
|
@@ -1843,28 +1786,28 @@ var ListQuery = class extends BaseListQuery {
|
|
|
1843
1786
|
websocketSubscription.unsubscribe();
|
|
1844
1787
|
});
|
|
1845
1788
|
}
|
|
1846
|
-
|
|
1789
|
+
onOswSuccessfulSubscription() {
|
|
1847
1790
|
if (process.env.NODE_ENV !== "production") {
|
|
1848
1791
|
this.logger?.child({
|
|
1849
1792
|
methodName: "onSuccessfulSubscription"
|
|
1850
1793
|
}).debug("");
|
|
1851
1794
|
}
|
|
1852
1795
|
}
|
|
1853
|
-
|
|
1796
|
+
onOswOutOfDate() {
|
|
1854
1797
|
if (process.env.NODE_ENV !== "production") {
|
|
1855
1798
|
this.logger?.child({
|
|
1856
1799
|
methodName: "onOutOfDate"
|
|
1857
1800
|
}).debug("");
|
|
1858
1801
|
}
|
|
1859
1802
|
}
|
|
1860
|
-
|
|
1803
|
+
onOswError(errors) {
|
|
1861
1804
|
if (this.logger) {
|
|
1862
1805
|
this.logger?.child({
|
|
1863
1806
|
methodName: "onError"
|
|
1864
1807
|
}).error("subscription errors", errors);
|
|
1865
1808
|
}
|
|
1866
1809
|
}
|
|
1867
|
-
|
|
1810
|
+
onOswChange({
|
|
1868
1811
|
object: objOrIface,
|
|
1869
1812
|
state
|
|
1870
1813
|
}) {
|
|
@@ -1882,10 +1825,10 @@ var ListQuery = class extends BaseListQuery {
|
|
|
1882
1825
|
this.store.objects.storeOsdkInstances([object], batch);
|
|
1883
1826
|
});
|
|
1884
1827
|
} else if (state === "REMOVED") {
|
|
1885
|
-
this
|
|
1828
|
+
this.onOswRemoved(objOrIface, logger);
|
|
1886
1829
|
}
|
|
1887
1830
|
}
|
|
1888
|
-
|
|
1831
|
+
onOswRemoved(objOrIface, logger) {
|
|
1889
1832
|
this.store.batch({}, (batch) => {
|
|
1890
1833
|
const existing = batch.read(this.cacheKey);
|
|
1891
1834
|
!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;
|
|
@@ -1916,10 +1859,54 @@ var ListQuery = class extends BaseListQuery {
|
|
|
1916
1859
|
});
|
|
1917
1860
|
}
|
|
1918
1861
|
};
|
|
1862
|
+
|
|
1863
|
+
// src/observable/internal/list/InterfaceListQuery.ts
|
|
1864
|
+
var InterfaceListQuery = class extends ListQuery {
|
|
1865
|
+
createObjectSet(store) {
|
|
1866
|
+
return store.client({
|
|
1867
|
+
type: "interface",
|
|
1868
|
+
apiName: this.apiName
|
|
1869
|
+
}).where(this.canonicalWhere);
|
|
1870
|
+
}
|
|
1871
|
+
async revalidateObjectType(apiName) {
|
|
1872
|
+
const objectMetadata = await this.store.client.fetchMetadata({
|
|
1873
|
+
type: "object",
|
|
1874
|
+
apiName
|
|
1875
|
+
});
|
|
1876
|
+
if (this.apiName in objectMetadata.interfaceMap) {
|
|
1877
|
+
await this.revalidate(
|
|
1878
|
+
/* force */
|
|
1879
|
+
true
|
|
1880
|
+
);
|
|
1881
|
+
}
|
|
1882
|
+
}
|
|
1883
|
+
async postProcessFetchedData(data) {
|
|
1884
|
+
return reloadDataAsFullObjects(this.store.client, data);
|
|
1885
|
+
}
|
|
1886
|
+
extractRelevantObjects(changes) {
|
|
1887
|
+
const matchesApiName = ([, object]) => {
|
|
1888
|
+
return this.apiName in object[chunkHCCGD2AP_cjs.ObjectDefRef].interfaceMap;
|
|
1889
|
+
};
|
|
1890
|
+
const added = Array.from(changes.addedObjects).filter(matchesApiName).map(([, object]) => object.$as(this.apiName));
|
|
1891
|
+
const modified = Array.from(changes.modifiedObjects).filter(matchesApiName).map(([, object]) => object.$as(this.apiName));
|
|
1892
|
+
return {
|
|
1893
|
+
added: {
|
|
1894
|
+
all: added,
|
|
1895
|
+
strictMatches: /* @__PURE__ */ new Set(),
|
|
1896
|
+
sortaMatches: /* @__PURE__ */ new Set()
|
|
1897
|
+
},
|
|
1898
|
+
modified: {
|
|
1899
|
+
all: modified,
|
|
1900
|
+
strictMatches: /* @__PURE__ */ new Set(),
|
|
1901
|
+
sortaMatches: /* @__PURE__ */ new Set()
|
|
1902
|
+
}
|
|
1903
|
+
};
|
|
1904
|
+
}
|
|
1905
|
+
};
|
|
1919
1906
|
async function reloadDataAsFullObjects(client, data) {
|
|
1920
1907
|
const groups = groupBy__default.default(data, (x) => x.$objectType);
|
|
1921
1908
|
const objectTypeToPrimaryKeyToObject = Object.fromEntries(await Promise.all(Object.entries(groups).map(async ([apiName, objects]) => {
|
|
1922
|
-
const objectDef = objects[0][
|
|
1909
|
+
const objectDef = objects[0][chunkHCCGD2AP_cjs.UnderlyingOsdkObject][chunkHCCGD2AP_cjs.ObjectDefRef];
|
|
1923
1910
|
const where = {
|
|
1924
1911
|
[objectDef.primaryKeyApiName]: {
|
|
1925
1912
|
$in: objects.map((x) => x.$primaryKey)
|
|
@@ -1935,6 +1922,41 @@ async function reloadDataAsFullObjects(client, data) {
|
|
|
1935
1922
|
return data;
|
|
1936
1923
|
}
|
|
1937
1924
|
|
|
1925
|
+
// src/observable/internal/list/ObjectListQuery.ts
|
|
1926
|
+
var ObjectListQuery = class extends ListQuery {
|
|
1927
|
+
createObjectSet(store) {
|
|
1928
|
+
return store.client({
|
|
1929
|
+
type: "object",
|
|
1930
|
+
apiName: this.apiName
|
|
1931
|
+
}).where(this.canonicalWhere);
|
|
1932
|
+
}
|
|
1933
|
+
async revalidateObjectType(apiName) {
|
|
1934
|
+
if (this.apiName === apiName) {
|
|
1935
|
+
await this.revalidate(
|
|
1936
|
+
/* force */
|
|
1937
|
+
true
|
|
1938
|
+
);
|
|
1939
|
+
}
|
|
1940
|
+
}
|
|
1941
|
+
postProcessFetchedData(data) {
|
|
1942
|
+
return Promise.resolve(data);
|
|
1943
|
+
}
|
|
1944
|
+
extractRelevantObjects(changes) {
|
|
1945
|
+
return {
|
|
1946
|
+
added: {
|
|
1947
|
+
all: changes.addedObjects.get(this.cacheKey.otherKeys[API_NAME_IDX]) ?? [],
|
|
1948
|
+
strictMatches: /* @__PURE__ */ new Set(),
|
|
1949
|
+
sortaMatches: /* @__PURE__ */ new Set()
|
|
1950
|
+
},
|
|
1951
|
+
modified: {
|
|
1952
|
+
all: changes.modifiedObjects.get(this.cacheKey.otherKeys[API_NAME_IDX]) ?? [],
|
|
1953
|
+
strictMatches: /* @__PURE__ */ new Set(),
|
|
1954
|
+
sortaMatches: /* @__PURE__ */ new Set()
|
|
1955
|
+
}
|
|
1956
|
+
};
|
|
1957
|
+
}
|
|
1958
|
+
};
|
|
1959
|
+
|
|
1938
1960
|
// src/observable/internal/list/ListsHelper.ts
|
|
1939
1961
|
var ListsHelper = class extends AbstractHelper {
|
|
1940
1962
|
constructor(store, cacheKeys, whereCanonicalizer, orderByCanonicalizer) {
|
|
@@ -1962,7 +1984,8 @@ var ListsHelper = class extends AbstractHelper {
|
|
|
1962
1984
|
const canonOrderBy = this.orderByCanonicalizer.canonicalize(orderBy ?? {});
|
|
1963
1985
|
const listCacheKey = this.cacheKeys.get("list", type, apiName, canonWhere, canonOrderBy);
|
|
1964
1986
|
return this.store.queries.get(listCacheKey, () => {
|
|
1965
|
-
|
|
1987
|
+
const QueryClass = type === "object" ? ObjectListQuery : InterfaceListQuery;
|
|
1988
|
+
return new QueryClass(this.store, this.store.subjects.get(listCacheKey), apiName, canonWhere, canonOrderBy, listCacheKey, options);
|
|
1966
1989
|
});
|
|
1967
1990
|
}
|
|
1968
1991
|
};
|
|
@@ -1993,7 +2016,7 @@ var BulkObjectLoader = class {
|
|
|
1993
2016
|
#maxEntries;
|
|
1994
2017
|
constructor(client, maxWait = 25, maxEntries = 100) {
|
|
1995
2018
|
this.#client = client;
|
|
1996
|
-
this.#logger = client[
|
|
2019
|
+
this.#logger = client[chunkMKL3HEQ5_cjs.additionalContext].logger;
|
|
1997
2020
|
this.#maxWait = maxWait;
|
|
1998
2021
|
this.#maxEntries = maxEntries;
|
|
1999
2022
|
}
|
|
@@ -2056,7 +2079,7 @@ var ObjectQuery = class extends Query {
|
|
|
2056
2079
|
#apiName;
|
|
2057
2080
|
#pk;
|
|
2058
2081
|
constructor(store, subject, type, pk, cacheKey, opts) {
|
|
2059
|
-
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[
|
|
2082
|
+
super(store, subject, opts, cacheKey, process.env.NODE_ENV !== "production" ? store.client[chunkMKL3HEQ5_cjs.additionalContext].logger?.child({}, {
|
|
2060
2083
|
msgPrefix: `ObjectQuery<${cacheKey.otherKeys.map((x) => JSON.stringify(x)).join(", ")}>`
|
|
2061
2084
|
}) : void 0);
|
|
2062
2085
|
this.#apiName = type;
|
|
@@ -2342,7 +2365,7 @@ var Store = class {
|
|
|
2342
2365
|
subjects = this.layers.subjects;
|
|
2343
2366
|
// these are hopefully temporary
|
|
2344
2367
|
constructor(client) {
|
|
2345
|
-
this.logger = client[
|
|
2368
|
+
this.logger = client[chunkMKL3HEQ5_cjs.additionalContext].logger?.child({}, {
|
|
2346
2369
|
msgPrefix: "Store"
|
|
2347
2370
|
});
|
|
2348
2371
|
this.client = client;
|
|
@@ -2462,10 +2485,10 @@ var Store = class {
|
|
|
2462
2485
|
|
|
2463
2486
|
// src/observable/ObservableClient.ts
|
|
2464
2487
|
function createObservableClient(client) {
|
|
2465
|
-
const tweakedClient =
|
|
2466
|
-
...client[
|
|
2467
|
-
fetch: shared_net_fetch.createFetchHeaderMutator(client[
|
|
2468
|
-
headers.set("Fetch-User-Agent", [headers.get("Fetch-User-Agent"),
|
|
2488
|
+
const tweakedClient = chunkHCCGD2AP_cjs.createClientFromContext({
|
|
2489
|
+
...client[chunkMKL3HEQ5_cjs.additionalContext],
|
|
2490
|
+
fetch: shared_net_fetch.createFetchHeaderMutator(client[chunkMKL3HEQ5_cjs.additionalContext].fetch, (headers) => {
|
|
2491
|
+
headers.set("Fetch-User-Agent", [headers.get("Fetch-User-Agent"), chunkHCCGD2AP_cjs.OBSERVABLE_USER_AGENT].filter((x) => x && x?.length > 0).join(" "));
|
|
2469
2492
|
return headers;
|
|
2470
2493
|
})
|
|
2471
2494
|
});
|
|
@@ -2508,11 +2531,11 @@ function getOsdkConfig(ontologyRid) {
|
|
|
2508
2531
|
|
|
2509
2532
|
Object.defineProperty(exports, "createClientWithTransaction", {
|
|
2510
2533
|
enumerable: true,
|
|
2511
|
-
get: function () { return
|
|
2534
|
+
get: function () { return chunkHCCGD2AP_cjs.createClientWithTransaction; }
|
|
2512
2535
|
});
|
|
2513
2536
|
Object.defineProperty(exports, "augment", {
|
|
2514
2537
|
enumerable: true,
|
|
2515
|
-
get: function () { return
|
|
2538
|
+
get: function () { return chunkMKL3HEQ5_cjs.augment; }
|
|
2516
2539
|
});
|
|
2517
2540
|
exports.createObservableClient = createObservableClient;
|
|
2518
2541
|
exports.getMetaTagContent = getMetaTagContent;
|