apps 0.0.1-beta.37 → 0.0.1-beta.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/framework-reference.json +1 -1
- package/js/{chunk-GHDZEEPO.js → chunk-27TDXHRX.js} +395 -82
- package/js/{chunk-KOOJUMLR.js → chunk-3MMG2H6M.js} +2 -2
- package/js/{chunk-LQBR7AI7.js → chunk-3V575NIW.js} +217 -19
- package/js/{chunk-U74JVKTQ.js → chunk-5NIEOXRZ.js} +7 -7
- package/js/{chunk-BWUHMKHQ.js → chunk-5TJA7364.js} +2 -2
- package/js/{chunk-7KEKFBV7.js → chunk-7CSHVXVR.js} +3 -3
- package/js/{chunk-3LRFKLUX.js → chunk-BO4US6DZ.js} +9 -49
- package/js/{chunk-A4O72Z3A.js → chunk-DKUEYTYD.js} +167 -30
- package/js/{chunk-ENJCQWVF.js → chunk-E4BWL7KQ.js} +3 -3
- package/js/{chunk-CAOHGMNW.js → chunk-F3TBO2U3.js} +7 -94
- package/js/{chunk-POOIHRPF.js → chunk-GHXRRFZA.js} +11 -34
- package/js/{chunk-RSNZDT4L.js → chunk-JTMDWPCH.js} +2 -2
- package/js/{chunk-YW333DH3.js → chunk-KANDIVIH.js} +4 -4
- package/js/{chunk-2FWXCU5I.js → chunk-KAQD3DTI.js} +1 -1
- package/js/{chunk-QQKHJ72Y.js → chunk-LVWX4UWK.js} +9 -9
- package/js/{chunk-KEZ4YZSP.js → chunk-MLHNVYHT.js} +2 -2
- package/js/{chunk-IJQ5LE74.js → chunk-MXDKXAY4.js} +363 -401
- package/js/{chunk-BI6R577B.js → chunk-P7MGDPFD.js} +2 -2
- package/js/{chunk-24EIFQYZ.js → chunk-PCV73KVK.js} +35 -10
- package/js/{chunk-JU7F4PRK.js → chunk-RIXVGVA6.js} +2 -2
- package/js/{chunk-D45FU4TZ.js → chunk-SDHD6J37.js} +3 -3
- package/js/{chunk-UCOMVHGW.js → chunk-U5PFZDVB.js} +2 -2
- package/js/{chunk-PHO7HXTC.js → chunk-VIU2XXA7.js} +294 -47
- package/js/{chunk-TADLIUEU.js → chunk-VJQXXOQ3.js} +2 -2
- package/js/{chunk-NHCFIWN5.js → chunk-W2NV54JD.js} +1 -1
- package/js/{chunk-BI45HZWM.js → chunk-YQ35E7KS.js} +1 -1
- package/js/{chunk-WDBUOIWV.js → chunk-ZUKBIHMK.js} +3 -3
- package/js/client.js +13 -17
- package/js/contracts.js +16 -21
- package/js/effect.js +19 -24
- package/js/graphql.js +21 -26
- package/js/host.js +19 -24
- package/js/index.js +13 -26
- package/js/mcp/effect.js +21 -26
- package/js/mcp/stdio.js +21 -26
- package/js/mcp.js +23 -28
- package/js/openapi.js +17 -21
- package/js/react.js +2 -3
- package/js/skills/effect.js +6 -7
- package/js/skills.js +15 -17
- package/js/storage/facet.js +1 -214
- package/js/ui/auth/contracts.js +2 -2
- package/js/ui/auth.js +5 -5
- package/js/ui/contracts.js +5 -6
- package/js/ui/serving.js +10 -11
- package/package.json +1 -2
- package/runtime.json +1 -1
- package/types/apps/src/contracts/app.d.ts +0 -2
- package/types/apps/src/contracts/context.d.ts +12 -11
- package/types/apps/src/contracts/host.d.ts +10 -8
- package/types/apps/src/contracts/live.d.ts +2 -0
- package/types/apps/src/contracts/operations.d.ts +3 -3
- package/types/apps/src/contracts/protocol-version.d.ts +2 -2
- package/types/apps/src/contracts/protocols/10.d.ts +1450 -0
- package/types/apps/src/contracts/protocols/4.d.ts +3 -3
- package/types/apps/src/contracts/protocols/5.d.ts +1 -1
- package/types/apps/src/contracts/protocols/6.d.ts +1 -1
- package/types/apps/src/contracts/protocols/7.d.ts +1 -1
- package/types/apps/src/contracts/sql.d.ts +58 -0
- package/types/apps/src/facet.d.ts +4 -5
- package/types/apps/src/implementation/openapi-compile.d.ts +2 -2
- package/types/apps/src/implementation/schema.d.ts +1 -10
- package/types/apps/src/implementation/sql.d.ts +66 -0
- package/types/apps/src/index.d.ts +1 -2
- package/types/telemetry/src/transport.d.ts +8 -1
- package/js/chunk-73AV3JVU.js +0 -186
- package/js/chunk-HDAQBRT5.js +0 -1254
- package/js/chunk-IU7CCCUC.js +0 -630
- package/js/chunk-NHUHTWAF.js +0 -0
- package/js/chunk-V5DWGYRK.js +0 -268
- package/js/chunk-Y3XN4X4Q.js +0 -19
- package/types/app-data/src/implementation/cursor.d.ts +0 -10
- package/types/app-data/src/implementation/index-key.d.ts +0 -7
- package/types/app-data/src/implementation/promise.d.ts +0 -68
- package/types/app-data/src/implementation/range.d.ts +0 -8
- package/types/app-data/src/implementation/schema.d.ts +0 -18
- package/types/app-data/src/implementation/sqlite.d.ts +0 -11
- package/types/app-data/src/index.d.ts +0 -4
- package/types/apps/src/contracts/storage.d.ts +0 -68
- package/types/apps/src/implementation/storage.d.ts +0 -15
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
EventEncoded,
|
|
3
|
-
decodeSchema
|
|
4
|
-
} from "./chunk-V5DWGYRK.js";
|
|
5
1
|
import {
|
|
6
2
|
DecodeError,
|
|
7
3
|
HttpClient,
|
|
@@ -23,7 +19,7 @@ import {
|
|
|
23
19
|
text,
|
|
24
20
|
uint8Array,
|
|
25
21
|
urlParams
|
|
26
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-3MMG2H6M.js";
|
|
27
23
|
import {
|
|
28
24
|
Cause,
|
|
29
25
|
Defect,
|
|
@@ -35,8 +31,11 @@ import {
|
|
|
35
31
|
Service,
|
|
36
32
|
String as String2,
|
|
37
33
|
Struct,
|
|
34
|
+
TaggedClass,
|
|
35
|
+
TaggedError,
|
|
38
36
|
Uint8Array as Uint8Array2,
|
|
39
37
|
Undefined,
|
|
38
|
+
UndefinedOr,
|
|
40
39
|
Union,
|
|
41
40
|
Unknown,
|
|
42
41
|
UnknownFromJsonString,
|
|
@@ -51,6 +50,7 @@ import {
|
|
|
51
50
|
constVoid,
|
|
52
51
|
context,
|
|
53
52
|
declare,
|
|
53
|
+
decode2 as decode,
|
|
54
54
|
decodeText,
|
|
55
55
|
decodeTo,
|
|
56
56
|
decodeUnknownEffect2 as decodeUnknownEffect,
|
|
@@ -59,13 +59,15 @@ import {
|
|
|
59
59
|
encodeSync,
|
|
60
60
|
encodeUnknownEffect2 as encodeUnknownEffect,
|
|
61
61
|
ensure,
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
fail,
|
|
63
|
+
fail2,
|
|
64
|
+
fail4 as fail3,
|
|
64
65
|
failCause2 as failCause,
|
|
65
66
|
flatMap2 as flatMap,
|
|
66
67
|
fnUntraced,
|
|
67
68
|
fromInput3 as fromInput,
|
|
68
69
|
fromJsonString,
|
|
70
|
+
fromTransform,
|
|
69
71
|
gen,
|
|
70
72
|
getLastEncoding,
|
|
71
73
|
getOrUndefined2 as getOrUndefined,
|
|
@@ -83,7 +85,7 @@ import {
|
|
|
83
85
|
isSuspend,
|
|
84
86
|
isUnion,
|
|
85
87
|
isVoid,
|
|
86
|
-
|
|
88
|
+
make2 as make,
|
|
87
89
|
map2 as map,
|
|
88
90
|
map3 as map2,
|
|
89
91
|
map4 as map3,
|
|
@@ -91,14 +93,18 @@ import {
|
|
|
91
93
|
mapError,
|
|
92
94
|
memoize,
|
|
93
95
|
merge,
|
|
96
|
+
millis,
|
|
94
97
|
optional,
|
|
95
98
|
pipeArguments,
|
|
96
99
|
pipeThroughChannel,
|
|
97
|
-
|
|
100
|
+
pipeTo,
|
|
101
|
+
provideContext,
|
|
98
102
|
resolveAt,
|
|
99
|
-
|
|
103
|
+
succeed,
|
|
104
|
+
succeed4 as succeed2,
|
|
100
105
|
suspend,
|
|
101
106
|
sync2 as sync,
|
|
107
|
+
tag,
|
|
102
108
|
toCodecJson,
|
|
103
109
|
toCodecStringTree,
|
|
104
110
|
toEncoded,
|
|
@@ -106,8 +112,9 @@ import {
|
|
|
106
112
|
toType,
|
|
107
113
|
transform,
|
|
108
114
|
transformEffect,
|
|
109
|
-
transformPull
|
|
110
|
-
|
|
115
|
+
transformPull,
|
|
116
|
+
void_2 as void_
|
|
117
|
+
} from "./chunk-MXDKXAY4.js";
|
|
111
118
|
import {
|
|
112
119
|
__export
|
|
113
120
|
} from "./chunk-CZ7CSFO4.js";
|
|
@@ -152,6 +159,246 @@ __export(HttpApiSchema_exports, {
|
|
|
152
159
|
status: () => status,
|
|
153
160
|
withHeaders: () => withHeaders
|
|
154
161
|
});
|
|
162
|
+
|
|
163
|
+
// ../../node_modules/.bun/effect@4.0.1/node_modules/effect/dist/encoding/Sse.js
|
|
164
|
+
var SseErrorTypeId = "~effect/encoding/Sse/SseError";
|
|
165
|
+
var EventTooLarge = class extends (/* @__PURE__ */ TaggedError("EventTooLarge")) {
|
|
166
|
+
get message() {
|
|
167
|
+
return `Pending SSE event exceeded the maximum size of ${this.maxEventSize}`;
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
var SseError = class extends (/* @__PURE__ */ TaggedError("SseError")) {
|
|
171
|
+
/**
|
|
172
|
+
* Marks this value as an SSE decoding error.
|
|
173
|
+
*
|
|
174
|
+
* @stability unstable
|
|
175
|
+
* @since 4.0.0
|
|
176
|
+
*/
|
|
177
|
+
[SseErrorTypeId] = SseErrorTypeId;
|
|
178
|
+
/**
|
|
179
|
+
* Delegates the public message to the underlying SSE error reason.
|
|
180
|
+
*
|
|
181
|
+
* @stability unstable
|
|
182
|
+
* @since 4.0.0
|
|
183
|
+
*/
|
|
184
|
+
get message() {
|
|
185
|
+
return this.reason.message;
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
var defaultMaxEventSize = 10 * 1024 * 1024;
|
|
189
|
+
var decode2 = (options2) => fromTransform((upstream, _scope) => sync(() => {
|
|
190
|
+
let buffer = [];
|
|
191
|
+
let retry;
|
|
192
|
+
const parser = makeParser((event) => {
|
|
193
|
+
if (event._tag === "Retry") {
|
|
194
|
+
retry = event;
|
|
195
|
+
} else {
|
|
196
|
+
buffer.push(event);
|
|
197
|
+
}
|
|
198
|
+
}, options2);
|
|
199
|
+
const pump = flatMap(upstream, (arr) => {
|
|
200
|
+
for (let i = 0; i < arr.length; i++) {
|
|
201
|
+
const error = parser.feed(arr[i]);
|
|
202
|
+
if (error !== void 0) {
|
|
203
|
+
return fail3(error);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
return void_;
|
|
207
|
+
});
|
|
208
|
+
return suspend(function loop() {
|
|
209
|
+
if (isArrayNonEmpty(buffer)) {
|
|
210
|
+
const out = buffer;
|
|
211
|
+
buffer = [];
|
|
212
|
+
return succeed2(out);
|
|
213
|
+
} else if (retry) {
|
|
214
|
+
return fail3(retry);
|
|
215
|
+
}
|
|
216
|
+
return flatMap(pump, loop);
|
|
217
|
+
});
|
|
218
|
+
}));
|
|
219
|
+
var decodeSchema = (schema, options2, parseOptions) => pipeTo(decode2(options2), decode(Event.pipe(decodeTo(schema, transformEvent)), parseOptions)());
|
|
220
|
+
function makeParser(onParse, options2) {
|
|
221
|
+
const maxEventSize = options2?.maxEventSize ?? defaultMaxEventSize;
|
|
222
|
+
let isFirstChunk;
|
|
223
|
+
let buffer;
|
|
224
|
+
let startingPosition;
|
|
225
|
+
let startingFieldLength;
|
|
226
|
+
let discardTrailingNewline;
|
|
227
|
+
let lastEventId;
|
|
228
|
+
let eventName;
|
|
229
|
+
let data;
|
|
230
|
+
reset();
|
|
231
|
+
return {
|
|
232
|
+
feed,
|
|
233
|
+
reset
|
|
234
|
+
};
|
|
235
|
+
function reset() {
|
|
236
|
+
isFirstChunk = true;
|
|
237
|
+
buffer = "";
|
|
238
|
+
startingPosition = 0;
|
|
239
|
+
startingFieldLength = -1;
|
|
240
|
+
discardTrailingNewline = false;
|
|
241
|
+
lastEventId = void 0;
|
|
242
|
+
eventName = void 0;
|
|
243
|
+
data = "";
|
|
244
|
+
}
|
|
245
|
+
function feed(chunk) {
|
|
246
|
+
buffer = buffer ? buffer + chunk : chunk;
|
|
247
|
+
if (isFirstChunk && buffer.startsWith(BOM)) {
|
|
248
|
+
buffer = buffer.slice(BOM.length);
|
|
249
|
+
}
|
|
250
|
+
isFirstChunk = false;
|
|
251
|
+
const length = buffer.length;
|
|
252
|
+
let position = 0;
|
|
253
|
+
while (position < length) {
|
|
254
|
+
if (discardTrailingNewline) {
|
|
255
|
+
if (buffer[position] === "\n") {
|
|
256
|
+
++position;
|
|
257
|
+
}
|
|
258
|
+
discardTrailingNewline = false;
|
|
259
|
+
}
|
|
260
|
+
let lineLength = -1;
|
|
261
|
+
let fieldLength = startingFieldLength;
|
|
262
|
+
let character;
|
|
263
|
+
for (let index = position + startingPosition; lineLength < 0 && index < length; ++index) {
|
|
264
|
+
character = buffer[index];
|
|
265
|
+
if (character === ":" && fieldLength < 0) {
|
|
266
|
+
fieldLength = index - position;
|
|
267
|
+
} else if (character === "\r") {
|
|
268
|
+
discardTrailingNewline = true;
|
|
269
|
+
lineLength = index - position;
|
|
270
|
+
} else if (character === "\n") {
|
|
271
|
+
lineLength = index - position;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
if (lineLength < 0) {
|
|
275
|
+
startingPosition = length - position;
|
|
276
|
+
startingFieldLength = fieldLength;
|
|
277
|
+
break;
|
|
278
|
+
} else {
|
|
279
|
+
startingPosition = 0;
|
|
280
|
+
startingFieldLength = -1;
|
|
281
|
+
}
|
|
282
|
+
parseEventStreamLine(buffer, position, fieldLength, lineLength);
|
|
283
|
+
position += lineLength + 1;
|
|
284
|
+
}
|
|
285
|
+
if (position === length) {
|
|
286
|
+
buffer = "";
|
|
287
|
+
} else if (position > 0) {
|
|
288
|
+
buffer = buffer.slice(position);
|
|
289
|
+
}
|
|
290
|
+
if (buffer.length + data.length > maxEventSize) {
|
|
291
|
+
const error = new SseError({
|
|
292
|
+
reason: new EventTooLarge({
|
|
293
|
+
maxEventSize
|
|
294
|
+
})
|
|
295
|
+
});
|
|
296
|
+
reset();
|
|
297
|
+
return error;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
function parseEventStreamLine(lineBuffer, index, fieldLength, lineLength) {
|
|
301
|
+
if (lineLength === 0) {
|
|
302
|
+
if (data.length > 0) {
|
|
303
|
+
onParse({
|
|
304
|
+
_tag: "Event",
|
|
305
|
+
id: lastEventId,
|
|
306
|
+
event: eventName || "message",
|
|
307
|
+
data: data.slice(0, -1)
|
|
308
|
+
// remove trailing newline
|
|
309
|
+
});
|
|
310
|
+
data = "";
|
|
311
|
+
}
|
|
312
|
+
eventName = void 0;
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
const noValue = fieldLength < 0;
|
|
316
|
+
const field = lineBuffer.slice(index, index + (noValue ? lineLength : fieldLength));
|
|
317
|
+
let step = 0;
|
|
318
|
+
if (noValue) {
|
|
319
|
+
step = lineLength;
|
|
320
|
+
} else if (lineBuffer[index + fieldLength + 1] === " ") {
|
|
321
|
+
step = fieldLength + 2;
|
|
322
|
+
} else {
|
|
323
|
+
step = fieldLength + 1;
|
|
324
|
+
}
|
|
325
|
+
const position = index + step;
|
|
326
|
+
const valueLength = lineLength - step;
|
|
327
|
+
const value = lineBuffer.slice(position, position + valueLength).toString();
|
|
328
|
+
if (field === "data") {
|
|
329
|
+
data += value ? `${value}
|
|
330
|
+
` : "\n";
|
|
331
|
+
} else if (field === "event") {
|
|
332
|
+
eventName = value;
|
|
333
|
+
} else if (field === "id" && !value.includes("\0")) {
|
|
334
|
+
lastEventId = value;
|
|
335
|
+
} else if (field === "retry" && /^\d+$/.test(value)) {
|
|
336
|
+
const retry = parseInt(value, 10);
|
|
337
|
+
onParse(new Retry({
|
|
338
|
+
duration: millis(retry),
|
|
339
|
+
lastEventId
|
|
340
|
+
}));
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
var BOM = "\uFEFF";
|
|
345
|
+
var EventEncoded = /* @__PURE__ */ Struct({
|
|
346
|
+
id: /* @__PURE__ */ optional(String2),
|
|
347
|
+
event: String2,
|
|
348
|
+
data: String2
|
|
349
|
+
});
|
|
350
|
+
var Event = /* @__PURE__ */ Struct({
|
|
351
|
+
_tag: /* @__PURE__ */ tag("Event"),
|
|
352
|
+
id: /* @__PURE__ */ UndefinedOr(String2),
|
|
353
|
+
event: String2,
|
|
354
|
+
data: String2
|
|
355
|
+
});
|
|
356
|
+
var transformEvent = /* @__PURE__ */ transform({
|
|
357
|
+
decode: (event) => event.id === void 0 ? {
|
|
358
|
+
event: event.event,
|
|
359
|
+
data: event.data
|
|
360
|
+
} : {
|
|
361
|
+
id: event.id,
|
|
362
|
+
event: event.event,
|
|
363
|
+
data: event.data
|
|
364
|
+
},
|
|
365
|
+
encode: (event) => ({
|
|
366
|
+
_tag: "Event",
|
|
367
|
+
id: event.id,
|
|
368
|
+
event: event.event ?? "message",
|
|
369
|
+
data: event.data
|
|
370
|
+
})
|
|
371
|
+
});
|
|
372
|
+
var RetryTypeId = "~effect/encoding/Sse/Retry";
|
|
373
|
+
var Retry = class _Retry extends (/* @__PURE__ */ TaggedClass("Retry")) {
|
|
374
|
+
/**
|
|
375
|
+
* Marks this value as an SSE retry directive for runtime guards.
|
|
376
|
+
*
|
|
377
|
+
* @stability unstable
|
|
378
|
+
* @since 4.0.0
|
|
379
|
+
*/
|
|
380
|
+
[RetryTypeId] = RetryTypeId;
|
|
381
|
+
/**
|
|
382
|
+
* Returns `true` when the value is an SSE retry directive.
|
|
383
|
+
*
|
|
384
|
+
* @stability unstable
|
|
385
|
+
* @since 4.0.0
|
|
386
|
+
*/
|
|
387
|
+
static is(u) {
|
|
388
|
+
return hasProperty(u, RetryTypeId);
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* Separates SSE retry directives from regular event values.
|
|
392
|
+
*
|
|
393
|
+
* @stability unstable
|
|
394
|
+
* @since 4.0.0
|
|
395
|
+
*/
|
|
396
|
+
static filter(u) {
|
|
397
|
+
return _Retry.is(u) ? succeed(u) : fail(u);
|
|
398
|
+
}
|
|
399
|
+
};
|
|
400
|
+
|
|
401
|
+
// ../../node_modules/.bun/effect@4.0.1/node_modules/effect/dist/http-api/HttpApiSchema.js
|
|
155
402
|
var StreamSchemaTypeId = "~effect/http-api/HttpApiSchema/Stream";
|
|
156
403
|
function status(code) {
|
|
157
404
|
const statusCode = typeof code === "string" ? fromLiteral(code) : code;
|
|
@@ -786,10 +1033,10 @@ var Proto2 = {
|
|
|
786
1033
|
groups: map(this.groups, (group2) => group2.prefix(prefix))
|
|
787
1034
|
});
|
|
788
1035
|
},
|
|
789
|
-
middleware(
|
|
1036
|
+
middleware(tag2) {
|
|
790
1037
|
return makeProto2({
|
|
791
1038
|
...optionsFromApi(this),
|
|
792
|
-
groups: map(this.groups, (group2) => group2.middleware(
|
|
1039
|
+
groups: map(this.groups, (group2) => group2.middleware(tag2))
|
|
793
1040
|
});
|
|
794
1041
|
},
|
|
795
1042
|
annotate(key, value) {
|
|
@@ -847,16 +1094,16 @@ var reflect = (self, options2) => {
|
|
|
847
1094
|
}
|
|
848
1095
|
};
|
|
849
1096
|
var extractResponseContent = (schemas, getStatus) => {
|
|
850
|
-
const
|
|
1097
|
+
const map7 = /* @__PURE__ */ new Map();
|
|
851
1098
|
schemas.forEach(add2);
|
|
852
|
-
return
|
|
1099
|
+
return map7;
|
|
853
1100
|
function add2(schema) {
|
|
854
1101
|
const body = isWithHeaders(schema) ? schema.schema : schema;
|
|
855
1102
|
if (isStreamSchema(body)) return;
|
|
856
1103
|
const status2 = getStatus(schema);
|
|
857
|
-
const schemas2 =
|
|
1104
|
+
const schemas2 = map7.get(status2);
|
|
858
1105
|
if (schemas2 === void 0) {
|
|
859
|
-
|
|
1106
|
+
map7.set(status2, [schema]);
|
|
860
1107
|
} else {
|
|
861
1108
|
schemas2.push(schema);
|
|
862
1109
|
}
|
|
@@ -1036,13 +1283,13 @@ var makeClient = (api, options2) => gen(function* () {
|
|
|
1036
1283
|
}
|
|
1037
1284
|
}
|
|
1038
1285
|
for (const [status2, alternatives] of errorAlternatives.entries()) {
|
|
1039
|
-
const
|
|
1040
|
-
decodeMap[status2] = (response) => flatMap(catchCause(
|
|
1286
|
+
const decode3 = makeResponseDecoder(alternatives);
|
|
1287
|
+
decodeMap[status2] = (response) => flatMap(catchCause(decode3(response), (cause) => failCause(combine(fail2(new HttpClientError({
|
|
1041
1288
|
reason: new StatusCodeError({
|
|
1042
1289
|
request: response.request,
|
|
1043
1290
|
response
|
|
1044
1291
|
})
|
|
1045
|
-
})), cause))),
|
|
1292
|
+
})), cause))), fail3);
|
|
1046
1293
|
}
|
|
1047
1294
|
const successAlternatives = /* @__PURE__ */ new Map();
|
|
1048
1295
|
for (const [status2, schemas] of successes.entries()) {
|
|
@@ -1063,7 +1310,7 @@ var makeClient = (api, options2) => gen(function* () {
|
|
|
1063
1310
|
const encodePayload = isArrayNonEmpty(payloadSchemas) ? encodeUnknownEffect(hasBody(endpoint2.method) ? getEncodePayloadSchema(payloadSchemas, endpoint2.method) : Union(payloadSchemas), parseOptions.payload) : void 0;
|
|
1064
1311
|
const encodeHeaders = map4(endpoint2.headers, (schema) => encodeUnknownEffect(schema, parseOptions.headers));
|
|
1065
1312
|
const encodeQuery = map4(endpoint2.query, (schema) => encodeUnknownEffect(schema, parseOptions.query));
|
|
1066
|
-
const middlewareKeys = Array.from(onEndpointOptions.middleware, (
|
|
1313
|
+
const middlewareKeys = Array.from(onEndpointOptions.middleware, (tag2) => `${tag2.key}/Client`);
|
|
1067
1314
|
const endpointFn = fnUntraced(function* (request) {
|
|
1068
1315
|
let httpRequest = make2(endpoint2.method)(endpoint2.path);
|
|
1069
1316
|
if (request !== void 0) {
|
|
@@ -1227,11 +1474,11 @@ var compilePath = (path, schema) => {
|
|
|
1227
1474
|
function schemasToResponse(schemas, options2, headersOptions) {
|
|
1228
1475
|
const hasWithHeaders = schemas.some((schema) => isWithHeaders(schema) || getWithHeadersAnnotation(schema.ast) !== void 0);
|
|
1229
1476
|
const codec = hasWithHeaders ? Union(schemas.map((schema) => toCodecArrayBufferWithHeaders(schema, options2, headersOptions))) : toCodecArrayBuffer(schemas);
|
|
1230
|
-
const
|
|
1231
|
-
return (response) => flatMap(response.arrayBuffer, hasWithHeaders ? (body) =>
|
|
1477
|
+
const decode3 = decodeUnknownEffect(codec, options2);
|
|
1478
|
+
return (response) => flatMap(response.arrayBuffer, hasWithHeaders ? (body) => decode3({
|
|
1232
1479
|
body,
|
|
1233
1480
|
headers: response.headers
|
|
1234
|
-
}) :
|
|
1481
|
+
}) : decode3);
|
|
1235
1482
|
}
|
|
1236
1483
|
var ResponsePair = /* @__PURE__ */ Struct({
|
|
1237
1484
|
body: Unknown,
|
|
@@ -1259,23 +1506,23 @@ function toCodecArrayBufferWithHeaders(schema, options2, headersOptions) {
|
|
|
1259
1506
|
body: decodeBody(pair.body),
|
|
1260
1507
|
headers: decodeHeaders(pair.headers)
|
|
1261
1508
|
}).pipe(map2(parts.toValue), mapError((error) => error.issue)),
|
|
1262
|
-
encode: (input, options3) =>
|
|
1509
|
+
encode: (input, options3) => fail3(new Forbidden({
|
|
1263
1510
|
message: "Decode only schema"
|
|
1264
1511
|
}, input, options3))
|
|
1265
1512
|
})));
|
|
1266
1513
|
}
|
|
1267
|
-
function addResponseAlternative(
|
|
1514
|
+
function addResponseAlternative(map7, status2, contentType, decode3) {
|
|
1268
1515
|
const normalizedContentType = normalize(contentType);
|
|
1269
|
-
const alternatives =
|
|
1516
|
+
const alternatives = map7.get(status2);
|
|
1270
1517
|
if (alternatives === void 0) {
|
|
1271
|
-
|
|
1518
|
+
map7.set(status2, [{
|
|
1272
1519
|
contentType: normalizedContentType,
|
|
1273
|
-
decode
|
|
1520
|
+
decode: decode3
|
|
1274
1521
|
}]);
|
|
1275
1522
|
} else {
|
|
1276
1523
|
alternatives.push({
|
|
1277
1524
|
contentType: normalizedContentType,
|
|
1278
|
-
decode
|
|
1525
|
+
decode: decode3
|
|
1279
1526
|
});
|
|
1280
1527
|
}
|
|
1281
1528
|
}
|
|
@@ -1306,7 +1553,7 @@ function groupSchemasByContentType(schemas) {
|
|
|
1306
1553
|
}
|
|
1307
1554
|
function failUnsupportedContentType(response, contentType, alternatives) {
|
|
1308
1555
|
const expected = Array.from(new Set(alternatives.map((alternative) => alternative.contentType))).join(", ");
|
|
1309
|
-
return
|
|
1556
|
+
return fail3(new HttpClientError({
|
|
1310
1557
|
reason: new DecodeError({
|
|
1311
1558
|
request: response.request,
|
|
1312
1559
|
response,
|
|
@@ -1342,13 +1589,13 @@ function streamToResponse(successSchema, options2, headersOptions) {
|
|
|
1342
1589
|
})));
|
|
1343
1590
|
}
|
|
1344
1591
|
function makeSseDecoder(declaration, parseOptions) {
|
|
1345
|
-
const
|
|
1592
|
+
const Event2 = Union([Struct({
|
|
1346
1593
|
id: optional(String2),
|
|
1347
1594
|
event: Literal(reservedStreamFailureEvent2),
|
|
1348
1595
|
data: fromJsonString(toCodecJson(Cause(declaration.error, Defect())))
|
|
1349
1596
|
}), declaration.events]);
|
|
1350
|
-
const defaultDecoder = decodeSchema(
|
|
1351
|
-
return (options2) => options2 === void 0 ? defaultDecoder : decodeSchema(
|
|
1597
|
+
const defaultDecoder = decodeSchema(Event2, void 0, parseOptions);
|
|
1598
|
+
return (options2) => options2 === void 0 ? defaultDecoder : decodeSchema(Event2, options2, parseOptions);
|
|
1352
1599
|
}
|
|
1353
1600
|
function decodeSseStream(stream, declaration, decoder) {
|
|
1354
1601
|
const events = transformPull(stream.pipe(decodeText, pipeThroughChannel(decoder)), (pull) => sync(() => {
|
|
@@ -1369,7 +1616,7 @@ function decodeSseStream(stream, declaration, decoder) {
|
|
|
1369
1616
|
break;
|
|
1370
1617
|
}
|
|
1371
1618
|
}
|
|
1372
|
-
return
|
|
1619
|
+
return succeed2(events2);
|
|
1373
1620
|
});
|
|
1374
1621
|
});
|
|
1375
1622
|
}));
|
|
@@ -1433,7 +1680,7 @@ function fromArrayBuffer(schema) {
|
|
|
1433
1680
|
return StringFromArrayBuffer;
|
|
1434
1681
|
}
|
|
1435
1682
|
}
|
|
1436
|
-
var statusOrElse = (response) =>
|
|
1683
|
+
var statusOrElse = (response) => fail3(new HttpClientError({
|
|
1437
1684
|
reason: new DecodeError({
|
|
1438
1685
|
request: response.request,
|
|
1439
1686
|
response
|
|
@@ -1453,49 +1700,49 @@ function getEncodePayloadSchemaFromBody(schema, method) {
|
|
|
1453
1700
|
const encoding = getPayloadEncoding(ast, method);
|
|
1454
1701
|
const out = $HttpBody.pipe(decodeTo(schema, transformEffect({
|
|
1455
1702
|
decode(input, options2) {
|
|
1456
|
-
return
|
|
1703
|
+
return fail3(new Forbidden({
|
|
1457
1704
|
message: "Encode only schema"
|
|
1458
1705
|
}, input, options2));
|
|
1459
1706
|
},
|
|
1460
1707
|
encode(t, options2) {
|
|
1461
1708
|
switch (encoding._tag) {
|
|
1462
1709
|
case "Multipart":
|
|
1463
|
-
return
|
|
1710
|
+
return fail3(new Forbidden({
|
|
1464
1711
|
message: "Payload must be a FormData"
|
|
1465
1712
|
}, t, options2));
|
|
1466
1713
|
case "Json": {
|
|
1467
1714
|
try {
|
|
1468
1715
|
const body = JSON.stringify(t);
|
|
1469
|
-
return
|
|
1716
|
+
return succeed2(text(body, encoding.contentType));
|
|
1470
1717
|
} catch {
|
|
1471
|
-
return
|
|
1718
|
+
return fail3(new InvalidValue({
|
|
1472
1719
|
expected: "a JSON-serializable request body"
|
|
1473
1720
|
}, t, options2));
|
|
1474
1721
|
}
|
|
1475
1722
|
}
|
|
1476
1723
|
case "Text": {
|
|
1477
1724
|
if (typeof t !== "string") {
|
|
1478
|
-
return
|
|
1725
|
+
return fail3(new InvalidValue({
|
|
1479
1726
|
message: "Expected a string"
|
|
1480
1727
|
}, t, options2));
|
|
1481
1728
|
}
|
|
1482
|
-
return
|
|
1729
|
+
return succeed2(text(t, encoding.contentType));
|
|
1483
1730
|
}
|
|
1484
1731
|
case "FormUrlEncoded": {
|
|
1485
1732
|
if (!isObject(t)) {
|
|
1486
|
-
return
|
|
1733
|
+
return fail3(new InvalidValue({
|
|
1487
1734
|
message: "Expected a record"
|
|
1488
1735
|
}, t, options2));
|
|
1489
1736
|
}
|
|
1490
|
-
return
|
|
1737
|
+
return succeed2(urlParams(fromInput(t), encoding.contentType));
|
|
1491
1738
|
}
|
|
1492
1739
|
case "Uint8Array": {
|
|
1493
1740
|
if (!(t instanceof Uint8Array)) {
|
|
1494
|
-
return
|
|
1741
|
+
return fail3(new InvalidValue({
|
|
1495
1742
|
message: "Expected a Uint8Array"
|
|
1496
1743
|
}, t, options2));
|
|
1497
1744
|
}
|
|
1498
|
-
return
|
|
1745
|
+
return succeed2(uint8Array(t, encoding.contentType));
|
|
1499
1746
|
}
|
|
1500
1747
|
}
|
|
1501
1748
|
}
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
fromWeb,
|
|
5
5
|
layerMergedContext,
|
|
6
6
|
make2 as make
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-3MMG2H6M.js";
|
|
8
8
|
import {
|
|
9
9
|
Reference,
|
|
10
10
|
Service,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
succeed4 as succeed,
|
|
18
18
|
toReadableStreamEffect,
|
|
19
19
|
tryPromise
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-MXDKXAY4.js";
|
|
21
21
|
import {
|
|
22
22
|
__export
|
|
23
23
|
} from "./chunk-CZ7CSFO4.js";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
JsonValue
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YQ35E7KS.js";
|
|
4
4
|
import {
|
|
5
5
|
HttpApiEndpoint_exports,
|
|
6
6
|
HttpApiGroup_exports,
|
|
7
7
|
HttpApiSchema_exports,
|
|
8
8
|
HttpApi_exports
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-VIU2XXA7.js";
|
|
10
10
|
import {
|
|
11
11
|
Schema_exports
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-MXDKXAY4.js";
|
|
13
13
|
|
|
14
14
|
// src/contracts/ui.ts
|
|
15
15
|
var UiContext = Schema_exports.Struct({
|
package/js/client.js
CHANGED
|
@@ -3,41 +3,36 @@ import {
|
|
|
3
3
|
UiContext,
|
|
4
4
|
UiDeploymentChanged,
|
|
5
5
|
UiFailed
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZUKBIHMK.js";
|
|
7
7
|
import {
|
|
8
8
|
AsyncResult_exports,
|
|
9
9
|
AtomRegistry_exports,
|
|
10
10
|
Atom_exports,
|
|
11
11
|
queryResult
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-HDAQBRT5.js";
|
|
12
|
+
} from "./chunk-DKUEYTYD.js";
|
|
14
13
|
import {
|
|
15
14
|
OtlpExporter_exports,
|
|
16
15
|
externalTrace,
|
|
17
16
|
pendingSpan,
|
|
18
17
|
telemetryLayer,
|
|
19
18
|
traceLinks
|
|
20
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-PCV73KVK.js";
|
|
21
20
|
import {
|
|
22
21
|
FetchHttpClient_exports
|
|
23
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-VJQXXOQ3.js";
|
|
24
23
|
import {
|
|
25
24
|
decoderOf
|
|
26
|
-
} from "./chunk-
|
|
27
|
-
import
|
|
28
|
-
StorageName
|
|
29
|
-
} from "./chunk-Y3XN4X4Q.js";
|
|
30
|
-
import "./chunk-2FWXCU5I.js";
|
|
25
|
+
} from "./chunk-GHXRRFZA.js";
|
|
26
|
+
import "./chunk-KAQD3DTI.js";
|
|
31
27
|
import {
|
|
32
28
|
JsonValue
|
|
33
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-YQ35E7KS.js";
|
|
34
30
|
import {
|
|
35
31
|
HttpApiClient_exports
|
|
36
|
-
} from "./chunk-
|
|
37
|
-
import "./chunk-V5DWGYRK.js";
|
|
32
|
+
} from "./chunk-VIU2XXA7.js";
|
|
38
33
|
import {
|
|
39
34
|
HttpClientError_exports
|
|
40
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-3MMG2H6M.js";
|
|
41
36
|
import {
|
|
42
37
|
Cause_exports,
|
|
43
38
|
Clock_exports,
|
|
@@ -56,20 +51,21 @@ import {
|
|
|
56
51
|
Semaphore_exports,
|
|
57
52
|
Stream_exports,
|
|
58
53
|
Tracer_exports
|
|
59
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-MXDKXAY4.js";
|
|
60
55
|
import "./chunk-CZ7CSFO4.js";
|
|
61
56
|
|
|
62
57
|
// src/contracts/live.ts
|
|
58
|
+
var OperationName = Schema_exports.NonEmptyString.check(Schema_exports.isMaxLength(200));
|
|
63
59
|
var AppQueryFailed = class extends Schema_exports.TaggedError()("AppQueryFailed", {}) {
|
|
64
60
|
};
|
|
65
61
|
|
|
66
62
|
// src/implementation/live.ts
|
|
67
63
|
var queryReference = (name) => ({
|
|
68
|
-
name: Schema_exports.decodeUnknownSync(
|
|
64
|
+
name: Schema_exports.decodeUnknownSync(OperationName)(name),
|
|
69
65
|
kind: "query"
|
|
70
66
|
});
|
|
71
67
|
var mutationReference = (name) => ({
|
|
72
|
-
name: Schema_exports.decodeUnknownSync(
|
|
68
|
+
name: Schema_exports.decodeUnknownSync(OperationName)(name),
|
|
73
69
|
kind: "mutation"
|
|
74
70
|
});
|
|
75
71
|
var liveQueryAtom = (reference, input, options) => Atom_exports.make(
|