@rxap/service-worker 12.0.7 → 13.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.
Files changed (40) hide show
  1. package/esm2020/index.mjs +9 -0
  2. package/esm2020/lib/check-for-update.service.mjs +55 -0
  3. package/esm2020/lib/log-update.service.mjs +40 -0
  4. package/esm2020/lib/prompt-update/prompt-update.component.mjs +45 -0
  5. package/esm2020/lib/prompt-update/prompt-update.component.module.mjs +39 -0
  6. package/esm2020/lib/prompt-update/prompt-update.service.mjs +45 -0
  7. package/esm2020/lib/service-worker-prompt-update.module.mjs +25 -0
  8. package/esm2020/lib/service-worker-snack-bar-update.module.mjs +25 -0
  9. package/esm2020/lib/snack-bar-update.service.mjs +62 -0
  10. package/esm2020/rxap-service-worker.mjs +5 -0
  11. package/fesm2015/rxap-service-worker.mjs +314 -0
  12. package/fesm2015/rxap-service-worker.mjs.map +1 -0
  13. package/{fesm2015/rxap-service-worker.js → fesm2020/rxap-service-worker.mjs} +42 -48
  14. package/fesm2020/rxap-service-worker.mjs.map +1 -0
  15. package/package.json +29 -14
  16. package/src/schematics/ng-add/index.js +1 -1
  17. package/src/schematics/ng-add/index.js.map +1 -1
  18. package/bundles/rxap-service-worker.umd.js +0 -367
  19. package/bundles/rxap-service-worker.umd.js.map +0 -1
  20. package/esm2015/index.js +0 -9
  21. package/esm2015/index.js.map +0 -1
  22. package/esm2015/lib/check-for-update.service.js +0 -55
  23. package/esm2015/lib/check-for-update.service.js.map +0 -1
  24. package/esm2015/lib/log-update.service.js +0 -40
  25. package/esm2015/lib/log-update.service.js.map +0 -1
  26. package/esm2015/lib/prompt-update/prompt-update.component.js +0 -51
  27. package/esm2015/lib/prompt-update/prompt-update.component.js.map +0 -1
  28. package/esm2015/lib/prompt-update/prompt-update.component.module.js +0 -39
  29. package/esm2015/lib/prompt-update/prompt-update.component.module.js.map +0 -1
  30. package/esm2015/lib/prompt-update/prompt-update.service.js +0 -45
  31. package/esm2015/lib/prompt-update/prompt-update.service.js.map +0 -1
  32. package/esm2015/lib/service-worker-prompt-update.module.js +0 -25
  33. package/esm2015/lib/service-worker-prompt-update.module.js.map +0 -1
  34. package/esm2015/lib/service-worker-snack-bar-update.module.js +0 -25
  35. package/esm2015/lib/service-worker-snack-bar-update.module.js.map +0 -1
  36. package/esm2015/lib/snack-bar-update.service.js +0 -62
  37. package/esm2015/lib/snack-bar-update.service.js.map +0 -1
  38. package/esm2015/rxap-service-worker.js +0 -5
  39. package/esm2015/rxap-service-worker.js.map +0 -1
  40. package/fesm2015/rxap-service-worker.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rxap/service-worker",
3
- "version": "12.0.7",
3
+ "version": "13.0.0",
4
4
  "author": "Merzough Münker",
5
5
  "homepage": "https://gitlab.com/rxap/packages/libs/service-worker",
6
6
  "repository": "git@gitlab.com:rxap/packages.git",
@@ -16,12 +16,14 @@
16
16
  },
17
17
  "description": "A utility package for the update process of apps with services worker",
18
18
  "peerDependencies": {
19
- "@angular/core": "^12.0.1",
20
- "@angular/material": "^12.0.1",
21
- "@angular/router": "^12.0.1",
22
- "@angular/service-worker": "^12.0.1",
23
- "@rxap/life-cycle": "^12.0.7-next.0",
24
- "@rxap/utilities": "^12.2.0-next.0",
19
+ "@angular-devkit/schematics": "^13.2.4",
20
+ "@angular/core": "^13.2.3",
21
+ "@angular/material": "^13.2.3",
22
+ "@angular/platform-browser-dynamic": "^13.2.3",
23
+ "@angular/router": "^13.2.3",
24
+ "@angular/service-worker": "^13.2.3",
25
+ "@rxap/life-cycle": "^13.0.0",
26
+ "@rxap/utilities": "^13.0.0",
25
27
  "reflect-metadata": "^0.1.13",
26
28
  "rxjs": "^6.5.5"
27
29
  },
@@ -43,14 +45,27 @@
43
45
  "save": "dependencies"
44
46
  },
45
47
  "dependencies": {
46
- "@rxap/schematics-utilities": "^12.4.0",
47
- "tslib": "^2.2.0"
48
+ "@rxap/schematics-utilities": "^13.0.0-next.1",
49
+ "tslib": "^2.3.1"
48
50
  },
49
- "main": "bundles/rxap-service-worker.umd.js",
50
- "module": "fesm2015/rxap-service-worker.js",
51
- "es2015": "fesm2015/rxap-service-worker.js",
52
- "esm2015": "esm2015/rxap-service-worker.js",
53
- "fesm2015": "fesm2015/rxap-service-worker.js",
51
+ "module": "fesm2015/rxap-service-worker.mjs",
52
+ "es2020": "fesm2020/rxap-service-worker.mjs",
53
+ "esm2020": "esm2020/rxap-service-worker.mjs",
54
+ "fesm2020": "fesm2020/rxap-service-worker.mjs",
55
+ "fesm2015": "fesm2015/rxap-service-worker.mjs",
54
56
  "typings": "rxap-service-worker.d.ts",
57
+ "exports": {
58
+ "./package.json": {
59
+ "default": "./package.json"
60
+ },
61
+ ".": {
62
+ "types": "./rxap-service-worker.d.ts",
63
+ "esm2020": "./esm2020/rxap-service-worker.mjs",
64
+ "es2020": "./fesm2020/rxap-service-worker.mjs",
65
+ "es2015": "./fesm2015/rxap-service-worker.mjs",
66
+ "node": "./fesm2015/rxap-service-worker.mjs",
67
+ "default": "./fesm2020/rxap-service-worker.mjs"
68
+ }
69
+ },
55
70
  "sideEffects": false
56
71
  }
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const schematics_utilities_1 = require("@rxap/schematics-utilities");
4
4
  function default_1() {
5
- return schematics_utilities_1.InstallPeerDependencies();
5
+ return (0, schematics_utilities_1.InstallPeerDependencies)();
6
6
  }
7
7
  exports.default = default_1;
8
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/service-worker/src/schematics/ng-add/index.ts"],"names":[],"mappings":";;AACA,qEAAqE;AAErE;IACE,OAAO,8CAAuB,EAAE,CAAC;AACnC,CAAC;AAFD,4BAEC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/service-worker/src/schematics/ng-add/index.ts"],"names":[],"mappings":";;AACA,qEAAqE;AAErE;IACE,OAAO,IAAA,8CAAuB,GAAE,CAAC;AACnC,CAAC;AAFD,4BAEC"}
@@ -1,367 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/service-worker'), require('rxjs/operators'), require('rxjs'), require('@rxap/life-cycle'), require('@rxap/utilities/rxjs'), require('@angular/material/dialog'), require('@angular/material/progress-bar'), require('@angular/material/button'), require('@angular/material/tooltip'), require('@angular/material/snack-bar')) :
3
- typeof define === 'function' && define.amd ? define('@rxap/service-worker', ['exports', '@angular/core', '@angular/service-worker', 'rxjs/operators', 'rxjs', '@rxap/life-cycle', '@rxap/utilities/rxjs', '@angular/material/dialog', '@angular/material/progress-bar', '@angular/material/button', '@angular/material/tooltip', '@angular/material/snack-bar'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.rxap = global.rxap || {}, global.rxap['service-worker'] = {}), global.ng.core, global.ng.serviceWorker, global.rxjs.operators, global.rxjs, global.i1, global.rxjs$1, global.ng.material.dialog, global.ng.material.progressBar, global.ng.material.button, global.ng.material.tooltip, global.ng.material.snackBar));
5
- }(this, (function (exports, i0, i2, operators, rxjs, i1, rxjs$1, i3, i1$1, i2$1, i4, i1$2) { 'use strict';
6
-
7
- function _interopNamespace(e) {
8
- if (e && e.__esModule) return e;
9
- var n = Object.create(null);
10
- if (e) {
11
- Object.keys(e).forEach(function (k) {
12
- if (k !== 'default') {
13
- var d = Object.getOwnPropertyDescriptor(e, k);
14
- Object.defineProperty(n, k, d.get ? d : {
15
- enumerable: true,
16
- get: function () {
17
- return e[k];
18
- }
19
- });
20
- }
21
- });
22
- }
23
- n['default'] = e;
24
- return Object.freeze(n);
25
- }
26
-
27
- var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
28
- var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
29
- var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
30
- var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
31
- var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
32
- var i2__namespace$1 = /*#__PURE__*/_interopNamespace(i2$1);
33
- var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
34
- var i1__namespace$2 = /*#__PURE__*/_interopNamespace(i1$2);
35
-
36
- var LogUpdateService = /** @class */ (function () {
37
- function LogUpdateService(updates) {
38
- this.updates = updates;
39
- }
40
- LogUpdateService.prototype.start = function () {
41
- console.debug('start log update');
42
- this.updates.available.subscribe(function (event) {
43
- console.log('current version is', event.current);
44
- console.log('available version is', event.available);
45
- });
46
- this.updates.activated.subscribe(function (event) {
47
- console.log('old version was', event.previous);
48
- console.log('new version is', event.current);
49
- });
50
- };
51
- return LogUpdateService;
52
- }());
53
- LogUpdateService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: LogUpdateService, deps: [{ token: i2__namespace.SwUpdate }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
54
- LogUpdateService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: LogUpdateService, providedIn: 'root' });
55
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: LogUpdateService, decorators: [{
56
- type: i0.Injectable,
57
- args: [{
58
- providedIn: 'root'
59
- }]
60
- }], ctorParameters: function () { return [{ type: i2__namespace.SwUpdate }]; } });
61
- var LogUpdateModule = /** @class */ (function () {
62
- function LogUpdateModule(logUpdate) {
63
- logUpdate.start();
64
- }
65
- return LogUpdateModule;
66
- }());
67
- LogUpdateModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: LogUpdateModule, deps: [{ token: LogUpdateService }], target: i0__namespace.ɵɵFactoryTarget.NgModule });
68
- LogUpdateModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: LogUpdateModule });
69
- LogUpdateModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: LogUpdateModule });
70
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: LogUpdateModule, decorators: [{
71
- type: i0.NgModule
72
- }], ctorParameters: function () { return [{ type: LogUpdateService }]; } });
73
-
74
- var CheckForUpdateService = /** @class */ (function () {
75
- function CheckForUpdateService(lifeCycle, updates) {
76
- this.lifeCycle = lifeCycle;
77
- this.updates = updates;
78
- }
79
- CheckForUpdateService.prototype.start = function () {
80
- var _this = this;
81
- if (this.updates.isEnabled) {
82
- console.debug('start check for update');
83
- this.updates.checkForUpdate();
84
- this
85
- .lifeCycle
86
- .whenReady(function () { return rxjs.interval(15 * 60 * 1000)
87
- .pipe(operators.startWith(null), rxjs$1.log('check for update'), operators.tap(function () { return _this.updates.checkForUpdate(); })); })
88
- .subscribe();
89
- }
90
- };
91
- return CheckForUpdateService;
92
- }());
93
- CheckForUpdateService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: CheckForUpdateService, deps: [{ token: i1.LifeCycleService }, { token: i2.SwUpdate }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
94
- CheckForUpdateService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: CheckForUpdateService, providedIn: 'root' });
95
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: CheckForUpdateService, decorators: [{
96
- type: i0.Injectable,
97
- args: [{
98
- providedIn: 'root'
99
- }]
100
- }], ctorParameters: function () {
101
- return [{ type: i1__namespace.LifeCycleService, decorators: [{
102
- type: i0.Inject,
103
- args: [i1.LifeCycleService]
104
- }] }, { type: i2__namespace.SwUpdate, decorators: [{
105
- type: i0.Inject,
106
- args: [i2.SwUpdate]
107
- }] }];
108
- } });
109
- var CheckForUpdateModule = /** @class */ (function () {
110
- function CheckForUpdateModule(checkForUpdate) {
111
- checkForUpdate.start();
112
- }
113
- return CheckForUpdateModule;
114
- }());
115
- CheckForUpdateModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: CheckForUpdateModule, deps: [{ token: CheckForUpdateService }], target: i0__namespace.ɵɵFactoryTarget.NgModule });
116
- CheckForUpdateModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: CheckForUpdateModule });
117
- CheckForUpdateModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: CheckForUpdateModule });
118
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: CheckForUpdateModule, decorators: [{
119
- type: i0.NgModule
120
- }], ctorParameters: function () {
121
- return [{ type: CheckForUpdateService, decorators: [{
122
- type: i0.Inject,
123
- args: [CheckForUpdateService]
124
- }] }];
125
- } });
126
-
127
- var PromptUpdateComponent = /** @class */ (function () {
128
- function PromptUpdateComponent(event, dialogRef, lifecycle) {
129
- this.event = event;
130
- this.dialogRef = dialogRef;
131
- this.lifecycle = lifecycle;
132
- this.progress = 1;
133
- }
134
- PromptUpdateComponent.prototype.ngOnInit = function () {
135
- var _this = this;
136
- this.subscription = this.lifecycle
137
- .whenReady(function () { return rxjs.interval(100).pipe(operators.tap(function (i) { return (_this.progress = Math.floor(((i + 1) / (PromptUpdateComponent.AUTO_UPDATE_IN / 100)) * 100)); }), operators.first(function (i) { return i >= PromptUpdateComponent.AUTO_UPDATE_IN / 100; }), rxjs$1.log('start auto update'), operators.tap(function () { return _this.dialogRef.close(true); })); })
138
- .subscribe();
139
- };
140
- PromptUpdateComponent.prototype.ngOnDestroy = function () {
141
- var _a;
142
- (_a = this.subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
143
- };
144
- return PromptUpdateComponent;
145
- }());
146
- PromptUpdateComponent.AUTO_UPDATE_IN = 1000 * 60 * 1.5;
147
- PromptUpdateComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: PromptUpdateComponent, deps: [{ token: i3.MAT_DIALOG_DATA }, { token: i3.MatDialogRef }, { token: i1.LifeCycleService }], target: i0__namespace.ɵɵFactoryTarget.Component });
148
- PromptUpdateComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.1", type: PromptUpdateComponent, selector: "rxap-prompt-update", ngImport: i0__namespace, template: "<h2 mat-dialog-title>Update available</h2>\n<mat-dialog-content>\n <p>Ein neue Version der App steht zur Verf\u00FCgung!</p>\n <p>Soll die neue Version heruntergeladen werden und aktiviert werden?</p>\n <table class=\"version\">\n <tr>\n <th>Aktuelle Version</th>\n <td>{{event.current.hash}}</td>\n </tr>\n <tr>\n <th>Neue Version</th>\n <td>{{event.available.hash}}</td>\n </tr>\n </table>\n <mat-progress-bar [value]=\"progress\" matTooltip=\"start auto update\" mode=\"determinate\"></mat-progress-bar>\n</mat-dialog-content>\n<mat-dialog-actions>\n <button [mat-dialog-close]=\"false\" mat-button>Abbrechen</button>\n <!-- The mat-dialog-close directive optionally accepts a value as a result for the dialog. -->\n <button [mat-dialog-close]=\"true\" mat-button>Update</button>\n</mat-dialog-actions>\n", styles: [".version th{padding-right:12px}"], components: [{ type: i1__namespace$1.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "mode", "value", "bufferValue"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { type: i2__namespace$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i3__namespace.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i3__namespace.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i4__namespace.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { type: i3__namespace.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i3__namespace.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["type", "mat-dialog-close", "aria-label", "matDialogClose"], exportAs: ["matDialogClose"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.Default });
149
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: PromptUpdateComponent, decorators: [{
150
- type: i0.Component,
151
- args: [{
152
- selector: 'rxap-prompt-update',
153
- templateUrl: './prompt-update.component.html',
154
- styleUrls: ['./prompt-update.component.scss'],
155
- changeDetection: i0.ChangeDetectionStrategy.Default,
156
- }]
157
- }], ctorParameters: function () {
158
- return [{ type: undefined, decorators: [{
159
- type: i0.Inject,
160
- args: [i3.MAT_DIALOG_DATA]
161
- }] }, { type: i3__namespace.MatDialogRef, decorators: [{
162
- type: i0.Inject,
163
- args: [i3.MatDialogRef]
164
- }] }, { type: i1__namespace.LifeCycleService, decorators: [{
165
- type: i0.Inject,
166
- args: [i1.LifeCycleService]
167
- }] }];
168
- } });
169
-
170
- var PromptUpdateService = /** @class */ (function () {
171
- function PromptUpdateService(dialog, updates) {
172
- this.dialog = dialog;
173
- this.updates = updates;
174
- }
175
- PromptUpdateService.prototype.start = function () {
176
- var _this = this;
177
- console.debug('start prompt update');
178
- this.updates.available
179
- .pipe(operators.concatMap(function (event) { return _this.promptUser(event); }), operators.filter(Boolean), rxjs$1.log('start app update'), operators.tap(function () { return _this.updates.activateUpdate().then(function () {
180
- console.log('app update completed. Reload app.');
181
- document.location.reload();
182
- }); }))
183
- .subscribe();
184
- };
185
- PromptUpdateService.prototype.promptUser = function (event) {
186
- var dialogRef = this.dialog.open(PromptUpdateComponent, {
187
- data: event,
188
- });
189
- return dialogRef.afterClosed().pipe(operators.map(Boolean), operators.take(1));
190
- };
191
- return PromptUpdateService;
192
- }());
193
- PromptUpdateService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: PromptUpdateService, deps: [{ token: i3.MatDialog }, { token: i2.SwUpdate }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
194
- PromptUpdateService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: PromptUpdateService, providedIn: 'root' });
195
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: PromptUpdateService, decorators: [{
196
- type: i0.Injectable,
197
- args: [{
198
- providedIn: 'root',
199
- }]
200
- }], ctorParameters: function () {
201
- return [{ type: i3__namespace.MatDialog, decorators: [{
202
- type: i0.Inject,
203
- args: [i3.MatDialog]
204
- }] }, { type: i2__namespace.SwUpdate, decorators: [{
205
- type: i0.Inject,
206
- args: [i2.SwUpdate]
207
- }] }];
208
- } });
209
-
210
- var PromptUpdateModule = /** @class */ (function () {
211
- function PromptUpdateModule(promptUpdate) {
212
- promptUpdate.start();
213
- }
214
- return PromptUpdateModule;
215
- }());
216
- PromptUpdateModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: PromptUpdateModule, deps: [{ token: PromptUpdateService }], target: i0__namespace.ɵɵFactoryTarget.NgModule });
217
- PromptUpdateModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: PromptUpdateModule, declarations: [PromptUpdateComponent], imports: [i3.MatDialogModule,
218
- i2$1.MatButtonModule,
219
- i1$1.MatProgressBarModule,
220
- i4.MatTooltipModule], exports: [PromptUpdateComponent] });
221
- PromptUpdateModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: PromptUpdateModule, imports: [[
222
- i3.MatDialogModule,
223
- i2$1.MatButtonModule,
224
- i1$1.MatProgressBarModule,
225
- i4.MatTooltipModule
226
- ]] });
227
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: PromptUpdateModule, decorators: [{
228
- type: i0.NgModule,
229
- args: [{
230
- declarations: [PromptUpdateComponent],
231
- imports: [
232
- i3.MatDialogModule,
233
- i2$1.MatButtonModule,
234
- i1$1.MatProgressBarModule,
235
- i4.MatTooltipModule
236
- ],
237
- exports: [PromptUpdateComponent]
238
- }]
239
- }], ctorParameters: function () { return [{ type: PromptUpdateService }]; } });
240
-
241
- var ServiceWorkerPromptUpdateModule = /** @class */ (function () {
242
- function ServiceWorkerPromptUpdateModule() {
243
- }
244
- return ServiceWorkerPromptUpdateModule;
245
- }());
246
- ServiceWorkerPromptUpdateModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: ServiceWorkerPromptUpdateModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
247
- ServiceWorkerPromptUpdateModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: ServiceWorkerPromptUpdateModule, exports: [LogUpdateModule,
248
- CheckForUpdateModule,
249
- PromptUpdateModule] });
250
- ServiceWorkerPromptUpdateModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: ServiceWorkerPromptUpdateModule, imports: [LogUpdateModule,
251
- CheckForUpdateModule,
252
- PromptUpdateModule] });
253
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: ServiceWorkerPromptUpdateModule, decorators: [{
254
- type: i0.NgModule,
255
- args: [{
256
- exports: [
257
- LogUpdateModule,
258
- CheckForUpdateModule,
259
- PromptUpdateModule
260
- ]
261
- }]
262
- }] });
263
-
264
- var SnackBarUpdateService = /** @class */ (function () {
265
- function SnackBarUpdateService(snackBar, updates) {
266
- this.snackBar = snackBar;
267
- this.updates = updates;
268
- }
269
- SnackBarUpdateService.prototype.start = function () {
270
- var _this = this;
271
- console.debug('start prompt update');
272
- this.updates.available
273
- .pipe(operators.concatMap(function (event) { return _this.openSnackBar(event); }), rxjs$1.log('start app update'), operators.tap(function () { return _this.updates.activateUpdate().then(function () {
274
- console.log('app update completed. Reload app.');
275
- document.location.reload();
276
- }); }))
277
- .subscribe();
278
- };
279
- SnackBarUpdateService.prototype.openSnackBar = function (event) {
280
- var snackBarRef = this.snackBar.open('New update available', 'update', {
281
- duration: 25 * 1000,
282
- data: event,
283
- });
284
- return snackBarRef.onAction();
285
- };
286
- return SnackBarUpdateService;
287
- }());
288
- SnackBarUpdateService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: SnackBarUpdateService, deps: [{ token: i1$2.MatSnackBar }, { token: i2.SwUpdate }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
289
- SnackBarUpdateService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: SnackBarUpdateService, providedIn: 'root' });
290
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: SnackBarUpdateService, decorators: [{
291
- type: i0.Injectable,
292
- args: [{
293
- providedIn: 'root',
294
- }]
295
- }], ctorParameters: function () {
296
- return [{ type: i1__namespace$2.MatSnackBar, decorators: [{
297
- type: i0.Inject,
298
- args: [i1$2.MatSnackBar]
299
- }] }, { type: i2__namespace.SwUpdate, decorators: [{
300
- type: i0.Inject,
301
- args: [i2.SwUpdate]
302
- }] }];
303
- } });
304
- var SnackBarUpdateServiceModule = /** @class */ (function () {
305
- function SnackBarUpdateServiceModule(snackBarUpdate) {
306
- snackBarUpdate.start();
307
- }
308
- return SnackBarUpdateServiceModule;
309
- }());
310
- SnackBarUpdateServiceModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: SnackBarUpdateServiceModule, deps: [{ token: SnackBarUpdateService }], target: i0__namespace.ɵɵFactoryTarget.NgModule });
311
- SnackBarUpdateServiceModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: SnackBarUpdateServiceModule, exports: [i1$2.MatSnackBarModule] });
312
- SnackBarUpdateServiceModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: SnackBarUpdateServiceModule, imports: [i1$2.MatSnackBarModule] });
313
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: SnackBarUpdateServiceModule, decorators: [{
314
- type: i0.NgModule,
315
- args: [{
316
- exports: [i1$2.MatSnackBarModule],
317
- }]
318
- }], ctorParameters: function () {
319
- return [{ type: SnackBarUpdateService, decorators: [{
320
- type: i0.Inject,
321
- args: [SnackBarUpdateService]
322
- }] }];
323
- } });
324
-
325
- var ServiceWorkerSnackBarUpdateModule = /** @class */ (function () {
326
- function ServiceWorkerSnackBarUpdateModule() {
327
- }
328
- return ServiceWorkerSnackBarUpdateModule;
329
- }());
330
- ServiceWorkerSnackBarUpdateModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: ServiceWorkerSnackBarUpdateModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
331
- ServiceWorkerSnackBarUpdateModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: ServiceWorkerSnackBarUpdateModule, exports: [LogUpdateModule,
332
- CheckForUpdateModule,
333
- SnackBarUpdateServiceModule] });
334
- ServiceWorkerSnackBarUpdateModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: ServiceWorkerSnackBarUpdateModule, imports: [LogUpdateModule,
335
- CheckForUpdateModule,
336
- SnackBarUpdateServiceModule] });
337
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0__namespace, type: ServiceWorkerSnackBarUpdateModule, decorators: [{
338
- type: i0.NgModule,
339
- args: [{
340
- exports: [
341
- LogUpdateModule,
342
- CheckForUpdateModule,
343
- SnackBarUpdateServiceModule,
344
- ]
345
- }]
346
- }] });
347
-
348
- /**
349
- * Generated bundle index. Do not edit.
350
- */
351
-
352
- exports.CheckForUpdateModule = CheckForUpdateModule;
353
- exports.CheckForUpdateService = CheckForUpdateService;
354
- exports.LogUpdateModule = LogUpdateModule;
355
- exports.LogUpdateService = LogUpdateService;
356
- exports.PromptUpdateComponent = PromptUpdateComponent;
357
- exports.PromptUpdateModule = PromptUpdateModule;
358
- exports.PromptUpdateService = PromptUpdateService;
359
- exports.ServiceWorkerPromptUpdateModule = ServiceWorkerPromptUpdateModule;
360
- exports.ServiceWorkerSnackBarUpdateModule = ServiceWorkerSnackBarUpdateModule;
361
- exports.SnackBarUpdateService = SnackBarUpdateService;
362
- exports.SnackBarUpdateServiceModule = SnackBarUpdateServiceModule;
363
-
364
- Object.defineProperty(exports, '__esModule', { value: true });
365
-
366
- })));
367
- //# sourceMappingURL=rxap-service-worker.umd.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rxap-service-worker.umd.js","sources":["../../../../libs/service-worker/src/lib/log-update.service.ts","../../../../libs/service-worker/src/lib/check-for-update.service.ts","../../../../libs/service-worker/src/lib/prompt-update/prompt-update.component.ts","../../../../libs/service-worker/src/lib/prompt-update/prompt-update.component.html","../../../../libs/service-worker/src/lib/prompt-update/prompt-update.service.ts","../../../../libs/service-worker/src/lib/prompt-update/prompt-update.component.module.ts","../../../../libs/service-worker/src/lib/service-worker-prompt-update.module.ts","../../../../libs/service-worker/src/lib/snack-bar-update.service.ts","../../../../libs/service-worker/src/lib/service-worker-snack-bar-update.module.ts","../../../../libs/service-worker/src/rxap-service-worker.ts"],"sourcesContent":["import {\n Injectable,\n NgModule\n} from '@angular/core';\nimport { SwUpdate } from '@angular/service-worker';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class LogUpdateService {\n\n constructor(private readonly updates: SwUpdate) {}\n\n public start() {\n console.debug('start log update');\n this.updates.available.subscribe(event => {\n console.log('current version is', event.current);\n console.log('available version is', event.available);\n });\n this.updates.activated.subscribe(event => {\n console.log('old version was', event.previous);\n console.log('new version is', event.current);\n });\n }\n\n}\n\n@NgModule()\nexport class LogUpdateModule {\n\n constructor(logUpdate: LogUpdateService) {\n logUpdate.start();\n }\n\n}\n","import {\n Injectable,\n NgModule,\n Inject\n} from '@angular/core';\nimport { SwUpdate } from '@angular/service-worker';\nimport {\n tap,\n startWith\n} from 'rxjs/operators';\nimport { interval } from 'rxjs';\nimport { LifeCycleService } from '@rxap/life-cycle';\nimport { log } from '@rxap/utilities/rxjs';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class CheckForUpdateService {\n\n constructor(\n @Inject(LifeCycleService) private readonly lifeCycle: LifeCycleService,\n @Inject(SwUpdate) private readonly updates: SwUpdate,\n ) {}\n\n public start(): void {\n if (this.updates.isEnabled) {\n\n console.debug('start check for update');\n\n this.updates.checkForUpdate();\n\n this\n .lifeCycle\n .whenReady(() => interval(15 * 60 * 1000)\n .pipe(\n startWith(null),\n log('check for update'),\n tap(() => this.updates.checkForUpdate()),\n ),\n )\n .subscribe();\n\n }\n }\n\n}\n\n@NgModule()\nexport class CheckForUpdateModule {\n\n constructor(@Inject(CheckForUpdateService) checkForUpdate: CheckForUpdateService) {\n checkForUpdate.start();\n }\n\n}\n","import {\n Component,\n OnInit,\n ChangeDetectionStrategy,\n Inject,\n OnDestroy\n} from '@angular/core';\nimport { UpdateAvailableEvent } from '@angular/service-worker';\nimport {\n MAT_DIALOG_DATA,\n MatDialogRef\n} from '@angular/material/dialog';\nimport {\n interval,\n Subscription\n} from 'rxjs';\nimport {\n tap,\n first\n} from 'rxjs/operators';\nimport { LifeCycleService } from '@rxap/life-cycle';\nimport { log } from '@rxap/utilities/rxjs';\n\n@Component({\n selector: 'rxap-prompt-update',\n templateUrl: './prompt-update.component.html',\n styleUrls: ['./prompt-update.component.scss'],\n changeDetection: ChangeDetectionStrategy.Default,\n})\nexport class PromptUpdateComponent implements OnInit, OnDestroy {\n public static AUTO_UPDATE_IN = 1000 * 60 * 1.5;\n\n public progress: number = 1;\n\n public subscription?: Subscription;\n\n constructor(\n @Inject(MAT_DIALOG_DATA) public readonly event: UpdateAvailableEvent,\n @Inject(MatDialogRef)\n private readonly dialogRef: MatDialogRef<boolean>,\n @Inject(LifeCycleService)\n private readonly lifecycle: LifeCycleService\n ) {}\n\n public ngOnInit(): void {\n this.subscription = this.lifecycle\n .whenReady(() =>\n interval(100).pipe(\n tap(\n (i) =>\n (this.progress = Math.floor(\n ((i + 1) / (PromptUpdateComponent.AUTO_UPDATE_IN / 100)) * 100\n ))\n ),\n first((i) => i >= PromptUpdateComponent.AUTO_UPDATE_IN / 100),\n log('start auto update'),\n tap(() => this.dialogRef.close(true))\n )\n )\n .subscribe();\n }\n\n public ngOnDestroy(): void {\n this.subscription?.unsubscribe();\n }\n}\n","<h2 mat-dialog-title>Update available</h2>\n<mat-dialog-content>\n <p>Ein neue Version der App steht zur Verfügung!</p>\n <p>Soll die neue Version heruntergeladen werden und aktiviert werden?</p>\n <table class=\"version\">\n <tr>\n <th>Aktuelle Version</th>\n <td>{{event.current.hash}}</td>\n </tr>\n <tr>\n <th>Neue Version</th>\n <td>{{event.available.hash}}</td>\n </tr>\n </table>\n <mat-progress-bar [value]=\"progress\" matTooltip=\"start auto update\" mode=\"determinate\"></mat-progress-bar>\n</mat-dialog-content>\n<mat-dialog-actions>\n <button [mat-dialog-close]=\"false\" mat-button>Abbrechen</button>\n <!-- The mat-dialog-close directive optionally accepts a value as a result for the dialog. -->\n <button [mat-dialog-close]=\"true\" mat-button>Update</button>\n</mat-dialog-actions>\n","import {\n Injectable,\n Inject\n} from '@angular/core';\nimport {\n SwUpdate,\n UpdateAvailableEvent\n} from '@angular/service-worker';\nimport {\n concatMap,\n filter,\n tap,\n map,\n take\n} from 'rxjs/operators';\nimport { MatDialog } from '@angular/material/dialog';\nimport { PromptUpdateComponent } from './prompt-update.component';\nimport { Observable } from 'rxjs';\nimport { log } from '@rxap/utilities/rxjs';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class PromptUpdateService {\n constructor(\n @Inject(MatDialog)\n private readonly dialog: MatDialog,\n @Inject(SwUpdate)\n private readonly updates: SwUpdate\n ) {}\n\n public start(): void {\n console.debug('start prompt update');\n this.updates.available\n .pipe(\n concatMap((event) => this.promptUser(event)),\n filter(Boolean),\n log('start app update'),\n tap(() =>\n this.updates.activateUpdate().then(() => {\n console.log('app update completed. Reload app.');\n document.location.reload();\n })\n )\n )\n .subscribe();\n }\n\n private promptUser(event: UpdateAvailableEvent): Observable<boolean> {\n const dialogRef = this.dialog.open<PromptUpdateComponent, any, boolean>(\n PromptUpdateComponent,\n {\n data: event,\n }\n );\n\n return dialogRef.afterClosed().pipe(map(Boolean), take(1));\n }\n}\n","import { NgModule } from '@angular/core';\nimport { PromptUpdateComponent } from './prompt-update.component';\nimport { MatDialogModule } from '@angular/material/dialog';\nimport { PromptUpdateService } from './prompt-update.service';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\nimport { MatTooltipModule } from '@angular/material/tooltip';\n\n\n@NgModule({\n declarations: [ PromptUpdateComponent ],\n imports: [\n MatDialogModule,\n MatButtonModule,\n MatProgressBarModule,\n MatTooltipModule\n ],\n exports: [ PromptUpdateComponent ]\n})\nexport class PromptUpdateModule {\n\n constructor(promptUpdate: PromptUpdateService) {\n promptUpdate.start();\n }\n\n}\n","import { NgModule } from '@angular/core';\nimport { LogUpdateModule } from './log-update.service';\nimport { CheckForUpdateModule } from './check-for-update.service';\nimport { PromptUpdateModule } from './prompt-update/prompt-update.component.module';\n\n@NgModule({\n exports: [\n LogUpdateModule,\n CheckForUpdateModule,\n PromptUpdateModule\n ]\n})\nexport class ServiceWorkerPromptUpdateModule {}\n","import {\n Injectable,\n NgModule,\n Inject\n} from '@angular/core';\nimport {\n SwUpdate,\n UpdateAvailableEvent\n} from '@angular/service-worker';\nimport {\n concatMap,\n tap\n} from 'rxjs/operators';\nimport { Observable } from 'rxjs';\nimport {\n MatSnackBar,\n MatSnackBarModule\n} from '@angular/material/snack-bar';\nimport { log } from '@rxap/utilities/rxjs';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class SnackBarUpdateService {\n constructor(\n @Inject(MatSnackBar)\n private readonly snackBar: MatSnackBar,\n @Inject(SwUpdate)\n private readonly updates: SwUpdate\n ) {}\n\n public start(): void {\n console.debug('start prompt update');\n this.updates.available\n .pipe(\n concatMap((event) => this.openSnackBar(event)),\n log('start app update'),\n tap(() =>\n this.updates.activateUpdate().then(() => {\n console.log('app update completed. Reload app.');\n document.location.reload();\n })\n )\n )\n .subscribe();\n }\n\n private openSnackBar(event: UpdateAvailableEvent): Observable<void> {\n const snackBarRef = this.snackBar.open('New update available', 'update', {\n duration: 25 * 1000,\n data: event,\n });\n\n return snackBarRef.onAction();\n }\n}\n\n@NgModule({\n exports: [MatSnackBarModule],\n})\nexport class SnackBarUpdateServiceModule {\n constructor(\n @Inject(SnackBarUpdateService)\n snackBarUpdate: SnackBarUpdateService\n ) {\n snackBarUpdate.start();\n }\n}\n","import { NgModule } from '@angular/core';\nimport { SnackBarUpdateServiceModule } from './snack-bar-update.service';\nimport { LogUpdateModule } from './log-update.service';\nimport { CheckForUpdateModule } from './check-for-update.service';\n\n@NgModule({\n exports: [\n LogUpdateModule,\n CheckForUpdateModule,\n SnackBarUpdateServiceModule,\n ]\n})\nexport class ServiceWorkerSnackBarUpdateModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["Injectable","NgModule","interval","startWith","log","tap","LifeCycleService","SwUpdate","Inject","first","MAT_DIALOG_DATA","MatDialogRef","Component","ChangeDetectionStrategy","concatMap","filter","map","take","MatDialog","MatDialogModule","MatButtonModule","MatProgressBarModule","MatTooltipModule","MatSnackBar","MatSnackBarModule"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAWE,0BAA6B,OAAiB;YAAjB,YAAO,GAAP,OAAO,CAAU;SAAI;QAE3C,gCAAK,GAAL;YACL,OAAO,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;YAClC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,SAAS,CAAC,UAAA,KAAK;gBACpC,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;gBACjD,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;aACtD,CAAC,CAAC;YACH,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,SAAS,CAAC,UAAA,KAAK;gBACpC,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;gBAC/C,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;aAC9C,CAAC,CAAC;SACJ;;;uIAdU,gBAAgB;2IAAhB,gBAAgB,cAFf,MAAM;qHAE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;;;;;;;;;;;"}
package/esm2015/index.js DELETED
@@ -1,9 +0,0 @@
1
- export * from './lib/service-worker-prompt-update.module';
2
- export * from './lib/log-update.service';
3
- export * from './lib/check-for-update.service';
4
- export * from './lib/prompt-update/prompt-update.component.module';
5
- export * from './lib/prompt-update/prompt-update.component';
6
- export * from './lib/prompt-update/prompt-update.service';
7
- export * from './lib/snack-bar-update.service';
8
- export * from './lib/service-worker-snack-bar-update.module';
9
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/service-worker/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,2CAA2C,CAAC;AAC1D,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oDAAoD,CAAC;AACnE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8CAA8C,CAAC","sourcesContent":["export * from './lib/service-worker-prompt-update.module';\nexport * from './lib/log-update.service';\nexport * from './lib/check-for-update.service';\nexport * from './lib/prompt-update/prompt-update.component.module';\nexport * from './lib/prompt-update/prompt-update.component';\nexport * from './lib/prompt-update/prompt-update.service';\nexport * from './lib/snack-bar-update.service';\nexport * from './lib/service-worker-snack-bar-update.module';\n"]}
@@ -1,55 +0,0 @@
1
- import { Injectable, NgModule, Inject } from '@angular/core';
2
- import { SwUpdate } from '@angular/service-worker';
3
- import { tap, startWith } from 'rxjs/operators';
4
- import { interval } from 'rxjs';
5
- import { LifeCycleService } from '@rxap/life-cycle';
6
- import { log } from '@rxap/utilities/rxjs';
7
- import * as i0 from "@angular/core";
8
- import * as i1 from "@rxap/life-cycle";
9
- import * as i2 from "@angular/service-worker";
10
- export class CheckForUpdateService {
11
- constructor(lifeCycle, updates) {
12
- this.lifeCycle = lifeCycle;
13
- this.updates = updates;
14
- }
15
- start() {
16
- if (this.updates.isEnabled) {
17
- console.debug('start check for update');
18
- this.updates.checkForUpdate();
19
- this
20
- .lifeCycle
21
- .whenReady(() => interval(15 * 60 * 1000)
22
- .pipe(startWith(null), log('check for update'), tap(() => this.updates.checkForUpdate())))
23
- .subscribe();
24
- }
25
- }
26
- }
27
- CheckForUpdateService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: CheckForUpdateService, deps: [{ token: LifeCycleService }, { token: SwUpdate }], target: i0.ɵɵFactoryTarget.Injectable });
28
- CheckForUpdateService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: CheckForUpdateService, providedIn: 'root' });
29
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: CheckForUpdateService, decorators: [{
30
- type: Injectable,
31
- args: [{
32
- providedIn: 'root'
33
- }]
34
- }], ctorParameters: function () { return [{ type: i1.LifeCycleService, decorators: [{
35
- type: Inject,
36
- args: [LifeCycleService]
37
- }] }, { type: i2.SwUpdate, decorators: [{
38
- type: Inject,
39
- args: [SwUpdate]
40
- }] }]; } });
41
- export class CheckForUpdateModule {
42
- constructor(checkForUpdate) {
43
- checkForUpdate.start();
44
- }
45
- }
46
- CheckForUpdateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: CheckForUpdateModule, deps: [{ token: CheckForUpdateService }], target: i0.ɵɵFactoryTarget.NgModule });
47
- CheckForUpdateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: CheckForUpdateModule });
48
- CheckForUpdateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: CheckForUpdateModule });
49
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: CheckForUpdateModule, decorators: [{
50
- type: NgModule
51
- }], ctorParameters: function () { return [{ type: CheckForUpdateService, decorators: [{
52
- type: Inject,
53
- args: [CheckForUpdateService]
54
- }] }]; } });
55
- //# sourceMappingURL=check-for-update.service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"check-for-update.service.js","sourceRoot":"","sources":["../../../../../libs/service-worker/src/lib/check-for-update.service.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,QAAQ,EACR,MAAM,EACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EACL,GAAG,EACH,SAAS,EACV,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAChC,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;;;;AAK3C,MAAM,OAAO,qBAAqB;IAEhC,YAC6C,SAA2B,EACnC,OAAiB;QADT,cAAS,GAAT,SAAS,CAAkB;QACnC,YAAO,GAAP,OAAO,CAAU;IACnD,CAAC;IAEG,KAAK;QACV,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE;YAE1B,OAAO,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;YAExC,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC;YAE9B,IAAI;iBACD,SAAS;iBACT,SAAS,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;iBACtC,IAAI,CACH,SAAS,CAAC,IAAI,CAAC,EACf,GAAG,CAAC,kBAAkB,CAAC,EACvB,GAAG,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC,CACzC,CACF;iBACA,SAAS,EAAE,CAAC;SAEhB;IACH,CAAC;;kHA1BU,qBAAqB,kBAGtB,gBAAgB,aAChB,QAAQ;sHAJP,qBAAqB,cAFpB,MAAM;2FAEP,qBAAqB;kBAHjC,UAAU;mBAAC;oBACV,UAAU,EAAE,MAAM;iBACnB;;0BAII,MAAM;2BAAC,gBAAgB;;0BACvB,MAAM;2BAAC,QAAQ;;AA2BpB,MAAM,OAAO,oBAAoB;IAE/B,YAA2C,cAAqC;QAC9E,cAAc,CAAC,KAAK,EAAE,CAAC;IACzB,CAAC;;iHAJU,oBAAoB,kBAEX,qBAAqB;kHAF9B,oBAAoB;kHAApB,oBAAoB;2FAApB,oBAAoB;kBADhC,QAAQ;0DAGoD,qBAAqB;0BAAnE,MAAM;2BAAC,qBAAqB","sourcesContent":["import {\n Injectable,\n NgModule,\n Inject\n} from '@angular/core';\nimport { SwUpdate } from '@angular/service-worker';\nimport {\n tap,\n startWith\n} from 'rxjs/operators';\nimport { interval } from 'rxjs';\nimport { LifeCycleService } from '@rxap/life-cycle';\nimport { log } from '@rxap/utilities/rxjs';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class CheckForUpdateService {\n\n constructor(\n @Inject(LifeCycleService) private readonly lifeCycle: LifeCycleService,\n @Inject(SwUpdate) private readonly updates: SwUpdate,\n ) {}\n\n public start(): void {\n if (this.updates.isEnabled) {\n\n console.debug('start check for update');\n\n this.updates.checkForUpdate();\n\n this\n .lifeCycle\n .whenReady(() => interval(15 * 60 * 1000)\n .pipe(\n startWith(null),\n log('check for update'),\n tap(() => this.updates.checkForUpdate()),\n ),\n )\n .subscribe();\n\n }\n }\n\n}\n\n@NgModule()\nexport class CheckForUpdateModule {\n\n constructor(@Inject(CheckForUpdateService) checkForUpdate: CheckForUpdateService) {\n checkForUpdate.start();\n }\n\n}\n"]}
@@ -1,40 +0,0 @@
1
- import { Injectable, NgModule } from '@angular/core';
2
- import { SwUpdate } from '@angular/service-worker';
3
- import * as i0 from "@angular/core";
4
- import * as i1 from "@angular/service-worker";
5
- export class LogUpdateService {
6
- constructor(updates) {
7
- this.updates = updates;
8
- }
9
- start() {
10
- console.debug('start log update');
11
- this.updates.available.subscribe(event => {
12
- console.log('current version is', event.current);
13
- console.log('available version is', event.available);
14
- });
15
- this.updates.activated.subscribe(event => {
16
- console.log('old version was', event.previous);
17
- console.log('new version is', event.current);
18
- });
19
- }
20
- }
21
- LogUpdateService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: LogUpdateService, deps: [{ token: i1.SwUpdate }], target: i0.ɵɵFactoryTarget.Injectable });
22
- LogUpdateService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: LogUpdateService, providedIn: 'root' });
23
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: LogUpdateService, decorators: [{
24
- type: Injectable,
25
- args: [{
26
- providedIn: 'root'
27
- }]
28
- }], ctorParameters: function () { return [{ type: i1.SwUpdate }]; } });
29
- export class LogUpdateModule {
30
- constructor(logUpdate) {
31
- logUpdate.start();
32
- }
33
- }
34
- LogUpdateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: LogUpdateModule, deps: [{ token: LogUpdateService }], target: i0.ɵɵFactoryTarget.NgModule });
35
- LogUpdateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: LogUpdateModule });
36
- LogUpdateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: LogUpdateModule });
37
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: LogUpdateModule, decorators: [{
38
- type: NgModule
39
- }], ctorParameters: function () { return [{ type: LogUpdateService }]; } });
40
- //# sourceMappingURL=log-update.service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"log-update.service.js","sourceRoot":"","sources":["../../../../../libs/service-worker/src/lib/log-update.service.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,QAAQ,EACT,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;;;AAKnD,MAAM,OAAO,gBAAgB;IAE3B,YAA6B,OAAiB;QAAjB,YAAO,GAAP,OAAO,CAAU;IAAG,CAAC;IAE3C,KAAK;QACV,OAAO,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;QAClC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE;YACvC,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;YACjD,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;QACvD,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE;YACvC,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;YAC/C,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;IACL,CAAC;;6GAdU,gBAAgB;iHAAhB,gBAAgB,cAFf,MAAM;2FAEP,gBAAgB;kBAH5B,UAAU;mBAAC;oBACV,UAAU,EAAE,MAAM;iBACnB;;AAoBD,MAAM,OAAO,eAAe;IAE1B,YAAY,SAA2B;QACrC,SAAS,CAAC,KAAK,EAAE,CAAC;IACpB,CAAC;;4GAJU,eAAe,kBAEH,gBAAgB;6GAF5B,eAAe;6GAAf,eAAe;2FAAf,eAAe;kBAD3B,QAAQ;0DAGgB,gBAAgB","sourcesContent":["import {\n Injectable,\n NgModule\n} from '@angular/core';\nimport { SwUpdate } from '@angular/service-worker';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class LogUpdateService {\n\n constructor(private readonly updates: SwUpdate) {}\n\n public start() {\n console.debug('start log update');\n this.updates.available.subscribe(event => {\n console.log('current version is', event.current);\n console.log('available version is', event.available);\n });\n this.updates.activated.subscribe(event => {\n console.log('old version was', event.previous);\n console.log('new version is', event.current);\n });\n }\n\n}\n\n@NgModule()\nexport class LogUpdateModule {\n\n constructor(logUpdate: LogUpdateService) {\n logUpdate.start();\n }\n\n}\n"]}