@forklaunch/implementation-worker-bullmq 0.1.4 → 0.1.6
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/__test__/schemaEquality.test.d.ts +1 -1
- package/lib/__test__/schemaEquality.test.js +13 -5
- package/lib/consumers/bullMqWorker.consumer.d.ts +27 -14
- package/lib/consumers/bullMqWorker.consumer.d.ts.map +1 -1
- package/lib/consumers/bullMqWorker.consumer.js +43 -39
- package/lib/consumers/index.d.ts +1 -1
- package/lib/eject/consumers/bullMqWorker.consumer.ts +2 -2
- package/lib/eject/producers/bullMqWorker.producer.ts +2 -2
- package/lib/eject/types/bullMqWorker.types.ts +1 -1
- package/lib/jest.config.d.ts +1 -1
- package/lib/jest.config.js +16 -16
- package/lib/producers/bullMqWorker.producer.d.ts +13 -9
- package/lib/producers/bullMqWorker.producer.d.ts.map +1 -1
- package/lib/producers/bullMqWorker.producer.js +34 -32
- package/lib/producers/index.d.ts +1 -1
- package/lib/schemas/bullMqWorker.schema.d.ts +1949 -360
- package/lib/schemas/bullMqWorker.schema.js +4 -1
- package/lib/schemas/index.d.ts +1 -1
- package/lib/schemas/typebox/bullMqWorker.schema.d.ts +1019 -79
- package/lib/schemas/typebox/bullMqWorker.schema.js +123 -83
- package/lib/schemas/zod/bullMqWorker.schema.d.ts +873 -259
- package/lib/schemas/zod/bullMqWorker.schema.js +123 -83
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/bullMqWorker.types.d.ts +5 -5
- package/lib/types/bullMqWorker.types.d.ts.map +1 -1
- package/lib/types/index.d.ts +1 -1
- package/lib/vitest.config.d.ts +2 -2
- package/lib/vitest.config.js +4 -4
- package/package.json +8 -8
|
@@ -1,105 +1,145 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
any,
|
|
3
|
+
array,
|
|
4
|
+
boolean,
|
|
5
|
+
date,
|
|
6
|
+
enum_,
|
|
7
|
+
function_,
|
|
8
|
+
literal,
|
|
9
|
+
null_,
|
|
10
|
+
number,
|
|
11
|
+
optional,
|
|
12
|
+
promise,
|
|
13
|
+
record,
|
|
14
|
+
string,
|
|
15
|
+
undefined_,
|
|
16
|
+
union,
|
|
17
|
+
unknown,
|
|
18
|
+
void_
|
|
19
|
+
} from '@forklaunch/validator/typebox';
|
|
2
20
|
import { SpanKind } from 'bullmq';
|
|
3
21
|
const BullMqWorkerKeepJobsSchema = {
|
|
4
|
-
|
|
5
|
-
|
|
22
|
+
age: optional(number),
|
|
23
|
+
count: optional(number)
|
|
6
24
|
};
|
|
7
25
|
const BullMqWorkerBackoffOptionsSchema = {
|
|
8
|
-
|
|
9
|
-
|
|
26
|
+
type: union([literal('fixed'), literal('exponential')]),
|
|
27
|
+
delay: optional(number)
|
|
10
28
|
};
|
|
11
29
|
const BullMqWorkerDefaultJobOptionsSchema = {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
30
|
+
timestamp: optional(number),
|
|
31
|
+
priority: optional(number),
|
|
32
|
+
delay: optional(number),
|
|
33
|
+
attempts: optional(number),
|
|
34
|
+
backoff: optional(union([number, BullMqWorkerBackoffOptionsSchema])),
|
|
35
|
+
lifo: optional(boolean),
|
|
36
|
+
removeOnComplete: optional(
|
|
37
|
+
union([boolean, number, BullMqWorkerKeepJobsSchema])
|
|
38
|
+
),
|
|
39
|
+
removeOnFail: optional(union([boolean, number, BullMqWorkerKeepJobsSchema])),
|
|
40
|
+
keepLogs: optional(number),
|
|
41
|
+
stackTraceLimit: optional(number),
|
|
42
|
+
sizeLimit: optional(number)
|
|
23
43
|
};
|
|
24
44
|
const BullMqDateType = union([date, number, string]);
|
|
25
45
|
const BullMqWorkerAdvancedRepeatOptionsSchema = {
|
|
26
|
-
|
|
46
|
+
repeatStrategy: optional(
|
|
47
|
+
function_(
|
|
48
|
+
[
|
|
27
49
|
number,
|
|
28
50
|
{
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
51
|
+
pattern: optional(string),
|
|
52
|
+
key: optional(string),
|
|
53
|
+
limit: optional(number),
|
|
54
|
+
every: optional(number),
|
|
55
|
+
immediately: optional(boolean),
|
|
56
|
+
count: optional(number),
|
|
57
|
+
offset: optional(number),
|
|
58
|
+
prevMillis: optional(number),
|
|
59
|
+
jobId: optional(string),
|
|
60
|
+
currentDate: optional(BullMqDateType),
|
|
61
|
+
startDate: optional(BullMqDateType),
|
|
62
|
+
endDate: optional(BullMqDateType),
|
|
63
|
+
utc: optional(boolean),
|
|
64
|
+
tz: optional(string),
|
|
65
|
+
nthDayOfWeek: optional(number)
|
|
44
66
|
},
|
|
45
67
|
optional(string)
|
|
46
|
-
|
|
47
|
-
|
|
68
|
+
],
|
|
69
|
+
union([number, undefined_, promise(union([number, undefined_]))])
|
|
70
|
+
)
|
|
71
|
+
),
|
|
72
|
+
repeatKeyHashAlgorithm: optional(string)
|
|
48
73
|
};
|
|
49
74
|
const BullMqWorkerTelemetryAttributeValueSchema = union([
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
75
|
+
string,
|
|
76
|
+
number,
|
|
77
|
+
boolean,
|
|
78
|
+
array(union([string, null_, undefined_])),
|
|
79
|
+
array(union([number, null_, undefined_])),
|
|
80
|
+
array(union([boolean, null_, undefined_]))
|
|
56
81
|
]);
|
|
57
|
-
const BullMqWorkerTelemetryAttributesSchema = record(
|
|
82
|
+
const BullMqWorkerTelemetryAttributesSchema = record(
|
|
83
|
+
string,
|
|
84
|
+
union([BullMqWorkerTelemetryAttributeValueSchema, undefined_])
|
|
85
|
+
);
|
|
58
86
|
const BullMqWorkerTelemetrySchema = optional({
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
87
|
+
tracer: {
|
|
88
|
+
startSpan: function_(
|
|
89
|
+
[
|
|
90
|
+
string,
|
|
91
|
+
optional({
|
|
92
|
+
kind: optional(enum_(SpanKind))
|
|
93
|
+
}),
|
|
94
|
+
optional(unknown)
|
|
95
|
+
],
|
|
96
|
+
{
|
|
97
|
+
setSpanOnContext: function_([unknown], unknown),
|
|
98
|
+
setAttribute: function_(
|
|
99
|
+
[string, BullMqWorkerTelemetryAttributeValueSchema],
|
|
100
|
+
void_
|
|
101
|
+
),
|
|
102
|
+
setAttributes: function_(
|
|
103
|
+
[BullMqWorkerTelemetryAttributesSchema],
|
|
104
|
+
void_
|
|
105
|
+
),
|
|
106
|
+
addEvent: function_(
|
|
107
|
+
[string, optional(BullMqWorkerTelemetryAttributesSchema)],
|
|
108
|
+
void_
|
|
109
|
+
),
|
|
110
|
+
recordException: function_([unknown, optional(number)], void_),
|
|
111
|
+
end: function_([], void_)
|
|
112
|
+
}
|
|
113
|
+
)
|
|
114
|
+
},
|
|
115
|
+
contextManager: {
|
|
116
|
+
with: function_([unknown, function_([any], any)], any),
|
|
117
|
+
active: function_([], unknown),
|
|
118
|
+
getMetadata: function_([unknown], string),
|
|
119
|
+
fromMetadata: function_([unknown, string], unknown)
|
|
120
|
+
}
|
|
81
121
|
});
|
|
82
122
|
const BullMqWorkerQueueOptionsSchema = {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
123
|
+
connection: {
|
|
124
|
+
skipVersionCheck: optional(boolean),
|
|
125
|
+
url: optional(string)
|
|
126
|
+
},
|
|
127
|
+
blockingConnection: optional(boolean),
|
|
128
|
+
prefix: optional(string),
|
|
129
|
+
telemetry: BullMqWorkerTelemetrySchema,
|
|
130
|
+
skipWaitingForReady: optional(boolean),
|
|
131
|
+
defaultJobOptions: optional(BullMqWorkerDefaultJobOptionsSchema),
|
|
132
|
+
streams: optional({
|
|
133
|
+
events: {
|
|
134
|
+
maxLen: number
|
|
135
|
+
}
|
|
136
|
+
}),
|
|
137
|
+
skipMetasUpdate: optional(boolean),
|
|
138
|
+
settings: optional(BullMqWorkerAdvancedRepeatOptionsSchema)
|
|
99
139
|
};
|
|
100
140
|
export const BullMqWorkerOptionsSchema = {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
141
|
+
...BullMqWorkerQueueOptionsSchema,
|
|
142
|
+
backoffType: union([literal('exponential'), literal('fixed')]),
|
|
143
|
+
retries: number,
|
|
144
|
+
interval: number
|
|
105
145
|
};
|