lonnymq 0.0.4 → 0.0.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/dist/index.cjs +186 -169
- package/dist/index.d.ts +29 -46
- package/dist/index.js +180 -163
- package/package.json +1 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,23 +1,10 @@
|
|
|
1
1
|
// Generated by dts-bundle-generator v9.5.1
|
|
2
2
|
|
|
3
|
-
export type DeferredGetResult<T> = {
|
|
4
|
-
resultType: "RESULT_NOT_SET";
|
|
5
|
-
} | {
|
|
6
|
-
resultType: "RESULT_SET";
|
|
7
|
-
value: T;
|
|
8
|
-
};
|
|
9
|
-
export declare class Deferred<T> {
|
|
10
|
-
private value;
|
|
11
|
-
private isSet;
|
|
12
|
-
constructor();
|
|
13
|
-
get(): DeferredGetResult<T>;
|
|
14
|
-
set(value: T): void;
|
|
15
|
-
}
|
|
16
3
|
export type DatabaseClientQueryResult = {
|
|
17
4
|
rows: Array<Record<string, unknown>>;
|
|
18
5
|
};
|
|
19
6
|
export interface DatabaseClient {
|
|
20
|
-
query(query: string): Promise<DatabaseClientQueryResult>;
|
|
7
|
+
query(query: string, params: Array<unknown>): Promise<DatabaseClientQueryResult>;
|
|
21
8
|
}
|
|
22
9
|
export declare class ChannelPolicyClearCommand {
|
|
23
10
|
readonly schema: string;
|
|
@@ -49,11 +36,9 @@ export declare class ChannelPolicySetCommand {
|
|
|
49
36
|
}
|
|
50
37
|
export type MessageCreateCommandResultMessageCreated = {
|
|
51
38
|
resultType: "MESSAGE_CREATED";
|
|
52
|
-
id: bigint;
|
|
53
39
|
};
|
|
54
40
|
export type MessageCreateCommandResultMessageDeduplicated = {
|
|
55
41
|
resultType: "MESSAGE_DEDUPLICATED";
|
|
56
|
-
id: bigint;
|
|
57
42
|
};
|
|
58
43
|
export type MessageCreateCommandResultMessageDropped = {
|
|
59
44
|
resultType: "MESSAGE_DROPPED";
|
|
@@ -63,15 +48,16 @@ export declare class MessageCreateCommand {
|
|
|
63
48
|
readonly schema: string;
|
|
64
49
|
readonly channelName: string;
|
|
65
50
|
readonly name: string | null;
|
|
66
|
-
readonly content:
|
|
51
|
+
readonly content: Buffer;
|
|
67
52
|
readonly lockMs: number;
|
|
53
|
+
readonly id: string;
|
|
68
54
|
readonly delayMs: number;
|
|
69
55
|
readonly createdAt: Date;
|
|
70
56
|
constructor(params: {
|
|
71
57
|
schema: string;
|
|
72
58
|
channelName: string;
|
|
73
59
|
name?: string;
|
|
74
|
-
content:
|
|
60
|
+
content: Buffer;
|
|
75
61
|
lockMs?: number;
|
|
76
62
|
delayMs?: number;
|
|
77
63
|
});
|
|
@@ -80,12 +66,11 @@ export declare class MessageCreateCommand {
|
|
|
80
66
|
export type MessageDequeueCommandResultMessageDequeued = {
|
|
81
67
|
resultType: "MESSAGE_DEQUEUED";
|
|
82
68
|
message: {
|
|
83
|
-
id:
|
|
69
|
+
id: string;
|
|
84
70
|
channelName: string;
|
|
85
71
|
name: string | null;
|
|
86
|
-
content:
|
|
87
|
-
|
|
88
|
-
state: string | null;
|
|
72
|
+
content: Buffer;
|
|
73
|
+
state: Buffer | null;
|
|
89
74
|
numAttempts: number;
|
|
90
75
|
};
|
|
91
76
|
};
|
|
@@ -113,12 +98,10 @@ export type MessageDeleteCommandResultMessageDeleted = {
|
|
|
113
98
|
export type MessageDeleteCommandResult = MessageDeleteCommandResultMessageNotFound | MessageDeleteCommandResultStateInvalid | MessageDeleteCommandResultMessageDeleted;
|
|
114
99
|
export declare class MessageDeleteCommand {
|
|
115
100
|
readonly schema: string;
|
|
116
|
-
readonly id:
|
|
117
|
-
readonly dequeueNonce: string;
|
|
101
|
+
readonly id: string;
|
|
118
102
|
constructor(params: {
|
|
119
103
|
schema: string;
|
|
120
|
-
id:
|
|
121
|
-
dequeueNonce: string;
|
|
104
|
+
id: string;
|
|
122
105
|
});
|
|
123
106
|
execute(databaseClient: DatabaseClient): Promise<MessageDeleteCommandResult>;
|
|
124
107
|
}
|
|
@@ -134,19 +117,21 @@ export type MessageDeferCommandResultMessageDeferred = {
|
|
|
134
117
|
export type MessageDeferCommandResult = MessageDeferCommandResultMessageNotFound | MessageDeferCommandResultStateInvalid | MessageDeferCommandResultMessageDeferred;
|
|
135
118
|
export declare class MessageDeferCommand {
|
|
136
119
|
readonly schema: string;
|
|
137
|
-
readonly id:
|
|
138
|
-
readonly dequeueNonce: string;
|
|
120
|
+
readonly id: string;
|
|
139
121
|
readonly delayMs: number;
|
|
140
|
-
readonly state:
|
|
122
|
+
readonly state: Buffer | null;
|
|
141
123
|
constructor(params: {
|
|
142
124
|
schema: string;
|
|
143
|
-
id:
|
|
144
|
-
dequeueNonce: string;
|
|
125
|
+
id: string;
|
|
145
126
|
delayMs?: number;
|
|
146
|
-
state?:
|
|
127
|
+
state?: Buffer | null;
|
|
147
128
|
});
|
|
148
129
|
execute(databaseClient: DatabaseClient): Promise<MessageDeferCommandResult>;
|
|
149
130
|
}
|
|
131
|
+
export type QueueBatchChannelMessageCreateResult = {
|
|
132
|
+
messageId: string;
|
|
133
|
+
promise: Promise<MessageCreateCommandResult>;
|
|
134
|
+
};
|
|
150
135
|
export declare class QueueBatchChannelMessage {
|
|
151
136
|
private readonly schema;
|
|
152
137
|
private readonly channelName;
|
|
@@ -159,9 +144,9 @@ export declare class QueueBatchChannelMessage {
|
|
|
159
144
|
create(params: {
|
|
160
145
|
name?: string;
|
|
161
146
|
lockMs?: number;
|
|
162
|
-
content:
|
|
147
|
+
content: Buffer;
|
|
163
148
|
delayMs?: number;
|
|
164
|
-
}):
|
|
149
|
+
}): QueueBatchChannelMessageCreateResult;
|
|
165
150
|
}
|
|
166
151
|
export declare class QueueBatchChannelPolicy {
|
|
167
152
|
private readonly schema;
|
|
@@ -176,8 +161,8 @@ export declare class QueueBatchChannelPolicy {
|
|
|
176
161
|
maxConcurrency?: number | null;
|
|
177
162
|
maxSize?: number | null;
|
|
178
163
|
releaseIntervalMs?: number | null;
|
|
179
|
-
}):
|
|
180
|
-
clear():
|
|
164
|
+
}): void;
|
|
165
|
+
clear(): void;
|
|
181
166
|
}
|
|
182
167
|
export declare class QueueBatchChannel {
|
|
183
168
|
readonly policy: QueueBatchChannelPolicy;
|
|
@@ -215,7 +200,7 @@ export declare class QueueChannelMessage {
|
|
|
215
200
|
databaseClient: DatabaseClient;
|
|
216
201
|
name?: string;
|
|
217
202
|
lockMs?: number;
|
|
218
|
-
content:
|
|
203
|
+
content: Buffer;
|
|
219
204
|
delayMs?: number;
|
|
220
205
|
}): Promise<MessageCreateCommandResult>;
|
|
221
206
|
}
|
|
@@ -246,27 +231,25 @@ export declare class QueueChannel {
|
|
|
246
231
|
}
|
|
247
232
|
export declare class QueueMessage {
|
|
248
233
|
private readonly schema;
|
|
249
|
-
readonly id:
|
|
234
|
+
readonly id: string;
|
|
250
235
|
readonly channelName: string;
|
|
251
236
|
readonly name: string | null;
|
|
252
|
-
readonly content:
|
|
253
|
-
readonly
|
|
254
|
-
readonly state: string | null;
|
|
237
|
+
readonly content: Buffer;
|
|
238
|
+
readonly state: Buffer | null;
|
|
255
239
|
readonly numAttempts: number;
|
|
256
240
|
constructor(params: {
|
|
257
241
|
schema: string;
|
|
258
|
-
id:
|
|
259
|
-
dequeueNonce: string;
|
|
242
|
+
id: string;
|
|
260
243
|
channelName: string;
|
|
261
244
|
name: string | null;
|
|
262
|
-
content:
|
|
263
|
-
state:
|
|
245
|
+
content: Buffer;
|
|
246
|
+
state: Buffer | null;
|
|
264
247
|
numAttempts: number;
|
|
265
248
|
});
|
|
266
249
|
defer(params: {
|
|
267
250
|
databaseClient: DatabaseClient;
|
|
268
251
|
delayMs?: number;
|
|
269
|
-
state?:
|
|
252
|
+
state?: Buffer;
|
|
270
253
|
}): Promise<MessageDeferCommandResult>;
|
|
271
254
|
delete(params: {
|
|
272
255
|
databaseClient: DatabaseClient;
|