@kitman-sh/cli 0.6.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-brp7cekg.js → chunk-1d2e4je3.js} +1 -1
- package/dist/chunk-23ch5vdv.js +78 -0
- package/dist/{chunk-fc0v325q.js → chunk-2vcae278.js} +9 -10
- package/dist/{chunk-h8ctzn91.js → chunk-50w9z6we.js} +9 -12
- package/dist/{chunk-txyq8r41.js → chunk-5rp5hvc0.js} +1177 -250
- package/dist/{chunk-hw7qkap1.js → chunk-9bje6bm0.js} +22 -361
- package/dist/{chunk-tfr74ays.js → chunk-eynqc0vm.js} +142 -33
- package/dist/{chunk-3j7sewn0.js → chunk-f1f60hgt.js} +782 -615
- package/dist/{chunk-dsefng1v.js → chunk-gj8pz39x.js} +5 -6
- package/dist/{chunk-6h8ghah0.js → chunk-mx1x1b6a.js} +3 -4
- package/dist/{chunk-n32jhswz.js → chunk-tkk2synn.js} +21 -23
- package/dist/index.js +165 -78
- package/package.json +1 -1
- package/dist/chunk-hrvcz0m4.js +0 -211
- package/dist/chunk-xdk488qp.js +0 -364
|
@@ -1,23 +1,16 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
|
-
pipeArguments,
|
|
4
3
|
dual,
|
|
5
4
|
identity,
|
|
6
5
|
constVoid,
|
|
7
6
|
flow,
|
|
8
7
|
hasProperty,
|
|
9
|
-
getStackTraceLimit,
|
|
10
|
-
setStackTraceLimit,
|
|
11
8
|
assignProperty,
|
|
12
|
-
none,
|
|
13
|
-
some,
|
|
14
9
|
isNone,
|
|
15
10
|
isSome,
|
|
16
11
|
map,
|
|
17
|
-
|
|
18
|
-
makeUnsafe,
|
|
12
|
+
Service,
|
|
19
13
|
empty,
|
|
20
|
-
make8,
|
|
21
14
|
add,
|
|
22
15
|
getOrUndefinedUnsafe,
|
|
23
16
|
getUnsafe,
|
|
@@ -41,12 +34,10 @@ import {
|
|
|
41
34
|
addFinalizer,
|
|
42
35
|
succeed4,
|
|
43
36
|
effect,
|
|
44
|
-
effectContext,
|
|
45
37
|
Clock,
|
|
46
38
|
min,
|
|
47
39
|
exponential,
|
|
48
40
|
spaced,
|
|
49
|
-
isEffect,
|
|
50
41
|
forEach,
|
|
51
42
|
whileLoop,
|
|
52
43
|
succeed5,
|
|
@@ -75,7 +66,6 @@ import {
|
|
|
75
66
|
matchCauseEffect,
|
|
76
67
|
context,
|
|
77
68
|
contextWith,
|
|
78
|
-
provide3,
|
|
79
69
|
provideContext,
|
|
80
70
|
serviceOption,
|
|
81
71
|
updateContext,
|
|
@@ -102,46 +92,40 @@ import {
|
|
|
102
92
|
annotateLogs,
|
|
103
93
|
interrupt3,
|
|
104
94
|
getCurrent,
|
|
105
|
-
|
|
95
|
+
makeUnsafe3,
|
|
106
96
|
bounded,
|
|
107
97
|
offerAll,
|
|
108
98
|
failCause3,
|
|
109
99
|
end,
|
|
110
100
|
shutdownUnsafe,
|
|
111
|
-
isStream,
|
|
112
101
|
fromQueue,
|
|
113
102
|
unwrap,
|
|
114
|
-
provideContext2,
|
|
115
103
|
empty3,
|
|
116
104
|
fromInput,
|
|
117
105
|
merge3,
|
|
118
|
-
declare,
|
|
119
106
|
decodeUnknownEffect,
|
|
120
107
|
decodeSync,
|
|
121
108
|
encodeEffect,
|
|
122
|
-
make16,
|
|
123
|
-
isSchema,
|
|
124
109
|
optional,
|
|
125
|
-
Never,
|
|
126
110
|
String2,
|
|
127
|
-
Void,
|
|
128
|
-
Struct,
|
|
129
111
|
NonEmptyArray,
|
|
130
112
|
Union,
|
|
131
113
|
Literals,
|
|
132
114
|
tag,
|
|
133
115
|
Int,
|
|
134
116
|
Defect,
|
|
135
|
-
Exit,
|
|
136
|
-
Class,
|
|
137
117
|
Error2,
|
|
138
118
|
TaggedError2,
|
|
139
119
|
toCodecJson,
|
|
140
|
-
HttpClientErrorSchema
|
|
141
|
-
|
|
120
|
+
HttpClientErrorSchema,
|
|
121
|
+
isStreamSchema,
|
|
122
|
+
getStreamSchemas,
|
|
123
|
+
exitSchema
|
|
124
|
+
} from "./chunk-5rp5hvc0.js";
|
|
125
|
+
|
|
142
126
|
// node_modules/.bun/effect@4.0.4/node_modules/effect/dist/socket/Socket.js
|
|
143
127
|
var TypeId = "~effect/socket/Socket";
|
|
144
|
-
var Socket = /* @__PURE__ */
|
|
128
|
+
var Socket = /* @__PURE__ */ Service("effect/socket/Socket");
|
|
145
129
|
var make4 = (options) => Socket.of({
|
|
146
130
|
[TypeId]: TypeId,
|
|
147
131
|
reader: options.reader,
|
|
@@ -242,7 +226,7 @@ var closeError = (code, closeReason) => new SocketError({
|
|
|
242
226
|
closeReason
|
|
243
227
|
})
|
|
244
228
|
});
|
|
245
|
-
class WebSocketConstructor extends (/* @__PURE__ */
|
|
229
|
+
class WebSocketConstructor extends (/* @__PURE__ */ Service()("@effect/platform/Socket/WebSocketConstructor")) {
|
|
246
230
|
}
|
|
247
231
|
var layerWebSocketConstructorGlobal = /* @__PURE__ */ succeed4(WebSocketConstructor)((url, options) => {
|
|
248
232
|
if (options !== undefined && typeof options !== "string" && !Array.isArray(options)) {
|
|
@@ -257,7 +241,7 @@ var makeWebSocket = (url, options) => WebSocketConstructor.use((makeWs) => fromW
|
|
|
257
241
|
var isPausable = (ws) => ("pause" in ws) && typeof ws.pause === "function";
|
|
258
242
|
var fromWebSocket = (acquire, options) => withFiber((fiber) => {
|
|
259
243
|
let currentWS;
|
|
260
|
-
const latch =
|
|
244
|
+
const latch = makeUnsafe3(false);
|
|
261
245
|
const acquireContext = fiber.context;
|
|
262
246
|
const reader = gen(function* () {
|
|
263
247
|
const scope2 = yield* scope;
|
|
@@ -485,167 +469,9 @@ var fromWebSocket = (acquire, options) => withFiber((fiber) => {
|
|
|
485
469
|
});
|
|
486
470
|
var defaultHighWaterMark = 64 * 1024;
|
|
487
471
|
var layerWebSocket = /* @__PURE__ */ flow(makeWebSocket, /* @__PURE__ */ effect(Socket));
|
|
488
|
-
// node_modules/.bun/effect@4.0.4/node_modules/effect/dist/PrimaryKey.js
|
|
489
|
-
var symbol = "~effect/PrimaryKey";
|
|
490
|
-
|
|
491
|
-
// node_modules/.bun/effect@4.0.4/node_modules/effect/dist/rpc/RpcSchema.js
|
|
492
|
-
var StreamSchemaTypeId = "~effect/rpc/RpcSchema/StreamSchema";
|
|
493
|
-
function isStreamSchema(schema) {
|
|
494
|
-
return hasProperty(schema, StreamSchemaTypeId);
|
|
495
|
-
}
|
|
496
|
-
function getStreamSchemas(schema) {
|
|
497
|
-
return isStreamSchema(schema) ? some({
|
|
498
|
-
success: schema.success,
|
|
499
|
-
error: schema.error
|
|
500
|
-
}) : none();
|
|
501
|
-
}
|
|
502
|
-
var schema = /* @__PURE__ */ declare(isStream);
|
|
503
|
-
function Stream(success, error) {
|
|
504
|
-
return make16(schema.ast, {
|
|
505
|
-
[StreamSchemaTypeId]: StreamSchemaTypeId,
|
|
506
|
-
success,
|
|
507
|
-
error
|
|
508
|
-
});
|
|
509
|
-
}
|
|
510
472
|
|
|
511
|
-
// node_modules/.bun/effect@4.0.4/node_modules/effect/dist/rpc/Rpc.js
|
|
512
|
-
var TypeId2 = "~effect/rpc/Rpc";
|
|
513
|
-
var Proto = {
|
|
514
|
-
[TypeId2]: TypeId2,
|
|
515
|
-
pipe() {
|
|
516
|
-
return pipeArguments(this, arguments);
|
|
517
|
-
},
|
|
518
|
-
setSuccess(successSchema) {
|
|
519
|
-
return makeProto({
|
|
520
|
-
_tag: this._tag,
|
|
521
|
-
payloadSchema: this.payloadSchema,
|
|
522
|
-
successSchema,
|
|
523
|
-
errorSchema: this.errorSchema,
|
|
524
|
-
defectSchema: this.defectSchema,
|
|
525
|
-
annotations: this.annotations,
|
|
526
|
-
middlewares: this.middlewares
|
|
527
|
-
});
|
|
528
|
-
},
|
|
529
|
-
setError(errorSchema) {
|
|
530
|
-
return makeProto({
|
|
531
|
-
_tag: this._tag,
|
|
532
|
-
payloadSchema: this.payloadSchema,
|
|
533
|
-
successSchema: this.successSchema,
|
|
534
|
-
errorSchema,
|
|
535
|
-
defectSchema: this.defectSchema,
|
|
536
|
-
annotations: this.annotations,
|
|
537
|
-
middlewares: this.middlewares
|
|
538
|
-
});
|
|
539
|
-
},
|
|
540
|
-
setPayload(payloadSchema) {
|
|
541
|
-
return makeProto({
|
|
542
|
-
_tag: this._tag,
|
|
543
|
-
payloadSchema: isSchema(payloadSchema) ? payloadSchema : Struct(payloadSchema),
|
|
544
|
-
successSchema: this.successSchema,
|
|
545
|
-
errorSchema: this.errorSchema,
|
|
546
|
-
defectSchema: this.defectSchema,
|
|
547
|
-
annotations: this.annotations,
|
|
548
|
-
middlewares: this.middlewares
|
|
549
|
-
});
|
|
550
|
-
},
|
|
551
|
-
middleware(middleware) {
|
|
552
|
-
return makeProto({
|
|
553
|
-
_tag: this._tag,
|
|
554
|
-
payloadSchema: this.payloadSchema,
|
|
555
|
-
successSchema: this.successSchema,
|
|
556
|
-
errorSchema: this.errorSchema,
|
|
557
|
-
defectSchema: this.defectSchema,
|
|
558
|
-
annotations: this.annotations,
|
|
559
|
-
middlewares: new Set([...this.middlewares, middleware])
|
|
560
|
-
});
|
|
561
|
-
},
|
|
562
|
-
prefix(prefix) {
|
|
563
|
-
return makeProto({
|
|
564
|
-
_tag: `${prefix}${this._tag}`,
|
|
565
|
-
payloadSchema: this.payloadSchema,
|
|
566
|
-
successSchema: this.successSchema,
|
|
567
|
-
errorSchema: this.errorSchema,
|
|
568
|
-
defectSchema: this.defectSchema,
|
|
569
|
-
annotations: this.annotations,
|
|
570
|
-
middlewares: this.middlewares
|
|
571
|
-
});
|
|
572
|
-
},
|
|
573
|
-
annotate(tag, value) {
|
|
574
|
-
return makeProto({
|
|
575
|
-
_tag: this._tag,
|
|
576
|
-
payloadSchema: this.payloadSchema,
|
|
577
|
-
successSchema: this.successSchema,
|
|
578
|
-
errorSchema: this.errorSchema,
|
|
579
|
-
defectSchema: this.defectSchema,
|
|
580
|
-
middlewares: this.middlewares,
|
|
581
|
-
annotations: add(this.annotations, tag, value)
|
|
582
|
-
});
|
|
583
|
-
},
|
|
584
|
-
annotateMerge(context) {
|
|
585
|
-
return makeProto({
|
|
586
|
-
_tag: this._tag,
|
|
587
|
-
payloadSchema: this.payloadSchema,
|
|
588
|
-
successSchema: this.successSchema,
|
|
589
|
-
errorSchema: this.errorSchema,
|
|
590
|
-
defectSchema: this.defectSchema,
|
|
591
|
-
middlewares: this.middlewares,
|
|
592
|
-
annotations: merge(this.annotations, context)
|
|
593
|
-
});
|
|
594
|
-
}
|
|
595
|
-
};
|
|
596
|
-
var makeProto = (options) => {
|
|
597
|
-
function Rpc() {}
|
|
598
|
-
Object.setPrototypeOf(Rpc, Proto);
|
|
599
|
-
Object.assign(Rpc, options);
|
|
600
|
-
Rpc.key = `effect/rpc/Rpc/${options._tag}`;
|
|
601
|
-
return Rpc;
|
|
602
|
-
};
|
|
603
|
-
var make5 = (tag, options) => {
|
|
604
|
-
const successSchema = options?.success ?? Void;
|
|
605
|
-
const errorSchema = options?.error ?? Never;
|
|
606
|
-
const defectSchema = options?.defect ?? Defect();
|
|
607
|
-
let payloadSchema;
|
|
608
|
-
if (options?.primaryKey) {
|
|
609
|
-
payloadSchema = class Payload extends Class(`effect/rpc/Rpc/${tag}`)(options.payload) {
|
|
610
|
-
[symbol]() {
|
|
611
|
-
return options.primaryKey(this);
|
|
612
|
-
}
|
|
613
|
-
};
|
|
614
|
-
} else {
|
|
615
|
-
payloadSchema = isSchema(options?.payload) ? options?.payload : options?.payload ? Struct(options?.payload) : Void;
|
|
616
|
-
}
|
|
617
|
-
return makeProto({
|
|
618
|
-
_tag: tag,
|
|
619
|
-
payloadSchema,
|
|
620
|
-
successSchema: options?.stream ? Stream(successSchema, errorSchema) : successSchema,
|
|
621
|
-
errorSchema: options?.stream ? Never : errorSchema,
|
|
622
|
-
defectSchema,
|
|
623
|
-
annotations: empty(),
|
|
624
|
-
middlewares: new Set
|
|
625
|
-
});
|
|
626
|
-
};
|
|
627
|
-
var exitSchemaCache = /* @__PURE__ */ new WeakMap;
|
|
628
|
-
var exitSchema = (self) => {
|
|
629
|
-
if (exitSchemaCache.has(self)) {
|
|
630
|
-
return exitSchemaCache.get(self);
|
|
631
|
-
}
|
|
632
|
-
const rpc = self;
|
|
633
|
-
const failures = new Set([rpc.errorSchema]);
|
|
634
|
-
const streamSchemas = getStreamSchemas(rpc.successSchema);
|
|
635
|
-
if (isSome(streamSchemas)) {
|
|
636
|
-
failures.add(streamSchemas.value.error);
|
|
637
|
-
}
|
|
638
|
-
for (const middleware of rpc.middlewares) {
|
|
639
|
-
failures.add(middleware.error);
|
|
640
|
-
}
|
|
641
|
-
const schema = Exit(isSome(streamSchemas) ? Void : rpc.successSchema, Union([...failures]), rpc.defectSchema);
|
|
642
|
-
exitSchemaCache.set(self, schema);
|
|
643
|
-
return schema;
|
|
644
|
-
};
|
|
645
|
-
var WrapperTypeId = "~effect/rpc/Rpc/Wrapper";
|
|
646
|
-
var isWrapper = (u) => (WrapperTypeId in u);
|
|
647
473
|
// node_modules/.bun/effect@4.0.4/node_modules/effect/dist/workers/Transferable.js
|
|
648
|
-
class Collector extends (/* @__PURE__ */
|
|
474
|
+
class Collector extends (/* @__PURE__ */ Service()("effect/workers/Transferable/Collector")) {
|
|
649
475
|
}
|
|
650
476
|
var makeCollectorUnsafe = () => {
|
|
651
477
|
let tranferables = [];
|
|
@@ -707,7 +533,7 @@ var spanAttributes = (tag, attributes) => ({
|
|
|
707
533
|
});
|
|
708
534
|
|
|
709
535
|
// node_modules/.bun/effect@4.0.4/node_modules/effect/dist/rpc/RpcClientError.js
|
|
710
|
-
var
|
|
536
|
+
var TypeId2 = "~effect/rpc/RpcClientError";
|
|
711
537
|
|
|
712
538
|
class RpcClientDefect extends (/* @__PURE__ */ Error2("effect/rpc/RpcClientError/RpcClientDefect")({
|
|
713
539
|
_tag: /* @__PURE__ */ tag("RpcClientDefect"),
|
|
@@ -716,11 +542,11 @@ class RpcClientDefect extends (/* @__PURE__ */ Error2("effect/rpc/RpcClientError
|
|
|
716
542
|
})) {
|
|
717
543
|
}
|
|
718
544
|
|
|
719
|
-
class RpcClientError extends (/* @__PURE__ */ Error2(
|
|
545
|
+
class RpcClientError extends (/* @__PURE__ */ Error2(TypeId2)({
|
|
720
546
|
_tag: /* @__PURE__ */ tag("RpcClientError"),
|
|
721
547
|
reason: /* @__PURE__ */ Union([WorkerErrorReason, SocketErrorReason, HttpClientErrorSchema, RpcClientDefect])
|
|
722
548
|
})) {
|
|
723
|
-
[
|
|
549
|
+
[TypeId2] = TypeId2;
|
|
724
550
|
get message() {
|
|
725
551
|
return `${this.reason._tag}: ${this.reason.message}`;
|
|
726
552
|
}
|
|
@@ -737,7 +563,7 @@ var codecForJson = toCodecJson;
|
|
|
737
563
|
var sharedTextDecoder;
|
|
738
564
|
var decodeText = (bytes) => (sharedTextDecoder ??= new TextDecoder).decode(bytes);
|
|
739
565
|
|
|
740
|
-
class RpcSerialization extends (/* @__PURE__ */
|
|
566
|
+
class RpcSerialization extends (/* @__PURE__ */ Service()("effect/rpc/RpcSerialization")) {
|
|
741
567
|
}
|
|
742
568
|
var defaultMaxBufferSize = 16 * 1024 * 1024;
|
|
743
569
|
var json = /* @__PURE__ */ RpcSerialization.of({
|
|
@@ -1041,7 +867,7 @@ var makeNoSerialization = /* @__PURE__ */ fnUntraced(function* (group, options)
|
|
|
1041
867
|
};
|
|
1042
868
|
});
|
|
1043
869
|
var clientIdCounter = 0;
|
|
1044
|
-
var
|
|
870
|
+
var make5 = /* @__PURE__ */ fnUntraced(function* (group, options) {
|
|
1045
871
|
const clientId = clientIdCounter++;
|
|
1046
872
|
const {
|
|
1047
873
|
codecFor,
|
|
@@ -1193,7 +1019,7 @@ var CurrentHeaders = /* @__PURE__ */ Reference("effect/rpc/RpcClient/CurrentHead
|
|
|
1193
1019
|
});
|
|
1194
1020
|
var withHeaders = /* @__PURE__ */ dual(2, (effect, headers) => updateService(effect, CurrentHeaders, merge3(fromInput(headers))));
|
|
1195
1021
|
|
|
1196
|
-
class Protocol extends (/* @__PURE__ */
|
|
1022
|
+
class Protocol extends (/* @__PURE__ */ Service()("effect/rpc/RpcClient/Protocol")) {
|
|
1197
1023
|
static make = withRunClient;
|
|
1198
1024
|
}
|
|
1199
1025
|
var makeProtocolSocket = (options) => Protocol.make(fnUntraced(function* (writeResponse, clientIds) {
|
|
@@ -1326,7 +1152,7 @@ var makePinger = /* @__PURE__ */ fnUntraced(function* (writePing, options) {
|
|
|
1326
1152
|
const interval = options?.pingInterval ?? "5 seconds";
|
|
1327
1153
|
const timeoutMillis = toMillis(options?.pingTimeout ?? interval);
|
|
1328
1154
|
let lastSeen = clock.currentTimeMillisUnsafe();
|
|
1329
|
-
const latch =
|
|
1155
|
+
const latch = makeUnsafe3();
|
|
1330
1156
|
const onFrame = () => {
|
|
1331
1157
|
lastSeen = clock.currentTimeMillisUnsafe();
|
|
1332
1158
|
};
|
|
@@ -1346,172 +1172,7 @@ var makePinger = /* @__PURE__ */ fnUntraced(function* (writePing, options) {
|
|
|
1346
1172
|
};
|
|
1347
1173
|
});
|
|
1348
1174
|
var layerProtocolSocket = (options) => effect(Protocol)(makeProtocolSocket(options));
|
|
1349
|
-
class ConnectionHooks extends (/* @__PURE__ */
|
|
1175
|
+
class ConnectionHooks extends (/* @__PURE__ */ Service()("effect/rpc/RpcClient/ConnectionHooks")) {
|
|
1350
1176
|
}
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
add(...rpcs) {
|
|
1354
|
-
const requests = new Map(this.requests);
|
|
1355
|
-
for (const rpc of rpcs) {
|
|
1356
|
-
requests.set(rpc._tag, rpc);
|
|
1357
|
-
}
|
|
1358
|
-
return makeProto2({
|
|
1359
|
-
requests,
|
|
1360
|
-
annotations: this.annotations
|
|
1361
|
-
});
|
|
1362
|
-
},
|
|
1363
|
-
merge(...groups) {
|
|
1364
|
-
const requests = new Map(this.requests);
|
|
1365
|
-
const annotations = new Map(this.annotations.mapUnsafe);
|
|
1366
|
-
for (const group of groups) {
|
|
1367
|
-
for (const [tag, rpc] of group.requests) {
|
|
1368
|
-
requests.set(tag, rpc);
|
|
1369
|
-
}
|
|
1370
|
-
for (const [key, value] of group.annotations.mapUnsafe) {
|
|
1371
|
-
annotations.set(key, value);
|
|
1372
|
-
}
|
|
1373
|
-
}
|
|
1374
|
-
return makeProto2({
|
|
1375
|
-
requests,
|
|
1376
|
-
annotations: makeUnsafe(annotations)
|
|
1377
|
-
});
|
|
1378
|
-
},
|
|
1379
|
-
omit(...tags) {
|
|
1380
|
-
const requests = new Map(this.requests);
|
|
1381
|
-
for (const tag of tags) {
|
|
1382
|
-
requests.delete(tag);
|
|
1383
|
-
}
|
|
1384
|
-
return makeProto2({
|
|
1385
|
-
requests,
|
|
1386
|
-
annotations: this.annotations
|
|
1387
|
-
});
|
|
1388
|
-
},
|
|
1389
|
-
middleware(middleware) {
|
|
1390
|
-
const requests = new Map;
|
|
1391
|
-
for (const [tag, rpc] of this.requests) {
|
|
1392
|
-
requests.set(tag, rpc.middleware(middleware));
|
|
1393
|
-
}
|
|
1394
|
-
return makeProto2({
|
|
1395
|
-
requests,
|
|
1396
|
-
annotations: this.annotations
|
|
1397
|
-
});
|
|
1398
|
-
},
|
|
1399
|
-
toHandlers(build) {
|
|
1400
|
-
const self = this;
|
|
1401
|
-
return gen(function* () {
|
|
1402
|
-
const services = yield* context();
|
|
1403
|
-
const handlers = isEffect(build) ? yield* build : build;
|
|
1404
|
-
const contextMap = new Map;
|
|
1405
|
-
self.requests.forEach((rpc, tag) => {
|
|
1406
|
-
contextMap.set(rpc.key, {
|
|
1407
|
-
tag: rpc._tag,
|
|
1408
|
-
handler: handlers[tag],
|
|
1409
|
-
context: services
|
|
1410
|
-
});
|
|
1411
|
-
});
|
|
1412
|
-
return makeUnsafe(contextMap);
|
|
1413
|
-
});
|
|
1414
|
-
},
|
|
1415
|
-
prefix(prefix) {
|
|
1416
|
-
const requests = new Map;
|
|
1417
|
-
for (const rpc of this.requests.values()) {
|
|
1418
|
-
const newRpc = rpc.prefix(prefix);
|
|
1419
|
-
requests.set(newRpc._tag, newRpc);
|
|
1420
|
-
}
|
|
1421
|
-
return makeProto2({
|
|
1422
|
-
requests,
|
|
1423
|
-
annotations: this.annotations
|
|
1424
|
-
});
|
|
1425
|
-
},
|
|
1426
|
-
toLayer(build) {
|
|
1427
|
-
return effectContext(this.toHandlers(build));
|
|
1428
|
-
},
|
|
1429
|
-
of: identity,
|
|
1430
|
-
toLayerHandler(service, build) {
|
|
1431
|
-
const self = this;
|
|
1432
|
-
return effectContext(gen(function* () {
|
|
1433
|
-
const services = yield* context();
|
|
1434
|
-
const handler = isEffect(build) ? yield* build : build;
|
|
1435
|
-
const contextMap = new Map;
|
|
1436
|
-
const rpc = self.requests.get(service);
|
|
1437
|
-
contextMap.set(rpc.key, {
|
|
1438
|
-
handler,
|
|
1439
|
-
context: services
|
|
1440
|
-
});
|
|
1441
|
-
return makeUnsafe(contextMap);
|
|
1442
|
-
}));
|
|
1443
|
-
},
|
|
1444
|
-
accessHandler(service) {
|
|
1445
|
-
return contextWith((parentContext) => {
|
|
1446
|
-
const rpc = this.requests.get(service);
|
|
1447
|
-
const {
|
|
1448
|
-
handler,
|
|
1449
|
-
context
|
|
1450
|
-
} = getOrUndefinedUnsafe(parentContext, rpc.key);
|
|
1451
|
-
return succeed5((payload, options) => {
|
|
1452
|
-
options.rpc = rpc;
|
|
1453
|
-
const result = handler(payload, options);
|
|
1454
|
-
const effectOrStream = isWrapper(result) ? result.value : result;
|
|
1455
|
-
return isEffect(effectOrStream) ? provide3(effectOrStream, context) : provideContext2(effectOrStream, context);
|
|
1456
|
-
});
|
|
1457
|
-
});
|
|
1458
|
-
},
|
|
1459
|
-
annotate(service, value) {
|
|
1460
|
-
return makeProto2({
|
|
1461
|
-
requests: this.requests,
|
|
1462
|
-
annotations: add(this.annotations, service, value)
|
|
1463
|
-
});
|
|
1464
|
-
},
|
|
1465
|
-
annotateRpcs(service, value) {
|
|
1466
|
-
return this.annotateRpcsMerge(make8(service, value));
|
|
1467
|
-
},
|
|
1468
|
-
annotateMerge(context) {
|
|
1469
|
-
return makeProto2({
|
|
1470
|
-
requests: this.requests,
|
|
1471
|
-
annotations: merge(this.annotations, context)
|
|
1472
|
-
});
|
|
1473
|
-
},
|
|
1474
|
-
annotateRpcsMerge(context) {
|
|
1475
|
-
const requests = new Map;
|
|
1476
|
-
for (const [tag, rpc] of this.requests) {
|
|
1477
|
-
requests.set(tag, rpc.annotateMerge(merge(context, rpc.annotations)));
|
|
1478
|
-
}
|
|
1479
|
-
return makeProto2({
|
|
1480
|
-
requests,
|
|
1481
|
-
annotations: this.annotations
|
|
1482
|
-
});
|
|
1483
|
-
}
|
|
1484
|
-
};
|
|
1485
|
-
var makeProto2 = (options) => Object.assign(function() {}, RpcGroupProto, {
|
|
1486
|
-
requests: options.requests,
|
|
1487
|
-
annotations: options.annotations
|
|
1488
|
-
});
|
|
1489
|
-
var make6 = (...rpcs) => makeProto2({
|
|
1490
|
-
requests: new Map(rpcs.map((rpc) => [rpc._tag, rpc])),
|
|
1491
|
-
annotations: empty()
|
|
1492
|
-
});
|
|
1493
|
-
// node_modules/.bun/effect@4.0.4/node_modules/effect/dist/rpc/RpcMiddleware.js
|
|
1494
|
-
var TypeId4 = "~effect/rpc/RpcMiddleware";
|
|
1495
|
-
var Service = () => (id, options) => {
|
|
1496
|
-
const limit = getStackTraceLimit();
|
|
1497
|
-
let creationError;
|
|
1498
|
-
if (limit !== 0) {
|
|
1499
|
-
setStackTraceLimit(2);
|
|
1500
|
-
creationError = new globalThis.Error;
|
|
1501
|
-
setStackTraceLimit(limit);
|
|
1502
|
-
}
|
|
1503
|
-
function ServiceClass() {}
|
|
1504
|
-
const ServiceClass_ = ServiceClass;
|
|
1505
|
-
Object.setPrototypeOf(ServiceClass, Object.getPrototypeOf(Service2(id)));
|
|
1506
|
-
ServiceClass.key = id;
|
|
1507
|
-
Object.defineProperty(ServiceClass, "stack", {
|
|
1508
|
-
get() {
|
|
1509
|
-
return creationError?.stack;
|
|
1510
|
-
}
|
|
1511
|
-
});
|
|
1512
|
-
ServiceClass_[TypeId4] = TypeId4;
|
|
1513
|
-
ServiceClass_.error = options?.error ?? Never;
|
|
1514
|
-
ServiceClass_.requiredForClient = options?.requiredForClient ?? false;
|
|
1515
|
-
return ServiceClass;
|
|
1516
|
-
};
|
|
1517
|
-
export { make4, readerString, isCloseEvent, SocketReadError, SocketWriteError, SocketOpenError, SocketUpgradeError, SocketCloseError, SocketError, layerWebSocketConstructorGlobal, layerWebSocket, make5, make6, layerJson, make7, withHeaders, layerProtocolSocket, ConnectionHooks, Service };
|
|
1177
|
+
|
|
1178
|
+
export { make4, readerString, isCloseEvent, SocketReadError, SocketWriteError, SocketOpenError, SocketUpgradeError, SocketCloseError, SocketError, WebSocketConstructor, layerWebSocketConstructorGlobal, layerWebSocket, layerJson, make5, withHeaders, layerProtocolSocket, ConnectionHooks };
|