@dreamboard-games/cli 0.1.30-alpha.2 → 0.1.30-alpha.21

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 (136) hide show
  1. package/README.md +25 -107
  2. package/dist/agent-verifier/agent-workspace-verifier.mjs +1682 -0
  3. package/dist/agent-verifier/agent-workspace-verifier.mjs.map +1 -0
  4. package/dist/agent-verifier/chunk-22U6RMWO.mjs +722 -0
  5. package/dist/agent-verifier/chunk-22U6RMWO.mjs.map +1 -0
  6. package/dist/agent-verifier/chunk-4I2WWAPK.mjs +399 -0
  7. package/dist/agent-verifier/chunk-4I2WWAPK.mjs.map +1 -0
  8. package/dist/agent-verifier/chunk-BWBN2TDJ.mjs +2811 -0
  9. package/dist/agent-verifier/chunk-BWBN2TDJ.mjs.map +1 -0
  10. package/dist/agent-verifier/chunk-DQUYBIGQ.mjs +353 -0
  11. package/dist/agent-verifier/chunk-DQUYBIGQ.mjs.map +1 -0
  12. package/dist/agent-verifier/chunk-F2DIOJJZ.mjs +302 -0
  13. package/dist/agent-verifier/chunk-F2DIOJJZ.mjs.map +1 -0
  14. package/dist/agent-verifier/chunk-GWRZRWCF.mjs +107 -0
  15. package/dist/agent-verifier/chunk-GWRZRWCF.mjs.map +1 -0
  16. package/dist/agent-verifier/chunk-H6XDQJ3N.mjs +11 -0
  17. package/dist/agent-verifier/chunk-HUBV22JQ.mjs +89 -0
  18. package/dist/agent-verifier/chunk-HUBV22JQ.mjs.map +1 -0
  19. package/dist/agent-verifier/chunk-IWB4L2HV.mjs +273 -0
  20. package/dist/agent-verifier/chunk-IWB4L2HV.mjs.map +1 -0
  21. package/dist/agent-verifier/chunk-JZTH3EMV.mjs +14523 -0
  22. package/dist/agent-verifier/chunk-JZTH3EMV.mjs.map +1 -0
  23. package/dist/agent-verifier/chunk-KDAQ4CZY.mjs +192 -0
  24. package/dist/agent-verifier/chunk-KDAQ4CZY.mjs.map +1 -0
  25. package/dist/agent-verifier/chunk-M7UVBANQ.mjs +58 -0
  26. package/dist/agent-verifier/chunk-M7UVBANQ.mjs.map +1 -0
  27. package/dist/agent-verifier/chunk-MYMVXTZT.mjs +766 -0
  28. package/dist/agent-verifier/chunk-MYMVXTZT.mjs.map +1 -0
  29. package/dist/agent-verifier/chunk-OJFZVGEL.mjs +492 -0
  30. package/dist/agent-verifier/chunk-OJFZVGEL.mjs.map +1 -0
  31. package/dist/agent-verifier/chunk-QD4SQNUP.mjs +75 -0
  32. package/dist/agent-verifier/chunk-QD4SQNUP.mjs.map +1 -0
  33. package/dist/agent-verifier/chunk-RDYXWXXC.mjs +47 -0
  34. package/dist/agent-verifier/chunk-RDYXWXXC.mjs.map +1 -0
  35. package/dist/agent-verifier/chunk-TIDX3YLW.mjs +158 -0
  36. package/dist/agent-verifier/chunk-TIDX3YLW.mjs.map +1 -0
  37. package/dist/agent-verifier/chunk-TTB7AIHZ.mjs +214 -0
  38. package/dist/agent-verifier/chunk-TTB7AIHZ.mjs.map +1 -0
  39. package/dist/agent-verifier/chunk-UXGTT25Q.mjs +59 -0
  40. package/dist/agent-verifier/chunk-UXGTT25Q.mjs.map +1 -0
  41. package/dist/agent-verifier/chunk-YE7UAO3T.mjs +129 -0
  42. package/dist/agent-verifier/chunk-YE7UAO3T.mjs.map +1 -0
  43. package/dist/agent-verifier/chunk-ZEELHSY3.mjs +20 -0
  44. package/dist/agent-verifier/chunk-ZEELHSY3.mjs.map +1 -0
  45. package/dist/agent-verifier/global-config-IXZLY4BS.mjs +19 -0
  46. package/dist/agent-verifier/keychain-backend-UF3Z26JM.mjs +140 -0
  47. package/dist/agent-verifier/keychain-backend-UF3Z26JM.mjs.map +1 -0
  48. package/dist/agent-verifier/local-files-OF4QFISU.mjs +45 -0
  49. package/dist/agent-verifier/local-files-OF4QFISU.mjs.map +1 -0
  50. package/dist/agent-verifier/local-typecheck-DHVLM37Z.mjs +150 -0
  51. package/dist/agent-verifier/local-typecheck-DHVLM37Z.mjs.map +1 -0
  52. package/dist/agent-verifier/materialize-workspace-7DFE45ZH.mjs +90 -0
  53. package/dist/agent-verifier/materialize-workspace-7DFE45ZH.mjs.map +1 -0
  54. package/dist/agent-verifier/project-state-XKUSCFSV.mjs +33 -0
  55. package/dist/agent-verifier/project-state-XKUSCFSV.mjs.map +1 -0
  56. package/dist/agent-verifier/prompt-VKHMCQT6.mjs +756 -0
  57. package/dist/agent-verifier/prompt-VKHMCQT6.mjs.map +1 -0
  58. package/dist/agent-verifier/reducer-bundle-preflight-GLUJKTWU.mjs +312 -0
  59. package/dist/agent-verifier/reducer-bundle-preflight-GLUJKTWU.mjs.map +1 -0
  60. package/dist/agent-verifier/reducer-contract-preflight-WVQQPW5F.mjs +46 -0
  61. package/dist/agent-verifier/reducer-contract-preflight-WVQQPW5F.mjs.map +1 -0
  62. package/dist/agent-verifier/reducer-native-test-harness-H6G6RBRY.mjs +3436 -0
  63. package/dist/agent-verifier/reducer-native-test-harness-H6G6RBRY.mjs.map +1 -0
  64. package/dist/agent-verifier/static-scaffold-CC4KL6K7.mjs +24 -0
  65. package/dist/agent-verifier/static-scaffold-CC4KL6K7.mjs.map +1 -0
  66. package/dist/agent-verifier/workspace-codegen-SPPVHURX.mjs +10 -0
  67. package/dist/agent-verifier/workspace-codegen-SPPVHURX.mjs.map +1 -0
  68. package/dist/agent-verifier/workspace-dependencies-5HEEKZFP.mjs +17 -0
  69. package/dist/agent-verifier/workspace-dependencies-5HEEKZFP.mjs.map +1 -0
  70. package/dist/authoring-compatibility-internal.js +12 -0
  71. package/dist/authoring-compatibility-internal.js.map +1 -0
  72. package/dist/chunk-2H7UOFLK.js +11 -0
  73. package/dist/chunk-2H7UOFLK.js.map +1 -0
  74. package/dist/{chunk-TAQKH67O.js → chunk-2Z65YI7P.js} +2702 -7338
  75. package/dist/chunk-2Z65YI7P.js.map +1 -0
  76. package/dist/chunk-EQNBQVIW.js +204 -0
  77. package/dist/chunk-EQNBQVIW.js.map +1 -0
  78. package/dist/chunk-GQ3ZEAEG.js +4281 -0
  79. package/dist/chunk-GQ3ZEAEG.js.map +1 -0
  80. package/dist/chunk-UI7NWSYA.js +334 -0
  81. package/dist/chunk-UI7NWSYA.js.map +1 -0
  82. package/dist/{global-config-S4ZIPECE.js → global-config-GK2UC2X6.js} +4 -3
  83. package/dist/global-config-GK2UC2X6.js.map +1 -0
  84. package/dist/index.js +3421 -6435
  85. package/dist/index.js.map +1 -1
  86. package/dist/internal.js +15 -9
  87. package/dist/{keychain-backend-HDF4TZDL.js → keychain-backend-GO34KGTG.js} +12 -7
  88. package/dist/keychain-backend-GO34KGTG.js.map +1 -0
  89. package/dist/{prompt-NDV3AE5L.js → prompt-GMZABCJC.js} +2 -2
  90. package/package.json +11 -20
  91. package/release/authoring-release-set.json +38 -0
  92. package/skills/dreamboard/SKILL.md +30 -28
  93. package/skills/dreamboard/references/building-your-first-game.md +15 -15
  94. package/skills/dreamboard/references/cli.md +48 -47
  95. package/skills/dreamboard/references/manifest-authoring.md +11 -3
  96. package/skills/dreamboard/references/quickstart.md +16 -13
  97. package/skills/dreamboard/references/testing.md +10 -10
  98. package/dist/chunk-N7XPNNUI.js +0 -432
  99. package/dist/chunk-N7XPNNUI.js.map +0 -1
  100. package/dist/chunk-SEGVTWSK.js +0 -44
  101. package/dist/chunk-TAQKH67O.js.map +0 -1
  102. package/dist/dev-host/components/drawer.tsx +0 -132
  103. package/dist/dev-host/components/input.tsx +0 -21
  104. package/dist/dev-host/dev-api-proxy-plugin.ts +0 -328
  105. package/dist/dev-host/dev-author-dom-warnings.ts +0 -100
  106. package/dist/dev-host/dev-diagnostics.ts +0 -62
  107. package/dist/dev-host/dev-fallback-stylesheet.ts +0 -53
  108. package/dist/dev-host/dev-hmr-guard-plugin.ts +0 -47
  109. package/dist/dev-host/dev-host-controller.ts +0 -674
  110. package/dist/dev-host/dev-host-player-query.ts +0 -17
  111. package/dist/dev-host/dev-host-session-transport.ts +0 -52
  112. package/dist/dev-host/dev-host-storage.ts +0 -56
  113. package/dist/dev-host/dev-log-relay-plugin.ts +0 -510
  114. package/dist/dev-host/dev-runtime-config.ts +0 -14
  115. package/dist/dev-host/dev-runtime-platform.ts +0 -335
  116. package/dist/dev-host/dev-virtual-modules-plugin.ts +0 -64
  117. package/dist/dev-host/host-main.css +0 -224
  118. package/dist/dev-host/host-main.tsx +0 -948
  119. package/dist/dev-host/index.html +0 -56
  120. package/dist/dev-host/lib/utils.ts +0 -6
  121. package/dist/dev-host/plugin-main.ts +0 -61
  122. package/dist/dev-host/plugin.html +0 -24
  123. package/dist/dev-host/shared-styles.css +0 -144
  124. package/dist/dev-host/start-dev-server.ts +0 -140
  125. package/dist/dev-host/virtual-modules.d.ts +0 -27
  126. package/dist/keychain-backend-HDF4TZDL.js.map +0 -1
  127. package/skills/dreamboard/scripts/events-extract.mjs +0 -218
  128. /package/dist/{chunk-SEGVTWSK.js.map → agent-verifier/chunk-H6XDQJ3N.mjs.map} +0 -0
  129. /package/dist/{global-config-S4ZIPECE.js.map → agent-verifier/global-config-IXZLY4BS.mjs.map} +0 -0
  130. /package/dist/{prompt-NDV3AE5L.js.map → prompt-GMZABCJC.js.map} +0 -0
  131. /package/{dist/scaffold → scaffold}/assets/static/app/tsconfig.framework.json +0 -0
  132. /package/{dist/scaffold → scaffold}/assets/static/app/tsconfig.json +0 -0
  133. /package/{dist/scaffold → scaffold}/assets/static/ui/index.tsx +0 -0
  134. /package/{dist/scaffold → scaffold}/assets/static/ui/style.css +0 -0
  135. /package/{dist/scaffold → scaffold}/assets/static/ui/tsconfig.framework.json +0 -0
  136. /package/{dist/scaffold → scaffold}/assets/static/ui/tsconfig.json +0 -0
@@ -0,0 +1,766 @@
1
+ #!/usr/bin/env node
2
+
3
+ // ../../packages/api-client/dist/core/bodySerializer.gen.js
4
+ var jsonBodySerializer = {
5
+ bodySerializer: (body) => JSON.stringify(body, (_key, value) => typeof value === "bigint" ? value.toString() : value)
6
+ };
7
+
8
+ // ../../packages/api-client/dist/core/params.gen.js
9
+ var extraPrefixesMap = {
10
+ $body_: "body",
11
+ $headers_: "headers",
12
+ $path_: "path",
13
+ $query_: "query"
14
+ };
15
+ var extraPrefixes = Object.entries(extraPrefixesMap);
16
+
17
+ // ../../packages/api-client/dist/core/serverSentEvents.gen.js
18
+ var createSseClient = ({ onRequest, onSseError, onSseEvent, responseTransformer, responseValidator, sseDefaultRetryDelay, sseMaxRetryAttempts, sseMaxRetryDelay, sseSleepFn, url, ...options }) => {
19
+ let lastEventId;
20
+ const sleep = sseSleepFn ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
21
+ const createStream = async function* () {
22
+ let retryDelay = sseDefaultRetryDelay ?? 3e3;
23
+ let attempt = 0;
24
+ const signal = options.signal ?? new AbortController().signal;
25
+ while (true) {
26
+ if (signal.aborted)
27
+ break;
28
+ attempt++;
29
+ const headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers);
30
+ if (lastEventId !== void 0) {
31
+ headers.set("Last-Event-ID", lastEventId);
32
+ }
33
+ try {
34
+ const requestInit = {
35
+ redirect: "follow",
36
+ ...options,
37
+ body: options.serializedBody,
38
+ headers,
39
+ signal
40
+ };
41
+ let request = new Request(url, requestInit);
42
+ if (onRequest) {
43
+ request = await onRequest(url, requestInit);
44
+ }
45
+ const _fetch = options.fetch ?? globalThis.fetch;
46
+ const response = await _fetch(request);
47
+ if (!response.ok)
48
+ throw new Error(`SSE failed: ${response.status} ${response.statusText}`);
49
+ if (!response.body)
50
+ throw new Error("No body in SSE response");
51
+ const reader = response.body.pipeThrough(new TextDecoderStream()).getReader();
52
+ let buffer = "";
53
+ const abortHandler = () => {
54
+ try {
55
+ reader.cancel();
56
+ } catch {
57
+ }
58
+ };
59
+ signal.addEventListener("abort", abortHandler);
60
+ try {
61
+ while (true) {
62
+ const { done, value } = await reader.read();
63
+ if (done)
64
+ break;
65
+ buffer += value;
66
+ const chunks = buffer.split("\r\n");
67
+ buffer = chunks.pop() ?? "";
68
+ for (const chunk of chunks) {
69
+ const lines = chunk.split("\n");
70
+ const dataLines = [];
71
+ let eventName;
72
+ for (const line of lines) {
73
+ if (line.startsWith("data:")) {
74
+ dataLines.push(line.replace(/^data:\s*/, ""));
75
+ } else if (line.startsWith("event:")) {
76
+ eventName = line.replace(/^event:\s*/, "");
77
+ } else if (line.startsWith("id:")) {
78
+ lastEventId = line.replace(/^id:\s*/, "");
79
+ } else if (line.startsWith("retry:")) {
80
+ const parsed = Number.parseInt(line.replace(/^retry:\s*/, ""), 10);
81
+ if (!Number.isNaN(parsed)) {
82
+ retryDelay = parsed;
83
+ }
84
+ }
85
+ }
86
+ let data;
87
+ let parsedJson = false;
88
+ if (dataLines.length) {
89
+ const rawData = dataLines.join("\n");
90
+ try {
91
+ data = JSON.parse(rawData);
92
+ parsedJson = true;
93
+ } catch {
94
+ data = rawData;
95
+ }
96
+ }
97
+ if (parsedJson) {
98
+ if (responseValidator) {
99
+ await responseValidator(data);
100
+ }
101
+ if (responseTransformer) {
102
+ data = await responseTransformer(data);
103
+ }
104
+ }
105
+ onSseEvent?.({
106
+ data,
107
+ event: eventName,
108
+ id: lastEventId,
109
+ retry: retryDelay
110
+ });
111
+ if (dataLines.length) {
112
+ yield data;
113
+ }
114
+ }
115
+ }
116
+ } finally {
117
+ signal.removeEventListener("abort", abortHandler);
118
+ reader.releaseLock();
119
+ }
120
+ break;
121
+ } catch (error) {
122
+ onSseError?.(error);
123
+ if (sseMaxRetryAttempts !== void 0 && attempt >= sseMaxRetryAttempts) {
124
+ break;
125
+ }
126
+ const backoff = Math.min(retryDelay * 2 ** (attempt - 1), sseMaxRetryDelay ?? 3e4);
127
+ await sleep(backoff);
128
+ }
129
+ }
130
+ };
131
+ const stream = createStream();
132
+ return { stream };
133
+ };
134
+
135
+ // ../../packages/api-client/dist/core/pathSerializer.gen.js
136
+ var separatorArrayExplode = (style) => {
137
+ switch (style) {
138
+ case "label":
139
+ return ".";
140
+ case "matrix":
141
+ return ";";
142
+ case "simple":
143
+ return ",";
144
+ default:
145
+ return "&";
146
+ }
147
+ };
148
+ var separatorArrayNoExplode = (style) => {
149
+ switch (style) {
150
+ case "form":
151
+ return ",";
152
+ case "pipeDelimited":
153
+ return "|";
154
+ case "spaceDelimited":
155
+ return "%20";
156
+ default:
157
+ return ",";
158
+ }
159
+ };
160
+ var separatorObjectExplode = (style) => {
161
+ switch (style) {
162
+ case "label":
163
+ return ".";
164
+ case "matrix":
165
+ return ";";
166
+ case "simple":
167
+ return ",";
168
+ default:
169
+ return "&";
170
+ }
171
+ };
172
+ var serializeArrayParam = ({ allowReserved, explode, name, style, value }) => {
173
+ if (!explode) {
174
+ const joinedValues2 = (allowReserved ? value : value.map((v) => encodeURIComponent(v))).join(separatorArrayNoExplode(style));
175
+ switch (style) {
176
+ case "label":
177
+ return `.${joinedValues2}`;
178
+ case "matrix":
179
+ return `;${name}=${joinedValues2}`;
180
+ case "simple":
181
+ return joinedValues2;
182
+ default:
183
+ return `${name}=${joinedValues2}`;
184
+ }
185
+ }
186
+ const separator = separatorArrayExplode(style);
187
+ const joinedValues = value.map((v) => {
188
+ if (style === "label" || style === "simple") {
189
+ return allowReserved ? v : encodeURIComponent(v);
190
+ }
191
+ return serializePrimitiveParam({
192
+ allowReserved,
193
+ name,
194
+ value: v
195
+ });
196
+ }).join(separator);
197
+ return style === "label" || style === "matrix" ? separator + joinedValues : joinedValues;
198
+ };
199
+ var serializePrimitiveParam = ({ allowReserved, name, value }) => {
200
+ if (value === void 0 || value === null) {
201
+ return "";
202
+ }
203
+ if (typeof value === "object") {
204
+ throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");
205
+ }
206
+ return `${name}=${allowReserved ? value : encodeURIComponent(value)}`;
207
+ };
208
+ var serializeObjectParam = ({ allowReserved, explode, name, style, value, valueOnly }) => {
209
+ if (value instanceof Date) {
210
+ return valueOnly ? value.toISOString() : `${name}=${value.toISOString()}`;
211
+ }
212
+ if (style !== "deepObject" && !explode) {
213
+ let values = [];
214
+ Object.entries(value).forEach(([key, v]) => {
215
+ values = [
216
+ ...values,
217
+ key,
218
+ allowReserved ? v : encodeURIComponent(v)
219
+ ];
220
+ });
221
+ const joinedValues2 = values.join(",");
222
+ switch (style) {
223
+ case "form":
224
+ return `${name}=${joinedValues2}`;
225
+ case "label":
226
+ return `.${joinedValues2}`;
227
+ case "matrix":
228
+ return `;${name}=${joinedValues2}`;
229
+ default:
230
+ return joinedValues2;
231
+ }
232
+ }
233
+ const separator = separatorObjectExplode(style);
234
+ const joinedValues = Object.entries(value).map(([key, v]) => serializePrimitiveParam({
235
+ allowReserved,
236
+ name: style === "deepObject" ? `${name}[${key}]` : key,
237
+ value: v
238
+ })).join(separator);
239
+ return style === "label" || style === "matrix" ? separator + joinedValues : joinedValues;
240
+ };
241
+
242
+ // ../../packages/api-client/dist/core/utils.gen.js
243
+ var PATH_PARAM_RE = /\{[^{}]+\}/g;
244
+ var defaultPathSerializer = ({ path, url: _url }) => {
245
+ let url = _url;
246
+ const matches = _url.match(PATH_PARAM_RE);
247
+ if (matches) {
248
+ for (const match of matches) {
249
+ let explode = false;
250
+ let name = match.substring(1, match.length - 1);
251
+ let style = "simple";
252
+ if (name.endsWith("*")) {
253
+ explode = true;
254
+ name = name.substring(0, name.length - 1);
255
+ }
256
+ if (name.startsWith(".")) {
257
+ name = name.substring(1);
258
+ style = "label";
259
+ } else if (name.startsWith(";")) {
260
+ name = name.substring(1);
261
+ style = "matrix";
262
+ }
263
+ const value = path[name];
264
+ if (value === void 0 || value === null) {
265
+ continue;
266
+ }
267
+ if (Array.isArray(value)) {
268
+ url = url.replace(match, serializeArrayParam({ explode, name, style, value }));
269
+ continue;
270
+ }
271
+ if (typeof value === "object") {
272
+ url = url.replace(match, serializeObjectParam({
273
+ explode,
274
+ name,
275
+ style,
276
+ value,
277
+ valueOnly: true
278
+ }));
279
+ continue;
280
+ }
281
+ if (style === "matrix") {
282
+ url = url.replace(match, `;${serializePrimitiveParam({
283
+ name,
284
+ value
285
+ })}`);
286
+ continue;
287
+ }
288
+ const replaceValue = encodeURIComponent(style === "label" ? `.${value}` : value);
289
+ url = url.replace(match, replaceValue);
290
+ }
291
+ }
292
+ return url;
293
+ };
294
+ var getUrl = ({ baseUrl, path, query, querySerializer, url: _url }) => {
295
+ const pathUrl = _url.startsWith("/") ? _url : `/${_url}`;
296
+ let url = (baseUrl ?? "") + pathUrl;
297
+ if (path) {
298
+ url = defaultPathSerializer({ path, url });
299
+ }
300
+ let search = query ? querySerializer(query) : "";
301
+ if (search.startsWith("?")) {
302
+ search = search.substring(1);
303
+ }
304
+ if (search) {
305
+ url += `?${search}`;
306
+ }
307
+ return url;
308
+ };
309
+ function getValidRequestBody(options) {
310
+ const hasBody = options.body !== void 0;
311
+ const isSerializedBody = hasBody && options.bodySerializer;
312
+ if (isSerializedBody) {
313
+ if ("serializedBody" in options) {
314
+ const hasSerializedBody = options.serializedBody !== void 0 && options.serializedBody !== "";
315
+ return hasSerializedBody ? options.serializedBody : null;
316
+ }
317
+ return options.body !== "" ? options.body : null;
318
+ }
319
+ if (hasBody) {
320
+ return options.body;
321
+ }
322
+ return void 0;
323
+ }
324
+
325
+ // ../../packages/api-client/dist/core/auth.gen.js
326
+ var getAuthToken = async (auth, callback) => {
327
+ const token = typeof callback === "function" ? await callback(auth) : callback;
328
+ if (!token) {
329
+ return;
330
+ }
331
+ if (auth.scheme === "bearer") {
332
+ return `Bearer ${token}`;
333
+ }
334
+ if (auth.scheme === "basic") {
335
+ return `Basic ${btoa(token)}`;
336
+ }
337
+ return token;
338
+ };
339
+
340
+ // ../../packages/api-client/dist/client/utils.gen.js
341
+ var createQuerySerializer = ({ parameters = {}, ...args } = {}) => {
342
+ const querySerializer = (queryParams) => {
343
+ const search = [];
344
+ if (queryParams && typeof queryParams === "object") {
345
+ for (const name in queryParams) {
346
+ const value = queryParams[name];
347
+ if (value === void 0 || value === null) {
348
+ continue;
349
+ }
350
+ const options = parameters[name] || args;
351
+ if (Array.isArray(value)) {
352
+ const serializedArray = serializeArrayParam({
353
+ allowReserved: options.allowReserved,
354
+ explode: true,
355
+ name,
356
+ style: "form",
357
+ value,
358
+ ...options.array
359
+ });
360
+ if (serializedArray)
361
+ search.push(serializedArray);
362
+ } else if (typeof value === "object") {
363
+ const serializedObject = serializeObjectParam({
364
+ allowReserved: options.allowReserved,
365
+ explode: true,
366
+ name,
367
+ style: "deepObject",
368
+ value,
369
+ ...options.object
370
+ });
371
+ if (serializedObject)
372
+ search.push(serializedObject);
373
+ } else {
374
+ const serializedPrimitive = serializePrimitiveParam({
375
+ allowReserved: options.allowReserved,
376
+ name,
377
+ value
378
+ });
379
+ if (serializedPrimitive)
380
+ search.push(serializedPrimitive);
381
+ }
382
+ }
383
+ }
384
+ return search.join("&");
385
+ };
386
+ return querySerializer;
387
+ };
388
+ var getParseAs = (contentType) => {
389
+ if (!contentType) {
390
+ return "stream";
391
+ }
392
+ const cleanContent = contentType.split(";")[0]?.trim();
393
+ if (!cleanContent) {
394
+ return;
395
+ }
396
+ if (cleanContent.startsWith("application/json") || cleanContent.endsWith("+json")) {
397
+ return "json";
398
+ }
399
+ if (cleanContent === "multipart/form-data") {
400
+ return "formData";
401
+ }
402
+ if (["application/", "audio/", "image/", "video/"].some((type) => cleanContent.startsWith(type))) {
403
+ return "blob";
404
+ }
405
+ if (cleanContent.startsWith("text/")) {
406
+ return "text";
407
+ }
408
+ return;
409
+ };
410
+ var checkForExistence = (options, name) => {
411
+ if (!name) {
412
+ return false;
413
+ }
414
+ if (options.headers.has(name) || options.query?.[name] || options.headers.get("Cookie")?.includes(`${name}=`)) {
415
+ return true;
416
+ }
417
+ return false;
418
+ };
419
+ var setAuthParams = async ({ security, ...options }) => {
420
+ for (const auth of security) {
421
+ if (checkForExistence(options, auth.name)) {
422
+ continue;
423
+ }
424
+ const token = await getAuthToken(auth, options.auth);
425
+ if (!token) {
426
+ continue;
427
+ }
428
+ const name = auth.name ?? "Authorization";
429
+ switch (auth.in) {
430
+ case "query":
431
+ if (!options.query) {
432
+ options.query = {};
433
+ }
434
+ options.query[name] = token;
435
+ break;
436
+ case "cookie":
437
+ options.headers.append("Cookie", `${name}=${token}`);
438
+ break;
439
+ case "header":
440
+ default:
441
+ options.headers.set(name, token);
442
+ break;
443
+ }
444
+ }
445
+ };
446
+ var buildUrl = (options) => getUrl({
447
+ baseUrl: options.baseUrl,
448
+ path: options.path,
449
+ query: options.query,
450
+ querySerializer: typeof options.querySerializer === "function" ? options.querySerializer : createQuerySerializer(options.querySerializer),
451
+ url: options.url
452
+ });
453
+ var mergeConfigs = (a, b) => {
454
+ const config = { ...a, ...b };
455
+ if (config.baseUrl?.endsWith("/")) {
456
+ config.baseUrl = config.baseUrl.substring(0, config.baseUrl.length - 1);
457
+ }
458
+ config.headers = mergeHeaders(a.headers, b.headers);
459
+ return config;
460
+ };
461
+ var headersEntries = (headers) => {
462
+ const entries = [];
463
+ headers.forEach((value, key) => {
464
+ entries.push([key, value]);
465
+ });
466
+ return entries;
467
+ };
468
+ var mergeHeaders = (...headers) => {
469
+ const mergedHeaders = new Headers();
470
+ for (const header of headers) {
471
+ if (!header) {
472
+ continue;
473
+ }
474
+ const iterator = header instanceof Headers ? headersEntries(header) : Object.entries(header);
475
+ for (const [key, value] of iterator) {
476
+ if (value === null) {
477
+ mergedHeaders.delete(key);
478
+ } else if (Array.isArray(value)) {
479
+ for (const v of value) {
480
+ mergedHeaders.append(key, v);
481
+ }
482
+ } else if (value !== void 0) {
483
+ mergedHeaders.set(key, typeof value === "object" ? JSON.stringify(value) : value);
484
+ }
485
+ }
486
+ }
487
+ return mergedHeaders;
488
+ };
489
+ var Interceptors = class {
490
+ constructor() {
491
+ this.fns = [];
492
+ }
493
+ clear() {
494
+ this.fns = [];
495
+ }
496
+ eject(id) {
497
+ const index = this.getInterceptorIndex(id);
498
+ if (this.fns[index]) {
499
+ this.fns[index] = null;
500
+ }
501
+ }
502
+ exists(id) {
503
+ const index = this.getInterceptorIndex(id);
504
+ return Boolean(this.fns[index]);
505
+ }
506
+ getInterceptorIndex(id) {
507
+ if (typeof id === "number") {
508
+ return this.fns[id] ? id : -1;
509
+ }
510
+ return this.fns.indexOf(id);
511
+ }
512
+ update(id, fn) {
513
+ const index = this.getInterceptorIndex(id);
514
+ if (this.fns[index]) {
515
+ this.fns[index] = fn;
516
+ return id;
517
+ }
518
+ return false;
519
+ }
520
+ use(fn) {
521
+ this.fns.push(fn);
522
+ return this.fns.length - 1;
523
+ }
524
+ };
525
+ var createInterceptors = () => ({
526
+ error: new Interceptors(),
527
+ request: new Interceptors(),
528
+ response: new Interceptors()
529
+ });
530
+ var defaultQuerySerializer = createQuerySerializer({
531
+ allowReserved: false,
532
+ array: {
533
+ explode: true,
534
+ style: "form"
535
+ },
536
+ object: {
537
+ explode: true,
538
+ style: "deepObject"
539
+ }
540
+ });
541
+ var defaultHeaders = {
542
+ "Content-Type": "application/json"
543
+ };
544
+ var createConfig = (override = {}) => ({
545
+ ...jsonBodySerializer,
546
+ headers: defaultHeaders,
547
+ parseAs: "auto",
548
+ querySerializer: defaultQuerySerializer,
549
+ ...override
550
+ });
551
+
552
+ // ../../packages/api-client/dist/client/client.gen.js
553
+ var createClient = (config = {}) => {
554
+ let _config = mergeConfigs(createConfig(), config);
555
+ const getConfig = () => ({ ..._config });
556
+ const setConfig = (config2) => {
557
+ _config = mergeConfigs(_config, config2);
558
+ return getConfig();
559
+ };
560
+ const interceptors = createInterceptors();
561
+ const beforeRequest = async (options) => {
562
+ const opts = {
563
+ ..._config,
564
+ ...options,
565
+ fetch: options.fetch ?? _config.fetch ?? globalThis.fetch,
566
+ headers: mergeHeaders(_config.headers, options.headers),
567
+ serializedBody: void 0
568
+ };
569
+ if (opts.security) {
570
+ await setAuthParams({
571
+ ...opts,
572
+ security: opts.security
573
+ });
574
+ }
575
+ if (opts.requestValidator) {
576
+ await opts.requestValidator(opts);
577
+ }
578
+ if (opts.body !== void 0 && opts.bodySerializer) {
579
+ opts.serializedBody = opts.bodySerializer(opts.body);
580
+ }
581
+ if (opts.body === void 0 || opts.serializedBody === "") {
582
+ opts.headers.delete("Content-Type");
583
+ }
584
+ const url = buildUrl(opts);
585
+ return { opts, url };
586
+ };
587
+ const request = async (options) => {
588
+ const { opts, url } = await beforeRequest(options);
589
+ const requestInit = {
590
+ redirect: "follow",
591
+ ...opts,
592
+ body: getValidRequestBody(opts)
593
+ };
594
+ let request2 = new Request(url, requestInit);
595
+ for (const fn of interceptors.request.fns) {
596
+ if (fn) {
597
+ request2 = await fn(request2, opts);
598
+ }
599
+ }
600
+ const _fetch = opts.fetch;
601
+ let response;
602
+ try {
603
+ response = await _fetch(request2);
604
+ } catch (error2) {
605
+ let finalError2 = error2;
606
+ for (const fn of interceptors.error.fns) {
607
+ if (fn) {
608
+ finalError2 = await fn(error2, void 0, request2, opts);
609
+ }
610
+ }
611
+ finalError2 = finalError2 || {};
612
+ if (opts.throwOnError) {
613
+ throw finalError2;
614
+ }
615
+ return opts.responseStyle === "data" ? void 0 : {
616
+ error: finalError2,
617
+ request: request2,
618
+ response: void 0
619
+ };
620
+ }
621
+ for (const fn of interceptors.response.fns) {
622
+ if (fn) {
623
+ response = await fn(response, request2, opts);
624
+ }
625
+ }
626
+ const result = {
627
+ request: request2,
628
+ response
629
+ };
630
+ if (response.ok) {
631
+ const parseAs = (opts.parseAs === "auto" ? getParseAs(response.headers.get("Content-Type")) : opts.parseAs) ?? "json";
632
+ if (response.status === 204 || response.headers.get("Content-Length") === "0") {
633
+ let emptyData;
634
+ switch (parseAs) {
635
+ case "arrayBuffer":
636
+ case "blob":
637
+ case "text":
638
+ emptyData = await response[parseAs]();
639
+ break;
640
+ case "formData":
641
+ emptyData = new FormData();
642
+ break;
643
+ case "stream":
644
+ emptyData = response.body;
645
+ break;
646
+ case "json":
647
+ default:
648
+ emptyData = {};
649
+ break;
650
+ }
651
+ return opts.responseStyle === "data" ? emptyData : {
652
+ data: emptyData,
653
+ ...result
654
+ };
655
+ }
656
+ let data;
657
+ switch (parseAs) {
658
+ case "arrayBuffer":
659
+ case "blob":
660
+ case "formData":
661
+ case "text":
662
+ data = await response[parseAs]();
663
+ break;
664
+ case "json": {
665
+ const text = await response.text();
666
+ data = text ? JSON.parse(text) : {};
667
+ break;
668
+ }
669
+ case "stream":
670
+ return opts.responseStyle === "data" ? response.body : {
671
+ data: response.body,
672
+ ...result
673
+ };
674
+ }
675
+ if (parseAs === "json") {
676
+ if (opts.responseValidator) {
677
+ await opts.responseValidator(data);
678
+ }
679
+ if (opts.responseTransformer) {
680
+ data = await opts.responseTransformer(data);
681
+ }
682
+ }
683
+ return opts.responseStyle === "data" ? data : {
684
+ data,
685
+ ...result
686
+ };
687
+ }
688
+ const textError = await response.text();
689
+ let jsonError;
690
+ try {
691
+ jsonError = JSON.parse(textError);
692
+ } catch {
693
+ }
694
+ const error = jsonError ?? textError;
695
+ let finalError = error;
696
+ for (const fn of interceptors.error.fns) {
697
+ if (fn) {
698
+ finalError = await fn(error, response, request2, opts);
699
+ }
700
+ }
701
+ finalError = finalError || {};
702
+ if (opts.throwOnError) {
703
+ throw finalError;
704
+ }
705
+ return opts.responseStyle === "data" ? void 0 : {
706
+ error: finalError,
707
+ ...result
708
+ };
709
+ };
710
+ const makeMethodFn = (method) => (options) => request({ ...options, method });
711
+ const makeSseFn = (method) => async (options) => {
712
+ const { opts, url } = await beforeRequest(options);
713
+ return createSseClient({
714
+ ...opts,
715
+ body: opts.body,
716
+ headers: opts.headers,
717
+ method,
718
+ onRequest: async (url2, init) => {
719
+ let request2 = new Request(url2, init);
720
+ for (const fn of interceptors.request.fns) {
721
+ if (fn) {
722
+ request2 = await fn(request2, opts);
723
+ }
724
+ }
725
+ return request2;
726
+ },
727
+ serializedBody: getValidRequestBody(opts),
728
+ url
729
+ });
730
+ };
731
+ return {
732
+ buildUrl,
733
+ connect: makeMethodFn("CONNECT"),
734
+ delete: makeMethodFn("DELETE"),
735
+ get: makeMethodFn("GET"),
736
+ getConfig,
737
+ head: makeMethodFn("HEAD"),
738
+ interceptors,
739
+ options: makeMethodFn("OPTIONS"),
740
+ patch: makeMethodFn("PATCH"),
741
+ post: makeMethodFn("POST"),
742
+ put: makeMethodFn("PUT"),
743
+ request,
744
+ setConfig,
745
+ sse: {
746
+ connect: makeSseFn("CONNECT"),
747
+ delete: makeSseFn("DELETE"),
748
+ get: makeSseFn("GET"),
749
+ head: makeSseFn("HEAD"),
750
+ options: makeSseFn("OPTIONS"),
751
+ patch: makeSseFn("PATCH"),
752
+ post: makeSseFn("POST"),
753
+ put: makeSseFn("PUT"),
754
+ trace: makeSseFn("TRACE")
755
+ },
756
+ trace: makeMethodFn("TRACE")
757
+ };
758
+ };
759
+
760
+ // ../../packages/api-client/dist/client.gen.js
761
+ var client = createClient(createConfig({ baseUrl: "https://dreamboard.games" }));
762
+
763
+ export {
764
+ client
765
+ };
766
+ //# sourceMappingURL=chunk-MYMVXTZT.mjs.map