@requence/service 0.8.2-edge.1168 → 0.8.2-edge.1169
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/index.js +80 -59
- package/build/index.js.map +5 -4
- package/build/types/helpers/src/index.d.ts +1 -0
- package/build/types/helpers/src/index.d.ts.map +1 -1
- package/build/types/helpers/src/protocol/update.d.ts +46 -0
- package/build/types/helpers/src/protocol/update.d.ts.map +1 -1
- package/build/types/helpers/src/utils/nodeResume.d.ts +37 -0
- package/build/types/helpers/src/utils/nodeResume.d.ts.map +1 -0
- package/build/types/service/src/createAmqpConnection.d.ts.map +1 -1
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -324,6 +324,13 @@ var uiRebuildSchema = z8.object({
|
|
|
324
324
|
source: z8.string()
|
|
325
325
|
});
|
|
326
326
|
|
|
327
|
+
// ../helpers/src/utils/nodeResume.ts
|
|
328
|
+
import { z as z9 } from "zod/v4";
|
|
329
|
+
var NODE_RESUME_HEADER = "nodeResume";
|
|
330
|
+
var nodeResumeReportSchema = z9.object({
|
|
331
|
+
messageId: z9.uuid()
|
|
332
|
+
});
|
|
333
|
+
|
|
327
334
|
// ../helpers/src/utils/obj.ts
|
|
328
335
|
var import_dlv = __toESM(require_dlv(), 1);
|
|
329
336
|
var getByPath = import_dlv.default;
|
|
@@ -400,7 +407,7 @@ function wireBodyByteLength(value, codec) {
|
|
|
400
407
|
|
|
401
408
|
// src/createAmqpConnection.ts
|
|
402
409
|
import { connect } from "amqp-connection-manager";
|
|
403
|
-
import { z as
|
|
410
|
+
import { z as z11 } from "zod/v4";
|
|
404
411
|
|
|
405
412
|
// ../files/src/errors.ts
|
|
406
413
|
class RequenceStreamTruncatedError extends Error {
|
|
@@ -1566,7 +1573,7 @@ async function createContextHelper(options) {
|
|
|
1566
1573
|
var handlerStorage = new AsyncLocalStorage2;
|
|
1567
1574
|
|
|
1568
1575
|
// ../store/src/address.ts
|
|
1569
|
-
import { z as
|
|
1576
|
+
import { z as z10 } from "zod/v4";
|
|
1570
1577
|
// ../store/src/capability.ts
|
|
1571
1578
|
function encode(value) {
|
|
1572
1579
|
return Buffer.from(JSON.stringify(value), "utf8").toString("base64url");
|
|
@@ -1844,7 +1851,7 @@ function reload(registration) {
|
|
|
1844
1851
|
function errorText(error) {
|
|
1845
1852
|
return error instanceof Error ? error.message : String(error);
|
|
1846
1853
|
}
|
|
1847
|
-
var messageKeySchema =
|
|
1854
|
+
var messageKeySchema = z11.string().transform((str) => deobfuscate(str)).pipe(z11.tuple([z11.uuid(), z11.uuid()]).rest(z11.string())).transform((arr) => ({
|
|
1848
1855
|
taskId: arr[0],
|
|
1849
1856
|
messageId: arr[1],
|
|
1850
1857
|
uploadUrl: arr[2] || undefined,
|
|
@@ -1853,12 +1860,12 @@ var messageKeySchema = z10.string().transform((str) => deobfuscate(str)).pipe(z1
|
|
|
1853
1860
|
maxFileSize: arr[5] && Number.isFinite(Number(arr[5])) ? Number(arr[5]) : undefined,
|
|
1854
1861
|
nodeId: arr[6] || undefined
|
|
1855
1862
|
}));
|
|
1856
|
-
var headerSchema =
|
|
1857
|
-
properties:
|
|
1858
|
-
correlationId:
|
|
1859
|
-
headers:
|
|
1860
|
-
taskId:
|
|
1861
|
-
mode:
|
|
1863
|
+
var headerSchema = z11.object({
|
|
1864
|
+
properties: z11.object({
|
|
1865
|
+
correlationId: z11.uuid(),
|
|
1866
|
+
headers: z11.object({
|
|
1867
|
+
taskId: z11.uuid(),
|
|
1868
|
+
mode: z11.enum(["LINEAR", "CONTINUOUS"]).default("LINEAR")
|
|
1862
1869
|
})
|
|
1863
1870
|
})
|
|
1864
1871
|
}).transform((msg) => ({
|
|
@@ -1866,48 +1873,48 @@ var headerSchema = z10.object({
|
|
|
1866
1873
|
taskId: msg.properties.headers.taskId,
|
|
1867
1874
|
mode: msg.properties.headers.mode
|
|
1868
1875
|
}));
|
|
1869
|
-
var payloadSchema =
|
|
1870
|
-
content:
|
|
1871
|
-
properties:
|
|
1872
|
-
}).transform((msg) => decodeWireBody(msg.content, msg.properties.contentType)).pipe(
|
|
1873
|
-
input:
|
|
1874
|
-
configuration:
|
|
1875
|
-
nodeId:
|
|
1876
|
-
configurationEval:
|
|
1877
|
-
options:
|
|
1878
|
-
uploadUrl:
|
|
1879
|
-
streamUrl:
|
|
1880
|
-
maxPayloadSize:
|
|
1881
|
-
maxFileSize:
|
|
1882
|
-
storeUrl:
|
|
1883
|
-
storeSignature:
|
|
1876
|
+
var payloadSchema = z11.object({
|
|
1877
|
+
content: z11.instanceof(Buffer),
|
|
1878
|
+
properties: z11.object({ contentType: z11.string().optional() })
|
|
1879
|
+
}).transform((msg) => decodeWireBody(msg.content, msg.properties.contentType)).pipe(z11.object({
|
|
1880
|
+
input: z11.unknown().optional(),
|
|
1881
|
+
configuration: z11.unknown().optional(),
|
|
1882
|
+
nodeId: z11.string().optional(),
|
|
1883
|
+
configurationEval: z11.boolean().optional(),
|
|
1884
|
+
options: z11.object({
|
|
1885
|
+
uploadUrl: z11.url().optional(),
|
|
1886
|
+
streamUrl: z11.url().optional(),
|
|
1887
|
+
maxPayloadSize: z11.number().optional(),
|
|
1888
|
+
maxFileSize: z11.number().optional(),
|
|
1889
|
+
storeUrl: z11.string().optional(),
|
|
1890
|
+
storeSignature: z11.string().optional()
|
|
1884
1891
|
})
|
|
1885
1892
|
}));
|
|
1886
|
-
var backchannelMessageSchema =
|
|
1887
|
-
content:
|
|
1888
|
-
properties:
|
|
1889
|
-
correlationId:
|
|
1890
|
-
contentType:
|
|
1891
|
-
headers:
|
|
1893
|
+
var backchannelMessageSchema = z11.object({
|
|
1894
|
+
content: z11.instanceof(Buffer),
|
|
1895
|
+
properties: z11.object({
|
|
1896
|
+
correlationId: z11.string(),
|
|
1897
|
+
contentType: z11.string().optional(),
|
|
1898
|
+
headers: z11.object({ taskId: z11.uuid().optional() }).optional().catch(undefined)
|
|
1892
1899
|
})
|
|
1893
1900
|
}).transform((message) => ({
|
|
1894
1901
|
...message,
|
|
1895
1902
|
content: decodeWireBody(message.content, message.properties.contentType)
|
|
1896
|
-
})).pipe(
|
|
1897
|
-
content:
|
|
1898
|
-
|
|
1899
|
-
type:
|
|
1903
|
+
})).pipe(z11.object({
|
|
1904
|
+
content: z11.discriminatedUnion("type", [
|
|
1905
|
+
z11.object({
|
|
1906
|
+
type: z11.literal("stop")
|
|
1900
1907
|
}),
|
|
1901
|
-
|
|
1902
|
-
type:
|
|
1903
|
-
callbackId:
|
|
1904
|
-
arg:
|
|
1905
|
-
surface:
|
|
1908
|
+
z11.object({
|
|
1909
|
+
type: z11.literal("callback"),
|
|
1910
|
+
callbackId: z11.uuid(),
|
|
1911
|
+
arg: z11.any().optional(),
|
|
1912
|
+
surface: z11.uuid().optional()
|
|
1906
1913
|
})
|
|
1907
1914
|
]),
|
|
1908
|
-
properties:
|
|
1909
|
-
correlationId:
|
|
1910
|
-
headers:
|
|
1915
|
+
properties: z11.object({
|
|
1916
|
+
correlationId: z11.string(),
|
|
1917
|
+
headers: z11.object({ taskId: z11.uuid().optional() }).optional().catch(undefined)
|
|
1911
1918
|
})
|
|
1912
1919
|
})).transform((message) => ({
|
|
1913
1920
|
payload: message.content,
|
|
@@ -1915,21 +1922,21 @@ var backchannelMessageSchema = z10.object({
|
|
|
1915
1922
|
taskId: message.properties.headers?.taskId
|
|
1916
1923
|
}));
|
|
1917
1924
|
var abortSymbol = Symbol();
|
|
1918
|
-
var connectionOptionsSchema =
|
|
1919
|
-
url:
|
|
1920
|
-
|
|
1921
|
-
|
|
1925
|
+
var connectionOptionsSchema = z11.object({
|
|
1926
|
+
url: z11.union([
|
|
1927
|
+
z11.string().regex(/^amqps?:\/\/(.+):(.+)@(.+)$/).transform((str) => new URL(str)),
|
|
1928
|
+
z11.instanceof(URL).refine((url) => url.protocol.match(/^amqps?:/), "Wrong protocol")
|
|
1922
1929
|
]),
|
|
1923
|
-
version:
|
|
1924
|
-
name:
|
|
1925
|
-
devOverlay:
|
|
1926
|
-
silent:
|
|
1927
|
-
prefetch:
|
|
1928
|
-
connectionTimeout:
|
|
1929
|
-
heartbeatInterval:
|
|
1930
|
-
connectionOptions:
|
|
1931
|
-
maxMessageSize:
|
|
1932
|
-
passthroughByteReferences:
|
|
1930
|
+
version: z11.string(),
|
|
1931
|
+
name: z11.string().optional(),
|
|
1932
|
+
devOverlay: z11.string().optional(),
|
|
1933
|
+
silent: z11.boolean().optional(),
|
|
1934
|
+
prefetch: z11.number().int().optional(),
|
|
1935
|
+
connectionTimeout: z11.number().positive().default(3000),
|
|
1936
|
+
heartbeatInterval: z11.number().int().positive().optional(),
|
|
1937
|
+
connectionOptions: z11.any().optional(),
|
|
1938
|
+
maxMessageSize: z11.number().int().positive().default(128 * 1024 * 1024),
|
|
1939
|
+
passthroughByteReferences: z11.boolean().optional()
|
|
1933
1940
|
});
|
|
1934
1941
|
function isMessageHandlerGenerator(handler) {
|
|
1935
1942
|
return handler.constructor.name === "GeneratorFunction" || handler.constructor.name === "AsyncGeneratorFunction";
|
|
@@ -1993,7 +2000,7 @@ function createConnection({
|
|
|
1993
2000
|
clientProperties: {
|
|
1994
2001
|
...connectionOptions?.clientProperties,
|
|
1995
2002
|
...buildServiceClientProperties({
|
|
1996
|
-
libVersion: "javascript@0.8.2-edge.
|
|
2003
|
+
libVersion: "javascript@0.8.2-edge.1169",
|
|
1997
2004
|
serviceVersion: version,
|
|
1998
2005
|
connectionId,
|
|
1999
2006
|
prefetch,
|
|
@@ -2135,6 +2142,19 @@ function createConnection({
|
|
|
2135
2142
|
simple_default.error(`Requence: could not report a failed surface interaction on |${params.surface}|:`, error instanceof Error ? error.message : error);
|
|
2136
2143
|
});
|
|
2137
2144
|
};
|
|
2145
|
+
const announceResume = (params) => {
|
|
2146
|
+
channelWrapper.publish(exchange, "", Buffer.from(JSON.stringify({ messageId: params.messageId })), {
|
|
2147
|
+
correlationId: params.messageId,
|
|
2148
|
+
contentType: "application/json",
|
|
2149
|
+
persistent: true,
|
|
2150
|
+
headers: {
|
|
2151
|
+
taskId: params.taskId,
|
|
2152
|
+
[NODE_RESUME_HEADER]: true
|
|
2153
|
+
}
|
|
2154
|
+
}).catch((error) => {
|
|
2155
|
+
simple_default.error(`Requence: could not announce the resume of message |${params.messageId}|:`, error instanceof Error ? error.message : error);
|
|
2156
|
+
});
|
|
2157
|
+
};
|
|
2138
2158
|
const publishBundleSwap = (ui) => {
|
|
2139
2159
|
const swap = {
|
|
2140
2160
|
devSession,
|
|
@@ -2516,7 +2536,7 @@ function createConnection({
|
|
|
2516
2536
|
begin: true,
|
|
2517
2537
|
epoch,
|
|
2518
2538
|
...buildServiceIdentityHeaders({
|
|
2519
|
-
libVersion: "javascript@0.8.2-edge.
|
|
2539
|
+
libVersion: "javascript@0.8.2-edge.1169",
|
|
2520
2540
|
name,
|
|
2521
2541
|
holdsSlot: !(isGeneratorHandler && mode === "CONTINUOUS")
|
|
2522
2542
|
})
|
|
@@ -2821,6 +2841,7 @@ function createConnection({
|
|
|
2821
2841
|
});
|
|
2822
2842
|
}
|
|
2823
2843
|
};
|
|
2844
|
+
announceResume({ taskId, messageId });
|
|
2824
2845
|
const result = await actor(sendApi);
|
|
2825
2846
|
if (result != null && typeof result === "object" && ((Symbol.asyncIterator in result) || (Symbol.iterator in result))) {
|
|
2826
2847
|
const iterable = result;
|
|
@@ -3086,5 +3107,5 @@ export {
|
|
|
3086
3107
|
PayloadTooLargeError
|
|
3087
3108
|
};
|
|
3088
3109
|
|
|
3089
|
-
//# debugId=
|
|
3110
|
+
//# debugId=92BCB493C34198B664756E2164756E21
|
|
3090
3111
|
//# sourceMappingURL=index.js.map
|