@evolver-fi/evolver-basics-admin-components 1.0.0 → 8.2.2-alpha.2

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 (198) hide show
  1. package/dist/EnumSelectFilter-DDWIjz5i.js +35 -0
  2. package/dist/EnumSelectFilter-DDWIjz5i.js.map +1 -0
  3. package/dist/FilterLink-OxQDWR5G.js +29 -0
  4. package/dist/FilterLink-OxQDWR5G.js.map +1 -0
  5. package/dist/Table-IciQttr3.js +79 -0
  6. package/dist/Table-IciQttr3.js.map +1 -0
  7. package/dist/TableMetadataDisplay-BM61EulC.js +49 -0
  8. package/dist/TableMetadataDisplay-BM61EulC.js.map +1 -0
  9. package/dist/TextFilter-CLOKjiSd.js +54 -0
  10. package/dist/TextFilter-CLOKjiSd.js.map +1 -0
  11. package/dist/api-CMiZYkfc.js +32 -0
  12. package/dist/api-CMiZYkfc.js.map +1 -0
  13. package/dist/breadcrumbs/index.js +2 -5
  14. package/dist/breadcrumbs-BAwnKRxL.js +32 -0
  15. package/dist/breadcrumbs-BAwnKRxL.js.map +1 -0
  16. package/dist/breadcrumbs.css +1 -0
  17. package/dist/client/index.js +330 -369
  18. package/dist/client/index.js.map +1 -1
  19. package/dist/configuration-values/index.js +2 -13
  20. package/dist/configuration-values-CjOfmPRq.js +3464 -0
  21. package/dist/configuration-values-CjOfmPRq.js.map +1 -0
  22. package/dist/control-values/index.js +2 -10
  23. package/dist/control-values-CzQOB4WJ.js +144 -0
  24. package/dist/control-values-CzQOB4WJ.js.map +1 -0
  25. package/dist/exhaustiveValues-BYWkg9M1.js +6 -0
  26. package/dist/exhaustiveValues-BYWkg9M1.js.map +1 -0
  27. package/dist/filter/index.js +4 -10
  28. package/dist/formData-BO275hRZ.js +43 -0
  29. package/dist/formData-BO275hRZ.js.map +1 -0
  30. package/dist/jwt-tokens/index.js +2 -9
  31. package/dist/jwt-tokens-DnKsHei4.js +71 -0
  32. package/dist/jwt-tokens-DnKsHei4.js.map +1 -0
  33. package/dist/main/index.js +17 -87
  34. package/dist/message-log/index.js +2 -12
  35. package/dist/message-log-BdrJtbsP.js +337 -0
  36. package/dist/message-log-BdrJtbsP.js.map +1 -0
  37. package/dist/message-sending/index.js +2 -10
  38. package/dist/message-sending-dvTw2fFm.js +181 -0
  39. package/dist/message-sending-dvTw2fFm.js.map +1 -0
  40. package/dist/message-targets/index.js +2 -15
  41. package/dist/message-targets-8EppIJde.js +406 -0
  42. package/dist/message-targets-8EppIJde.js.map +1 -0
  43. package/dist/pagination-C4QUYRMf.js +20 -0
  44. package/dist/pagination-C4QUYRMf.js.map +1 -0
  45. package/dist/scheduled-tasks/index.js +2 -16
  46. package/dist/scheduled-tasks-BtBnBrE7.js +647 -0
  47. package/dist/scheduled-tasks-BtBnBrE7.js.map +1 -0
  48. package/dist/schemas-D-8_LuND.js +2986 -0
  49. package/dist/schemas-D-8_LuND.js.map +1 -0
  50. package/dist/table/index.js +2 -6
  51. package/dist/triggerables/index.js +3 -11
  52. package/dist/triggerables-DgrIeQMi.js +51 -0
  53. package/dist/triggerables-DgrIeQMi.js.map +1 -0
  54. package/dist/types/breadcrumbs.d.ts +1 -0
  55. package/dist/types/client/index.d.ts +5 -0
  56. package/dist/types/client.d.ts +1 -0
  57. package/dist/types/common/exhaustiveValues.d.ts +5 -0
  58. package/dist/types/common/formData.d.ts +20 -0
  59. package/dist/types/common/format.d.ts +1 -0
  60. package/dist/types/common/pagination.d.ts +8 -0
  61. package/dist/types/common/types.d.ts +27 -0
  62. package/dist/types/common/validation.d.ts +5 -0
  63. package/dist/types/components/breadcrumbs/BreadCrumbs.d.ts +10 -0
  64. package/dist/types/components/breadcrumbs/index.d.ts +1 -0
  65. package/dist/types/components/filter/EnumSelectFilter.d.ts +7 -0
  66. package/dist/types/components/filter/FilterHelperTexts.d.ts +4 -0
  67. package/dist/types/components/filter/FilterLink.d.ts +2 -0
  68. package/dist/types/components/filter/TextFilter.d.ts +2 -0
  69. package/dist/types/components/filter/createEnumSelectFilter.d.ts +5 -0
  70. package/dist/types/components/filter/index.d.ts +5 -0
  71. package/dist/types/components/filter/types.d.ts +20 -0
  72. package/dist/types/components/metadata/TableMetadataDisplay.d.ts +2 -0
  73. package/dist/types/components/metadata/utils.d.ts +1 -0
  74. package/dist/types/components/table/Pagination.d.ts +7 -0
  75. package/dist/types/components/table/Table.d.ts +3 -0
  76. package/dist/types/components/table/index.d.ts +3 -0
  77. package/dist/types/components/table/types.d.ts +48 -0
  78. package/dist/types/configuration-values.d.ts +1 -0
  79. package/dist/types/control-values.d.ts +1 -0
  80. package/dist/types/filter.d.ts +1 -0
  81. package/dist/types/index.d.ts +11 -0
  82. package/dist/types/jwt-tokens.d.ts +1 -0
  83. package/dist/types/main.d.ts +1 -0
  84. package/dist/types/message-log.d.ts +1 -0
  85. package/dist/types/message-sending.d.ts +1 -0
  86. package/dist/types/message-targets.d.ts +1 -0
  87. package/dist/types/routes/configuration-values/ConfigurationValueFormRoute.d.ts +2 -0
  88. package/dist/types/routes/configuration-values/ConfigurationValuesRoute.d.ts +2 -0
  89. package/dist/types/routes/configuration-values/action.d.ts +8 -0
  90. package/dist/types/routes/configuration-values/api.d.ts +53 -0
  91. package/dist/types/routes/configuration-values/configurationValueColumns.d.ts +4 -0
  92. package/dist/types/routes/configuration-values/index.d.ts +5 -0
  93. package/dist/types/routes/configuration-values/loader.d.ts +52 -0
  94. package/dist/types/routes/control-values/ControlValuesRoute.d.ts +2 -0
  95. package/dist/types/routes/control-values/SingleControlValueRoute.d.ts +2 -0
  96. package/dist/types/routes/control-values/api.d.ts +43 -0
  97. package/dist/types/routes/control-values/controlValueColumns.d.ts +4 -0
  98. package/dist/types/routes/control-values/index.d.ts +4 -0
  99. package/dist/types/routes/control-values/loader.d.ts +43 -0
  100. package/dist/types/routes/jwt-tokens/JwtTokensRoute.d.ts +6 -0
  101. package/dist/types/routes/jwt-tokens/api.d.ts +41 -0
  102. package/dist/types/routes/jwt-tokens/index.d.ts +3 -0
  103. package/dist/types/routes/jwt-tokens/loader.d.ts +35 -0
  104. package/dist/types/routes/message-log/LogBodyLink.d.ts +6 -0
  105. package/dist/types/routes/message-log/MessageLogRoute.d.ts +2 -0
  106. package/dist/types/routes/message-log/SingleLogMessageRoute.d.ts +6 -0
  107. package/dist/types/routes/message-log/api.d.ts +88 -0
  108. package/dist/types/routes/message-log/index.d.ts +4 -0
  109. package/dist/types/routes/message-log/loader.d.ts +53 -0
  110. package/dist/types/routes/message-log/messageLogColumns.d.ts +3 -0
  111. package/dist/types/routes/message-log/types.d.ts +37 -0
  112. package/dist/types/routes/message-sending/MessageSendingRoute.d.ts +2 -0
  113. package/dist/types/routes/message-sending/SingleMessageRoute.d.ts +2 -0
  114. package/dist/types/routes/message-sending/api.d.ts +92 -0
  115. package/dist/types/routes/message-sending/index.d.ts +4 -0
  116. package/dist/types/routes/message-sending/loader.d.ts +34 -0
  117. package/dist/types/routes/message-sending/messageSendingColumns.d.ts +3 -0
  118. package/dist/types/routes/message-sending/types.d.ts +43 -0
  119. package/dist/types/routes/message-targets/MessageTargetFormRoute.d.ts +2 -0
  120. package/dist/types/routes/message-targets/MessageTargetsRoute.d.ts +2 -0
  121. package/dist/types/routes/message-targets/action.d.ts +8 -0
  122. package/dist/types/routes/message-targets/api.d.ts +12 -0
  123. package/dist/types/routes/message-targets/index.d.ts +5 -0
  124. package/dist/types/routes/message-targets/loader.d.ts +15 -0
  125. package/dist/types/routes/scheduled-tasks/ScheduledTaskFormRoute.d.ts +2 -0
  126. package/dist/types/routes/scheduled-tasks/ScheduledTasksRoute.d.ts +2 -0
  127. package/dist/types/routes/scheduled-tasks/action.d.ts +21 -0
  128. package/dist/types/routes/scheduled-tasks/api.d.ts +75 -0
  129. package/dist/types/routes/scheduled-tasks/index.d.ts +5 -0
  130. package/dist/types/routes/scheduled-tasks/loader.d.ts +57 -0
  131. package/dist/types/routes/scheduled-tasks/parseScheduledTask.d.ts +15 -0
  132. package/dist/types/routes/triggerables/TriggerablesRoute.d.ts +2 -0
  133. package/dist/types/routes/triggerables/action.d.ts +6 -0
  134. package/dist/types/routes/triggerables/api.d.ts +33 -0
  135. package/dist/types/routes/triggerables/index.d.ts +4 -0
  136. package/dist/types/routes/triggerables/loader.d.ts +3 -0
  137. package/dist/types/scheduled-tasks.d.ts +1 -0
  138. package/dist/types/table.d.ts +1 -0
  139. package/dist/types/triggerables.d.ts +1 -0
  140. package/dist/types/types/openapiTypes.d.ts +3321 -0
  141. package/package.json +12 -5
  142. package/dist/ArrowBack-Bifnzxvs.js +0 -6430
  143. package/dist/ArrowBack-Bifnzxvs.js.map +0 -1
  144. package/dist/BreadCrumbs-DMuPCevY.js +0 -19
  145. package/dist/BreadCrumbs-DMuPCevY.js.map +0 -1
  146. package/dist/BreadCrumbs.css +0 -1
  147. package/dist/EnumSelectFilter-BdGla5Yf.js +0 -36
  148. package/dist/EnumSelectFilter-BdGla5Yf.js.map +0 -1
  149. package/dist/ExpandMore-DUn2zrFA.js +0 -1644
  150. package/dist/ExpandMore-DUn2zrFA.js.map +0 -1
  151. package/dist/FilterLink-DIeFjfZX.js +0 -49
  152. package/dist/FilterLink-DIeFjfZX.js.map +0 -1
  153. package/dist/JwtTokensRoute-C74zNV7A.js +0 -2374
  154. package/dist/JwtTokensRoute-C74zNV7A.js.map +0 -1
  155. package/dist/ScheduledTasksRoute-BAetDHqN.js +0 -611
  156. package/dist/ScheduledTasksRoute-BAetDHqN.js.map +0 -1
  157. package/dist/SingleLogMessageRoute-Dl2NFfqG.js +0 -419
  158. package/dist/SingleLogMessageRoute-Dl2NFfqG.js.map +0 -1
  159. package/dist/SingleMessageRoute-fC94BR1C.js +0 -306
  160. package/dist/SingleMessageRoute-fC94BR1C.js.map +0 -1
  161. package/dist/Table-DWiRP1za.js +0 -120
  162. package/dist/Table-DWiRP1za.js.map +0 -1
  163. package/dist/TextFilter-BHWY2B7i.js +0 -67
  164. package/dist/TextFilter-BHWY2B7i.js.map +0 -1
  165. package/dist/TriggerablesRoute-DiEEX1cR.js +0 -3552
  166. package/dist/TriggerablesRoute-DiEEX1cR.js.map +0 -1
  167. package/dist/api-BD_4zyJw.js +0 -38
  168. package/dist/api-BD_4zyJw.js.map +0 -1
  169. package/dist/breadcrumbs/index.js.map +0 -1
  170. package/dist/configuration-values/index.js.map +0 -1
  171. package/dist/control-values/index.js.map +0 -1
  172. package/dist/createSvgIcon-dA_Vj2W0.js +0 -3914
  173. package/dist/createSvgIcon-dA_Vj2W0.js.map +0 -1
  174. package/dist/exhaustiveValues-Dx50G3yz.js +0 -5
  175. package/dist/exhaustiveValues-Dx50G3yz.js.map +0 -1
  176. package/dist/filter/index.js.map +0 -1
  177. package/dist/formData-BH8saYep.js +0 -65
  178. package/dist/formData-BH8saYep.js.map +0 -1
  179. package/dist/jsx-runtime-D858t2LC.js +0 -617
  180. package/dist/jsx-runtime-D858t2LC.js.map +0 -1
  181. package/dist/jwt-tokens/index.js.map +0 -1
  182. package/dist/loader-CrveWlGb.js +0 -375
  183. package/dist/loader-CrveWlGb.js.map +0 -1
  184. package/dist/loader-D-oC32OJ.js +0 -3612
  185. package/dist/loader-D-oC32OJ.js.map +0 -1
  186. package/dist/loader-rVy8Z9xH.js +0 -130
  187. package/dist/loader-rVy8Z9xH.js.map +0 -1
  188. package/dist/main/index.js.map +0 -1
  189. package/dist/message-log/index.js.map +0 -1
  190. package/dist/message-sending/index.js.map +0 -1
  191. package/dist/message-targets/index.js.map +0 -1
  192. package/dist/pagination-Dy4ansKN.js +0 -21
  193. package/dist/pagination-Dy4ansKN.js.map +0 -1
  194. package/dist/scheduled-tasks/index.js.map +0 -1
  195. package/dist/schemas-CBHIJ_eF.js +0 -3059
  196. package/dist/schemas-CBHIJ_eF.js.map +0 -1
  197. package/dist/table/index.js.map +0 -1
  198. package/dist/triggerables/index.js.map +0 -1
@@ -1,380 +1,341 @@
1
- const V = /\{[^{}]+\}/g, X = () => typeof process == "object" && Number.parseInt(process?.versions?.node?.substring(0, 2)) >= 18 && process.versions.undici;
2
- function Y() {
3
- return Math.random().toString(36).slice(2, 11);
1
+ //#region ../node_modules/openapi-fetch/dist/index.mjs
2
+ var e = /\{[^{}]+\}/g, t = () => typeof process == "object" && Number.parseInt(process?.versions?.node?.substring(0, 2)) >= 18 && process.versions.undici;
3
+ function n() {
4
+ return Math.random().toString(36).slice(2, 11);
4
5
  }
5
- function Z(n) {
6
- let {
7
- baseUrl: t = "",
8
- Request: e = globalThis.Request,
9
- fetch: o = globalThis.fetch,
10
- querySerializer: r,
11
- bodySerializer: i,
12
- pathSerializer: l,
13
- headers: u,
14
- requestInitExt: $ = void 0,
15
- ...J
16
- } = { ...n };
17
- $ = X() ? $ : void 0, t = F(t);
18
- const g = [];
19
- async function p(a, s) {
20
- const {
21
- baseUrl: m,
22
- fetch: O = o,
23
- Request: D = e,
24
- headers: I,
25
- params: w = {},
26
- parseAs: j = "json",
27
- querySerializer: S,
28
- bodySerializer: H = i ?? te,
29
- pathSerializer: Q,
30
- body: P,
31
- middleware: G = [],
32
- ...x
33
- } = s || {};
34
- let A = t;
35
- m && (A = F(m) ?? t);
36
- let v = typeof r == "function" ? r : M(r);
37
- S && (v = typeof S == "function" ? S : M({
38
- ...typeof r == "object" ? r : {},
39
- ...S
40
- }));
41
- const k = Q || l || ee, U = P === void 0 ? void 0 : H(
42
- P,
43
- // Note: we declare mergeHeaders() both here and below because it’s a bit of a chicken-or-egg situation:
44
- // bodySerializer() needs all headers so we aren’t dropping ones set by the user, however,
45
- // the result of this ALSO sets the lowest-priority content-type header. So we re-merge below,
46
- // setting the content-type at the very beginning to be overwritten.
47
- // Lastly, based on the way headers work, it’s not a simple “present-or-not” check becauase null intentionally un-sets headers.
48
- N(u, I, w.header)
49
- ), _ = N(
50
- // with no body, we should not to set Content-Type
51
- U === void 0 || // if serialized body is FormData; browser will correctly set Content-Type & boundary expression
52
- U instanceof FormData ? {} : {
53
- "Content-Type": "application/json"
54
- },
55
- u,
56
- I,
57
- w.header
58
- ), y = [...g, ...G], K = {
59
- redirect: "follow",
60
- ...J,
61
- ...x,
62
- body: U,
63
- headers: _
64
- };
65
- let E, z, h = new D(
66
- re(a, { baseUrl: A, params: w, querySerializer: v, pathSerializer: k }),
67
- K
68
- ), c;
69
- for (const d in x)
70
- d in h || (h[d] = x[d]);
71
- if (y.length) {
72
- E = Y(), z = Object.freeze({
73
- baseUrl: A,
74
- fetch: O,
75
- parseAs: j,
76
- querySerializer: v,
77
- bodySerializer: H,
78
- pathSerializer: k
79
- });
80
- for (const d of y)
81
- if (d && typeof d == "object" && typeof d.onRequest == "function") {
82
- const f = await d.onRequest({
83
- request: h,
84
- schemaPath: a,
85
- params: w,
86
- options: z,
87
- id: E
88
- });
89
- if (f)
90
- if (f instanceof D)
91
- h = f;
92
- else if (f instanceof Response) {
93
- c = f;
94
- break;
95
- } else
96
- throw new Error("onRequest: must return new Request() or Response() when modifying the request");
97
- }
98
- }
99
- if (!c) {
100
- try {
101
- c = await O(h, $);
102
- } catch (d) {
103
- let f = d;
104
- if (y.length)
105
- for (let b = y.length - 1; b >= 0; b--) {
106
- const T = y[b];
107
- if (T && typeof T == "object" && typeof T.onError == "function") {
108
- const R = await T.onError({
109
- request: h,
110
- error: f,
111
- schemaPath: a,
112
- params: w,
113
- options: z,
114
- id: E
115
- });
116
- if (R) {
117
- if (R instanceof Response) {
118
- f = void 0, c = R;
119
- break;
120
- }
121
- if (R instanceof Error) {
122
- f = R;
123
- continue;
124
- }
125
- throw new Error("onError: must return new Response() or instance of Error");
126
- }
127
- }
128
- }
129
- if (f)
130
- throw f;
131
- }
132
- if (y.length)
133
- for (let d = y.length - 1; d >= 0; d--) {
134
- const f = y[d];
135
- if (f && typeof f == "object" && typeof f.onResponse == "function") {
136
- const b = await f.onResponse({
137
- request: h,
138
- response: c,
139
- schemaPath: a,
140
- params: w,
141
- options: z,
142
- id: E
143
- });
144
- if (b) {
145
- if (!(b instanceof Response))
146
- throw new Error("onResponse: must return new Response() when modifying the response");
147
- c = b;
148
- }
149
- }
150
- }
151
- }
152
- const L = c.headers.get("Content-Length");
153
- if (c.status === 204 || h.method === "HEAD" || L === "0" && !c.headers.get("Transfer-Encoding")?.includes("chunked"))
154
- return c.ok ? { data: void 0, response: c } : { error: void 0, response: c };
155
- if (c.ok)
156
- return { data: await (async () => {
157
- if (j === "stream")
158
- return c.body;
159
- if (j === "json" && !L) {
160
- const f = await c.text();
161
- return f ? JSON.parse(f) : void 0;
162
- }
163
- return await c[j]();
164
- })(), response: c };
165
- let C = await c.text();
166
- try {
167
- C = JSON.parse(C);
168
- } catch {
169
- }
170
- return { error: C, response: c };
171
- }
172
- return {
173
- request(a, s, m) {
174
- return p(s, { ...m, method: a.toUpperCase() });
175
- },
176
- /** Call a GET endpoint */
177
- GET(a, s) {
178
- return p(a, { ...s, method: "GET" });
179
- },
180
- /** Call a PUT endpoint */
181
- PUT(a, s) {
182
- return p(a, { ...s, method: "PUT" });
183
- },
184
- /** Call a POST endpoint */
185
- POST(a, s) {
186
- return p(a, { ...s, method: "POST" });
187
- },
188
- /** Call a DELETE endpoint */
189
- DELETE(a, s) {
190
- return p(a, { ...s, method: "DELETE" });
191
- },
192
- /** Call a OPTIONS endpoint */
193
- OPTIONS(a, s) {
194
- return p(a, { ...s, method: "OPTIONS" });
195
- },
196
- /** Call a HEAD endpoint */
197
- HEAD(a, s) {
198
- return p(a, { ...s, method: "HEAD" });
199
- },
200
- /** Call a PATCH endpoint */
201
- PATCH(a, s) {
202
- return p(a, { ...s, method: "PATCH" });
203
- },
204
- /** Call a TRACE endpoint */
205
- TRACE(a, s) {
206
- return p(a, { ...s, method: "TRACE" });
207
- },
208
- /** Register middleware */
209
- use(...a) {
210
- for (const s of a)
211
- if (s) {
212
- if (typeof s != "object" || !("onRequest" in s || "onResponse" in s || "onError" in s))
213
- throw new Error("Middleware must be an object with one of `onRequest()`, `onResponse() or `onError()`");
214
- g.push(s);
215
- }
216
- },
217
- /** Unregister middleware */
218
- eject(...a) {
219
- for (const s of a) {
220
- const m = g.indexOf(s);
221
- m !== -1 && g.splice(m, 1);
222
- }
223
- }
224
- };
6
+ function r(e) {
7
+ let { baseUrl: r = "", Request: i = globalThis.Request, fetch: a = globalThis.fetch, querySerializer: o, bodySerializer: p, pathSerializer: m, headers: h, requestInitExt: g = void 0, ..._ } = { ...e };
8
+ g = t() ? g : void 0, r = f(r);
9
+ let v = [];
10
+ async function y(e, t) {
11
+ let { baseUrl: y, fetch: b = a, Request: x = i, headers: S, params: C = {}, parseAs: w = "json", querySerializer: T, bodySerializer: E = p ?? l, pathSerializer: D, body: O, middleware: k = [], ...A } = t || {}, j = r;
12
+ y && (j = f(y) ?? r);
13
+ let M = typeof o == "function" ? o : s(o);
14
+ T && (M = typeof T == "function" ? T : s({
15
+ ...typeof o == "object" ? o : {},
16
+ ...T
17
+ }));
18
+ let N = D || m || c, P = O === void 0 ? void 0 : E(O, d(h, S, C.header)), F = d(P === void 0 || P instanceof FormData ? {} : { "Content-Type": "application/json" }, h, S, C.header), I = [...v, ...k], L = {
19
+ redirect: "follow",
20
+ ..._,
21
+ ...A,
22
+ body: P,
23
+ headers: F
24
+ }, R, z, B = new x(u(e, {
25
+ baseUrl: j,
26
+ params: C,
27
+ querySerializer: M,
28
+ pathSerializer: N
29
+ }), L), V;
30
+ for (let e in A) e in B || (B[e] = A[e]);
31
+ if (I.length) {
32
+ R = n(), z = Object.freeze({
33
+ baseUrl: j,
34
+ fetch: b,
35
+ parseAs: w,
36
+ querySerializer: M,
37
+ bodySerializer: E,
38
+ pathSerializer: N
39
+ });
40
+ for (let t of I) if (t && typeof t == "object" && typeof t.onRequest == "function") {
41
+ let n = await t.onRequest({
42
+ request: B,
43
+ schemaPath: e,
44
+ params: C,
45
+ options: z,
46
+ id: R
47
+ });
48
+ if (n) if (n instanceof x) B = n;
49
+ else if (n instanceof Response) {
50
+ V = n;
51
+ break;
52
+ } else throw Error("onRequest: must return new Request() or Response() when modifying the request");
53
+ }
54
+ }
55
+ if (!V) {
56
+ try {
57
+ V = await b(B, g);
58
+ } catch (t) {
59
+ let n = t;
60
+ if (I.length) for (let t = I.length - 1; t >= 0; t--) {
61
+ let r = I[t];
62
+ if (r && typeof r == "object" && typeof r.onError == "function") {
63
+ let t = await r.onError({
64
+ request: B,
65
+ error: n,
66
+ schemaPath: e,
67
+ params: C,
68
+ options: z,
69
+ id: R
70
+ });
71
+ if (t) {
72
+ if (t instanceof Response) {
73
+ n = void 0, V = t;
74
+ break;
75
+ }
76
+ if (t instanceof Error) {
77
+ n = t;
78
+ continue;
79
+ }
80
+ throw Error("onError: must return new Response() or instance of Error");
81
+ }
82
+ }
83
+ }
84
+ if (n) throw n;
85
+ }
86
+ if (I.length) for (let t = I.length - 1; t >= 0; t--) {
87
+ let n = I[t];
88
+ if (n && typeof n == "object" && typeof n.onResponse == "function") {
89
+ let t = await n.onResponse({
90
+ request: B,
91
+ response: V,
92
+ schemaPath: e,
93
+ params: C,
94
+ options: z,
95
+ id: R
96
+ });
97
+ if (t) {
98
+ if (!(t instanceof Response)) throw Error("onResponse: must return new Response() when modifying the response");
99
+ V = t;
100
+ }
101
+ }
102
+ }
103
+ }
104
+ let H = V.headers.get("Content-Length");
105
+ if (V.status === 204 || B.method === "HEAD" || H === "0" && !V.headers.get("Transfer-Encoding")?.includes("chunked")) return V.ok ? {
106
+ data: void 0,
107
+ response: V
108
+ } : {
109
+ error: void 0,
110
+ response: V
111
+ };
112
+ if (V.ok) return {
113
+ data: await (async () => {
114
+ if (w === "stream") return V.body;
115
+ if (w === "json" && !H) {
116
+ let e = await V.text();
117
+ return e ? JSON.parse(e) : void 0;
118
+ }
119
+ return await V[w]();
120
+ })(),
121
+ response: V
122
+ };
123
+ let U = await V.text();
124
+ try {
125
+ U = JSON.parse(U);
126
+ } catch {}
127
+ return {
128
+ error: U,
129
+ response: V
130
+ };
131
+ }
132
+ return {
133
+ request(e, t, n) {
134
+ return y(t, {
135
+ ...n,
136
+ method: e.toUpperCase()
137
+ });
138
+ },
139
+ GET(e, t) {
140
+ return y(e, {
141
+ ...t,
142
+ method: "GET"
143
+ });
144
+ },
145
+ PUT(e, t) {
146
+ return y(e, {
147
+ ...t,
148
+ method: "PUT"
149
+ });
150
+ },
151
+ POST(e, t) {
152
+ return y(e, {
153
+ ...t,
154
+ method: "POST"
155
+ });
156
+ },
157
+ DELETE(e, t) {
158
+ return y(e, {
159
+ ...t,
160
+ method: "DELETE"
161
+ });
162
+ },
163
+ OPTIONS(e, t) {
164
+ return y(e, {
165
+ ...t,
166
+ method: "OPTIONS"
167
+ });
168
+ },
169
+ HEAD(e, t) {
170
+ return y(e, {
171
+ ...t,
172
+ method: "HEAD"
173
+ });
174
+ },
175
+ PATCH(e, t) {
176
+ return y(e, {
177
+ ...t,
178
+ method: "PATCH"
179
+ });
180
+ },
181
+ TRACE(e, t) {
182
+ return y(e, {
183
+ ...t,
184
+ method: "TRACE"
185
+ });
186
+ },
187
+ use(...e) {
188
+ for (let t of e) if (t) {
189
+ if (typeof t != "object" || !("onRequest" in t || "onResponse" in t || "onError" in t)) throw Error("Middleware must be an object with one of `onRequest()`, `onResponse() or `onError()`");
190
+ v.push(t);
191
+ }
192
+ },
193
+ eject(...e) {
194
+ for (let t of e) {
195
+ let e = v.indexOf(t);
196
+ e !== -1 && v.splice(e, 1);
197
+ }
198
+ }
199
+ };
225
200
  }
226
- function q(n, t, e) {
227
- if (t == null)
228
- return "";
229
- if (typeof t == "object")
230
- throw new Error(
231
- "Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these."
232
- );
233
- return `${n}=${e?.allowReserved === !0 ? t : encodeURIComponent(t)}`;
201
+ function i(e, t, n) {
202
+ if (t == null) return "";
203
+ if (typeof t == "object") throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");
204
+ return `${e}=${n?.allowReserved === !0 ? t : encodeURIComponent(t)}`;
234
205
  }
235
- function B(n, t, e) {
236
- if (!t || typeof t != "object")
237
- return "";
238
- const o = [], r = {
239
- simple: ",",
240
- label: ".",
241
- matrix: ";"
242
- }[e.style] || "&";
243
- if (e.style !== "deepObject" && e.explode === !1) {
244
- for (const u in t)
245
- o.push(u, e.allowReserved === !0 ? t[u] : encodeURIComponent(t[u]));
246
- const l = o.join(",");
247
- switch (e.style) {
248
- case "form":
249
- return `${n}=${l}`;
250
- case "label":
251
- return `.${l}`;
252
- case "matrix":
253
- return `;${n}=${l}`;
254
- default:
255
- return l;
256
- }
257
- }
258
- for (const l in t) {
259
- const u = e.style === "deepObject" ? `${n}[${l}]` : l;
260
- o.push(q(u, t[l], e));
261
- }
262
- const i = o.join(r);
263
- return e.style === "label" || e.style === "matrix" ? `${r}${i}` : i;
206
+ function a(e, t, n) {
207
+ if (!t || typeof t != "object") return "";
208
+ let r = [], a = {
209
+ simple: ",",
210
+ label: ".",
211
+ matrix: ";"
212
+ }[n.style] || "&";
213
+ if (n.style !== "deepObject" && n.explode === !1) {
214
+ for (let e in t) r.push(e, n.allowReserved === !0 ? t[e] : encodeURIComponent(t[e]));
215
+ let i = r.join(",");
216
+ switch (n.style) {
217
+ case "form": return `${e}=${i}`;
218
+ case "label": return `.${i}`;
219
+ case "matrix": return `;${e}=${i}`;
220
+ default: return i;
221
+ }
222
+ }
223
+ for (let a in t) {
224
+ let o = n.style === "deepObject" ? `${e}[${a}]` : a;
225
+ r.push(i(o, t[a], n));
226
+ }
227
+ let o = r.join(a);
228
+ return n.style === "label" || n.style === "matrix" ? `${a}${o}` : o;
264
229
  }
265
- function W(n, t, e) {
266
- if (!Array.isArray(t))
267
- return "";
268
- if (e.explode === !1) {
269
- const i = { form: ",", spaceDelimited: "%20", pipeDelimited: "|" }[e.style] || ",", l = (e.allowReserved === !0 ? t : t.map((u) => encodeURIComponent(u))).join(i);
270
- switch (e.style) {
271
- case "simple":
272
- return l;
273
- case "label":
274
- return `.${l}`;
275
- case "matrix":
276
- return `;${n}=${l}`;
277
- // case "spaceDelimited":
278
- // case "pipeDelimited":
279
- default:
280
- return `${n}=${l}`;
281
- }
282
- }
283
- const o = { simple: ",", label: ".", matrix: ";" }[e.style] || "&", r = [];
284
- for (const i of t)
285
- e.style === "simple" || e.style === "label" ? r.push(e.allowReserved === !0 ? i : encodeURIComponent(i)) : r.push(q(n, i, e));
286
- return e.style === "label" || e.style === "matrix" ? `${o}${r.join(o)}` : r.join(o);
230
+ function o(e, t, n) {
231
+ if (!Array.isArray(t)) return "";
232
+ if (n.explode === !1) {
233
+ let r = {
234
+ form: ",",
235
+ spaceDelimited: "%20",
236
+ pipeDelimited: "|"
237
+ }[n.style] || ",", i = (n.allowReserved === !0 ? t : t.map((e) => encodeURIComponent(e))).join(r);
238
+ switch (n.style) {
239
+ case "simple": return i;
240
+ case "label": return `.${i}`;
241
+ case "matrix": return `;${e}=${i}`;
242
+ default: return `${e}=${i}`;
243
+ }
244
+ }
245
+ let r = {
246
+ simple: ",",
247
+ label: ".",
248
+ matrix: ";"
249
+ }[n.style] || "&", a = [];
250
+ for (let r of t) n.style === "simple" || n.style === "label" ? a.push(n.allowReserved === !0 ? r : encodeURIComponent(r)) : a.push(i(e, r, n));
251
+ return n.style === "label" || n.style === "matrix" ? `${r}${a.join(r)}` : a.join(r);
287
252
  }
288
- function M(n) {
289
- return function(e) {
290
- const o = [];
291
- if (e && typeof e == "object")
292
- for (const r in e) {
293
- const i = e[r];
294
- if (i != null) {
295
- if (Array.isArray(i)) {
296
- if (i.length === 0)
297
- continue;
298
- o.push(
299
- W(r, i, {
300
- style: "form",
301
- explode: !0,
302
- ...n?.array,
303
- allowReserved: n?.allowReserved || !1
304
- })
305
- );
306
- continue;
307
- }
308
- if (typeof i == "object") {
309
- o.push(
310
- B(r, i, {
311
- style: "deepObject",
312
- explode: !0,
313
- ...n?.object,
314
- allowReserved: n?.allowReserved || !1
315
- })
316
- );
317
- continue;
318
- }
319
- o.push(q(r, i, n));
320
- }
321
- }
322
- return o.join("&");
323
- };
253
+ function s(e) {
254
+ return function(t) {
255
+ let n = [];
256
+ if (t && typeof t == "object") for (let r in t) {
257
+ let s = t[r];
258
+ if (s != null) {
259
+ if (Array.isArray(s)) {
260
+ if (s.length === 0) continue;
261
+ n.push(o(r, s, {
262
+ style: "form",
263
+ explode: !0,
264
+ ...e?.array,
265
+ allowReserved: e?.allowReserved || !1
266
+ }));
267
+ continue;
268
+ }
269
+ if (typeof s == "object") {
270
+ n.push(a(r, s, {
271
+ style: "deepObject",
272
+ explode: !0,
273
+ ...e?.object,
274
+ allowReserved: e?.allowReserved || !1
275
+ }));
276
+ continue;
277
+ }
278
+ n.push(i(r, s, e));
279
+ }
280
+ }
281
+ return n.join("&");
282
+ };
324
283
  }
325
- function ee(n, t) {
326
- let e = n;
327
- for (const o of n.match(V) ?? []) {
328
- let r = o.substring(1, o.length - 1), i = !1, l = "simple";
329
- if (r.endsWith("*") && (i = !0, r = r.substring(0, r.length - 1)), r.startsWith(".") ? (l = "label", r = r.substring(1)) : r.startsWith(";") && (l = "matrix", r = r.substring(1)), !t || t[r] === void 0 || t[r] === null)
330
- continue;
331
- const u = t[r];
332
- if (Array.isArray(u)) {
333
- e = e.replace(o, W(r, u, { style: l, explode: i }));
334
- continue;
335
- }
336
- if (typeof u == "object") {
337
- e = e.replace(o, B(r, u, { style: l, explode: i }));
338
- continue;
339
- }
340
- if (l === "matrix") {
341
- e = e.replace(o, `;${q(r, u)}`);
342
- continue;
343
- }
344
- e = e.replace(o, l === "label" ? `.${encodeURIComponent(u)}` : encodeURIComponent(u));
345
- }
346
- return e;
284
+ function c(t, n) {
285
+ let r = t;
286
+ for (let s of t.match(e) ?? []) {
287
+ let e = s.substring(1, s.length - 1), t = !1, c = "simple";
288
+ if (e.endsWith("*") && (t = !0, e = e.substring(0, e.length - 1)), e.startsWith(".") ? (c = "label", e = e.substring(1)) : e.startsWith(";") && (c = "matrix", e = e.substring(1)), !n || n[e] === void 0 || n[e] === null) continue;
289
+ let l = n[e];
290
+ if (Array.isArray(l)) {
291
+ r = r.replace(s, o(e, l, {
292
+ style: c,
293
+ explode: t
294
+ }));
295
+ continue;
296
+ }
297
+ if (typeof l == "object") {
298
+ r = r.replace(s, a(e, l, {
299
+ style: c,
300
+ explode: t
301
+ }));
302
+ continue;
303
+ }
304
+ if (c === "matrix") {
305
+ r = r.replace(s, `;${i(e, l)}`);
306
+ continue;
307
+ }
308
+ r = r.replace(s, c === "label" ? `.${encodeURIComponent(l)}` : encodeURIComponent(l));
309
+ }
310
+ return r;
347
311
  }
348
- function te(n, t) {
349
- return n instanceof FormData ? n : t && (t.get instanceof Function ? t.get("Content-Type") ?? t.get("content-type") : t["Content-Type"] ?? t["content-type"]) === "application/x-www-form-urlencoded" ? new URLSearchParams(n).toString() : JSON.stringify(n);
312
+ function l(e, t) {
313
+ return e instanceof FormData ? e : t && (t.get instanceof Function ? t.get("Content-Type") ?? t.get("content-type") : t["Content-Type"] ?? t["content-type"]) === "application/x-www-form-urlencoded" ? new URLSearchParams(e).toString() : JSON.stringify(e);
350
314
  }
351
- function re(n, t) {
352
- let e = `${t.baseUrl}${n}`;
353
- t.params?.path && (e = t.pathSerializer(e, t.params.path));
354
- let o = t.querySerializer(t.params.query ?? {});
355
- return o.startsWith("?") && (o = o.substring(1)), o && (e += `?${o}`), e;
315
+ function u(e, t) {
316
+ let n = `${t.baseUrl}${e}`;
317
+ t.params?.path && (n = t.pathSerializer(n, t.params.path));
318
+ let r = t.querySerializer(t.params.query ?? {});
319
+ return r.startsWith("?") && (r = r.substring(1)), r && (n += `?${r}`), n;
356
320
  }
357
- function N(...n) {
358
- const t = new Headers();
359
- for (const e of n) {
360
- if (!e || typeof e != "object")
361
- continue;
362
- const o = e instanceof Headers ? e.entries() : Object.entries(e);
363
- for (const [r, i] of o)
364
- if (i === null)
365
- t.delete(r);
366
- else if (Array.isArray(i))
367
- for (const l of i)
368
- t.append(r, l);
369
- else i !== void 0 && t.set(r, i);
370
- }
371
- return t;
321
+ function d(...e) {
322
+ let t = new Headers();
323
+ for (let n of e) {
324
+ if (!n || typeof n != "object") continue;
325
+ let e = n instanceof Headers ? n.entries() : Object.entries(n);
326
+ for (let [n, r] of e) if (r === null) t.delete(n);
327
+ else if (Array.isArray(r)) for (let e of r) t.append(n, e);
328
+ else r !== void 0 && t.set(n, r);
329
+ }
330
+ return t;
372
331
  }
373
- function F(n) {
374
- return n.endsWith("/") ? n.substring(0, n.length - 1) : n;
332
+ function f(e) {
333
+ return e.endsWith("/") ? e.substring(0, e.length - 1) : e;
375
334
  }
376
- const ne = (n) => Z(n);
377
- export {
378
- ne as createCustomClient
379
- };
380
- //# sourceMappingURL=index.js.map
335
+ //#endregion
336
+ //#region src/client/index.ts
337
+ var p = (e) => r(e);
338
+ //#endregion
339
+ export { p as createCustomClient };
340
+
341
+ //# sourceMappingURL=index.js.map