@artstesh/postboy 2.1.9 → 3.0.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 +27 -68
- package/lib/i-postboy-depending.service.d.ts +3 -3
- package/lib/i-postboy-depending.service.js +2 -2
- package/lib/index.d.ts +9 -10
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +28 -29
- package/lib/index.js.map +1 -1
- package/lib/models/message-queue.model.d.ts +43 -43
- package/lib/models/message-queue.model.js +65 -65
- package/lib/models/message-queue.model.js.map +1 -1
- package/lib/models/postboy-callback.message.d.ts +26 -8
- package/lib/models/postboy-callback.message.d.ts.map +1 -1
- package/lib/models/postboy-callback.message.js +36 -18
- package/lib/models/postboy-callback.message.js.map +1 -1
- package/lib/models/postboy-execution.handler.d.ts +14 -14
- package/lib/models/postboy-execution.handler.js +16 -16
- package/lib/models/postboy-executor.d.ts +3 -3
- package/lib/models/postboy-executor.d.ts.map +1 -1
- package/lib/models/postboy-executor.js +7 -7
- package/lib/models/postboy-executor.js.map +1 -1
- package/lib/models/postboy-generic-message.d.ts +7 -7
- package/lib/models/postboy-generic-message.d.ts.map +1 -1
- package/lib/models/postboy-generic-message.js +16 -18
- package/lib/models/postboy-generic-message.js.map +1 -1
- package/lib/models/postboy-middleware.d.ts +5 -0
- package/lib/models/postboy-middleware.d.ts.map +1 -0
- package/lib/models/{postboy-bbb.js → postboy-middleware.js} +1 -1
- package/lib/models/postboy-middleware.js.map +1 -0
- package/lib/models/postboy-subscription.d.ts +6 -6
- package/lib/models/postboy-subscription.js +10 -10
- package/lib/models/postboy.message.d.ts +4 -0
- package/lib/models/postboy.message.d.ts.map +1 -0
- package/lib/models/postboy.message.js +10 -0
- package/lib/models/postboy.message.js.map +1 -0
- package/lib/models/queue.d.ts +11 -0
- package/lib/models/queue.d.ts.map +1 -0
- package/lib/models/queue.js +34 -0
- package/lib/models/queue.js.map +1 -0
- package/lib/postboy-abstract.registrator.d.ts +89 -113
- package/lib/postboy-abstract.registrator.d.ts.map +1 -1
- package/lib/postboy-abstract.registrator.js +108 -141
- package/lib/postboy-abstract.registrator.js.map +1 -1
- package/lib/postboy.service.d.ts +91 -105
- package/lib/postboy.service.d.ts.map +1 -1
- package/lib/postboy.service.js +140 -161
- package/lib/postboy.service.js.map +1 -1
- package/package.json +2 -4
- package/lib/locker.store.d.ts +0 -9
- package/lib/locker.store.d.ts.map +0 -1
- package/lib/locker.store.js +0 -27
- package/lib/locker.store.js.map +0 -1
- package/lib/mocks/message-history-item-mock.d.ts +0 -10
- package/lib/mocks/message-history-item-mock.d.ts.map +0 -1
- package/lib/mocks/message-history-item-mock.js +0 -26
- package/lib/mocks/message-history-item-mock.js.map +0 -1
- package/lib/mocks/message-history-mock.d.ts +0 -9
- package/lib/mocks/message-history-mock.d.ts.map +0 -1
- package/lib/mocks/message-history-mock.js +0 -24
- package/lib/mocks/message-history-mock.js.map +0 -1
- package/lib/mocks/postboy-service-mock.d.ts +0 -22
- package/lib/mocks/postboy-service-mock.d.ts.map +0 -1
- package/lib/mocks/postboy-service-mock.js +0 -51
- package/lib/mocks/postboy-service-mock.js.map +0 -1
- package/lib/models/dictionary.d.ts +0 -18
- package/lib/models/dictionary.d.ts.map +0 -1
- package/lib/models/dictionary.js +0 -59
- package/lib/models/dictionary.js.map +0 -1
- package/lib/models/id-generator.d.ts +0 -4
- package/lib/models/id-generator.d.ts.map +0 -1
- package/lib/models/id-generator.js +0 -14
- package/lib/models/id-generator.js.map +0 -1
- package/lib/models/postboy-bbb.d.ts +0 -4
- package/lib/models/postboy-bbb.d.ts.map +0 -1
- package/lib/models/postboy-bbb.js.map +0 -1
- package/lib/models/postboy.locker.d.ts +0 -6
- package/lib/models/postboy.locker.d.ts.map +0 -1
- package/lib/models/postboy.locker.js +0 -3
- package/lib/models/postboy.locker.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,81 +1,40 @@
|
|
|
1
|
-
|
|
1
|
+
# Introduction
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 1.1. About the Library
|
|
4
|
+
Modern web development often feels like a survival race: components are scattered across dependency trees, services communicate through layers of abstraction, and events multiply like rabbits in the Australian outback. In this chaos, managing communication isn’t just a task—it’s an art of balancing flexibility and order.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
**Postboy** was born from this chaos. It’s not just another RxJS-based Event Bus—it’s an attempt to bridge the gap between the power of reactive programming and everyday simplicity. Over years of working with Angular, I’ve watched standard event-handling approaches drown in boilerplate code, while complex state managers morphed into impenetrable "black boxes." Postboy is my answer to these challenges.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
**Key Features:**
|
|
9
|
+
- Lightweight architecture with zero hidden dependencies.
|
|
10
|
+
- Flexible messaging system backed by TypeScript typing.
|
|
11
|
+
- Middleware for intercepting and transforming events (logging, validation, metrics).
|
|
12
|
+
- Async operations and callback management tools.
|
|
13
|
+
- Reactive patterns out of the box: ReplaySubject, BehaviorSubject, and more.
|
|
8
14
|
|
|
9
|
-
|
|
15
|
+
Postboy doesn’t aim to replace NgRx or Akita—it solves a narrower set of problems but does so with minimal entry barriers.
|
|
10
16
|
|
|
11
|
-
|
|
12
|
-
Enables creating event-based applications with minimal overhead and explicit subscription management. This is especially useful for large-scale applications where data delivery and reaction to events play a critical role.
|
|
17
|
+
---
|
|
13
18
|
|
|
14
|
-
2.
|
|
15
|
-
|
|
19
|
+
## 1.2. Core Concepts
|
|
20
|
+
Imagine Postboy as your app’s postal service. Here’s how it works:
|
|
16
21
|
|
|
17
|
-
|
|
18
|
-
|
|
22
|
+
- **Messages (PostboyMessage)**
|
|
23
|
+
These are data envelopes. Every message has a unique `ID` and can carry anything: a simple notification, a complex DTO, or even a `UserLoggedInEvent` or `DataFetchRequest`.
|
|
19
24
|
|
|
20
|
-
|
|
21
|
-
|
|
25
|
+
- **Subscriptions**
|
|
26
|
+
Like subscribing to a magazine. Components register interest in specific message types and react when they "arrive in the mailbox."
|
|
22
27
|
|
|
23
|
-
|
|
24
|
-
|
|
28
|
+
- **Handlers (Executors)**
|
|
29
|
+
Special agents that execute synchronous tasks on demand. Need to fetch data from a store or validate permissions? An Executor handles it without event spaghetti.
|
|
25
30
|
|
|
26
|
-
|
|
31
|
+
- **Middleware**
|
|
32
|
+
Customs officers inspecting every message at the border. Need to add auth headers or log errors? Middleware centralizes these tasks.
|
|
27
33
|
|
|
28
|
-
|
|
34
|
+
- **Registrators**
|
|
35
|
+
Archivists managing subscription lifecycles. They prevent memory leaks and keep your codebase tidy.
|
|
29
36
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
Suppose we such a simple structure in an Angular application:
|
|
33
|
-
|
|
34
|
-
<img src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI2MDAiIGhlaWdodD0iNDAwIiBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjogdHJhbnNwYXJlbnQ7IGZvbnQtZmFtaWx5OiBBcmlhbCwgc2Fucy1zZXJpZjsgZm9udC1zaXplOiAxNHB4OyI+DQogIDwhLS0gRmlyc3QgTGV2ZWwgQ29tcG9uZW50IC0tPg0KICA8cmVjdCB4PSIyMzAiIHk9IjIwIiB3aWR0aD0iMTQwIiBoZWlnaHQ9IjUwIiBmaWxsPSIjYzhlNmM5IiBzdHJva2U9IiMyZTdkMzIiIHN0cm9rZS13aWR0aD0iMiIgcng9IjYiPjwvcmVjdD4NCiAgPHRleHQgeD0iMzAwIiB5PSI1MCIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZmlsbD0iIzJlN2QzMiI+QXBwQ29tcG9uZW50PC90ZXh0Pg0KDQogIDwhLS0gU2Vjb25kIExldmVsIENvbXBvbmVudHMgLS0+DQogIDxyZWN0IHg9IjEzMCIgeT0iMTIwIiB3aWR0aD0iMTQwIiBoZWlnaHQ9IjUwIiBmaWxsPSIjZmZlY2IzIiBzdHJva2U9IiNmNTdjMDAiIHN0cm9rZS13aWR0aD0iMiIgcng9IjYiPjwvcmVjdD4NCiAgPHRleHQgeD0iMjAwIiB5PSIxNTAiIHRleHQtYW5jaG9yPSJtaWRkbGUiIGZpbGw9IiNmNTdjMDAiPlBhcmVudCBBPC90ZXh0Pg0KDQogIDxyZWN0IHg9IjMzMCIgeT0iMTIwIiB3aWR0aD0iMTQwIiBoZWlnaHQ9IjUwIiBmaWxsPSIjZmZlY2IzIiBzdHJva2U9IiNmNTdjMDAiIHN0cm9rZS13aWR0aD0iMiIgcng9IjYiPjwvcmVjdD4NCiAgPHRleHQgeD0iNDAwIiB5PSIxNTAiIHRleHQtYW5jaG9yPSJtaWRkbGUiIGZpbGw9IiNmNTdjMDAiPlBhcmVudCBCPC90ZXh0Pg0KDQogIDwhLS0gVGhpcmQgTGV2ZWwgQ29tcG9uZW50cyAtLT4NCiAgPHJlY3QgeD0iNzAiIHk9IjI0MCIgd2lkdGg9IjE0MCIgaGVpZ2h0PSI1MCIgZmlsbD0iI2UzZjJmZCIgc3Ryb2tlPSIjMDA3YWNjIiBzdHJva2Utd2lkdGg9IjIiIHJ4PSI2Ij48L3JlY3Q+DQogIDx0ZXh0IHg9IjE0MCIgeT0iMjcwIiB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBmaWxsPSIjMDA3YWNjIj5DaGlsZCBBPC90ZXh0Pg0KDQogIDxyZWN0IHg9IjIzMCIgeT0iMjQwIiB3aWR0aD0iMTQwIiBoZWlnaHQ9IjUwIiBmaWxsPSIjZTNmMmZkIiBzdHJva2U9IiMwMDdhY2MiIHN0cm9rZS13aWR0aD0iMiIgcng9IjYiPjwvcmVjdD4NCiAgPHRleHQgeD0iMzAwIiB5PSIyNzAiIHRleHQtYW5jaG9yPSJtaWRkbGUiIGZpbGw9IiMwMDdhY2MiPi4uLjwvdGV4dD4NCg0KICA8cmVjdCB4PSIzOTAiIHk9IjI0MCIgd2lkdGg9IjE0MCIgaGVpZ2h0PSI1MCIgZmlsbD0iI2UzZjJmZCIgc3Ryb2tlPSIjMDA3YWNjIiBzdHJva2Utd2lkdGg9IjIiIHJ4PSI2Ij48L3JlY3Q+DQogIDx0ZXh0IHg9IjQ2MCIgeT0iMjcwIiB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBmaWxsPSIjMDA3YWNjIj5DaGlsZCBCPC90ZXh0Pg0KDQogIDwhLS0gTGluZXMgQ29ubmVjdGluZyBDb21wb25lbnRzIC0tPg0KICA8IS0tIEZyb20gQXBwQ29tcG9uZW50IHRvIFNlY29uZCBMZXZlbCAtLT4NCiAgPGxpbmUgeDE9IjMwMCIgeTE9IjcwIiB4Mj0iMjAwIiB5Mj0iMTIwIiBzdHJva2U9IiM2MDYwNjAiIHN0cm9rZS13aWR0aD0iMiIgbWFya2VyLWVuZD0idXJsKCNhcnJvd2hlYWQpIj48L2xpbmU+DQogIDxsaW5lIHgxPSIzMDAiIHkxPSI3MCIgeDI9IjQwMCIgeTI9IjEyMCIgc3Ryb2tlPSIjNjA2MDYwIiBzdHJva2Utd2lkdGg9IjIiIG1hcmtlci1lbmQ9InVybCgjYXJyb3doZWFkKSI+PC9saW5lPg0KDQogIDwhLS0gRnJvbSBTZWNvbmQgTGV2ZWwgdG8gVGhpcmQgTGV2ZWwgLS0+DQogIDxsaW5lIHgxPSIyMDAiIHkxPSIxNzAiIHgyPSIxNDAiIHkyPSIyNDAiIHN0cm9rZT0iIzYwNjA2MCIgc3Ryb2tlLXdpZHRoPSIyIiBtYXJrZXItZW5kPSJ1cmwoI2Fycm93aGVhZCkiPjwvbGluZT4NCiAgPGxpbmUgeDE9IjQwMCIgeTE9IjE3MCIgeDI9IjQ2MCIgeTI9IjI0MCIgc3Ryb2tlPSIjNjA2MDYwIiBzdHJva2Utd2lkdGg9IjIiIG1hcmtlci1lbmQ9InVybCgjYXJyb3doZWFkKSI+PC9saW5lPg0KDQogIDwhLS0gQXJyb3doZWFkIG1hcmtlciAtLT4NCiAgPGRlZnM+DQogICAgPG1hcmtlciBpZD0iYXJyb3doZWFkIiBtYXJrZXJXaWR0aD0iMTAiIG1hcmtlckhlaWdodD0iNyIgcmVmWD0iMTAiIHJlZlk9IjMuNSIgb3JpZW50PSJhdXRvIj4NCiAgICAgIDxwb2x5Z29uIHBvaW50cz0iMCAwLCAxMCAzLjUsIDAgNyIgZmlsbD0iIzYwNjA2MCI+PC9wb2x5Z29uPg0KICAgIDwvbWFya2VyPg0KICA8L2RlZnM+DQo8L3N2Zz4NCg==">
|
|
35
|
-
|
|
36
|
-
**Child B** contains a text input and **Child A** have show the value of the input.
|
|
37
|
-
|
|
38
|
-
In a common case, we would create a specific service with an observable; but it alse means that we have to get an instance of the service in **Child A** and **Child B** and the service itself looks pretty bad - it is just a wrapper over the observable.
|
|
39
|
-
|
|
40
|
-
*I don't event want to describe the idea of sending information through the parents - it is much more painful and dirty.
|
|
41
|
-
|
|
42
|
-
### The postboy approach
|
|
43
|
-
|
|
44
|
-
```typescript
|
|
45
|
-
import {PostboyService} from '@artstesh/postboy';
|
|
46
|
-
|
|
47
|
-
public class ChildA {
|
|
48
|
-
constructor(private postboy: PostboyService) {
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
public ngOnInit(){
|
|
52
|
-
this.postboy.sub(UserInputEvent).subscribe(ev => {
|
|
53
|
-
console.log(ev.text);
|
|
54
|
-
})
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
public class ChildB {
|
|
59
|
-
constructor(private postboy: PostboyService) {
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
public onInput(){
|
|
63
|
-
this.postboy.fire(new UserInputEvent(this.text));
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
### Key Benefits of This Approach
|
|
69
|
-
|
|
70
|
-
- Clear separation of event generation and event handling.
|
|
71
|
-
- TypeScript interfaces ensure strict typing for the data passed between different parts of the application.
|
|
72
|
-
- The members of the system know nothing about each other
|
|
73
|
-
- No need to create specific mediators
|
|
74
|
-
|
|
75
|
-
## Advantages of the Library
|
|
76
|
-
|
|
77
|
-
- **Simplicity:** Clear structure for managing events and their processing.
|
|
78
|
-
- **Safety:** TypeScript ensures type-safety, minimizing potential errors.
|
|
79
|
-
- **Flexibility:** `rxjs` integration allows advanced event processing, such as filtering, pre-processing, and combining event streams.
|
|
80
|
-
- **Scalability:** Code becomes clean and easy to extend without introducing unnecessary complexity.
|
|
37
|
+
---
|
|
81
38
|
|
|
39
|
+
### Why Does It Work?
|
|
40
|
+
Over the past five years, I’ve built dozens of enterprise apps. One recurring issue? Logic fragmentation. Components communicate via `@Output()` chains and services until a single button change breaks three screens. Postboy offers an alternative: a centralized yet unobtrusive event bus that doesn’t demand architectural overhauls.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export interface IPostboyDependingService {
|
|
2
|
-
up(): void;
|
|
3
|
-
}
|
|
1
|
+
export interface IPostboyDependingService {
|
|
2
|
+
up(): void;
|
|
3
|
+
}
|
|
4
4
|
//# sourceMappingURL=i-postboy-depending.service.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=i-postboy-depending.service.js.map
|
package/lib/index.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
export * from './postboy.service';
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './postboy-
|
|
5
|
-
export * from './models/postboy-
|
|
6
|
-
export * from './models/postboy-
|
|
7
|
-
export * from './models/postboy
|
|
8
|
-
export * from './models/postboy-
|
|
9
|
-
export * from './models/postboy
|
|
10
|
-
export * from './models/message-queue.model';
|
|
1
|
+
export * from './postboy.service';
|
|
2
|
+
export * from './i-postboy-depending.service';
|
|
3
|
+
export * from './postboy-abstract.registrator';
|
|
4
|
+
export * from './models/postboy-generic-message';
|
|
5
|
+
export * from './models/postboy-callback.message';
|
|
6
|
+
export * from './models/postboy-execution.handler';
|
|
7
|
+
export * from './models/postboy-executor';
|
|
8
|
+
export * from './models/postboy-middleware';
|
|
9
|
+
export * from './models/postboy.message';
|
|
11
10
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,mBAAmB,CAAC;AAClC,cAAc
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,mBAAmB,CAAC;AAClC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -1,30 +1,29 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Public API Surface of postboy
|
|
4
|
-
*/
|
|
5
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
-
}
|
|
11
|
-
Object.defineProperty(o, k2, desc);
|
|
12
|
-
}) : (function(o, m, k, k2) {
|
|
13
|
-
if (k2 === undefined) k2 = k;
|
|
14
|
-
o[k2] = m[k];
|
|
15
|
-
}));
|
|
16
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
17
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
18
|
-
};
|
|
19
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
__exportStar(require("./postboy.service"), exports);
|
|
21
|
-
__exportStar(require("./
|
|
22
|
-
__exportStar(require("./
|
|
23
|
-
__exportStar(require("./postboy-
|
|
24
|
-
__exportStar(require("./models/postboy-
|
|
25
|
-
__exportStar(require("./models/postboy-
|
|
26
|
-
__exportStar(require("./models/postboy
|
|
27
|
-
__exportStar(require("./models/postboy-
|
|
28
|
-
__exportStar(require("./models/postboy
|
|
29
|
-
__exportStar(require("./models/message-queue.model"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Public API Surface of postboy
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
17
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
__exportStar(require("./postboy.service"), exports);
|
|
21
|
+
__exportStar(require("./i-postboy-depending.service"), exports);
|
|
22
|
+
__exportStar(require("./postboy-abstract.registrator"), exports);
|
|
23
|
+
__exportStar(require("./models/postboy-generic-message"), exports);
|
|
24
|
+
__exportStar(require("./models/postboy-callback.message"), exports);
|
|
25
|
+
__exportStar(require("./models/postboy-execution.handler"), exports);
|
|
26
|
+
__exportStar(require("./models/postboy-executor"), exports);
|
|
27
|
+
__exportStar(require("./models/postboy-middleware"), exports);
|
|
28
|
+
__exportStar(require("./models/postboy.message"), exports);
|
|
30
29
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;AAEH,oDAAkC;AAClC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;AAEH,oDAAkC;AAClC,gEAA8C;AAC9C,iEAA+C;AAC/C,mEAAiD;AACjD,oEAAkD;AAClD,qEAAmD;AACnD,4DAA0C;AAC1C,8DAA4C;AAC5C,2DAAyC"}
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { PostboyCallbackMessage } from './postboy-callback.message';
|
|
2
|
-
export declare class MessageQueue<D> {
|
|
3
|
-
private cache;
|
|
4
|
-
/**
|
|
5
|
-
* Gets the current data stored in the instance.
|
|
6
|
-
*
|
|
7
|
-
* @return {D | null} The current data or null if no data is set.
|
|
8
|
-
*/
|
|
9
|
-
get data(): D | null;
|
|
10
|
-
private queries;
|
|
11
|
-
private _requestInProgress;
|
|
12
|
-
private _data;
|
|
13
|
-
constructor(cache?: boolean);
|
|
14
|
-
/**
|
|
15
|
-
* Resets the state of the instance by clearing stored data.
|
|
16
|
-
* This method sets the internal data to null, effectively resetting the object.
|
|
17
|
-
*
|
|
18
|
-
* @return {void} Does not return a value.
|
|
19
|
-
*/
|
|
20
|
-
reset(): MessageQueue<D>;
|
|
21
|
-
/**
|
|
22
|
-
* Attempts to finalize the provided query. It either queues the query for later processing
|
|
23
|
-
* if a request is in progress or data is missing, or completes the query immediately.
|
|
24
|
-
*
|
|
25
|
-
* @param {PostboyCallbackMessage<D>} query - The callback message to be finalized.
|
|
26
|
-
* @return {boolean} - Returns true if the query was successfully finalized, otherwise false.
|
|
27
|
-
*/
|
|
28
|
-
tryFinish(query: PostboyCallbackMessage<D>): boolean;
|
|
29
|
-
/**
|
|
30
|
-
* Adds a new query to the query queue.
|
|
31
|
-
*
|
|
32
|
-
* @param {PostboyCallbackMessage<D>} query - The query to be added to the queue.
|
|
33
|
-
* @return {MessageQueue<D>} The updated QueryQueue instance.
|
|
34
|
-
*/
|
|
35
|
-
add(query: PostboyCallbackMessage<D>): MessageQueue<D>;
|
|
36
|
-
/**
|
|
37
|
-
* Marks the operation as finished by updating the internal state and handling each query.
|
|
38
|
-
*
|
|
39
|
-
* @param {D} data - The data to be set for the current operation.
|
|
40
|
-
* @return {void} This method does not return a value.
|
|
41
|
-
*/
|
|
42
|
-
finish(data: D): void;
|
|
43
|
-
}
|
|
1
|
+
import { PostboyCallbackMessage } from './postboy-callback.message';
|
|
2
|
+
export declare class MessageQueue<D> {
|
|
3
|
+
private cache;
|
|
4
|
+
/**
|
|
5
|
+
* Gets the current data stored in the instance.
|
|
6
|
+
*
|
|
7
|
+
* @return {D | null} The current data or null if no data is set.
|
|
8
|
+
*/
|
|
9
|
+
get data(): D | null;
|
|
10
|
+
private queries;
|
|
11
|
+
private _requestInProgress;
|
|
12
|
+
private _data;
|
|
13
|
+
constructor(cache?: boolean);
|
|
14
|
+
/**
|
|
15
|
+
* Resets the state of the instance by clearing stored data.
|
|
16
|
+
* This method sets the internal data to null, effectively resetting the object.
|
|
17
|
+
*
|
|
18
|
+
* @return {void} Does not return a value.
|
|
19
|
+
*/
|
|
20
|
+
reset(): MessageQueue<D>;
|
|
21
|
+
/**
|
|
22
|
+
* Attempts to finalize the provided query. It either queues the query for later processing
|
|
23
|
+
* if a request is in progress or data is missing, or completes the query immediately.
|
|
24
|
+
*
|
|
25
|
+
* @param {PostboyCallbackMessage<D>} query - The callback message to be finalized.
|
|
26
|
+
* @return {boolean} - Returns true if the query was successfully finalized, otherwise false.
|
|
27
|
+
*/
|
|
28
|
+
tryFinish(query: PostboyCallbackMessage<D>): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Adds a new query to the query queue.
|
|
31
|
+
*
|
|
32
|
+
* @param {PostboyCallbackMessage<D>} query - The query to be added to the queue.
|
|
33
|
+
* @return {MessageQueue<D>} The updated QueryQueue instance.
|
|
34
|
+
*/
|
|
35
|
+
add(query: PostboyCallbackMessage<D>): MessageQueue<D>;
|
|
36
|
+
/**
|
|
37
|
+
* Marks the operation as finished by updating the internal state and handling each query.
|
|
38
|
+
*
|
|
39
|
+
* @param {D} data - The data to be set for the current operation.
|
|
40
|
+
* @return {void} This method does not return a value.
|
|
41
|
+
*/
|
|
42
|
+
finish(data: D): void;
|
|
43
|
+
}
|
|
44
44
|
//# sourceMappingURL=message-queue.model.d.ts.map
|
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MessageQueue = void 0;
|
|
4
|
-
const
|
|
5
|
-
class MessageQueue {
|
|
6
|
-
/**
|
|
7
|
-
* Gets the current data stored in the instance.
|
|
8
|
-
*
|
|
9
|
-
* @return {D | null} The current data or null if no data is set.
|
|
10
|
-
*/
|
|
11
|
-
get data() {
|
|
12
|
-
return this._data;
|
|
13
|
-
}
|
|
14
|
-
constructor(cache = true) {
|
|
15
|
-
this.cache = cache;
|
|
16
|
-
this.queries = new
|
|
17
|
-
this._requestInProgress = true;
|
|
18
|
-
this._data = null;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Resets the state of the instance by clearing stored data.
|
|
22
|
-
* This method sets the internal data to null, effectively resetting the object.
|
|
23
|
-
*
|
|
24
|
-
* @return {void} Does not return a value.
|
|
25
|
-
*/
|
|
26
|
-
reset() {
|
|
27
|
-
this._data = null;
|
|
28
|
-
return this;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Attempts to finalize the provided query. It either queues the query for later processing
|
|
32
|
-
* if a request is in progress or data is missing, or completes the query immediately.
|
|
33
|
-
*
|
|
34
|
-
* @param {PostboyCallbackMessage<D>} query - The callback message to be finalized.
|
|
35
|
-
* @return {boolean} - Returns true if the query was successfully finalized, otherwise false.
|
|
36
|
-
*/
|
|
37
|
-
tryFinish(query) {
|
|
38
|
-
if (this._requestInProgress || this._data === null)
|
|
39
|
-
return this.queries.put(query) && false;
|
|
40
|
-
query.finish(this._data);
|
|
41
|
-
return true;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Adds a new query to the query queue.
|
|
45
|
-
*
|
|
46
|
-
* @param {PostboyCallbackMessage<D>} query - The query to be added to the queue.
|
|
47
|
-
* @return {MessageQueue<D>} The updated QueryQueue instance.
|
|
48
|
-
*/
|
|
49
|
-
add(query) {
|
|
50
|
-
return this.queries.put(query) && this;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Marks the operation as finished by updating the internal state and handling each query.
|
|
54
|
-
*
|
|
55
|
-
* @param {D} data - The data to be set for the current operation.
|
|
56
|
-
* @return {void} This method does not return a value.
|
|
57
|
-
*/
|
|
58
|
-
finish(data) {
|
|
59
|
-
if (this.cache)
|
|
60
|
-
this._data = data;
|
|
61
|
-
this._requestInProgress = false;
|
|
62
|
-
this.queries.each((q) => q.finish(data));
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
exports.MessageQueue = MessageQueue;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MessageQueue = void 0;
|
|
4
|
+
const queue_1 = require("./queue");
|
|
5
|
+
class MessageQueue {
|
|
6
|
+
/**
|
|
7
|
+
* Gets the current data stored in the instance.
|
|
8
|
+
*
|
|
9
|
+
* @return {D | null} The current data or null if no data is set.
|
|
10
|
+
*/
|
|
11
|
+
get data() {
|
|
12
|
+
return this._data;
|
|
13
|
+
}
|
|
14
|
+
constructor(cache = true) {
|
|
15
|
+
this.cache = cache;
|
|
16
|
+
this.queries = new queue_1.Queue();
|
|
17
|
+
this._requestInProgress = true;
|
|
18
|
+
this._data = null;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Resets the state of the instance by clearing stored data.
|
|
22
|
+
* This method sets the internal data to null, effectively resetting the object.
|
|
23
|
+
*
|
|
24
|
+
* @return {void} Does not return a value.
|
|
25
|
+
*/
|
|
26
|
+
reset() {
|
|
27
|
+
this._data = null;
|
|
28
|
+
return this;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Attempts to finalize the provided query. It either queues the query for later processing
|
|
32
|
+
* if a request is in progress or data is missing, or completes the query immediately.
|
|
33
|
+
*
|
|
34
|
+
* @param {PostboyCallbackMessage<D>} query - The callback message to be finalized.
|
|
35
|
+
* @return {boolean} - Returns true if the query was successfully finalized, otherwise false.
|
|
36
|
+
*/
|
|
37
|
+
tryFinish(query) {
|
|
38
|
+
if (this._requestInProgress || this._data === null)
|
|
39
|
+
return this.queries.put(query) && false;
|
|
40
|
+
query.finish(this._data);
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Adds a new query to the query queue.
|
|
45
|
+
*
|
|
46
|
+
* @param {PostboyCallbackMessage<D>} query - The query to be added to the queue.
|
|
47
|
+
* @return {MessageQueue<D>} The updated QueryQueue instance.
|
|
48
|
+
*/
|
|
49
|
+
add(query) {
|
|
50
|
+
return this.queries.put(query) && this;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Marks the operation as finished by updating the internal state and handling each query.
|
|
54
|
+
*
|
|
55
|
+
* @param {D} data - The data to be set for the current operation.
|
|
56
|
+
* @return {void} This method does not return a value.
|
|
57
|
+
*/
|
|
58
|
+
finish(data) {
|
|
59
|
+
if (this.cache)
|
|
60
|
+
this._data = data;
|
|
61
|
+
this._requestInProgress = false;
|
|
62
|
+
this.queries.each((q) => q.finish(data));
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.MessageQueue = MessageQueue;
|
|
66
66
|
//# sourceMappingURL=message-queue.model.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-queue.model.js","sourceRoot":"","sources":["../../src/models/message-queue.model.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"message-queue.model.js","sourceRoot":"","sources":["../../src/models/message-queue.model.ts"],"names":[],"mappings":";;;AACA,mCAA8B;AAE9B,MAAa,YAAY;IACvB;;;;OAIG;IACH,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAMD,YAAoB,QAAiB,IAAI;QAArB,UAAK,GAAL,KAAK,CAAgB;QAJjC,YAAO,GAAqC,IAAI,aAAK,EAA6B,CAAC;QACnF,uBAAkB,GAAY,IAAI,CAAC;QACnC,UAAK,GAAa,IAAI,CAAC;IAEa,CAAC;IAE7C;;;;;OAKG;IACI,KAAK;QACV,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;OAMG;IACI,SAAS,CAAC,KAAgC;QAC/C,IAAI,IAAI,CAAC,kBAAkB,IAAI,IAAI,CAAC,KAAK,KAAK,IAAI;YAAE,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC;QAC5F,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACzB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;OAKG;IACI,GAAG,CAAC,KAAgC;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC;IACzC,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,IAAO;QACnB,IAAI,IAAI,CAAC,KAAK;YAAE,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClC,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC;QAChC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IAC3C,CAAC;CACF;AA7DD,oCA6DC"}
|
|
@@ -1,9 +1,27 @@
|
|
|
1
|
-
import { Observable, Subject } from 'rxjs';
|
|
2
|
-
import { PostboyGenericMessage } from './postboy-generic-message';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { Observable, Subject } from 'rxjs';
|
|
2
|
+
import { PostboyGenericMessage } from './postboy-generic-message';
|
|
3
|
+
/**
|
|
4
|
+
* An abstract class extending PostboyGenericMessage that provides mechanisms for managing
|
|
5
|
+
* asynchronous data communication using RxJS observables. It is designed to work with
|
|
6
|
+
* callback-based operations that emit a result of type T.
|
|
7
|
+
*
|
|
8
|
+
* @template T - The type of the data emitted by the observables in this class.
|
|
9
|
+
*
|
|
10
|
+
* @extends PostboyGenericMessage
|
|
11
|
+
*
|
|
12
|
+
* @property {Observable<T>} result - An observable that emits the result of the operation
|
|
13
|
+
* and completes once the operation is finished.
|
|
14
|
+
*
|
|
15
|
+
* @method next - Emits the next value for the result observable.
|
|
16
|
+
* @param {T} value - The value to be emitted by the result observable.
|
|
17
|
+
*
|
|
18
|
+
* @method finish - Emits the final value for the result observable and completes it.
|
|
19
|
+
* @param {T} value - The final value for the observable emission.
|
|
20
|
+
*/
|
|
21
|
+
export declare abstract class PostboyCallbackMessage<T> extends PostboyGenericMessage {
|
|
22
|
+
protected result$: Subject<T>;
|
|
23
|
+
result: Observable<T>;
|
|
24
|
+
next: (value: T) => void;
|
|
25
|
+
finish(value: T): void;
|
|
26
|
+
}
|
|
9
27
|
//# sourceMappingURL=postboy-callback.message.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postboy-callback.message.d.ts","sourceRoot":"","sources":["../../src/models/postboy-callback.message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAElE,8BAAsB,sBAAsB,CAAC,CAAC,CAAE,SAAQ,qBAAqB;IAC3E,SAAS,CAAC,OAAO,aAAoB;IAC9B,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,CAA+B;IAEpD,IAAI,UAAW,CAAC,KAAG,IAAI,CAA6B;IAEpD,MAAM,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI;CAI9B"}
|
|
1
|
+
{"version":3,"file":"postboy-callback.message.d.ts","sourceRoot":"","sources":["../../src/models/postboy-callback.message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAElE;;;;;;;;;;;;;;;;;GAiBG;AACH,8BAAsB,sBAAsB,CAAC,CAAC,CAAE,SAAQ,qBAAqB;IAC3E,SAAS,CAAC,OAAO,aAAoB;IAC9B,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,CAA+B;IAEpD,IAAI,UAAW,CAAC,KAAG,IAAI,CAA6B;IAEpD,MAAM,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI;CAI9B"}
|
|
@@ -1,19 +1,37 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PostboyCallbackMessage = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const postboy_generic_message_1 = require("./postboy-generic-message");
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PostboyCallbackMessage = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const postboy_generic_message_1 = require("./postboy-generic-message");
|
|
6
|
+
/**
|
|
7
|
+
* An abstract class extending PostboyGenericMessage that provides mechanisms for managing
|
|
8
|
+
* asynchronous data communication using RxJS observables. It is designed to work with
|
|
9
|
+
* callback-based operations that emit a result of type T.
|
|
10
|
+
*
|
|
11
|
+
* @template T - The type of the data emitted by the observables in this class.
|
|
12
|
+
*
|
|
13
|
+
* @extends PostboyGenericMessage
|
|
14
|
+
*
|
|
15
|
+
* @property {Observable<T>} result - An observable that emits the result of the operation
|
|
16
|
+
* and completes once the operation is finished.
|
|
17
|
+
*
|
|
18
|
+
* @method next - Emits the next value for the result observable.
|
|
19
|
+
* @param {T} value - The value to be emitted by the result observable.
|
|
20
|
+
*
|
|
21
|
+
* @method finish - Emits the final value for the result observable and completes it.
|
|
22
|
+
* @param {T} value - The final value for the observable emission.
|
|
23
|
+
*/
|
|
24
|
+
class PostboyCallbackMessage extends postboy_generic_message_1.PostboyGenericMessage {
|
|
25
|
+
constructor() {
|
|
26
|
+
super(...arguments);
|
|
27
|
+
this.result$ = new rxjs_1.Subject();
|
|
28
|
+
this.result = this.result$.asObservable();
|
|
29
|
+
this.next = (value) => this.result$.next(value);
|
|
30
|
+
}
|
|
31
|
+
finish(value) {
|
|
32
|
+
this.result$.next(value);
|
|
33
|
+
this.result$.complete();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.PostboyCallbackMessage = PostboyCallbackMessage;
|
|
19
37
|
//# sourceMappingURL=postboy-callback.message.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postboy-callback.message.js","sourceRoot":"","sources":["../../src/models/postboy-callback.message.ts"],"names":[],"mappings":";;;AAAA,+BAA2C;AAC3C,uEAAkE;AAElE,MAAsB,sBAA0B,SAAQ,+CAAqB;IAA7E;;QACY,YAAO,GAAG,IAAI,cAAO,EAAK,CAAC;QAC9B,WAAM,GAAkB,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;QAEpD,SAAI,GAAG,CAAC,KAAQ,EAAQ,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAM7D,CAAC;IAJQ,MAAM,CAAC,KAAQ;QACpB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACzB,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;IAC1B,CAAC;CACF;AAVD,wDAUC"}
|
|
1
|
+
{"version":3,"file":"postboy-callback.message.js","sourceRoot":"","sources":["../../src/models/postboy-callback.message.ts"],"names":[],"mappings":";;;AAAA,+BAA2C;AAC3C,uEAAkE;AAElE;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAsB,sBAA0B,SAAQ,+CAAqB;IAA7E;;QACY,YAAO,GAAG,IAAI,cAAO,EAAK,CAAC;QAC9B,WAAM,GAAkB,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;QAEpD,SAAI,GAAG,CAAC,KAAQ,EAAQ,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAM7D,CAAC;IAJQ,MAAM,CAAC,KAAQ;QACpB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACzB,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;IAC1B,CAAC;CACF;AAVD,wDAUC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { PostboyExecutor } from './postboy-executor';
|
|
2
|
-
/**
|
|
3
|
-
* Abstract class representing a handler for executing a Postboy task.
|
|
4
|
-
*
|
|
5
|
-
* This class is intended to manage the execution flow of a PostboyExecutor instance.
|
|
6
|
-
* Subclasses must implement the `handle` method, which executes a given PostboyExecutor
|
|
7
|
-
* and returns a result of type R.
|
|
8
|
-
*
|
|
9
|
-
* @template R The type of the result returned by the `handle` method.
|
|
10
|
-
* @template E The type of the executor extending the PostboyExecutor.
|
|
11
|
-
*/
|
|
12
|
-
export declare abstract class PostboyExecutionHandler<R, E extends PostboyExecutor<R>> {
|
|
13
|
-
abstract handle(executor: E): R;
|
|
14
|
-
}
|
|
1
|
+
import { PostboyExecutor } from './postboy-executor';
|
|
2
|
+
/**
|
|
3
|
+
* Abstract class representing a handler for executing a Postboy task.
|
|
4
|
+
*
|
|
5
|
+
* This class is intended to manage the execution flow of a PostboyExecutor instance.
|
|
6
|
+
* Subclasses must implement the `handle` method, which executes a given PostboyExecutor
|
|
7
|
+
* and returns a result of type R.
|
|
8
|
+
*
|
|
9
|
+
* @template R The type of the result returned by the `handle` method.
|
|
10
|
+
* @template E The type of the executor extending the PostboyExecutor.
|
|
11
|
+
*/
|
|
12
|
+
export declare abstract class PostboyExecutionHandler<R, E extends PostboyExecutor<R>> {
|
|
13
|
+
abstract handle(executor: E): R;
|
|
14
|
+
}
|
|
15
15
|
//# sourceMappingURL=postboy-execution.handler.d.ts.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PostboyExecutionHandler = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Abstract class representing a handler for executing a Postboy task.
|
|
6
|
-
*
|
|
7
|
-
* This class is intended to manage the execution flow of a PostboyExecutor instance.
|
|
8
|
-
* Subclasses must implement the `handle` method, which executes a given PostboyExecutor
|
|
9
|
-
* and returns a result of type R.
|
|
10
|
-
*
|
|
11
|
-
* @template R The type of the result returned by the `handle` method.
|
|
12
|
-
* @template E The type of the executor extending the PostboyExecutor.
|
|
13
|
-
*/
|
|
14
|
-
class PostboyExecutionHandler {
|
|
15
|
-
}
|
|
16
|
-
exports.PostboyExecutionHandler = PostboyExecutionHandler;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PostboyExecutionHandler = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Abstract class representing a handler for executing a Postboy task.
|
|
6
|
+
*
|
|
7
|
+
* This class is intended to manage the execution flow of a PostboyExecutor instance.
|
|
8
|
+
* Subclasses must implement the `handle` method, which executes a given PostboyExecutor
|
|
9
|
+
* and returns a result of type R.
|
|
10
|
+
*
|
|
11
|
+
* @template R The type of the result returned by the `handle` method.
|
|
12
|
+
* @template E The type of the executor extending the PostboyExecutor.
|
|
13
|
+
*/
|
|
14
|
+
class PostboyExecutionHandler {
|
|
15
|
+
}
|
|
16
|
+
exports.PostboyExecutionHandler = PostboyExecutionHandler;
|
|
17
17
|
//# sourceMappingURL=postboy-execution.handler.js.map
|