@cartanova/qgrid-cli 2.6.11 → 2.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (153) hide show
  1. package/bundle/dist/_virtual/_rolldown/runtime.js +20 -1
  2. package/bundle/dist/application/qgrid/qgrid.dispatcher.js +17 -6
  3. package/bundle/dist/application/qgrid/qgrid.frame.js +1 -1
  4. package/bundle/dist/application/qgrid/schema-prompt.js +240 -0
  5. package/bundle/dist/application/qgrid/tool-emulation.js +7 -5
  6. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/2020.js +112 -0
  7. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/code.js +140 -0
  8. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/index.js +676 -0
  9. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/scope.js +143 -0
  10. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/errors.js +104 -0
  11. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/index.js +225 -0
  12. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/names.js +30 -0
  13. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/ref_error.js +20 -0
  14. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/resolve.js +135 -0
  15. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/rules.js +63 -0
  16. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/util.js +148 -0
  17. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/applicability.js +25 -0
  18. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/boolSchema.js +50 -0
  19. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/dataType.js +174 -0
  20. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/defaults.js +33 -0
  21. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/index.js +435 -0
  22. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/keyword.js +115 -0
  23. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/subschema.js +74 -0
  24. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/core.js +585 -0
  25. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/data.js +20 -0
  26. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/index.js +44 -0
  27. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.js +52 -0
  28. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.js +22 -0
  29. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.js +53 -0
  30. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.js +18 -0
  31. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.js +38 -0
  32. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.js +21 -0
  33. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.js +87 -0
  34. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/schema.js +61 -0
  35. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/equal.js +14 -0
  36. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/ucs2length.js +27 -0
  37. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/uri.js +14 -0
  38. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/validation_error.js +18 -0
  39. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +59 -0
  40. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +98 -0
  41. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/allOf.js +31 -0
  42. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +18 -0
  43. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/contains.js +91 -0
  44. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +89 -0
  45. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js +18 -0
  46. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/if.js +64 -0
  47. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/index.js +62 -0
  48. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/items.js +61 -0
  49. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/items2020.js +36 -0
  50. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/not.js +33 -0
  51. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +53 -0
  52. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +63 -0
  53. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +19 -0
  54. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/properties.js +54 -0
  55. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +43 -0
  56. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +19 -0
  57. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/code.js +132 -0
  58. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/id.js +16 -0
  59. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/index.js +24 -0
  60. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/ref.js +114 -0
  61. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/index.js +103 -0
  62. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/types.js +16 -0
  63. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/draft2020.js +37 -0
  64. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js +48 -0
  65. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js +47 -0
  66. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/index.js +24 -0
  67. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js +22 -0
  68. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js +17 -0
  69. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/format.js +94 -0
  70. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/index.js +12 -0
  71. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/metadata.js +25 -0
  72. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/next.js +21 -0
  73. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/unevaluated/index.js +15 -0
  74. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js +48 -0
  75. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js +61 -0
  76. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/const.js +29 -0
  77. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js +19 -0
  78. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/enum.js +51 -0
  79. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/index.js +50 -0
  80. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitContains.js +20 -0
  81. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitItems.js +30 -0
  82. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitLength.js +35 -0
  83. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +49 -0
  84. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +30 -0
  85. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +29 -0
  86. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/pattern.js +40 -0
  87. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/required.js +74 -0
  88. package/bundle/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +72 -0
  89. package/bundle/dist/node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js +35 -0
  90. package/bundle/dist/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/index.js +238 -0
  91. package/bundle/dist/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/schemes.js +189 -0
  92. package/bundle/dist/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/utils.js +284 -0
  93. package/bundle/dist/node_modules/.pnpm/json-schema-traverse@1.0.0/node_modules/json-schema-traverse/index.js +80 -0
  94. package/bundle/dist/testing/schema-bench.js +0 -0
  95. package/bundle/dist/utils/providers/anthropic/fence-strip.js +83 -0
  96. package/bundle/dist/utils/providers/anthropic/stream-json-adapter.js +3 -5
  97. package/bundle/src/application/qgrid/qgrid.dispatcher.test.ts +250 -34
  98. package/bundle/src/application/qgrid/qgrid.dispatcher.ts +36 -5
  99. package/bundle/src/application/qgrid/qgrid.frame.test.ts +120 -153
  100. package/bundle/src/application/qgrid/qgrid.frame.ts +2 -0
  101. package/bundle/src/application/qgrid/schema-prompt.test.ts +166 -0
  102. package/bundle/src/application/qgrid/schema-prompt.ts +293 -0
  103. package/bundle/src/application/qgrid/tool-emulation.test.ts +36 -0
  104. package/bundle/src/application/qgrid/tool-emulation.ts +19 -7
  105. package/bundle/src/testing/schema-bench.test.ts +358 -0
  106. package/bundle/src/testing/schema-bench.ts +352 -0
  107. package/bundle/src/utils/providers/anthropic/fence-strip.test.ts +122 -0
  108. package/bundle/src/utils/providers/anthropic/fence-strip.ts +105 -0
  109. package/bundle/src/utils/providers/anthropic/stream-json-adapter.ts +2 -8
  110. package/bundle/web-dist/client/assets/chat-icon-JYfue7fB.png +0 -0
  111. package/bundle/web-dist/client/assets/index-C0594sjh.js +106 -0
  112. package/bundle/web-dist/client/assets/index-CcMEpCgt.css +1 -0
  113. package/bundle/web-dist/client/assets/logs-BotUcOEB.js +1 -0
  114. package/bundle/web-dist/client/assets/monit-kk3vnGvu.js +1 -0
  115. package/bundle/web-dist/client/assets/{routes-DVseTo6T.js → routes-J4bnHVfl.js} +2 -2
  116. package/bundle/web-dist/client/assets/services.generated-jGypfumC.js +51 -0
  117. package/bundle/web-dist/client/assets/settings-CAAQSIyg.js +1 -0
  118. package/bundle/web-dist/client/assets/show-BryNvjUT.js +2 -0
  119. package/bundle/web-dist/client/assets/tokens-DDrATjGA.js +1 -0
  120. package/bundle/web-dist/client/assets/{use-oauth-login-flow-CuLvs_CW.js → use-oauth-login-flow-CptleCFM.js} +1 -1
  121. package/bundle/web-dist/client/index.html +3 -3
  122. package/bundle/web-dist/server/assets/{lazyRouteComponent-C-N6sd5N.js → lazyRouteComponent-DOc8TV-P.js} +2 -2
  123. package/bundle/web-dist/server/assets/{logs-CVkeSr1S.js → logs-CfF3nmLM.js} +3 -4
  124. package/bundle/web-dist/server/assets/{monit-Bb6QfT9V.js → monit-BSaKhh5D.js} +2 -3
  125. package/bundle/web-dist/server/assets/{plus-B8JRuCb9.js → plus-DLFUHsfx.js} +1 -1
  126. package/bundle/web-dist/server/assets/{react-dom-ByF9tqTB.js → react-dom-BotjLnTK.js} +1 -1
  127. package/bundle/web-dist/server/assets/{routes-Dnm-Eti6.js → routes-CHMxrTT0.js} +4 -5
  128. package/bundle/web-dist/server/assets/{sd.generated-CuyajYtc.js → services.generated-D3Q3FYot.js} +16008 -14698
  129. package/bundle/web-dist/server/assets/{settings-4T3nBfY8.js → settings-DOQjV28c.js} +5 -21
  130. package/bundle/web-dist/server/assets/show-Cn_C6Qvl.js +2776 -0
  131. package/bundle/web-dist/server/assets/{tokens-Di_SGPYj.js → tokens-c0EN3iCx.js} +4 -5
  132. package/bundle/web-dist/server/assets/{use-oauth-login-flow-DiYCMNAQ.js → use-oauth-login-flow-B68AbMDE.js} +1 -2
  133. package/bundle/web-dist/server/entry-server.generated.js +23856 -40
  134. package/package.json +1 -1
  135. package/skills/qgrid/references/ai-sdk-provider-contract.md +20 -15
  136. package/skills/qgrid/references/anthropic-claude-code-runtime.md +31 -14
  137. package/skills/qgrid/references/decision-rationale.md +13 -3
  138. package/skills/qgrid/references/prompt-cache-and-usage.md +4 -1
  139. package/skills/qgrid/references/provider-runtime-differences.md +3 -3
  140. package/skills/qgrid/references/tool-calling-and-multiturn.md +16 -6
  141. package/bundle/web-dist/client/assets/index-CFvFRDk_.js +0 -78
  142. package/bundle/web-dist/client/assets/index-CJ9iTI_V.css +0 -1
  143. package/bundle/web-dist/client/assets/logs-DeAK5Uyu.js +0 -1
  144. package/bundle/web-dist/client/assets/monit-Rj94Sz3_.js +0 -1
  145. package/bundle/web-dist/client/assets/sd.generated-W6XqgWK6.js +0 -51
  146. package/bundle/web-dist/client/assets/services.generated-Dz5pA5Fb.js +0 -1
  147. package/bundle/web-dist/client/assets/settings-DvuRDFfS.js +0 -1
  148. package/bundle/web-dist/client/assets/show-C7etBj89.js +0 -30
  149. package/bundle/web-dist/client/assets/tokens-BroPe7Tn.js +0 -1
  150. package/bundle/web-dist/server/assets/services.generated-BAGLi2r8.js +0 -1313
  151. package/bundle/web-dist/server/assets/show-CQw03iTP.js +0 -25968
  152. /package/bundle/web-dist/client/assets/{plus-p4vtg6LN.js → plus-DqBd6gHk.js} +0 -0
  153. /package/bundle/web-dist/server/assets/{cost-DzjfVtUr.js → cost-CSH_t17I.js} +0 -0
@@ -1,1313 +0,0 @@
1
- import { B as resolveStaleTime, C as infiniteQueryBehavior, D as notifyManager, G as timeoutManager, H as shouldThrowError, I as noop, K as focusManager, N as isValidTimeout, O as pendingThenable, R as replaceData, S as hasPreviousPage, T as fetchState, V as shallowEqualObjects, W as timeUntilStale, Z as __toESM, _ as require_jsx_runtime, a as fetch, b as getDefaultState, c as useSSEStream, g as useQueryClient, i as dedupeAndFlatten, j as hashKey, k as environmentManager, p as require_lib, q as Subscribable, s as useRefreshable, v as require_react, x as hasNextPage, z as resolveEnabled } from "./sd.generated-CuyajYtc.js";
2
- //#region ../../node_modules/.pnpm/@tanstack+query-core@5.95.2/node_modules/@tanstack/query-core/build/modern/queryObserver.js
3
- var QueryObserver = class extends Subscribable {
4
- constructor(client, options) {
5
- super();
6
- this.options = options;
7
- this.#client = client;
8
- this.#selectError = null;
9
- this.#currentThenable = pendingThenable();
10
- this.bindMethods();
11
- this.setOptions(options);
12
- }
13
- #client;
14
- #currentQuery = void 0;
15
- #currentQueryInitialState = void 0;
16
- #currentResult = void 0;
17
- #currentResultState;
18
- #currentResultOptions;
19
- #currentThenable;
20
- #selectError;
21
- #selectFn;
22
- #selectResult;
23
- #lastQueryWithDefinedData;
24
- #staleTimeoutId;
25
- #refetchIntervalId;
26
- #currentRefetchInterval;
27
- #trackedProps = /* @__PURE__ */ new Set();
28
- bindMethods() {
29
- this.refetch = this.refetch.bind(this);
30
- }
31
- onSubscribe() {
32
- if (this.listeners.size === 1) {
33
- this.#currentQuery.addObserver(this);
34
- if (shouldFetchOnMount(this.#currentQuery, this.options)) this.#executeFetch();
35
- else this.updateResult();
36
- this.#updateTimers();
37
- }
38
- }
39
- onUnsubscribe() {
40
- if (!this.hasListeners()) this.destroy();
41
- }
42
- shouldFetchOnReconnect() {
43
- return shouldFetchOn(this.#currentQuery, this.options, this.options.refetchOnReconnect);
44
- }
45
- shouldFetchOnWindowFocus() {
46
- return shouldFetchOn(this.#currentQuery, this.options, this.options.refetchOnWindowFocus);
47
- }
48
- destroy() {
49
- this.listeners = /* @__PURE__ */ new Set();
50
- this.#clearStaleTimeout();
51
- this.#clearRefetchInterval();
52
- this.#currentQuery.removeObserver(this);
53
- }
54
- setOptions(options) {
55
- const prevOptions = this.options;
56
- const prevQuery = this.#currentQuery;
57
- this.options = this.#client.defaultQueryOptions(options);
58
- if (this.options.enabled !== void 0 && typeof this.options.enabled !== "boolean" && typeof this.options.enabled !== "function" && typeof resolveEnabled(this.options.enabled, this.#currentQuery) !== "boolean") throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");
59
- this.#updateQuery();
60
- this.#currentQuery.setOptions(this.options);
61
- if (prevOptions._defaulted && !shallowEqualObjects(this.options, prevOptions)) this.#client.getQueryCache().notify({
62
- type: "observerOptionsUpdated",
63
- query: this.#currentQuery,
64
- observer: this
65
- });
66
- const mounted = this.hasListeners();
67
- if (mounted && shouldFetchOptionally(this.#currentQuery, prevQuery, this.options, prevOptions)) this.#executeFetch();
68
- this.updateResult();
69
- if (mounted && (this.#currentQuery !== prevQuery || resolveEnabled(this.options.enabled, this.#currentQuery) !== resolveEnabled(prevOptions.enabled, this.#currentQuery) || resolveStaleTime(this.options.staleTime, this.#currentQuery) !== resolveStaleTime(prevOptions.staleTime, this.#currentQuery))) this.#updateStaleTimeout();
70
- const nextRefetchInterval = this.#computeRefetchInterval();
71
- if (mounted && (this.#currentQuery !== prevQuery || resolveEnabled(this.options.enabled, this.#currentQuery) !== resolveEnabled(prevOptions.enabled, this.#currentQuery) || nextRefetchInterval !== this.#currentRefetchInterval)) this.#updateRefetchInterval(nextRefetchInterval);
72
- }
73
- getOptimisticResult(options) {
74
- const query = this.#client.getQueryCache().build(this.#client, options);
75
- const result = this.createResult(query, options);
76
- if (shouldAssignObserverCurrentProperties(this, result)) {
77
- this.#currentResult = result;
78
- this.#currentResultOptions = this.options;
79
- this.#currentResultState = this.#currentQuery.state;
80
- }
81
- return result;
82
- }
83
- getCurrentResult() {
84
- return this.#currentResult;
85
- }
86
- trackResult(result, onPropTracked) {
87
- return new Proxy(result, { get: (target, key) => {
88
- this.trackProp(key);
89
- onPropTracked?.(key);
90
- if (key === "promise") {
91
- this.trackProp("data");
92
- if (!this.options.experimental_prefetchInRender && this.#currentThenable.status === "pending") this.#currentThenable.reject(/* @__PURE__ */ new Error("experimental_prefetchInRender feature flag is not enabled"));
93
- }
94
- return Reflect.get(target, key);
95
- } });
96
- }
97
- trackProp(key) {
98
- this.#trackedProps.add(key);
99
- }
100
- getCurrentQuery() {
101
- return this.#currentQuery;
102
- }
103
- refetch({ ...options } = {}) {
104
- return this.fetch({ ...options });
105
- }
106
- fetchOptimistic(options) {
107
- const defaultedOptions = this.#client.defaultQueryOptions(options);
108
- const query = this.#client.getQueryCache().build(this.#client, defaultedOptions);
109
- return query.fetch().then(() => this.createResult(query, defaultedOptions));
110
- }
111
- fetch(fetchOptions) {
112
- return this.#executeFetch({
113
- ...fetchOptions,
114
- cancelRefetch: fetchOptions.cancelRefetch ?? true
115
- }).then(() => {
116
- this.updateResult();
117
- return this.#currentResult;
118
- });
119
- }
120
- #executeFetch(fetchOptions) {
121
- this.#updateQuery();
122
- let promise = this.#currentQuery.fetch(this.options, fetchOptions);
123
- if (!fetchOptions?.throwOnError) promise = promise.catch(noop);
124
- return promise;
125
- }
126
- #updateStaleTimeout() {
127
- this.#clearStaleTimeout();
128
- const staleTime = resolveStaleTime(this.options.staleTime, this.#currentQuery);
129
- if (environmentManager.isServer() || this.#currentResult.isStale || !isValidTimeout(staleTime)) return;
130
- const timeout = timeUntilStale(this.#currentResult.dataUpdatedAt, staleTime) + 1;
131
- this.#staleTimeoutId = timeoutManager.setTimeout(() => {
132
- if (!this.#currentResult.isStale) this.updateResult();
133
- }, timeout);
134
- }
135
- #computeRefetchInterval() {
136
- return (typeof this.options.refetchInterval === "function" ? this.options.refetchInterval(this.#currentQuery) : this.options.refetchInterval) ?? false;
137
- }
138
- #updateRefetchInterval(nextInterval) {
139
- this.#clearRefetchInterval();
140
- this.#currentRefetchInterval = nextInterval;
141
- if (environmentManager.isServer() || resolveEnabled(this.options.enabled, this.#currentQuery) === false || !isValidTimeout(this.#currentRefetchInterval) || this.#currentRefetchInterval === 0) return;
142
- this.#refetchIntervalId = timeoutManager.setInterval(() => {
143
- if (this.options.refetchIntervalInBackground || focusManager.isFocused()) this.#executeFetch();
144
- }, this.#currentRefetchInterval);
145
- }
146
- #updateTimers() {
147
- this.#updateStaleTimeout();
148
- this.#updateRefetchInterval(this.#computeRefetchInterval());
149
- }
150
- #clearStaleTimeout() {
151
- if (this.#staleTimeoutId) {
152
- timeoutManager.clearTimeout(this.#staleTimeoutId);
153
- this.#staleTimeoutId = void 0;
154
- }
155
- }
156
- #clearRefetchInterval() {
157
- if (this.#refetchIntervalId) {
158
- timeoutManager.clearInterval(this.#refetchIntervalId);
159
- this.#refetchIntervalId = void 0;
160
- }
161
- }
162
- createResult(query, options) {
163
- const prevQuery = this.#currentQuery;
164
- const prevOptions = this.options;
165
- const prevResult = this.#currentResult;
166
- const prevResultState = this.#currentResultState;
167
- const prevResultOptions = this.#currentResultOptions;
168
- const queryInitialState = query !== prevQuery ? query.state : this.#currentQueryInitialState;
169
- const { state } = query;
170
- let newState = { ...state };
171
- let isPlaceholderData = false;
172
- let data;
173
- if (options._optimisticResults) {
174
- const mounted = this.hasListeners();
175
- const fetchOnMount = !mounted && shouldFetchOnMount(query, options);
176
- const fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions);
177
- if (fetchOnMount || fetchOptionally) newState = {
178
- ...newState,
179
- ...fetchState(state.data, query.options)
180
- };
181
- if (options._optimisticResults === "isRestoring") newState.fetchStatus = "idle";
182
- }
183
- let { error, errorUpdatedAt, status } = newState;
184
- data = newState.data;
185
- let skipSelect = false;
186
- if (options.placeholderData !== void 0 && data === void 0 && status === "pending") {
187
- let placeholderData;
188
- if (prevResult?.isPlaceholderData && options.placeholderData === prevResultOptions?.placeholderData) {
189
- placeholderData = prevResult.data;
190
- skipSelect = true;
191
- } else placeholderData = typeof options.placeholderData === "function" ? options.placeholderData(this.#lastQueryWithDefinedData?.state.data, this.#lastQueryWithDefinedData) : options.placeholderData;
192
- if (placeholderData !== void 0) {
193
- status = "success";
194
- data = replaceData(prevResult?.data, placeholderData, options);
195
- isPlaceholderData = true;
196
- }
197
- }
198
- if (options.select && data !== void 0 && !skipSelect) if (prevResult && data === prevResultState?.data && options.select === this.#selectFn) data = this.#selectResult;
199
- else try {
200
- this.#selectFn = options.select;
201
- data = options.select(data);
202
- data = replaceData(prevResult?.data, data, options);
203
- this.#selectResult = data;
204
- this.#selectError = null;
205
- } catch (selectError) {
206
- this.#selectError = selectError;
207
- }
208
- if (this.#selectError) {
209
- error = this.#selectError;
210
- data = this.#selectResult;
211
- errorUpdatedAt = Date.now();
212
- status = "error";
213
- }
214
- const isFetching = newState.fetchStatus === "fetching";
215
- const isPending = status === "pending";
216
- const isError = status === "error";
217
- const isLoading = isPending && isFetching;
218
- const hasData = data !== void 0;
219
- const nextResult = {
220
- status,
221
- fetchStatus: newState.fetchStatus,
222
- isPending,
223
- isSuccess: status === "success",
224
- isError,
225
- isInitialLoading: isLoading,
226
- isLoading,
227
- data,
228
- dataUpdatedAt: newState.dataUpdatedAt,
229
- error,
230
- errorUpdatedAt,
231
- failureCount: newState.fetchFailureCount,
232
- failureReason: newState.fetchFailureReason,
233
- errorUpdateCount: newState.errorUpdateCount,
234
- isFetched: query.isFetched(),
235
- isFetchedAfterMount: newState.dataUpdateCount > queryInitialState.dataUpdateCount || newState.errorUpdateCount > queryInitialState.errorUpdateCount,
236
- isFetching,
237
- isRefetching: isFetching && !isPending,
238
- isLoadingError: isError && !hasData,
239
- isPaused: newState.fetchStatus === "paused",
240
- isPlaceholderData,
241
- isRefetchError: isError && hasData,
242
- isStale: isStale(query, options),
243
- refetch: this.refetch,
244
- promise: this.#currentThenable,
245
- isEnabled: resolveEnabled(options.enabled, query) !== false
246
- };
247
- if (this.options.experimental_prefetchInRender) {
248
- const hasResultData = nextResult.data !== void 0;
249
- const isErrorWithoutData = nextResult.status === "error" && !hasResultData;
250
- const finalizeThenableIfPossible = (thenable) => {
251
- if (isErrorWithoutData) thenable.reject(nextResult.error);
252
- else if (hasResultData) thenable.resolve(nextResult.data);
253
- };
254
- const recreateThenable = () => {
255
- finalizeThenableIfPossible(this.#currentThenable = nextResult.promise = pendingThenable());
256
- };
257
- const prevThenable = this.#currentThenable;
258
- switch (prevThenable.status) {
259
- case "pending":
260
- if (query.queryHash === prevQuery.queryHash) finalizeThenableIfPossible(prevThenable);
261
- break;
262
- case "fulfilled":
263
- if (isErrorWithoutData || nextResult.data !== prevThenable.value) recreateThenable();
264
- break;
265
- case "rejected":
266
- if (!isErrorWithoutData || nextResult.error !== prevThenable.reason) recreateThenable();
267
- break;
268
- }
269
- }
270
- return nextResult;
271
- }
272
- updateResult() {
273
- const prevResult = this.#currentResult;
274
- const nextResult = this.createResult(this.#currentQuery, this.options);
275
- this.#currentResultState = this.#currentQuery.state;
276
- this.#currentResultOptions = this.options;
277
- if (this.#currentResultState.data !== void 0) this.#lastQueryWithDefinedData = this.#currentQuery;
278
- if (shallowEqualObjects(nextResult, prevResult)) return;
279
- this.#currentResult = nextResult;
280
- const shouldNotifyListeners = () => {
281
- if (!prevResult) return true;
282
- const { notifyOnChangeProps } = this.options;
283
- const notifyOnChangePropsValue = typeof notifyOnChangeProps === "function" ? notifyOnChangeProps() : notifyOnChangeProps;
284
- if (notifyOnChangePropsValue === "all" || !notifyOnChangePropsValue && !this.#trackedProps.size) return true;
285
- const includedProps = new Set(notifyOnChangePropsValue ?? this.#trackedProps);
286
- if (this.options.throwOnError) includedProps.add("error");
287
- return Object.keys(this.#currentResult).some((key) => {
288
- const typedKey = key;
289
- return this.#currentResult[typedKey] !== prevResult[typedKey] && includedProps.has(typedKey);
290
- });
291
- };
292
- this.#notify({ listeners: shouldNotifyListeners() });
293
- }
294
- #updateQuery() {
295
- const query = this.#client.getQueryCache().build(this.#client, this.options);
296
- if (query === this.#currentQuery) return;
297
- const prevQuery = this.#currentQuery;
298
- this.#currentQuery = query;
299
- this.#currentQueryInitialState = query.state;
300
- if (this.hasListeners()) {
301
- prevQuery?.removeObserver(this);
302
- query.addObserver(this);
303
- }
304
- }
305
- onQueryUpdate() {
306
- this.updateResult();
307
- if (this.hasListeners()) this.#updateTimers();
308
- }
309
- #notify(notifyOptions) {
310
- notifyManager.batch(() => {
311
- if (notifyOptions.listeners) this.listeners.forEach((listener) => {
312
- listener(this.#currentResult);
313
- });
314
- this.#client.getQueryCache().notify({
315
- query: this.#currentQuery,
316
- type: "observerResultsUpdated"
317
- });
318
- });
319
- }
320
- };
321
- function shouldLoadOnMount(query, options) {
322
- return resolveEnabled(options.enabled, query) !== false && query.state.data === void 0 && !(query.state.status === "error" && options.retryOnMount === false);
323
- }
324
- function shouldFetchOnMount(query, options) {
325
- return shouldLoadOnMount(query, options) || query.state.data !== void 0 && shouldFetchOn(query, options, options.refetchOnMount);
326
- }
327
- function shouldFetchOn(query, options, field) {
328
- if (resolveEnabled(options.enabled, query) !== false && resolveStaleTime(options.staleTime, query) !== "static") {
329
- const value = typeof field === "function" ? field(query) : field;
330
- return value === "always" || value !== false && isStale(query, options);
331
- }
332
- return false;
333
- }
334
- function shouldFetchOptionally(query, prevQuery, options, prevOptions) {
335
- return (query !== prevQuery || resolveEnabled(prevOptions.enabled, query) === false) && (!options.suspense || query.state.status !== "error") && isStale(query, options);
336
- }
337
- function isStale(query, options) {
338
- return resolveEnabled(options.enabled, query) !== false && query.isStaleByTime(resolveStaleTime(options.staleTime, query));
339
- }
340
- function shouldAssignObserverCurrentProperties(observer, optimisticResult) {
341
- if (!shallowEqualObjects(observer.getCurrentResult(), optimisticResult)) return true;
342
- return false;
343
- }
344
- //#endregion
345
- //#region ../../node_modules/.pnpm/@tanstack+query-core@5.95.2/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.js
346
- var InfiniteQueryObserver = class extends QueryObserver {
347
- constructor(client, options) {
348
- super(client, options);
349
- }
350
- bindMethods() {
351
- super.bindMethods();
352
- this.fetchNextPage = this.fetchNextPage.bind(this);
353
- this.fetchPreviousPage = this.fetchPreviousPage.bind(this);
354
- }
355
- setOptions(options) {
356
- super.setOptions({
357
- ...options,
358
- behavior: infiniteQueryBehavior()
359
- });
360
- }
361
- getOptimisticResult(options) {
362
- options.behavior = infiniteQueryBehavior();
363
- return super.getOptimisticResult(options);
364
- }
365
- fetchNextPage(options) {
366
- return this.fetch({
367
- ...options,
368
- meta: { fetchMore: { direction: "forward" } }
369
- });
370
- }
371
- fetchPreviousPage(options) {
372
- return this.fetch({
373
- ...options,
374
- meta: { fetchMore: { direction: "backward" } }
375
- });
376
- }
377
- createResult(query, options) {
378
- const { state } = query;
379
- const parentResult = super.createResult(query, options);
380
- const { isFetching, isRefetching, isError, isRefetchError } = parentResult;
381
- const fetchDirection = state.fetchMeta?.fetchMore?.direction;
382
- const isFetchNextPageError = isError && fetchDirection === "forward";
383
- const isFetchingNextPage = isFetching && fetchDirection === "forward";
384
- const isFetchPreviousPageError = isError && fetchDirection === "backward";
385
- const isFetchingPreviousPage = isFetching && fetchDirection === "backward";
386
- return {
387
- ...parentResult,
388
- fetchNextPage: this.fetchNextPage,
389
- fetchPreviousPage: this.fetchPreviousPage,
390
- hasNextPage: hasNextPage(options, state.data),
391
- hasPreviousPage: hasPreviousPage(options, state.data),
392
- isFetchNextPageError,
393
- isFetchingNextPage,
394
- isFetchPreviousPageError,
395
- isFetchingPreviousPage,
396
- isRefetchError: isRefetchError && !isFetchNextPageError && !isFetchPreviousPageError,
397
- isRefetching: isRefetching && !isFetchingNextPage && !isFetchingPreviousPage
398
- };
399
- }
400
- };
401
- //#endregion
402
- //#region ../../node_modules/.pnpm/@tanstack+query-core@5.95.2/node_modules/@tanstack/query-core/build/modern/mutationObserver.js
403
- var MutationObserver = class extends Subscribable {
404
- #client;
405
- #currentResult = void 0;
406
- #currentMutation;
407
- #mutateOptions;
408
- constructor(client, options) {
409
- super();
410
- this.#client = client;
411
- this.setOptions(options);
412
- this.bindMethods();
413
- this.#updateResult();
414
- }
415
- bindMethods() {
416
- this.mutate = this.mutate.bind(this);
417
- this.reset = this.reset.bind(this);
418
- }
419
- setOptions(options) {
420
- const prevOptions = this.options;
421
- this.options = this.#client.defaultMutationOptions(options);
422
- if (!shallowEqualObjects(this.options, prevOptions)) this.#client.getMutationCache().notify({
423
- type: "observerOptionsUpdated",
424
- mutation: this.#currentMutation,
425
- observer: this
426
- });
427
- if (prevOptions?.mutationKey && this.options.mutationKey && hashKey(prevOptions.mutationKey) !== hashKey(this.options.mutationKey)) this.reset();
428
- else if (this.#currentMutation?.state.status === "pending") this.#currentMutation.setOptions(this.options);
429
- }
430
- onUnsubscribe() {
431
- if (!this.hasListeners()) this.#currentMutation?.removeObserver(this);
432
- }
433
- onMutationUpdate(action) {
434
- this.#updateResult();
435
- this.#notify(action);
436
- }
437
- getCurrentResult() {
438
- return this.#currentResult;
439
- }
440
- reset() {
441
- this.#currentMutation?.removeObserver(this);
442
- this.#currentMutation = void 0;
443
- this.#updateResult();
444
- this.#notify();
445
- }
446
- mutate(variables, options) {
447
- this.#mutateOptions = options;
448
- this.#currentMutation?.removeObserver(this);
449
- this.#currentMutation = this.#client.getMutationCache().build(this.#client, this.options);
450
- this.#currentMutation.addObserver(this);
451
- return this.#currentMutation.execute(variables);
452
- }
453
- #updateResult() {
454
- const state = this.#currentMutation?.state ?? getDefaultState();
455
- this.#currentResult = {
456
- ...state,
457
- isPending: state.status === "pending",
458
- isSuccess: state.status === "success",
459
- isError: state.status === "error",
460
- isIdle: state.status === "idle",
461
- mutate: this.mutate,
462
- reset: this.reset
463
- };
464
- }
465
- #notify(action) {
466
- notifyManager.batch(() => {
467
- if (this.#mutateOptions && this.hasListeners()) {
468
- const variables = this.#currentResult.variables;
469
- const onMutateResult = this.#currentResult.context;
470
- const context = {
471
- client: this.#client,
472
- meta: this.options.meta,
473
- mutationKey: this.options.mutationKey
474
- };
475
- if (action?.type === "success") {
476
- try {
477
- this.#mutateOptions.onSuccess?.(action.data, variables, onMutateResult, context);
478
- } catch (e) {
479
- Promise.reject(e);
480
- }
481
- try {
482
- this.#mutateOptions.onSettled?.(action.data, null, variables, onMutateResult, context);
483
- } catch (e) {
484
- Promise.reject(e);
485
- }
486
- } else if (action?.type === "error") {
487
- try {
488
- this.#mutateOptions.onError?.(action.error, variables, onMutateResult, context);
489
- } catch (e) {
490
- Promise.reject(e);
491
- }
492
- try {
493
- this.#mutateOptions.onSettled?.(void 0, action.error, variables, onMutateResult, context);
494
- } catch (e) {
495
- Promise.reject(e);
496
- }
497
- }
498
- }
499
- this.listeners.forEach((listener) => {
500
- listener(this.#currentResult);
501
- });
502
- });
503
- }
504
- };
505
- //#endregion
506
- //#region ../../node_modules/.pnpm/@tanstack+react-query@5.95.2_react@19.2.4/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.js
507
- var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
508
- var IsRestoringContext = import_react.createContext(false);
509
- var useIsRestoring = () => import_react.useContext(IsRestoringContext);
510
- IsRestoringContext.Provider;
511
- require_jsx_runtime();
512
- function createValue() {
513
- let isReset = false;
514
- return {
515
- clearReset: () => {
516
- isReset = false;
517
- },
518
- reset: () => {
519
- isReset = true;
520
- },
521
- isReset: () => {
522
- return isReset;
523
- }
524
- };
525
- }
526
- var QueryErrorResetBoundaryContext = import_react.createContext(createValue());
527
- var useQueryErrorResetBoundary = () => import_react.useContext(QueryErrorResetBoundaryContext);
528
- //#endregion
529
- //#region ../../node_modules/.pnpm/@tanstack+react-query@5.95.2_react@19.2.4/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js
530
- var ensurePreventErrorBoundaryRetry = (options, errorResetBoundary, query) => {
531
- const throwOnError = query?.state.error && typeof options.throwOnError === "function" ? shouldThrowError(options.throwOnError, [query.state.error, query]) : options.throwOnError;
532
- if (options.suspense || options.experimental_prefetchInRender || throwOnError) {
533
- if (!errorResetBoundary.isReset()) options.retryOnMount = false;
534
- }
535
- };
536
- var useClearResetErrorBoundary = (errorResetBoundary) => {
537
- import_react.useEffect(() => {
538
- errorResetBoundary.clearReset();
539
- }, [errorResetBoundary]);
540
- };
541
- var getHasError = ({ result, errorResetBoundary, throwOnError, query, suspense }) => {
542
- return result.isError && !errorResetBoundary.isReset() && !result.isFetching && query && (suspense && result.data === void 0 || shouldThrowError(throwOnError, [result.error, query]));
543
- };
544
- //#endregion
545
- //#region ../../node_modules/.pnpm/@tanstack+react-query@5.95.2_react@19.2.4/node_modules/@tanstack/react-query/build/modern/suspense.js
546
- var ensureSuspenseTimers = (defaultedOptions) => {
547
- if (defaultedOptions.suspense) {
548
- const MIN_SUSPENSE_TIME_MS = 1e3;
549
- const clamp = (value) => value === "static" ? value : Math.max(value ?? MIN_SUSPENSE_TIME_MS, MIN_SUSPENSE_TIME_MS);
550
- const originalStaleTime = defaultedOptions.staleTime;
551
- defaultedOptions.staleTime = typeof originalStaleTime === "function" ? (...args) => clamp(originalStaleTime(...args)) : clamp(originalStaleTime);
552
- if (typeof defaultedOptions.gcTime === "number") defaultedOptions.gcTime = Math.max(defaultedOptions.gcTime, MIN_SUSPENSE_TIME_MS);
553
- }
554
- };
555
- var willFetch = (result, isRestoring) => result.isLoading && result.isFetching && !isRestoring;
556
- var shouldSuspend = (defaultedOptions, result) => defaultedOptions?.suspense && result.isPending;
557
- var fetchOptimistic = (defaultedOptions, observer, errorResetBoundary) => observer.fetchOptimistic(defaultedOptions).catch(() => {
558
- errorResetBoundary.clearReset();
559
- });
560
- //#endregion
561
- //#region ../../node_modules/.pnpm/@tanstack+react-query@5.95.2_react@19.2.4/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js
562
- function useBaseQuery(options, Observer, queryClient) {
563
- if (process.env.NODE_ENV !== "production") {
564
- if (typeof options !== "object" || Array.isArray(options)) throw new Error("Bad argument type. Starting with v5, only the \"Object\" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object");
565
- }
566
- const isRestoring = useIsRestoring();
567
- const errorResetBoundary = useQueryErrorResetBoundary();
568
- const client = useQueryClient(queryClient);
569
- const defaultedOptions = client.defaultQueryOptions(options);
570
- client.getDefaultOptions().queries?._experimental_beforeQuery?.(defaultedOptions);
571
- const query = client.getQueryCache().get(defaultedOptions.queryHash);
572
- if (process.env.NODE_ENV !== "production") {
573
- if (!defaultedOptions.queryFn) console.error(`[${defaultedOptions.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`);
574
- }
575
- defaultedOptions._optimisticResults = isRestoring ? "isRestoring" : "optimistic";
576
- ensureSuspenseTimers(defaultedOptions);
577
- ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary, query);
578
- useClearResetErrorBoundary(errorResetBoundary);
579
- const isNewCacheEntry = !client.getQueryCache().get(defaultedOptions.queryHash);
580
- const [observer] = import_react.useState(() => new Observer(client, defaultedOptions));
581
- const result = observer.getOptimisticResult(defaultedOptions);
582
- const shouldSubscribe = !isRestoring && options.subscribed !== false;
583
- import_react.useSyncExternalStore(import_react.useCallback((onStoreChange) => {
584
- const unsubscribe = shouldSubscribe ? observer.subscribe(notifyManager.batchCalls(onStoreChange)) : noop;
585
- observer.updateResult();
586
- return unsubscribe;
587
- }, [observer, shouldSubscribe]), () => observer.getCurrentResult(), () => observer.getCurrentResult());
588
- import_react.useEffect(() => {
589
- observer.setOptions(defaultedOptions);
590
- }, [defaultedOptions, observer]);
591
- if (shouldSuspend(defaultedOptions, result)) throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary);
592
- if (getHasError({
593
- result,
594
- errorResetBoundary,
595
- throwOnError: defaultedOptions.throwOnError,
596
- query,
597
- suspense: defaultedOptions.suspense
598
- })) throw result.error;
599
- client.getDefaultOptions().queries?._experimental_afterQuery?.(defaultedOptions, result);
600
- if (defaultedOptions.experimental_prefetchInRender && !environmentManager.isServer() && willFetch(result, isRestoring)) (isNewCacheEntry ? fetchOptimistic(defaultedOptions, observer, errorResetBoundary) : query?.promise)?.catch(noop).finally(() => {
601
- observer.updateResult();
602
- });
603
- return !defaultedOptions.notifyOnChangeProps ? observer.trackResult(result) : result;
604
- }
605
- //#endregion
606
- //#region ../../node_modules/.pnpm/@tanstack+react-query@5.95.2_react@19.2.4/node_modules/@tanstack/react-query/build/modern/useQuery.js
607
- function useQuery(options, queryClient) {
608
- return useBaseQuery(options, QueryObserver, queryClient);
609
- }
610
- //#endregion
611
- //#region ../../node_modules/.pnpm/@tanstack+react-query@5.95.2_react@19.2.4/node_modules/@tanstack/react-query/build/modern/queryOptions.js
612
- function queryOptions(options) {
613
- return options;
614
- }
615
- //#endregion
616
- //#region ../../node_modules/.pnpm/@tanstack+react-query@5.95.2_react@19.2.4/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.js
617
- function infiniteQueryOptions(options) {
618
- return options;
619
- }
620
- //#endregion
621
- //#region ../../node_modules/.pnpm/@tanstack+react-query@5.95.2_react@19.2.4/node_modules/@tanstack/react-query/build/modern/useMutation.js
622
- function useMutation(options, queryClient) {
623
- const client = useQueryClient(queryClient);
624
- const [observer] = import_react.useState(() => new MutationObserver(client, options));
625
- import_react.useEffect(() => {
626
- observer.setOptions(options);
627
- }, [observer, options]);
628
- const result = import_react.useSyncExternalStore(import_react.useCallback((onStoreChange) => observer.subscribe(notifyManager.batchCalls(onStoreChange)), [observer]), () => observer.getCurrentResult(), () => observer.getCurrentResult());
629
- const mutate = import_react.useCallback((variables, mutateOptions) => {
630
- observer.mutate(variables, mutateOptions).catch(noop);
631
- }, [observer]);
632
- if (result.error && shouldThrowError(observer.options.throwOnError, [result.error])) throw result.error;
633
- return {
634
- ...result,
635
- mutate,
636
- mutateAsync: result.mutate
637
- };
638
- }
639
- //#endregion
640
- //#region ../../node_modules/.pnpm/@tanstack+react-query@5.95.2_react@19.2.4/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.js
641
- function useInfiniteQuery(options, queryClient) {
642
- return useBaseQuery(options, InfiniteQueryObserver, queryClient);
643
- }
644
- //#endregion
645
- //#region src/services/services.generated.ts
646
- var import_lib = /* @__PURE__ */ __toESM(require_lib(), 1);
647
- var TokenService;
648
- (function(_TokenService) {
649
- async function getToken(subset, id) {
650
- return fetch({
651
- method: "GET",
652
- url: `/api/token/findById?${import_lib.default.stringify({
653
- subset,
654
- id
655
- })}`
656
- });
657
- }
658
- _TokenService.getToken = getToken;
659
- const getTokenQueryOptions = _TokenService.getTokenQueryOptions = (subset, id) => queryOptions({
660
- queryKey: [
661
- "Token",
662
- "getToken",
663
- subset,
664
- id
665
- ],
666
- queryFn: () => getToken(subset, id)
667
- });
668
- _TokenService.useToken = (subset, id, options) => useRefreshable(useQuery({
669
- ...getTokenQueryOptions(subset, id),
670
- ...options
671
- }));
672
- async function getTokens(subset, rawParams) {
673
- return fetch({
674
- method: "GET",
675
- url: `/api/token/findMany?${import_lib.default.stringify({
676
- subset,
677
- rawParams
678
- })}`
679
- });
680
- }
681
- _TokenService.getTokens = getTokens;
682
- const getTokensQueryOptions = _TokenService.getTokensQueryOptions = (subset, rawParams) => queryOptions({
683
- queryKey: [
684
- "Token",
685
- "getTokens",
686
- subset,
687
- rawParams
688
- ],
689
- queryFn: () => getTokens(subset, rawParams)
690
- });
691
- _TokenService.useTokens = (subset, rawParams, options) => useRefreshable(useQuery({
692
- ...getTokensQueryOptions(subset, rawParams),
693
- ...options
694
- }));
695
- const getTokensInfiniteQueryOptions = _TokenService.getTokensInfiniteQueryOptions = (subset, rawParams) => infiniteQueryOptions({
696
- queryKey: [
697
- "Token",
698
- "getTokens",
699
- "infinite",
700
- subset,
701
- rawParams
702
- ],
703
- queryFn: ({ pageParam }) => getTokens(subset, {
704
- ...rawParams,
705
- page: pageParam
706
- }),
707
- initialPageParam: 1,
708
- getNextPageParam: (lastPage, allPages) => {
709
- const total = lastPage?.total ?? 0;
710
- return allPages.reduce((sum, p) => sum + (p?.rows?.length ?? 0), 0) < total ? allPages.length + 1 : void 0;
711
- },
712
- select: dedupeAndFlatten
713
- });
714
- _TokenService.useTokensInfinite = (subset, rawParams, options) => useRefreshable(useInfiniteQuery({
715
- ...getTokensInfiniteQueryOptions(subset, rawParams),
716
- ...options
717
- }));
718
- async function save(spa) {
719
- return fetch({
720
- method: "POST",
721
- url: `/api/token/save`,
722
- data: { spa }
723
- });
724
- }
725
- _TokenService.save = save;
726
- _TokenService.useSaveMutation = () => useMutation({ mutationFn: (params) => save(params.spa) });
727
- async function reorder(ids) {
728
- return fetch({
729
- method: "POST",
730
- url: `/api/token/reorder`,
731
- data: { ids }
732
- });
733
- }
734
- _TokenService.reorder = reorder;
735
- _TokenService.useReorderMutation = () => useMutation({ mutationFn: (params) => reorder(params.ids) });
736
- async function del(ids) {
737
- return fetch({
738
- method: "POST",
739
- url: `/api/token/del`,
740
- data: { ids }
741
- });
742
- }
743
- _TokenService.del = del;
744
- _TokenService.useDelMutation = () => useMutation({ mutationFn: (params) => del(params.ids) });
745
- })(TokenService || (TokenService = {}));
746
- var SettingService;
747
- (function(_SettingService) {
748
- async function getSetting(subset, id) {
749
- return fetch({
750
- method: "GET",
751
- url: `/api/setting/findById?${import_lib.default.stringify({
752
- subset,
753
- id
754
- })}`
755
- });
756
- }
757
- _SettingService.getSetting = getSetting;
758
- const getSettingQueryOptions = _SettingService.getSettingQueryOptions = (subset, id) => queryOptions({
759
- queryKey: [
760
- "Setting",
761
- "getSetting",
762
- subset,
763
- id
764
- ],
765
- queryFn: () => getSetting(subset, id)
766
- });
767
- _SettingService.useSetting = (subset, id, options) => useRefreshable(useQuery({
768
- ...getSettingQueryOptions(subset, id),
769
- ...options
770
- }));
771
- async function getSettings(subset, rawParams) {
772
- return fetch({
773
- method: "GET",
774
- url: `/api/setting/findMany?${import_lib.default.stringify({
775
- subset,
776
- rawParams
777
- })}`
778
- });
779
- }
780
- _SettingService.getSettings = getSettings;
781
- const getSettingsQueryOptions = _SettingService.getSettingsQueryOptions = (subset, rawParams) => queryOptions({
782
- queryKey: [
783
- "Setting",
784
- "getSettings",
785
- subset,
786
- rawParams
787
- ],
788
- queryFn: () => getSettings(subset, rawParams)
789
- });
790
- _SettingService.useSettings = (subset, rawParams, options) => useRefreshable(useQuery({
791
- ...getSettingsQueryOptions(subset, rawParams),
792
- ...options
793
- }));
794
- const getSettingsInfiniteQueryOptions = _SettingService.getSettingsInfiniteQueryOptions = (subset, rawParams) => infiniteQueryOptions({
795
- queryKey: [
796
- "Setting",
797
- "getSettings",
798
- "infinite",
799
- subset,
800
- rawParams
801
- ],
802
- queryFn: ({ pageParam }) => getSettings(subset, {
803
- ...rawParams,
804
- page: pageParam
805
- }),
806
- initialPageParam: 1,
807
- getNextPageParam: (lastPage, allPages) => {
808
- const total = lastPage?.total ?? 0;
809
- return allPages.reduce((sum, p) => sum + (p?.rows?.length ?? 0), 0) < total ? allPages.length + 1 : void 0;
810
- },
811
- select: dedupeAndFlatten
812
- });
813
- _SettingService.useSettingsInfinite = (subset, rawParams, options) => useRefreshable(useInfiniteQuery({
814
- ...getSettingsInfiniteQueryOptions(subset, rawParams),
815
- ...options
816
- }));
817
- async function getSettingList() {
818
- return fetch({
819
- method: "GET",
820
- url: `/api/setting/listSettings`
821
- });
822
- }
823
- _SettingService.getSettingList = getSettingList;
824
- const getSettingListQueryOptions = _SettingService.getSettingListQueryOptions = () => queryOptions({
825
- queryKey: ["Setting", "getSettingList"],
826
- queryFn: () => getSettingList()
827
- });
828
- _SettingService.useSettingList = (options) => useRefreshable(useQuery({
829
- ...getSettingListQueryOptions(),
830
- ...options
831
- }));
832
- async function updateSetting(key, value) {
833
- return fetch({
834
- method: "POST",
835
- url: `/api/setting/updateSetting`,
836
- data: {
837
- key,
838
- value
839
- }
840
- });
841
- }
842
- _SettingService.updateSetting = updateSetting;
843
- _SettingService.useUpdateSettingMutation = () => useMutation({ mutationFn: (params) => updateSetting(params.key, params.value) });
844
- async function resetSetting(key) {
845
- return fetch({
846
- method: "POST",
847
- url: `/api/setting/resetSetting`,
848
- data: { key }
849
- });
850
- }
851
- _SettingService.resetSetting = resetSetting;
852
- _SettingService.useResetSettingMutation = () => useMutation({ mutationFn: (params) => resetSetting(params.key) });
853
- async function triggerExpiryReminder() {
854
- return fetch({
855
- method: "POST",
856
- url: `/api/setting/triggerExpiryReminder`
857
- });
858
- }
859
- _SettingService.triggerExpiryReminder = triggerExpiryReminder;
860
- _SettingService.useTriggerExpiryReminderMutation = () => useMutation({ mutationFn: (params) => triggerExpiryReminder() });
861
- async function restartServer() {
862
- return fetch({
863
- method: "POST",
864
- url: `/api/setting/restartServer`
865
- });
866
- }
867
- _SettingService.restartServer = restartServer;
868
- _SettingService.useRestartServerMutation = () => useMutation({ mutationFn: (params) => restartServer() });
869
- })(SettingService || (SettingService = {}));
870
- var RequestLogStepService;
871
- (function(_RequestLogStepService) {
872
- async function getRequestLogStep(subset, id) {
873
- return fetch({
874
- method: "GET",
875
- url: `/api/requestLogStep/findById?${import_lib.default.stringify({
876
- subset,
877
- id
878
- })}`
879
- });
880
- }
881
- _RequestLogStepService.getRequestLogStep = getRequestLogStep;
882
- const getRequestLogStepQueryOptions = _RequestLogStepService.getRequestLogStepQueryOptions = (subset, id) => queryOptions({
883
- queryKey: [
884
- "RequestLogStep",
885
- "getRequestLogStep",
886
- subset,
887
- id
888
- ],
889
- queryFn: () => getRequestLogStep(subset, id)
890
- });
891
- _RequestLogStepService.useRequestLogStep = (subset, id, options) => useRefreshable(useQuery({
892
- ...getRequestLogStepQueryOptions(subset, id),
893
- ...options
894
- }));
895
- async function getRequestLogSteps(subset, rawParams) {
896
- return fetch({
897
- method: "GET",
898
- url: `/api/requestLogStep/findMany?${import_lib.default.stringify({
899
- subset,
900
- rawParams
901
- })}`
902
- });
903
- }
904
- _RequestLogStepService.getRequestLogSteps = getRequestLogSteps;
905
- const getRequestLogStepsQueryOptions = _RequestLogStepService.getRequestLogStepsQueryOptions = (subset, rawParams) => queryOptions({
906
- queryKey: [
907
- "RequestLogStep",
908
- "getRequestLogSteps",
909
- subset,
910
- rawParams
911
- ],
912
- queryFn: () => getRequestLogSteps(subset, rawParams)
913
- });
914
- _RequestLogStepService.useRequestLogSteps = (subset, rawParams, options) => useRefreshable(useQuery({
915
- ...getRequestLogStepsQueryOptions(subset, rawParams),
916
- ...options
917
- }));
918
- const getRequestLogStepsInfiniteQueryOptions = _RequestLogStepService.getRequestLogStepsInfiniteQueryOptions = (subset, rawParams) => infiniteQueryOptions({
919
- queryKey: [
920
- "RequestLogStep",
921
- "getRequestLogSteps",
922
- "infinite",
923
- subset,
924
- rawParams
925
- ],
926
- queryFn: ({ pageParam }) => getRequestLogSteps(subset, {
927
- ...rawParams,
928
- page: pageParam
929
- }),
930
- initialPageParam: 1,
931
- getNextPageParam: (lastPage, allPages) => {
932
- const total = lastPage?.total ?? 0;
933
- return allPages.reduce((sum, p) => sum + (p?.rows?.length ?? 0), 0) < total ? allPages.length + 1 : void 0;
934
- },
935
- select: dedupeAndFlatten
936
- });
937
- _RequestLogStepService.useRequestLogStepsInfinite = (subset, rawParams, options) => useRefreshable(useInfiniteQuery({
938
- ...getRequestLogStepsInfiniteQueryOptions(subset, rawParams),
939
- ...options
940
- }));
941
- async function save(spa) {
942
- return fetch({
943
- method: "POST",
944
- url: `/api/requestLogStep/save`,
945
- data: { spa }
946
- });
947
- }
948
- _RequestLogStepService.save = save;
949
- _RequestLogStepService.useSaveMutation = () => useMutation({ mutationFn: (params) => save(params.spa) });
950
- async function del(ids) {
951
- return fetch({
952
- method: "POST",
953
- url: `/api/requestLogStep/del`,
954
- data: { ids }
955
- });
956
- }
957
- _RequestLogStepService.del = del;
958
- _RequestLogStepService.useDelMutation = () => useMutation({ mutationFn: (params) => del(params.ids) });
959
- })(RequestLogStepService || (RequestLogStepService = {}));
960
- var RequestLogService;
961
- (function(_RequestLogService) {
962
- async function getRequestLog(subset, id) {
963
- return fetch({
964
- method: "GET",
965
- url: `/api/requestLog/findById?${import_lib.default.stringify({
966
- subset,
967
- id
968
- })}`
969
- });
970
- }
971
- _RequestLogService.getRequestLog = getRequestLog;
972
- const getRequestLogQueryOptions = _RequestLogService.getRequestLogQueryOptions = (subset, id) => queryOptions({
973
- queryKey: [
974
- "RequestLog",
975
- "getRequestLog",
976
- subset,
977
- id
978
- ],
979
- queryFn: () => getRequestLog(subset, id)
980
- });
981
- _RequestLogService.useRequestLog = (subset, id, options) => useRefreshable(useQuery({
982
- ...getRequestLogQueryOptions(subset, id),
983
- ...options
984
- }));
985
- async function getRequestLogs(subset, rawParams) {
986
- return fetch({
987
- method: "GET",
988
- url: `/api/requestLog/findMany?${import_lib.default.stringify({
989
- subset,
990
- rawParams
991
- })}`
992
- });
993
- }
994
- _RequestLogService.getRequestLogs = getRequestLogs;
995
- const getRequestLogsQueryOptions = _RequestLogService.getRequestLogsQueryOptions = (subset, rawParams) => queryOptions({
996
- queryKey: [
997
- "RequestLog",
998
- "getRequestLogs",
999
- subset,
1000
- rawParams
1001
- ],
1002
- queryFn: () => getRequestLogs(subset, rawParams)
1003
- });
1004
- _RequestLogService.useRequestLogs = (subset, rawParams, options) => useRefreshable(useQuery({
1005
- ...getRequestLogsQueryOptions(subset, rawParams),
1006
- ...options
1007
- }));
1008
- const getRequestLogsInfiniteQueryOptions = _RequestLogService.getRequestLogsInfiniteQueryOptions = (subset, rawParams) => infiniteQueryOptions({
1009
- queryKey: [
1010
- "RequestLog",
1011
- "getRequestLogs",
1012
- "infinite",
1013
- subset,
1014
- rawParams
1015
- ],
1016
- queryFn: ({ pageParam }) => getRequestLogs(subset, {
1017
- ...rawParams,
1018
- page: pageParam
1019
- }),
1020
- initialPageParam: 1,
1021
- getNextPageParam: (lastPage, allPages) => {
1022
- const total = lastPage?.total ?? 0;
1023
- return allPages.reduce((sum, p) => sum + (p?.rows?.length ?? 0), 0) < total ? allPages.length + 1 : void 0;
1024
- },
1025
- select: dedupeAndFlatten
1026
- });
1027
- _RequestLogService.useRequestLogsInfinite = (subset, rawParams, options) => useRefreshable(useInfiniteQuery({
1028
- ...getRequestLogsInfiniteQueryOptions(subset, rawParams),
1029
- ...options
1030
- }));
1031
- async function save(spa) {
1032
- return fetch({
1033
- method: "POST",
1034
- url: `/api/requestLog/save`,
1035
- data: { spa }
1036
- });
1037
- }
1038
- _RequestLogService.save = save;
1039
- _RequestLogService.useSaveMutation = () => useMutation({ mutationFn: (params) => save(params.spa) });
1040
- async function del(ids) {
1041
- return fetch({
1042
- method: "POST",
1043
- url: `/api/requestLog/del`,
1044
- data: { ids }
1045
- });
1046
- }
1047
- _RequestLogService.del = del;
1048
- _RequestLogService.useDelMutation = () => useMutation({ mutationFn: (params) => del(params.ids) });
1049
- })(RequestLogService || (RequestLogService = {}));
1050
- var QgridService;
1051
- (function(_QgridService) {
1052
- async function query(args) {
1053
- return fetch({
1054
- method: "POST",
1055
- url: `/api/qgrid/query`,
1056
- data: { args }
1057
- });
1058
- }
1059
- _QgridService.query = query;
1060
- _QgridService.useQueryMutation = () => useMutation({ mutationFn: (params) => query(params.args) });
1061
- async function prepareStream(args) {
1062
- return fetch({
1063
- method: "POST",
1064
- url: `/api/qgrid/prepareStream`,
1065
- data: { args }
1066
- });
1067
- }
1068
- _QgridService.prepareStream = prepareStream;
1069
- _QgridService.usePrepareStreamMutation = () => useMutation({ mutationFn: (params) => prepareStream(params.args) });
1070
- function useQueryStream(params, handlers, options) {
1071
- return useSSEStream(`/api/qgrid/queryStream`, params, handlers, options);
1072
- }
1073
- _QgridService.useQueryStream = useQueryStream;
1074
- async function createRun(input) {
1075
- return fetch({
1076
- method: "POST",
1077
- url: `/api/qgrid/createRun`,
1078
- data: { input }
1079
- });
1080
- }
1081
- _QgridService.createRun = createRun;
1082
- _QgridService.useCreateRunMutation = () => useMutation({ mutationFn: (params) => createRun(params.input) });
1083
- async function appendStep(input) {
1084
- return fetch({
1085
- method: "POST",
1086
- url: `/api/qgrid/appendStep`,
1087
- data: { input }
1088
- });
1089
- }
1090
- _QgridService.appendStep = appendStep;
1091
- _QgridService.useAppendStepMutation = () => useMutation({ mutationFn: (params) => appendStep(params.input) });
1092
- async function finishRun(input) {
1093
- return fetch({
1094
- method: "POST",
1095
- url: `/api/qgrid/finishRun`,
1096
- data: { input }
1097
- });
1098
- }
1099
- _QgridService.finishRun = finishRun;
1100
- _QgridService.useFinishRunMutation = () => useMutation({ mutationFn: (params) => finishRun(params.input) });
1101
- async function stats() {
1102
- return fetch({
1103
- method: "GET",
1104
- url: `/api/qgrid/stats`
1105
- });
1106
- }
1107
- _QgridService.stats = stats;
1108
- const statsQueryOptions = _QgridService.statsQueryOptions = () => queryOptions({
1109
- queryKey: ["Qgrid", "stats"],
1110
- queryFn: () => stats()
1111
- });
1112
- _QgridService.useStats = (options) => useRefreshable(useQuery({
1113
- ...statsQueryOptions(),
1114
- ...options
1115
- }));
1116
- async function totalCost(params) {
1117
- return fetch({
1118
- method: "GET",
1119
- url: `/api/qgrid/totalCost?${import_lib.default.stringify({ params })}`
1120
- });
1121
- }
1122
- _QgridService.totalCost = totalCost;
1123
- const totalCostQueryOptions = _QgridService.totalCostQueryOptions = (params) => queryOptions({
1124
- queryKey: [
1125
- "Qgrid",
1126
- "totalCost",
1127
- params
1128
- ],
1129
- queryFn: () => totalCost(params)
1130
- });
1131
- _QgridService.useTotalCost = (params, options) => useRefreshable(useQuery({
1132
- ...totalCostQueryOptions(params),
1133
- ...options
1134
- }));
1135
- async function projectNames() {
1136
- return fetch({
1137
- method: "GET",
1138
- url: `/api/qgrid/projectNames`
1139
- });
1140
- }
1141
- _QgridService.projectNames = projectNames;
1142
- const projectNamesQueryOptions = _QgridService.projectNamesQueryOptions = () => queryOptions({
1143
- queryKey: ["Qgrid", "projectNames"],
1144
- queryFn: () => projectNames()
1145
- });
1146
- _QgridService.useProjectNames = (options) => useRefreshable(useQuery({
1147
- ...projectNamesQueryOptions(),
1148
- ...options
1149
- }));
1150
- async function modelNames() {
1151
- return fetch({
1152
- method: "GET",
1153
- url: `/api/qgrid/modelNames`
1154
- });
1155
- }
1156
- _QgridService.modelNames = modelNames;
1157
- const modelNamesQueryOptions = _QgridService.modelNamesQueryOptions = () => queryOptions({
1158
- queryKey: ["Qgrid", "modelNames"],
1159
- queryFn: () => modelNames()
1160
- });
1161
- _QgridService.useModelNames = (options) => useRefreshable(useQuery({
1162
- ...modelNamesQueryOptions(),
1163
- ...options
1164
- }));
1165
- async function addToken(provider, credentials, name) {
1166
- return fetch({
1167
- method: "POST",
1168
- url: `/api/qgrid/addToken`,
1169
- data: {
1170
- provider,
1171
- credentials,
1172
- name
1173
- }
1174
- });
1175
- }
1176
- _QgridService.addToken = addToken;
1177
- _QgridService.useAddTokenMutation = () => useMutation({ mutationFn: (params) => addToken(params.provider, params.credentials, params.name) });
1178
- async function updateToken(id, name, quotaThreshold, weight) {
1179
- return fetch({
1180
- method: "POST",
1181
- url: `/api/qgrid/updateToken`,
1182
- data: {
1183
- id,
1184
- name,
1185
- quotaThreshold,
1186
- weight
1187
- }
1188
- });
1189
- }
1190
- _QgridService.updateToken = updateToken;
1191
- async function removeToken(id) {
1192
- return fetch({
1193
- method: "POST",
1194
- url: `/api/qgrid/removeToken`,
1195
- data: { id }
1196
- });
1197
- }
1198
- _QgridService.removeToken = removeToken;
1199
- _QgridService.useRemoveTokenMutation = () => useMutation({ mutationFn: (params) => removeToken(params.id) });
1200
- async function toggleToken(id) {
1201
- return fetch({
1202
- method: "POST",
1203
- url: `/api/qgrid/toggleToken`,
1204
- data: { id }
1205
- });
1206
- }
1207
- _QgridService.toggleToken = toggleToken;
1208
- _QgridService.useToggleTokenMutation = () => useMutation({ mutationFn: (params) => toggleToken(params.id) });
1209
- async function oauthStart(name) {
1210
- return fetch({
1211
- method: "POST",
1212
- url: `/api/qgrid/oauthStart`,
1213
- data: { name }
1214
- });
1215
- }
1216
- _QgridService.oauthStart = oauthStart;
1217
- _QgridService.useOauthStartMutation = () => useMutation({ mutationFn: (params) => oauthStart(params.name) });
1218
- async function oauthComplete(pastedCode) {
1219
- return fetch({
1220
- method: "POST",
1221
- url: `/api/qgrid/oauthComplete`,
1222
- data: { pastedCode }
1223
- });
1224
- }
1225
- _QgridService.oauthComplete = oauthComplete;
1226
- _QgridService.useOauthCompleteMutation = () => useMutation({ mutationFn: (params) => oauthComplete(params.pastedCode) });
1227
- async function oauthStartOpenAI(name) {
1228
- return fetch({
1229
- method: "POST",
1230
- url: `/api/qgrid/oauthStartOpenAI`,
1231
- data: { name }
1232
- });
1233
- }
1234
- _QgridService.oauthStartOpenAI = oauthStartOpenAI;
1235
- _QgridService.useOauthStartOpenAIMutation = () => useMutation({ mutationFn: (params) => oauthStartOpenAI(params.name) });
1236
- async function usage(tokenId) {
1237
- return fetch({
1238
- method: "GET",
1239
- url: `/api/qgrid/usage?${import_lib.default.stringify({ tokenId })}`
1240
- });
1241
- }
1242
- _QgridService.usage = usage;
1243
- const usageQueryOptions = _QgridService.usageQueryOptions = (tokenId) => queryOptions({
1244
- queryKey: [
1245
- "Qgrid",
1246
- "usage",
1247
- tokenId
1248
- ],
1249
- queryFn: () => usage(tokenId)
1250
- });
1251
- _QgridService.useUsage = (tokenId, options) => useRefreshable(useQuery({
1252
- ...usageQueryOptions(tokenId),
1253
- ...options
1254
- }));
1255
- async function health() {
1256
- return fetch({
1257
- method: "GET",
1258
- url: `/api/qgrid/health`
1259
- });
1260
- }
1261
- _QgridService.health = health;
1262
- const healthQueryOptions = _QgridService.healthQueryOptions = () => queryOptions({
1263
- queryKey: ["Qgrid", "health"],
1264
- queryFn: () => health()
1265
- });
1266
- _QgridService.useHealth = (options) => useRefreshable(useQuery({
1267
- ...healthQueryOptions(),
1268
- ...options
1269
- }));
1270
- })(QgridService || (QgridService = {}));
1271
- var MonitService;
1272
- (function(_MonitService) {
1273
- async function monitLogs(cursor) {
1274
- return fetch({
1275
- method: "GET",
1276
- url: `/api/monit/monitLogs?${import_lib.default.stringify({ cursor })}`
1277
- });
1278
- }
1279
- _MonitService.monitLogs = monitLogs;
1280
- const monitLogsQueryOptions = _MonitService.monitLogsQueryOptions = (cursor) => queryOptions({
1281
- queryKey: [
1282
- "Monit",
1283
- "monitLogs",
1284
- cursor
1285
- ],
1286
- queryFn: () => monitLogs(cursor)
1287
- });
1288
- _MonitService.useMonitLogs = (cursor, options) => useRefreshable(useQuery({
1289
- ...monitLogsQueryOptions(cursor),
1290
- ...options
1291
- }));
1292
- async function monitInfo() {
1293
- return fetch({
1294
- method: "GET",
1295
- url: `/api/monit/monitInfo`
1296
- });
1297
- }
1298
- _MonitService.monitInfo = monitInfo;
1299
- const monitInfoQueryOptions = _MonitService.monitInfoQueryOptions = () => queryOptions({
1300
- queryKey: ["Monit", "monitInfo"],
1301
- queryFn: () => monitInfo()
1302
- });
1303
- _MonitService.useMonitInfo = (options) => useRefreshable(useQuery({
1304
- ...monitInfoQueryOptions(),
1305
- ...options
1306
- }));
1307
- })(MonitService || (MonitService = {}));
1308
- RequestLogService.useRequestLogs, RequestLogService.useRequestLogsInfinite;
1309
- RequestLogStepService.useRequestLogSteps, RequestLogStepService.useRequestLogStepsInfinite;
1310
- SettingService.useSettings, SettingService.useSettingsInfinite;
1311
- TokenService.useTokens, TokenService.useTokensInfinite;
1312
- //#endregion
1313
- export { SettingService as a, useQuery as c, RequestLogStepService as i, QgridService as n, TokenService as o, RequestLogService as r, useMutation as s, MonitService as t };