@forklaunch/implementation-worker-redis 0.5.7 → 0.5.8
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/lib/domain/schemas/index.js +43 -11
- package/lib/domain/schemas/index.mjs +43 -11
- package/package.json +7 -7
|
@@ -35,7 +35,7 @@ module.exports = __toCommonJS(schemas_exports);
|
|
|
35
35
|
// domain/schemas/redisWorker.schema.ts
|
|
36
36
|
var import_internal = require('@forklaunch/internal');
|
|
37
37
|
|
|
38
|
-
// ../../../node_modules/.pnpm/@forklaunch+validator@0.9.
|
|
38
|
+
// ../../../node_modules/.pnpm/@forklaunch+validator@0.9.8/node_modules/@forklaunch/validator/lib/src/typebox/index.mjs
|
|
39
39
|
var typebox_exports = {};
|
|
40
40
|
__export(typebox_exports, {
|
|
41
41
|
SchemaValidator: () => SchemaValidator,
|
|
@@ -75,7 +75,7 @@ __export(typebox_exports, {
|
|
|
75
75
|
});
|
|
76
76
|
__reExport(typebox_exports, require('@sinclair/typebox'));
|
|
77
77
|
|
|
78
|
-
// ../../../node_modules/.pnpm/@forklaunch+common@0.5.
|
|
78
|
+
// ../../../node_modules/.pnpm/@forklaunch+common@0.5.7/node_modules/@forklaunch/common/lib/index.mjs
|
|
79
79
|
var InMemoryBlob = class extends Blob {
|
|
80
80
|
constructor(content) {
|
|
81
81
|
super([content]);
|
|
@@ -83,7 +83,7 @@ var InMemoryBlob = class extends Blob {
|
|
|
83
83
|
}
|
|
84
84
|
};
|
|
85
85
|
|
|
86
|
-
// ../../../node_modules/.pnpm/@forklaunch+validator@0.9.
|
|
86
|
+
// ../../../node_modules/.pnpm/@forklaunch+validator@0.9.8/node_modules/@forklaunch/validator/lib/src/typebox/index.mjs
|
|
87
87
|
var import_typebox = require('@sinclair/typebox');
|
|
88
88
|
var import_compiler = require('@sinclair/typebox/compiler');
|
|
89
89
|
var import_errors = require('@sinclair/typebox/errors');
|
|
@@ -121,7 +121,7 @@ var TypeboxSchemaValidator = class {
|
|
|
121
121
|
title: 'UUID'
|
|
122
122
|
});
|
|
123
123
|
email = import_typebox.Type.String({
|
|
124
|
-
pattern:
|
|
124
|
+
pattern: '^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$',
|
|
125
125
|
errorType: 'email',
|
|
126
126
|
example: 'a@b.com',
|
|
127
127
|
title: 'Email'
|
|
@@ -308,7 +308,9 @@ var TypeboxSchemaValidator = class {
|
|
|
308
308
|
title: 'File'
|
|
309
309
|
})
|
|
310
310
|
)
|
|
311
|
-
.Decode((value) =>
|
|
311
|
+
.Decode((value) => {
|
|
312
|
+
return new InMemoryBlob(value);
|
|
313
|
+
})
|
|
312
314
|
.Encode((value) => value.content);
|
|
313
315
|
type = () => this.any;
|
|
314
316
|
/**
|
|
@@ -511,10 +513,40 @@ var TypeboxSchemaValidator = class {
|
|
|
511
513
|
}
|
|
512
514
|
} else {
|
|
513
515
|
const schemified = this.schemify(schema);
|
|
514
|
-
if (
|
|
515
|
-
|
|
516
|
+
if (schemified[import_typebox.Kind] === 'Unsafe') {
|
|
517
|
+
try {
|
|
518
|
+
if (value instanceof Buffer) {
|
|
519
|
+
conversion = new InMemoryBlob(value);
|
|
520
|
+
} else {
|
|
521
|
+
errors = [
|
|
522
|
+
{
|
|
523
|
+
type: import_errors.ValueErrorType.String,
|
|
524
|
+
schema: schemified,
|
|
525
|
+
path: '',
|
|
526
|
+
message: `Invalid file type: expected Buffer or string, got ${typeof value}`,
|
|
527
|
+
value,
|
|
528
|
+
errors: []
|
|
529
|
+
}
|
|
530
|
+
];
|
|
531
|
+
}
|
|
532
|
+
} catch (err) {
|
|
533
|
+
errors = [
|
|
534
|
+
{
|
|
535
|
+
type: import_errors.ValueErrorType.String,
|
|
536
|
+
schema: schemified,
|
|
537
|
+
path: '',
|
|
538
|
+
message: err instanceof Error ? err.message : 'Invalid file type',
|
|
539
|
+
value,
|
|
540
|
+
errors: []
|
|
541
|
+
}
|
|
542
|
+
];
|
|
543
|
+
}
|
|
516
544
|
} else {
|
|
517
|
-
|
|
545
|
+
if (import_value.Value.Check(schemified, value)) {
|
|
546
|
+
conversion = import_value.Value.Decode(schemified, value);
|
|
547
|
+
} else {
|
|
548
|
+
errors = Array.from(import_value.Value.Errors(schemified, value));
|
|
549
|
+
}
|
|
518
550
|
}
|
|
519
551
|
}
|
|
520
552
|
return errors != null && errors.length === 0
|
|
@@ -632,7 +664,7 @@ var RedisWorkerOptionsSchema = {
|
|
|
632
664
|
interval: number
|
|
633
665
|
};
|
|
634
666
|
|
|
635
|
-
// ../../../node_modules/.pnpm/@forklaunch+validator@0.9.
|
|
667
|
+
// ../../../node_modules/.pnpm/@forklaunch+validator@0.9.8/node_modules/@forklaunch/validator/lib/src/zod/index.mjs
|
|
636
668
|
var import_v3 = require('zod/v3');
|
|
637
669
|
|
|
638
670
|
// ../../../node_modules/.pnpm/ts-deepmerge@7.0.3/node_modules/ts-deepmerge/esm/index.js
|
|
@@ -694,7 +726,7 @@ merge.withOptions = (options, ...objects) => {
|
|
|
694
726
|
return result;
|
|
695
727
|
};
|
|
696
728
|
|
|
697
|
-
// ../../../node_modules/.pnpm/@forklaunch+validator@0.9.
|
|
729
|
+
// ../../../node_modules/.pnpm/@forklaunch+validator@0.9.8/node_modules/@forklaunch/validator/lib/src/zod/index.mjs
|
|
698
730
|
var import_v32 = require('zod/v3');
|
|
699
731
|
function extendApi(schema, schemaObject = {}) {
|
|
700
732
|
const This = schema.constructor;
|
|
@@ -1246,7 +1278,7 @@ var ZodSchemaValidator = class {
|
|
|
1246
1278
|
email = import_v3.z.string().email().openapi({
|
|
1247
1279
|
title: 'Email',
|
|
1248
1280
|
format: 'email',
|
|
1249
|
-
pattern:
|
|
1281
|
+
pattern: '^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$',
|
|
1250
1282
|
example: 'a@b.com'
|
|
1251
1283
|
});
|
|
1252
1284
|
uri = import_v3.z.string().url().openapi({
|
|
@@ -25,7 +25,7 @@ var __reExport = (target, mod, secondTarget) => (
|
|
|
25
25
|
// domain/schemas/redisWorker.schema.ts
|
|
26
26
|
import { serviceSchemaResolver } from '@forklaunch/internal';
|
|
27
27
|
|
|
28
|
-
// ../../../node_modules/.pnpm/@forklaunch+validator@0.9.
|
|
28
|
+
// ../../../node_modules/.pnpm/@forklaunch+validator@0.9.8/node_modules/@forklaunch/validator/lib/src/typebox/index.mjs
|
|
29
29
|
var typebox_exports = {};
|
|
30
30
|
__export(typebox_exports, {
|
|
31
31
|
SchemaValidator: () => SchemaValidator,
|
|
@@ -66,7 +66,7 @@ __export(typebox_exports, {
|
|
|
66
66
|
__reExport(typebox_exports, typebox_star);
|
|
67
67
|
import * as typebox_star from '@sinclair/typebox';
|
|
68
68
|
|
|
69
|
-
// ../../../node_modules/.pnpm/@forklaunch+common@0.5.
|
|
69
|
+
// ../../../node_modules/.pnpm/@forklaunch+common@0.5.7/node_modules/@forklaunch/common/lib/index.mjs
|
|
70
70
|
var InMemoryBlob = class extends Blob {
|
|
71
71
|
constructor(content) {
|
|
72
72
|
super([content]);
|
|
@@ -74,7 +74,7 @@ var InMemoryBlob = class extends Blob {
|
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
76
|
|
|
77
|
-
// ../../../node_modules/.pnpm/@forklaunch+validator@0.9.
|
|
77
|
+
// ../../../node_modules/.pnpm/@forklaunch+validator@0.9.8/node_modules/@forklaunch/validator/lib/src/typebox/index.mjs
|
|
78
78
|
import { FormatRegistry, Kind, KindGuard, Type } from '@sinclair/typebox';
|
|
79
79
|
import { TypeCheck, TypeCompiler } from '@sinclair/typebox/compiler';
|
|
80
80
|
import {
|
|
@@ -113,7 +113,7 @@ var TypeboxSchemaValidator = class {
|
|
|
113
113
|
title: 'UUID'
|
|
114
114
|
});
|
|
115
115
|
email = Type.String({
|
|
116
|
-
pattern:
|
|
116
|
+
pattern: '^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$',
|
|
117
117
|
errorType: 'email',
|
|
118
118
|
example: 'a@b.com',
|
|
119
119
|
title: 'Email'
|
|
@@ -293,7 +293,9 @@ var TypeboxSchemaValidator = class {
|
|
|
293
293
|
title: 'File'
|
|
294
294
|
})
|
|
295
295
|
)
|
|
296
|
-
.Decode((value) =>
|
|
296
|
+
.Decode((value) => {
|
|
297
|
+
return new InMemoryBlob(value);
|
|
298
|
+
})
|
|
297
299
|
.Encode((value) => value.content);
|
|
298
300
|
type = () => this.any;
|
|
299
301
|
/**
|
|
@@ -490,10 +492,40 @@ var TypeboxSchemaValidator = class {
|
|
|
490
492
|
}
|
|
491
493
|
} else {
|
|
492
494
|
const schemified = this.schemify(schema);
|
|
493
|
-
if (
|
|
494
|
-
|
|
495
|
+
if (schemified[Kind] === 'Unsafe') {
|
|
496
|
+
try {
|
|
497
|
+
if (value instanceof Buffer) {
|
|
498
|
+
conversion = new InMemoryBlob(value);
|
|
499
|
+
} else {
|
|
500
|
+
errors = [
|
|
501
|
+
{
|
|
502
|
+
type: ValueErrorType.String,
|
|
503
|
+
schema: schemified,
|
|
504
|
+
path: '',
|
|
505
|
+
message: `Invalid file type: expected Buffer or string, got ${typeof value}`,
|
|
506
|
+
value,
|
|
507
|
+
errors: []
|
|
508
|
+
}
|
|
509
|
+
];
|
|
510
|
+
}
|
|
511
|
+
} catch (err) {
|
|
512
|
+
errors = [
|
|
513
|
+
{
|
|
514
|
+
type: ValueErrorType.String,
|
|
515
|
+
schema: schemified,
|
|
516
|
+
path: '',
|
|
517
|
+
message: err instanceof Error ? err.message : 'Invalid file type',
|
|
518
|
+
value,
|
|
519
|
+
errors: []
|
|
520
|
+
}
|
|
521
|
+
];
|
|
522
|
+
}
|
|
495
523
|
} else {
|
|
496
|
-
|
|
524
|
+
if (Value.Check(schemified, value)) {
|
|
525
|
+
conversion = Value.Decode(schemified, value);
|
|
526
|
+
} else {
|
|
527
|
+
errors = Array.from(Value.Errors(schemified, value));
|
|
528
|
+
}
|
|
497
529
|
}
|
|
498
530
|
}
|
|
499
531
|
return errors != null && errors.length === 0
|
|
@@ -608,7 +640,7 @@ var RedisWorkerOptionsSchema = {
|
|
|
608
640
|
interval: number
|
|
609
641
|
};
|
|
610
642
|
|
|
611
|
-
// ../../../node_modules/.pnpm/@forklaunch+validator@0.9.
|
|
643
|
+
// ../../../node_modules/.pnpm/@forklaunch+validator@0.9.8/node_modules/@forklaunch/validator/lib/src/zod/index.mjs
|
|
612
644
|
import { z as z2, ZodType } from 'zod/v3';
|
|
613
645
|
|
|
614
646
|
// ../../../node_modules/.pnpm/ts-deepmerge@7.0.3/node_modules/ts-deepmerge/esm/index.js
|
|
@@ -670,7 +702,7 @@ merge.withOptions = (options, ...objects) => {
|
|
|
670
702
|
return result;
|
|
671
703
|
};
|
|
672
704
|
|
|
673
|
-
// ../../../node_modules/.pnpm/@forklaunch+validator@0.9.
|
|
705
|
+
// ../../../node_modules/.pnpm/@forklaunch+validator@0.9.8/node_modules/@forklaunch/validator/lib/src/zod/index.mjs
|
|
674
706
|
import { z } from 'zod/v3';
|
|
675
707
|
function extendApi(schema, schemaObject = {}) {
|
|
676
708
|
const This = schema.constructor;
|
|
@@ -1218,7 +1250,7 @@ var ZodSchemaValidator = class {
|
|
|
1218
1250
|
email = z2.string().email().openapi({
|
|
1219
1251
|
title: 'Email',
|
|
1220
1252
|
format: 'email',
|
|
1221
|
-
pattern:
|
|
1253
|
+
pattern: '^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$',
|
|
1222
1254
|
example: 'a@b.com'
|
|
1223
1255
|
});
|
|
1224
1256
|
uri = z2.string().url().openapi({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forklaunch/implementation-worker-redis",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.8",
|
|
4
4
|
"description": "Redis implementation for forklaunch workers",
|
|
5
5
|
"homepage": "https://github.com/forklaunch/forklaunch-js#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -42,19 +42,19 @@
|
|
|
42
42
|
"lib/**"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@forklaunch/core": "^0.13.
|
|
46
|
-
"@forklaunch/internal": "^0.2.
|
|
45
|
+
"@forklaunch/core": "^0.13.8",
|
|
46
|
+
"@forklaunch/internal": "^0.2.8",
|
|
47
47
|
"@sinclair/typebox": "^0.34.40",
|
|
48
48
|
"zod": "^4.1.1",
|
|
49
|
-
"@forklaunch/interfaces-worker": "0.4.
|
|
49
|
+
"@forklaunch/interfaces-worker": "0.4.7"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
52
|
+
"@typescript/native-preview": "7.0.0-dev.20250825.1",
|
|
53
53
|
"depcheck": "^1.4.7",
|
|
54
54
|
"eslint": "^9.34.0",
|
|
55
55
|
"prettier": "^3.6.2",
|
|
56
|
-
"typedoc": "^0.28.
|
|
57
|
-
"typescript-eslint": "^8.
|
|
56
|
+
"typedoc": "^0.28.11",
|
|
57
|
+
"typescript-eslint": "^8.41.0"
|
|
58
58
|
},
|
|
59
59
|
"scripts": {
|
|
60
60
|
"build": "tsc --noEmit && tsup producers/index.ts consumers/index.ts domain/schemas/index.ts domain/types/index.ts --format cjs,esm --no-splitting --dts --tsconfig tsconfig.json --out-dir lib --clean && if [ -f eject-package.bash ]; then pnpm package:eject; fi",
|