ngx-presentationcommons-esm-network 0.0.2
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
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# NgxPresentationcommonsEsmNetwork
|
|
2
|
+
|
|
3
|
+
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 19.2.0.
|
|
4
|
+
|
|
5
|
+
## Code scaffolding
|
|
6
|
+
|
|
7
|
+
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
ng generate component component-name
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
ng generate --help
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Building
|
|
20
|
+
|
|
21
|
+
To build the library, run:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
ng build ngx-presentationcommons-esm-network
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
|
|
28
|
+
|
|
29
|
+
### Publishing the Library
|
|
30
|
+
|
|
31
|
+
Once the project is built, you can publish your library by following these steps:
|
|
32
|
+
|
|
33
|
+
1. Navigate to the `dist` directory:
|
|
34
|
+
```bash
|
|
35
|
+
cd dist/ngx-presentationcommons-esm-network
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
2. Run the `npm publish` command to publish your library to the npm registry:
|
|
39
|
+
```bash
|
|
40
|
+
npm publish
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Running unit tests
|
|
44
|
+
|
|
45
|
+
To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
ng test
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Running end-to-end tests
|
|
52
|
+
|
|
53
|
+
For end-to-end (e2e) testing, run:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
ng e2e
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
|
|
60
|
+
|
|
61
|
+
## Additional Resources
|
|
62
|
+
|
|
63
|
+
For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, Directive } from '@angular/core';
|
|
3
|
+
import { commonsBase62IsId, commonsTypeIsString, commonsTypeIsBoolean, commonsTypeHasPropertyString, commonsTypeHasPropertyNumber, commonsTypeDecode } from 'tscommons-esm-core';
|
|
4
|
+
import { CommonsNetworkSocketIoService } from 'ngx-httpcommons-esm-network';
|
|
5
|
+
import { CommonsPresentationService, ECommonsPresentationActionSource, isECommonsPresentationMoveMagnitude } from 'ngx-presentationcommons-esm-core';
|
|
6
|
+
|
|
7
|
+
function expireInSeconds(n) {
|
|
8
|
+
const date = new Date();
|
|
9
|
+
date.setTime(date.getTime() + (n * 1000));
|
|
10
|
+
return date;
|
|
11
|
+
}
|
|
12
|
+
class CommonsPresentationNetworkService extends CommonsNetworkSocketIoService {
|
|
13
|
+
ns;
|
|
14
|
+
presentationService = inject(CommonsPresentationService);
|
|
15
|
+
observables = new Map();
|
|
16
|
+
constructor(url,
|
|
17
|
+
// eslint-disable-next-line @angular-eslint/prefer-inject
|
|
18
|
+
ns, channel, deviceId) {
|
|
19
|
+
super(url, false);
|
|
20
|
+
this.ns = ns;
|
|
21
|
+
if (!commonsBase62IsId(channel))
|
|
22
|
+
throw new Error('Invalid channel id. Must be base62id');
|
|
23
|
+
if (!commonsBase62IsId(deviceId))
|
|
24
|
+
throw new Error('Invalid device id. Must be base62id');
|
|
25
|
+
this.channel = channel;
|
|
26
|
+
this.deviceId = deviceId;
|
|
27
|
+
this.addRemote('prev', (source, magnitude) => {
|
|
28
|
+
this.presentationService.prev(magnitude, ECommonsPresentationActionSource.NETWORK, source);
|
|
29
|
+
}, isECommonsPresentationMoveMagnitude);
|
|
30
|
+
this.addRemote('next', (source, magnitude) => {
|
|
31
|
+
this.presentationService.next(magnitude, ECommonsPresentationActionSource.NETWORK, source);
|
|
32
|
+
}, isECommonsPresentationMoveMagnitude);
|
|
33
|
+
this.addRemote('restart', (source) => {
|
|
34
|
+
this.presentationService.restart(ECommonsPresentationActionSource.NETWORK, source);
|
|
35
|
+
}, (_test) => true // ignore
|
|
36
|
+
);
|
|
37
|
+
this.addRemote('jump', (source, page) => {
|
|
38
|
+
this.presentationService.jump(page, ECommonsPresentationActionSource.NETWORK, source);
|
|
39
|
+
}, commonsTypeIsString);
|
|
40
|
+
this.addRemote('end', (source) => {
|
|
41
|
+
this.presentationService.end(ECommonsPresentationActionSource.NETWORK, source);
|
|
42
|
+
}, (_test) => true // ignore
|
|
43
|
+
);
|
|
44
|
+
this.addRemote('blank', (source, state) => {
|
|
45
|
+
this.presentationService.blank(state, ECommonsPresentationActionSource.NETWORK, source);
|
|
46
|
+
}, (test) => {
|
|
47
|
+
if (commonsTypeIsBoolean(test))
|
|
48
|
+
return true;
|
|
49
|
+
if (commonsTypeIsString(test) && test === 'holding')
|
|
50
|
+
return true;
|
|
51
|
+
return false;
|
|
52
|
+
});
|
|
53
|
+
this.addRemote('show-all', (source) => {
|
|
54
|
+
this.presentationService.showAll(ECommonsPresentationActionSource.NETWORK, source);
|
|
55
|
+
}, (_test) => true // ignore
|
|
56
|
+
);
|
|
57
|
+
this.addRemote('trigger', (source, data) => {
|
|
58
|
+
this.presentationService.trigger(data.name, data.data, ECommonsPresentationActionSource.NETWORK, source);
|
|
59
|
+
}, (test) => {
|
|
60
|
+
if (!commonsTypeHasPropertyString(test, 'name'))
|
|
61
|
+
return false;
|
|
62
|
+
// cannot check data
|
|
63
|
+
return true;
|
|
64
|
+
});
|
|
65
|
+
this.addRemote('reached-slide', (source, state) => {
|
|
66
|
+
this.presentationService.reachedSlide(state.page, state.index, ECommonsPresentationActionSource.NETWORK, source);
|
|
67
|
+
}, (test) => {
|
|
68
|
+
if (!commonsTypeHasPropertyString(test, 'page'))
|
|
69
|
+
return false;
|
|
70
|
+
if (!commonsTypeHasPropertyNumber(test, 'index'))
|
|
71
|
+
return false;
|
|
72
|
+
return true;
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
// cascade things like keydowns to the network
|
|
76
|
+
// NB, this needs to be called AFTER any triggers have been added
|
|
77
|
+
setupLoopbackRepeat() {
|
|
78
|
+
this.presentationService.prevObservable
|
|
79
|
+
.subscribe((action) => {
|
|
80
|
+
// prevent infinite cascades
|
|
81
|
+
if (action.source === ECommonsPresentationActionSource.NETWORK && action.sourceId === this.deviceId)
|
|
82
|
+
return;
|
|
83
|
+
void this.prev(action.magnitude);
|
|
84
|
+
});
|
|
85
|
+
this.presentationService.nextObservable
|
|
86
|
+
.subscribe((action) => {
|
|
87
|
+
// prevent infinite cascades
|
|
88
|
+
if (action.source === ECommonsPresentationActionSource.NETWORK && action.sourceId === this.deviceId)
|
|
89
|
+
return;
|
|
90
|
+
void this.next(action.magnitude);
|
|
91
|
+
});
|
|
92
|
+
this.presentationService.restartObservable
|
|
93
|
+
.subscribe((action) => {
|
|
94
|
+
// prevent infinite cascades
|
|
95
|
+
if (action.source === ECommonsPresentationActionSource.NETWORK && action.sourceId === this.deviceId)
|
|
96
|
+
return;
|
|
97
|
+
void this.restart();
|
|
98
|
+
});
|
|
99
|
+
this.presentationService.jumpObservable
|
|
100
|
+
.subscribe((action) => {
|
|
101
|
+
// prevent infinite cascades
|
|
102
|
+
if (action.source === ECommonsPresentationActionSource.NETWORK && action.sourceId === this.deviceId)
|
|
103
|
+
return;
|
|
104
|
+
void this.jump(action.page);
|
|
105
|
+
});
|
|
106
|
+
this.presentationService.endObservable
|
|
107
|
+
.subscribe((action) => {
|
|
108
|
+
// prevent infinite cascades
|
|
109
|
+
if (action.source === ECommonsPresentationActionSource.NETWORK && action.sourceId === this.deviceId)
|
|
110
|
+
return;
|
|
111
|
+
void this.end();
|
|
112
|
+
});
|
|
113
|
+
this.presentationService.blankObservable
|
|
114
|
+
.subscribe((action) => {
|
|
115
|
+
// prevent infinite cascades
|
|
116
|
+
if (action.source === ECommonsPresentationActionSource.NETWORK && action.sourceId === this.deviceId)
|
|
117
|
+
return;
|
|
118
|
+
void this.blank(action.state);
|
|
119
|
+
});
|
|
120
|
+
this.presentationService.showAllObservable
|
|
121
|
+
.subscribe((action) => {
|
|
122
|
+
// prevent infinite cascades
|
|
123
|
+
if (action.source === ECommonsPresentationActionSource.NETWORK && action.sourceId === this.deviceId)
|
|
124
|
+
return;
|
|
125
|
+
void this.showAll();
|
|
126
|
+
});
|
|
127
|
+
for (const name of this.presentationService.triggerNames) {
|
|
128
|
+
this.presentationService.triggerObservable(name)
|
|
129
|
+
.subscribe((action) => {
|
|
130
|
+
// prevent infinite cascades
|
|
131
|
+
if (action.source === ECommonsPresentationActionSource.NETWORK && action.sourceId === this.deviceId)
|
|
132
|
+
return;
|
|
133
|
+
void this.trigger(name, action.data);
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
this.presentationService.reachedSlideObservable
|
|
137
|
+
.subscribe((action) => {
|
|
138
|
+
// prevent infinite cascades
|
|
139
|
+
if (action.source === ECommonsPresentationActionSource.NETWORK && action.sourceId === this.deviceId)
|
|
140
|
+
return;
|
|
141
|
+
void this.reachedSlide(action.page, action.index);
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
addRemote(command, callback, isT) {
|
|
145
|
+
this.observables.set(command, this.receiveObservable
|
|
146
|
+
.subscribe((packet) => {
|
|
147
|
+
if (packet.ns !== this.ns)
|
|
148
|
+
return;
|
|
149
|
+
if (packet.command !== command)
|
|
150
|
+
return;
|
|
151
|
+
if (packet.source === this.deviceId)
|
|
152
|
+
return; // present infinite cascade
|
|
153
|
+
if (packet.data === undefined) {
|
|
154
|
+
console.log('Invalid packet didn\'t contain any data. Cannot continue');
|
|
155
|
+
console.log(packet);
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
const data = commonsTypeDecode(packet.data);
|
|
159
|
+
if (!isT(data)) {
|
|
160
|
+
console.log('Invalid packet data for command. Cannot continue');
|
|
161
|
+
console.log(data);
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
callback(packet.source, data);
|
|
165
|
+
}));
|
|
166
|
+
}
|
|
167
|
+
addRemoteTrigger(name, isT) {
|
|
168
|
+
this.addRemote(`trigger-${name}`, (_source, data) => {
|
|
169
|
+
this.presentationService.trigger(name, data);
|
|
170
|
+
}, isT);
|
|
171
|
+
}
|
|
172
|
+
removeRemoteTrigger(name) {
|
|
173
|
+
if (!this.observables.has(name))
|
|
174
|
+
return false;
|
|
175
|
+
this.observables.get(name).unsubscribe();
|
|
176
|
+
this.observables.delete(name);
|
|
177
|
+
return true;
|
|
178
|
+
}
|
|
179
|
+
async broadcastCommand(command, data) {
|
|
180
|
+
await this.broadcast(this.ns, command, data, expireInSeconds(10), true);
|
|
181
|
+
}
|
|
182
|
+
async prev(magnitude) {
|
|
183
|
+
await this.broadcastCommand('prev', magnitude);
|
|
184
|
+
}
|
|
185
|
+
async next(magnitude) {
|
|
186
|
+
await this.broadcastCommand('next', magnitude);
|
|
187
|
+
}
|
|
188
|
+
async restart() {
|
|
189
|
+
await this.broadcastCommand('restart', true);
|
|
190
|
+
}
|
|
191
|
+
async jump(page) {
|
|
192
|
+
await this.broadcastCommand('jump', page);
|
|
193
|
+
}
|
|
194
|
+
async end() {
|
|
195
|
+
await this.broadcastCommand('end', true);
|
|
196
|
+
}
|
|
197
|
+
async blank(state) {
|
|
198
|
+
await this.broadcastCommand('blank', state);
|
|
199
|
+
}
|
|
200
|
+
async showAll() {
|
|
201
|
+
await this.broadcastCommand('show-all', true);
|
|
202
|
+
}
|
|
203
|
+
async trigger(name, data) {
|
|
204
|
+
await this.broadcastCommand(`trigger-${name}`, data);
|
|
205
|
+
}
|
|
206
|
+
async reachedSlide(page, index) {
|
|
207
|
+
await this.broadcastCommand('reached-slide', {
|
|
208
|
+
page: page,
|
|
209
|
+
index: index
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: CommonsPresentationNetworkService, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive });
|
|
213
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: CommonsPresentationNetworkService, isStandalone: true, usesInheritance: true, ngImport: i0 });
|
|
214
|
+
}
|
|
215
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: CommonsPresentationNetworkService, decorators: [{
|
|
216
|
+
type: Directive
|
|
217
|
+
}], ctorParameters: () => [{ type: undefined }, { type: undefined }, { type: undefined }, { type: undefined }] });
|
|
218
|
+
|
|
219
|
+
/*
|
|
220
|
+
* Public API Surface of ngx-presentationcommons-esm-network
|
|
221
|
+
*/
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Generated bundle index. Do not edit.
|
|
225
|
+
*/
|
|
226
|
+
|
|
227
|
+
export { CommonsPresentationNetworkService };
|
|
228
|
+
//# sourceMappingURL=ngx-presentationcommons-esm-network.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngx-presentationcommons-esm-network.mjs","sources":["../../../projects/ngx-presentationcommons-esm-network/src/lib/services/network.service.ts","../../../projects/ngx-presentationcommons-esm-network/src/public-api.ts","../../../projects/ngx-presentationcommons-esm-network/src/ngx-presentationcommons-esm-network.ts"],"sourcesContent":["import { Directive, inject } from '@angular/core';\n\nimport { Subscription } from 'rxjs';\n\nimport { commonsBase62IsId, commonsTypeDecode, commonsTypeHasPropertyNumber, commonsTypeHasPropertyString, commonsTypeIsBoolean, commonsTypeIsString, TEncoded } from 'tscommons-esm-core';\nimport { ICommonsNetworkPacket } from 'tscommons-esm-network';\n\nimport { CommonsNetworkSocketIoService } from 'ngx-httpcommons-esm-network';\n\nimport {\n\t\tCommonsPresentationService,\n\t\tECommonsPresentationActionSource,\n\t\tECommonsPresentationMoveMagnitude,\n\t\tTCommonsPresentationAction,\n\t\tTCommonsPresentationBlankAction,\n\t\tTCommonsPresentationJumpAction,\n\t\tTCommonsPresentationMoveAction,\n\t\tTCommonsPresentationReachedSlide,\n\t\tTCommonsPresentationTriggerAction,\n\t\tisECommonsPresentationMoveMagnitude\n} from 'ngx-presentationcommons-esm-core';\n\nfunction expireInSeconds(n: number): Date {\n\tconst date: Date = new Date();\n\tdate.setTime(date.getTime() + (n * 1000));\n\n\treturn date;\n}\n\ntype TNetworkTrigger = {\n\t\tname: string;\n\t\tdata: unknown;\n};\n\ntype TReachedSlide = {\n\t\tpage: string;\n\t\tindex: number;\n};\n\n@Directive()\nexport abstract class CommonsPresentationNetworkService extends CommonsNetworkSocketIoService {\n\tprivate readonly presentationService: CommonsPresentationService = inject<CommonsPresentationService>(CommonsPresentationService);\n\n\tprivate observables: Map<string, Subscription> = new Map<string, Subscription>();\n\n\tconstructor(\n\t\t\turl: string,\n\t\t\t// eslint-disable-next-line @angular-eslint/prefer-inject\n\t\t\tprivate ns: string,\n\t\t\tchannel: string,\n\t\t\tdeviceId: string\n\t) {\n\t\tsuper(\n\t\t\t\turl,\n\t\t\t\tfalse\n\t\t);\n\n\t\tif (!commonsBase62IsId(channel)) throw new Error('Invalid channel id. Must be base62id');\n\t\tif (!commonsBase62IsId(deviceId)) throw new Error('Invalid device id. Must be base62id');\n\n\t\tthis.channel = channel;\n\t\tthis.deviceId = deviceId;\n\n\t\tthis.addRemote<ECommonsPresentationMoveMagnitude>(\n\t\t\t\t'prev',\n\t\t\t\t(source: string, magnitude: ECommonsPresentationMoveMagnitude): void => {\n\t\t\t\t\tthis.presentationService.prev(magnitude, ECommonsPresentationActionSource.NETWORK, source);\n\t\t\t\t},\n\t\t\t\tisECommonsPresentationMoveMagnitude\n\t\t);\n\n\t\tthis.addRemote<ECommonsPresentationMoveMagnitude>(\n\t\t\t\t'next',\n\t\t\t\t(source: string, magnitude: ECommonsPresentationMoveMagnitude): void => {\n\t\t\t\t\tthis.presentationService.next(magnitude, ECommonsPresentationActionSource.NETWORK, source);\n\t\t\t\t},\n\t\t\t\tisECommonsPresentationMoveMagnitude\n\t\t);\n\n\t\tthis.addRemote<true>(\n\t\t\t\t'restart',\n\t\t\t\t(source: string): void => {\n\t\t\t\t\tthis.presentationService.restart(ECommonsPresentationActionSource.NETWORK, source);\n\t\t\t\t},\n\t\t\t\t(_test: unknown): _test is true => true\t// ignore\n\t\t);\n\n\t\tthis.addRemote<string>(\n\t\t\t\t'jump',\n\t\t\t\t(source: string, page: string): void => {\n\t\t\t\t\tthis.presentationService.jump(\n\t\t\t\t\t\t\tpage,\n\t\t\t\t\t\t\tECommonsPresentationActionSource.NETWORK,\n\t\t\t\t\t\t\tsource\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tcommonsTypeIsString\n\t\t);\n\n\t\tthis.addRemote(\n\t\t\t\t'end',\n\t\t\t\t(source: string): void => {\n\t\t\t\t\tthis.presentationService.end(ECommonsPresentationActionSource.NETWORK, source);\n\t\t\t\t},\n\t\t\t\t(_test: unknown): _test is true => true\t// ignore\n\t\t);\n\n\t\tthis.addRemote<boolean|'holding'>(\n\t\t\t\t'blank',\n\t\t\t\t(source: string, state: boolean|'holding'): void => {\n\t\t\t\t\tthis.presentationService.blank(\n\t\t\t\t\t\t\tstate,\n\t\t\t\t\t\t\tECommonsPresentationActionSource.NETWORK,\n\t\t\t\t\t\t\tsource\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\t(test: unknown): test is boolean|'holding' => {\n\t\t\t\t\tif (commonsTypeIsBoolean(test)) return true;\n\t\t\t\t\tif (commonsTypeIsString(test) && test === 'holding') return true;\n\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t);\n\n\t\tthis.addRemote(\n\t\t\t\t'show-all',\n\t\t\t\t(source: string): void => {\n\t\t\t\t\tthis.presentationService.showAll(ECommonsPresentationActionSource.NETWORK, source);\n\t\t\t\t},\n\t\t\t\t(_test: unknown): _test is true => true\t// ignore\n\t\t);\n\t\t\n\t\tthis.addRemote<TNetworkTrigger>(\n\t\t\t\t'trigger',\n\t\t\t\t(source: string, data: TNetworkTrigger): void => {\n\t\t\t\t\tthis.presentationService.trigger(\n\t\t\t\t\t\t\tdata.name,\n\t\t\t\t\t\t\tdata.data,\n\t\t\t\t\t\t\tECommonsPresentationActionSource.NETWORK,\n\t\t\t\t\t\t\tsource\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\t(test: unknown): test is TNetworkTrigger => {\n\t\t\t\t\tif (!commonsTypeHasPropertyString(test, 'name')) return false;\n\n\t\t\t\t\t// cannot check data\n\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t);\n\n\t\tthis.addRemote<TReachedSlide>(\n\t\t\t\t'reached-slide',\n\t\t\t\t(source: string, state: TReachedSlide): void => {\n\t\t\t\t\tthis.presentationService.reachedSlide(\n\t\t\t\t\t\t\tstate.page,\n\t\t\t\t\t\t\tstate.index,\n\t\t\t\t\t\t\tECommonsPresentationActionSource.NETWORK,\n\t\t\t\t\t\t\tsource\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\t(test: unknown): test is TReachedSlide => {\n\t\t\t\t\tif (!commonsTypeHasPropertyString(test, 'page')) return false;\n\t\t\t\t\tif (!commonsTypeHasPropertyNumber(test, 'index')) return false;\n\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t);\n\t}\n\n\t// cascade things like keydowns to the network\n\t// NB, this needs to be called AFTER any triggers have been added\n\tpublic setupLoopbackRepeat(): void {\n\t\tthis.presentationService.prevObservable\n\t\t\t\t.subscribe((action: TCommonsPresentationMoveAction): void => {\n\t\t\t\t\t// prevent infinite cascades\n\t\t\t\t\tif (action.source === ECommonsPresentationActionSource.NETWORK && action.sourceId === this.deviceId) return;\n\n\t\t\t\t\tvoid this.prev(action.magnitude);\n\t\t\t\t});\n\n\t\tthis.presentationService.nextObservable\n\t\t\t\t.subscribe((action: TCommonsPresentationMoveAction): void => {\n\t\t\t\t\t// prevent infinite cascades\n\t\t\t\t\tif (action.source === ECommonsPresentationActionSource.NETWORK && action.sourceId === this.deviceId) return;\n\n\t\t\t\t\tvoid this.next(action.magnitude);\n\t\t\t\t});\n\n\t\tthis.presentationService.restartObservable\n\t\t\t\t.subscribe((action: TCommonsPresentationAction): void => {\n\t\t\t\t\t// prevent infinite cascades\n\t\t\t\t\tif (action.source === ECommonsPresentationActionSource.NETWORK && action.sourceId === this.deviceId) return;\n\n\t\t\t\t\tvoid this.restart();\n\t\t\t\t});\n\n\t\tthis.presentationService.jumpObservable\n\t\t\t\t.subscribe((action: TCommonsPresentationJumpAction): void => {\n\t\t\t\t\t// prevent infinite cascades\n\t\t\t\t\tif (action.source === ECommonsPresentationActionSource.NETWORK && action.sourceId === this.deviceId) return;\n\n\t\t\t\t\tvoid this.jump(action.page);\n\t\t\t\t});\n\n\t\tthis.presentationService.endObservable\n\t\t\t\t.subscribe((action: TCommonsPresentationAction): void => {\n\t\t\t\t\t// prevent infinite cascades\n\t\t\t\t\tif (action.source === ECommonsPresentationActionSource.NETWORK && action.sourceId === this.deviceId) return;\n\n\t\t\t\t\tvoid this.end();\n\t\t\t\t});\n\n\t\tthis.presentationService.blankObservable\n\t\t\t\t.subscribe((action: TCommonsPresentationBlankAction): void => {\n\t\t\t\t\t// prevent infinite cascades\n\t\t\t\t\tif (action.source === ECommonsPresentationActionSource.NETWORK && action.sourceId === this.deviceId) return;\n\n\t\t\t\t\tvoid this.blank(action.state);\n\t\t\t\t});\n\n\t\tthis.presentationService.showAllObservable\n\t\t\t\t.subscribe((action: TCommonsPresentationAction): void => {\n\t\t\t\t\t// prevent infinite cascades\n\t\t\t\t\tif (action.source === ECommonsPresentationActionSource.NETWORK && action.sourceId === this.deviceId) return;\n\n\t\t\t\t\tvoid this.showAll();\n\t\t\t\t});\n\n\t\tfor (const name of this.presentationService.triggerNames) {\n\t\t\tthis.presentationService.triggerObservable(name)\n\t\t\t\t\t.subscribe((action: TCommonsPresentationTriggerAction): void => {\n\t\t\t\t\t\t// prevent infinite cascades\n\t\t\t\t\t\tif (action.source === ECommonsPresentationActionSource.NETWORK && action.sourceId === this.deviceId) return;\n\n\t\t\t\t\t\tvoid this.trigger(name, action.data as TEncoded);\n\t\t\t\t\t});\n\t\t}\n\n\t\tthis.presentationService.reachedSlideObservable\n\t\t\t\t.subscribe((action: TCommonsPresentationReachedSlide): void => {\n\t\t\t\t\t// prevent infinite cascades\n\t\t\t\t\tif (action.source === ECommonsPresentationActionSource.NETWORK && action.sourceId === this.deviceId) return;\n\n\t\t\t\t\tvoid this.reachedSlide(action.page, action.index);\n\t\t\t\t});\n\t}\n\n\tprivate addRemote<T = any>(\n\t\t\tcommand: string,\n\t\t\tcallback: (source: string, data: T) => void,\n\t\t\tisT: (test: unknown) => test is T\n\t): void {\n\t\tthis.observables.set(\n\t\t\t\tcommand,\n\t\t\t\tthis.receiveObservable\n\t\t\t\t\t\t.subscribe((packet: ICommonsNetworkPacket): void => {\n\t\t\t\t\t\t\tif (packet.ns !== this.ns) return;\n\t\t\t\t\t\t\tif (packet.command !== command) return;\n\t\t\t\t\t\t\tif (packet.source === this.deviceId) return;\t// present infinite cascade\n\n\t\t\t\t\t\t\tif (packet.data === undefined) {\n\t\t\t\t\t\t\t\tconsole.log('Invalid packet didn\\'t contain any data. Cannot continue');\n\t\t\t\t\t\t\t\tconsole.log(packet);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst data: unknown = commonsTypeDecode(packet.data);\n\t\t\t\t\t\t\tif (!isT(data)) {\n\t\t\t\t\t\t\t\tconsole.log('Invalid packet data for command. Cannot continue');\n\t\t\t\t\t\t\t\tconsole.log(data);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tcallback(packet.source, data);\n\t\t\t\t\t\t})\n\t\t);\n\t}\n\n\tpublic addRemoteTrigger<T = any>(\n\t\t\tname: string,\n\t\t\tisT: (test: unknown) => test is T\n\t): void {\n\t\tthis.addRemote(\n\t\t\t\t`trigger-${name}`,\n\t\t\t\t(_source: string, data: T): void => {\n\t\t\t\t\tthis.presentationService.trigger(name, data);\n\t\t\t\t},\n\t\t\t\tisT\n\t\t);\n\t}\n\n\tpublic removeRemoteTrigger(name: string): boolean {\n\t\tif (!this.observables.has(name)) return false;\n\n\t\tthis.observables.get(name)!.unsubscribe();\n\t\tthis.observables.delete(name);\n\n\t\treturn true;\n\t}\n\n\tprivate async broadcastCommand<T = any>(\n\t\t\tcommand: string,\n\t\t\tdata: T\n\t): Promise<void> {\n\t\tawait this.broadcast(\n\t\t\t\tthis.ns,\n\t\t\t\tcommand,\n\t\t\t\tdata as TEncoded,\n\t\t\t\texpireInSeconds(10),\n\t\t\t\ttrue\n\t\t);\n\t}\n\n\tpublic async prev(magnitude: ECommonsPresentationMoveMagnitude): Promise<void> {\n\t\tawait this.broadcastCommand<ECommonsPresentationMoveMagnitude>('prev', magnitude);\n\t}\n\n\tpublic async next(magnitude: ECommonsPresentationMoveMagnitude): Promise<void> {\n\t\tawait this.broadcastCommand<ECommonsPresentationMoveMagnitude>('next', magnitude);\n\t}\n\n\tpublic async restart(): Promise<void> {\n\t\tawait this.broadcastCommand<true>('restart', true);\n\t}\n\n\tpublic async jump(page: string): Promise<void> {\n\t\tawait this.broadcastCommand<string>(\n\t\t\t\t'jump',\n\t\t\t\tpage\n\t\t);\n\t}\n\n\tpublic async end(): Promise<void> {\n\t\tawait this.broadcastCommand<true>('end', true);\n\t}\n\n\tpublic async blank(state: boolean|'holding'): Promise<void> {\n\t\tawait this.broadcastCommand<boolean|'holding'>(\n\t\t\t\t'blank',\n\t\t\t\tstate\n\t\t);\n\t}\n\n\tpublic async showAll(): Promise<void> {\n\t\tawait this.broadcastCommand<true>('show-all', true);\n\t}\n\n\tpublic async trigger<T = any>(\n\t\t\tname: string,\n\t\t\tdata: T\n\t): Promise<void> {\n\t\tawait this.broadcastCommand<T>(\n\t\t\t\t`trigger-${name}`,\n\t\t\t\tdata\n\t\t);\n\t}\n\n\tpublic async reachedSlide(page: string, index: number): Promise<void> {\n\t\tawait this.broadcastCommand<TReachedSlide>(\n\t\t\t\t'reached-slide',\n\t\t\t\t{\n\t\t\t\t\t\tpage: page,\n\t\t\t\t\t\tindex: index\n\t\t\t\t}\n\t\t);\n\t}\n}\n","/*\n * Public API Surface of ngx-presentationcommons-esm-network\n */\n\nexport * from './lib/services/network.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAsBA,SAAS,eAAe,CAAC,CAAS,EAAA;AACjC,IAAA,MAAM,IAAI,GAAS,IAAI,IAAI,EAAE;AAC7B,IAAA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;AAEzC,IAAA,OAAO,IAAI;AACZ;AAaM,MAAgB,iCAAkC,SAAQ,6BAA6B,CAAA;AAQlF,IAAA,EAAA;AAPO,IAAA,mBAAmB,GAA+B,MAAM,CAA6B,0BAA0B,CAAC;AAEzH,IAAA,WAAW,GAA8B,IAAI,GAAG,EAAwB;AAEhF,IAAA,WAAA,CACE,GAAW;;IAEH,EAAU,EAClB,OAAe,EACf,QAAgB,EAAA;AAEjB,QAAA,KAAK,CACH,GAAG,EACH,KAAK,CACN;QAPQ,IAAE,CAAA,EAAA,GAAF,EAAE;AASX,QAAA,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC;AAAE,YAAA,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC;AACxF,QAAA,IAAI,CAAC,iBAAiB,CAAC,QAA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E,IAAI,CAAC;;AAG7C,IAAA,MAAM,OAAO,CAClB,IAAY,EACZ,IAAO,EAAA;QAER,MAAM,IAAI,CAAC,gBAAgB,CACzB,CAAA,QAAA,EAAW,IAAI,CAAE,CAAA,EACjB,IAAI,CACL;;AAGK,IAAA,MAAM,YAAY,CAAC,IAAY,EAAE,KAAa,EAAA;AACpD,QAAA,MAAM,IAAI,CAAC,gBAAgB,CACzB,eAAe,EACf;AACE,YAAA,IAAI,EAAE,IAAI;AACV,YAAA,KAAK,EAAE;AACR,SAAA,CACF;;wGArUmB,iCAAiC,EAAA,IAAA,EAAA,SAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;4FAAjC,iCAAiC,EAAA,YAAA,EAAA,IAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;4FAAjC,iCAAiC,EAAA,UAAA,EAAA,CAAA;kBADtD;;;ACvCD;;AAEG;;ACFH;;AAEG;;;;"}
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { CommonsNetworkSocketIoService } from 'ngx-httpcommons-esm-network';
|
|
2
|
+
import { ECommonsPresentationMoveMagnitude } from 'ngx-presentationcommons-esm-core';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare abstract class CommonsPresentationNetworkService extends CommonsNetworkSocketIoService {
|
|
5
|
+
private ns;
|
|
6
|
+
private readonly presentationService;
|
|
7
|
+
private observables;
|
|
8
|
+
constructor(url: string, ns: string, channel: string, deviceId: string);
|
|
9
|
+
setupLoopbackRepeat(): void;
|
|
10
|
+
private addRemote;
|
|
11
|
+
addRemoteTrigger<T = any>(name: string, isT: (test: unknown) => test is T): void;
|
|
12
|
+
removeRemoteTrigger(name: string): boolean;
|
|
13
|
+
private broadcastCommand;
|
|
14
|
+
prev(magnitude: ECommonsPresentationMoveMagnitude): Promise<void>;
|
|
15
|
+
next(magnitude: ECommonsPresentationMoveMagnitude): Promise<void>;
|
|
16
|
+
restart(): Promise<void>;
|
|
17
|
+
jump(page: string): Promise<void>;
|
|
18
|
+
end(): Promise<void>;
|
|
19
|
+
blank(state: boolean | 'holding'): Promise<void>;
|
|
20
|
+
showAll(): Promise<void>;
|
|
21
|
+
trigger<T = any>(name: string, data: T): Promise<void>;
|
|
22
|
+
reachedSlide(page: string, index: number): Promise<void>;
|
|
23
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CommonsPresentationNetworkService, never>;
|
|
24
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<CommonsPresentationNetworkService, never, never, {}, {}, never, never, true, never>;
|
|
25
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ngx-presentationcommons-esm-network",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"peerDependencies": {
|
|
5
|
+
"@angular/common": "^19.2.0",
|
|
6
|
+
"@angular/core": "^19.2.0",
|
|
7
|
+
"tscommons-esm-core": "^0.1.0",
|
|
8
|
+
"tscommons-esm-network": "^0.0.9",
|
|
9
|
+
"ngx-httpcommons-esm-network": "^0.0.5",
|
|
10
|
+
"ngx-httpcommons-esm-socket-io": "^1.0.1",
|
|
11
|
+
"ngx-presentationcommons-esm-core": "^0.0.2"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"tslib": "^2.3.0"
|
|
15
|
+
},
|
|
16
|
+
"sideEffects": false,
|
|
17
|
+
"module": "fesm2022/ngx-presentationcommons-esm-network.mjs",
|
|
18
|
+
"typings": "index.d.ts",
|
|
19
|
+
"exports": {
|
|
20
|
+
"./package.json": {
|
|
21
|
+
"default": "./package.json"
|
|
22
|
+
},
|
|
23
|
+
".": {
|
|
24
|
+
"types": "./index.d.ts",
|
|
25
|
+
"default": "./fesm2022/ngx-presentationcommons-esm-network.mjs"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
package/public-api.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './lib/services/network.service';
|