@softpak/components 19.1.0-beta.3 → 19.1.0-beta.5
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/fesm2022/softpak-components-spx-helpers.mjs +9 -1
- package/fesm2022/softpak-components-spx-helpers.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-translate.mjs +34 -0
- package/fesm2022/softpak-components-spx-translate.mjs.map +1 -0
- package/fesm2022/softpak-components-spx-update.mjs +336 -111
- package/fesm2022/softpak-components-spx-update.mjs.map +1 -1
- package/package.json +21 -21
- package/spx-helpers/public-api.d.ts +1 -0
- package/spx-helpers/unsubscribe-subscriptions.function.d.ts +1 -0
- package/{spx-app-update → spx-translate}/index.d.ts +1 -1
- package/spx-translate/public-api.d.ts +3 -0
- package/spx-translate/spx-translate._const.d.ts +16 -0
- package/spx-translate/spx-translate.en.d.ts +2 -0
- package/spx-translate/spx-translate.nl.d.ts +2 -0
- package/spx-update/public-api.d.ts +12 -2
- package/spx-update/spx-upd-page.component.d.ts +16 -0
- package/spx-update/spx-upd-pending.component.d.ts +28 -0
- package/spx-update/store/upd-pending/upd-pending.effects.d.ts +10 -0
- package/spx-update/store/upd-pending/upd-pending.initial.d.ts +2 -0
- package/spx-update/store/upd-pending/upd-pending.reducer.d.ts +9 -0
- package/spx-update/store/upd-pending/upd-pending.state.d.ts +4 -0
- package/tailwind.css +1 -1
- package/fesm2022/softpak-components-spx-app-update.mjs +0 -504
- package/fesm2022/softpak-components-spx-app-update.mjs.map +0 -1
- package/spx-app-update/public-api.d.ts +0 -6
- package/spx-app-update/spx-app-update.component.d.ts +0 -49
- package/spx-update/src/spx-update-info.component.d.ts +0 -18
- package/spx-update/src/spx-update-progress.component.d.ts +0 -14
- /package/{spx-app-update → spx-update}/store/upd-check/upd-check.actions.d.ts +0 -0
- /package/{spx-app-update → spx-update}/store/upd-check/upd-check.effects.d.ts +0 -0
- /package/{spx-app-update → spx-update}/store/upd-check/upd-check.initial.d.ts +0 -0
- /package/{spx-app-update → spx-update}/store/upd-check/upd-check.reducer.d.ts +0 -0
- /package/{spx-app-update → spx-update}/store/upd-check/upd-check.state.d.ts +0 -0
- /package/{spx-app-update → spx-update}/store/upd-pending/upd-pending.actions.d.ts +0 -0
|
@@ -1,504 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, Input, Injectable } from '@angular/core';
|
|
3
|
-
import * as i3 from '@angular/forms';
|
|
4
|
-
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
5
|
-
import * as i2 from '@ngx-translate/core';
|
|
6
|
-
import { TranslateModule } from '@ngx-translate/core';
|
|
7
|
-
import { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';
|
|
8
|
-
import { SpxInputComponent } from '@softpak/components/spx-inputs';
|
|
9
|
-
import { SpxProgressBarComponent } from '@softpak/components/spx-progress-bar';
|
|
10
|
-
import { SpxStorage, SpxStorageKeyEnum } from '@softpak/components/spx-storage';
|
|
11
|
-
import { Device } from '@capacitor/device';
|
|
12
|
-
import { getCurrentScope, captureMessage } from '@sentry/angular';
|
|
13
|
-
import * as i4 from '@ionic/angular/standalone';
|
|
14
|
-
import { IonHeader, IonToolbar, IonTitle, IonContent } from '@ionic/angular/standalone';
|
|
15
|
-
import * as i1 from 'cordova-plugin-ionic/dist/ngx';
|
|
16
|
-
import { createAction, props, union, createFeature, createReducer, on } from '@ngrx/store';
|
|
17
|
-
import * as i1$1 from '@ngrx/effects';
|
|
18
|
-
import { createEffect, ofType } from '@ngrx/effects';
|
|
19
|
-
import { from, of } from 'rxjs';
|
|
20
|
-
import { delay, mergeMap, tap, exhaustMap, map, catchError } from 'rxjs/operators';
|
|
21
|
-
import { getConfig, setConfig, sync, reload } from '@capacitor/live-updates';
|
|
22
|
-
import { Capacitor } from '@capacitor/core';
|
|
23
|
-
import { AppUpdate } from '@capawesome/capacitor-app-update';
|
|
24
|
-
import { DateTime } from 'luxon';
|
|
25
|
-
|
|
26
|
-
const ctrlNextVersionNumber = 'ctrlNextVersionNumber';
|
|
27
|
-
const ctrlVersionNumber = 'ctrlVersionNumber';
|
|
28
|
-
const ctrlConfiguredChannel = 'ctrlConfiguredChannel';
|
|
29
|
-
const ctrlAppStoreVersion = 'ctrlAppStoreVersion';
|
|
30
|
-
class SpxAppUpdateComponent {
|
|
31
|
-
constructor(deploy, changeDetector, applicationRef, translateService, formBuilder, navController) {
|
|
32
|
-
this.deploy = deploy;
|
|
33
|
-
this.changeDetector = changeDetector;
|
|
34
|
-
this.applicationRef = applicationRef;
|
|
35
|
-
this.translateService = translateService;
|
|
36
|
-
this.formBuilder = formBuilder;
|
|
37
|
-
this.navController = navController;
|
|
38
|
-
this.delayedPercentage = 0;
|
|
39
|
-
this.percentage = 0;
|
|
40
|
-
this.syncTruckInterval = null;
|
|
41
|
-
this.updateStatus = this.textCheckingForUpdates;
|
|
42
|
-
this.form = this.formBuilder.group({
|
|
43
|
-
[ctrlNextVersionNumber]: [null, []],
|
|
44
|
-
[ctrlVersionNumber]: [null, []],
|
|
45
|
-
[ctrlConfiguredChannel]: [null, []],
|
|
46
|
-
[ctrlAppStoreVersion]: [null, []],
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
get ctrlVersionNumber() { return this.form.get(ctrlVersionNumber); }
|
|
50
|
-
get ctrlNextVersionNumber() { return this.form.get(ctrlNextVersionNumber); }
|
|
51
|
-
get ctrlConfiguredChannel() { return this.form.get(ctrlConfiguredChannel); }
|
|
52
|
-
get ctrlAppStoreVersion() { return this.form.get(ctrlAppStoreVersion); }
|
|
53
|
-
init() {
|
|
54
|
-
this.delayedPercentage = 0;
|
|
55
|
-
this.percentage = 0;
|
|
56
|
-
this.performAutomaticUpdate().then(() => { });
|
|
57
|
-
this.startLoaderSync();
|
|
58
|
-
this.changeStatus({
|
|
59
|
-
percentage: 0,
|
|
60
|
-
text: this.translateService.instant(this.textCheckingForUpdates),
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
destroy() {
|
|
64
|
-
this.stopLoaderSync();
|
|
65
|
-
}
|
|
66
|
-
async performAutomaticUpdate() {
|
|
67
|
-
const deviceInfo = await Device.getInfo();
|
|
68
|
-
if (deviceInfo?.platform === 'web') {
|
|
69
|
-
// Local? Skip the update page.
|
|
70
|
-
this.closeUpdateScreen();
|
|
71
|
-
}
|
|
72
|
-
try {
|
|
73
|
-
this.updateInfo();
|
|
74
|
-
// Start upgrade
|
|
75
|
-
const currentVersion = await this.deploy.getCurrentVersion();
|
|
76
|
-
if (currentVersion?.binaryVersionName) {
|
|
77
|
-
const binaryGroup = currentVersion.binaryVersionName.substring(0, 3); // e.g. "1.4"
|
|
78
|
-
const channelGroup = currentVersion.channel.split('-')[1].substring(0, 3); // e.g. "1.4"
|
|
79
|
-
const channelType = currentVersion.channel.split('-')[0];
|
|
80
|
-
if (binaryGroup != channelGroup) {
|
|
81
|
-
await this.deploy.configure({
|
|
82
|
-
appId: this.spxAppId,
|
|
83
|
-
channel: `${channelType}-${binaryGroup}.x`
|
|
84
|
-
}).then(() => {
|
|
85
|
-
this.sync().then(() => { });
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
else {
|
|
89
|
-
this.sync().then(() => { });
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
this.sync().then(() => { });
|
|
94
|
-
}
|
|
95
|
-
// End upgrade
|
|
96
|
-
}
|
|
97
|
-
catch (error) {
|
|
98
|
-
this.changeStatus({
|
|
99
|
-
closeScreen: true,
|
|
100
|
-
error,
|
|
101
|
-
percentage: 100,
|
|
102
|
-
text: this.translateService.instant(this.textUnexpectedError)
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
async sync() {
|
|
107
|
-
try {
|
|
108
|
-
this.updateInfo();
|
|
109
|
-
const updateAvailableInfo = await this.deploy.checkForUpdate();
|
|
110
|
-
if (!updateAvailableInfo.available) {
|
|
111
|
-
// No update available
|
|
112
|
-
this.changeStatus({
|
|
113
|
-
closeScreen: true,
|
|
114
|
-
percentage: 0,
|
|
115
|
-
text: this.translateService.instant(this.textNoUpdatesAvailable),
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
else {
|
|
119
|
-
// Download update
|
|
120
|
-
await this.deploy.sync({ updateMethod: 'auto' }, (percentage) => {
|
|
121
|
-
this.changeStatus({
|
|
122
|
-
percentage: percentage ?? 0,
|
|
123
|
-
text: this.translateService.instant(this.textDownloadingUpdate, { percentage, version: updateAvailableInfo.build }),
|
|
124
|
-
});
|
|
125
|
-
}).catch((error) => {
|
|
126
|
-
this.changeStatus({
|
|
127
|
-
closeScreen: true,
|
|
128
|
-
error,
|
|
129
|
-
percentage: 100,
|
|
130
|
-
text: this.translateService.instant(this.textErrorWhileUpdatingApp),
|
|
131
|
-
});
|
|
132
|
-
});
|
|
133
|
-
this.changeStatus({
|
|
134
|
-
closeScreen: true,
|
|
135
|
-
percentage: 100,
|
|
136
|
-
text: this.translateService.instant(this.textFinishedUpdating, { version: updateAvailableInfo.build })
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
catch (error) {
|
|
141
|
-
// Catch unexpected plug-in errors
|
|
142
|
-
this.changeStatus({
|
|
143
|
-
closeScreen: true,
|
|
144
|
-
error,
|
|
145
|
-
percentage: 100,
|
|
146
|
-
text: this.translateService.instant(this.textUnexpectedError)
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
async updateInfo() {
|
|
151
|
-
const currentVersion = await this.deploy.getCurrentVersion();
|
|
152
|
-
const configuration = await this.deploy.getConfiguration();
|
|
153
|
-
const updateAvailableInfo = await this.deploy.checkForUpdate();
|
|
154
|
-
if (currentVersion) {
|
|
155
|
-
this.ctrlVersionNumber.setValue({
|
|
156
|
-
value: configuration?.currentBuildId,
|
|
157
|
-
});
|
|
158
|
-
this.ctrlNextVersionNumber.setValue({
|
|
159
|
-
value: updateAvailableInfo?.build
|
|
160
|
-
});
|
|
161
|
-
this.ctrlConfiguredChannel.setValue({
|
|
162
|
-
value: configuration ? configuration.channel : null
|
|
163
|
-
});
|
|
164
|
-
this.ctrlAppStoreVersion.setValue({
|
|
165
|
-
value: configuration ? configuration.binaryVersionName : null
|
|
166
|
-
});
|
|
167
|
-
{
|
|
168
|
-
const scope = getCurrentScope();
|
|
169
|
-
scope.setTag('version_binary_code', currentVersion?.binaryVersionCode);
|
|
170
|
-
scope.setTag('version_binary_name', currentVersion?.binaryVersionName);
|
|
171
|
-
scope.setTag('version_build_id', currentVersion?.buildId);
|
|
172
|
-
scope.setTag('channel_type', currentVersion?.channel);
|
|
173
|
-
scope.setTag('version_snapshot_id', currentVersion?.versionId);
|
|
174
|
-
}
|
|
175
|
-
;
|
|
176
|
-
this.changeDetector.markForCheck();
|
|
177
|
-
this.applicationRef.tick();
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
changeStatus(status) {
|
|
181
|
-
this.updateStatus = status.text;
|
|
182
|
-
this.percentage = status.percentage;
|
|
183
|
-
if (status.closeScreen) {
|
|
184
|
-
this.closeUpdateScreen();
|
|
185
|
-
}
|
|
186
|
-
if (status.error) {
|
|
187
|
-
// this.appStore.dispatch(
|
|
188
|
-
// sharedToasterActions.CREATE_ERROR({
|
|
189
|
-
// messageText: status.error,
|
|
190
|
-
// })
|
|
191
|
-
// );
|
|
192
|
-
}
|
|
193
|
-
this.changeDetector.markForCheck();
|
|
194
|
-
this.applicationRef.tick();
|
|
195
|
-
}
|
|
196
|
-
closeUpdateScreen() {
|
|
197
|
-
// Allowing some time to make a screenshot of version info
|
|
198
|
-
SpxStorage.clearSetting(SpxStorageKeyEnum.updateInProgress);
|
|
199
|
-
setTimeout(() => {
|
|
200
|
-
if (SpxStorage.getSetting(SpxStorageKeyEnum.afterSignIn) &&
|
|
201
|
-
this.spxIsSignedIn) {
|
|
202
|
-
this.navController.navigateRoot([SpxStorage.getSetting(SpxStorageKeyEnum.afterSignIn)]);
|
|
203
|
-
SpxStorage.clearSetting(SpxStorageKeyEnum.afterSignIn);
|
|
204
|
-
}
|
|
205
|
-
else {
|
|
206
|
-
this.navController.navigateRoot([this.spxHomeUrl]);
|
|
207
|
-
}
|
|
208
|
-
}, 0);
|
|
209
|
-
}
|
|
210
|
-
startLoaderSync() {
|
|
211
|
-
SpxStorage.setSetting(SpxStorageKeyEnum.updateInProgress, '1');
|
|
212
|
-
if (this.syncTruckInterval === null) {
|
|
213
|
-
this.syncTruckInterval = setInterval(() => {
|
|
214
|
-
this.delayedPercentage = this.percentage;
|
|
215
|
-
}, 200);
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
stopLoaderSync() {
|
|
219
|
-
if (this.syncTruckInterval !== null) {
|
|
220
|
-
clearInterval(this.syncTruckInterval);
|
|
221
|
-
this.syncTruckInterval = null;
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxAppUpdateComponent, deps: [{ token: i1.Deploy }, { token: i0.ChangeDetectorRef }, { token: i0.ApplicationRef }, { token: i2.TranslateService }, { token: i3.FormBuilder }, { token: i4.NavController }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
225
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: SpxAppUpdateComponent, isStandalone: true, selector: "spx-app-update", inputs: { spxHomeUrl: "spxHomeUrl", spxIsSignedIn: "spxIsSignedIn", textCheckingForUpdates: "textCheckingForUpdates", textDownloadingUpdate: "textDownloadingUpdate", textErrorWhileUpdatingApp: "textErrorWhileUpdatingApp", textFinishedUpdating: "textFinishedUpdating", textNoUpdatesAvailable: "textNoUpdatesAvailable", textUnexpectedError: "textUnexpectedError", txtAppStoreVersion: "txtAppStoreVersion", txtChannel: "txtChannel", txtNextVersion: "txtNextVersion", txtUpdate: "txtUpdate", txtVersion: "txtVersion", spxAppId: "spxAppId" }, ngImport: i0, template: `<ion-header>
|
|
226
|
-
<ion-toolbar>
|
|
227
|
-
<ion-title>
|
|
228
|
-
{{ txtUpdate | translate | capitalize }}
|
|
229
|
-
</ion-title>
|
|
230
|
-
</ion-toolbar>
|
|
231
|
-
</ion-header>
|
|
232
|
-
|
|
233
|
-
<ion-content class="ion-content--upd" [fullscreen]="true">
|
|
234
|
-
<div class="ion-padding">
|
|
235
|
-
<spx-progress-bar [spxPercentage]="delayedPercentage" [spxTitle]="updateStatus | capitalize">
|
|
236
|
-
</spx-progress-bar>
|
|
237
|
-
<form [formGroup]="form" class="mt-3">
|
|
238
|
-
@if (ctrlAppStoreVersion.value && ctrlAppStoreVersion.value.value) {
|
|
239
|
-
<div class="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-3">
|
|
240
|
-
<spx-input [formControl]="ctrlAppStoreVersion" [spxLabel]="txtAppStoreVersion | translate | capitalize"
|
|
241
|
-
[spxReadonly]="true"></spx-input>
|
|
242
|
-
<spx-input [formControl]="ctrlConfiguredChannel" [spxLabel]="txtChannel | translate | capitalize"
|
|
243
|
-
[spxReadonly]="true"></spx-input>
|
|
244
|
-
<spx-input [formControl]="ctrlVersionNumber" [spxLabel]="txtVersion | translate | capitalize"
|
|
245
|
-
[spxReadonly]="true"></spx-input>
|
|
246
|
-
@if (ctrlNextVersionNumber.value && ctrlNextVersionNumber.value.value) {
|
|
247
|
-
<spx-input [formControl]="ctrlNextVersionNumber" [spxLabel]="txtNextVersion | translate | capitalize"
|
|
248
|
-
[spxReadonly]="true"></spx-input>
|
|
249
|
-
}
|
|
250
|
-
</div>
|
|
251
|
-
}
|
|
252
|
-
</form>
|
|
253
|
-
</div>
|
|
254
|
-
</ion-content>`, isInline: true, dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "component", type: IonHeader, selector: "ion-header", inputs: ["collapse", "mode", "translucent"] }, { kind: "component", type: IonToolbar, selector: "ion-toolbar", inputs: ["color", "mode"] }, { kind: "component", type: IonTitle, selector: "ion-title", inputs: ["color", "size"] }, { kind: "component", type: IonContent, selector: "ion-content", inputs: ["color", "fixedSlotPlacement", "forceOverscroll", "fullscreen", "scrollEvents", "scrollX", "scrollY"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "pipe", type: SpxCapitalizePipe, name: "capitalize" }, { kind: "component", type: SpxInputComponent, selector: "spx-input", inputs: ["spxLabel", "spxMax", "spxMin", "spxName", "spxReadonly", "spxAutocomplete", "spxAutofocus", "spxInputMode", "spxPattern", "spxRequired", "spxSelectMonth", "spxSelectDay", "spxShowEdit", "spxShowHelp", "spxShowLabel", "spxCompact", "spxShowClear", "spxShowSearch", "spxShowValidationMessages", "spxStep", "spxSuggestions", "spxType", "spxValidators", "value", "spxCapitalize", "spxFocused"], outputs: ["spxBlur", "spxClear", "spxChange", "spxFocus", "spxEdit", "spxHelp", "spxSearch"] }, { kind: "component", type: SpxProgressBarComponent, selector: "spx-progress-bar", inputs: ["spxPercentage", "spxTitle"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }] }); }
|
|
255
|
-
}
|
|
256
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxAppUpdateComponent, decorators: [{
|
|
257
|
-
type: Component,
|
|
258
|
-
args: [{
|
|
259
|
-
selector: 'spx-app-update',
|
|
260
|
-
imports: [
|
|
261
|
-
FormsModule,
|
|
262
|
-
IonHeader,
|
|
263
|
-
IonToolbar,
|
|
264
|
-
IonTitle,
|
|
265
|
-
IonContent,
|
|
266
|
-
ReactiveFormsModule,
|
|
267
|
-
SpxCapitalizePipe,
|
|
268
|
-
SpxInputComponent,
|
|
269
|
-
SpxProgressBarComponent,
|
|
270
|
-
TranslateModule
|
|
271
|
-
],
|
|
272
|
-
template: `<ion-header>
|
|
273
|
-
<ion-toolbar>
|
|
274
|
-
<ion-title>
|
|
275
|
-
{{ txtUpdate | translate | capitalize }}
|
|
276
|
-
</ion-title>
|
|
277
|
-
</ion-toolbar>
|
|
278
|
-
</ion-header>
|
|
279
|
-
|
|
280
|
-
<ion-content class="ion-content--upd" [fullscreen]="true">
|
|
281
|
-
<div class="ion-padding">
|
|
282
|
-
<spx-progress-bar [spxPercentage]="delayedPercentage" [spxTitle]="updateStatus | capitalize">
|
|
283
|
-
</spx-progress-bar>
|
|
284
|
-
<form [formGroup]="form" class="mt-3">
|
|
285
|
-
@if (ctrlAppStoreVersion.value && ctrlAppStoreVersion.value.value) {
|
|
286
|
-
<div class="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-3">
|
|
287
|
-
<spx-input [formControl]="ctrlAppStoreVersion" [spxLabel]="txtAppStoreVersion | translate | capitalize"
|
|
288
|
-
[spxReadonly]="true"></spx-input>
|
|
289
|
-
<spx-input [formControl]="ctrlConfiguredChannel" [spxLabel]="txtChannel | translate | capitalize"
|
|
290
|
-
[spxReadonly]="true"></spx-input>
|
|
291
|
-
<spx-input [formControl]="ctrlVersionNumber" [spxLabel]="txtVersion | translate | capitalize"
|
|
292
|
-
[spxReadonly]="true"></spx-input>
|
|
293
|
-
@if (ctrlNextVersionNumber.value && ctrlNextVersionNumber.value.value) {
|
|
294
|
-
<spx-input [formControl]="ctrlNextVersionNumber" [spxLabel]="txtNextVersion | translate | capitalize"
|
|
295
|
-
[spxReadonly]="true"></spx-input>
|
|
296
|
-
}
|
|
297
|
-
</div>
|
|
298
|
-
}
|
|
299
|
-
</form>
|
|
300
|
-
</div>
|
|
301
|
-
</ion-content>`
|
|
302
|
-
}]
|
|
303
|
-
}], ctorParameters: () => [{ type: i1.Deploy }, { type: i0.ChangeDetectorRef }, { type: i0.ApplicationRef }, { type: i2.TranslateService }, { type: i3.FormBuilder }, { type: i4.NavController }], propDecorators: { spxHomeUrl: [{
|
|
304
|
-
type: Input
|
|
305
|
-
}], spxIsSignedIn: [{
|
|
306
|
-
type: Input
|
|
307
|
-
}], textCheckingForUpdates: [{
|
|
308
|
-
type: Input
|
|
309
|
-
}], textDownloadingUpdate: [{
|
|
310
|
-
type: Input
|
|
311
|
-
}], textErrorWhileUpdatingApp: [{
|
|
312
|
-
type: Input
|
|
313
|
-
}], textFinishedUpdating: [{
|
|
314
|
-
type: Input
|
|
315
|
-
}], textNoUpdatesAvailable: [{
|
|
316
|
-
type: Input
|
|
317
|
-
}], textUnexpectedError: [{
|
|
318
|
-
type: Input
|
|
319
|
-
}], txtAppStoreVersion: [{
|
|
320
|
-
type: Input
|
|
321
|
-
}], txtChannel: [{
|
|
322
|
-
type: Input
|
|
323
|
-
}], txtNextVersion: [{
|
|
324
|
-
type: Input
|
|
325
|
-
}], txtUpdate: [{
|
|
326
|
-
type: Input
|
|
327
|
-
}], txtVersion: [{
|
|
328
|
-
type: Input
|
|
329
|
-
}], spxAppId: [{
|
|
330
|
-
type: Input
|
|
331
|
-
}] } });
|
|
332
|
-
|
|
333
|
-
const anUpdateIsReady = createAction('[UPD / Check] An update is ready', props());
|
|
334
|
-
const clearError = createAction('[UPD / Check] Clear error', props());
|
|
335
|
-
const checkFailed = createAction('[UPD / Check] Error happened', props());
|
|
336
|
-
const initialize = createAction('[UPD / Check] Initialize', props());
|
|
337
|
-
const noUpdateWasFound = createAction('[UPD / Check] No update was found', props());
|
|
338
|
-
const notAvailableOnWeb = createAction('[UPD / Check] Not available on web', props());
|
|
339
|
-
const runCheck = createAction('[UPD / Check] Run', props());
|
|
340
|
-
const all$1 = union({
|
|
341
|
-
anUpdateIsReady,
|
|
342
|
-
clearError,
|
|
343
|
-
checkFailed,
|
|
344
|
-
initialize,
|
|
345
|
-
noUpdateWasFound,
|
|
346
|
-
notAvailableOnWeb,
|
|
347
|
-
runCheck,
|
|
348
|
-
});
|
|
349
|
-
|
|
350
|
-
var updCheck_actions = /*#__PURE__*/Object.freeze({
|
|
351
|
-
__proto__: null,
|
|
352
|
-
anUpdateIsReady: anUpdateIsReady,
|
|
353
|
-
checkFailed: checkFailed,
|
|
354
|
-
clearError: clearError,
|
|
355
|
-
initialize: initialize,
|
|
356
|
-
noUpdateWasFound: noUpdateWasFound,
|
|
357
|
-
notAvailableOnWeb: notAvailableOnWeb,
|
|
358
|
-
runCheck: runCheck
|
|
359
|
-
});
|
|
360
|
-
|
|
361
|
-
const acceptUpdate = createAction('[UPD / Available] Accept update', props());
|
|
362
|
-
const hasBeenDownloaded = createAction('[UPD / Available] Has been downloaded', props());
|
|
363
|
-
const hasBeenInstalled = createAction('[UPD / Available] Has been installed', props());
|
|
364
|
-
const postpone = createAction('[UPD / Available] Postpone', props());
|
|
365
|
-
const postponeExpired = createAction('[UPD / Available] Postpone expired', props());
|
|
366
|
-
const all = union({
|
|
367
|
-
acceptUpdate,
|
|
368
|
-
hasBeenDownloaded,
|
|
369
|
-
hasBeenInstalled,
|
|
370
|
-
postpone,
|
|
371
|
-
postponeExpired,
|
|
372
|
-
});
|
|
373
|
-
|
|
374
|
-
class Effects {
|
|
375
|
-
constructor(actions$) {
|
|
376
|
-
this.actions$ = actions$;
|
|
377
|
-
this.afterInitialize$ = createEffect(() => this.actions$.pipe(ofType(initialize), delay(120000), mergeMap(() => [
|
|
378
|
-
runCheck({}),
|
|
379
|
-
])));
|
|
380
|
-
this.onRun$ = createEffect(() => this.actions$.pipe(ofType(runCheck), tap(async () => {
|
|
381
|
-
if (Capacitor.getPlatform() !== 'web') {
|
|
382
|
-
// Migrate from e.g. 1.2.x to 1.3.x
|
|
383
|
-
const binaryInfo = await AppUpdate.getAppUpdateInfo();
|
|
384
|
-
const binaryVersionGroup = (Capacitor.getPlatform() === 'android' ? binaryInfo.currentVersionCode : binaryInfo.currentVersionName).substring(0, 3);
|
|
385
|
-
const config = await getConfig();
|
|
386
|
-
const channelVersionGroup = config.channel.split('-')[1].substring(0, 3); // e.g. "1.4"
|
|
387
|
-
const channelType = config.channel.split('-')[0];
|
|
388
|
-
captureMessage("[UPD] Changed chanel to `${channelType}-${binaryVersionGroup}.x`");
|
|
389
|
-
if (binaryVersionGroup != channelVersionGroup) {
|
|
390
|
-
await setConfig({
|
|
391
|
-
channel: `${channelType}-${binaryVersionGroup}.x`
|
|
392
|
-
});
|
|
393
|
-
}
|
|
394
|
-
// End migrate from e.g. 1.2.x to 1.3.x
|
|
395
|
-
}
|
|
396
|
-
}), exhaustMap((action) => from(sync()).pipe(map((syncResult) => {
|
|
397
|
-
if (syncResult.activeApplicationPathChanged) {
|
|
398
|
-
if (action.forceWaitForUpdate) {
|
|
399
|
-
reload();
|
|
400
|
-
}
|
|
401
|
-
return anUpdateIsReady({});
|
|
402
|
-
}
|
|
403
|
-
else {
|
|
404
|
-
return noUpdateWasFound({ startUpdateAgainAfterTimeout: !action.forceWaitForUpdate });
|
|
405
|
-
}
|
|
406
|
-
}), catchError((err) => {
|
|
407
|
-
if (err.message !== 'Not implemented for web only') {
|
|
408
|
-
captureMessage("[UPD] Handled: " + err.message);
|
|
409
|
-
}
|
|
410
|
-
return err.message === 'Not implemented for web only' ? of(notAvailableOnWeb({})) : of(checkFailed({ startUpdateAgainAfterTimeout: !action.forceWaitForUpdate }));
|
|
411
|
-
})))));
|
|
412
|
-
this.whenAndUpdateIsReady$ = createEffect(() => this.actions$.pipe(ofType(anUpdateIsReady), mergeMap(() => [
|
|
413
|
-
hasBeenDownloaded({}),
|
|
414
|
-
])));
|
|
415
|
-
this.whenCheckHasFailed$ = createEffect(() => this.actions$.pipe(ofType(checkFailed), delay(30000), mergeMap((action) => !action.startUpdateAgainAfterTimeout ? [] : [
|
|
416
|
-
runCheck({}),
|
|
417
|
-
])));
|
|
418
|
-
this.whenNoUpdateWasFound$ = createEffect(() => this.actions$.pipe(ofType(noUpdateWasFound), delay(120000), mergeMap((action) => !action.startUpdateAgainAfterTimeout ? [] : [
|
|
419
|
-
runCheck({}),
|
|
420
|
-
])));
|
|
421
|
-
}
|
|
422
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: Effects, deps: [{ token: i1$1.Actions }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
423
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: Effects }); }
|
|
424
|
-
}
|
|
425
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: Effects, decorators: [{
|
|
426
|
-
type: Injectable
|
|
427
|
-
}], ctorParameters: () => [{ type: i1$1.Actions }] });
|
|
428
|
-
|
|
429
|
-
var updCheck_effects = /*#__PURE__*/Object.freeze({
|
|
430
|
-
__proto__: null,
|
|
431
|
-
Effects: Effects
|
|
432
|
-
});
|
|
433
|
-
|
|
434
|
-
const initialState = {
|
|
435
|
-
forceWaitForUpdate: false,
|
|
436
|
-
lastCheck: null,
|
|
437
|
-
showError: false,
|
|
438
|
-
};
|
|
439
|
-
|
|
440
|
-
var updCheck_initial = /*#__PURE__*/Object.freeze({
|
|
441
|
-
__proto__: null,
|
|
442
|
-
initialState: initialState
|
|
443
|
-
});
|
|
444
|
-
|
|
445
|
-
var updCheck_reducer = createFeature({
|
|
446
|
-
name: 'spxUpdCheck',
|
|
447
|
-
reducer: createReducer(initialState, on(anUpdateIsReady, (state) => {
|
|
448
|
-
return {
|
|
449
|
-
...state,
|
|
450
|
-
lastCheck: DateTime.now().toISO(),
|
|
451
|
-
showError: false,
|
|
452
|
-
};
|
|
453
|
-
}), on(clearError, (state) => {
|
|
454
|
-
return {
|
|
455
|
-
...state,
|
|
456
|
-
showError: false,
|
|
457
|
-
};
|
|
458
|
-
}), on(checkFailed, (state) => {
|
|
459
|
-
return {
|
|
460
|
-
...state,
|
|
461
|
-
forceWaitForUpdate: false,
|
|
462
|
-
showError: true,
|
|
463
|
-
};
|
|
464
|
-
}), on(noUpdateWasFound, (state) => {
|
|
465
|
-
return {
|
|
466
|
-
...state,
|
|
467
|
-
forceWaitForUpdate: false,
|
|
468
|
-
lastCheck: DateTime.now().toISO(),
|
|
469
|
-
showError: false,
|
|
470
|
-
};
|
|
471
|
-
}), on(runCheck, (state, { forceWaitForUpdate }) => {
|
|
472
|
-
return {
|
|
473
|
-
...state,
|
|
474
|
-
forceWaitForUpdate: forceWaitForUpdate ? true : state.forceWaitForUpdate
|
|
475
|
-
};
|
|
476
|
-
}), on(notAvailableOnWeb, (state) => {
|
|
477
|
-
return {
|
|
478
|
-
...state,
|
|
479
|
-
forceWaitForUpdate: false
|
|
480
|
-
};
|
|
481
|
-
})),
|
|
482
|
-
});
|
|
483
|
-
|
|
484
|
-
var updCheck_reducer$1 = /*#__PURE__*/Object.freeze({
|
|
485
|
-
__proto__: null,
|
|
486
|
-
default: updCheck_reducer
|
|
487
|
-
});
|
|
488
|
-
|
|
489
|
-
var updCheck_state = /*#__PURE__*/Object.freeze({
|
|
490
|
-
__proto__: null
|
|
491
|
-
});
|
|
492
|
-
|
|
493
|
-
// export * as updPendingActions from './store/upd-pending/upd-pending.actions';
|
|
494
|
-
// export * as updPendingEffects from './store/upd-pending/upd-pending.effects';
|
|
495
|
-
// export * as updPendingInitial from './store/upd-pending/upd-pending.initial';
|
|
496
|
-
// export * as updPendingReducer from './store/upd-pending/upd-pending.reducer';
|
|
497
|
-
// export * as updPendingState from './store/upd-pending/upd-pending.state';
|
|
498
|
-
|
|
499
|
-
/**
|
|
500
|
-
* Generated bundle index. Do not edit.
|
|
501
|
-
*/
|
|
502
|
-
|
|
503
|
-
export { SpxAppUpdateComponent, updCheck_actions as updCheckActions, updCheck_effects as updCheckEffects, updCheck_initial as updCheckInitial, updCheck_reducer$1 as updCheckReducer, updCheck_state as updCheckState };
|
|
504
|
-
//# sourceMappingURL=softpak-components-spx-app-update.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"softpak-components-spx-app-update.mjs","sources":["../../../../projects/softpak/components/spx-app-update/spx-app-update.component.ts","../../../../projects/softpak/components/spx-app-update/store/upd-check/upd-check.actions.ts","../../../../projects/softpak/components/spx-app-update/store/upd-pending/upd-pending.actions.ts","../../../../projects/softpak/components/spx-app-update/store/upd-check/upd-check.effects.ts","../../../../projects/softpak/components/spx-app-update/store/upd-check/upd-check.initial.ts","../../../../projects/softpak/components/spx-app-update/store/upd-check/upd-check.reducer.ts","../../../../projects/softpak/components/spx-app-update/public-api.ts","../../../../projects/softpak/components/spx-app-update/softpak-components-spx-app-update.ts"],"sourcesContent":["import { NgClass } from '@angular/common';\nimport { ApplicationRef, ChangeDetectorRef, Component, Input } from '@angular/core';\nimport { FormBuilder, FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { TranslateModule, TranslateService } from '@ngx-translate/core';\nimport { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';\nimport { SpxInputComponent } from '@softpak/components/spx-inputs';\nimport { SpxProgressBarComponent } from '@softpak/components/spx-progress-bar';\nimport { SpxStorage, SpxStorageKeyEnum } from '@softpak/components/spx-storage';\nimport { Device } from '@capacitor/device';\nimport { Deploy } from 'cordova-plugin-ionic/dist/ngx';\nimport { getCurrentScope } from '@sentry/angular';\nimport { IonContent, IonHeader, IonTitle, IonToolbar, NavController } from '@ionic/angular/standalone';\n\nconst ctrlNextVersionNumber = 'ctrlNextVersionNumber';\nconst ctrlVersionNumber = 'ctrlVersionNumber';\nconst ctrlConfiguredChannel = 'ctrlConfiguredChannel';\nconst ctrlAppStoreVersion = 'ctrlAppStoreVersion';\n\n@Component({\n selector: 'spx-app-update',\n imports: [\n FormsModule,\n IonHeader,\n IonToolbar,\n IonTitle,\n IonContent,\n ReactiveFormsModule,\n SpxCapitalizePipe,\n SpxInputComponent,\n SpxProgressBarComponent,\n TranslateModule\n ],\n template: `<ion-header>\n <ion-toolbar>\n <ion-title>\n {{ txtUpdate | translate | capitalize }}\n </ion-title>\n </ion-toolbar>\n </ion-header>\n \n <ion-content class=\"ion-content--upd\" [fullscreen]=\"true\">\n <div class=\"ion-padding\">\n <spx-progress-bar [spxPercentage]=\"delayedPercentage\" [spxTitle]=\"updateStatus | capitalize\">\n </spx-progress-bar>\n <form [formGroup]=\"form\" class=\"mt-3\">\n @if (ctrlAppStoreVersion.value && ctrlAppStoreVersion.value.value) {\n <div class=\"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-3\">\n <spx-input [formControl]=\"ctrlAppStoreVersion\" [spxLabel]=\"txtAppStoreVersion | translate | capitalize\"\n [spxReadonly]=\"true\"></spx-input>\n <spx-input [formControl]=\"ctrlConfiguredChannel\" [spxLabel]=\"txtChannel | translate | capitalize\"\n [spxReadonly]=\"true\"></spx-input>\n <spx-input [formControl]=\"ctrlVersionNumber\" [spxLabel]=\"txtVersion | translate | capitalize\"\n [spxReadonly]=\"true\"></spx-input>\n @if (ctrlNextVersionNumber.value && ctrlNextVersionNumber.value.value) {\n <spx-input [formControl]=\"ctrlNextVersionNumber\" [spxLabel]=\"txtNextVersion | translate | capitalize\"\n [spxReadonly]=\"true\"></spx-input>\n }\n </div>\n }\n </form>\n </div>\n </ion-content>`\n})\nexport class SpxAppUpdateComponent {\n @Input() spxHomeUrl!: string;\n @Input() spxIsSignedIn!: boolean;\n @Input() textCheckingForUpdates!: string;\n @Input() textDownloadingUpdate!: string;\n @Input() textErrorWhileUpdatingApp!: string;\n @Input() textFinishedUpdating!: string;\n @Input() textNoUpdatesAvailable!: string;\n @Input() textUnexpectedError!: string;\n @Input() txtAppStoreVersion!: string;\n @Input() txtChannel!: string;\n @Input() txtNextVersion!: string;\n @Input() txtUpdate!: string;\n @Input() txtVersion!: string;\n @Input() spxAppId!: string;\n\n form: FormGroup;\n\n delayedPercentage: number = 0;\n percentage: number = 0;\n syncTruckInterval: any | null = null;\n updateStatus: string = this.textCheckingForUpdates;\n\n constructor(\n private readonly deploy: Deploy,\n private readonly changeDetector: ChangeDetectorRef,\n private readonly applicationRef: ApplicationRef,\n private readonly translateService: TranslateService,\n private readonly formBuilder: FormBuilder,\n private readonly navController: NavController,\n ) {\n this.form = this.formBuilder.group({\n [ctrlNextVersionNumber]: [null, []],\n [ctrlVersionNumber]: [null, []],\n [ctrlConfiguredChannel]: [null, []],\n [ctrlAppStoreVersion]: [null, []],\n });\n }\n\n get ctrlVersionNumber(): FormControl { return this.form.get(ctrlVersionNumber) as FormControl; }\n get ctrlNextVersionNumber(): FormControl { return this.form.get(ctrlNextVersionNumber) as FormControl; }\n get ctrlConfiguredChannel(): FormControl { return this.form.get(ctrlConfiguredChannel) as FormControl; }\n get ctrlAppStoreVersion(): FormControl { return this.form.get(ctrlAppStoreVersion) as FormControl; }\n\n init() {\n this.delayedPercentage = 0;\n this.percentage = 0;\n this.performAutomaticUpdate().then(() => { });\n this.startLoaderSync();\n this.changeStatus({\n percentage: 0,\n text: this.translateService.instant(this.textCheckingForUpdates),\n });\n }\n\n destroy() {\n this.stopLoaderSync();\n }\n\n async performAutomaticUpdate() {\n const deviceInfo = await Device.getInfo();\n\n if (deviceInfo?.platform === 'web') {\n // Local? Skip the update page.\n this.closeUpdateScreen();\n }\n try {\n this.updateInfo();\n\n // Start upgrade\n const currentVersion = await this.deploy.getCurrentVersion();\n if (currentVersion?.binaryVersionName) {\n const binaryGroup = currentVersion.binaryVersionName.substring(0, 3); // e.g. \"1.4\"\n const channelGroup = currentVersion.channel.split('-')[1].substring(0, 3); // e.g. \"1.4\"\n const channelType = currentVersion.channel.split('-')[0];\n\n if (binaryGroup != channelGroup) {\n await this.deploy.configure({\n appId: this.spxAppId,\n channel: `${channelType}-${binaryGroup}.x`\n }).then(() => {\n this.sync().then(() => { });\n });\n } else {\n this.sync().then(() => { });\n }\n } else {\n this.sync().then(() => { });\n }\n // End upgrade\n } catch (error: any) {\n this.changeStatus({\n closeScreen: true,\n error,\n percentage: 100,\n text: this.translateService.instant(this.textUnexpectedError)\n });\n }\n }\n\n private async sync() {\n try {\n this.updateInfo();\n\n const updateAvailableInfo = await this.deploy.checkForUpdate();\n if (!updateAvailableInfo.available) {\n // No update available\n this.changeStatus({\n closeScreen: true,\n percentage: 0,\n text: this.translateService.instant(this.textNoUpdatesAvailable),\n });\n } else {\n // Download update\n await this.deploy.sync({ updateMethod: 'auto' }, (percentage) => {\n this.changeStatus({\n percentage: percentage ?? 0,\n text: this.translateService.instant(this.textDownloadingUpdate, { percentage, version: updateAvailableInfo.build }),\n });\n }).catch((error) => {\n this.changeStatus({\n closeScreen: true,\n error,\n percentage: 100,\n text: this.translateService.instant(this.textErrorWhileUpdatingApp),\n });\n });\n\n this.changeStatus({\n closeScreen: true,\n percentage: 100,\n text: this.translateService.instant(this.textFinishedUpdating, { version: updateAvailableInfo.build })\n });\n }\n } catch (error: any) {\n // Catch unexpected plug-in errors\n this.changeStatus({\n closeScreen: true,\n error,\n percentage: 100,\n text: this.translateService.instant(this.textUnexpectedError)\n });\n }\n }\n\n private async updateInfo(): Promise<void> {\n const currentVersion = await this.deploy.getCurrentVersion();\n const configuration = await this.deploy.getConfiguration();\n const updateAvailableInfo = await this.deploy.checkForUpdate();\n\n if (currentVersion) {\n this.ctrlVersionNumber.setValue({\n value: configuration?.currentBuildId,\n });\n this.ctrlNextVersionNumber.setValue({\n value: updateAvailableInfo?.build\n });\n this.ctrlConfiguredChannel.setValue({\n value: configuration ? configuration.channel : null\n });\n this.ctrlAppStoreVersion.setValue({\n value: configuration ? configuration.binaryVersionName : null\n });\n\n {\n const scope = getCurrentScope();\n scope.setTag('version_binary_code', currentVersion?.binaryVersionCode);\n scope.setTag('version_binary_name', currentVersion?.binaryVersionName);\n scope.setTag('version_build_id', currentVersion?.buildId);\n scope.setTag('channel_type', currentVersion?.channel);\n scope.setTag('version_snapshot_id', currentVersion?.versionId);\n };\n\n this.changeDetector.markForCheck();\n this.applicationRef.tick();\n }\n }\n\n private changeStatus(status: {\n error?: string;\n text: string;\n closeScreen?: boolean;\n percentage: number;\n }) {\n this.updateStatus = status.text;\n this.percentage = status.percentage;\n if (status.closeScreen) {\n this.closeUpdateScreen();\n }\n if (status.error) {\n // this.appStore.dispatch(\n // sharedToasterActions.CREATE_ERROR({\n // messageText: status.error,\n // })\n // );\n }\n this.changeDetector.markForCheck();\n this.applicationRef.tick();\n }\n\n private closeUpdateScreen() {\n // Allowing some time to make a screenshot of version info\n SpxStorage.clearSetting<any>(SpxStorageKeyEnum.updateInProgress);\n setTimeout(() => {\n if (\n SpxStorage.getSetting<any>(SpxStorageKeyEnum.afterSignIn) &&\n this.spxIsSignedIn\n ) {\n this.navController.navigateRoot([SpxStorage.getSetting<any>(SpxStorageKeyEnum.afterSignIn)]);\n SpxStorage.clearSetting<any>(SpxStorageKeyEnum.afterSignIn)\n } else {\n this.navController.navigateRoot([this.spxHomeUrl]);\n }\n }, 0);\n }\n\n private startLoaderSync() {\n SpxStorage.setSetting<any>(SpxStorageKeyEnum.updateInProgress, '1');\n if (this.syncTruckInterval === null) {\n this.syncTruckInterval = setInterval(() => {\n this.delayedPercentage = this.percentage;\n }, 200);\n }\n }\n\n private stopLoaderSync() {\n if (this.syncTruckInterval !== null) {\n clearInterval(this.syncTruckInterval);\n this.syncTruckInterval = null;\n }\n }\n}\n","import { createAction, props, union } from '@ngrx/store';\n\nexport const anUpdateIsReady = createAction('[UPD / Check] An update is ready', props<Record<string, unknown>>());\nexport const clearError = createAction('[UPD / Check] Clear error', props<Record<string, unknown>>());\nexport const checkFailed = createAction('[UPD / Check] Error happened', props<{ startUpdateAgainAfterTimeout?: boolean }>());\nexport const initialize = createAction('[UPD / Check] Initialize', props<Record<string, unknown>>());\nexport const noUpdateWasFound = createAction('[UPD / Check] No update was found', props<{ startUpdateAgainAfterTimeout?: boolean }>());\nexport const notAvailableOnWeb = createAction('[UPD / Check] Not available on web', props<Record<string, unknown>>());\nexport const runCheck = createAction('[UPD / Check] Run', props<{ forceWaitForUpdate?: boolean; }>());\n\nconst all = union({\n anUpdateIsReady,\n clearError,\n checkFailed,\n initialize,\n noUpdateWasFound,\n notAvailableOnWeb,\n runCheck,\n});\n\nexport type Actions = typeof all;\n","import { createAction, props, union } from '@ngrx/store';\n\nexport const acceptUpdate = createAction('[UPD / Available] Accept update', props<Record<string, unknown>>());\nexport const hasBeenDownloaded = createAction('[UPD / Available] Has been downloaded', props<Record<string, unknown>>());\nexport const hasBeenInstalled = createAction('[UPD / Available] Has been installed', props<Record<string, unknown>>());\nexport const postpone = createAction('[UPD / Available] Postpone', props<Record<string, unknown>>());\nexport const postponeExpired = createAction('[UPD / Available] Postpone expired', props<Record<string, unknown>>());\n\nconst all = union({\n acceptUpdate,\n hasBeenDownloaded,\n hasBeenInstalled,\n postpone,\n postponeExpired,\n});\n\nexport type Actions = typeof all;\n","import { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { from, Observable, of } from 'rxjs';\nimport { catchError, delay, exhaustMap, map, mergeMap, tap } from 'rxjs/operators';\nimport { Injectable } from '@angular/core';\nimport * as actions from './upd-check.actions';\nimport { getConfig, reload, setConfig, sync, SyncResult } from '@capacitor/live-updates';\nimport { captureMessage } from '@sentry/angular';\nimport { Capacitor } from '@capacitor/core';\nimport { AppUpdate } from '@capawesome/capacitor-app-update';\nimport { hasBeenDownloaded } from '../upd-pending/upd-pending.actions';\n\n@Injectable()\nexport class Effects {\n afterInitialize$: Observable<any> = createEffect(() => this.actions$.pipe(\n ofType(actions.initialize),\n delay(120000),\n mergeMap(() => [\n actions.runCheck({}),\n ]))\n );\n onRun$: Observable<any> = createEffect(() => this.actions$.pipe(\n ofType(actions.runCheck),\n tap(async () => {\n if (Capacitor.getPlatform() !== 'web') {\n // Migrate from e.g. 1.2.x to 1.3.x\n const binaryInfo = await AppUpdate.getAppUpdateInfo()\n const binaryVersionGroup = (Capacitor.getPlatform() === 'android' ? binaryInfo.currentVersionCode : binaryInfo.currentVersionName).substring(0, 3);\n const config = await getConfig();\n const channelVersionGroup = config.channel!.split('-')[1].substring(0, 3); // e.g. \"1.4\"\n const channelType = config.channel!.split('-')[0];\n captureMessage(\"[UPD] Changed chanel to `${channelType}-${binaryVersionGroup}.x`\");\n if (binaryVersionGroup != channelVersionGroup) {\n await setConfig({\n channel: `${channelType}-${binaryVersionGroup}.x`\n });\n }\n // End migrate from e.g. 1.2.x to 1.3.x\n }\n }),\n exhaustMap((action) => from(sync()).pipe(\n map((syncResult: SyncResult) => {\n if (syncResult.activeApplicationPathChanged) {\n if (action.forceWaitForUpdate) {\n reload();\n }\n return actions.anUpdateIsReady({});\n } else {\n return actions.noUpdateWasFound({ startUpdateAgainAfterTimeout: !action.forceWaitForUpdate });\n }\n }),\n catchError((err) => {\n if (err.message !== 'Not implemented for web only') {\n captureMessage(\"[UPD] Handled: \" + err.message);\n }\n return err.message === 'Not implemented for web only' ? of(actions.notAvailableOnWeb({})) : of(actions.checkFailed({ startUpdateAgainAfterTimeout: !action.forceWaitForUpdate }))\n })\n )),\n ));\n\n constructor(\n private readonly actions$: Actions,\n ) { }\n\n whenAndUpdateIsReady$: Observable<any> = createEffect(() => this.actions$.pipe(\n ofType(actions.anUpdateIsReady),\n mergeMap(() => [\n hasBeenDownloaded({}),\n ]))\n );\n\n whenCheckHasFailed$: Observable<any> = createEffect(() => this.actions$.pipe(\n ofType(actions.checkFailed),\n delay(30000),\n mergeMap((action) => !action.startUpdateAgainAfterTimeout ? [] : [\n actions.runCheck({}),\n ]))\n );\n\n whenNoUpdateWasFound$: Observable<any> = createEffect(() => this.actions$.pipe(\n ofType(actions.noUpdateWasFound),\n delay(120000),\n mergeMap((action) => !action.startUpdateAgainAfterTimeout ? [] : [\n actions.runCheck({}),\n ]))\n );\n}\n\n","import { StateI } from \"./upd-check.state\";\n\nexport const initialState: StateI = {\n forceWaitForUpdate: false,\n lastCheck: null,\n showError: false,\n};\n","\nimport * as actions from './upd-check.actions';\nimport { createFeature, createReducer, on } from '@ngrx/store';\nimport { StateI } from './upd-check.state';\nimport { initialState } from './upd-check.initial';\nimport { DateTime } from 'luxon';\n \nexport default createFeature({\n name: 'spxUpdCheck',\n reducer: createReducer(\n initialState,\n on(actions.anUpdateIsReady, (state: StateI): StateI => {\n return {\n ...state,\n lastCheck: DateTime.now().toISO(),\n showError: false,\n };\n }),\n on(actions.clearError, (state: StateI): StateI => {\n return {\n ...state,\n showError: false,\n };\n }),\n on(actions.checkFailed, (state: StateI): StateI => {\n return {\n ...state,\n forceWaitForUpdate: false,\n showError: true,\n };\n }),\n on(actions.noUpdateWasFound, (state: StateI): StateI => {\n return {\n ...state,\n forceWaitForUpdate: false,\n lastCheck: DateTime.now().toISO(),\n showError: false,\n };\n }),\n on(actions.runCheck, (state: StateI, { forceWaitForUpdate }): StateI => {\n return {\n ...state,\n forceWaitForUpdate: forceWaitForUpdate ? true : state.forceWaitForUpdate\n };\n }),\n on(actions.notAvailableOnWeb, (state: StateI): StateI => {\n return {\n ...state,\n forceWaitForUpdate: false\n };\n }),\n ),\n});\n","export * from './spx-app-update.component';\nexport * as updCheckActions from './store/upd-check/upd-check.actions';\nexport * as updCheckEffects from './store/upd-check/upd-check.effects';\nexport * as updCheckInitial from './store/upd-check/upd-check.initial';\nexport * as updCheckReducer from './store/upd-check/upd-check.reducer';\nexport * as updCheckState from './store/upd-check/upd-check.state';\n// export * as updPendingActions from './store/upd-pending/upd-pending.actions';\n// export * as updPendingEffects from './store/upd-pending/upd-pending.effects';\n// export * as updPendingInitial from './store/upd-pending/upd-pending.initial';\n// export * as updPendingReducer from './store/upd-pending/upd-pending.reducer';\n// export * as updPendingState from './store/upd-pending/upd-pending.state';\n\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["all","actions.initialize","actions.runCheck","actions.anUpdateIsReady","actions.noUpdateWasFound","actions.notAvailableOnWeb","actions.checkFailed","i1","actions.clearError"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAaA,MAAM,qBAAqB,GAAG,uBAAuB;AACrD,MAAM,iBAAiB,GAAG,mBAAmB;AAC7C,MAAM,qBAAqB,GAAG,uBAAuB;AACrD,MAAM,mBAAmB,GAAG,qBAAqB;MA+CpC,qBAAqB,CAAA;IAuBhC,WACmB,CAAA,MAAc,EACd,cAAiC,EACjC,cAA8B,EAC9B,gBAAkC,EAClC,WAAwB,EACxB,aAA4B,EAAA;QAL5B,IAAM,CAAA,MAAA,GAAN,MAAM;QACN,IAAc,CAAA,cAAA,GAAd,cAAc;QACd,IAAc,CAAA,cAAA,GAAd,cAAc;QACd,IAAgB,CAAA,gBAAA,GAAhB,gBAAgB;QAChB,IAAW,CAAA,WAAA,GAAX,WAAW;QACX,IAAa,CAAA,aAAA,GAAb,aAAa;QAXhC,IAAiB,CAAA,iBAAA,GAAW,CAAC;QAC7B,IAAU,CAAA,UAAA,GAAW,CAAC;QACtB,IAAiB,CAAA,iBAAA,GAAe,IAAI;AACpC,QAAA,IAAA,CAAA,YAAY,GAAW,IAAI,CAAC,sBAAsB;QAUhD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;AACjC,YAAA,CAAC,qBAAqB,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC;AACnC,YAAA,CAAC,iBAAiB,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC;AAC/B,YAAA,CAAC,qBAAqB,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC;AACnC,YAAA,CAAC,mBAAmB,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC;AAClC,SAAA,CAAC;;AAGJ,IAAA,IAAI,iBAAiB,GAAA,EAAkB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,iB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AACR,YAAA,kBAAkB,EAAE,KAAK;AACzB,YAAA,SAAS,EAAE,IAAI;SAClB;KACJ,CAAC,EACF,EAAE,CAACF,gBAAwB,EAAE,CAAC,KAAa,KAAY;QACnD,OAAO;AACH,YAAA,GAAG,KAAK;AACR,YAAA,kBAAkB,EAAE,KAAK;AACzB,YAAA,SAAS,EAAE,QAAQ,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE;AACjC,YAAA,SAAS,EAAE,KAAK;SACnB;AACL,KAAC,CAAC,EACF,EAAE,CAACF,QAAgB,EAAE,CAAC,KAAa,EAAE,EAAE,kBAAkB,EAAE,KAAY;QACnE,OAAO;AACH,YAAA,GAAG,KAAK;YACR,kBAAkB,EAAE,kBAAkB,GAAG,IAAI,GAAG,KAAK,CAAC;SACzD;KACJ,CAAC,EACF,EAAE,CAACG,iBAAyB,EAAE,CAAC,KAAa,KAAY;QACpD,OAAO;AACH,YAAA,GAAG,KAAK;AACR,YAAA,kBAAkB,EAAE;SACvB;AACL,KAAC,CAAC,CACL;AACJ,CAAA,CAAC;;;;;;;;;;;AC9CF;AACA;AACA;AACA;AACA;;ACVA;;AAEG;;;;"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export * from './spx-app-update.component';
|
|
2
|
-
export * as updCheckActions from './store/upd-check/upd-check.actions';
|
|
3
|
-
export * as updCheckEffects from './store/upd-check/upd-check.effects';
|
|
4
|
-
export * as updCheckInitial from './store/upd-check/upd-check.initial';
|
|
5
|
-
export * as updCheckReducer from './store/upd-check/upd-check.reducer';
|
|
6
|
-
export * as updCheckState from './store/upd-check/upd-check.state';
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { ApplicationRef, ChangeDetectorRef } from '@angular/core';
|
|
2
|
-
import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
|
|
3
|
-
import { TranslateService } from '@ngx-translate/core';
|
|
4
|
-
import { Deploy } from 'cordova-plugin-ionic/dist/ngx';
|
|
5
|
-
import { NavController } from '@ionic/angular/standalone';
|
|
6
|
-
import * as i0 from "@angular/core";
|
|
7
|
-
export declare class SpxAppUpdateComponent {
|
|
8
|
-
private readonly deploy;
|
|
9
|
-
private readonly changeDetector;
|
|
10
|
-
private readonly applicationRef;
|
|
11
|
-
private readonly translateService;
|
|
12
|
-
private readonly formBuilder;
|
|
13
|
-
private readonly navController;
|
|
14
|
-
spxHomeUrl: string;
|
|
15
|
-
spxIsSignedIn: boolean;
|
|
16
|
-
textCheckingForUpdates: string;
|
|
17
|
-
textDownloadingUpdate: string;
|
|
18
|
-
textErrorWhileUpdatingApp: string;
|
|
19
|
-
textFinishedUpdating: string;
|
|
20
|
-
textNoUpdatesAvailable: string;
|
|
21
|
-
textUnexpectedError: string;
|
|
22
|
-
txtAppStoreVersion: string;
|
|
23
|
-
txtChannel: string;
|
|
24
|
-
txtNextVersion: string;
|
|
25
|
-
txtUpdate: string;
|
|
26
|
-
txtVersion: string;
|
|
27
|
-
spxAppId: string;
|
|
28
|
-
form: FormGroup;
|
|
29
|
-
delayedPercentage: number;
|
|
30
|
-
percentage: number;
|
|
31
|
-
syncTruckInterval: any | null;
|
|
32
|
-
updateStatus: string;
|
|
33
|
-
constructor(deploy: Deploy, changeDetector: ChangeDetectorRef, applicationRef: ApplicationRef, translateService: TranslateService, formBuilder: FormBuilder, navController: NavController);
|
|
34
|
-
get ctrlVersionNumber(): FormControl;
|
|
35
|
-
get ctrlNextVersionNumber(): FormControl;
|
|
36
|
-
get ctrlConfiguredChannel(): FormControl;
|
|
37
|
-
get ctrlAppStoreVersion(): FormControl;
|
|
38
|
-
init(): void;
|
|
39
|
-
destroy(): void;
|
|
40
|
-
performAutomaticUpdate(): Promise<void>;
|
|
41
|
-
private sync;
|
|
42
|
-
private updateInfo;
|
|
43
|
-
private changeStatus;
|
|
44
|
-
private closeUpdateScreen;
|
|
45
|
-
private startLoaderSync;
|
|
46
|
-
private stopLoaderSync;
|
|
47
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<SpxAppUpdateComponent, never>;
|
|
48
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SpxAppUpdateComponent, "spx-app-update", never, { "spxHomeUrl": { "alias": "spxHomeUrl"; "required": false; }; "spxIsSignedIn": { "alias": "spxIsSignedIn"; "required": false; }; "textCheckingForUpdates": { "alias": "textCheckingForUpdates"; "required": false; }; "textDownloadingUpdate": { "alias": "textDownloadingUpdate"; "required": false; }; "textErrorWhileUpdatingApp": { "alias": "textErrorWhileUpdatingApp"; "required": false; }; "textFinishedUpdating": { "alias": "textFinishedUpdating"; "required": false; }; "textNoUpdatesAvailable": { "alias": "textNoUpdatesAvailable"; "required": false; }; "textUnexpectedError": { "alias": "textUnexpectedError"; "required": false; }; "txtAppStoreVersion": { "alias": "txtAppStoreVersion"; "required": false; }; "txtChannel": { "alias": "txtChannel"; "required": false; }; "txtNextVersion": { "alias": "txtNextVersion"; "required": false; }; "txtUpdate": { "alias": "txtUpdate"; "required": false; }; "txtVersion": { "alias": "txtVersion"; "required": false; }; "spxAppId": { "alias": "spxAppId"; "required": false; }; }, {}, never, never, true, never>;
|
|
49
|
-
}
|