houdini-svelte 0.17.8 → 0.17.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/.turbo/turbo-compile.log +2 -2
- package/.turbo/turbo-typedefs.log +2 -2
- package/CHANGELOG.md +5 -0
- package/build/plugin-cjs/index.js +47 -29
- package/build/plugin-esm/index.js +47 -29
- package/build/preprocess-cjs/index.js +52 -24
- package/build/preprocess-esm/index.js +52 -24
- package/build/runtime/session.d.ts +1 -1
- package/build/runtime-cjs/session.d.ts +1 -1
- package/build/runtime-esm/session.d.ts +1 -1
- package/build/test-cjs/index.js +190 -77
- package/build/test-esm/index.js +190 -77
- package/package.json +3 -3
- package/src/runtime/session.ts +1 -1
package/.turbo/turbo-compile.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
houdini-svelte:compile: cache hit, replaying output
|
|
1
|
+
houdini-svelte:compile: cache hit, replaying output a6f23d9fada7a9db
|
|
2
2
|
houdini-svelte:compile:
|
|
3
|
-
houdini-svelte:compile: > houdini-svelte@0.17.
|
|
3
|
+
houdini-svelte:compile: > houdini-svelte@0.17.9 compile /home/runner/work/houdini/houdini/packages/houdini-svelte
|
|
4
4
|
houdini-svelte:compile: > scripts build --plugin
|
|
5
5
|
houdini-svelte:compile:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
houdini-svelte:typedefs: cache hit, replaying output
|
|
1
|
+
houdini-svelte:typedefs: cache hit, replaying output dc7aa0cae2a15b45
|
|
2
2
|
houdini-svelte:typedefs:
|
|
3
|
-
houdini-svelte:typedefs: > houdini-svelte@0.17.
|
|
3
|
+
houdini-svelte:typedefs: > houdini-svelte@0.17.9 typedefs /home/runner/work/houdini/houdini/packages/houdini-svelte
|
|
4
4
|
houdini-svelte:typedefs: > scripts typedefs --plugin
|
|
5
5
|
houdini-svelte:typedefs:
|
package/CHANGELOG.md
CHANGED
|
@@ -30803,10 +30803,10 @@ var require_main5 = __commonJS({
|
|
|
30803
30803
|
}
|
|
30804
30804
|
});
|
|
30805
30805
|
|
|
30806
|
-
// ../../node_modules/.pnpm/@sveltejs+kit@1.0.0-next.
|
|
30806
|
+
// ../../node_modules/.pnpm/@sveltejs+kit@1.0.0-next.547_svelte@3.52.0+vite@3.2.4/node_modules/@sveltejs/kit/src/runtime/control.js
|
|
30807
30807
|
var HttpError, Redirect, ValidationError;
|
|
30808
30808
|
var init_control = __esm({
|
|
30809
|
-
"../../node_modules/.pnpm/@sveltejs+kit@1.0.0-next.
|
|
30809
|
+
"../../node_modules/.pnpm/@sveltejs+kit@1.0.0-next.547_svelte@3.52.0+vite@3.2.4/node_modules/@sveltejs/kit/src/runtime/control.js"() {
|
|
30810
30810
|
HttpError = class {
|
|
30811
30811
|
constructor(status, body) {
|
|
30812
30812
|
this.status = status;
|
|
@@ -30837,7 +30837,7 @@ var init_control = __esm({
|
|
|
30837
30837
|
}
|
|
30838
30838
|
});
|
|
30839
30839
|
|
|
30840
|
-
// ../../node_modules/.pnpm/@sveltejs+kit@1.0.0-next.
|
|
30840
|
+
// ../../node_modules/.pnpm/@sveltejs+kit@1.0.0-next.547_svelte@3.52.0+vite@3.2.4/node_modules/@sveltejs/kit/src/exports/index.js
|
|
30841
30841
|
var exports_exports = {};
|
|
30842
30842
|
__export(exports_exports, {
|
|
30843
30843
|
error: () => error2,
|
|
@@ -30849,7 +30849,7 @@ function error2(status, message) {
|
|
|
30849
30849
|
return new HttpError(status, message);
|
|
30850
30850
|
}
|
|
30851
30851
|
function redirect(status, location) {
|
|
30852
|
-
if (isNaN(status) || status < 300 || status >
|
|
30852
|
+
if (isNaN(status) || status < 300 || status > 308) {
|
|
30853
30853
|
throw new Error("Invalid status code");
|
|
30854
30854
|
}
|
|
30855
30855
|
return new Redirect(status, location);
|
|
@@ -30868,7 +30868,7 @@ function invalid(status, data2) {
|
|
|
30868
30868
|
return new ValidationError(status, data2);
|
|
30869
30869
|
}
|
|
30870
30870
|
var init_exports = __esm({
|
|
30871
|
-
"../../node_modules/.pnpm/@sveltejs+kit@1.0.0-next.
|
|
30871
|
+
"../../node_modules/.pnpm/@sveltejs+kit@1.0.0-next.547_svelte@3.52.0+vite@3.2.4/node_modules/@sveltejs/kit/src/exports/index.js"() {
|
|
30872
30872
|
init_control();
|
|
30873
30873
|
}
|
|
30874
30874
|
});
|
|
@@ -88584,22 +88584,31 @@ var ListManager = class {
|
|
|
88584
88584
|
}
|
|
88585
88585
|
lists = /* @__PURE__ */ new Map();
|
|
88586
88586
|
listsByField = /* @__PURE__ */ new Map();
|
|
88587
|
-
get(listName, id2) {
|
|
88587
|
+
get(listName, id2, allLists) {
|
|
88588
88588
|
const matches2 = this.lists.get(listName);
|
|
88589
88589
|
if (!matches2 || matches2.size === 0) {
|
|
88590
88590
|
return null;
|
|
88591
88591
|
}
|
|
88592
|
+
if (allLists) {
|
|
88593
|
+
return new ListCollection(
|
|
88594
|
+
Array.from(matches2, ([key, value2]) => [...value2.lists]).flat()
|
|
88595
|
+
);
|
|
88596
|
+
}
|
|
88592
88597
|
const head = [...matches2.values()][0];
|
|
88598
|
+
const { recordType } = head.lists[0];
|
|
88599
|
+
const parentID = id2 ? this.cache._internal_unstable.id(recordType || "", id2) : this.rootID;
|
|
88593
88600
|
if (matches2?.size === 1) {
|
|
88594
|
-
|
|
88601
|
+
if (!id2) {
|
|
88602
|
+
return head;
|
|
88603
|
+
}
|
|
88604
|
+
return parentID === Array.from(matches2.keys())[0] ? head : null;
|
|
88595
88605
|
}
|
|
88596
88606
|
if (!id2) {
|
|
88597
|
-
|
|
88598
|
-
`Found multiple instances of "${listName}". Please provide
|
|
88607
|
+
console.error(
|
|
88608
|
+
`Found multiple instances of "${listName}". Please provide one of @parentID or @allLists directives to help identify which list you want modify. For more information, visit this guide: https://www.houdinigraphql.com/api/graphql#parentidvalue-string `
|
|
88599
88609
|
);
|
|
88610
|
+
return null;
|
|
88600
88611
|
}
|
|
88601
|
-
const { recordType } = head.lists[0];
|
|
88602
|
-
const parentID = id2 ? this.cache._internal_unstable.id(recordType || "", id2) : this.rootID;
|
|
88603
88612
|
return this.lists.get(listName)?.get(parentID);
|
|
88604
88613
|
}
|
|
88605
88614
|
remove(listName, id2) {
|
|
@@ -89539,8 +89548,8 @@ var Cache2 = class {
|
|
|
89539
89548
|
variables
|
|
89540
89549
|
);
|
|
89541
89550
|
}
|
|
89542
|
-
list(name2, parentID) {
|
|
89543
|
-
const handler = this._internal_unstable.lists.get(name2, parentID);
|
|
89551
|
+
list(name2, parentID, allLists) {
|
|
89552
|
+
const handler = this._internal_unstable.lists.get(name2, parentID, allLists);
|
|
89544
89553
|
if (!handler) {
|
|
89545
89554
|
throw new Error(
|
|
89546
89555
|
`Cannot find list with name: ${name2}${parentID ? " under parent " + parentID : ""}. Is it possible that the query is not mounted?`
|
|
@@ -89807,15 +89816,15 @@ var CacheInternal = class {
|
|
|
89807
89816
|
parentID = id2;
|
|
89808
89817
|
}
|
|
89809
89818
|
}
|
|
89810
|
-
if (operation.list && !this.lists.get(operation.list, parentID)) {
|
|
89819
|
+
if (operation.list && !this.lists.get(operation.list, parentID, operation.target === "all")) {
|
|
89811
89820
|
continue;
|
|
89812
89821
|
}
|
|
89813
89822
|
const targets = Array.isArray(value2) ? value2 : [value2];
|
|
89814
89823
|
for (const target of targets) {
|
|
89815
89824
|
if (operation.action === "insert" && target instanceof Object && fields && operation.list) {
|
|
89816
|
-
this.cache.list(operation.list, parentID).when(operation.when).addToList(fields, target, variables, operation.position || "last");
|
|
89825
|
+
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).addToList(fields, target, variables, operation.position || "last");
|
|
89817
89826
|
} else if (operation.action === "remove" && target instanceof Object && fields && operation.list) {
|
|
89818
|
-
this.cache.list(operation.list, parentID).when(operation.when).remove(target, variables);
|
|
89827
|
+
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).remove(target, variables);
|
|
89819
89828
|
} else if (operation.action === "delete" && operation.type) {
|
|
89820
89829
|
if (typeof target !== "string") {
|
|
89821
89830
|
throw new Error("Cannot delete a record with a non-string ID");
|
|
@@ -89826,7 +89835,7 @@ var CacheInternal = class {
|
|
|
89826
89835
|
}
|
|
89827
89836
|
this.cache.delete(targetID);
|
|
89828
89837
|
} else if (operation.action === "toggle" && target instanceof Object && fields && operation.list) {
|
|
89829
|
-
this.cache.list(operation.list, parentID).when(operation.when).toggleElement(fields, target, variables, operation.position || "last");
|
|
89838
|
+
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).toggleElement(fields, target, variables, operation.position || "last");
|
|
89830
89839
|
}
|
|
89831
89840
|
}
|
|
89832
89841
|
}
|
|
@@ -151647,22 +151656,31 @@ var ListManager2 = class {
|
|
|
151647
151656
|
}
|
|
151648
151657
|
lists = /* @__PURE__ */ new Map();
|
|
151649
151658
|
listsByField = /* @__PURE__ */ new Map();
|
|
151650
|
-
get(listName, id2) {
|
|
151659
|
+
get(listName, id2, allLists) {
|
|
151651
151660
|
const matches2 = this.lists.get(listName);
|
|
151652
151661
|
if (!matches2 || matches2.size === 0) {
|
|
151653
151662
|
return null;
|
|
151654
151663
|
}
|
|
151664
|
+
if (allLists) {
|
|
151665
|
+
return new ListCollection2(
|
|
151666
|
+
Array.from(matches2, ([key, value2]) => [...value2.lists]).flat()
|
|
151667
|
+
);
|
|
151668
|
+
}
|
|
151655
151669
|
const head = [...matches2.values()][0];
|
|
151670
|
+
const { recordType } = head.lists[0];
|
|
151671
|
+
const parentID = id2 ? this.cache._internal_unstable.id(recordType || "", id2) : this.rootID;
|
|
151656
151672
|
if (matches2?.size === 1) {
|
|
151657
|
-
|
|
151673
|
+
if (!id2) {
|
|
151674
|
+
return head;
|
|
151675
|
+
}
|
|
151676
|
+
return parentID === Array.from(matches2.keys())[0] ? head : null;
|
|
151658
151677
|
}
|
|
151659
151678
|
if (!id2) {
|
|
151660
|
-
|
|
151661
|
-
`Found multiple instances of "${listName}". Please provide
|
|
151679
|
+
console.error(
|
|
151680
|
+
`Found multiple instances of "${listName}". Please provide one of @parentID or @allLists directives to help identify which list you want modify. For more information, visit this guide: https://www.houdinigraphql.com/api/graphql#parentidvalue-string `
|
|
151662
151681
|
);
|
|
151682
|
+
return null;
|
|
151663
151683
|
}
|
|
151664
|
-
const { recordType } = head.lists[0];
|
|
151665
|
-
const parentID = id2 ? this.cache._internal_unstable.id(recordType || "", id2) : this.rootID;
|
|
151666
151684
|
return this.lists.get(listName)?.get(parentID);
|
|
151667
151685
|
}
|
|
151668
151686
|
remove(listName, id2) {
|
|
@@ -152602,8 +152620,8 @@ var Cache22 = class {
|
|
|
152602
152620
|
variables
|
|
152603
152621
|
);
|
|
152604
152622
|
}
|
|
152605
|
-
list(name2, parentID) {
|
|
152606
|
-
const handler = this._internal_unstable.lists.get(name2, parentID);
|
|
152623
|
+
list(name2, parentID, allLists) {
|
|
152624
|
+
const handler = this._internal_unstable.lists.get(name2, parentID, allLists);
|
|
152607
152625
|
if (!handler) {
|
|
152608
152626
|
throw new Error(
|
|
152609
152627
|
`Cannot find list with name: ${name2}${parentID ? " under parent " + parentID : ""}. Is it possible that the query is not mounted?`
|
|
@@ -152870,15 +152888,15 @@ var CacheInternal2 = class {
|
|
|
152870
152888
|
parentID = id2;
|
|
152871
152889
|
}
|
|
152872
152890
|
}
|
|
152873
|
-
if (operation.list && !this.lists.get(operation.list, parentID)) {
|
|
152891
|
+
if (operation.list && !this.lists.get(operation.list, parentID, operation.target === "all")) {
|
|
152874
152892
|
continue;
|
|
152875
152893
|
}
|
|
152876
152894
|
const targets = Array.isArray(value2) ? value2 : [value2];
|
|
152877
152895
|
for (const target of targets) {
|
|
152878
152896
|
if (operation.action === "insert" && target instanceof Object && fields && operation.list) {
|
|
152879
|
-
this.cache.list(operation.list, parentID).when(operation.when).addToList(fields, target, variables, operation.position || "last");
|
|
152897
|
+
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).addToList(fields, target, variables, operation.position || "last");
|
|
152880
152898
|
} else if (operation.action === "remove" && target instanceof Object && fields && operation.list) {
|
|
152881
|
-
this.cache.list(operation.list, parentID).when(operation.when).remove(target, variables);
|
|
152899
|
+
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).remove(target, variables);
|
|
152882
152900
|
} else if (operation.action === "delete" && operation.type) {
|
|
152883
152901
|
if (typeof target !== "string") {
|
|
152884
152902
|
throw new Error("Cannot delete a record with a non-string ID");
|
|
@@ -152889,7 +152907,7 @@ var CacheInternal2 = class {
|
|
|
152889
152907
|
}
|
|
152890
152908
|
this.cache.delete(targetID);
|
|
152891
152909
|
} else if (operation.action === "toggle" && target instanceof Object && fields && operation.list) {
|
|
152892
|
-
this.cache.list(operation.list, parentID).when(operation.when).toggleElement(fields, target, variables, operation.position || "last");
|
|
152910
|
+
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).toggleElement(fields, target, variables, operation.position || "last");
|
|
152893
152911
|
}
|
|
152894
152912
|
}
|
|
152895
152913
|
}
|
|
@@ -30808,10 +30808,10 @@ var require_main5 = __commonJS({
|
|
|
30808
30808
|
}
|
|
30809
30809
|
});
|
|
30810
30810
|
|
|
30811
|
-
// ../../node_modules/.pnpm/@sveltejs+kit@1.0.0-next.
|
|
30811
|
+
// ../../node_modules/.pnpm/@sveltejs+kit@1.0.0-next.547_svelte@3.52.0+vite@3.2.4/node_modules/@sveltejs/kit/src/runtime/control.js
|
|
30812
30812
|
var HttpError, Redirect, ValidationError;
|
|
30813
30813
|
var init_control = __esm({
|
|
30814
|
-
"../../node_modules/.pnpm/@sveltejs+kit@1.0.0-next.
|
|
30814
|
+
"../../node_modules/.pnpm/@sveltejs+kit@1.0.0-next.547_svelte@3.52.0+vite@3.2.4/node_modules/@sveltejs/kit/src/runtime/control.js"() {
|
|
30815
30815
|
HttpError = class {
|
|
30816
30816
|
constructor(status, body) {
|
|
30817
30817
|
this.status = status;
|
|
@@ -30842,7 +30842,7 @@ var init_control = __esm({
|
|
|
30842
30842
|
}
|
|
30843
30843
|
});
|
|
30844
30844
|
|
|
30845
|
-
// ../../node_modules/.pnpm/@sveltejs+kit@1.0.0-next.
|
|
30845
|
+
// ../../node_modules/.pnpm/@sveltejs+kit@1.0.0-next.547_svelte@3.52.0+vite@3.2.4/node_modules/@sveltejs/kit/src/exports/index.js
|
|
30846
30846
|
var exports_exports = {};
|
|
30847
30847
|
__export(exports_exports, {
|
|
30848
30848
|
error: () => error2,
|
|
@@ -30854,7 +30854,7 @@ function error2(status, message) {
|
|
|
30854
30854
|
return new HttpError(status, message);
|
|
30855
30855
|
}
|
|
30856
30856
|
function redirect(status, location) {
|
|
30857
|
-
if (isNaN(status) || status < 300 || status >
|
|
30857
|
+
if (isNaN(status) || status < 300 || status > 308) {
|
|
30858
30858
|
throw new Error("Invalid status code");
|
|
30859
30859
|
}
|
|
30860
30860
|
return new Redirect(status, location);
|
|
@@ -30873,7 +30873,7 @@ function invalid(status, data2) {
|
|
|
30873
30873
|
return new ValidationError(status, data2);
|
|
30874
30874
|
}
|
|
30875
30875
|
var init_exports = __esm({
|
|
30876
|
-
"../../node_modules/.pnpm/@sveltejs+kit@1.0.0-next.
|
|
30876
|
+
"../../node_modules/.pnpm/@sveltejs+kit@1.0.0-next.547_svelte@3.52.0+vite@3.2.4/node_modules/@sveltejs/kit/src/exports/index.js"() {
|
|
30877
30877
|
init_control();
|
|
30878
30878
|
}
|
|
30879
30879
|
});
|
|
@@ -88581,22 +88581,31 @@ var ListManager = class {
|
|
|
88581
88581
|
}
|
|
88582
88582
|
lists = /* @__PURE__ */ new Map();
|
|
88583
88583
|
listsByField = /* @__PURE__ */ new Map();
|
|
88584
|
-
get(listName, id2) {
|
|
88584
|
+
get(listName, id2, allLists) {
|
|
88585
88585
|
const matches2 = this.lists.get(listName);
|
|
88586
88586
|
if (!matches2 || matches2.size === 0) {
|
|
88587
88587
|
return null;
|
|
88588
88588
|
}
|
|
88589
|
+
if (allLists) {
|
|
88590
|
+
return new ListCollection(
|
|
88591
|
+
Array.from(matches2, ([key, value2]) => [...value2.lists]).flat()
|
|
88592
|
+
);
|
|
88593
|
+
}
|
|
88589
88594
|
const head = [...matches2.values()][0];
|
|
88595
|
+
const { recordType } = head.lists[0];
|
|
88596
|
+
const parentID = id2 ? this.cache._internal_unstable.id(recordType || "", id2) : this.rootID;
|
|
88590
88597
|
if (matches2?.size === 1) {
|
|
88591
|
-
|
|
88598
|
+
if (!id2) {
|
|
88599
|
+
return head;
|
|
88600
|
+
}
|
|
88601
|
+
return parentID === Array.from(matches2.keys())[0] ? head : null;
|
|
88592
88602
|
}
|
|
88593
88603
|
if (!id2) {
|
|
88594
|
-
|
|
88595
|
-
`Found multiple instances of "${listName}". Please provide
|
|
88604
|
+
console.error(
|
|
88605
|
+
`Found multiple instances of "${listName}". Please provide one of @parentID or @allLists directives to help identify which list you want modify. For more information, visit this guide: https://www.houdinigraphql.com/api/graphql#parentidvalue-string `
|
|
88596
88606
|
);
|
|
88607
|
+
return null;
|
|
88597
88608
|
}
|
|
88598
|
-
const { recordType } = head.lists[0];
|
|
88599
|
-
const parentID = id2 ? this.cache._internal_unstable.id(recordType || "", id2) : this.rootID;
|
|
88600
88609
|
return this.lists.get(listName)?.get(parentID);
|
|
88601
88610
|
}
|
|
88602
88611
|
remove(listName, id2) {
|
|
@@ -89536,8 +89545,8 @@ var Cache2 = class {
|
|
|
89536
89545
|
variables
|
|
89537
89546
|
);
|
|
89538
89547
|
}
|
|
89539
|
-
list(name2, parentID) {
|
|
89540
|
-
const handler = this._internal_unstable.lists.get(name2, parentID);
|
|
89548
|
+
list(name2, parentID, allLists) {
|
|
89549
|
+
const handler = this._internal_unstable.lists.get(name2, parentID, allLists);
|
|
89541
89550
|
if (!handler) {
|
|
89542
89551
|
throw new Error(
|
|
89543
89552
|
`Cannot find list with name: ${name2}${parentID ? " under parent " + parentID : ""}. Is it possible that the query is not mounted?`
|
|
@@ -89804,15 +89813,15 @@ var CacheInternal = class {
|
|
|
89804
89813
|
parentID = id2;
|
|
89805
89814
|
}
|
|
89806
89815
|
}
|
|
89807
|
-
if (operation.list && !this.lists.get(operation.list, parentID)) {
|
|
89816
|
+
if (operation.list && !this.lists.get(operation.list, parentID, operation.target === "all")) {
|
|
89808
89817
|
continue;
|
|
89809
89818
|
}
|
|
89810
89819
|
const targets = Array.isArray(value2) ? value2 : [value2];
|
|
89811
89820
|
for (const target of targets) {
|
|
89812
89821
|
if (operation.action === "insert" && target instanceof Object && fields && operation.list) {
|
|
89813
|
-
this.cache.list(operation.list, parentID).when(operation.when).addToList(fields, target, variables, operation.position || "last");
|
|
89822
|
+
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).addToList(fields, target, variables, operation.position || "last");
|
|
89814
89823
|
} else if (operation.action === "remove" && target instanceof Object && fields && operation.list) {
|
|
89815
|
-
this.cache.list(operation.list, parentID).when(operation.when).remove(target, variables);
|
|
89824
|
+
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).remove(target, variables);
|
|
89816
89825
|
} else if (operation.action === "delete" && operation.type) {
|
|
89817
89826
|
if (typeof target !== "string") {
|
|
89818
89827
|
throw new Error("Cannot delete a record with a non-string ID");
|
|
@@ -89823,7 +89832,7 @@ var CacheInternal = class {
|
|
|
89823
89832
|
}
|
|
89824
89833
|
this.cache.delete(targetID);
|
|
89825
89834
|
} else if (operation.action === "toggle" && target instanceof Object && fields && operation.list) {
|
|
89826
|
-
this.cache.list(operation.list, parentID).when(operation.when).toggleElement(fields, target, variables, operation.position || "last");
|
|
89835
|
+
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).toggleElement(fields, target, variables, operation.position || "last");
|
|
89827
89836
|
}
|
|
89828
89837
|
}
|
|
89829
89838
|
}
|
|
@@ -151643,22 +151652,31 @@ var ListManager2 = class {
|
|
|
151643
151652
|
}
|
|
151644
151653
|
lists = /* @__PURE__ */ new Map();
|
|
151645
151654
|
listsByField = /* @__PURE__ */ new Map();
|
|
151646
|
-
get(listName, id2) {
|
|
151655
|
+
get(listName, id2, allLists) {
|
|
151647
151656
|
const matches2 = this.lists.get(listName);
|
|
151648
151657
|
if (!matches2 || matches2.size === 0) {
|
|
151649
151658
|
return null;
|
|
151650
151659
|
}
|
|
151660
|
+
if (allLists) {
|
|
151661
|
+
return new ListCollection2(
|
|
151662
|
+
Array.from(matches2, ([key, value2]) => [...value2.lists]).flat()
|
|
151663
|
+
);
|
|
151664
|
+
}
|
|
151651
151665
|
const head = [...matches2.values()][0];
|
|
151666
|
+
const { recordType } = head.lists[0];
|
|
151667
|
+
const parentID = id2 ? this.cache._internal_unstable.id(recordType || "", id2) : this.rootID;
|
|
151652
151668
|
if (matches2?.size === 1) {
|
|
151653
|
-
|
|
151669
|
+
if (!id2) {
|
|
151670
|
+
return head;
|
|
151671
|
+
}
|
|
151672
|
+
return parentID === Array.from(matches2.keys())[0] ? head : null;
|
|
151654
151673
|
}
|
|
151655
151674
|
if (!id2) {
|
|
151656
|
-
|
|
151657
|
-
`Found multiple instances of "${listName}". Please provide
|
|
151675
|
+
console.error(
|
|
151676
|
+
`Found multiple instances of "${listName}". Please provide one of @parentID or @allLists directives to help identify which list you want modify. For more information, visit this guide: https://www.houdinigraphql.com/api/graphql#parentidvalue-string `
|
|
151658
151677
|
);
|
|
151678
|
+
return null;
|
|
151659
151679
|
}
|
|
151660
|
-
const { recordType } = head.lists[0];
|
|
151661
|
-
const parentID = id2 ? this.cache._internal_unstable.id(recordType || "", id2) : this.rootID;
|
|
151662
151680
|
return this.lists.get(listName)?.get(parentID);
|
|
151663
151681
|
}
|
|
151664
151682
|
remove(listName, id2) {
|
|
@@ -152598,8 +152616,8 @@ var Cache22 = class {
|
|
|
152598
152616
|
variables
|
|
152599
152617
|
);
|
|
152600
152618
|
}
|
|
152601
|
-
list(name2, parentID) {
|
|
152602
|
-
const handler = this._internal_unstable.lists.get(name2, parentID);
|
|
152619
|
+
list(name2, parentID, allLists) {
|
|
152620
|
+
const handler = this._internal_unstable.lists.get(name2, parentID, allLists);
|
|
152603
152621
|
if (!handler) {
|
|
152604
152622
|
throw new Error(
|
|
152605
152623
|
`Cannot find list with name: ${name2}${parentID ? " under parent " + parentID : ""}. Is it possible that the query is not mounted?`
|
|
@@ -152866,15 +152884,15 @@ var CacheInternal2 = class {
|
|
|
152866
152884
|
parentID = id2;
|
|
152867
152885
|
}
|
|
152868
152886
|
}
|
|
152869
|
-
if (operation.list && !this.lists.get(operation.list, parentID)) {
|
|
152887
|
+
if (operation.list && !this.lists.get(operation.list, parentID, operation.target === "all")) {
|
|
152870
152888
|
continue;
|
|
152871
152889
|
}
|
|
152872
152890
|
const targets = Array.isArray(value2) ? value2 : [value2];
|
|
152873
152891
|
for (const target of targets) {
|
|
152874
152892
|
if (operation.action === "insert" && target instanceof Object && fields && operation.list) {
|
|
152875
|
-
this.cache.list(operation.list, parentID).when(operation.when).addToList(fields, target, variables, operation.position || "last");
|
|
152893
|
+
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).addToList(fields, target, variables, operation.position || "last");
|
|
152876
152894
|
} else if (operation.action === "remove" && target instanceof Object && fields && operation.list) {
|
|
152877
|
-
this.cache.list(operation.list, parentID).when(operation.when).remove(target, variables);
|
|
152895
|
+
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).remove(target, variables);
|
|
152878
152896
|
} else if (operation.action === "delete" && operation.type) {
|
|
152879
152897
|
if (typeof target !== "string") {
|
|
152880
152898
|
throw new Error("Cannot delete a record with a non-string ID");
|
|
@@ -152885,7 +152903,7 @@ var CacheInternal2 = class {
|
|
|
152885
152903
|
}
|
|
152886
152904
|
this.cache.delete(targetID);
|
|
152887
152905
|
} else if (operation.action === "toggle" && target instanceof Object && fields && operation.list) {
|
|
152888
|
-
this.cache.list(operation.list, parentID).when(operation.when).toggleElement(fields, target, variables, operation.position || "last");
|
|
152906
|
+
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).toggleElement(fields, target, variables, operation.position || "last");
|
|
152889
152907
|
}
|
|
152890
152908
|
}
|
|
152891
152909
|
}
|
|
@@ -91246,22 +91246,31 @@ var ListManager = class {
|
|
|
91246
91246
|
}
|
|
91247
91247
|
lists = /* @__PURE__ */ new Map();
|
|
91248
91248
|
listsByField = /* @__PURE__ */ new Map();
|
|
91249
|
-
get(listName, id2) {
|
|
91249
|
+
get(listName, id2, allLists) {
|
|
91250
91250
|
const matches2 = this.lists.get(listName);
|
|
91251
91251
|
if (!matches2 || matches2.size === 0) {
|
|
91252
91252
|
return null;
|
|
91253
91253
|
}
|
|
91254
|
+
if (allLists) {
|
|
91255
|
+
return new ListCollection(
|
|
91256
|
+
Array.from(matches2, ([key, value2]) => [...value2.lists]).flat()
|
|
91257
|
+
);
|
|
91258
|
+
}
|
|
91254
91259
|
const head = [...matches2.values()][0];
|
|
91260
|
+
const { recordType } = head.lists[0];
|
|
91261
|
+
const parentID = id2 ? this.cache._internal_unstable.id(recordType || "", id2) : this.rootID;
|
|
91255
91262
|
if (matches2?.size === 1) {
|
|
91256
|
-
|
|
91263
|
+
if (!id2) {
|
|
91264
|
+
return head;
|
|
91265
|
+
}
|
|
91266
|
+
return parentID === Array.from(matches2.keys())[0] ? head : null;
|
|
91257
91267
|
}
|
|
91258
91268
|
if (!id2) {
|
|
91259
|
-
|
|
91260
|
-
`Found multiple instances of "${listName}". Please provide
|
|
91269
|
+
console.error(
|
|
91270
|
+
`Found multiple instances of "${listName}". Please provide one of @parentID or @allLists directives to help identify which list you want modify. For more information, visit this guide: https://www.houdinigraphql.com/api/graphql#parentidvalue-string `
|
|
91261
91271
|
);
|
|
91272
|
+
return null;
|
|
91262
91273
|
}
|
|
91263
|
-
const { recordType } = head.lists[0];
|
|
91264
|
-
const parentID = id2 ? this.cache._internal_unstable.id(recordType || "", id2) : this.rootID;
|
|
91265
91274
|
return this.lists.get(listName)?.get(parentID);
|
|
91266
91275
|
}
|
|
91267
91276
|
remove(listName, id2) {
|
|
@@ -92201,8 +92210,8 @@ var Cache2 = class {
|
|
|
92201
92210
|
variables
|
|
92202
92211
|
);
|
|
92203
92212
|
}
|
|
92204
|
-
list(name2, parentID) {
|
|
92205
|
-
const handler = this._internal_unstable.lists.get(name2, parentID);
|
|
92213
|
+
list(name2, parentID, allLists) {
|
|
92214
|
+
const handler = this._internal_unstable.lists.get(name2, parentID, allLists);
|
|
92206
92215
|
if (!handler) {
|
|
92207
92216
|
throw new Error(
|
|
92208
92217
|
`Cannot find list with name: ${name2}${parentID ? " under parent " + parentID : ""}. Is it possible that the query is not mounted?`
|
|
@@ -92469,15 +92478,15 @@ var CacheInternal = class {
|
|
|
92469
92478
|
parentID = id2;
|
|
92470
92479
|
}
|
|
92471
92480
|
}
|
|
92472
|
-
if (operation.list && !this.lists.get(operation.list, parentID)) {
|
|
92481
|
+
if (operation.list && !this.lists.get(operation.list, parentID, operation.target === "all")) {
|
|
92473
92482
|
continue;
|
|
92474
92483
|
}
|
|
92475
92484
|
const targets = Array.isArray(value2) ? value2 : [value2];
|
|
92476
92485
|
for (const target of targets) {
|
|
92477
92486
|
if (operation.action === "insert" && target instanceof Object && fields && operation.list) {
|
|
92478
|
-
this.cache.list(operation.list, parentID).when(operation.when).addToList(fields, target, variables, operation.position || "last");
|
|
92487
|
+
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).addToList(fields, target, variables, operation.position || "last");
|
|
92479
92488
|
} else if (operation.action === "remove" && target instanceof Object && fields && operation.list) {
|
|
92480
|
-
this.cache.list(operation.list, parentID).when(operation.when).remove(target, variables);
|
|
92489
|
+
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).remove(target, variables);
|
|
92481
92490
|
} else if (operation.action === "delete" && operation.type) {
|
|
92482
92491
|
if (typeof target !== "string") {
|
|
92483
92492
|
throw new Error("Cannot delete a record with a non-string ID");
|
|
@@ -92488,7 +92497,7 @@ var CacheInternal = class {
|
|
|
92488
92497
|
}
|
|
92489
92498
|
this.cache.delete(targetID);
|
|
92490
92499
|
} else if (operation.action === "toggle" && target instanceof Object && fields && operation.list) {
|
|
92491
|
-
this.cache.list(operation.list, parentID).when(operation.when).toggleElement(fields, target, variables, operation.position || "last");
|
|
92500
|
+
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).toggleElement(fields, target, variables, operation.position || "last");
|
|
92492
92501
|
}
|
|
92493
92502
|
}
|
|
92494
92503
|
}
|
|
@@ -94212,6 +94221,8 @@ var Config = class {
|
|
|
94212
94221
|
cacheBufferSize;
|
|
94213
94222
|
defaultCachePolicy;
|
|
94214
94223
|
defaultPartial;
|
|
94224
|
+
internalListPosition;
|
|
94225
|
+
defaultListTarget = null;
|
|
94215
94226
|
definitionsFolder;
|
|
94216
94227
|
newSchema = "";
|
|
94217
94228
|
newDocuments = "";
|
|
@@ -94243,6 +94254,8 @@ var Config = class {
|
|
|
94243
94254
|
definitionsPath,
|
|
94244
94255
|
defaultCachePolicy = "CacheOrNetwork",
|
|
94245
94256
|
defaultPartial = false,
|
|
94257
|
+
defaultListPosition = "append",
|
|
94258
|
+
defaultListTarget = null,
|
|
94246
94259
|
defaultKeys,
|
|
94247
94260
|
types: types42 = {},
|
|
94248
94261
|
logLevel,
|
|
@@ -94276,6 +94289,8 @@ var Config = class {
|
|
|
94276
94289
|
this.cacheBufferSize = cacheBufferSize;
|
|
94277
94290
|
this.defaultCachePolicy = defaultCachePolicy;
|
|
94278
94291
|
this.defaultPartial = defaultPartial;
|
|
94292
|
+
this.internalListPosition = defaultListPosition === "append" ? "last" : "first";
|
|
94293
|
+
this.defaultListTarget == defaultListTarget;
|
|
94279
94294
|
this.definitionsFolder = definitionsPath;
|
|
94280
94295
|
this.logLevel = (logLevel || LogLevel.Summary).toLowerCase();
|
|
94281
94296
|
this.disableMasking = disableMasking;
|
|
@@ -94490,6 +94505,9 @@ var Config = class {
|
|
|
94490
94505
|
get listDirectiveParentIDArg() {
|
|
94491
94506
|
return "parentID";
|
|
94492
94507
|
}
|
|
94508
|
+
get listAllListsDirective() {
|
|
94509
|
+
return "allLists";
|
|
94510
|
+
}
|
|
94493
94511
|
get listNameArg() {
|
|
94494
94512
|
return "name";
|
|
94495
94513
|
}
|
|
@@ -94571,6 +94589,7 @@ var Config = class {
|
|
|
94571
94589
|
this.listPrependDirective,
|
|
94572
94590
|
this.listAppendDirective,
|
|
94573
94591
|
this.listDirectiveParentIDArg,
|
|
94592
|
+
this.listAllListsDirective,
|
|
94574
94593
|
this.whenDirective,
|
|
94575
94594
|
this.whenNotDirective,
|
|
94576
94595
|
this.argumentsDirective,
|
|
@@ -180465,22 +180484,31 @@ var ListManager2 = class {
|
|
|
180465
180484
|
}
|
|
180466
180485
|
lists = /* @__PURE__ */ new Map();
|
|
180467
180486
|
listsByField = /* @__PURE__ */ new Map();
|
|
180468
|
-
get(listName, id2) {
|
|
180487
|
+
get(listName, id2, allLists) {
|
|
180469
180488
|
const matches2 = this.lists.get(listName);
|
|
180470
180489
|
if (!matches2 || matches2.size === 0) {
|
|
180471
180490
|
return null;
|
|
180472
180491
|
}
|
|
180492
|
+
if (allLists) {
|
|
180493
|
+
return new ListCollection2(
|
|
180494
|
+
Array.from(matches2, ([key, value2]) => [...value2.lists]).flat()
|
|
180495
|
+
);
|
|
180496
|
+
}
|
|
180473
180497
|
const head = [...matches2.values()][0];
|
|
180498
|
+
const { recordType } = head.lists[0];
|
|
180499
|
+
const parentID = id2 ? this.cache._internal_unstable.id(recordType || "", id2) : this.rootID;
|
|
180474
180500
|
if (matches2?.size === 1) {
|
|
180475
|
-
|
|
180501
|
+
if (!id2) {
|
|
180502
|
+
return head;
|
|
180503
|
+
}
|
|
180504
|
+
return parentID === Array.from(matches2.keys())[0] ? head : null;
|
|
180476
180505
|
}
|
|
180477
180506
|
if (!id2) {
|
|
180478
|
-
|
|
180479
|
-
`Found multiple instances of "${listName}". Please provide
|
|
180507
|
+
console.error(
|
|
180508
|
+
`Found multiple instances of "${listName}". Please provide one of @parentID or @allLists directives to help identify which list you want modify. For more information, visit this guide: https://www.houdinigraphql.com/api/graphql#parentidvalue-string `
|
|
180480
180509
|
);
|
|
180510
|
+
return null;
|
|
180481
180511
|
}
|
|
180482
|
-
const { recordType } = head.lists[0];
|
|
180483
|
-
const parentID = id2 ? this.cache._internal_unstable.id(recordType || "", id2) : this.rootID;
|
|
180484
180512
|
return this.lists.get(listName)?.get(parentID);
|
|
180485
180513
|
}
|
|
180486
180514
|
remove(listName, id2) {
|
|
@@ -181420,8 +181448,8 @@ var Cache22 = class {
|
|
|
181420
181448
|
variables
|
|
181421
181449
|
);
|
|
181422
181450
|
}
|
|
181423
|
-
list(name2, parentID) {
|
|
181424
|
-
const handler = this._internal_unstable.lists.get(name2, parentID);
|
|
181451
|
+
list(name2, parentID, allLists) {
|
|
181452
|
+
const handler = this._internal_unstable.lists.get(name2, parentID, allLists);
|
|
181425
181453
|
if (!handler) {
|
|
181426
181454
|
throw new Error(
|
|
181427
181455
|
`Cannot find list with name: ${name2}${parentID ? " under parent " + parentID : ""}. Is it possible that the query is not mounted?`
|
|
@@ -181688,15 +181716,15 @@ var CacheInternal2 = class {
|
|
|
181688
181716
|
parentID = id2;
|
|
181689
181717
|
}
|
|
181690
181718
|
}
|
|
181691
|
-
if (operation.list && !this.lists.get(operation.list, parentID)) {
|
|
181719
|
+
if (operation.list && !this.lists.get(operation.list, parentID, operation.target === "all")) {
|
|
181692
181720
|
continue;
|
|
181693
181721
|
}
|
|
181694
181722
|
const targets = Array.isArray(value2) ? value2 : [value2];
|
|
181695
181723
|
for (const target of targets) {
|
|
181696
181724
|
if (operation.action === "insert" && target instanceof Object && fields && operation.list) {
|
|
181697
|
-
this.cache.list(operation.list, parentID).when(operation.when).addToList(fields, target, variables, operation.position || "last");
|
|
181725
|
+
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).addToList(fields, target, variables, operation.position || "last");
|
|
181698
181726
|
} else if (operation.action === "remove" && target instanceof Object && fields && operation.list) {
|
|
181699
|
-
this.cache.list(operation.list, parentID).when(operation.when).remove(target, variables);
|
|
181727
|
+
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).remove(target, variables);
|
|
181700
181728
|
} else if (operation.action === "delete" && operation.type) {
|
|
181701
181729
|
if (typeof target !== "string") {
|
|
181702
181730
|
throw new Error("Cannot delete a record with a non-string ID");
|
|
@@ -181707,7 +181735,7 @@ var CacheInternal2 = class {
|
|
|
181707
181735
|
}
|
|
181708
181736
|
this.cache.delete(targetID);
|
|
181709
181737
|
} else if (operation.action === "toggle" && target instanceof Object && fields && operation.list) {
|
|
181710
|
-
this.cache.list(operation.list, parentID).when(operation.when).toggleElement(fields, target, variables, operation.position || "last");
|
|
181738
|
+
this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).toggleElement(fields, target, variables, operation.position || "last");
|
|
181711
181739
|
}
|
|
181712
181740
|
}
|
|
181713
181741
|
}
|