@camstack/addon-pipeline-orchestrator 0.1.17 → 0.1.18
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/dist/@mf-types.zip +0 -0
- package/dist/ReactKonva-JXCACcqD.mjs +7267 -0
- package/dist/_CoreInternals-B7PHssO3.mjs +3808 -0
- package/dist/__mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_camstack_mf_1_sdk__loadShare__.mjs-h5aXOPSA.mjs +12 -0
- package/dist/__mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.mjs-UNj4rttw.mjs +20 -0
- package/dist/__mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.mjs-XtEtGou1.mjs +34 -0
- package/dist/__mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.mjs-DoWbefqS.mjs +104 -0
- package/dist/__mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_trpc_mf_1_client__loadShare__.mjs-D4eEXltm.mjs +85 -0
- package/dist/__mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.mjs-CVrnrGED.mjs +62 -0
- package/dist/__mfe_internal__addon_pipeline_orchestrator_widgets__loadShare__konva__loadShare__.mjs-F783v1sm.mjs +8 -0
- package/dist/__mfe_internal__addon_pipeline_orchestrator_widgets__loadShare__react__loadShare__.mjs-0qpbQxoV.mjs +88 -0
- package/dist/__mfe_internal__addon_pipeline_orchestrator_widgets__loadShare__react__loadShare__.mjs_commonjs-proxy-DekuE8px.mjs +29 -0
- package/dist/__mfe_internal__addon_pipeline_orchestrator_widgets__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.mjs-Cg6QsnjR.mjs +36 -0
- package/dist/__mfe_internal__addon_pipeline_orchestrator_widgets__loadShare__react_mf_2_dom__loadShare__.mjs-Dp8hqYOB.mjs +45 -0
- package/dist/__mfe_internal__addon_pipeline_orchestrator_widgets__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-Ba_7PYkj.mjs +6 -0
- package/dist/__mfe_internal__addon_pipeline_orchestrator_widgets__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs-BBmNf5hf.mjs +34 -0
- package/dist/__mfe_internal__addon_pipeline_orchestrator_widgets__loadShare__react_mf_2_konva__loadShare__.mjs-CJUQOcTE.mjs +18 -0
- package/dist/_stub.js +1047 -21451
- package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_orchestrator_widgets-D4U9-5a3.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_orchestrator_widgets-GASHflbS.mjs} +75 -66
- package/dist/client-CzjQ3uuI.mjs +9836 -0
- package/dist/getErrorShape-BPSzUA7W-TlK8ipWe.mjs +211 -0
- package/dist/hostInit-B0XiFU2K.mjs +196 -0
- package/dist/index-BD2XShwZ.mjs +20965 -0
- package/dist/index-BIlr4dIX.mjs +1655 -0
- package/dist/index-BP1Nti7b.mjs +13431 -0
- package/dist/index-C1DnrJuR.mjs +2603 -0
- package/dist/index-C52WDzRJ.mjs +3842 -0
- package/dist/index-CWkKuNLr.mjs +232 -0
- package/dist/index-Cbqs9uJn.mjs +725 -0
- package/dist/index-DOuehnyb.mjs +185 -0
- package/dist/index-DaulYonp.mjs +435 -0
- package/dist/index-xncRG7-x.mjs +2713 -0
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -1
- package/dist/index.mjs.map +1 -1
- package/dist/jsx-runtime-DACJhJOv.mjs +55 -0
- package/dist/remoteEntry.js +2327 -3351
- package/dist/schemas-ChN4Ih0h.mjs +3584 -0
- package/dist/virtualExposes-8FzWTdq3.mjs +42 -0
- package/package.json +1 -1
- package/dist/__mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_camstack_mf_1_sdk__loadShare__.mjs-Dn6pffG6.mjs +0 -14
- package/dist/__mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.mjs-DrteYOPu.mjs +0 -22
- package/dist/__mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.mjs-DfNJpPfu.mjs +0 -36
- package/dist/__mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.mjs-CaQq3kr4.mjs +0 -112
- package/dist/__mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_trpc_mf_1_client__loadShare__.mjs-DhUh9Qzt.mjs +0 -93
- package/dist/__mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.mjs-DOHfklLX.mjs +0 -70
- package/dist/__mfe_internal__addon_pipeline_orchestrator_widgets__loadShare__react__loadShare__.mjs-BX5snCRm.mjs +0 -96
- package/dist/__mfe_internal__addon_pipeline_orchestrator_widgets__loadShare__react__loadShare__.mjs_commonjs-proxy-Bg2N8TAe.mjs +0 -34
- package/dist/__mfe_internal__addon_pipeline_orchestrator_widgets__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.mjs-CO0PugXp.mjs +0 -44
- package/dist/__mfe_internal__addon_pipeline_orchestrator_widgets__loadShare__react_mf_2_dom__loadShare__.mjs-Cqpb8kvp.mjs +0 -53
- package/dist/__mfe_internal__addon_pipeline_orchestrator_widgets__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-DnIwYUrp.mjs +0 -6
- package/dist/__mfe_internal__addon_pipeline_orchestrator_widgets__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs-Iv-aGQ4k.mjs +0 -42
- package/dist/client-TtgJQfbd.mjs +0 -11569
- package/dist/getErrorShape-BPSzUA7W-D5KpHcIj.mjs +0 -244
- package/dist/hostInit-C89SX6z4.mjs +0 -198
- package/dist/index-0-mfXOlq.mjs +0 -899
- package/dist/index-BKVjF_OI.mjs +0 -14804
- package/dist/index-BN2rV_KJ.mjs +0 -463
- package/dist/index-BepH9mzJ.mjs +0 -3536
- package/dist/index-BxLvm_gu.mjs +0 -267
- package/dist/index-CVOLs7Aq.mjs +0 -24402
- package/dist/index-Cfo7sGh_.mjs +0 -2054
- package/dist/index-CrGKNQoE.mjs +0 -3260
- package/dist/index-sCAUpX2M.mjs +0 -197
- package/dist/jsx-runtime-D2w1zDMK.mjs +0 -67
- package/dist/schemas-DihhZLrP.mjs +0 -5087
- package/dist/virtualExposes-D_9EJnra.mjs +0 -59
package/dist/index-0-mfXOlq.mjs
DELETED
|
@@ -1,899 +0,0 @@
|
|
|
1
|
-
import { a as __mf_53, b as __mf_7, c as __mf_5, d as __mf_20, e as __mf_14, f as __mf_8, g as __mf_40, h as __mf_12, i as __mf_21, j as __mf_16, k as __mf_22, l as __mf_15, _ as __mf_17 } from "./__mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.mjs-CaQq3kr4.mjs";
|
|
2
|
-
import { i as isObject, h as isAsyncIterable, d as createRecursiveProxy, f as createFlatProxy } from "./getErrorShape-BPSzUA7W-D5KpHcIj.mjs";
|
|
3
|
-
import { _ as __mf_1, a as __mf_10, b as __mf_3, c as __mf_4, d as __moduleExports } from "./__mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_trpc_mf_1_client__loadShare__.mjs-DhUh9Qzt.mjs";
|
|
4
|
-
import { e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A } from "./__mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_trpc_mf_1_client__loadShare__.mjs-DhUh9Qzt.mjs";
|
|
5
|
-
import { l as __mf_37, e as __mf_28, d as __mf_38, m as __mf_24, h as __mf_25, c as __mf_34, j as __mf_13, _ as __mfHostReact } from "./__mfe_internal__addon_pipeline_orchestrator_widgets__loadShare__react__loadShare__.mjs-BX5snCRm.mjs";
|
|
6
|
-
import { _ as __mf_1$1 } from "./__mfe_internal__addon_pipeline_orchestrator_widgets__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.mjs-CO0PugXp.mjs";
|
|
7
|
-
var __create = Object.create;
|
|
8
|
-
var __defProp = Object.defineProperty;
|
|
9
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
10
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
11
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
12
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
13
|
-
var __commonJS = (cb, mod) => function() {
|
|
14
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
15
|
-
};
|
|
16
|
-
var __copyProps = (to, from, except, desc) => {
|
|
17
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i2 = 0, n2 = keys.length, key; i2 < n2; i2++) {
|
|
18
|
-
key = keys[i2];
|
|
19
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
20
|
-
get: ((k2) => from[k2]).bind(null, key),
|
|
21
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
return to;
|
|
25
|
-
};
|
|
26
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
27
|
-
value: mod,
|
|
28
|
-
enumerable: true
|
|
29
|
-
}) : target, mod));
|
|
30
|
-
var require_objectWithoutPropertiesLoose = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectWithoutPropertiesLoose.js"(exports, module) {
|
|
31
|
-
function _objectWithoutPropertiesLoose(r2, e2) {
|
|
32
|
-
if (null == r2) return {};
|
|
33
|
-
var t2 = {};
|
|
34
|
-
for (var n2 in r2) if ({}.hasOwnProperty.call(r2, n2)) {
|
|
35
|
-
if (e2.includes(n2)) continue;
|
|
36
|
-
t2[n2] = r2[n2];
|
|
37
|
-
}
|
|
38
|
-
return t2;
|
|
39
|
-
}
|
|
40
|
-
module.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
41
|
-
} });
|
|
42
|
-
var require_objectWithoutProperties = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectWithoutProperties.js"(exports, module) {
|
|
43
|
-
var objectWithoutPropertiesLoose = require_objectWithoutPropertiesLoose();
|
|
44
|
-
function _objectWithoutProperties$1(e2, t2) {
|
|
45
|
-
if (null == e2) return {};
|
|
46
|
-
var o2, r2, i2 = objectWithoutPropertiesLoose(e2, t2);
|
|
47
|
-
if (Object.getOwnPropertySymbols) {
|
|
48
|
-
var s2 = Object.getOwnPropertySymbols(e2);
|
|
49
|
-
for (r2 = 0; r2 < s2.length; r2++) o2 = s2[r2], t2.includes(o2) || {}.propertyIsEnumerable.call(e2, o2) && (i2[o2] = e2[o2]);
|
|
50
|
-
}
|
|
51
|
-
return i2;
|
|
52
|
-
}
|
|
53
|
-
module.exports = _objectWithoutProperties$1, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
54
|
-
} });
|
|
55
|
-
var require_typeof = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(exports, module) {
|
|
56
|
-
function _typeof$2(o2) {
|
|
57
|
-
"@babel/helpers - typeof";
|
|
58
|
-
return module.exports = _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
|
|
59
|
-
return typeof o$1;
|
|
60
|
-
} : function(o$1) {
|
|
61
|
-
return o$1 && "function" == typeof Symbol && o$1.constructor === Symbol && o$1 !== Symbol.prototype ? "symbol" : typeof o$1;
|
|
62
|
-
}, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof$2(o2);
|
|
63
|
-
}
|
|
64
|
-
module.exports = _typeof$2, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
65
|
-
} });
|
|
66
|
-
var require_toPrimitive = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(exports, module) {
|
|
67
|
-
var _typeof$1 = require_typeof()["default"];
|
|
68
|
-
function toPrimitive$1(t2, r2) {
|
|
69
|
-
if ("object" != _typeof$1(t2) || !t2) return t2;
|
|
70
|
-
var e2 = t2[Symbol.toPrimitive];
|
|
71
|
-
if (void 0 !== e2) {
|
|
72
|
-
var i2 = e2.call(t2, r2 || "default");
|
|
73
|
-
if ("object" != _typeof$1(i2)) return i2;
|
|
74
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
75
|
-
}
|
|
76
|
-
return ("string" === r2 ? String : Number)(t2);
|
|
77
|
-
}
|
|
78
|
-
module.exports = toPrimitive$1, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
79
|
-
} });
|
|
80
|
-
var require_toPropertyKey = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(exports, module) {
|
|
81
|
-
var _typeof = require_typeof()["default"];
|
|
82
|
-
var toPrimitive = require_toPrimitive();
|
|
83
|
-
function toPropertyKey$1(t2) {
|
|
84
|
-
var i2 = toPrimitive(t2, "string");
|
|
85
|
-
return "symbol" == _typeof(i2) ? i2 : i2 + "";
|
|
86
|
-
}
|
|
87
|
-
module.exports = toPropertyKey$1, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
88
|
-
} });
|
|
89
|
-
var require_defineProperty = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(exports, module) {
|
|
90
|
-
var toPropertyKey = require_toPropertyKey();
|
|
91
|
-
function _defineProperty(e2, r2, t2) {
|
|
92
|
-
return (r2 = toPropertyKey(r2)) in e2 ? Object.defineProperty(e2, r2, {
|
|
93
|
-
value: t2,
|
|
94
|
-
enumerable: true,
|
|
95
|
-
configurable: true,
|
|
96
|
-
writable: true
|
|
97
|
-
}) : e2[r2] = t2, e2;
|
|
98
|
-
}
|
|
99
|
-
module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
100
|
-
} });
|
|
101
|
-
var require_objectSpread2 = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(exports, module) {
|
|
102
|
-
var defineProperty = require_defineProperty();
|
|
103
|
-
function ownKeys(e2, r2) {
|
|
104
|
-
var t2 = Object.keys(e2);
|
|
105
|
-
if (Object.getOwnPropertySymbols) {
|
|
106
|
-
var o2 = Object.getOwnPropertySymbols(e2);
|
|
107
|
-
r2 && (o2 = o2.filter(function(r$1) {
|
|
108
|
-
return Object.getOwnPropertyDescriptor(e2, r$1).enumerable;
|
|
109
|
-
})), t2.push.apply(t2, o2);
|
|
110
|
-
}
|
|
111
|
-
return t2;
|
|
112
|
-
}
|
|
113
|
-
function _objectSpread2(e2) {
|
|
114
|
-
for (var r2 = 1; r2 < arguments.length; r2++) {
|
|
115
|
-
var t2 = null != arguments[r2] ? arguments[r2] : {};
|
|
116
|
-
r2 % 2 ? ownKeys(Object(t2), true).forEach(function(r$1) {
|
|
117
|
-
defineProperty(e2, r$1, t2[r$1]);
|
|
118
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys(Object(t2)).forEach(function(r$1) {
|
|
119
|
-
Object.defineProperty(e2, r$1, Object.getOwnPropertyDescriptor(t2, r$1));
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
return e2;
|
|
123
|
-
}
|
|
124
|
-
module.exports = _objectSpread2, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
125
|
-
} });
|
|
126
|
-
var import_objectWithoutProperties = __toESM(require_objectWithoutProperties(), 1);
|
|
127
|
-
var import_objectSpread2$4 = __toESM(require_objectSpread2(), 1);
|
|
128
|
-
const _excluded = ["cursor", "direction"];
|
|
129
|
-
function getQueryKeyInternal(path, input, type) {
|
|
130
|
-
const splitPath = path.flatMap((part) => part.split("."));
|
|
131
|
-
if (!input && (!type || type === "any")) return splitPath.length ? [splitPath] : [];
|
|
132
|
-
if (type === "infinite" && isObject(input) && ("direction" in input || "cursor" in input)) {
|
|
133
|
-
const { cursor: _, direction: __ } = input, inputWithoutCursorAndDirection = (0, import_objectWithoutProperties.default)(input, _excluded);
|
|
134
|
-
return [splitPath, {
|
|
135
|
-
input: inputWithoutCursorAndDirection,
|
|
136
|
-
type: "infinite"
|
|
137
|
-
}];
|
|
138
|
-
}
|
|
139
|
-
return [splitPath, (0, import_objectSpread2$4.default)((0, import_objectSpread2$4.default)({}, typeof input !== "undefined" && input !== __mf_53 && { input }), type && type !== "any" && { type })];
|
|
140
|
-
}
|
|
141
|
-
function getMutationKeyInternal(path) {
|
|
142
|
-
return getQueryKeyInternal(path, void 0, "any");
|
|
143
|
-
}
|
|
144
|
-
function getQueryKey(procedureOrRouter, ..._params) {
|
|
145
|
-
const [input, type] = _params;
|
|
146
|
-
const path = procedureOrRouter._def().path;
|
|
147
|
-
const queryKey = getQueryKeyInternal(path, input, type !== null && type !== void 0 ? type : "any");
|
|
148
|
-
return queryKey;
|
|
149
|
-
}
|
|
150
|
-
function getMutationKey(procedure) {
|
|
151
|
-
const path = procedure._def().path;
|
|
152
|
-
return getMutationKeyInternal(path);
|
|
153
|
-
}
|
|
154
|
-
function createReactDecoration(hooks) {
|
|
155
|
-
return createRecursiveProxy(({ path, args }) => {
|
|
156
|
-
var _rest$;
|
|
157
|
-
const pathCopy = [...path];
|
|
158
|
-
const lastArg = pathCopy.pop();
|
|
159
|
-
if (lastArg === "useMutation") return hooks[lastArg](pathCopy, ...args);
|
|
160
|
-
if (lastArg === "_def") return { path: pathCopy };
|
|
161
|
-
const [input, ...rest] = args;
|
|
162
|
-
const opts = (_rest$ = rest[0]) !== null && _rest$ !== void 0 ? _rest$ : {};
|
|
163
|
-
return hooks[lastArg](pathCopy, input, opts);
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
var _React$createContext;
|
|
167
|
-
const contextProps = [
|
|
168
|
-
"client",
|
|
169
|
-
"ssrContext",
|
|
170
|
-
"ssrState",
|
|
171
|
-
"abortOnUnmount"
|
|
172
|
-
];
|
|
173
|
-
const TRPCContext = (_React$createContext = __mf_13) === null || _React$createContext === void 0 ? void 0 : _React$createContext.call(__mfHostReact, null);
|
|
174
|
-
const getQueryType = (utilName) => {
|
|
175
|
-
switch (utilName) {
|
|
176
|
-
case "queryOptions":
|
|
177
|
-
case "fetch":
|
|
178
|
-
case "ensureData":
|
|
179
|
-
case "prefetch":
|
|
180
|
-
case "getData":
|
|
181
|
-
case "setData":
|
|
182
|
-
case "setQueriesData":
|
|
183
|
-
return "query";
|
|
184
|
-
case "infiniteQueryOptions":
|
|
185
|
-
case "fetchInfinite":
|
|
186
|
-
case "prefetchInfinite":
|
|
187
|
-
case "getInfiniteData":
|
|
188
|
-
case "setInfiniteData":
|
|
189
|
-
return "infinite";
|
|
190
|
-
case "setMutationDefaults":
|
|
191
|
-
case "getMutationDefaults":
|
|
192
|
-
case "isMutating":
|
|
193
|
-
case "cancel":
|
|
194
|
-
case "invalidate":
|
|
195
|
-
case "refetch":
|
|
196
|
-
case "reset":
|
|
197
|
-
return "any";
|
|
198
|
-
}
|
|
199
|
-
};
|
|
200
|
-
function createRecursiveUtilsProxy(context) {
|
|
201
|
-
return createRecursiveProxy((opts) => {
|
|
202
|
-
const path = [...opts.path];
|
|
203
|
-
const utilName = path.pop();
|
|
204
|
-
const args = [...opts.args];
|
|
205
|
-
const input = args.shift();
|
|
206
|
-
const queryType = getQueryType(utilName);
|
|
207
|
-
const queryKey = getQueryKeyInternal(path, input, queryType);
|
|
208
|
-
const contextMap = {
|
|
209
|
-
infiniteQueryOptions: () => context.infiniteQueryOptions(path, queryKey, args[0]),
|
|
210
|
-
queryOptions: () => context.queryOptions(path, queryKey, ...args),
|
|
211
|
-
fetch: () => context.fetchQuery(queryKey, ...args),
|
|
212
|
-
fetchInfinite: () => context.fetchInfiniteQuery(queryKey, args[0]),
|
|
213
|
-
prefetch: () => context.prefetchQuery(queryKey, ...args),
|
|
214
|
-
prefetchInfinite: () => context.prefetchInfiniteQuery(queryKey, args[0]),
|
|
215
|
-
ensureData: () => context.ensureQueryData(queryKey, ...args),
|
|
216
|
-
invalidate: () => context.invalidateQueries(queryKey, ...args),
|
|
217
|
-
reset: () => context.resetQueries(queryKey, ...args),
|
|
218
|
-
refetch: () => context.refetchQueries(queryKey, ...args),
|
|
219
|
-
cancel: () => context.cancelQuery(queryKey, ...args),
|
|
220
|
-
setData: () => {
|
|
221
|
-
context.setQueryData(queryKey, args[0], args[1]);
|
|
222
|
-
},
|
|
223
|
-
setQueriesData: () => context.setQueriesData(queryKey, args[0], args[1], args[2]),
|
|
224
|
-
setInfiniteData: () => {
|
|
225
|
-
context.setInfiniteQueryData(queryKey, args[0], args[1]);
|
|
226
|
-
},
|
|
227
|
-
getData: () => context.getQueryData(queryKey),
|
|
228
|
-
getInfiniteData: () => context.getInfiniteQueryData(queryKey),
|
|
229
|
-
setMutationDefaults: () => context.setMutationDefaults(getMutationKeyInternal(path), input),
|
|
230
|
-
getMutationDefaults: () => context.getMutationDefaults(getMutationKeyInternal(path)),
|
|
231
|
-
isMutating: () => context.isMutating({ mutationKey: getMutationKeyInternal(path) })
|
|
232
|
-
};
|
|
233
|
-
return contextMap[utilName]();
|
|
234
|
-
});
|
|
235
|
-
}
|
|
236
|
-
function createReactQueryUtils(context) {
|
|
237
|
-
const clientProxy = __mf_4(context.client);
|
|
238
|
-
const proxy = createRecursiveUtilsProxy(context);
|
|
239
|
-
return createFlatProxy((key) => {
|
|
240
|
-
const contextName = key;
|
|
241
|
-
if (contextName === "client") return clientProxy;
|
|
242
|
-
if (contextProps.includes(contextName)) return context[contextName];
|
|
243
|
-
return proxy[key];
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
function createQueryUtilsProxy(context) {
|
|
247
|
-
return createRecursiveUtilsProxy(context);
|
|
248
|
-
}
|
|
249
|
-
var import_objectSpread2$3 = __toESM(require_objectSpread2(), 1);
|
|
250
|
-
function createUseQueries(client) {
|
|
251
|
-
const untypedClient = client instanceof __mf_1 ? client : __mf_10(client);
|
|
252
|
-
return createRecursiveProxy((opts) => {
|
|
253
|
-
const arrayPath = opts.path;
|
|
254
|
-
const dotPath = arrayPath.join(".");
|
|
255
|
-
const [input, _opts] = opts.args;
|
|
256
|
-
const options = (0, import_objectSpread2$3.default)({
|
|
257
|
-
queryKey: getQueryKeyInternal(arrayPath, input, "query"),
|
|
258
|
-
queryFn: () => {
|
|
259
|
-
return untypedClient.query(dotPath, input, _opts === null || _opts === void 0 ? void 0 : _opts.trpc);
|
|
260
|
-
}
|
|
261
|
-
}, _opts);
|
|
262
|
-
return options;
|
|
263
|
-
});
|
|
264
|
-
}
|
|
265
|
-
var import_objectSpread2$2 = __toESM(require_objectSpread2(), 1);
|
|
266
|
-
function getClientArgs(queryKey, opts, infiniteParams) {
|
|
267
|
-
var _queryKey$;
|
|
268
|
-
const path = queryKey[0];
|
|
269
|
-
let input = (_queryKey$ = queryKey[1]) === null || _queryKey$ === void 0 ? void 0 : _queryKey$.input;
|
|
270
|
-
if (infiniteParams) {
|
|
271
|
-
var _input;
|
|
272
|
-
input = (0, import_objectSpread2$2.default)((0, import_objectSpread2$2.default)((0, import_objectSpread2$2.default)({}, (_input = input) !== null && _input !== void 0 ? _input : {}), infiniteParams.pageParam ? { cursor: infiniteParams.pageParam } : {}), {}, { direction: infiniteParams.direction });
|
|
273
|
-
}
|
|
274
|
-
return [
|
|
275
|
-
path.join("."),
|
|
276
|
-
input,
|
|
277
|
-
opts === null || opts === void 0 ? void 0 : opts.trpc
|
|
278
|
-
];
|
|
279
|
-
}
|
|
280
|
-
var require_asyncIterator = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(exports, module) {
|
|
281
|
-
function _asyncIterator$1(r2) {
|
|
282
|
-
var n2, t2, o2, e2 = 2;
|
|
283
|
-
for ("undefined" != typeof Symbol && (t2 = Symbol.asyncIterator, o2 = Symbol.iterator); e2--; ) {
|
|
284
|
-
if (t2 && null != (n2 = r2[t2])) return n2.call(r2);
|
|
285
|
-
if (o2 && null != (n2 = r2[o2])) return new AsyncFromSyncIterator(n2.call(r2));
|
|
286
|
-
t2 = "@@asyncIterator", o2 = "@@iterator";
|
|
287
|
-
}
|
|
288
|
-
throw new TypeError("Object is not async iterable");
|
|
289
|
-
}
|
|
290
|
-
function AsyncFromSyncIterator(r2) {
|
|
291
|
-
function AsyncFromSyncIteratorContinuation(r$1) {
|
|
292
|
-
if (Object(r$1) !== r$1) return Promise.reject(new TypeError(r$1 + " is not an object."));
|
|
293
|
-
var n2 = r$1.done;
|
|
294
|
-
return Promise.resolve(r$1.value).then(function(r$2) {
|
|
295
|
-
return {
|
|
296
|
-
value: r$2,
|
|
297
|
-
done: n2
|
|
298
|
-
};
|
|
299
|
-
});
|
|
300
|
-
}
|
|
301
|
-
return AsyncFromSyncIterator = function AsyncFromSyncIterator$1(r$1) {
|
|
302
|
-
this.s = r$1, this.n = r$1.next;
|
|
303
|
-
}, AsyncFromSyncIterator.prototype = {
|
|
304
|
-
s: null,
|
|
305
|
-
n: null,
|
|
306
|
-
next: function next() {
|
|
307
|
-
return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments));
|
|
308
|
-
},
|
|
309
|
-
"return": function _return(r$1) {
|
|
310
|
-
var n2 = this.s["return"];
|
|
311
|
-
return void 0 === n2 ? Promise.resolve({
|
|
312
|
-
value: r$1,
|
|
313
|
-
done: true
|
|
314
|
-
}) : AsyncFromSyncIteratorContinuation(n2.apply(this.s, arguments));
|
|
315
|
-
},
|
|
316
|
-
"throw": function _throw(r$1) {
|
|
317
|
-
var n2 = this.s["return"];
|
|
318
|
-
return void 0 === n2 ? Promise.reject(r$1) : AsyncFromSyncIteratorContinuation(n2.apply(this.s, arguments));
|
|
319
|
-
}
|
|
320
|
-
}, new AsyncFromSyncIterator(r2);
|
|
321
|
-
}
|
|
322
|
-
module.exports = _asyncIterator$1, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
323
|
-
} });
|
|
324
|
-
var import_asyncIterator = __toESM(require_asyncIterator(), 1);
|
|
325
|
-
function createTRPCOptionsResult(value) {
|
|
326
|
-
const path = value.path.join(".");
|
|
327
|
-
return { path };
|
|
328
|
-
}
|
|
329
|
-
function useHookResult(value) {
|
|
330
|
-
const result = createTRPCOptionsResult(value);
|
|
331
|
-
return __mf_34(() => result, [result]);
|
|
332
|
-
}
|
|
333
|
-
async function buildQueryFromAsyncIterable(asyncIterable, queryClient, queryKey) {
|
|
334
|
-
const queryCache = queryClient.getQueryCache();
|
|
335
|
-
const query = queryCache.build(queryClient, { queryKey });
|
|
336
|
-
query.setState({
|
|
337
|
-
data: [],
|
|
338
|
-
status: "success"
|
|
339
|
-
});
|
|
340
|
-
const aggregate = [];
|
|
341
|
-
var _iteratorAbruptCompletion = false;
|
|
342
|
-
var _didIteratorError = false;
|
|
343
|
-
var _iteratorError;
|
|
344
|
-
try {
|
|
345
|
-
for (var _iterator = (0, import_asyncIterator.default)(asyncIterable), _step; _iteratorAbruptCompletion = !(_step = await _iterator.next()).done; _iteratorAbruptCompletion = false) {
|
|
346
|
-
const value = _step.value;
|
|
347
|
-
{
|
|
348
|
-
aggregate.push(value);
|
|
349
|
-
query.setState({ data: [...aggregate] });
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
} catch (err) {
|
|
353
|
-
_didIteratorError = true;
|
|
354
|
-
_iteratorError = err;
|
|
355
|
-
} finally {
|
|
356
|
-
try {
|
|
357
|
-
if (_iteratorAbruptCompletion && _iterator.return != null) await _iterator.return();
|
|
358
|
-
} finally {
|
|
359
|
-
if (_didIteratorError) throw _iteratorError;
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
return aggregate;
|
|
363
|
-
}
|
|
364
|
-
var import_objectSpread2$1 = __toESM(require_objectSpread2(), 1);
|
|
365
|
-
function createUtilityFunctions(opts) {
|
|
366
|
-
const { client, queryClient } = opts;
|
|
367
|
-
const untypedClient = client instanceof __mf_1 ? client : __mf_10(client);
|
|
368
|
-
return {
|
|
369
|
-
infiniteQueryOptions: (path, queryKey, opts$1) => {
|
|
370
|
-
var _queryKey$, _ref;
|
|
371
|
-
const inputIsSkipToken = ((_queryKey$ = queryKey[1]) === null || _queryKey$ === void 0 ? void 0 : _queryKey$.input) === __mf_53;
|
|
372
|
-
const queryFn = async (queryFnContext) => {
|
|
373
|
-
var _opts$trpc;
|
|
374
|
-
const actualOpts = (0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, opts$1), {}, { trpc: (0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, opts$1 === null || opts$1 === void 0 ? void 0 : opts$1.trpc), (opts$1 === null || opts$1 === void 0 || (_opts$trpc = opts$1.trpc) === null || _opts$trpc === void 0 ? void 0 : _opts$trpc.abortOnUnmount) ? { signal: queryFnContext.signal } : { signal: null }) });
|
|
375
|
-
const result = await untypedClient.query(...getClientArgs(queryKey, actualOpts, {
|
|
376
|
-
direction: queryFnContext.direction,
|
|
377
|
-
pageParam: queryFnContext.pageParam
|
|
378
|
-
}));
|
|
379
|
-
return result;
|
|
380
|
-
};
|
|
381
|
-
return Object.assign(__mf_5((0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, opts$1), {}, {
|
|
382
|
-
initialData: opts$1 === null || opts$1 === void 0 ? void 0 : opts$1.initialData,
|
|
383
|
-
queryKey,
|
|
384
|
-
queryFn: inputIsSkipToken ? __mf_53 : queryFn,
|
|
385
|
-
initialPageParam: (_ref = opts$1 === null || opts$1 === void 0 ? void 0 : opts$1.initialCursor) !== null && _ref !== void 0 ? _ref : null
|
|
386
|
-
})), { trpc: createTRPCOptionsResult({ path }) });
|
|
387
|
-
},
|
|
388
|
-
queryOptions: (path, queryKey, opts$1) => {
|
|
389
|
-
var _queryKey$2;
|
|
390
|
-
const inputIsSkipToken = ((_queryKey$2 = queryKey[1]) === null || _queryKey$2 === void 0 ? void 0 : _queryKey$2.input) === __mf_53;
|
|
391
|
-
const queryFn = async (queryFnContext) => {
|
|
392
|
-
var _opts$trpc2;
|
|
393
|
-
const actualOpts = (0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, opts$1), {}, { trpc: (0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, opts$1 === null || opts$1 === void 0 ? void 0 : opts$1.trpc), (opts$1 === null || opts$1 === void 0 || (_opts$trpc2 = opts$1.trpc) === null || _opts$trpc2 === void 0 ? void 0 : _opts$trpc2.abortOnUnmount) ? { signal: queryFnContext.signal } : { signal: null }) });
|
|
394
|
-
const result = await untypedClient.query(...getClientArgs(queryKey, actualOpts));
|
|
395
|
-
if (isAsyncIterable(result)) return buildQueryFromAsyncIterable(result, queryClient, queryKey);
|
|
396
|
-
return result;
|
|
397
|
-
};
|
|
398
|
-
return Object.assign(__mf_7((0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, opts$1), {}, {
|
|
399
|
-
initialData: opts$1 === null || opts$1 === void 0 ? void 0 : opts$1.initialData,
|
|
400
|
-
queryKey,
|
|
401
|
-
queryFn: inputIsSkipToken ? __mf_53 : queryFn
|
|
402
|
-
})), { trpc: createTRPCOptionsResult({ path }) });
|
|
403
|
-
},
|
|
404
|
-
fetchQuery: (queryKey, opts$1) => {
|
|
405
|
-
return queryClient.fetchQuery((0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, opts$1), {}, {
|
|
406
|
-
queryKey,
|
|
407
|
-
queryFn: () => untypedClient.query(...getClientArgs(queryKey, opts$1))
|
|
408
|
-
}));
|
|
409
|
-
},
|
|
410
|
-
fetchInfiniteQuery: (queryKey, opts$1) => {
|
|
411
|
-
var _opts$initialCursor;
|
|
412
|
-
return queryClient.fetchInfiniteQuery((0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, opts$1), {}, {
|
|
413
|
-
queryKey,
|
|
414
|
-
queryFn: ({ pageParam, direction }) => {
|
|
415
|
-
return untypedClient.query(...getClientArgs(queryKey, opts$1, {
|
|
416
|
-
pageParam,
|
|
417
|
-
direction
|
|
418
|
-
}));
|
|
419
|
-
},
|
|
420
|
-
initialPageParam: (_opts$initialCursor = opts$1 === null || opts$1 === void 0 ? void 0 : opts$1.initialCursor) !== null && _opts$initialCursor !== void 0 ? _opts$initialCursor : null
|
|
421
|
-
}));
|
|
422
|
-
},
|
|
423
|
-
prefetchQuery: (queryKey, opts$1) => {
|
|
424
|
-
return queryClient.prefetchQuery((0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, opts$1), {}, {
|
|
425
|
-
queryKey,
|
|
426
|
-
queryFn: () => untypedClient.query(...getClientArgs(queryKey, opts$1))
|
|
427
|
-
}));
|
|
428
|
-
},
|
|
429
|
-
prefetchInfiniteQuery: (queryKey, opts$1) => {
|
|
430
|
-
var _opts$initialCursor2;
|
|
431
|
-
return queryClient.prefetchInfiniteQuery((0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, opts$1), {}, {
|
|
432
|
-
queryKey,
|
|
433
|
-
queryFn: ({ pageParam, direction }) => {
|
|
434
|
-
return untypedClient.query(...getClientArgs(queryKey, opts$1, {
|
|
435
|
-
pageParam,
|
|
436
|
-
direction
|
|
437
|
-
}));
|
|
438
|
-
},
|
|
439
|
-
initialPageParam: (_opts$initialCursor2 = opts$1 === null || opts$1 === void 0 ? void 0 : opts$1.initialCursor) !== null && _opts$initialCursor2 !== void 0 ? _opts$initialCursor2 : null
|
|
440
|
-
}));
|
|
441
|
-
},
|
|
442
|
-
ensureQueryData: (queryKey, opts$1) => {
|
|
443
|
-
return queryClient.ensureQueryData((0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, opts$1), {}, {
|
|
444
|
-
queryKey,
|
|
445
|
-
queryFn: () => untypedClient.query(...getClientArgs(queryKey, opts$1))
|
|
446
|
-
}));
|
|
447
|
-
},
|
|
448
|
-
invalidateQueries: (queryKey, filters, options) => {
|
|
449
|
-
return queryClient.invalidateQueries((0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, filters), {}, { queryKey }), options);
|
|
450
|
-
},
|
|
451
|
-
resetQueries: (queryKey, filters, options) => {
|
|
452
|
-
return queryClient.resetQueries((0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, filters), {}, { queryKey }), options);
|
|
453
|
-
},
|
|
454
|
-
refetchQueries: (queryKey, filters, options) => {
|
|
455
|
-
return queryClient.refetchQueries((0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, filters), {}, { queryKey }), options);
|
|
456
|
-
},
|
|
457
|
-
cancelQuery: (queryKey, options) => {
|
|
458
|
-
return queryClient.cancelQueries({ queryKey }, options);
|
|
459
|
-
},
|
|
460
|
-
setQueryData: (queryKey, updater, options) => {
|
|
461
|
-
return queryClient.setQueryData(queryKey, updater, options);
|
|
462
|
-
},
|
|
463
|
-
setQueriesData: (queryKey, filters, updater, options) => {
|
|
464
|
-
return queryClient.setQueriesData((0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, filters), {}, { queryKey }), updater, options);
|
|
465
|
-
},
|
|
466
|
-
getQueryData: (queryKey) => {
|
|
467
|
-
return queryClient.getQueryData(queryKey);
|
|
468
|
-
},
|
|
469
|
-
setInfiniteQueryData: (queryKey, updater, options) => {
|
|
470
|
-
return queryClient.setQueryData(queryKey, updater, options);
|
|
471
|
-
},
|
|
472
|
-
getInfiniteQueryData: (queryKey) => {
|
|
473
|
-
return queryClient.getQueryData(queryKey);
|
|
474
|
-
},
|
|
475
|
-
setMutationDefaults: (mutationKey, options) => {
|
|
476
|
-
const path = mutationKey[0];
|
|
477
|
-
const canonicalMutationFn = (input) => {
|
|
478
|
-
return untypedClient.mutation(...getClientArgs([path, { input }], opts));
|
|
479
|
-
};
|
|
480
|
-
return queryClient.setMutationDefaults(mutationKey, typeof options === "function" ? options({ canonicalMutationFn }) : options);
|
|
481
|
-
},
|
|
482
|
-
getMutationDefaults: (mutationKey) => {
|
|
483
|
-
return queryClient.getMutationDefaults(mutationKey);
|
|
484
|
-
},
|
|
485
|
-
isMutating: (filters) => {
|
|
486
|
-
return queryClient.isMutating((0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, filters), {}, { exact: true }));
|
|
487
|
-
}
|
|
488
|
-
};
|
|
489
|
-
}
|
|
490
|
-
var import_objectSpread2 = __toESM(require_objectSpread2());
|
|
491
|
-
const trackResult = (result, onTrackResult) => {
|
|
492
|
-
const trackedResult = new Proxy(result, { get(target, prop) {
|
|
493
|
-
onTrackResult(prop);
|
|
494
|
-
return target[prop];
|
|
495
|
-
} });
|
|
496
|
-
return trackedResult;
|
|
497
|
-
};
|
|
498
|
-
function createRootHooks(config) {
|
|
499
|
-
var _config$overrides$use, _config$overrides, _config$context;
|
|
500
|
-
const mutationSuccessOverride = (_config$overrides$use = config === null || config === void 0 || (_config$overrides = config.overrides) === null || _config$overrides === void 0 || (_config$overrides = _config$overrides.useMutation) === null || _config$overrides === void 0 ? void 0 : _config$overrides.onSuccess) !== null && _config$overrides$use !== void 0 ? _config$overrides$use : (options) => options.originalFn();
|
|
501
|
-
const Context = (_config$context = config === null || config === void 0 ? void 0 : config.context) !== null && _config$context !== void 0 ? _config$context : TRPCContext;
|
|
502
|
-
const createClient = __mf_3;
|
|
503
|
-
const TRPCProvider = (props) => {
|
|
504
|
-
var _props$ssrState;
|
|
505
|
-
const { abortOnUnmount = false, queryClient, ssrContext } = props;
|
|
506
|
-
const [ssrState, setSSRState] = __mf_38((_props$ssrState = props.ssrState) !== null && _props$ssrState !== void 0 ? _props$ssrState : false);
|
|
507
|
-
const client = props.client instanceof __mf_1 ? props.client : __mf_10(props.client);
|
|
508
|
-
const fns = __mf_34(() => createUtilityFunctions({
|
|
509
|
-
client,
|
|
510
|
-
queryClient
|
|
511
|
-
}), [client, queryClient]);
|
|
512
|
-
const contextValue = __mf_34(() => (0, import_objectSpread2.default)({
|
|
513
|
-
abortOnUnmount,
|
|
514
|
-
queryClient,
|
|
515
|
-
client,
|
|
516
|
-
ssrContext: ssrContext !== null && ssrContext !== void 0 ? ssrContext : null,
|
|
517
|
-
ssrState
|
|
518
|
-
}, fns), [
|
|
519
|
-
abortOnUnmount,
|
|
520
|
-
client,
|
|
521
|
-
fns,
|
|
522
|
-
queryClient,
|
|
523
|
-
ssrContext,
|
|
524
|
-
ssrState
|
|
525
|
-
]);
|
|
526
|
-
__mf_28(() => {
|
|
527
|
-
setSSRState((state) => state ? "mounted" : false);
|
|
528
|
-
}, []);
|
|
529
|
-
return /* @__PURE__ */ __mf_1$1(Context.Provider, {
|
|
530
|
-
value: contextValue,
|
|
531
|
-
children: props.children
|
|
532
|
-
});
|
|
533
|
-
};
|
|
534
|
-
function useContext() {
|
|
535
|
-
const context = __mf_25(Context);
|
|
536
|
-
if (!context) throw new Error("Unable to find tRPC Context. Did you forget to wrap your App inside `withTRPC` HoC?");
|
|
537
|
-
return context;
|
|
538
|
-
}
|
|
539
|
-
function useSSRQueryOptionsIfNeeded(queryKey, opts) {
|
|
540
|
-
var _queryClient$getQuery;
|
|
541
|
-
const { queryClient, ssrState } = useContext();
|
|
542
|
-
return ssrState && ssrState !== "mounted" && ((_queryClient$getQuery = queryClient.getQueryCache().find({ queryKey })) === null || _queryClient$getQuery === void 0 ? void 0 : _queryClient$getQuery.state.status) === "error" ? (0, import_objectSpread2.default)({ retryOnMount: false }, opts) : opts;
|
|
543
|
-
}
|
|
544
|
-
function useQuery$1(path, input, opts) {
|
|
545
|
-
var _opts$trpc, _opts$enabled, _ref, _opts$trpc$abortOnUnm, _opts$trpc2;
|
|
546
|
-
const context = useContext();
|
|
547
|
-
const { abortOnUnmount, client, ssrState, queryClient, prefetchQuery } = context;
|
|
548
|
-
const queryKey = getQueryKeyInternal(path, input, "query");
|
|
549
|
-
const defaultOpts = queryClient.getQueryDefaults(queryKey);
|
|
550
|
-
const isInputSkipToken = input === __mf_53;
|
|
551
|
-
if (typeof window === "undefined" && ssrState === "prepass" && (opts === null || opts === void 0 || (_opts$trpc = opts.trpc) === null || _opts$trpc === void 0 ? void 0 : _opts$trpc.ssr) !== false && ((_opts$enabled = opts === null || opts === void 0 ? void 0 : opts.enabled) !== null && _opts$enabled !== void 0 ? _opts$enabled : defaultOpts === null || defaultOpts === void 0 ? void 0 : defaultOpts.enabled) !== false && !isInputSkipToken && !queryClient.getQueryCache().find({ queryKey })) prefetchQuery(queryKey, opts);
|
|
552
|
-
const ssrOpts = useSSRQueryOptionsIfNeeded(queryKey, (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, defaultOpts), opts));
|
|
553
|
-
const shouldAbortOnUnmount = (_ref = (_opts$trpc$abortOnUnm = opts === null || opts === void 0 || (_opts$trpc2 = opts.trpc) === null || _opts$trpc2 === void 0 ? void 0 : _opts$trpc2.abortOnUnmount) !== null && _opts$trpc$abortOnUnm !== void 0 ? _opts$trpc$abortOnUnm : config === null || config === void 0 ? void 0 : config.abortOnUnmount) !== null && _ref !== void 0 ? _ref : abortOnUnmount;
|
|
554
|
-
const hook = __mf_17((0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, ssrOpts), {}, {
|
|
555
|
-
queryKey,
|
|
556
|
-
queryFn: isInputSkipToken ? input : async (queryFunctionContext) => {
|
|
557
|
-
const actualOpts = (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, ssrOpts), {}, { trpc: (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, ssrOpts === null || ssrOpts === void 0 ? void 0 : ssrOpts.trpc), shouldAbortOnUnmount ? { signal: queryFunctionContext.signal } : { signal: null }) });
|
|
558
|
-
const result = await client.query(...getClientArgs(queryKey, actualOpts));
|
|
559
|
-
if (isAsyncIterable(result)) return buildQueryFromAsyncIterable(result, queryClient, queryKey);
|
|
560
|
-
return result;
|
|
561
|
-
}
|
|
562
|
-
}), queryClient);
|
|
563
|
-
hook.trpc = useHookResult({ path });
|
|
564
|
-
return hook;
|
|
565
|
-
}
|
|
566
|
-
function usePrefetchQuery$1(path, input, opts) {
|
|
567
|
-
var _ref2, _opts$trpc$abortOnUnm2, _opts$trpc3;
|
|
568
|
-
const context = useContext();
|
|
569
|
-
const queryKey = getQueryKeyInternal(path, input, "query");
|
|
570
|
-
const isInputSkipToken = input === __mf_53;
|
|
571
|
-
const shouldAbortOnUnmount = (_ref2 = (_opts$trpc$abortOnUnm2 = opts === null || opts === void 0 || (_opts$trpc3 = opts.trpc) === null || _opts$trpc3 === void 0 ? void 0 : _opts$trpc3.abortOnUnmount) !== null && _opts$trpc$abortOnUnm2 !== void 0 ? _opts$trpc$abortOnUnm2 : config === null || config === void 0 ? void 0 : config.abortOnUnmount) !== null && _ref2 !== void 0 ? _ref2 : context.abortOnUnmount;
|
|
572
|
-
__mf_15((0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, opts), {}, {
|
|
573
|
-
queryKey,
|
|
574
|
-
queryFn: isInputSkipToken ? input : (queryFunctionContext) => {
|
|
575
|
-
const actualOpts = { trpc: (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, opts === null || opts === void 0 ? void 0 : opts.trpc), shouldAbortOnUnmount ? { signal: queryFunctionContext.signal } : {}) };
|
|
576
|
-
return context.client.query(...getClientArgs(queryKey, actualOpts));
|
|
577
|
-
}
|
|
578
|
-
}));
|
|
579
|
-
}
|
|
580
|
-
function useSuspenseQuery$1(path, input, opts) {
|
|
581
|
-
var _ref3, _opts$trpc$abortOnUnm3, _opts$trpc4;
|
|
582
|
-
const context = useContext();
|
|
583
|
-
const queryKey = getQueryKeyInternal(path, input, "query");
|
|
584
|
-
const shouldAbortOnUnmount = (_ref3 = (_opts$trpc$abortOnUnm3 = opts === null || opts === void 0 || (_opts$trpc4 = opts.trpc) === null || _opts$trpc4 === void 0 ? void 0 : _opts$trpc4.abortOnUnmount) !== null && _opts$trpc$abortOnUnm3 !== void 0 ? _opts$trpc$abortOnUnm3 : config === null || config === void 0 ? void 0 : config.abortOnUnmount) !== null && _ref3 !== void 0 ? _ref3 : context.abortOnUnmount;
|
|
585
|
-
const hook = __mf_22((0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, opts), {}, {
|
|
586
|
-
queryKey,
|
|
587
|
-
queryFn: (queryFunctionContext) => {
|
|
588
|
-
const actualOpts = (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, opts), {}, { trpc: (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, opts === null || opts === void 0 ? void 0 : opts.trpc), shouldAbortOnUnmount ? { signal: queryFunctionContext.signal } : { signal: null }) });
|
|
589
|
-
return context.client.query(...getClientArgs(queryKey, actualOpts));
|
|
590
|
-
}
|
|
591
|
-
}), context.queryClient);
|
|
592
|
-
hook.trpc = useHookResult({ path });
|
|
593
|
-
return [hook.data, hook];
|
|
594
|
-
}
|
|
595
|
-
function useMutation$1(path, opts) {
|
|
596
|
-
const { client, queryClient } = useContext();
|
|
597
|
-
const mutationKey = getMutationKeyInternal(path);
|
|
598
|
-
const defaultOpts = queryClient.defaultMutationOptions(queryClient.getMutationDefaults(mutationKey));
|
|
599
|
-
const hook = __mf_12((0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, opts), {}, {
|
|
600
|
-
mutationKey,
|
|
601
|
-
mutationFn: (input) => {
|
|
602
|
-
return client.mutation(...getClientArgs([path, { input }], opts));
|
|
603
|
-
},
|
|
604
|
-
onSuccess(...args) {
|
|
605
|
-
var _ref4, _opts$meta;
|
|
606
|
-
const originalFn = () => {
|
|
607
|
-
var _opts$onSuccess, _opts$onSuccess2, _defaultOpts$onSucces;
|
|
608
|
-
return (_opts$onSuccess = opts === null || opts === void 0 || (_opts$onSuccess2 = opts.onSuccess) === null || _opts$onSuccess2 === void 0 ? void 0 : _opts$onSuccess2.call(opts, ...args)) !== null && _opts$onSuccess !== void 0 ? _opts$onSuccess : defaultOpts === null || defaultOpts === void 0 || (_defaultOpts$onSucces = defaultOpts.onSuccess) === null || _defaultOpts$onSucces === void 0 ? void 0 : _defaultOpts$onSucces.call(defaultOpts, ...args);
|
|
609
|
-
};
|
|
610
|
-
return mutationSuccessOverride({
|
|
611
|
-
originalFn,
|
|
612
|
-
queryClient,
|
|
613
|
-
meta: (_ref4 = (_opts$meta = opts === null || opts === void 0 ? void 0 : opts.meta) !== null && _opts$meta !== void 0 ? _opts$meta : defaultOpts === null || defaultOpts === void 0 ? void 0 : defaultOpts.meta) !== null && _ref4 !== void 0 ? _ref4 : {}
|
|
614
|
-
});
|
|
615
|
-
}
|
|
616
|
-
}), queryClient);
|
|
617
|
-
hook.trpc = useHookResult({ path });
|
|
618
|
-
return hook;
|
|
619
|
-
}
|
|
620
|
-
const initialStateIdle = {
|
|
621
|
-
data: void 0,
|
|
622
|
-
error: null,
|
|
623
|
-
status: "idle"
|
|
624
|
-
};
|
|
625
|
-
const initialStateConnecting = {
|
|
626
|
-
data: void 0,
|
|
627
|
-
error: null,
|
|
628
|
-
status: "connecting"
|
|
629
|
-
};
|
|
630
|
-
/* istanbul ignore next -- @preserve */
|
|
631
|
-
function useSubscription(path, input, opts) {
|
|
632
|
-
var _opts$enabled2;
|
|
633
|
-
const enabled = (_opts$enabled2 = opts === null || opts === void 0 ? void 0 : opts.enabled) !== null && _opts$enabled2 !== void 0 ? _opts$enabled2 : input !== __mf_53;
|
|
634
|
-
const queryKey = __mf_40(getQueryKeyInternal(path, input, "any"));
|
|
635
|
-
const { client } = useContext();
|
|
636
|
-
const optsRef = __mf_37(opts);
|
|
637
|
-
__mf_28(() => {
|
|
638
|
-
optsRef.current = opts;
|
|
639
|
-
});
|
|
640
|
-
const [trackedProps] = __mf_38(/* @__PURE__ */ new Set([]));
|
|
641
|
-
const addTrackedProp = __mf_24((key) => {
|
|
642
|
-
trackedProps.add(key);
|
|
643
|
-
}, [trackedProps]);
|
|
644
|
-
const currentSubscriptionRef = __mf_37(null);
|
|
645
|
-
const updateState = __mf_24((callback) => {
|
|
646
|
-
const prev = resultRef.current;
|
|
647
|
-
const next = resultRef.current = callback(prev);
|
|
648
|
-
let shouldUpdate = false;
|
|
649
|
-
for (const key of trackedProps) if (prev[key] !== next[key]) {
|
|
650
|
-
shouldUpdate = true;
|
|
651
|
-
break;
|
|
652
|
-
}
|
|
653
|
-
if (shouldUpdate) setState(trackResult(next, addTrackedProp));
|
|
654
|
-
}, [addTrackedProp, trackedProps]);
|
|
655
|
-
const reset = __mf_24(() => {
|
|
656
|
-
var _currentSubscriptionR;
|
|
657
|
-
(_currentSubscriptionR = currentSubscriptionRef.current) === null || _currentSubscriptionR === void 0 || _currentSubscriptionR.unsubscribe();
|
|
658
|
-
if (!enabled) {
|
|
659
|
-
updateState(() => (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, initialStateIdle), {}, { reset }));
|
|
660
|
-
return;
|
|
661
|
-
}
|
|
662
|
-
updateState(() => (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, initialStateConnecting), {}, { reset }));
|
|
663
|
-
const subscription = client.subscription(path.join("."), input !== null && input !== void 0 ? input : void 0, {
|
|
664
|
-
onStarted: () => {
|
|
665
|
-
var _optsRef$current$onSt, _optsRef$current;
|
|
666
|
-
(_optsRef$current$onSt = (_optsRef$current = optsRef.current).onStarted) === null || _optsRef$current$onSt === void 0 || _optsRef$current$onSt.call(_optsRef$current);
|
|
667
|
-
updateState((prev) => (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, prev), {}, {
|
|
668
|
-
status: "pending",
|
|
669
|
-
error: null
|
|
670
|
-
}));
|
|
671
|
-
},
|
|
672
|
-
onData: (data) => {
|
|
673
|
-
var _optsRef$current$onDa, _optsRef$current2;
|
|
674
|
-
(_optsRef$current$onDa = (_optsRef$current2 = optsRef.current).onData) === null || _optsRef$current$onDa === void 0 || _optsRef$current$onDa.call(_optsRef$current2, data);
|
|
675
|
-
updateState((prev) => (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, prev), {}, {
|
|
676
|
-
status: "pending",
|
|
677
|
-
data,
|
|
678
|
-
error: null
|
|
679
|
-
}));
|
|
680
|
-
},
|
|
681
|
-
onError: (error) => {
|
|
682
|
-
var _optsRef$current$onEr, _optsRef$current3;
|
|
683
|
-
(_optsRef$current$onEr = (_optsRef$current3 = optsRef.current).onError) === null || _optsRef$current$onEr === void 0 || _optsRef$current$onEr.call(_optsRef$current3, error);
|
|
684
|
-
updateState((prev) => (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, prev), {}, {
|
|
685
|
-
status: "error",
|
|
686
|
-
error
|
|
687
|
-
}));
|
|
688
|
-
},
|
|
689
|
-
onConnectionStateChange: (result) => {
|
|
690
|
-
updateState((prev) => {
|
|
691
|
-
switch (result.state) {
|
|
692
|
-
case "idle":
|
|
693
|
-
return (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, prev), {}, {
|
|
694
|
-
status: result.state,
|
|
695
|
-
error: null,
|
|
696
|
-
data: void 0
|
|
697
|
-
});
|
|
698
|
-
case "connecting":
|
|
699
|
-
return (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, prev), {}, {
|
|
700
|
-
error: result.error,
|
|
701
|
-
status: result.state
|
|
702
|
-
});
|
|
703
|
-
case "pending":
|
|
704
|
-
return prev;
|
|
705
|
-
}
|
|
706
|
-
});
|
|
707
|
-
},
|
|
708
|
-
onComplete: () => {
|
|
709
|
-
var _optsRef$current$onCo, _optsRef$current4;
|
|
710
|
-
(_optsRef$current$onCo = (_optsRef$current4 = optsRef.current).onComplete) === null || _optsRef$current$onCo === void 0 || _optsRef$current$onCo.call(_optsRef$current4);
|
|
711
|
-
updateState((prev) => (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, prev), {}, {
|
|
712
|
-
status: "idle",
|
|
713
|
-
error: null,
|
|
714
|
-
data: void 0
|
|
715
|
-
}));
|
|
716
|
-
}
|
|
717
|
-
});
|
|
718
|
-
currentSubscriptionRef.current = subscription;
|
|
719
|
-
}, [
|
|
720
|
-
client,
|
|
721
|
-
queryKey,
|
|
722
|
-
enabled,
|
|
723
|
-
updateState
|
|
724
|
-
]);
|
|
725
|
-
__mf_28(() => {
|
|
726
|
-
reset();
|
|
727
|
-
return () => {
|
|
728
|
-
var _currentSubscriptionR2;
|
|
729
|
-
(_currentSubscriptionR2 = currentSubscriptionRef.current) === null || _currentSubscriptionR2 === void 0 || _currentSubscriptionR2.unsubscribe();
|
|
730
|
-
};
|
|
731
|
-
}, [reset]);
|
|
732
|
-
const resultRef = __mf_37(enabled ? (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, initialStateConnecting), {}, { reset }) : (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, initialStateIdle), {}, { reset }));
|
|
733
|
-
const [state, setState] = __mf_38(trackResult(resultRef.current, addTrackedProp));
|
|
734
|
-
return state;
|
|
735
|
-
}
|
|
736
|
-
function useInfiniteQuery$1(path, input, opts) {
|
|
737
|
-
var _opts$trpc5, _opts$enabled3, _opts$trpc$abortOnUnm4, _opts$trpc6, _opts$initialCursor;
|
|
738
|
-
const { client, ssrState, prefetchInfiniteQuery, queryClient, abortOnUnmount } = useContext();
|
|
739
|
-
const queryKey = getQueryKeyInternal(path, input, "infinite");
|
|
740
|
-
const defaultOpts = queryClient.getQueryDefaults(queryKey);
|
|
741
|
-
const isInputSkipToken = input === __mf_53;
|
|
742
|
-
if (typeof window === "undefined" && ssrState === "prepass" && (opts === null || opts === void 0 || (_opts$trpc5 = opts.trpc) === null || _opts$trpc5 === void 0 ? void 0 : _opts$trpc5.ssr) !== false && ((_opts$enabled3 = opts === null || opts === void 0 ? void 0 : opts.enabled) !== null && _opts$enabled3 !== void 0 ? _opts$enabled3 : defaultOpts === null || defaultOpts === void 0 ? void 0 : defaultOpts.enabled) !== false && !isInputSkipToken && !queryClient.getQueryCache().find({ queryKey })) prefetchInfiniteQuery(queryKey, (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, defaultOpts), opts));
|
|
743
|
-
const ssrOpts = useSSRQueryOptionsIfNeeded(queryKey, (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, defaultOpts), opts));
|
|
744
|
-
const shouldAbortOnUnmount = (_opts$trpc$abortOnUnm4 = opts === null || opts === void 0 || (_opts$trpc6 = opts.trpc) === null || _opts$trpc6 === void 0 ? void 0 : _opts$trpc6.abortOnUnmount) !== null && _opts$trpc$abortOnUnm4 !== void 0 ? _opts$trpc$abortOnUnm4 : abortOnUnmount;
|
|
745
|
-
const hook = __mf_8((0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, ssrOpts), {}, {
|
|
746
|
-
initialPageParam: (_opts$initialCursor = opts.initialCursor) !== null && _opts$initialCursor !== void 0 ? _opts$initialCursor : null,
|
|
747
|
-
persister: opts.persister,
|
|
748
|
-
queryKey,
|
|
749
|
-
queryFn: isInputSkipToken ? input : (queryFunctionContext) => {
|
|
750
|
-
var _queryFunctionContext;
|
|
751
|
-
const actualOpts = (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, ssrOpts), {}, { trpc: (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, ssrOpts === null || ssrOpts === void 0 ? void 0 : ssrOpts.trpc), shouldAbortOnUnmount ? { signal: queryFunctionContext.signal } : { signal: null }) });
|
|
752
|
-
return client.query(...getClientArgs(queryKey, actualOpts, {
|
|
753
|
-
pageParam: (_queryFunctionContext = queryFunctionContext.pageParam) !== null && _queryFunctionContext !== void 0 ? _queryFunctionContext : opts.initialCursor,
|
|
754
|
-
direction: queryFunctionContext.direction
|
|
755
|
-
}));
|
|
756
|
-
}
|
|
757
|
-
}), queryClient);
|
|
758
|
-
hook.trpc = useHookResult({ path });
|
|
759
|
-
return hook;
|
|
760
|
-
}
|
|
761
|
-
function usePrefetchInfiniteQuery$1(path, input, opts) {
|
|
762
|
-
var _opts$trpc$abortOnUnm5, _opts$trpc7, _opts$initialCursor2;
|
|
763
|
-
const context = useContext();
|
|
764
|
-
const queryKey = getQueryKeyInternal(path, input, "infinite");
|
|
765
|
-
const defaultOpts = context.queryClient.getQueryDefaults(queryKey);
|
|
766
|
-
const isInputSkipToken = input === __mf_53;
|
|
767
|
-
const ssrOpts = useSSRQueryOptionsIfNeeded(queryKey, (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, defaultOpts), opts));
|
|
768
|
-
const shouldAbortOnUnmount = (_opts$trpc$abortOnUnm5 = opts === null || opts === void 0 || (_opts$trpc7 = opts.trpc) === null || _opts$trpc7 === void 0 ? void 0 : _opts$trpc7.abortOnUnmount) !== null && _opts$trpc$abortOnUnm5 !== void 0 ? _opts$trpc$abortOnUnm5 : context.abortOnUnmount;
|
|
769
|
-
__mf_14((0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, opts), {}, {
|
|
770
|
-
initialPageParam: (_opts$initialCursor2 = opts.initialCursor) !== null && _opts$initialCursor2 !== void 0 ? _opts$initialCursor2 : null,
|
|
771
|
-
queryKey,
|
|
772
|
-
queryFn: isInputSkipToken ? input : (queryFunctionContext) => {
|
|
773
|
-
var _queryFunctionContext2;
|
|
774
|
-
const actualOpts = (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, ssrOpts), {}, { trpc: (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, ssrOpts === null || ssrOpts === void 0 ? void 0 : ssrOpts.trpc), shouldAbortOnUnmount ? { signal: queryFunctionContext.signal } : {}) });
|
|
775
|
-
return context.client.query(...getClientArgs(queryKey, actualOpts, {
|
|
776
|
-
pageParam: (_queryFunctionContext2 = queryFunctionContext.pageParam) !== null && _queryFunctionContext2 !== void 0 ? _queryFunctionContext2 : opts.initialCursor,
|
|
777
|
-
direction: queryFunctionContext.direction
|
|
778
|
-
}));
|
|
779
|
-
}
|
|
780
|
-
}));
|
|
781
|
-
}
|
|
782
|
-
function useSuspenseInfiniteQuery$1(path, input, opts) {
|
|
783
|
-
var _opts$trpc$abortOnUnm6, _opts$trpc8, _opts$initialCursor3;
|
|
784
|
-
const context = useContext();
|
|
785
|
-
const queryKey = getQueryKeyInternal(path, input, "infinite");
|
|
786
|
-
const defaultOpts = context.queryClient.getQueryDefaults(queryKey);
|
|
787
|
-
const ssrOpts = useSSRQueryOptionsIfNeeded(queryKey, (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, defaultOpts), opts));
|
|
788
|
-
const shouldAbortOnUnmount = (_opts$trpc$abortOnUnm6 = opts === null || opts === void 0 || (_opts$trpc8 = opts.trpc) === null || _opts$trpc8 === void 0 ? void 0 : _opts$trpc8.abortOnUnmount) !== null && _opts$trpc$abortOnUnm6 !== void 0 ? _opts$trpc$abortOnUnm6 : context.abortOnUnmount;
|
|
789
|
-
const hook = __mf_20((0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, opts), {}, {
|
|
790
|
-
initialPageParam: (_opts$initialCursor3 = opts.initialCursor) !== null && _opts$initialCursor3 !== void 0 ? _opts$initialCursor3 : null,
|
|
791
|
-
queryKey,
|
|
792
|
-
queryFn: (queryFunctionContext) => {
|
|
793
|
-
var _queryFunctionContext3;
|
|
794
|
-
const actualOpts = (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, ssrOpts), {}, { trpc: (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, ssrOpts === null || ssrOpts === void 0 ? void 0 : ssrOpts.trpc), shouldAbortOnUnmount ? { signal: queryFunctionContext.signal } : {}) });
|
|
795
|
-
return context.client.query(...getClientArgs(queryKey, actualOpts, {
|
|
796
|
-
pageParam: (_queryFunctionContext3 = queryFunctionContext.pageParam) !== null && _queryFunctionContext3 !== void 0 ? _queryFunctionContext3 : opts.initialCursor,
|
|
797
|
-
direction: queryFunctionContext.direction
|
|
798
|
-
}));
|
|
799
|
-
}
|
|
800
|
-
}), context.queryClient);
|
|
801
|
-
hook.trpc = useHookResult({ path });
|
|
802
|
-
return [hook.data, hook];
|
|
803
|
-
}
|
|
804
|
-
const useQueries$1 = (queriesCallback, options) => {
|
|
805
|
-
const { ssrState, queryClient, prefetchQuery, client } = useContext();
|
|
806
|
-
const proxy = createUseQueries(client);
|
|
807
|
-
const queries = queriesCallback(proxy);
|
|
808
|
-
if (typeof window === "undefined" && ssrState === "prepass") for (const query of queries) {
|
|
809
|
-
var _queryOption$trpc;
|
|
810
|
-
const queryOption = query;
|
|
811
|
-
if (((_queryOption$trpc = queryOption.trpc) === null || _queryOption$trpc === void 0 ? void 0 : _queryOption$trpc.ssr) !== false && !queryClient.getQueryCache().find({ queryKey: queryOption.queryKey })) prefetchQuery(queryOption.queryKey, queryOption);
|
|
812
|
-
}
|
|
813
|
-
return __mf_16({
|
|
814
|
-
queries: queries.map((query) => (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, query), {}, { queryKey: query.queryKey })),
|
|
815
|
-
combine: options === null || options === void 0 ? void 0 : options.combine
|
|
816
|
-
}, queryClient);
|
|
817
|
-
};
|
|
818
|
-
const useSuspenseQueries$1 = (queriesCallback) => {
|
|
819
|
-
const { queryClient, client } = useContext();
|
|
820
|
-
const proxy = createUseQueries(client);
|
|
821
|
-
const queries = queriesCallback(proxy);
|
|
822
|
-
const hook = __mf_21({ queries: queries.map((query) => (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, query), {}, {
|
|
823
|
-
queryFn: query.queryFn,
|
|
824
|
-
queryKey: query.queryKey
|
|
825
|
-
})) }, queryClient);
|
|
826
|
-
return [hook.map((h2) => h2.data), hook];
|
|
827
|
-
};
|
|
828
|
-
return {
|
|
829
|
-
Provider: TRPCProvider,
|
|
830
|
-
createClient,
|
|
831
|
-
useContext,
|
|
832
|
-
useUtils: useContext,
|
|
833
|
-
useQuery: useQuery$1,
|
|
834
|
-
usePrefetchQuery: usePrefetchQuery$1,
|
|
835
|
-
useSuspenseQuery: useSuspenseQuery$1,
|
|
836
|
-
useQueries: useQueries$1,
|
|
837
|
-
useSuspenseQueries: useSuspenseQueries$1,
|
|
838
|
-
useMutation: useMutation$1,
|
|
839
|
-
useSubscription,
|
|
840
|
-
useInfiniteQuery: useInfiniteQuery$1,
|
|
841
|
-
usePrefetchInfiniteQuery: usePrefetchInfiniteQuery$1,
|
|
842
|
-
useSuspenseInfiniteQuery: useSuspenseInfiniteQuery$1
|
|
843
|
-
};
|
|
844
|
-
}
|
|
845
|
-
function createHooksInternal(trpc) {
|
|
846
|
-
const proxy = createReactDecoration(trpc);
|
|
847
|
-
return createFlatProxy((key) => {
|
|
848
|
-
if (key === "useContext" || key === "useUtils") return () => {
|
|
849
|
-
const context = trpc.useUtils();
|
|
850
|
-
return __mf_34(() => {
|
|
851
|
-
return createReactQueryUtils(context);
|
|
852
|
-
}, [context]);
|
|
853
|
-
};
|
|
854
|
-
if (trpc.hasOwnProperty(key)) return trpc[key];
|
|
855
|
-
return proxy[key];
|
|
856
|
-
});
|
|
857
|
-
}
|
|
858
|
-
function createTRPCReact(opts) {
|
|
859
|
-
const hooks = createRootHooks(opts);
|
|
860
|
-
const proxy = createHooksInternal(hooks);
|
|
861
|
-
return proxy;
|
|
862
|
-
}
|
|
863
|
-
function createTRPCQueryUtils(opts) {
|
|
864
|
-
const utils = createUtilityFunctions(opts);
|
|
865
|
-
return createQueryUtilsProxy(utils);
|
|
866
|
-
}
|
|
867
|
-
export {
|
|
868
|
-
e as TRPCClientError,
|
|
869
|
-
__mf_1 as TRPCUntypedClient,
|
|
870
|
-
f as clientCallTypeToProcedureType,
|
|
871
|
-
__mf_3 as createTRPCClient,
|
|
872
|
-
__mf_4 as createTRPCClientProxy,
|
|
873
|
-
g as createTRPCProxyClient,
|
|
874
|
-
createTRPCQueryUtils,
|
|
875
|
-
createTRPCReact,
|
|
876
|
-
h as createTRPCUntypedClient,
|
|
877
|
-
i as createWSClient,
|
|
878
|
-
j as experimental_localLink,
|
|
879
|
-
k as getFetch,
|
|
880
|
-
getMutationKey,
|
|
881
|
-
getQueryKey,
|
|
882
|
-
__mf_10 as getUntypedClient,
|
|
883
|
-
l as httpBatchLink,
|
|
884
|
-
m as httpBatchStreamLink,
|
|
885
|
-
n as httpLink,
|
|
886
|
-
o as httpSubscriptionLink,
|
|
887
|
-
p as isFormData,
|
|
888
|
-
q as isNonJsonSerializable,
|
|
889
|
-
r as isOctetType,
|
|
890
|
-
s as isTRPCClientError,
|
|
891
|
-
t as jsonEncoder,
|
|
892
|
-
u as loggerLink,
|
|
893
|
-
v as retryLink,
|
|
894
|
-
w as splitLink,
|
|
895
|
-
x as unstable_httpBatchStreamLink,
|
|
896
|
-
y as unstable_httpSubscriptionLink,
|
|
897
|
-
z as unstable_localLink,
|
|
898
|
-
A as wsLink
|
|
899
|
-
};
|