@hexok/queue 0.0.0 → 0.2.0
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/README.md +2 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/queue.d.ts +5 -1
- package/dist/queue.d.ts.map +1 -1
- package/dist/queue.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -7,3 +7,5 @@ import { Queue, type QueueHandler } from '@hexok/queue';
|
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
`publish` resolves a broker id. `subscribe` requires `consumerGroup`. A handler return of `'ack'`, `void`, or `'drop'` acknowledges. `'retry'` leaves the entry pending. A throw uses `onError`, which defaults to `'retry'`. There is no dead-letter stream. A Redis adapter can park a failed publish, a missing payload, or a decode failure when a quarantine sink is passed. A handler `'drop'` is not parked.
|
|
10
|
+
|
|
11
|
+
Pass `{ sensitive: true }` as the third `publish` argument for a payload that holds a secret, such as a one-time code or a reset link. An adapter then parks and logs that message without its payload.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { dispositionOf, Queue, type QueueDisposition, type QueueHandler, type QueueMessage, type QueueStartFrom, type QueueSubscribeOptions, } from './queue.js';
|
|
1
|
+
export { dispositionOf, Queue, type QueueDisposition, type QueueHandler, type QueueMessage, type QueuePublishOptions, type QueueStartFrom, type QueueSubscribeOptions, } from './queue.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,KAAK,EACL,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,qBAAqB,GAC3B,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,KAAK,EACL,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,qBAAqB,GAC3B,MAAM,YAAY,CAAC"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,KAAK,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,KAAK,GAON,MAAM,YAAY,CAAC"}
|
package/dist/queue.d.ts
CHANGED
|
@@ -16,13 +16,17 @@ export interface QueueSubscribeOptions<T> {
|
|
|
16
16
|
readonly onError?: QueueDisposition;
|
|
17
17
|
readonly handler: QueueHandler<T>;
|
|
18
18
|
}
|
|
19
|
+
/** `sensitive` keeps the payload out of quarantine and logs. Use it for one-time codes and reset links. */
|
|
20
|
+
export interface QueuePublishOptions {
|
|
21
|
+
readonly sensitive?: boolean;
|
|
22
|
+
}
|
|
19
23
|
declare const Queue_base: (abstract new () => {
|
|
20
24
|
readonly "__#private@#brand": true;
|
|
21
25
|
}) & {
|
|
22
26
|
readonly token: "Queue";
|
|
23
27
|
};
|
|
24
28
|
export declare abstract class Queue extends Queue_base {
|
|
25
|
-
abstract publish(topic: string, payload: unknown): Promise<string>;
|
|
29
|
+
abstract publish(topic: string, payload: unknown, options?: QueuePublishOptions): Promise<string>;
|
|
26
30
|
abstract subscribe<T>(topic: string, options: QueueSubscribeOptions<T>): Promise<void>;
|
|
27
31
|
abstract unsubscribe(topic: string, options: {
|
|
28
32
|
readonly consumerGroup: string;
|
package/dist/queue.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../src/queue.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,CAAC;AAExD,MAAM,WAAW,YAAY,CAAC,CAAC;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;CACrB;AAED,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAC5B,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,KACrB,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;AAEtC,MAAM,MAAM,cAAc,GACtB,UAAU,GACV,KAAK,GACL;IAAE,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAA;CAAE,GACrC;IAAE,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvC,MAAM,WAAW,qBAAqB,CAAC,CAAC;IACtC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,SAAS,CAAC,EAAE,cAAc,CAAC;IACpC,QAAQ,CAAC,OAAO,CAAC,EAAE,gBAAgB,CAAC;IACpC,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;CACnC;;;;;;AAED,8BAAsB,KAAM,SAAQ,UAAa;IAC/C,QAAQ,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../src/queue.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,CAAC;AAExD,MAAM,WAAW,YAAY,CAAC,CAAC;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,O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E,OAAO,EACf,OAAO,GAAE,gBAA0B,GAClC,gBAAgB,CAIlB"}
|
package/dist/queue.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queue.js","sourceRoot":"","sources":["../src/queue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"queue.js","sourceRoot":"","sources":["../src/queue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAgC7B,MAAM,OAAgB,KAAM,SAAQ,IAAI,CAAC,OAAO,CAAC;CAchD;AAED,yFAAyF;AACzF,MAAM,UAAU,aAAa,CAC3B,QAAiC,EACjC,MAAe,EACf,UAA4B,OAAO;IAEnC,IAAI,MAAM;QAAE,OAAO,OAAO,CAAC;IAC3B,IAAI,QAAQ,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IACzC,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hexok/queue",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Queue port for hexok.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,6 +40,6 @@
|
|
|
40
40
|
"clean": "rm -rf dist *.tsbuildinfo"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"hexok": "^2.1
|
|
43
|
+
"hexok": "^2.2.1"
|
|
44
44
|
}
|
|
45
45
|
}
|