two-stroke 5.0.2 → 5.0.4
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/package.json +11 -11
- package/src/index.ts +12 -3
package/package.json
CHANGED
|
@@ -8,24 +8,24 @@
|
|
|
8
8
|
"type-check": "./bin/type-check.mjs"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@cloudflare/vitest-pool-workers": "^0.8.
|
|
12
|
-
"@cloudflare/workers-types": "^4.
|
|
13
|
-
"@sentry/cli": "^2.
|
|
14
|
-
"@types/node": "^22.15.
|
|
15
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
16
|
-
"@typescript-eslint/parser": "^8.
|
|
11
|
+
"@cloudflare/vitest-pool-workers": "^0.8.34",
|
|
12
|
+
"@cloudflare/workers-types": "^4.20250601.0",
|
|
13
|
+
"@sentry/cli": "^2.46.0",
|
|
14
|
+
"@types/node": "^22.15.29",
|
|
15
|
+
"@typescript-eslint/eslint-plugin": "^8.33.0",
|
|
16
|
+
"@typescript-eslint/parser": "^8.33.0",
|
|
17
17
|
"@vitest/coverage-istanbul": "^3.1.4",
|
|
18
18
|
"eslint-config-prettier": "^10.1.5",
|
|
19
|
-
"eslint-config-two-stroke": "^1.1.
|
|
19
|
+
"eslint-config-two-stroke": "^1.1.20",
|
|
20
20
|
"eslint-config-typescript": "^3.0.0",
|
|
21
21
|
"jose": "^6.0.11",
|
|
22
22
|
"jwk-subtle": "^1.0.7",
|
|
23
|
-
"miniflare": "^4.
|
|
23
|
+
"miniflare": "^4.20250525.0",
|
|
24
24
|
"openapi-fetch": "^0.14.0",
|
|
25
25
|
"openapi-typescript": "^7.8.0",
|
|
26
26
|
"pbkdf-subtle": "^1.0.0",
|
|
27
27
|
"toucan-js": "^4.1.1",
|
|
28
|
-
"zod": "^3.25.
|
|
28
|
+
"zod": "^3.25.47"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"@sentry/cli": ">=2",
|
|
@@ -49,10 +49,10 @@
|
|
|
49
49
|
"name": "two-stroke",
|
|
50
50
|
"packageManager": "yarn@4.6.0",
|
|
51
51
|
"type": "module",
|
|
52
|
-
"version": "5.0.
|
|
52
|
+
"version": "5.0.4",
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@types/eslint": "^9.6.1",
|
|
55
|
-
"eslint": "^9.
|
|
55
|
+
"eslint": "^9.28.0",
|
|
56
56
|
"prettier": "^3.5.3",
|
|
57
57
|
"typescript": "^5.8.3",
|
|
58
58
|
"vitest": "^3.1.4"
|
package/src/index.ts
CHANGED
|
@@ -13,7 +13,8 @@ const escapeRegex = (str: string) =>
|
|
|
13
13
|
|
|
14
14
|
export function twoStroke<T extends Env>(title: string, release: string) {
|
|
15
15
|
let _queue: (c: {
|
|
16
|
-
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17
|
+
batch: MessageBatch<any>;
|
|
17
18
|
env: T;
|
|
18
19
|
sentry: Toucan;
|
|
19
20
|
}) => Promise<void>;
|
|
@@ -121,7 +122,7 @@ export function twoStroke<T extends Env>(title: string, release: string) {
|
|
|
121
122
|
JSON.stringify({
|
|
122
123
|
error: "Request body schema invalid",
|
|
123
124
|
issues: JSON.parse(body.error?.message ?? "{}") as unknown,
|
|
124
|
-
name: body.error?.name
|
|
125
|
+
name: body.error?.name,
|
|
125
126
|
}),
|
|
126
127
|
{
|
|
127
128
|
status: 400,
|
|
@@ -319,7 +320,15 @@ export function twoStroke<T extends Env>(title: string, release: string) {
|
|
|
319
320
|
parsedBatch: ZodSafeParseResult<z.output<I>>[];
|
|
320
321
|
}) => Promise<void>,
|
|
321
322
|
) {
|
|
322
|
-
_queue = async ({
|
|
323
|
+
_queue = async ({
|
|
324
|
+
batch,
|
|
325
|
+
env,
|
|
326
|
+
sentry,
|
|
327
|
+
}: {
|
|
328
|
+
batch: MessageBatch<z.input<I>>;
|
|
329
|
+
env: T;
|
|
330
|
+
sentry: Toucan;
|
|
331
|
+
}) => {
|
|
323
332
|
const parsedBatch = batch.messages.map((message) => {
|
|
324
333
|
const passed = input.safeParse(message.body);
|
|
325
334
|
if (!passed.success) {
|