@rxap/service-worker 19.2.0 → 21.0.1-dev.1
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/CHANGELOG.md +32 -0
- package/compodoc/changelog.html +30 -0
- package/compodoc/components/ServiceWorkerUpdateDialogComponent.html +123 -93
- package/compodoc/dependencies.html +7 -7
- package/compodoc/injectables/AutoUpdateService.html +4 -59
- package/compodoc/injectables/CheckForUpdateService.html +6 -72
- package/compodoc/injectables/DialogUpdateService.html +15 -78
- package/compodoc/injectables/LogUpdateService.html +4 -53
- package/compodoc/js/search/search_index.js +2 -2
- package/compodoc/properties.html +1 -1
- package/docs/documentation.json +212 -472
- package/docs/html/assets/search.js +1 -1
- package/docs/html/classes/AutoUpdateService.html +2 -2
- package/docs/html/classes/CheckForUpdateService.html +2 -2
- package/docs/html/classes/DialogUpdateService.html +2 -2
- package/docs/html/classes/LogUpdateService.html +2 -2
- package/docs/html/classes/ServiceWorkerUpdateDialogComponent.html +2 -6
- package/docs/html/classes/SnackbarUpdateService.html +2 -2
- package/docs/html/functions/ProvideServiceWorkerUpdater.html +1 -1
- package/docs/html/functions/UnregisterServiceWorker.html +1 -1
- package/docs/html/functions/withAutoUpdater.html +1 -1
- package/docs/html/functions/withDialogUpdater.html +1 -1
- package/docs/html/functions/withLogUpdater.html +1 -1
- package/docs/html/functions/withSnackbarUpdater.html +1 -1
- package/docs/html/index.html +2 -2
- package/docs/html/modules.html +1 -1
- package/docs/html/variables/UPDATE_AVAILABLE_EVENT.html +1 -1
- package/docs/markdown/README.md +1 -1
- package/docs/markdown/classes/AutoUpdateService.md +4 -12
- package/docs/markdown/classes/CheckForUpdateService.md +4 -16
- package/docs/markdown/classes/DialogUpdateService.md +4 -16
- package/docs/markdown/classes/LogUpdateService.md +4 -12
- package/docs/markdown/classes/ServiceWorkerUpdateDialogComponent.md +10 -32
- package/docs/markdown/classes/SnackbarUpdateService.md +3 -3
- package/docs/markdown/functions/ProvideServiceWorkerUpdater.md +2 -2
- package/docs/markdown/functions/UnregisterServiceWorker.md +2 -2
- package/docs/markdown/functions/withAutoUpdater.md +2 -2
- package/docs/markdown/functions/withDialogUpdater.md +2 -2
- package/docs/markdown/functions/withLogUpdater.md +2 -2
- package/docs/markdown/functions/withSnackbarUpdater.md +2 -2
- package/docs/markdown/globals.md +2 -2
- package/docs/markdown/variables/UPDATE_AVAILABLE_EVENT.md +2 -2
- package/docs/wiki/Class.AutoUpdateService.md +3 -11
- package/docs/wiki/Class.CheckForUpdateService.md +3 -15
- package/docs/wiki/Class.DialogUpdateService.md +3 -15
- package/docs/wiki/Class.LogUpdateService.md +3 -11
- package/docs/wiki/Class.ServiceWorkerUpdateDialogComponent.md +9 -31
- package/docs/wiki/Class.SnackbarUpdateService.md +2 -2
- package/docs/wiki/Function.ProvideServiceWorkerUpdater.md +1 -1
- package/docs/wiki/Function.UnregisterServiceWorker.md +1 -1
- package/docs/wiki/Function.withAutoUpdater.md +1 -1
- package/docs/wiki/Function.withDialogUpdater.md +1 -1
- package/docs/wiki/Function.withLogUpdater.md +1 -1
- package/docs/wiki/Function.withSnackbarUpdater.md +1 -1
- package/docs/wiki/Variable.UPDATE_AVAILABLE_EVENT.md +1 -1
- package/docs/wiki/globals.md +1 -1
- package/fesm2022/rxap-service-worker.mjs +51 -82
- package/fesm2022/rxap-service-worker.mjs.map +1 -1
- package/package.json +20 -19
- package/types/rxap-service-worker.d.ts +66 -0
- package/index.d.ts +0 -8
- package/lib/auto-update.service.d.ts +0 -9
- package/lib/check-for-update.service.d.ts +0 -12
- package/lib/dialog-update.service.d.ts +0 -12
- package/lib/log-update.service.d.ts +0 -9
- package/lib/provide-service-worker-updater.d.ts +0 -6
- package/lib/service-worker-update-dialog/service-worker-update-dialog.component.d.ts +0 -13
- package/lib/snackbar-update.service.d.ts +0 -9
- package/lib/unregister-service-worker.d.ts +0 -2
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **withDialogUpdater**(): `EnvironmentProviders`
|
|
6
6
|
|
|
7
|
-
Defined in: [provide-service-worker-updater.ts:30](https://gitlab.com/rxap/packages/-/blob/
|
|
7
|
+
Defined in: [provide-service-worker-updater.ts:30](https://gitlab.com/rxap/packages/-/blob/be7e221de2deba638078b6c685a94021679a1a5b/packages/angular/service-worker/src/lib/provide-service-worker-updater.ts#L30)
|
|
8
8
|
|
|
9
9
|
## Returns
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **withLogUpdater**(): `EnvironmentProviders`
|
|
6
6
|
|
|
7
|
-
Defined in: [provide-service-worker-updater.ts:23](https://gitlab.com/rxap/packages/-/blob/
|
|
7
|
+
Defined in: [provide-service-worker-updater.ts:23](https://gitlab.com/rxap/packages/-/blob/be7e221de2deba638078b6c685a94021679a1a5b/packages/angular/service-worker/src/lib/provide-service-worker-updater.ts#L23)
|
|
8
8
|
|
|
9
9
|
## Returns
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **withSnackbarUpdater**(): `EnvironmentProviders`
|
|
6
6
|
|
|
7
|
-
Defined in: [provide-service-worker-updater.ts:44](https://gitlab.com/rxap/packages/-/blob/
|
|
7
|
+
Defined in: [provide-service-worker-updater.ts:44](https://gitlab.com/rxap/packages/-/blob/be7e221de2deba638078b6c685a94021679a1a5b/packages/angular/service-worker/src/lib/provide-service-worker-updater.ts#L44)
|
|
8
8
|
|
|
9
9
|
## Returns
|
|
10
10
|
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
|
|
5
5
|
> `const` **UPDATE\_AVAILABLE\_EVENT**: `InjectionToken`\<`VersionEvent`\>
|
|
6
6
|
|
|
7
|
-
Defined in: [service-worker-update-dialog/service-worker-update-dialog.component.ts:
|
|
7
|
+
Defined in: [service-worker-update-dialog/service-worker-update-dialog.component.ts:15](https://gitlab.com/rxap/packages/-/blob/be7e221de2deba638078b6c685a94021679a1a5b/packages/angular/service-worker/src/lib/service-worker-update-dialog/service-worker-update-dialog.component.ts#L15)
|
package/docs/wiki/globals.md
CHANGED
|
@@ -1,46 +1,37 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { __decorate, __metadata } from 'tslib';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { InjectionToken,
|
|
4
|
-
import * as i1 from '@angular/service-worker';
|
|
3
|
+
import { InjectionToken, viewChild, output, inject, afterNextRender, ChangeDetectionStrategy, Component, Injectable, ApplicationRef, createComponent, Injector, provideAppInitializer } from '@angular/core';
|
|
5
4
|
import { SwUpdate } from '@angular/service-worker';
|
|
6
|
-
import { filter, interval, take } from 'rxjs';
|
|
5
|
+
import { filter, interval, take, finalize } from 'rxjs';
|
|
7
6
|
import { tap, startWith, concatMap } from 'rxjs/operators';
|
|
8
|
-
import * as i1$1 from '@rxap/life-cycle';
|
|
9
7
|
import { LifeCycleService } from '@rxap/life-cycle';
|
|
8
|
+
import { outputToObservable } from '@angular/core/rxjs-interop';
|
|
10
9
|
import { MatSnackBar } from '@angular/material/snack-bar';
|
|
11
|
-
|
|
12
10
|
const UPDATE_AVAILABLE_EVENT = new InjectionToken('UPDATE_AVAILABLE_EVENT');
|
|
13
|
-
class ServiceWorkerUpdateDialogComponent {
|
|
11
|
+
let ServiceWorkerUpdateDialogComponent = class ServiceWorkerUpdateDialogComponent {
|
|
14
12
|
constructor() {
|
|
15
|
-
this.
|
|
13
|
+
this.dialog = viewChild.required('dialog');
|
|
14
|
+
this.closeDialog = output();
|
|
16
15
|
this.updateAvailableEvent = inject(UPDATE_AVAILABLE_EVENT);
|
|
17
|
-
|
|
18
|
-
ngAfterViewInit() {
|
|
19
|
-
this.dialog.nativeElement.showModal();
|
|
16
|
+
afterNextRender(() => this.dialog().nativeElement.showModal());
|
|
20
17
|
}
|
|
21
18
|
close() {
|
|
22
|
-
this.dialog.nativeElement.close();
|
|
19
|
+
this.dialog().nativeElement.close();
|
|
23
20
|
this.closeDialog.emit();
|
|
24
21
|
}
|
|
25
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
26
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
27
|
-
}
|
|
28
|
-
|
|
22
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ServiceWorkerUpdateDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
23
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: ServiceWorkerUpdateDialogComponent, isStandalone: true, selector: "rxap-service-worker-update-dialog", outputs: { closeDialog: "closeDialog" }, viewQueries: [{ propertyName: "dialog", first: true, predicate: ["dialog"], descendants: true, isSignal: true }], ngImport: i0, template: "<dialog #dialog\n class=\"max-w-6xl rounded overflow-auto drop-shadow-2xl bg-white text-black dark:bg-black dark:text-white flex flex-col gap-3 p-6\">\n <h2 class=\"text-2xl font-bold\" i18n>A new application version is available</h2>\n @switch ($any(updateAvailableEvent).type) {\n @case ('VERSION_DETECTED') {\n <table class=\"table-auto\">\n <tr>\n <th i18n>Version hash</th>\n <td>{{$any(updateAvailableEvent)['version'].hash}}</td>\n </tr>\n </table>\n }\n @case ('VERSION_INSTALLATION_FAILED') {\n <table class=\"table-auto\">\n <tr>\n <th i18n>Version hash</th>\n <td>{{$any(updateAvailableEvent)['version'].hash}}</td>\n </tr>\n <tr>\n <th i18n>Version installation error</th>\n <td>{{$any(updateAvailableEvent)['error']}}</td>\n </tr>\n </table>\n }\n @case ('VERSION_READY') {\n <table class=\"table-auto\">\n <tr>\n <th i18n>Current version hash</th>\n <td>{{$any(updateAvailableEvent)['currentVersion'].hash}}</td>\n </tr>\n <tr>\n <th i18n>Last version hash</th>\n <td>{{$any(updateAvailableEvent)['latestVersion'].hash}}</td>\n </tr>\n </table>\n }\n @case ('NoNewVersionDetectedEvent') {\n <table class=\"table-auto\">\n <tr>\n <th i18n>Version hash</th>\n <td>{{$any(updateAvailableEvent)['version'].hash}}</td>\n </tr>\n </table>\n }\n }\n <button (click)=\"close()\" class=\"px-4 py-2 rounded bg-primary-500\" i18n>Update</button>\n</dialog>\n", styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
24
|
+
};
|
|
25
|
+
ServiceWorkerUpdateDialogComponent = __decorate([
|
|
26
|
+
__metadata("design:paramtypes", [])
|
|
27
|
+
], ServiceWorkerUpdateDialogComponent);
|
|
28
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ServiceWorkerUpdateDialogComponent, decorators: [{
|
|
29
29
|
type: Component,
|
|
30
|
-
args: [{ selector: 'rxap-service-worker-update-dialog', imports: [
|
|
31
|
-
|
|
32
|
-
NgSwitchCase,
|
|
33
|
-
], template: "<dialog #dialog\n class=\"max-w-6xl rounded overflow-auto drop-shadow-2xl bg-white text-black dark:bg-black dark:text-white flex flex-col gap-3 p-6\">\n <h2 class=\"text-2xl font-bold\" i18n>A new application version is available</h2>\n <ng-container [ngSwitch]=\"$any(updateAvailableEvent).type\">\n <table *ngSwitchCase=\"'VERSION_DETECTED'\" class=\"table-auto\">\n <tr>\n <th i18n>Version hash</th>\n <td>{{$any(updateAvailableEvent)['version'].hash}}</td>\n </tr>\n </table>\n <table *ngSwitchCase=\"'VERSION_INSTALLATION_FAILED'\" class=\"table-auto\">\n <tr>\n <th i18n>Version hash</th>\n <td>{{$any(updateAvailableEvent)['version'].hash}}</td>\n </tr>\n <tr>\n <th i18n>Version installation error</th>\n <td>{{$any(updateAvailableEvent)['error']}}</td>\n </tr>\n </table>\n <table *ngSwitchCase=\"'VERSION_READY'\" class=\"table-auto\">\n <tr>\n <th i18n>Current version hash</th>\n <td>{{$any(updateAvailableEvent)['currentVersion'].hash}}</td>\n </tr>\n <tr>\n <th i18n>Last version hash</th>\n <td>{{$any(updateAvailableEvent)['latestVersion'].hash}}</td>\n </tr>\n </table>\n <table *ngSwitchCase=\"'NoNewVersionDetectedEvent'\" class=\"table-auto\">\n <tr>\n <th i18n>Version hash</th>\n <td>{{$any(updateAvailableEvent)['version'].hash}}</td>\n </tr>\n </table>\n </ng-container>\n <button (click)=\"close()\" class=\"px-4 py-2 rounded bg-primary-500\" i18n>Update</button>\n</dialog>\n" }]
|
|
34
|
-
}], propDecorators: { dialog: [{
|
|
35
|
-
type: ViewChild,
|
|
36
|
-
args: ['dialog', { static: true }]
|
|
37
|
-
}], closeDialog: [{
|
|
38
|
-
type: Output
|
|
39
|
-
}] } });
|
|
40
|
-
|
|
30
|
+
args: [{ selector: 'rxap-service-worker-update-dialog', imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<dialog #dialog\n class=\"max-w-6xl rounded overflow-auto drop-shadow-2xl bg-white text-black dark:bg-black dark:text-white flex flex-col gap-3 p-6\">\n <h2 class=\"text-2xl font-bold\" i18n>A new application version is available</h2>\n @switch ($any(updateAvailableEvent).type) {\n @case ('VERSION_DETECTED') {\n <table class=\"table-auto\">\n <tr>\n <th i18n>Version hash</th>\n <td>{{$any(updateAvailableEvent)['version'].hash}}</td>\n </tr>\n </table>\n }\n @case ('VERSION_INSTALLATION_FAILED') {\n <table class=\"table-auto\">\n <tr>\n <th i18n>Version hash</th>\n <td>{{$any(updateAvailableEvent)['version'].hash}}</td>\n </tr>\n <tr>\n <th i18n>Version installation error</th>\n <td>{{$any(updateAvailableEvent)['error']}}</td>\n </tr>\n </table>\n }\n @case ('VERSION_READY') {\n <table class=\"table-auto\">\n <tr>\n <th i18n>Current version hash</th>\n <td>{{$any(updateAvailableEvent)['currentVersion'].hash}}</td>\n </tr>\n <tr>\n <th i18n>Last version hash</th>\n <td>{{$any(updateAvailableEvent)['latestVersion'].hash}}</td>\n </tr>\n </table>\n }\n @case ('NoNewVersionDetectedEvent') {\n <table class=\"table-auto\">\n <tr>\n <th i18n>Version hash</th>\n <td>{{$any(updateAvailableEvent)['version'].hash}}</td>\n </tr>\n </table>\n }\n }\n <button (click)=\"close()\" class=\"px-4 py-2 rounded bg-primary-500\" i18n>Update</button>\n</dialog>\n" }]
|
|
31
|
+
}], ctorParameters: () => [], propDecorators: { dialog: [{ type: i0.ViewChild, args: ['dialog', { isSignal: true }] }], closeDialog: [{ type: i0.Output, args: ["closeDialog"] }] } });
|
|
41
32
|
class AutoUpdateService {
|
|
42
|
-
constructor(
|
|
43
|
-
this.updates =
|
|
33
|
+
constructor() {
|
|
34
|
+
this.updates = inject(SwUpdate);
|
|
44
35
|
}
|
|
45
36
|
start() {
|
|
46
37
|
console.debug('start auto update service');
|
|
@@ -51,23 +42,19 @@ class AutoUpdateService {
|
|
|
51
42
|
})))
|
|
52
43
|
.subscribe();
|
|
53
44
|
}
|
|
54
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
55
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
45
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AutoUpdateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
46
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AutoUpdateService, providedIn: 'root' }); }
|
|
56
47
|
}
|
|
57
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
48
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AutoUpdateService, decorators: [{
|
|
58
49
|
type: Injectable,
|
|
59
50
|
args: [{
|
|
60
51
|
providedIn: 'root',
|
|
61
52
|
}]
|
|
62
|
-
}]
|
|
63
|
-
type: Inject,
|
|
64
|
-
args: [SwUpdate]
|
|
65
|
-
}] }] });
|
|
66
|
-
|
|
53
|
+
}] });
|
|
67
54
|
class CheckForUpdateService {
|
|
68
|
-
constructor(
|
|
69
|
-
this.lifeCycle =
|
|
70
|
-
this.updates =
|
|
55
|
+
constructor() {
|
|
56
|
+
this.lifeCycle = inject(LifeCycleService);
|
|
57
|
+
this.updates = inject(SwUpdate);
|
|
71
58
|
this._started = false;
|
|
72
59
|
}
|
|
73
60
|
start() {
|
|
@@ -89,26 +76,19 @@ class CheckForUpdateService {
|
|
|
89
76
|
console.warn('service worker updates are not enabled');
|
|
90
77
|
}
|
|
91
78
|
}
|
|
92
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
93
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
79
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CheckForUpdateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
80
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CheckForUpdateService, providedIn: 'root' }); }
|
|
94
81
|
}
|
|
95
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
82
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CheckForUpdateService, decorators: [{
|
|
96
83
|
type: Injectable,
|
|
97
84
|
args: [{
|
|
98
85
|
providedIn: 'root',
|
|
99
86
|
}]
|
|
100
|
-
}]
|
|
101
|
-
type: Inject,
|
|
102
|
-
args: [LifeCycleService]
|
|
103
|
-
}] }, { type: i1.SwUpdate, decorators: [{
|
|
104
|
-
type: Inject,
|
|
105
|
-
args: [SwUpdate]
|
|
106
|
-
}] }] });
|
|
107
|
-
|
|
87
|
+
}] });
|
|
108
88
|
class DialogUpdateService {
|
|
109
|
-
constructor(
|
|
110
|
-
this.applicationRef =
|
|
111
|
-
this.updates =
|
|
89
|
+
constructor() {
|
|
90
|
+
this.applicationRef = inject(ApplicationRef);
|
|
91
|
+
this.updates = inject(SwUpdate);
|
|
112
92
|
}
|
|
113
93
|
start() {
|
|
114
94
|
console.debug('start dialog update service');
|
|
@@ -137,31 +117,27 @@ class DialogUpdateService {
|
|
|
137
117
|
}),
|
|
138
118
|
});
|
|
139
119
|
this.applicationRef.attachView(componentRef.hostView);
|
|
140
|
-
|
|
120
|
+
// The cleanup must run after the close event has been forwarded. Destroying the component
|
|
121
|
+
// inside a tap completes the output observable before the value reaches the subscriber,
|
|
122
|
+
// so the update would never be activated.
|
|
123
|
+
return outputToObservable(componentRef.instance.closeDialog).pipe(take(1), finalize(() => {
|
|
141
124
|
componentRef.destroy();
|
|
142
125
|
body.removeChild(div);
|
|
143
126
|
div.remove();
|
|
144
127
|
}));
|
|
145
128
|
}
|
|
146
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
147
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
129
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DialogUpdateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
130
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DialogUpdateService, providedIn: 'root' }); }
|
|
148
131
|
}
|
|
149
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
132
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DialogUpdateService, decorators: [{
|
|
150
133
|
type: Injectable,
|
|
151
134
|
args: [{
|
|
152
135
|
providedIn: 'root',
|
|
153
136
|
}]
|
|
154
|
-
}]
|
|
155
|
-
type: Inject,
|
|
156
|
-
args: [ApplicationRef]
|
|
157
|
-
}] }, { type: i1.SwUpdate, decorators: [{
|
|
158
|
-
type: Inject,
|
|
159
|
-
args: [SwUpdate]
|
|
160
|
-
}] }] });
|
|
161
|
-
|
|
137
|
+
}] });
|
|
162
138
|
class LogUpdateService {
|
|
163
|
-
constructor(
|
|
164
|
-
this.updates =
|
|
139
|
+
constructor() {
|
|
140
|
+
this.updates = inject(SwUpdate);
|
|
165
141
|
}
|
|
166
142
|
start() {
|
|
167
143
|
console.debug('start log update');
|
|
@@ -169,16 +145,15 @@ class LogUpdateService {
|
|
|
169
145
|
console.log('version update event', event);
|
|
170
146
|
});
|
|
171
147
|
}
|
|
172
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
173
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
148
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: LogUpdateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
149
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: LogUpdateService, providedIn: 'root' }); }
|
|
174
150
|
}
|
|
175
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
151
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: LogUpdateService, decorators: [{
|
|
176
152
|
type: Injectable,
|
|
177
153
|
args: [{
|
|
178
154
|
providedIn: 'root',
|
|
179
155
|
}]
|
|
180
|
-
}]
|
|
181
|
-
|
|
156
|
+
}] });
|
|
182
157
|
class SnackbarUpdateService {
|
|
183
158
|
constructor() {
|
|
184
159
|
this.snackBar = inject(MatSnackBar);
|
|
@@ -198,16 +173,15 @@ class SnackbarUpdateService {
|
|
|
198
173
|
const ref = this.snackBar.open($localize `A new version is available`, $localize `Update`);
|
|
199
174
|
return ref.afterDismissed().pipe(take(1));
|
|
200
175
|
}
|
|
201
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
202
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
176
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: SnackbarUpdateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
177
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: SnackbarUpdateService, providedIn: 'root' }); }
|
|
203
178
|
}
|
|
204
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
179
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: SnackbarUpdateService, decorators: [{
|
|
205
180
|
type: Injectable,
|
|
206
181
|
args: [{
|
|
207
182
|
providedIn: 'root',
|
|
208
183
|
}]
|
|
209
184
|
}] });
|
|
210
|
-
|
|
211
185
|
function ProvideServiceWorkerUpdater(...providers) {
|
|
212
186
|
return [
|
|
213
187
|
provideAppInitializer(() => {
|
|
@@ -241,7 +215,6 @@ function withSnackbarUpdater() {
|
|
|
241
215
|
return initializerFn();
|
|
242
216
|
});
|
|
243
217
|
}
|
|
244
|
-
|
|
245
218
|
function UnregisterServiceWorker(environment) {
|
|
246
219
|
if (!environment.serviceWorker) {
|
|
247
220
|
navigator?.serviceWorker?.getRegistrations().then(async (registrations) => {
|
|
@@ -258,13 +231,9 @@ function UnregisterServiceWorker(environment) {
|
|
|
258
231
|
});
|
|
259
232
|
}
|
|
260
233
|
}
|
|
261
|
-
|
|
262
234
|
// region service-worker-update-dialog
|
|
263
235
|
// endregion
|
|
264
|
-
|
|
265
236
|
/**
|
|
266
237
|
* Generated bundle index. Do not edit.
|
|
267
238
|
*/
|
|
268
|
-
|
|
269
239
|
export { AutoUpdateService, CheckForUpdateService, DialogUpdateService, LogUpdateService, ProvideServiceWorkerUpdater, ServiceWorkerUpdateDialogComponent, SnackbarUpdateService, UPDATE_AVAILABLE_EVENT, UnregisterServiceWorker, withAutoUpdater, withDialogUpdater, withLogUpdater, withSnackbarUpdater };
|
|
270
|
-
//# sourceMappingURL=rxap-service-worker.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rxap-service-worker.mjs","sources":["../../../../../packages/angular/service-worker/src/lib/service-worker-update-dialog/service-worker-update-dialog.component.ts","../../../../../packages/angular/service-worker/src/lib/service-worker-update-dialog/service-worker-update-dialog.component.html","../../../../../packages/angular/service-worker/src/lib/auto-update.service.ts","../../../../../packages/angular/service-worker/src/lib/check-for-update.service.ts","../../../../../packages/angular/service-worker/src/lib/dialog-update.service.ts","../../../../../packages/angular/service-worker/src/lib/log-update.service.ts","../../../../../packages/angular/service-worker/src/lib/snackbar-update.service.ts","../../../../../packages/angular/service-worker/src/lib/provide-service-worker-updater.ts","../../../../../packages/angular/service-worker/src/lib/unregister-service-worker.ts","../../../../../packages/angular/service-worker/src/index.ts","../../../../../packages/angular/service-worker/src/rxap-service-worker.ts"],"sourcesContent":["import {\n NgSwitch,\n NgSwitchCase,\n} from '@angular/common';\nimport {\n AfterViewInit,\n Component,\n ElementRef,\n EventEmitter,\n inject,\n InjectionToken,\n Output,\n ViewChild,\n} from '@angular/core';\nimport { VersionEvent } from '@angular/service-worker';\n\nexport const UPDATE_AVAILABLE_EVENT = new InjectionToken<VersionEvent>('UPDATE_AVAILABLE_EVENT');\n\n@Component({\n selector: 'rxap-service-worker-update-dialog',\n imports: [\n NgSwitch,\n NgSwitchCase,\n ],\n templateUrl: './service-worker-update-dialog.component.html',\n styleUrls: ['./service-worker-update-dialog.component.scss']\n})\nexport class ServiceWorkerUpdateDialogComponent implements AfterViewInit {\n\n @ViewChild('dialog', { static: true })\n public dialog!: ElementRef<HTMLDialogElement>;\n\n @Output()\n public closeDialog = new EventEmitter<void>();\n\n public readonly updateAvailableEvent = inject(UPDATE_AVAILABLE_EVENT);\n\n ngAfterViewInit() {\n this.dialog.nativeElement.showModal();\n }\n\n close() {\n this.dialog.nativeElement.close();\n this.closeDialog.emit();\n }\n\n}\n","<dialog #dialog\n class=\"max-w-6xl rounded overflow-auto drop-shadow-2xl bg-white text-black dark:bg-black dark:text-white flex flex-col gap-3 p-6\">\n <h2 class=\"text-2xl font-bold\" i18n>A new application version is available</h2>\n <ng-container [ngSwitch]=\"$any(updateAvailableEvent).type\">\n <table *ngSwitchCase=\"'VERSION_DETECTED'\" class=\"table-auto\">\n <tr>\n <th i18n>Version hash</th>\n <td>{{$any(updateAvailableEvent)['version'].hash}}</td>\n </tr>\n </table>\n <table *ngSwitchCase=\"'VERSION_INSTALLATION_FAILED'\" class=\"table-auto\">\n <tr>\n <th i18n>Version hash</th>\n <td>{{$any(updateAvailableEvent)['version'].hash}}</td>\n </tr>\n <tr>\n <th i18n>Version installation error</th>\n <td>{{$any(updateAvailableEvent)['error']}}</td>\n </tr>\n </table>\n <table *ngSwitchCase=\"'VERSION_READY'\" class=\"table-auto\">\n <tr>\n <th i18n>Current version hash</th>\n <td>{{$any(updateAvailableEvent)['currentVersion'].hash}}</td>\n </tr>\n <tr>\n <th i18n>Last version hash</th>\n <td>{{$any(updateAvailableEvent)['latestVersion'].hash}}</td>\n </tr>\n </table>\n <table *ngSwitchCase=\"'NoNewVersionDetectedEvent'\" class=\"table-auto\">\n <tr>\n <th i18n>Version hash</th>\n <td>{{$any(updateAvailableEvent)['version'].hash}}</td>\n </tr>\n </table>\n </ng-container>\n <button (click)=\"close()\" class=\"px-4 py-2 rounded bg-primary-500\" i18n>Update</button>\n</dialog>\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\nimport { SwUpdate } from '@angular/service-worker';\nimport { filter } from 'rxjs';\nimport { tap } from 'rxjs/operators';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AutoUpdateService {\n\n constructor(\n @Inject(SwUpdate)\n private readonly updates: SwUpdate,\n ) {\n }\n\n public start(): void {\n console.debug('start auto update service');\n this.updates.versionUpdates\n .pipe(\n filter(event => event.type === 'VERSION_READY'),\n tap(() => console.log('start auto app update')),\n tap(() =>\n this.updates.activateUpdate().then(() => {\n console.log('auto app update completed. Reload app.');\n document.location.reload();\n }),\n ),\n )\n .subscribe();\n }\n\n}\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\nimport { SwUpdate } from '@angular/service-worker';\nimport { LifeCycleService } from '@rxap/life-cycle';\nimport { interval } from 'rxjs';\nimport {\n startWith,\n tap,\n} from 'rxjs/operators';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class CheckForUpdateService {\n\n private _started = false;\n\n constructor(\n @Inject(LifeCycleService) private readonly lifeCycle: LifeCycleService,\n @Inject(SwUpdate) private readonly updates: SwUpdate,\n ) {\n }\n\n public start(): void {\n if (this._started) {\n console.warn('check for update already started');\n return;\n }\n this._started = true;\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 tap(() => console.log('check for update')),\n tap(() => this.updates.checkForUpdate()),\n ),\n )\n .subscribe();\n\n } else {\n console.warn('service worker updates are not enabled');\n }\n }\n\n}\n","import {\n ApplicationRef,\n createComponent,\n Inject,\n Injectable,\n Injector,\n} from '@angular/core';\nimport {\n SwUpdate,\n VersionEvent,\n} from '@angular/service-worker';\nimport {\n filter,\n Observable,\n} from 'rxjs';\nimport {\n concatMap,\n tap,\n} from 'rxjs/operators';\nimport {\n ServiceWorkerUpdateDialogComponent,\n UPDATE_AVAILABLE_EVENT,\n} from './service-worker-update-dialog/service-worker-update-dialog.component';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DialogUpdateService {\n constructor(\n @Inject(ApplicationRef)\n private readonly applicationRef: ApplicationRef,\n @Inject(SwUpdate)\n private readonly updates: SwUpdate,\n ) {\n }\n\n public start(): void {\n console.debug('start dialog update service');\n this.updates.versionUpdates\n .pipe(\n filter(event => event.type === 'VERSION_READY'),\n concatMap((event) => this.openUpdateDialog(event)),\n tap(() => console.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 openUpdateDialog(event: VersionEvent): Observable<void> {\n console.debug('open update dialog');\n const body = document.getElementsByTagName('body')[0];\n const div = document.createElement('div');\n body.appendChild(div);\n const componentRef = createComponent(ServiceWorkerUpdateDialogComponent, {\n hostElement: div,\n environmentInjector: this.applicationRef.injector,\n elementInjector: Injector.create({\n providers: [\n {\n provide: UPDATE_AVAILABLE_EVENT,\n useValue: event,\n },\n ],\n }),\n });\n this.applicationRef.attachView(componentRef.hostView);\n\n return componentRef.instance.closeDialog.pipe(\n tap(() => {\n componentRef.destroy();\n body.removeChild(div);\n div.remove();\n }),\n );\n }\n}\n","import { Injectable } from '@angular/core';\nimport { SwUpdate } from '@angular/service-worker';\nimport { filter } from 'rxjs';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class LogUpdateService {\n\n constructor(private readonly updates: SwUpdate) {\n }\n\n public start() {\n console.debug('start log update');\n this.updates.versionUpdates.pipe(\n filter(event => event.type !== 'NO_NEW_VERSION_DETECTED'),\n ).subscribe(event => {\n console.log('version update event', event);\n });\n }\n\n}\n\n","import {\n inject,\n Injectable,\n} from '@angular/core';\nimport { MatSnackBar } from '@angular/material/snack-bar';\nimport {\n SwUpdate,\n VersionEvent,\n} from '@angular/service-worker';\nimport {\n filter,\n Observable,\n take,\n} from 'rxjs';\nimport {\n concatMap,\n tap,\n} from 'rxjs/operators';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class SnackbarUpdateService {\n private readonly snackBar = inject(MatSnackBar);\n private readonly updates = inject(SwUpdate);\n\n public start(): void {\n console.debug('start dialog update service');\n this.updates.versionUpdates\n .pipe(\n filter(event => event.type === 'VERSION_READY'),\n concatMap((event) => this.openUpdateSnackBar(event)),\n tap(() => console.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 openUpdateSnackBar(event: VersionEvent): Observable<any> {\n console.debug('open update snack bar');\n const ref = this.snackBar.open($localize`A new version is available`, $localize`Update`);\n return ref.afterDismissed().pipe(\n take(1),\n );\n }\n}\n","import {\n Provider,\n inject,\n provideAppInitializer,\n EnvironmentProviders,\n} from '@angular/core';\nimport { AutoUpdateService } from './auto-update.service';\nimport { CheckForUpdateService } from './check-for-update.service';\nimport { DialogUpdateService } from './dialog-update.service';\nimport { LogUpdateService } from './log-update.service';\nimport { SnackbarUpdateService } from './snackbar-update.service';\n\nexport function ProvideServiceWorkerUpdater(...providers: Array<Provider | EnvironmentProviders>): Array<Provider | EnvironmentProviders> {\n return [\n provideAppInitializer(() => {\n const initializerFn = ((checkForUpdate: CheckForUpdateService) => () => checkForUpdate.start())(inject(CheckForUpdateService));\n return initializerFn();\n }),\n ...providers,\n ];\n}\n\nexport function withLogUpdater() {\n return provideAppInitializer(() => {\n const initializerFn = ((logUpdateService: LogUpdateService) => () => logUpdateService.start())(inject(LogUpdateService));\n return initializerFn();\n });\n}\n\nexport function withDialogUpdater() {\n return provideAppInitializer(() => {\n const initializerFn = ((dus: DialogUpdateService) => () => dus.start())(inject(DialogUpdateService));\n return initializerFn();\n });\n}\n\nexport function withAutoUpdater() {\n return provideAppInitializer(() => {\n const initializerFn = ((aus: AutoUpdateService) => () => aus.start())(inject(AutoUpdateService));\n return initializerFn();\n });\n}\n\nexport function withSnackbarUpdater() {\n return provideAppInitializer(() => {\n const initializerFn = ((snackbarUpdateService: SnackbarUpdateService) => () => snackbarUpdateService.start())(inject(SnackbarUpdateService));\n return initializerFn();\n });\n}\n","import { Environment } from '@rxap/environment';\n\nexport function UnregisterServiceWorker(environment: Environment) {\n if (!environment.serviceWorker) {\n navigator?.serviceWorker?.getRegistrations().then(async (registrations) => {\n await Promise.all(registrations.map((registration) => {\n console.log('unregister service worker: ' + registration.scope);\n return registration.unregister();\n }));\n if (registrations.length) {\n const response = confirm(\n 'All dangling service worker are unregistered. Should the application be reloaded to complete the migration');\n if (response) {\n location.reload();\n }\n }\n });\n }\n}\n","// region service-worker-update-dialog\nexport * from './lib/service-worker-update-dialog/service-worker-update-dialog.component';\n// endregion\n\n// region \nexport * from './lib/auto-update.service';\nexport * from './lib/check-for-update.service';\nexport * from './lib/dialog-update.service';\nexport * from './lib/log-update.service';\nexport * from './lib/provide-service-worker-updater';\nexport * from './lib/snackbar-update.service';\nexport * from './lib/unregister-service-worker';\n// endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;MAgBa,sBAAsB,GAAG,IAAI,cAAc,CAAe,wBAAwB;MAWlF,kCAAkC,CAAA;AAT/C,IAAA,WAAA,GAAA;AAeS,QAAA,IAAA,CAAA,WAAW,GAAG,IAAI,YAAY,EAAQ;AAE7B,QAAA,IAAA,CAAA,oBAAoB,GAAG,MAAM,CAAC,sBAAsB,CAAC;AAWtE;IATC,eAAe,GAAA;AACb,QAAA,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,SAAS,EAAE;;IAGvC,KAAK,GAAA;AACH,QAAA,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,EAAE;AACjC,QAAA,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE;;+GAhBd,kCAAkC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAlC,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,kCAAkC,EC3B/C,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,mCAAA,EAAA,OAAA,EAAA,EAAA,WAA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,CAAC,CAAC;QACpG,OAAO,aAAa,EAAE;AACxB,KAAC,CAAC;AACR;SAEgB,eAAe,GAAA;IAC7B,OAAO,qBAAqB,CAAC,MAAK;QAC5B,MAAM,aAAa,GAAG,CAAC,CAAC,GAAsB,KAAK,MAAM,GAAG,CAAC,KAAK,EAAE,EAAE,MAAM,CAAC,iBAAiB,CAAC,CAAC;QAChG,OAAO,aAAa,EAAE;AACxB,KAAC,CAAC;AACR;SAEgB,mBAAmB,GAAA;IACjC,OAAO,qBAAqB,CAAC,MAAK;QAC5B,MAAM,aAAa,GAAG,CAAC,CAAC,qBAA4C,KAAK,MAAM,qBAAqB,CAAC,KAAK,EAAE,EAAE,MAAM,CAAC,qBAAqB,CAAC,CAAC;QAC5I,OAAO,aAAa,EAAE;AACxB,KAAC,CAAC;AACR;;AC9CM,SAAU,uBAAuB,CAAC,WAAwB,EAAA;AAC9D,IAAA,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE;AAC9B,QAAA,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,CAAC,IAAI,CAAC,OAAO,aAAa,KAAI;YACxE,MAAM,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,YAAY,KAAI;gBACnD,OAAO,CAAC,GAAG,CAAC,6BAA6B,GAAG,YAAY,CAAC,KAAK,CAAC;AAC/D,gBAAA,OAAO,YAAY,CAAC,UAAU,EAAE;aACjC,CAAC,CAAC;AACH,YAAA,IAAI,aAAa,CAAC,MAAM,EAAE;AACxB,gBAAA,MAAM,QAAQ,GAAG,OAAO,CACtB,4GAA4G,CAAC;gBAC/G,IAAI,QAAQ,EAAE;oBACZ,QAAQ,CAAC,MAAM,EAAE;;;AAGvB,SAAC,CAAC;;AAEN;;AClBA;AAYA;;ACZA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"rxap-service-worker.mjs","sources":["../../../../../packages/angular/service-worker/src/lib/service-worker-update-dialog/service-worker-update-dialog.component.ts","../../../../../packages/angular/service-worker/src/lib/service-worker-update-dialog/service-worker-update-dialog.component.html","../../../../../packages/angular/service-worker/src/lib/auto-update.service.ts","../../../../../packages/angular/service-worker/src/lib/check-for-update.service.ts","../../../../../packages/angular/service-worker/src/lib/dialog-update.service.ts","../../../../../packages/angular/service-worker/src/lib/log-update.service.ts","../../../../../packages/angular/service-worker/src/lib/snackbar-update.service.ts","../../../../../packages/angular/service-worker/src/lib/provide-service-worker-updater.ts","../../../../../packages/angular/service-worker/src/lib/unregister-service-worker.ts","../../../../../packages/angular/service-worker/src/index.ts","../../../../../packages/angular/service-worker/src/rxap-service-worker.ts"],"sourcesContent":["\nimport {\n afterNextRender,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n inject,\n InjectionToken,\n output,\n viewChild\n} from '@angular/core';\nimport { VersionEvent } from '@angular/service-worker';\nimport { Showcase } from '@ng-prism/core';\n\nexport const UPDATE_AVAILABLE_EVENT = new InjectionToken<VersionEvent>('UPDATE_AVAILABLE_EVENT');\n\n@Showcase({\n title: 'Service Worker Update Dialog',\n category: 'Service Worker',\n description: 'Modal dialog that informs the user about an available app update. The `UPDATE_AVAILABLE_EVENT` is provided by the styleguide host.',\n status: 'stable',\n variants: [\n { name: 'Default' },\n ],\n})\n@Component({\n selector: 'rxap-service-worker-update-dialog',\n imports: [],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './service-worker-update-dialog.component.html',\n styleUrls: ['./service-worker-update-dialog.component.scss']\n})\nexport class ServiceWorkerUpdateDialogComponent {\n\n public readonly dialog = viewChild.required<ElementRef<HTMLDialogElement>>('dialog');\n\n public readonly closeDialog = output<void>();\n\n public readonly updateAvailableEvent = inject(UPDATE_AVAILABLE_EVENT);\n\n constructor() {\n afterNextRender(() => this.dialog().nativeElement.showModal());\n }\n\n close() {\n this.dialog().nativeElement.close();\n this.closeDialog.emit();\n }\n\n}\n","<dialog #dialog\n class=\"max-w-6xl rounded overflow-auto drop-shadow-2xl bg-white text-black dark:bg-black dark:text-white flex flex-col gap-3 p-6\">\n <h2 class=\"text-2xl font-bold\" i18n>A new application version is available</h2>\n @switch ($any(updateAvailableEvent).type) {\n @case ('VERSION_DETECTED') {\n <table class=\"table-auto\">\n <tr>\n <th i18n>Version hash</th>\n <td>{{$any(updateAvailableEvent)['version'].hash}}</td>\n </tr>\n </table>\n }\n @case ('VERSION_INSTALLATION_FAILED') {\n <table class=\"table-auto\">\n <tr>\n <th i18n>Version hash</th>\n <td>{{$any(updateAvailableEvent)['version'].hash}}</td>\n </tr>\n <tr>\n <th i18n>Version installation error</th>\n <td>{{$any(updateAvailableEvent)['error']}}</td>\n </tr>\n </table>\n }\n @case ('VERSION_READY') {\n <table class=\"table-auto\">\n <tr>\n <th i18n>Current version hash</th>\n <td>{{$any(updateAvailableEvent)['currentVersion'].hash}}</td>\n </tr>\n <tr>\n <th i18n>Last version hash</th>\n <td>{{$any(updateAvailableEvent)['latestVersion'].hash}}</td>\n </tr>\n </table>\n }\n @case ('NoNewVersionDetectedEvent') {\n <table class=\"table-auto\">\n <tr>\n <th i18n>Version hash</th>\n <td>{{$any(updateAvailableEvent)['version'].hash}}</td>\n </tr>\n </table>\n }\n }\n <button (click)=\"close()\" class=\"px-4 py-2 rounded bg-primary-500\" i18n>Update</button>\n</dialog>\n","import { Injectable, inject } from '@angular/core';\nimport { SwUpdate } from '@angular/service-worker';\nimport { filter } from 'rxjs';\nimport { tap } from 'rxjs/operators';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AutoUpdateService {\n private readonly updates = inject<SwUpdate>(SwUpdate);\n\n\n public start(): void {\n console.debug('start auto update service');\n this.updates.versionUpdates\n .pipe(\n filter(event => event.type === 'VERSION_READY'),\n tap(() => console.log('start auto app update')),\n tap(() =>\n this.updates.activateUpdate().then(() => {\n console.log('auto app update completed. Reload app.');\n document.location.reload();\n }),\n ),\n )\n .subscribe();\n }\n\n}\n","import { Injectable, inject } from '@angular/core';\nimport { SwUpdate } from '@angular/service-worker';\nimport { LifeCycleService } from '@rxap/life-cycle';\nimport { interval } from 'rxjs';\nimport {\n startWith,\n tap,\n} from 'rxjs/operators';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class CheckForUpdateService {\n private readonly lifeCycle = inject<LifeCycleService>(LifeCycleService);\n private readonly updates = inject<SwUpdate>(SwUpdate);\n\n\n private _started = false;\n\n public start(): void {\n if (this._started) {\n console.warn('check for update already started');\n return;\n }\n this._started = true;\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 tap(() => console.log('check for update')),\n tap(() => this.updates.checkForUpdate()),\n ),\n )\n .subscribe();\n\n } else {\n console.warn('service worker updates are not enabled');\n }\n }\n\n}\n","import { ApplicationRef, createComponent, Injectable, Injector, inject } from '@angular/core';\nimport { outputToObservable } from '@angular/core/rxjs-interop';\nimport {\n SwUpdate,\n VersionEvent,\n} from '@angular/service-worker';\nimport {\n filter,\n finalize,\n Observable,\n take,\n} from 'rxjs';\nimport {\n concatMap,\n tap,\n} from 'rxjs/operators';\nimport {\n ServiceWorkerUpdateDialogComponent,\n UPDATE_AVAILABLE_EVENT,\n} from './service-worker-update-dialog/service-worker-update-dialog.component';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DialogUpdateService {\n private readonly applicationRef = inject<ApplicationRef>(ApplicationRef);\n private readonly updates = inject<SwUpdate>(SwUpdate);\n\n\n public start(): void {\n console.debug('start dialog update service');\n this.updates.versionUpdates\n .pipe(\n filter(event => event.type === 'VERSION_READY'),\n concatMap((event) => this.openUpdateDialog(event)),\n tap(() => console.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 openUpdateDialog(event: VersionEvent): Observable<void> {\n console.debug('open update dialog');\n const body = document.getElementsByTagName('body')[0];\n const div = document.createElement('div');\n body.appendChild(div);\n const componentRef = createComponent(ServiceWorkerUpdateDialogComponent, {\n hostElement: div,\n environmentInjector: this.applicationRef.injector,\n elementInjector: Injector.create({\n providers: [\n {\n provide: UPDATE_AVAILABLE_EVENT,\n useValue: event,\n },\n ],\n }),\n });\n this.applicationRef.attachView(componentRef.hostView);\n\n // The cleanup must run after the close event has been forwarded. Destroying the component\n // inside a tap completes the output observable before the value reaches the subscriber,\n // so the update would never be activated.\n return outputToObservable(componentRef.instance.closeDialog).pipe(\n take(1),\n finalize(() => {\n componentRef.destroy();\n body.removeChild(div);\n div.remove();\n }),\n );\n }\n}\n","import { Injectable, inject } from '@angular/core';\nimport { SwUpdate } from '@angular/service-worker';\nimport { filter } from 'rxjs';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class LogUpdateService {\n private readonly updates = inject(SwUpdate);\n\n\n public start() {\n console.debug('start log update');\n this.updates.versionUpdates.pipe(\n filter(event => event.type !== 'NO_NEW_VERSION_DETECTED'),\n ).subscribe(event => {\n console.log('version update event', event);\n });\n }\n\n}\n\n","import {\n inject,\n Injectable,\n} from '@angular/core';\nimport { MatSnackBar } from '@angular/material/snack-bar';\nimport {\n SwUpdate,\n VersionEvent,\n} from '@angular/service-worker';\nimport {\n filter,\n Observable,\n take,\n} from 'rxjs';\nimport {\n concatMap,\n tap,\n} from 'rxjs/operators';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class SnackbarUpdateService {\n private readonly snackBar = inject(MatSnackBar);\n private readonly updates = inject(SwUpdate);\n\n public start(): void {\n console.debug('start dialog update service');\n this.updates.versionUpdates\n .pipe(\n filter(event => event.type === 'VERSION_READY'),\n concatMap((event) => this.openUpdateSnackBar(event)),\n tap(() => console.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 openUpdateSnackBar(event: VersionEvent): Observable<any> {\n console.debug('open update snack bar');\n const ref = this.snackBar.open($localize`A new version is available`, $localize`Update`);\n return ref.afterDismissed().pipe(\n take(1),\n );\n }\n}\n","import {\n Provider,\n inject,\n provideAppInitializer,\n EnvironmentProviders,\n} from '@angular/core';\nimport { AutoUpdateService } from './auto-update.service';\nimport { CheckForUpdateService } from './check-for-update.service';\nimport { DialogUpdateService } from './dialog-update.service';\nimport { LogUpdateService } from './log-update.service';\nimport { SnackbarUpdateService } from './snackbar-update.service';\n\nexport function ProvideServiceWorkerUpdater(...providers: Array<Provider | EnvironmentProviders>): Array<Provider | EnvironmentProviders> {\n return [\n provideAppInitializer(() => {\n const initializerFn = ((checkForUpdate: CheckForUpdateService) => () => checkForUpdate.start())(inject(CheckForUpdateService));\n return initializerFn();\n }),\n ...providers,\n ];\n}\n\nexport function withLogUpdater() {\n return provideAppInitializer(() => {\n const initializerFn = ((logUpdateService: LogUpdateService) => () => logUpdateService.start())(inject(LogUpdateService));\n return initializerFn();\n });\n}\n\nexport function withDialogUpdater() {\n return provideAppInitializer(() => {\n const initializerFn = ((dus: DialogUpdateService) => () => dus.start())(inject(DialogUpdateService));\n return initializerFn();\n });\n}\n\nexport function withAutoUpdater() {\n return provideAppInitializer(() => {\n const initializerFn = ((aus: AutoUpdateService) => () => aus.start())(inject(AutoUpdateService));\n return initializerFn();\n });\n}\n\nexport function withSnackbarUpdater() {\n return provideAppInitializer(() => {\n const initializerFn = ((snackbarUpdateService: SnackbarUpdateService) => () => snackbarUpdateService.start())(inject(SnackbarUpdateService));\n return initializerFn();\n });\n}\n","import { Environment } from '@rxap/environment';\n\nexport function UnregisterServiceWorker(environment: Environment) {\n if (!environment.serviceWorker) {\n navigator?.serviceWorker?.getRegistrations().then(async (registrations) => {\n await Promise.all(registrations.map((registration) => {\n console.log('unregister service worker: ' + registration.scope);\n return registration.unregister();\n }));\n if (registrations.length) {\n const response = confirm(\n 'All dangling service worker are unregistered. Should the application be reloaded to complete the migration');\n if (response) {\n location.reload();\n }\n }\n });\n }\n}\n","// region service-worker-update-dialog\nexport * from './lib/service-worker-update-dialog/service-worker-update-dialog.component';\n// endregion\n\n// region \nexport * from './lib/auto-update.service';\nexport * from './lib/check-for-update.service';\nexport * from './lib/dialog-update.service';\nexport * from './lib/log-update.service';\nexport * from './lib/provide-service-worker-updater';\nexport * from './lib/snackbar-update.service';\nexport * from './lib/unregister-service-worker';\n// endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;MAca,sBAAsB,GAAG,IAAI,cAAc,CAAe,wBAAwB;AAkBxF,IAAM,kCAAkC,GAAxC,MAAM,kCAAkC,CAAA;AAQ7C,IAAA,WAAA,GAAA;AANgB,QAAA,IAAA,CAAA,MAAM,GAAG,SAAS,CAAC,QAAQ,CAAgC,QAAQ,CAAC;QAEpE,IAAA,CAAA,WAAW,GAAG,MAAM,EAAQ;AAE5B,QAAA,IAAA,CAAA,oBAAoB,GAAG,MAAM,CAAC,sBAAsB,CAAC;AAGnE,QAAA,eAAe,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC,aAAa,CAAC,SAAS,EAAE,CAAC;IAChE;IAEA,KAAK,GAAA;QACH,IAAI,CAAC,MAAM,EAAE,CAAC,aAAa,CAAC,KAAK,EAAE;AACnC,QAAA,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE;IACzB;8GAfW,kCAAkC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAlC,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,kCAAkC,wPChC/C,wlDA+CA,EAAA,MAAA,EAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;ADfa,kCAAkC,GAAA,UAAA,CAAA;AAhB9C,IAAA,QAAQ,CAAC;AACR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aAAa,GAAG,CAAC,CAAC,qBAA4C,KAAK,MAAM,qBAAqB,CAAC,KAAK,EAAE,EAAE,MAAM,CAAC,qBAAqB,CAAC,CAAC;QAC5I,OAAO,aAAa,EAAE;AACxB,IAAA,CAAC,CAAC;AACR;;AC9CM,SAAU,uBAAuB,CAAC,WAAwB,EAAA;AAC9D,IAAA,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE;AAC9B,QAAA,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,CAAC,IAAI,CAAC,OAAO,aAAa,KAAI;YACxE,MAAM,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,YAAY,KAAI;gBACnD,OAAO,CAAC,GAAG,CAAC,6BAA6B,GAAG,YAAY,CAAC,KAAK,CAAC;AAC/D,gBAAA,OAAO,YAAY,CAAC,UAAU,EAAE;YAClC,CAAC,CAAC,CAAC;AACH,YAAA,IAAI,aAAa,CAAC,MAAM,EAAE;AACxB,gBAAA,MAAM,QAAQ,GAAG,OAAO,CACtB,4GAA4G,CAAC;gBAC/G,IAAI,QAAQ,EAAE;oBACZ,QAAQ,CAAC,MAAM,EAAE;gBACnB;YACF;AACF,QAAA,CAAC,CAAC;IACJ;AACF;;AClBA;AAYA;;ACZA;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "
|
|
2
|
+
"version": "21.0.1-dev.1",
|
|
3
3
|
"name": "@rxap/service-worker",
|
|
4
4
|
"description": "Provides services and components to simplify the management of service worker updates in Angular applications. It includes features such as automatic updates, dialog prompts for updates, and logging of update events. The package also offers utilities to unregister service workers and initialize peer dependencies.\n",
|
|
5
5
|
"license": "GPL-3.0-or-later",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@nx/devkit": "
|
|
7
|
+
"@nx/devkit": "22.7.5",
|
|
8
8
|
"tslib": "2.6.2"
|
|
9
9
|
},
|
|
10
10
|
"peerDependencies": {
|
|
11
|
-
"@angular/common": "^
|
|
12
|
-
"@angular/core": "^
|
|
13
|
-
"@angular/service-worker": "^
|
|
14
|
-
"@rxap/environment": "^
|
|
15
|
-
"@rxap/life-cycle": "^
|
|
16
|
-
"rxjs": "^7.8.
|
|
11
|
+
"@angular/common": "^21.2.9",
|
|
12
|
+
"@angular/core": "^21.2.9",
|
|
13
|
+
"@angular/service-worker": "^21.2.9",
|
|
14
|
+
"@rxap/environment": "^21.0.1-dev.1",
|
|
15
|
+
"@rxap/life-cycle": "^21.0.1-dev.1",
|
|
16
|
+
"rxjs": "^7.8.2"
|
|
17
17
|
},
|
|
18
18
|
"author": {
|
|
19
19
|
"name": "Merzough Münker",
|
|
@@ -38,35 +38,35 @@
|
|
|
38
38
|
"packageGroup": [
|
|
39
39
|
{
|
|
40
40
|
"package": "@angular/common",
|
|
41
|
-
"version": "
|
|
41
|
+
"version": "21.2.9"
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
44
|
"package": "@angular/core",
|
|
45
|
-
"version": "
|
|
45
|
+
"version": "21.2.9"
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
"package": "@angular/platform-browser",
|
|
49
|
-
"version": "
|
|
49
|
+
"version": "21.2.9"
|
|
50
50
|
},
|
|
51
51
|
{
|
|
52
52
|
"package": "@angular/router",
|
|
53
|
-
"version": "
|
|
53
|
+
"version": "21.2.9"
|
|
54
54
|
},
|
|
55
55
|
{
|
|
56
56
|
"package": "@angular/service-worker",
|
|
57
|
-
"version": "
|
|
57
|
+
"version": "21.2.9"
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
"package": "@rxap/environment",
|
|
61
|
-
"version": "
|
|
61
|
+
"version": "21.0.1-dev.1"
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
64
|
"package": "@rxap/life-cycle",
|
|
65
|
-
"version": "
|
|
65
|
+
"version": "21.0.1-dev.1"
|
|
66
66
|
},
|
|
67
67
|
{
|
|
68
68
|
"package": "@rxap/utilities",
|
|
69
|
-
"version": "16.5.1"
|
|
69
|
+
"version": "16.5.2-dev.1"
|
|
70
70
|
}
|
|
71
71
|
]
|
|
72
72
|
},
|
|
@@ -82,15 +82,16 @@
|
|
|
82
82
|
"schematics": "./generators.json",
|
|
83
83
|
"sideEffects": false,
|
|
84
84
|
"module": "fesm2022/rxap-service-worker.mjs",
|
|
85
|
-
"typings": "
|
|
85
|
+
"typings": "types/rxap-service-worker.d.ts",
|
|
86
86
|
"exports": {
|
|
87
87
|
"./package.json": {
|
|
88
88
|
"default": "./package.json"
|
|
89
89
|
},
|
|
90
90
|
".": {
|
|
91
|
-
"types": "./
|
|
91
|
+
"types": "./types/rxap-service-worker.d.ts",
|
|
92
92
|
"default": "./fesm2022/rxap-service-worker.mjs"
|
|
93
93
|
},
|
|
94
94
|
"./theme": "./theme.css"
|
|
95
|
-
}
|
|
95
|
+
},
|
|
96
|
+
"type": "module"
|
|
96
97
|
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { ElementRef, InjectionToken, Provider, EnvironmentProviders } from '@angular/core';
|
|
3
|
+
import { VersionEvent } from '@angular/service-worker';
|
|
4
|
+
import { Environment } from '@rxap/environment';
|
|
5
|
+
|
|
6
|
+
declare const UPDATE_AVAILABLE_EVENT: InjectionToken<VersionEvent>;
|
|
7
|
+
declare class ServiceWorkerUpdateDialogComponent {
|
|
8
|
+
readonly dialog: i0.Signal<ElementRef<HTMLDialogElement>>;
|
|
9
|
+
readonly closeDialog: i0.OutputEmitterRef<void>;
|
|
10
|
+
readonly updateAvailableEvent: VersionEvent;
|
|
11
|
+
constructor();
|
|
12
|
+
close(): void;
|
|
13
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ServiceWorkerUpdateDialogComponent, never>;
|
|
14
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ServiceWorkerUpdateDialogComponent, "rxap-service-worker-update-dialog", never, {}, { "closeDialog": "closeDialog"; }, never, never, true, never>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
declare class AutoUpdateService {
|
|
18
|
+
private readonly updates;
|
|
19
|
+
start(): void;
|
|
20
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AutoUpdateService, never>;
|
|
21
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AutoUpdateService>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare class CheckForUpdateService {
|
|
25
|
+
private readonly lifeCycle;
|
|
26
|
+
private readonly updates;
|
|
27
|
+
private _started;
|
|
28
|
+
start(): void;
|
|
29
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CheckForUpdateService, never>;
|
|
30
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CheckForUpdateService>;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
declare class DialogUpdateService {
|
|
34
|
+
private readonly applicationRef;
|
|
35
|
+
private readonly updates;
|
|
36
|
+
start(): void;
|
|
37
|
+
private openUpdateDialog;
|
|
38
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DialogUpdateService, never>;
|
|
39
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DialogUpdateService>;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
declare class LogUpdateService {
|
|
43
|
+
private readonly updates;
|
|
44
|
+
start(): void;
|
|
45
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LogUpdateService, never>;
|
|
46
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<LogUpdateService>;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
declare function ProvideServiceWorkerUpdater(...providers: Array<Provider | EnvironmentProviders>): Array<Provider | EnvironmentProviders>;
|
|
50
|
+
declare function withLogUpdater(): EnvironmentProviders;
|
|
51
|
+
declare function withDialogUpdater(): EnvironmentProviders;
|
|
52
|
+
declare function withAutoUpdater(): EnvironmentProviders;
|
|
53
|
+
declare function withSnackbarUpdater(): EnvironmentProviders;
|
|
54
|
+
|
|
55
|
+
declare class SnackbarUpdateService {
|
|
56
|
+
private readonly snackBar;
|
|
57
|
+
private readonly updates;
|
|
58
|
+
start(): void;
|
|
59
|
+
private openUpdateSnackBar;
|
|
60
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnackbarUpdateService, never>;
|
|
61
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<SnackbarUpdateService>;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
declare function UnregisterServiceWorker(environment: Environment): void;
|
|
65
|
+
|
|
66
|
+
export { AutoUpdateService, CheckForUpdateService, DialogUpdateService, LogUpdateService, ProvideServiceWorkerUpdater, ServiceWorkerUpdateDialogComponent, SnackbarUpdateService, UPDATE_AVAILABLE_EVENT, UnregisterServiceWorker, withAutoUpdater, withDialogUpdater, withLogUpdater, withSnackbarUpdater };
|
package/index.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export * from './lib/service-worker-update-dialog/service-worker-update-dialog.component';
|
|
2
|
-
export * from './lib/auto-update.service';
|
|
3
|
-
export * from './lib/check-for-update.service';
|
|
4
|
-
export * from './lib/dialog-update.service';
|
|
5
|
-
export * from './lib/log-update.service';
|
|
6
|
-
export * from './lib/provide-service-worker-updater';
|
|
7
|
-
export * from './lib/snackbar-update.service';
|
|
8
|
-
export * from './lib/unregister-service-worker';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { SwUpdate } from '@angular/service-worker';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class AutoUpdateService {
|
|
4
|
-
private readonly updates;
|
|
5
|
-
constructor(updates: SwUpdate);
|
|
6
|
-
start(): void;
|
|
7
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<AutoUpdateService, never>;
|
|
8
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<AutoUpdateService>;
|
|
9
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { SwUpdate } from '@angular/service-worker';
|
|
2
|
-
import { LifeCycleService } from '@rxap/life-cycle';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class CheckForUpdateService {
|
|
5
|
-
private readonly lifeCycle;
|
|
6
|
-
private readonly updates;
|
|
7
|
-
private _started;
|
|
8
|
-
constructor(lifeCycle: LifeCycleService, updates: SwUpdate);
|
|
9
|
-
start(): void;
|
|
10
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<CheckForUpdateService, never>;
|
|
11
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<CheckForUpdateService>;
|
|
12
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ApplicationRef } from '@angular/core';
|
|
2
|
-
import { SwUpdate } from '@angular/service-worker';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class DialogUpdateService {
|
|
5
|
-
private readonly applicationRef;
|
|
6
|
-
private readonly updates;
|
|
7
|
-
constructor(applicationRef: ApplicationRef, updates: SwUpdate);
|
|
8
|
-
start(): void;
|
|
9
|
-
private openUpdateDialog;
|
|
10
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<DialogUpdateService, never>;
|
|
11
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<DialogUpdateService>;
|
|
12
|
-
}
|