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