@requence/service 0.8.1 → 0.8.2-edge.1151
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/build/chunk-974rc2jy.js +200 -0
- package/build/chunk-974rc2jy.js.map +12 -0
- package/build/cli.js +1 -1
- package/build/index.js +207 -36
- package/build/index.js.map +8 -7
- package/build/types/helpers/src/protocol/NodeTree.d.ts +94 -4
- package/build/types/helpers/src/protocol/NodeTree.d.ts.map +1 -1
- package/build/types/helpers/src/protocol/clientProperties.d.ts +116 -0
- package/build/types/helpers/src/protocol/clientProperties.d.ts.map +1 -0
- package/build/types/helpers/src/protocol/command.d.ts +16 -0
- package/build/types/helpers/src/protocol/command.d.ts.map +1 -1
- package/build/types/helpers/src/protocol/index.d.ts +1 -0
- package/build/types/helpers/src/protocol/index.d.ts.map +1 -1
- package/build/types/helpers/src/protocol/nodeType.d.ts +22 -0
- package/build/types/helpers/src/protocol/nodeType.d.ts.map +1 -1
- package/build/types/helpers/src/protocol/templateNodeTypes.d.ts.map +1 -1
- package/build/types/helpers/src/protocol/treeNodes.d.ts +82 -0
- package/build/types/helpers/src/protocol/treeNodes.d.ts.map +1 -1
- package/build/types/helpers/src/protocol/update.d.ts +32 -2
- package/build/types/helpers/src/protocol/update.d.ts.map +1 -1
- package/build/types/helpers/src/utils/amqpPublishRetry.d.ts +40 -0
- package/build/types/helpers/src/utils/amqpPublishRetry.d.ts.map +1 -1
- package/build/types/service/src/boundary.d.ts +12 -0
- package/build/types/service/src/boundary.d.ts.map +1 -1
- package/build/types/service/src/createAmqpConnection.d.ts +9 -1
- package/build/types/service/src/createAmqpConnection.d.ts.map +1 -1
- package/build/types/service/src/errors.d.ts +14 -0
- package/build/types/service/src/errors.d.ts.map +1 -1
- package/build/types/service/src/index.d.ts +18 -2
- package/build/types/service/src/index.d.ts.map +1 -1
- package/package.json +2 -1
- package/build/chunk-8r349zge.js +0 -99
- package/build/chunk-8r349zge.js.map +0 -11
|
@@ -40,6 +40,17 @@ export declare const treeSchema: z.ZodObject<{
|
|
|
40
40
|
LINEAR: "LINEAR";
|
|
41
41
|
}>>;
|
|
42
42
|
privileged: z.ZodDefault<z.ZodBoolean>;
|
|
43
|
+
wireCodec: z.ZodOptional<z.ZodEnum<{
|
|
44
|
+
json: "json";
|
|
45
|
+
msgpack: "msgpack";
|
|
46
|
+
}>>;
|
|
47
|
+
wireCodecReason: z.ZodOptional<z.ZodEnum<{
|
|
48
|
+
"fleet-capable": "fleet-capable";
|
|
49
|
+
"missing-capability": "missing-capability";
|
|
50
|
+
"no-replicas": "no-replicas";
|
|
51
|
+
"presence-unavailable": "presence-unavailable";
|
|
52
|
+
"replicas-unaccounted": "replicas-unaccounted";
|
|
53
|
+
}>>;
|
|
43
54
|
configurationServices: z.ZodOptional<z.ZodArray<z.ZodObject</*elided*/ any, z.core.$strict>>>;
|
|
44
55
|
}, z.core.$strict>, z.ZodObject<{
|
|
45
56
|
outputs: z.ZodArray<z.ZodObject<{
|
|
@@ -146,6 +157,17 @@ declare const extendedTreeSchema: z.ZodObject<{
|
|
|
146
157
|
LINEAR: "LINEAR";
|
|
147
158
|
}>>;
|
|
148
159
|
privileged: z.ZodDefault<z.ZodBoolean>;
|
|
160
|
+
wireCodec: z.ZodOptional<z.ZodEnum<{
|
|
161
|
+
json: "json";
|
|
162
|
+
msgpack: "msgpack";
|
|
163
|
+
}>>;
|
|
164
|
+
wireCodecReason: z.ZodOptional<z.ZodEnum<{
|
|
165
|
+
"fleet-capable": "fleet-capable";
|
|
166
|
+
"missing-capability": "missing-capability";
|
|
167
|
+
"no-replicas": "no-replicas";
|
|
168
|
+
"presence-unavailable": "presence-unavailable";
|
|
169
|
+
"replicas-unaccounted": "replicas-unaccounted";
|
|
170
|
+
}>>;
|
|
149
171
|
configurationServices: z.ZodOptional<z.ZodArray<z.ZodObject</*elided*/ any, z.core.$strict>>>;
|
|
150
172
|
}, z.core.$strict>, z.ZodObject<{
|
|
151
173
|
outputs: z.ZodArray<z.ZodObject<{
|
|
@@ -253,6 +275,17 @@ export declare const validatedTreeSchema: z.ZodPipe<z.ZodObject<{
|
|
|
253
275
|
LINEAR: "LINEAR";
|
|
254
276
|
}>>;
|
|
255
277
|
privileged: z.ZodDefault<z.ZodBoolean>;
|
|
278
|
+
wireCodec: z.ZodOptional<z.ZodEnum<{
|
|
279
|
+
json: "json";
|
|
280
|
+
msgpack: "msgpack";
|
|
281
|
+
}>>;
|
|
282
|
+
wireCodecReason: z.ZodOptional<z.ZodEnum<{
|
|
283
|
+
"fleet-capable": "fleet-capable";
|
|
284
|
+
"missing-capability": "missing-capability";
|
|
285
|
+
"no-replicas": "no-replicas";
|
|
286
|
+
"presence-unavailable": "presence-unavailable";
|
|
287
|
+
"replicas-unaccounted": "replicas-unaccounted";
|
|
288
|
+
}>>;
|
|
256
289
|
configurationServices: z.ZodOptional<z.ZodArray<z.ZodObject</*elided*/ any, z.core.$strict>>>;
|
|
257
290
|
}, z.core.$strict>, z.ZodObject<{
|
|
258
291
|
outputs: z.ZodArray<z.ZodObject<{
|
|
@@ -355,6 +388,8 @@ export declare const validatedTreeSchema: z.ZodPipe<z.ZodObject<{
|
|
|
355
388
|
retryDelay?: number | undefined;
|
|
356
389
|
mode: "CONTINUOUS" | "LINEAR";
|
|
357
390
|
privileged: boolean;
|
|
391
|
+
wireCodec?: "json" | "msgpack" | undefined;
|
|
392
|
+
wireCodecReason?: "fleet-capable" | "missing-capability" | "no-replicas" | "presence-unavailable" | "replicas-unaccounted" | undefined;
|
|
358
393
|
configurationServices?: {
|
|
359
394
|
outputs: {
|
|
360
395
|
name: string | null;
|
|
@@ -387,6 +422,8 @@ export declare const validatedTreeSchema: z.ZodPipe<z.ZodObject<{
|
|
|
387
422
|
retryDelay?: number | undefined;
|
|
388
423
|
mode: "CONTINUOUS" | "LINEAR";
|
|
389
424
|
privileged: boolean;
|
|
425
|
+
wireCodec?: "json" | "msgpack" | undefined;
|
|
426
|
+
wireCodecReason?: "fleet-capable" | "missing-capability" | "no-replicas" | "presence-unavailable" | "replicas-unaccounted" | undefined;
|
|
390
427
|
configurationServices?: /*elided*/ any[] | undefined;
|
|
391
428
|
}[] | undefined;
|
|
392
429
|
} | {
|
|
@@ -485,6 +522,8 @@ export declare const validatedTreeSchema: z.ZodPipe<z.ZodObject<{
|
|
|
485
522
|
retryDelay?: number | undefined;
|
|
486
523
|
mode: "CONTINUOUS" | "LINEAR";
|
|
487
524
|
privileged: boolean;
|
|
525
|
+
wireCodec?: "json" | "msgpack" | undefined;
|
|
526
|
+
wireCodecReason?: "fleet-capable" | "missing-capability" | "no-replicas" | "presence-unavailable" | "replicas-unaccounted" | undefined;
|
|
488
527
|
configurationServices?: {
|
|
489
528
|
outputs: {
|
|
490
529
|
name: string | null;
|
|
@@ -517,6 +556,8 @@ export declare const validatedTreeSchema: z.ZodPipe<z.ZodObject<{
|
|
|
517
556
|
retryDelay?: number | undefined;
|
|
518
557
|
mode: "CONTINUOUS" | "LINEAR";
|
|
519
558
|
privileged: boolean;
|
|
559
|
+
wireCodec?: "json" | "msgpack" | undefined;
|
|
560
|
+
wireCodecReason?: "fleet-capable" | "missing-capability" | "no-replicas" | "presence-unavailable" | "replicas-unaccounted" | undefined;
|
|
520
561
|
configurationServices?: any[] | undefined;
|
|
521
562
|
}[] | undefined;
|
|
522
563
|
} | {
|
|
@@ -629,6 +670,17 @@ export declare const treeReferenceSchema: z.ZodObject<{
|
|
|
629
670
|
LINEAR: "LINEAR";
|
|
630
671
|
}>>;
|
|
631
672
|
privileged: z.ZodDefault<z.ZodBoolean>;
|
|
673
|
+
wireCodec: z.ZodOptional<z.ZodEnum<{
|
|
674
|
+
json: "json";
|
|
675
|
+
msgpack: "msgpack";
|
|
676
|
+
}>>;
|
|
677
|
+
wireCodecReason: z.ZodOptional<z.ZodEnum<{
|
|
678
|
+
"fleet-capable": "fleet-capable";
|
|
679
|
+
"missing-capability": "missing-capability";
|
|
680
|
+
"no-replicas": "no-replicas";
|
|
681
|
+
"presence-unavailable": "presence-unavailable";
|
|
682
|
+
"replicas-unaccounted": "replicas-unaccounted";
|
|
683
|
+
}>>;
|
|
632
684
|
configurationServices: z.ZodOptional<z.ZodArray<z.ZodObject</*elided*/ any, z.core.$strict>>>;
|
|
633
685
|
}, z.core.$strict>, z.ZodObject<{
|
|
634
686
|
outputs: z.ZodArray<z.ZodObject<{
|
|
@@ -737,6 +789,17 @@ export declare const treeListSchema: z.ZodObject<{
|
|
|
737
789
|
LINEAR: "LINEAR";
|
|
738
790
|
}>>;
|
|
739
791
|
privileged: z.ZodDefault<z.ZodBoolean>;
|
|
792
|
+
wireCodec: z.ZodOptional<z.ZodEnum<{
|
|
793
|
+
json: "json";
|
|
794
|
+
msgpack: "msgpack";
|
|
795
|
+
}>>;
|
|
796
|
+
wireCodecReason: z.ZodOptional<z.ZodEnum<{
|
|
797
|
+
"fleet-capable": "fleet-capable";
|
|
798
|
+
"missing-capability": "missing-capability";
|
|
799
|
+
"no-replicas": "no-replicas";
|
|
800
|
+
"presence-unavailable": "presence-unavailable";
|
|
801
|
+
"replicas-unaccounted": "replicas-unaccounted";
|
|
802
|
+
}>>;
|
|
740
803
|
configurationServices: z.ZodOptional<z.ZodArray<z.ZodObject</*elided*/ any, z.core.$strict>>>;
|
|
741
804
|
}, z.core.$strict>, z.ZodObject<{
|
|
742
805
|
outputs: z.ZodArray<z.ZodObject<{
|
|
@@ -839,6 +902,8 @@ export declare const treeListSchema: z.ZodObject<{
|
|
|
839
902
|
retryDelay?: number | undefined;
|
|
840
903
|
mode: "CONTINUOUS" | "LINEAR";
|
|
841
904
|
privileged: boolean;
|
|
905
|
+
wireCodec?: "json" | "msgpack" | undefined;
|
|
906
|
+
wireCodecReason?: "fleet-capable" | "missing-capability" | "no-replicas" | "presence-unavailable" | "replicas-unaccounted" | undefined;
|
|
842
907
|
configurationServices?: {
|
|
843
908
|
outputs: {
|
|
844
909
|
name: string | null;
|
|
@@ -871,6 +936,8 @@ export declare const treeListSchema: z.ZodObject<{
|
|
|
871
936
|
retryDelay?: number | undefined;
|
|
872
937
|
mode: "CONTINUOUS" | "LINEAR";
|
|
873
938
|
privileged: boolean;
|
|
939
|
+
wireCodec?: "json" | "msgpack" | undefined;
|
|
940
|
+
wireCodecReason?: "fleet-capable" | "missing-capability" | "no-replicas" | "presence-unavailable" | "replicas-unaccounted" | undefined;
|
|
874
941
|
configurationServices?: /*elided*/ any[] | undefined;
|
|
875
942
|
}[] | undefined;
|
|
876
943
|
} | {
|
|
@@ -969,6 +1036,8 @@ export declare const treeListSchema: z.ZodObject<{
|
|
|
969
1036
|
retryDelay?: number | undefined;
|
|
970
1037
|
mode: "CONTINUOUS" | "LINEAR";
|
|
971
1038
|
privileged: boolean;
|
|
1039
|
+
wireCodec?: "json" | "msgpack" | undefined;
|
|
1040
|
+
wireCodecReason?: "fleet-capable" | "missing-capability" | "no-replicas" | "presence-unavailable" | "replicas-unaccounted" | undefined;
|
|
972
1041
|
configurationServices?: {
|
|
973
1042
|
outputs: {
|
|
974
1043
|
name: string | null;
|
|
@@ -1001,6 +1070,8 @@ export declare const treeListSchema: z.ZodObject<{
|
|
|
1001
1070
|
retryDelay?: number | undefined;
|
|
1002
1071
|
mode: "CONTINUOUS" | "LINEAR";
|
|
1003
1072
|
privileged: boolean;
|
|
1073
|
+
wireCodec?: "json" | "msgpack" | undefined;
|
|
1074
|
+
wireCodecReason?: "fleet-capable" | "missing-capability" | "no-replicas" | "presence-unavailable" | "replicas-unaccounted" | undefined;
|
|
1004
1075
|
configurationServices?: any[] | undefined;
|
|
1005
1076
|
}[] | undefined;
|
|
1006
1077
|
} | {
|
|
@@ -1113,6 +1184,17 @@ export declare const treeListSchema: z.ZodObject<{
|
|
|
1113
1184
|
LINEAR: "LINEAR";
|
|
1114
1185
|
}>>;
|
|
1115
1186
|
privileged: z.ZodDefault<z.ZodBoolean>;
|
|
1187
|
+
wireCodec: z.ZodOptional<z.ZodEnum<{
|
|
1188
|
+
json: "json";
|
|
1189
|
+
msgpack: "msgpack";
|
|
1190
|
+
}>>;
|
|
1191
|
+
wireCodecReason: z.ZodOptional<z.ZodEnum<{
|
|
1192
|
+
"fleet-capable": "fleet-capable";
|
|
1193
|
+
"missing-capability": "missing-capability";
|
|
1194
|
+
"no-replicas": "no-replicas";
|
|
1195
|
+
"presence-unavailable": "presence-unavailable";
|
|
1196
|
+
"replicas-unaccounted": "replicas-unaccounted";
|
|
1197
|
+
}>>;
|
|
1116
1198
|
configurationServices: z.ZodOptional<z.ZodArray<z.ZodObject<any, z.core.$strict>>>;
|
|
1117
1199
|
}, z.core.$strict>, z.ZodObject<{
|
|
1118
1200
|
outputs: z.ZodArray<z.ZodObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"treeNodes.d.ts","sourceRoot":"","sources":["../../../../../../helpers/src/protocol/treeNodes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAmB1B,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"treeNodes.d.ts","sourceRoot":"","sources":["../../../../../../helpers/src/protocol/treeNodes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAmB1B,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAGrB,CAAA;AAEF,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,UAAU,CAAC,CAAA;AAE9C,QAAA,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAEtB,CAAA;AACF,MAAM,MAAM,aAAa,GAAG,CAAC,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqBvB,CAAA;AAEJ,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,cAAc,CAAC,CAAA;AACtD,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA"}
|
|
@@ -35,7 +35,22 @@ declare const nodeStartUpdateSchema: z.ZodObject<{
|
|
|
35
35
|
alias: z.ZodOptional<z.ZodString>;
|
|
36
36
|
}, z.core.$strip>;
|
|
37
37
|
type: z.ZodLiteral<"NODE_START">;
|
|
38
|
-
|
|
38
|
+
service: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
39
|
+
libVersion: z.ZodNullable<z.ZodString>;
|
|
40
|
+
name: z.ZodNullable<z.ZodString>;
|
|
41
|
+
capabilities: z.ZodArray<z.ZodString>;
|
|
42
|
+
}, z.core.$strip>>>;
|
|
43
|
+
wireCodec: z.ZodDefault<z.ZodNullable<z.ZodEnum<{
|
|
44
|
+
json: "json";
|
|
45
|
+
msgpack: "msgpack";
|
|
46
|
+
}>>>;
|
|
47
|
+
wireCodecReason: z.ZodDefault<z.ZodNullable<z.ZodEnum<{
|
|
48
|
+
"fleet-capable": "fleet-capable";
|
|
49
|
+
"missing-capability": "missing-capability";
|
|
50
|
+
"no-replicas": "no-replicas";
|
|
51
|
+
"presence-unavailable": "presence-unavailable";
|
|
52
|
+
"replicas-unaccounted": "replicas-unaccounted";
|
|
53
|
+
}>>>;
|
|
39
54
|
triggers: z.ZodArray<z.ZodString>;
|
|
40
55
|
}, z.core.$strip>;
|
|
41
56
|
export type NodeStartUpdate = z.infer<typeof nodeStartUpdateSchema>;
|
|
@@ -241,7 +256,22 @@ export declare const updateSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
241
256
|
alias: z.ZodOptional<z.ZodString>;
|
|
242
257
|
}, z.core.$strip>;
|
|
243
258
|
type: z.ZodLiteral<"NODE_START">;
|
|
244
|
-
|
|
259
|
+
service: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
260
|
+
libVersion: z.ZodNullable<z.ZodString>;
|
|
261
|
+
name: z.ZodNullable<z.ZodString>;
|
|
262
|
+
capabilities: z.ZodArray<z.ZodString>;
|
|
263
|
+
}, z.core.$strip>>>;
|
|
264
|
+
wireCodec: z.ZodDefault<z.ZodNullable<z.ZodEnum<{
|
|
265
|
+
json: "json";
|
|
266
|
+
msgpack: "msgpack";
|
|
267
|
+
}>>>;
|
|
268
|
+
wireCodecReason: z.ZodDefault<z.ZodNullable<z.ZodEnum<{
|
|
269
|
+
"fleet-capable": "fleet-capable";
|
|
270
|
+
"missing-capability": "missing-capability";
|
|
271
|
+
"no-replicas": "no-replicas";
|
|
272
|
+
"presence-unavailable": "presence-unavailable";
|
|
273
|
+
"replicas-unaccounted": "replicas-unaccounted";
|
|
274
|
+
}>>>;
|
|
245
275
|
triggers: z.ZodArray<z.ZodString>;
|
|
246
276
|
}, z.core.$strip>, z.ZodObject<{
|
|
247
277
|
timestamp: z.ZodPipe<z.ZodNumber, z.ZodTransform<Date, number>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../../../../helpers/src/protocol/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../../../../helpers/src/protocol/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAsB1B,QAAA,MAAM,oBAAoB;;;;;;;;;;;;;;;;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AAC,OAAO,qBAAqB,CAAC,CAAA;AAEnE,QAAA,MAAM,qBAAqB;;;;;;;iBAGzB,CAAA;AACF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEnE,QAAA,MAAM,mBAAmB;;;;;;;;iBAIvB,CAAA;AACF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAO/D,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAavB,CAAA;AAEF,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAA"}
|
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
export declare const DEFAULT_AMQP_PUBLISH_TIMEOUT_MS = 10000;
|
|
2
2
|
export declare const DEFAULT_AMQP_PUBLISH_RETRY_ATTEMPTS = 3;
|
|
3
|
+
/**
|
|
4
|
+
* How long the loop must have been unable to run a callback during a publish's
|
|
5
|
+
* in-flight window for its confirm deadline to be treated as spurious rather
|
|
6
|
+
* than as a lost message.
|
|
7
|
+
*
|
|
8
|
+
* Mirrors the operator's event-loop stall threshold: a full second in which no
|
|
9
|
+
* callback could run is a stall, not scheduling jitter. Comfortably above normal
|
|
10
|
+
* GC pauses (so a genuinely unresponsive broker on a healthy loop still times
|
|
11
|
+
* out and retries) and far below the incident's multi-second stalls.
|
|
12
|
+
*/
|
|
13
|
+
export declare const PUBLISH_STARVATION_THRESHOLD_MS = 1000;
|
|
14
|
+
export interface LoopStarvationProbe {
|
|
15
|
+
/**
|
|
16
|
+
* Stop sampling and return the longest stretch (ms) during which the loop
|
|
17
|
+
* could not run a callback since the probe started. Idempotent — subsequent
|
|
18
|
+
* calls return the same value without re-reading the clock.
|
|
19
|
+
*/
|
|
20
|
+
stop: () => number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Measure how long the event loop was starved while a single publish is in
|
|
24
|
+
* flight. It runs a self-rescheduling timer and, crucially, also reads the
|
|
25
|
+
* pending gap synchronously at `stop()`: a stall that blocked the loop right up
|
|
26
|
+
* to `stop()` is caught by `now() - expected` even though the timer never got a
|
|
27
|
+
* chance to fire. That makes the reading immune to the very stall it measures
|
|
28
|
+
* and independent of callback ordering after the loop resumes.
|
|
29
|
+
*
|
|
30
|
+
* The clock is monotonic (`performance.now`), never wall time — the operator's
|
|
31
|
+
* lag monitor uses the same, and a wall-clock step (NTP) must not read as
|
|
32
|
+
* starvation and suppress a legitimate retry. `now` is injectable for tests.
|
|
33
|
+
*/
|
|
34
|
+
export declare function createLoopStarvationProbe({ now, }?: {
|
|
35
|
+
now?: () => number;
|
|
36
|
+
}): LoopStarvationProbe;
|
|
37
|
+
/**
|
|
38
|
+
* Whether a confirm deadline that elapsed should be read as loop starvation
|
|
39
|
+
* rather than a lost publish. When it returns true the publish must NOT be
|
|
40
|
+
* re-sent: the message is in the broker's hands and only the confirm was late.
|
|
41
|
+
*/
|
|
42
|
+
export declare function isStarvedPublishTimeout(starvedMs: number): boolean;
|
|
3
43
|
export declare function isRetryablePublishError(error: unknown): boolean;
|
|
4
44
|
export declare function computeAmqpPublishRetryDelay(attempt: number): number;
|
|
5
45
|
//# sourceMappingURL=amqpPublishRetry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"amqpPublishRetry.d.ts","sourceRoot":"","sources":["../../../../../../helpers/src/utils/amqpPublishRetry.ts"],"names":[],"mappings":"AA8BA,eAAO,MAAM,+BAA+B,QAAS,CAAA;AACrD,eAAO,MAAM,mCAAmC,IAAI,CAAA;
|
|
1
|
+
{"version":3,"file":"amqpPublishRetry.d.ts","sourceRoot":"","sources":["../../../../../../helpers/src/utils/amqpPublishRetry.ts"],"names":[],"mappings":"AA8BA,eAAO,MAAM,+BAA+B,QAAS,CAAA;AACrD,eAAO,MAAM,mCAAmC,IAAI,CAAA;AAqBpD;;;;;;;;;GASG;AACH,eAAO,MAAM,+BAA+B,OAAQ,CAAA;AAEpD,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,IAAI,EAAE,MAAM,MAAM,CAAA;CACnB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,yBAAyB,CAAC,EACxC,GAA6B,GAC9B,GAAE;IAAE,GAAG,CAAC,EAAE,MAAM,MAAM,CAAA;CAAO,GAAG,mBAAmB,CAyBnD;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,WAExD;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,WAQrD;AAID,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,MAAM,UAM3D"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { CallbackEgressContext, CallbackIngressContext } from '@requence/callbacks';
|
|
2
|
+
import type { WireCodec } from '@requence/helpers/msgpack';
|
|
2
3
|
import { transformer } from './transformer.ts';
|
|
3
4
|
type InboundCtx = Parameters<typeof transformer.inbound>[1];
|
|
4
5
|
export interface OutboundBoundaryOptions {
|
|
@@ -8,6 +9,17 @@ export interface OutboundBoundaryOptions {
|
|
|
8
9
|
maxPayloadSize?: number;
|
|
9
10
|
/** Upload/stream cap in bytes, transmitted via task options. */
|
|
10
11
|
maxFileSize?: number;
|
|
12
|
+
/**
|
|
13
|
+
* The codec this boundary's publishes will use — the codec of the dispatch
|
|
14
|
+
* being replied to, since a reply echoes it.
|
|
15
|
+
*
|
|
16
|
+
* The claim-check offloads on the SERIALIZED size, so the threshold has to be
|
|
17
|
+
* measured with the codec the body actually goes out under. Both are live at
|
|
18
|
+
* once (the choice is baked per service node), so the boundary cannot assume
|
|
19
|
+
* either. Defaults to `json`: the pre-migration status quo, and the right
|
|
20
|
+
* answer for the deferred path, which has no dispatch to echo.
|
|
21
|
+
*/
|
|
22
|
+
wireCodec?: WireCodec;
|
|
11
23
|
signal?: AbortSignal;
|
|
12
24
|
fetch?: typeof globalThis.fetch;
|
|
13
25
|
/** Sink for best-effort degradation notices. Defaults to `console.warn`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boundary.d.ts","sourceRoot":"","sources":["../../../../src/boundary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"boundary.d.ts","sourceRoot":"","sources":["../../../../src/boundary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,qBAAqB,CAAA;AAE5B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAG1D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAc9C,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAA;AAE3D,MAAM,WAAW,uBAAuB;IACtC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,4EAA4E;IAC5E,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,gEAAgE;IAChE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;;;;;;OASG;IACH,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAA;IAC/B,4EAA4E;IAC5E,IAAI,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GA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C,OAAO,CAAC,CAiBpB"}
|
|
@@ -39,6 +39,7 @@ export declare const messageKeySchema: z.ZodPipe<z.ZodPipe<z.ZodPipe<z.ZodString
|
|
|
39
39
|
export declare const connectionOptionsSchema: z.ZodObject<{
|
|
40
40
|
url: z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<URL, string>>, z.ZodCustom<URL, URL>]>;
|
|
41
41
|
version: z.ZodString;
|
|
42
|
+
name: z.ZodOptional<z.ZodString>;
|
|
42
43
|
devOverlay: z.ZodOptional<z.ZodString>;
|
|
43
44
|
silent: z.ZodOptional<z.ZodBoolean>;
|
|
44
45
|
prefetch: z.ZodOptional<z.ZodNumber>;
|
|
@@ -50,12 +51,19 @@ export declare const connectionOptionsSchema: z.ZodObject<{
|
|
|
50
51
|
}, z.core.$strip>;
|
|
51
52
|
export type PrivilegedConnectionOptions = z.output<typeof connectionOptionsSchema>;
|
|
52
53
|
export type ConnectionOptions = Omit<PrivilegedConnectionOptions, 'passthroughByteReferences'>;
|
|
54
|
+
export interface ConnectionState {
|
|
55
|
+
connected: boolean;
|
|
56
|
+
err?: Error;
|
|
57
|
+
}
|
|
58
|
+
export type ConnectionStateListener = (state: ConnectionState) => void;
|
|
53
59
|
type MessageHandlerContext<V> = V extends keyof RequenceService.Version ? ServiceContextHelper<V> : ContextHelper;
|
|
54
60
|
type MessageHandlerReturnValue<V, O = null> = V extends keyof RequenceService.Version ? O extends OutputName<V> ? OutputValue<V, O> | InternalNamedOutput : void : JSONValue;
|
|
55
61
|
type MessageHandlerFunction<V> = (context: MessageHandlerContext<V>) => MaybePromise<MessageHandlerReturnValue<V> | void>;
|
|
56
62
|
type MessageHandlerGenerator<V> = (context: MessageHandlerContext<V>) => Generator<MessageHandlerReturnValue<V>, MessageHandlerReturnValue<V> | void, void>;
|
|
57
63
|
type MessageHandlerAsyncGenerator<V> = (context: MessageHandlerContext<V>) => AsyncGenerator<MessageHandlerReturnValue<V>, MessageHandlerReturnValue<V> | void, void>;
|
|
58
64
|
export type MessageHandler<V> = V extends keyof RequenceService.Version ? RequenceService.Version[V]['mode'] extends 'LINEAR' ? MessageHandlerFunction<V> : MessageHandlerAsyncGenerator<V> | MessageHandlerGenerator<V> | MessageHandlerFunction<V> : MessageHandlerAsyncGenerator<V> | MessageHandlerGenerator<V> | MessageHandlerFunction<V>;
|
|
59
|
-
export default function createConnection<V>({ url, version, prefetch, silent, connectionTimeout, heartbeatInterval, connectionOptions, devOverlay, maxMessageSize, ...rest }: ConnectionOptions
|
|
65
|
+
export default function createConnection<V>({ url, version, prefetch, silent, connectionTimeout, heartbeatInterval, connectionOptions, name, devOverlay, maxMessageSize, onConnectionStateChange, ...rest }: ConnectionOptions & {
|
|
66
|
+
onConnectionStateChange?: ConnectionStateListener;
|
|
67
|
+
}, messageHandler: MessageHandler<V>): ConnectionApi<V>;
|
|
60
68
|
export {};
|
|
61
69
|
//# sourceMappingURL=createAmqpConnection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAmqpConnection.d.ts","sourceRoot":"","sources":["../../../../src/createAmqpConnection.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,YAAY,EAGlB,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"createAmqpConnection.d.ts","sourceRoot":"","sources":["../../../../src/createAmqpConnection.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,YAAY,EAGlB,MAAM,mBAAmB,CAAA;AAgB1B,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAY1B,OAA4B,EAE1B,KAAK,aAAa,EAClB,KAAK,SAAS,EAKf,MAAM,cAAc,CAAA;AAIrB,KAAK,mBAAmB,GAAG,2BAA2B,CAAA;AAEtD,KAAK,KAAK,CAAC,CAAC,SAAS,MAAM,eAAe,CAAC,OAAO,IAChD,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;AACrC,KAAK,aAAa,CAAC,CA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BAAyB,CAAC,CAAC,CAAC,EAC5B,yBAAyB,CAAC,CAAC,CAAC,GAAG,IAAI,EACnC,IAAI,CACL,CAAA;AAED,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,eAAe,CAAC,OAAO,GACnE,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,QAAQ,GACjD,sBAAsB,CAAC,CAAC,CAAC,GAErB,4BAA4B,CAAC,CAAC,CAAC,GAC/B,uBAAuB,CAAC,CAAC,CAAC,GAC1B,sBAAsB,CAAC,CAAC,CAAC,GAE3B,4BAA4B,CAAC,CAAC,CAAC,GAC/B,uBAAuB,CAAC,CAAC,CAAC,GAC1B,sBAAsB,CAAC,CAAC,CAAC,CAAA;AA4DjC,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,CAAC,EACxC,EACE,GAAG,EACH,OAAO,EACP,QAAY,EACZ,MAAc,EACd,iBAAiB,EAKjB,iBAAkD,EAClD,iBAAiB,EACjB,IAAI,EACJ,UAAe,EACf,cAAc,EACd,uBAAuB,EACvB,GAAG,IAAI,EACR,EAAE,iBAAiB,GAAG;IAAE,uBAAuB,CAAC,EAAE,uBAAuB,CAAA;CAAE,EAC5E,cAAc,EAAE,cAAc,CAAC,CAAC,CAAC,oBAukClC"}
|
|
@@ -26,6 +26,20 @@ export declare function assertReachable(response: Response): void;
|
|
|
26
26
|
* response is guaranteed not to be a gateway-error response.
|
|
27
27
|
*/
|
|
28
28
|
export declare function reachableFetch(input: Parameters<typeof fetch>[0], init?: Parameters<typeof fetch>[1]): Promise<Response>;
|
|
29
|
+
/**
|
|
30
|
+
* The dispatch declared a capability (`requires` header) this build cannot
|
|
31
|
+
* satisfy, so it was refused before its body was ever decoded.
|
|
32
|
+
*
|
|
33
|
+
* A NAMED error on purpose: the point of the `requires` header is that a
|
|
34
|
+
* mismatch reports the missing capability, instead of whatever incidental
|
|
35
|
+
* exception the undecodable payload would otherwise have produced — a bare
|
|
36
|
+
* `SyntaxError` from `JSON.parse` says nothing about why this box was the wrong
|
|
37
|
+
* one. The message travels to the operator, which surfaces it on the node.
|
|
38
|
+
*/
|
|
39
|
+
export declare class UnsupportedCapabilityError extends Error {
|
|
40
|
+
readonly capabilities: string[];
|
|
41
|
+
constructor(unsupported: ReadonlyArray<string>);
|
|
42
|
+
}
|
|
29
43
|
export declare class PayloadTooLargeError extends Error {
|
|
30
44
|
readonly size: number;
|
|
31
45
|
readonly maxSize: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/errors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/errors.ts"],"names":[],"mappings":"AAEA,qBAAa,uBAAwB,SAAQ,KAAK;CAAG;AAOrD;;;;;GAKG;AACH,qBAAa,wBAAyB,SAAQ,KAAK;aAE/B,MAAM,CAAC,EAAE,MAAM;IADjC,YACkB,MAAM,CAAC,EAAE,MAAM,YAAA,EAC/B,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,EAO9B;CACF;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAE3D;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAIxD;AAED;;;;;GAKG;AACH,wBAAsB,cAAc,CAClC,KAAK,EAAE,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,EAClC,IAAI,CAAC,EAAE,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,GACjC,OAAO,CAAC,QAAQ,CAAC,CASnB;AAED;;;;;;;;;GASG;AACH,qBAAa,0BAA2B,SAAQ,KAAK;IACnD,QAAQ,CAAC,YAAY,EAAE,MAAM,EAAE,CAAA;IAE/B,YAAY,WAAW,EAAE,aAAa,CAAC,MAAM,CAAC,EAI7C;CACF;AAED,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IAExB,YAAY,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EASxC;CACF"}
|
|
@@ -1,16 +1,26 @@
|
|
|
1
1
|
import type { AmqpConnectionManagerOptions } from 'amqp-connection-manager';
|
|
2
|
-
import { type ConnectionApi, type MessageHandler } from './createAmqpConnection.ts';
|
|
2
|
+
import { type ConnectionApi, type ConnectionStateListener, type MessageHandler } from './createAmqpConnection.ts';
|
|
3
3
|
export { RequenceFile, RequenceStream } from '@requence/files';
|
|
4
4
|
export { createCallback, type RequenceCallback, type WrappedRequenceCallback, } from '../../helpers/src/index.js';
|
|
5
5
|
export * from './errors.ts';
|
|
6
6
|
export * from './utils.ts';
|
|
7
|
-
export { MessageHandler } from './createAmqpConnection.ts';
|
|
7
|
+
export { type ConnectionState, type ConnectionStateListener, MessageHandler, } from './createAmqpConnection.ts';
|
|
8
8
|
export type { PrivilegedContext, PrivilegedSends } from './helpers.ts';
|
|
9
9
|
export type ServiceApi<V extends keyof RequenceService.Version | (string & {})> = ConnectionApi<V>;
|
|
10
10
|
interface ServiceOptions<V extends string> {
|
|
11
11
|
accessToken?: string;
|
|
12
12
|
devToken?: string;
|
|
13
13
|
version: V;
|
|
14
|
+
/**
|
|
15
|
+
* Optional, author-chosen label announced in the AMQP client properties and
|
|
16
|
+
* shown in the Requence UI next to the online count — "which of my three
|
|
17
|
+
* deployments is this?".
|
|
18
|
+
*
|
|
19
|
+
* A DEBUGGING LABEL, not an identifier: it is not unique, nothing keys off
|
|
20
|
+
* it, and no behaviour depends on it. Capped at 64 characters (longer labels
|
|
21
|
+
* are truncated, never rejected).
|
|
22
|
+
*/
|
|
23
|
+
name?: string;
|
|
14
24
|
prefetch?: number;
|
|
15
25
|
connectionTimeout?: number;
|
|
16
26
|
/** heartbeat interval in seconds — defaults to 30 */
|
|
@@ -20,6 +30,12 @@ interface ServiceOptions<V extends string> {
|
|
|
20
30
|
/** Max serialized body size in bytes before a PayloadTooLargeError is thrown. */
|
|
21
31
|
maxMessageSize?: number;
|
|
22
32
|
passthroughByteReferences?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Notified whenever the underlying AMQP connection is lost or (re)established.
|
|
35
|
+
* amqp-connection-manager auto-reconnects, so this is the only observable
|
|
36
|
+
* signal of a mid-life outage — use it to drive liveness/health reporting.
|
|
37
|
+
*/
|
|
38
|
+
onConnectionStateChange?: ConnectionStateListener;
|
|
23
39
|
}
|
|
24
40
|
export declare function createService<V extends keyof RequenceService.Version | (string & {})>(version: V, messageHandler: MessageHandler<V>): ServiceApi<V>;
|
|
25
41
|
export declare function createService<V extends keyof RequenceService.Version | (string & {})>(options: ServiceOptions<V>, messageHandler: MessageHandler<V>): ServiceApi<V>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAA;AAE3E,OAA6B,EAC3B,KAAK,aAAa,EAClB,KAAK,cAAc,EAEpB,MAAM,2BAA2B,CAAA;AAElC,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAC9D,OAAO,EACL,cAAc,EACd,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,GAC7B,MAAM,mBAAmB,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAE1B,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAA;AAE3E,OAA6B,EAC3B,KAAK,aAAa,EAClB,KAAK,uBAAuB,EAC5B,KAA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AAC,EAAE,cAAc,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAA;AAC/D,wBAAgB,aAAa,CAC3B,CAAC,SAAS,MAAM,eAAe,CAAC,OAAO,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,EACvD,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@requence/service",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.8.
|
|
4
|
+
"version": "0.8.2-edge.1151",
|
|
5
5
|
"bin": {
|
|
6
6
|
"requence-service": "build/cli.js"
|
|
7
7
|
},
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"chalk": "^5.6.2",
|
|
21
21
|
"eventsource-client": "^1.2.0",
|
|
22
22
|
"mime-types": "^3.0.1",
|
|
23
|
+
"msgpackr": "^1.11.5",
|
|
23
24
|
"yargs": "^17.7.2",
|
|
24
25
|
"zod": "^4.3.6"
|
|
25
26
|
},
|
package/build/chunk-8r349zge.js
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
// ../helpers/src/utils/obfuscate.ts
|
|
2
|
-
var separator = "";
|
|
3
|
-
var base65Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$";
|
|
4
|
-
var base65CharToIndex = {};
|
|
5
|
-
for (let i = 0;i < base65Chars.length; i++) {
|
|
6
|
-
base65CharToIndex[base65Chars[i]] = i;
|
|
7
|
-
}
|
|
8
|
-
function obfuscate(...parts) {
|
|
9
|
-
const str = parts.join(separator);
|
|
10
|
-
let binaryString = "";
|
|
11
|
-
for (let i = 0;i < str.length; i++) {
|
|
12
|
-
const charCode = str.charCodeAt(i);
|
|
13
|
-
binaryString += charCode.toString(2).padStart(16, "0");
|
|
14
|
-
}
|
|
15
|
-
let encodedString = "";
|
|
16
|
-
const chunkSize = 6;
|
|
17
|
-
let paddingCount = 0;
|
|
18
|
-
for (let i = 0;i < binaryString.length; i += chunkSize) {
|
|
19
|
-
let chunk = binaryString.substring(i, i + chunkSize);
|
|
20
|
-
if (chunk.length < chunkSize) {
|
|
21
|
-
paddingCount = chunkSize - chunk.length;
|
|
22
|
-
chunk = chunk.padEnd(chunkSize, "0");
|
|
23
|
-
}
|
|
24
|
-
const decimalValue = parseInt(chunk, 2);
|
|
25
|
-
encodedString += base65Chars[decimalValue];
|
|
26
|
-
}
|
|
27
|
-
return encodedString + paddingCount.toString();
|
|
28
|
-
}
|
|
29
|
-
function deobfuscate(str) {
|
|
30
|
-
const paddingCount = parseInt(str.slice(-1), 10);
|
|
31
|
-
str = str.slice(0, -1);
|
|
32
|
-
let binaryString = "";
|
|
33
|
-
for (let i = 0;i < str.length; i++) {
|
|
34
|
-
const decimalValue = base65CharToIndex[str[i]];
|
|
35
|
-
const binaryChunk = decimalValue.toString(2).padStart(6, "0");
|
|
36
|
-
binaryString += binaryChunk;
|
|
37
|
-
}
|
|
38
|
-
if (paddingCount > 0) {
|
|
39
|
-
binaryString = binaryString.slice(0, -paddingCount);
|
|
40
|
-
}
|
|
41
|
-
let decodedString = "";
|
|
42
|
-
const charSize = 16;
|
|
43
|
-
for (let i = 0;i < binaryString.length; i += charSize) {
|
|
44
|
-
const byte = binaryString.substring(i, i + charSize);
|
|
45
|
-
if (byte.length === 16) {
|
|
46
|
-
const charCode = parseInt(byte, 2);
|
|
47
|
-
decodedString += String.fromCharCode(charCode);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
return decodedString.split(separator);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// src/errors.ts
|
|
54
|
-
class RequenceConnectionError extends Error {
|
|
55
|
-
}
|
|
56
|
-
var UNREACHABLE_STATUS = new Set([502, 503, 504]);
|
|
57
|
-
|
|
58
|
-
class RequenceUnreachableError extends Error {
|
|
59
|
-
status;
|
|
60
|
-
constructor(status, options) {
|
|
61
|
-
super("The requence system is currently not reachable. Please retry later.", options);
|
|
62
|
-
this.status = status;
|
|
63
|
-
this.name = "RequenceUnreachableError";
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
function isUnreachableStatus(status) {
|
|
67
|
-
return UNREACHABLE_STATUS.has(status);
|
|
68
|
-
}
|
|
69
|
-
function assertReachable(response) {
|
|
70
|
-
if (isUnreachableStatus(response.status)) {
|
|
71
|
-
throw new RequenceUnreachableError(response.status);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
async function reachableFetch(input, init) {
|
|
75
|
-
let response;
|
|
76
|
-
try {
|
|
77
|
-
response = await fetch(input, init);
|
|
78
|
-
} catch (error) {
|
|
79
|
-
throw new RequenceUnreachableError(undefined, { cause: error });
|
|
80
|
-
}
|
|
81
|
-
assertReachable(response);
|
|
82
|
-
return response;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
class PayloadTooLargeError extends Error {
|
|
86
|
-
size;
|
|
87
|
-
maxSize;
|
|
88
|
-
constructor(size, maxSize) {
|
|
89
|
-
super(`Message payload is ${size} bytes, which exceeds the maximum message ` + `size of ${maxSize} bytes. Reduce the returned value, or offload large ` + `data (files/streams) so it travels by reference instead of inline.`);
|
|
90
|
-
this.name = "PayloadTooLargeError";
|
|
91
|
-
this.size = size;
|
|
92
|
-
this.maxSize = maxSize;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
export { obfuscate, deobfuscate, RequenceConnectionError, RequenceUnreachableError, isUnreachableStatus, assertReachable, reachableFetch, PayloadTooLargeError };
|
|
97
|
-
|
|
98
|
-
//# debugId=24EBA4C8C93E588B64756E2164756E21
|
|
99
|
-
//# sourceMappingURL=chunk-8r349zge.js.map
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../helpers/src/utils/obfuscate.ts", "../src/errors.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"const separator = '\\u{f6ee}'\n\nconst base65Chars =\n 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$'\n\nconst base65CharToIndex: Record<string, number> = {}\nfor (let i = 0; i < base65Chars.length; i++) {\n base65CharToIndex[base65Chars[i]] = i\n}\n\nexport function obfuscate(...parts: Array<string>) {\n const str = parts.join(separator)\n let binaryString = ''\n\n for (let i = 0; i < str.length; i++) {\n const charCode = str.charCodeAt(i)\n binaryString += charCode.toString(2).padStart(16, '0')\n }\n\n let encodedString = ''\n const chunkSize = 6\n let paddingCount = 0\n\n for (let i = 0; i < binaryString.length; i += chunkSize) {\n let chunk = binaryString.substring(i, i + chunkSize)\n\n if (chunk.length < chunkSize) {\n paddingCount = chunkSize - chunk.length\n chunk = chunk.padEnd(chunkSize, '0')\n }\n\n const decimalValue = parseInt(chunk, 2)\n encodedString += base65Chars[decimalValue]\n }\n\n return encodedString + paddingCount.toString()\n}\n\nexport function randomString(length: number) {\n const randomValues = new Uint8Array(length)\n crypto.getRandomValues(randomValues)\n\n let randomString = ''\n for (let i = 0; i < length; i++) {\n randomString += base65Chars[randomValues[i] % base65Chars.length]\n }\n\n return randomString\n}\n\nexport function deobfuscate(str: string) {\n const paddingCount = parseInt(str.slice(-1), 10)\n str = str.slice(0, -1)\n\n let binaryString = ''\n\n for (let i = 0; i < str.length; i++) {\n const decimalValue = base65CharToIndex[str[i]]\n const binaryChunk = decimalValue.toString(2).padStart(6, '0')\n binaryString += binaryChunk\n }\n\n if (paddingCount > 0) {\n binaryString = binaryString.slice(0, -paddingCount)\n }\n\n let decodedString = ''\n const charSize = 16\n\n for (let i = 0; i < binaryString.length; i += charSize) {\n const byte = binaryString.substring(i, i + charSize)\n if (byte.length === 16) {\n const charCode = parseInt(byte, 2)\n decodedString += String.fromCharCode(charCode)\n }\n }\n\n return decodedString.split(separator)\n}\n",
|
|
6
|
-
"export class RequenceConnectionError extends Error {}\n\n// Gateway statuses an ingress/load balancer emits when no healthy backend is\n// available (maintenance window, deploy, cutover). The backend endpoints never\n// return these themselves, so treating them as \"unreachable\" is unambiguous.\nconst UNREACHABLE_STATUS = new Set([502, 503, 504])\n\n/**\n * Signals that the requence system could not be reached — e.g. during a\n * maintenance window or deploy, when the backend is unreachable (connection\n * refused / timeout / DNS failure) or an ingress returns a gateway error\n * (502/503/504). Callers should treat this as transient and retry later.\n */\nexport class RequenceUnreachableError extends Error {\n constructor(\n public readonly status?: number,\n options?: { cause?: unknown },\n ) {\n super(\n 'The requence system is currently not reachable. Please retry later.',\n options,\n )\n this.name = 'RequenceUnreachableError'\n }\n}\n\nexport function isUnreachableStatus(status: number): boolean {\n return UNREACHABLE_STATUS.has(status)\n}\n\n/**\n * Throws a {@link RequenceUnreachableError} when the response carries a gateway\n * status indicating the system is unreachable. Call right after a fetch, before\n * inspecting `response.ok`.\n */\nexport function assertReachable(response: Response): void {\n if (isUnreachableStatus(response.status)) {\n throw new RequenceUnreachableError(response.status)\n }\n}\n\n/**\n * Wraps `fetch` so a transport-level failure (connection refused, DNS failure,\n * timeout) surfaces as a {@link RequenceUnreachableError} instead of a raw\n * TypeError, and gateway statuses (502/503/504) do the same. The returned\n * response is guaranteed not to be a gateway-error response.\n */\nexport async function reachableFetch(\n input: Parameters<typeof fetch>[0],\n init?: Parameters<typeof fetch>[1],\n): Promise<Response> {\n let response: Response\n try {\n response = await fetch(input, init)\n } catch (error) {\n throw new RequenceUnreachableError(undefined, { cause: error })\n }\n assertReachable(response)\n return response\n}\n\nexport class PayloadTooLargeError extends Error {\n readonly size: number\n readonly maxSize: number\n\n constructor(size: number, maxSize: number) {\n super(\n `Message payload is ${size} bytes, which exceeds the maximum message ` +\n `size of ${maxSize} bytes. Reduce the returned value, or offload large ` +\n `data (files/streams) so it travels by reference instead of inline.`,\n )\n this.name = 'PayloadTooLargeError'\n this.size = size\n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