@softpak/components 21.2.0-capwesome.5 → 21.2.0-capwesome.7

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.
@@ -1,6 +1,6 @@
1
1
  import * as i3 from '@ionic/angular/standalone';
2
2
  import { IonContent, IonHeader, IonToolbar, IonTitle } from '@ionic/angular/standalone';
3
- import { spxTextCheckingForUpdates, spxTextOneMomentPlease, spxTextUpdateAppVersion, spxTextUpdateBinaryVersionGroup, spxTextUpdateBuildVersion, spxTextUpdateLiveBundle, spxTextUpdateLiveChannel, spxTextUpdateStatus, spxTextUpdateVersionInfo, spxTextUpdateStatusPreparing, spxTextUpdateStatusFailed, spxTextUpdateStatusSyncing, spxTextUpdateStatusCompleted, spxTextUpdate, spxTextReadyToBeInstalled, spxTextPatchAvailable, spxTextUpdateAvailable, spxTextOpenAppStore, spxTextLiveUpdateCheckFailed } from '@softpak/components/spx-translate';
3
+ import { spxTextCheckingForUpdates, spxTextOneMomentPlease, spxTextUpdateErrorReason, spxTextUpdateAppVersion, spxTextUpdateBinaryVersionGroup, spxTextUpdateBuildVersion, spxTextUpdateLastCheck, spxTextUpdateLiveBundle, spxTextUpdateLiveChannel, spxTextUpdateStatus, spxTextUpdateVersionInfo, spxTextUpdateStatusCompleted, spxTextUpdateStatusWebNotAvailable, spxTextUpdateStatusFailed, spxTextUpdateStatusUpdateReady, spxTextUpdateStatusUpToDate, spxTextUpdateStatusReloading, spxTextUpdateStatusSyncing, spxTextUpdateStatusPreparing, spxTextUpdate, spxTextReadyToBeInstalled, spxTextPatchAvailable, spxTextUpdateAvailable, spxTextOpenAppStore, spxTextLiveUpdateCheckFailedWithReason, spxTextLiveUpdateCheckFailed } from '@softpak/components/spx-translate';
4
4
  import { App } from '@capacitor/app';
5
5
  import * as i0 from '@angular/core';
6
6
  import { signal, computed, effect, Component, HostBinding, ChangeDetectionStrategy, inject, Injectable } from '@angular/core';
@@ -8,17 +8,16 @@ import { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';
8
8
  import { SpxStorage, SpxStorageKeyEnum } from '@softpak/components/spx-storage';
9
9
  import { TranslatePipe, TranslateService } from '@ngx-translate/core';
10
10
  import * as i1 from '@ngrx/store';
11
- import { createActionGroup, props, emptyProps, createFeature, createReducer, on } from '@ngrx/store';
11
+ import { createActionGroup, emptyProps, props, createFeature, createReducer, on, Store } from '@ngrx/store';
12
12
  import { DateTime } from 'luxon';
13
13
  import * as i2 from '@angular/router';
14
14
  import { unsubscribeSubscriptions, SpxSeverityEnum, getBinaryVersionGroup } from '@softpak/components/spx-helpers';
15
15
  import { SpxButtonComponent } from '@softpak/components/spx-button';
16
16
  import * as i2$1 from '@angular/platform-browser';
17
- import * as i1$1 from '@ngrx/effects';
18
17
  import { Actions, createEffect, ofType } from '@ngrx/effects';
19
18
  import { LiveUpdate } from '@capawesome/capacitor-live-update';
20
19
  import { spxToasterActions, SpxToasterAutoCloseSpeedEnum } from '@softpak/components/spx-toaster';
21
- import { of, from } from 'rxjs';
20
+ import { of, concat, from } from 'rxjs';
22
21
  import { delay, mergeMap, exhaustMap, map, catchError, tap } from 'rxjs/operators';
23
22
  import { Capacitor } from '@capacitor/core';
24
23
  import { SpxAppChannelTypeEnum } from '@softpak/components/spx-app-configuration';
@@ -33,14 +32,35 @@ const spxUpdateCheckActions = createActionGroup({
33
32
  initialize: emptyProps(),
34
33
  noUpdateWasFound: props(),
35
34
  notAvailableOnWeb: emptyProps(),
35
+ reloadStarted: emptyProps(),
36
36
  runCheck: props(),
37
+ syncStarted: emptyProps(),
37
38
  },
38
39
  });
39
40
 
41
+ var SpxUpdateCheckStatusEnum;
42
+ (function (SpxUpdateCheckStatusEnum) {
43
+ SpxUpdateCheckStatusEnum["failed"] = "failed";
44
+ SpxUpdateCheckStatusEnum["idle"] = "idle";
45
+ SpxUpdateCheckStatusEnum["notAvailableOnWeb"] = "notAvailableOnWeb";
46
+ SpxUpdateCheckStatusEnum["preparing"] = "preparing";
47
+ SpxUpdateCheckStatusEnum["reloading"] = "reloading";
48
+ SpxUpdateCheckStatusEnum["syncing"] = "syncing";
49
+ SpxUpdateCheckStatusEnum["upToDate"] = "upToDate";
50
+ SpxUpdateCheckStatusEnum["updateReady"] = "updateReady";
51
+ })(SpxUpdateCheckStatusEnum || (SpxUpdateCheckStatusEnum = {}));
52
+
53
+ var spxUpdateCheck_state = /*#__PURE__*/Object.freeze({
54
+ __proto__: null,
55
+ get SpxUpdateCheckStatusEnum () { return SpxUpdateCheckStatusEnum; }
56
+ });
57
+
40
58
  const initialState$1 = {
41
59
  forceWaitForUpdate: false,
60
+ lastErrorReason: null,
42
61
  lastCheck: null,
43
62
  showError: false,
63
+ status: SpxUpdateCheckStatusEnum.idle,
44
64
  };
45
65
 
46
66
  var spxUpdateCheck_initial = /*#__PURE__*/Object.freeze({
@@ -54,35 +74,56 @@ var updCheck = createFeature({
54
74
  return {
55
75
  ...state,
56
76
  lastCheck: DateTime.now().toISO(),
77
+ lastErrorReason: null,
57
78
  showError: false,
79
+ status: SpxUpdateCheckStatusEnum.updateReady,
58
80
  };
59
81
  }), on(spxUpdateCheckActions.clearError, (state) => {
60
82
  return {
61
83
  ...state,
84
+ lastErrorReason: null,
62
85
  showError: false,
63
86
  };
64
- }), on(spxUpdateCheckActions.checkFailed, (state) => {
87
+ }), on(spxUpdateCheckActions.checkFailed, (state, { errorReason }) => {
65
88
  return {
66
89
  ...state,
67
90
  forceWaitForUpdate: false,
91
+ lastErrorReason: errorReason || null,
68
92
  showError: true,
93
+ status: SpxUpdateCheckStatusEnum.failed,
69
94
  };
70
95
  }), on(spxUpdateCheckActions.noUpdateWasFound, (state) => {
71
96
  return {
72
97
  ...state,
73
98
  forceWaitForUpdate: false,
74
99
  lastCheck: DateTime.now().toISO(),
100
+ lastErrorReason: null,
75
101
  showError: false,
102
+ status: SpxUpdateCheckStatusEnum.upToDate,
76
103
  };
77
104
  }), on(spxUpdateCheckActions.runCheck, (state, { forceWaitForUpdate }) => {
78
105
  return {
79
106
  ...state,
80
- forceWaitForUpdate: forceWaitForUpdate ? true : state.forceWaitForUpdate
107
+ forceWaitForUpdate: forceWaitForUpdate ? true : state.forceWaitForUpdate,
108
+ lastErrorReason: null,
109
+ showError: false,
110
+ status: SpxUpdateCheckStatusEnum.preparing,
111
+ };
112
+ }), on(spxUpdateCheckActions.syncStarted, (state) => {
113
+ return {
114
+ ...state,
115
+ status: SpxUpdateCheckStatusEnum.syncing,
116
+ };
117
+ }), on(spxUpdateCheckActions.reloadStarted, (state) => {
118
+ return {
119
+ ...state,
120
+ status: SpxUpdateCheckStatusEnum.reloading,
81
121
  };
82
122
  }), on(spxUpdateCheckActions.notAvailableOnWeb, (state) => {
83
123
  return {
84
124
  ...state,
85
- forceWaitForUpdate: false
125
+ forceWaitForUpdate: false,
126
+ status: SpxUpdateCheckStatusEnum.notAvailableOnWeb,
86
127
  };
87
128
  })),
88
129
  });
@@ -105,34 +146,47 @@ class SpxUpdatePageComponent {
105
146
  this.appVersion = signal('-', ...(ngDevMode ? [{ debugName: "appVersion" }] : []));
106
147
  this.binaryVersionGroup = signal('-', ...(ngDevMode ? [{ debugName: "binaryVersionGroup" }] : []));
107
148
  this.buildVersion = signal('-', ...(ngDevMode ? [{ debugName: "buildVersion" }] : []));
149
+ this.lastCheck = this.appStore.selectSignal(updCheck.selectLastCheck);
150
+ this.lastErrorReason = this.appStore.selectSignal(updCheck.selectLastErrorReason);
108
151
  this.forceWaitForUpdate = this.appStore.selectSignal(updCheck.selectForceWaitForUpdate);
109
152
  this.hasStarted = signal(false, ...(ngDevMode ? [{ debugName: "hasStarted" }] : []));
110
153
  this.liveBundle = signal('-', ...(ngDevMode ? [{ debugName: "liveBundle" }] : []));
111
154
  this.liveUpdateChannel = signal('-', ...(ngDevMode ? [{ debugName: "liveUpdateChannel" }] : []));
155
+ this.status = this.appStore.selectSignal(updCheck.selectStatus);
112
156
  this.spxTextCheckingForUpdates = spxTextCheckingForUpdates;
113
157
  this.spxTextOneMomentPlease = spxTextOneMomentPlease;
158
+ this.spxTextUpdateErrorReason = spxTextUpdateErrorReason;
114
159
  this.spxTextUpdateAppVersion = spxTextUpdateAppVersion;
115
160
  this.spxTextUpdateBinaryVersionGroup = spxTextUpdateBinaryVersionGroup;
116
161
  this.spxTextUpdateBuildVersion = spxTextUpdateBuildVersion;
162
+ this.spxTextUpdateLastCheck = spxTextUpdateLastCheck;
117
163
  this.spxTextUpdateLiveBundle = spxTextUpdateLiveBundle;
118
164
  this.spxTextUpdateLiveChannel = spxTextUpdateLiveChannel;
119
165
  this.spxTextUpdateStatus = spxTextUpdateStatus;
120
166
  this.spxTextUpdateVersionInfo = spxTextUpdateVersionInfo;
121
167
  this.statusText = computed(() => {
122
- if (!this.hasStarted()) {
123
- return spxTextUpdateStatusPreparing;
168
+ switch (this.status()) {
169
+ case SpxUpdateCheckStatusEnum.preparing:
170
+ return spxTextUpdateStatusPreparing;
171
+ case SpxUpdateCheckStatusEnum.syncing:
172
+ return spxTextUpdateStatusSyncing;
173
+ case SpxUpdateCheckStatusEnum.reloading:
174
+ return spxTextUpdateStatusReloading;
175
+ case SpxUpdateCheckStatusEnum.upToDate:
176
+ return spxTextUpdateStatusUpToDate;
177
+ case SpxUpdateCheckStatusEnum.updateReady:
178
+ return spxTextUpdateStatusUpdateReady;
179
+ case SpxUpdateCheckStatusEnum.failed:
180
+ return spxTextUpdateStatusFailed;
181
+ case SpxUpdateCheckStatusEnum.notAvailableOnWeb:
182
+ return spxTextUpdateStatusWebNotAvailable;
183
+ default:
184
+ return spxTextUpdateStatusCompleted;
124
185
  }
125
- if (this.showError()) {
126
- return spxTextUpdateStatusFailed;
127
- }
128
- if (this.forceWaitForUpdate()) {
129
- return spxTextUpdateStatusSyncing;
130
- }
131
- return spxTextUpdateStatusCompleted;
132
186
  }, ...(ngDevMode ? [{ debugName: "statusText" }] : []));
133
187
  this.showError = this.appStore.selectSignal(updCheck.selectShowError);
134
188
  effect(() => {
135
- if (!this.hasStarted() || this.forceWaitForUpdate()) {
189
+ if (!this.hasStarted() || this.forceWaitForUpdate() || this.showError()) {
136
190
  return;
137
191
  }
138
192
  if (this.activatedRoute.snapshot.data['url'] === undefined) {
@@ -150,7 +204,7 @@ class SpxUpdatePageComponent {
150
204
  this.liveBundle.set(SpxStorage.getSetting(SpxStorageKeyEnum.liveUpdate) || '-');
151
205
  }
152
206
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: SpxUpdatePageComponent, deps: [{ token: i1.Store }, { token: i2.ActivatedRoute }, { token: i3.NavController }], target: i0.ɵɵFactoryTarget.Component }); }
153
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.0", type: SpxUpdatePageComponent, isStandalone: true, selector: "spx-update-page", ngImport: i0, template: "<ion-header>\n <ion-toolbar>\n <ion-title>\n {{ spxTextCheckingForUpdates | translate | capitalize }}\n </ion-title>\n </ion-toolbar>\n</ion-header>\n\n<ion-content class=\"ion-padding\">\n <p>{{ spxTextOneMomentPlease | translate | capitalize }}...</p>\n <p class=\"mt-2\">\n <strong>{{ spxTextUpdateStatus | translate | capitalize }}:</strong>\n {{ statusText() | translate | capitalize }}\n </p>\n\n <div class=\"mt-6 text-sm text-zinc-600\">\n <p><strong>{{ spxTextUpdateVersionInfo | translate | capitalize }}</strong></p>\n <p>{{ spxTextUpdateAppVersion | translate | capitalize }}: {{ appVersion() }}</p>\n <p>{{ spxTextUpdateBuildVersion | translate | capitalize }}: {{ buildVersion() }}</p>\n <p>{{ spxTextUpdateBinaryVersionGroup | translate | capitalize }}: {{ binaryVersionGroup() }}</p>\n <p>{{ spxTextUpdateLiveChannel | translate | capitalize }}: {{ liveUpdateChannel() }}</p>\n <p>{{ spxTextUpdateLiveBundle | translate | capitalize }}: {{ liveBundle() }}</p>\n </div>\n</ion-content>\n", dependencies: [{ kind: "component", type: IonContent, selector: "ion-content", inputs: ["color", "fixedSlotPlacement", "forceOverscroll", "fullscreen", "scrollEvents", "scrollX", "scrollY"] }, { 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: "pipe", type: SpxCapitalizePipe, name: "capitalize" }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
207
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.0", type: SpxUpdatePageComponent, isStandalone: true, selector: "spx-update-page", ngImport: i0, template: "<ion-header>\n <ion-toolbar>\n <ion-title>\n {{ spxTextCheckingForUpdates | translate | capitalize }}\n </ion-title>\n </ion-toolbar>\n</ion-header>\n\n<ion-content class=\"ion-padding\">\n <p>{{ spxTextOneMomentPlease | translate | capitalize }}...</p>\n <p class=\"mt-2\">\n <strong>{{ spxTextUpdateStatus | translate | capitalize }}:</strong>\n {{ statusText() | translate | capitalize }}\n </p>\n @if (lastErrorReason()) {\n <p class=\"mt-2 text-red-700\">\n <strong>{{ spxTextUpdateErrorReason | translate | capitalize }}:</strong>\n {{ lastErrorReason() }}\n </p>\n }\n @if (lastCheck()) {\n <p class=\"mt-1 text-sm text-zinc-600\">\n <strong>{{ spxTextUpdateLastCheck | translate | capitalize }}:</strong>\n {{ lastCheck() }}\n </p>\n }\n\n <div class=\"mt-6 text-sm text-zinc-600\">\n <p><strong>{{ spxTextUpdateVersionInfo | translate | capitalize }}</strong></p>\n <p>{{ spxTextUpdateAppVersion | translate | capitalize }}: {{ appVersion() }}</p>\n <p>{{ spxTextUpdateBuildVersion | translate | capitalize }}: {{ buildVersion() }}</p>\n <p>{{ spxTextUpdateBinaryVersionGroup | translate | capitalize }}: {{ binaryVersionGroup() }}</p>\n <p>{{ spxTextUpdateLiveChannel | translate | capitalize }}: {{ liveUpdateChannel() }}</p>\n <p>{{ spxTextUpdateLiveBundle | translate | capitalize }}: {{ liveBundle() }}</p>\n </div>\n</ion-content>\n", dependencies: [{ kind: "component", type: IonContent, selector: "ion-content", inputs: ["color", "fixedSlotPlacement", "forceOverscroll", "fullscreen", "scrollEvents", "scrollX", "scrollY"] }, { 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: "pipe", type: SpxCapitalizePipe, name: "capitalize" }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
154
208
  }
155
209
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: SpxUpdatePageComponent, decorators: [{
156
210
  type: Component,
@@ -161,7 +215,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImpor
161
215
  IonTitle,
162
216
  SpxCapitalizePipe,
163
217
  TranslatePipe,
164
- ], standalone: true, template: "<ion-header>\n <ion-toolbar>\n <ion-title>\n {{ spxTextCheckingForUpdates | translate | capitalize }}\n </ion-title>\n </ion-toolbar>\n</ion-header>\n\n<ion-content class=\"ion-padding\">\n <p>{{ spxTextOneMomentPlease | translate | capitalize }}...</p>\n <p class=\"mt-2\">\n <strong>{{ spxTextUpdateStatus | translate | capitalize }}:</strong>\n {{ statusText() | translate | capitalize }}\n </p>\n\n <div class=\"mt-6 text-sm text-zinc-600\">\n <p><strong>{{ spxTextUpdateVersionInfo | translate | capitalize }}</strong></p>\n <p>{{ spxTextUpdateAppVersion | translate | capitalize }}: {{ appVersion() }}</p>\n <p>{{ spxTextUpdateBuildVersion | translate | capitalize }}: {{ buildVersion() }}</p>\n <p>{{ spxTextUpdateBinaryVersionGroup | translate | capitalize }}: {{ binaryVersionGroup() }}</p>\n <p>{{ spxTextUpdateLiveChannel | translate | capitalize }}: {{ liveUpdateChannel() }}</p>\n <p>{{ spxTextUpdateLiveBundle | translate | capitalize }}: {{ liveBundle() }}</p>\n </div>\n</ion-content>\n" }]
218
+ ], standalone: true, template: "<ion-header>\n <ion-toolbar>\n <ion-title>\n {{ spxTextCheckingForUpdates | translate | capitalize }}\n </ion-title>\n </ion-toolbar>\n</ion-header>\n\n<ion-content class=\"ion-padding\">\n <p>{{ spxTextOneMomentPlease | translate | capitalize }}...</p>\n <p class=\"mt-2\">\n <strong>{{ spxTextUpdateStatus | translate | capitalize }}:</strong>\n {{ statusText() | translate | capitalize }}\n </p>\n @if (lastErrorReason()) {\n <p class=\"mt-2 text-red-700\">\n <strong>{{ spxTextUpdateErrorReason | translate | capitalize }}:</strong>\n {{ lastErrorReason() }}\n </p>\n }\n @if (lastCheck()) {\n <p class=\"mt-1 text-sm text-zinc-600\">\n <strong>{{ spxTextUpdateLastCheck | translate | capitalize }}:</strong>\n {{ lastCheck() }}\n </p>\n }\n\n <div class=\"mt-6 text-sm text-zinc-600\">\n <p><strong>{{ spxTextUpdateVersionInfo | translate | capitalize }}</strong></p>\n <p>{{ spxTextUpdateAppVersion | translate | capitalize }}: {{ appVersion() }}</p>\n <p>{{ spxTextUpdateBuildVersion | translate | capitalize }}: {{ buildVersion() }}</p>\n <p>{{ spxTextUpdateBinaryVersionGroup | translate | capitalize }}: {{ binaryVersionGroup() }}</p>\n <p>{{ spxTextUpdateLiveChannel | translate | capitalize }}: {{ liveUpdateChannel() }}</p>\n <p>{{ spxTextUpdateLiveBundle | translate | capitalize }}: {{ liveBundle() }}</p>\n </div>\n</ion-content>\n" }]
165
219
  }], ctorParameters: () => [{ type: i1.Store }, { type: i2.ActivatedRoute }, { type: i3.NavController }] });
166
220
 
167
221
  const SpxUpdatePendingActions = createActionGroup({
@@ -277,7 +331,7 @@ let Effects$1 = class Effects {
277
331
  if (Capacitor.getPlatform() === 'web') {
278
332
  return of(spxUpdateCheckActions.notAvailableOnWeb());
279
333
  }
280
- return from(App.getInfo()).pipe(mergeMap((binaryInfo) => {
334
+ return concat(of(spxUpdateCheckActions.syncStarted()), from(App.getInfo()).pipe(mergeMap((binaryInfo) => {
281
335
  // Migrate from e.g. 1.2.x to 1.3.x
282
336
  const binaryVersionGroup = getBinaryVersionGroup(binaryInfo.version);
283
337
  let channelType = SpxStorage.getSetting(SpxStorageKeyEnum.channelType);
@@ -288,21 +342,32 @@ let Effects$1 = class Effects {
288
342
  SpxStorage.setSetting(SpxStorageKeyEnum.liveUpdateChannel, `${channelType ? channelType : SpxAppChannelTypeEnum.production}-${binaryVersionGroup}.x`);
289
343
  // End migrate from e.g. 1.2.x to 1.3.x
290
344
  return from(LiveUpdate.sync({ channel: SpxStorage.getSetting(SpxStorageKeyEnum.liveUpdateChannel) }));
291
- }), map((syncResult) => {
345
+ }), mergeMap((syncResult) => {
292
346
  if (syncResult.nextBundleId) {
293
347
  SpxStorage.setSetting(SpxStorageKeyEnum.liveUpdate, syncResult.nextBundleId);
294
348
  if (action.forceWaitForUpdate) {
295
- LiveUpdate.reload();
349
+ return concat(of(spxUpdateCheckActions.reloadStarted()), from(LiveUpdate.reload()).pipe(map(() => spxUpdateCheckActions.anUpdateIsReady()), catchError((err) => {
350
+ const errorReason = this.getReadableErrorReason(err);
351
+ captureMessage(`[UPD] Reload failed: ${errorReason}`);
352
+ return of(spxUpdateCheckActions.checkFailed({
353
+ errorReason,
354
+ startUpdateAgainAfterTimeout: false,
355
+ }));
356
+ })));
296
357
  }
297
- return spxUpdateCheckActions.anUpdateIsReady();
358
+ return of(spxUpdateCheckActions.anUpdateIsReady());
298
359
  }
299
360
  else {
300
- return spxUpdateCheckActions.noUpdateWasFound({ startUpdateAgainAfterTimeout: !action.forceWaitForUpdate });
361
+ return of(spxUpdateCheckActions.noUpdateWasFound({ startUpdateAgainAfterTimeout: !action.forceWaitForUpdate }));
301
362
  }
302
363
  }), catchError((err) => {
303
- captureMessage("[UPD] Handled: " + err.message);
304
- return of(spxUpdateCheckActions.checkFailed({ startUpdateAgainAfterTimeout: false }));
305
- }));
364
+ const errorReason = this.getReadableErrorReason(err);
365
+ captureMessage(`[UPD] Handled: ${errorReason}`);
366
+ return of(spxUpdateCheckActions.checkFailed({
367
+ errorReason,
368
+ startUpdateAgainAfterTimeout: false,
369
+ }));
370
+ })));
306
371
  })));
307
372
  this.whenAndUpdateIsReady$ = createEffect(() => this.actions$.pipe(ofType(spxUpdateCheckActions.anUpdateIsReady), mergeMap(() => [
308
373
  SpxUpdatePendingActions.hasBeenDownloaded(),
@@ -310,14 +375,40 @@ let Effects$1 = class Effects {
310
375
  this.whenCheckHasFailed$ = createEffect(() => this.actions$.pipe(ofType(spxUpdateCheckActions.checkFailed), delay(30000), mergeMap((action) => !action.startUpdateAgainAfterTimeout ? [] : [
311
376
  spxUpdateCheckActions.runCheck({}),
312
377
  ])));
313
- this.whenCheckHasFailedShowError$ = createEffect(() => this.actions$.pipe(ofType(spxUpdateCheckActions.checkFailed), map(() => spxToasterActions.createError({
378
+ this.whenCheckHasFailedShowError$ = createEffect(() => this.actions$.pipe(ofType(spxUpdateCheckActions.checkFailed), map((action) => spxToasterActions.createError({
314
379
  autoClose: SpxToasterAutoCloseSpeedEnum.DEFAULT,
315
- messageText: this.translateService.instant(spxTextLiveUpdateCheckFailed),
380
+ messageText: action.errorReason
381
+ ? this.translateService.instant(spxTextLiveUpdateCheckFailedWithReason, { reason: action.errorReason })
382
+ : this.translateService.instant(spxTextLiveUpdateCheckFailed),
316
383
  }))));
317
384
  this.whenNoUpdateWasFound$ = createEffect(() => this.actions$.pipe(ofType(spxUpdateCheckActions.noUpdateWasFound), delay(120000), mergeMap((action) => !action.startUpdateAgainAfterTimeout ? [] : [
318
385
  spxUpdateCheckActions.runCheck({}),
319
386
  ])));
320
387
  }
388
+ getReadableErrorReason(err) {
389
+ if (err instanceof Error && err.message?.trim()) {
390
+ return err.message.trim();
391
+ }
392
+ if (typeof err === 'string' && err.trim()) {
393
+ return err.trim();
394
+ }
395
+ if (err && typeof err === 'object') {
396
+ const withMessage = err;
397
+ if (typeof withMessage.message === 'string' && withMessage.message.trim()) {
398
+ return withMessage.message.trim();
399
+ }
400
+ try {
401
+ const serialized = JSON.stringify(err);
402
+ if (serialized && serialized !== '{}') {
403
+ return serialized.length > 180 ? `${serialized.slice(0, 177)}...` : serialized;
404
+ }
405
+ }
406
+ catch {
407
+ // ignore serialization errors
408
+ }
409
+ }
410
+ return '';
411
+ }
321
412
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: Effects, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
322
413
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: Effects }); }
323
414
  };
@@ -330,23 +421,54 @@ var spxUpdateCheck_effects = /*#__PURE__*/Object.freeze({
330
421
  Effects: Effects$1
331
422
  });
332
423
 
333
- var spxUpdateCheck_state = /*#__PURE__*/Object.freeze({
334
- __proto__: null
335
- });
336
-
337
424
  class Effects {
338
- constructor(actions$) {
339
- this.actions$ = actions$;
425
+ constructor() {
426
+ this.actions$ = inject(Actions);
427
+ this.appStore = inject(Store);
428
+ this.translateService = inject(TranslateService);
340
429
  this.whenAccepted$ = createEffect(() => this.actions$.pipe(ofType(SpxUpdatePendingActions.acceptUpdate), tap(() => {
341
- void LiveUpdate.reload();
430
+ void LiveUpdate.reload().catch((err) => {
431
+ const errorReason = this.getReadableErrorReason(err);
432
+ captureMessage(`[UPD] Accept reload failed: ${errorReason}`);
433
+ this.appStore.dispatch(spxToasterActions.createError({
434
+ autoClose: SpxToasterAutoCloseSpeedEnum.DEFAULT,
435
+ messageText: errorReason
436
+ ? this.translateService.instant(spxTextLiveUpdateCheckFailedWithReason, { reason: errorReason })
437
+ : this.translateService.instant(spxTextLiveUpdateCheckFailed),
438
+ }));
439
+ });
342
440
  })), { dispatch: false });
343
441
  }
344
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: Effects, deps: [{ token: i1$1.Actions }], target: i0.ɵɵFactoryTarget.Injectable }); }
442
+ getReadableErrorReason(err) {
443
+ if (err instanceof Error && err.message?.trim()) {
444
+ return err.message.trim();
445
+ }
446
+ if (typeof err === 'string' && err.trim()) {
447
+ return err.trim();
448
+ }
449
+ if (err && typeof err === 'object') {
450
+ const withMessage = err;
451
+ if (typeof withMessage.message === 'string' && withMessage.message.trim()) {
452
+ return withMessage.message.trim();
453
+ }
454
+ try {
455
+ const serialized = JSON.stringify(err);
456
+ if (serialized && serialized !== '{}') {
457
+ return serialized.length > 180 ? `${serialized.slice(0, 177)}...` : serialized;
458
+ }
459
+ }
460
+ catch {
461
+ // ignore serialization errors
462
+ }
463
+ }
464
+ return '';
465
+ }
466
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: Effects, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
345
467
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: Effects }); }
346
468
  }
347
469
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: Effects, decorators: [{
348
470
  type: Injectable
349
- }], ctorParameters: () => [{ type: i1$1.Actions }] });
471
+ }] });
350
472
 
351
473
  var spxUpdatePending_effects = /*#__PURE__*/Object.freeze({
352
474
  __proto__: null,
@@ -1 +1 @@
1
- {"version":3,"file":"softpak-components-spx-update.mjs","sources":["../../../../projects/softpak/components/spx-update/store/spx-update-check/spx-update-check.actions.ts","../../../../projects/softpak/components/spx-update/store/spx-update-check/spx-update-check.initial.ts","../../../../projects/softpak/components/spx-update/store/spx-update-check/spx-update-check.reducer.ts","../../../../projects/softpak/components/spx-update/spx-update-page.component.ts","../../../../projects/softpak/components/spx-update/spx-update-page.component.html","../../../../projects/softpak/components/spx-update/store/spx-update-pending/spx-update-pending.actions.ts","../../../../projects/softpak/components/spx-update/store/spx-update-pending/spx-update-pending.initial.ts","../../../../projects/softpak/components/spx-update/store/spx-update-pending/spx-update-pending.reducer.ts","../../../../projects/softpak/components/spx-update/spx-update-pending.component.ts","../../../../projects/softpak/components/spx-update/spx-update-pending.component.html","../../../../projects/softpak/components/spx-update/spx-update-url.ts","../../../../projects/softpak/components/spx-update/store/spx-update-check/spx-update-check.effects.ts","../../../../projects/softpak/components/spx-update/store/spx-update-pending/spx-update-pending.effects.ts","../../../../projects/softpak/components/spx-update/softpak-components-spx-update.ts"],"sourcesContent":["import { createActionGroup, emptyProps, props } from '@ngrx/store';\n\nexport const spxUpdateCheckActions = createActionGroup({\n source: 'SpxUpdateCheck',\n events: {\n anUpdateIsReady: emptyProps(),\n checkFailed: props<{ startUpdateAgainAfterTimeout?: boolean; }>(),\n clearError: emptyProps(),\n initialize: emptyProps(),\n noUpdateWasFound: props<{ startUpdateAgainAfterTimeout?: boolean; }>(),\n notAvailableOnWeb: emptyProps(),\n runCheck: props<{ forceWaitForUpdate?: boolean }>(),\n },\n});\n","import { StateI } from \"./spx-update-check.state\";\n\nexport const initialState: StateI = {\n forceWaitForUpdate: false,\n lastCheck: null,\n showError: false,\n};\n","import { createFeature, createReducer, on } from '@ngrx/store';\n\nimport { DateTime } from 'luxon';\nimport { StateI } from './spx-update-check.state';\nimport { initialState } from './spx-update-check.initial';\nimport { spxUpdateCheckActions } from './spx-update-check.actions';\n\nexport default createFeature({\n name: 'spxUpdateCheck',\n reducer: createReducer(\n initialState,\n on(spxUpdateCheckActions.anUpdateIsReady, (state: StateI): StateI => {\n return {\n ...state,\n lastCheck: DateTime.now().toISO(),\n showError: false,\n };\n }),\n on(spxUpdateCheckActions.clearError, (state: StateI): StateI => {\n return {\n ...state,\n showError: false,\n };\n }),\n on(spxUpdateCheckActions.checkFailed, (state: StateI): StateI => {\n return {\n ...state,\n forceWaitForUpdate: false,\n showError: true,\n };\n }),\n on(spxUpdateCheckActions.noUpdateWasFound, (state: StateI): StateI => {\n return {\n ...state,\n forceWaitForUpdate: false,\n lastCheck: DateTime.now().toISO(),\n showError: false,\n };\n }),\n on(spxUpdateCheckActions.runCheck, (state: StateI, { forceWaitForUpdate }): StateI => {\n return {\n ...state,\n forceWaitForUpdate: forceWaitForUpdate ? true : state.forceWaitForUpdate\n };\n }),\n on(spxUpdateCheckActions.notAvailableOnWeb, (state: StateI): StateI => {\n return {\n ...state,\n forceWaitForUpdate: false\n };\n }),\n ),\n});\n","import { IonContent, IonHeader, IonTitle, IonToolbar, NavController } from '@ionic/angular/standalone';\nimport {\n spxTextCheckingForUpdates,\n spxTextOneMomentPlease,\n spxTextUpdateAppVersion,\n spxTextUpdateBinaryVersionGroup,\n spxTextUpdateBuildVersion,\n spxTextUpdateLiveBundle,\n spxTextUpdateLiveChannel,\n spxTextUpdateStatus,\n spxTextUpdateStatusCompleted,\n spxTextUpdateStatusFailed,\n spxTextUpdateStatusPreparing,\n spxTextUpdateStatusSyncing,\n spxTextUpdateVersionInfo\n} from '@softpak/components/spx-translate';\n\nimport { ActivatedRoute } from '@angular/router';\nimport { App } from '@capacitor/app';\nimport { Component, computed, effect, signal } from '@angular/core';\nimport { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';\nimport { SpxStorage, SpxStorageKeyEnum } from '@softpak/components/spx-storage';\nimport { Store } from '@ngrx/store';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { spxUpdateCheckActions } from './store/spx-update-check/spx-update-check.actions';\nimport { default as updCheck } from './store/spx-update-check/spx-update-check.reducer';\n\n@Component({\n selector: 'spx-update-page',\n imports: [\n IonContent,\n IonHeader,\n IonToolbar,\n IonTitle,\n SpxCapitalizePipe,\n TranslatePipe,\n ],\n templateUrl: `./spx-update-page.component.html`,\n standalone: true,\n})\nexport class SpxUpdatePageComponent {\n appVersion = signal<string>('-');\n binaryVersionGroup = signal<string>('-');\n buildVersion = signal<string>('-');\n forceWaitForUpdate = this.appStore.selectSignal(updCheck.selectForceWaitForUpdate);\n hasStarted = signal<boolean>(false);\n liveBundle = signal<string>('-');\n liveUpdateChannel = signal<string>('-');\n spxTextCheckingForUpdates = spxTextCheckingForUpdates;\n spxTextOneMomentPlease = spxTextOneMomentPlease;\n spxTextUpdateAppVersion = spxTextUpdateAppVersion;\n spxTextUpdateBinaryVersionGroup = spxTextUpdateBinaryVersionGroup;\n spxTextUpdateBuildVersion = spxTextUpdateBuildVersion;\n spxTextUpdateLiveBundle = spxTextUpdateLiveBundle;\n spxTextUpdateLiveChannel = spxTextUpdateLiveChannel;\n spxTextUpdateStatus = spxTextUpdateStatus;\n spxTextUpdateVersionInfo = spxTextUpdateVersionInfo;\n statusText = computed(() => {\n if (!this.hasStarted()) {\n return spxTextUpdateStatusPreparing;\n }\n if (this.showError()) {\n return spxTextUpdateStatusFailed;\n }\n if (this.forceWaitForUpdate()) {\n return spxTextUpdateStatusSyncing;\n }\n return spxTextUpdateStatusCompleted;\n });\n showError = this.appStore.selectSignal(updCheck.selectShowError);\n\n ngOnInit() {\n this.hasStarted.set(true);\n void this.loadVersionInfo();\n this.appStore.dispatch(spxUpdateCheckActions.runCheck({ forceWaitForUpdate: true }));\n }\n\n constructor(\n private readonly appStore: Store,\n private readonly activatedRoute: ActivatedRoute,\n private readonly navController: NavController,\n ) {\n effect(() => {\n if (!this.hasStarted() || this.forceWaitForUpdate()) {\n return;\n }\n if (this.activatedRoute.snapshot.data['url'] === undefined) {\n console.error('configure data property \\'url\\' in route for update page');\n }\n this.navController.navigateRoot(this.activatedRoute.snapshot.data['url']);\n });\n }\n\n private async loadVersionInfo(): Promise<void> {\n const appInfo = await App.getInfo();\n this.appVersion.set(appInfo.version || '-');\n this.buildVersion.set(appInfo.build || '-');\n this.binaryVersionGroup.set(SpxStorage.getSetting(SpxStorageKeyEnum.binaryVersionGroup) || '-');\n this.liveUpdateChannel.set(SpxStorage.getSetting(SpxStorageKeyEnum.liveUpdateChannel) || '-');\n this.liveBundle.set(SpxStorage.getSetting(SpxStorageKeyEnum.liveUpdate) || '-');\n }\n}\n","<ion-header>\n <ion-toolbar>\n <ion-title>\n {{ spxTextCheckingForUpdates | translate | capitalize }}\n </ion-title>\n </ion-toolbar>\n</ion-header>\n\n<ion-content class=\"ion-padding\">\n <p>{{ spxTextOneMomentPlease | translate | capitalize }}...</p>\n <p class=\"mt-2\">\n <strong>{{ spxTextUpdateStatus | translate | capitalize }}:</strong>\n {{ statusText() | translate | capitalize }}\n </p>\n\n <div class=\"mt-6 text-sm text-zinc-600\">\n <p><strong>{{ spxTextUpdateVersionInfo | translate | capitalize }}</strong></p>\n <p>{{ spxTextUpdateAppVersion | translate | capitalize }}: {{ appVersion() }}</p>\n <p>{{ spxTextUpdateBuildVersion | translate | capitalize }}: {{ buildVersion() }}</p>\n <p>{{ spxTextUpdateBinaryVersionGroup | translate | capitalize }}: {{ binaryVersionGroup() }}</p>\n <p>{{ spxTextUpdateLiveChannel | translate | capitalize }}: {{ liveUpdateChannel() }}</p>\n <p>{{ spxTextUpdateLiveBundle | translate | capitalize }}: {{ liveBundle() }}</p>\n </div>\n</ion-content>\n","import { createActionGroup, emptyProps } from '@ngrx/store';\n\nexport const SpxUpdatePendingActions = createActionGroup({\n source: 'SpxUpdatePending',\n events: {\n AcceptUpdate: emptyProps(),\n HasBeenDownloaded: emptyProps(),\n HasBeenInstalled: emptyProps(),\n Postpone: emptyProps(),\n PostponeExpired: emptyProps(),\n },\n});\n","import { StateI } from \"./spx-update-pending.state\";\n\nexport const initialState: StateI = {\n showLiveUpdateReady: false,\n updateIsDownloadedAndPending: false,\n};\n","import { createFeature, createReducer, on } from '@ngrx/store';\n\nimport { SpxUpdatePendingActions } from './spx-update-pending.actions';\nimport { StateI } from './spx-update-pending.state';\nimport { initialState } from './spx-update-pending.initial';\n\nexport default createFeature({\n name: 'spxUpdatePending',\n reducer: createReducer(\n initialState,\n on(SpxUpdatePendingActions.hasBeenDownloaded, (state: StateI): StateI => {\n return {\n ...state,\n showLiveUpdateReady: true,\n updateIsDownloadedAndPending: true,\n };\n }),\n on(SpxUpdatePendingActions.hasBeenInstalled, (state: StateI): StateI => {\n return {\n ...state,\n showLiveUpdateReady: false,\n updateIsDownloadedAndPending: false,\n };\n }),\n on(SpxUpdatePendingActions.postpone, (state: StateI): StateI => {\n return {\n ...state,\n showLiveUpdateReady: false,\n };\n }),\n on(SpxUpdatePendingActions.postponeExpired, (state: StateI): StateI => {\n return {\n ...state,\n showLiveUpdateReady: true,\n };\n }),\n ),\n});\n","import { ChangeDetectionStrategy, Component, HostBinding, signal } from '@angular/core';\nimport { DomSanitizer, SafeStyle } from '@angular/platform-browser';\nimport { SpxSeverityEnum, unsubscribeSubscriptions } from '@softpak/components/spx-helpers';\nimport { spxTextOpenAppStore, spxTextPatchAvailable, spxTextReadyToBeInstalled, spxTextUpdate, spxTextUpdateAvailable } from '@softpak/components/spx-translate';\n\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\nimport { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';\nimport { SpxUpdatePendingActions } from './public-api';\nimport { Store } from '@ngrx/store';\nimport { Subscription } from 'rxjs';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { default as updPending } from './store/spx-update-pending/spx-update-pending.reducer';\n\n@Component({\n selector: 'spx-update-pending',\n imports: [\n SpxButtonComponent,\n SpxCapitalizePipe,\n TranslatePipe,\n ],\n templateUrl: `./spx-update-pending.component.html`,\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SpxUpdatePendingComponent {\n @HostBinding('style') baseStyle?: SafeStyle;\n availableStoreVersion = signal<undefined | string>(undefined);\n currentStoreVersion = signal<undefined | string>(undefined);\n severitySuccess = SpxSeverityEnum.success;\n showLiveUpdateReady = signal<boolean>(false);\n spxTextUpdate = spxTextUpdate;\n spxTextReadyToBeInstalled = spxTextReadyToBeInstalled;\n spxTextPatchAvailable = spxTextPatchAvailable;\n spxTextUpdateAvailable = spxTextUpdateAvailable;\n spxTextOpenAppStore = spxTextOpenAppStore;\n\n private subscriptions: {\n updPending?: Subscription;\n } = {};\n\n ngOnInit() {\n this.subscriptions.updPending = this.appStore.select(updPending.selectShowLiveUpdateReady).subscribe(showLiveUpdateReady => {\n this.showLiveUpdateReady.set(showLiveUpdateReady);\n if (showLiveUpdateReady) {\n this.baseStyle = this.sanitizer.bypassSecurityTrustStyle('display: block;');\n } else {\n this.baseStyle = this.sanitizer.bypassSecurityTrustStyle('display: none;');\n }\n });\n }\n\n ngOnDestroy() {\n unsubscribeSubscriptions(this.subscriptions);\n }\n\n constructor(\n private readonly appStore: Store,\n private sanitizer: DomSanitizer,\n ) {}\n\n onUpdate(): void {\n this.appStore.dispatch(SpxUpdatePendingActions.acceptUpdate());\n }\n}\n","@if (showLiveUpdateReady()) {\n<div class=\"bg-zinc-700 text-black p-3 rounded flex gap-3 mx-auto max-w-lg items-center\">\n <div class=\"grow\">\n <p\n class=\"text-xl font-extrabold bg-clip-text text-transparent bg-[linear-gradient(to_right,theme(colors.green.300),theme(colors.green.100),theme(colors.sky.400),theme(colors.yellow.200),theme(colors.sky.400),theme(colors.green.100),theme(colors.green.300))] bg-[length:200%_auto] animate-gradient\">\n {{ spxTextPatchAvailable | translate | capitalize }}</p>\n <div class=\"text-sm text-zinc-300\">{{ spxTextReadyToBeInstalled | translate | capitalize }}</div>\n </div>\n <spx-button [spxSeverity]=\"severitySuccess\" (spxClick)=\"onUpdate()\">{{ spxTextUpdate | translate | capitalize\n }}</spx-button>\n</div>\n}","export const spxUpdateUrl = '';","import { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { Injectable, inject } from '@angular/core';\nimport { LiveUpdate, SyncResult } from '@capawesome/capacitor-live-update';\nimport { SpxToasterAutoCloseSpeedEnum, spxToasterActions } from '@softpak/components/spx-toaster';\nimport { Observable, from, of } from 'rxjs';\nimport { SpxStorage, SpxStorageKeyEnum } from '@softpak/components/spx-storage';\nimport { catchError, delay, exhaustMap, map, mergeMap } from 'rxjs/operators';\n\nimport { App } from '@capacitor/app';\nimport { Capacitor } from '@capacitor/core';\nimport { SpxAppChannelTypeEnum } from '@softpak/components/spx-app-configuration';\nimport { getBinaryVersionGroup } from '@softpak/components/spx-helpers';\nimport { SpxUpdatePendingActions } from '../spx-update-pending/spx-update-pending.actions';\nimport { TranslateService } from '@ngx-translate/core';\nimport { captureMessage } from '@sentry/angular';\nimport { spxTextLiveUpdateCheckFailed } from '@softpak/components/spx-translate';\nimport { spxUpdateCheckActions } from './spx-update-check.actions';\n\n@Injectable()\nexport class Effects {\n private readonly actions$ = inject(Actions);\n private readonly translateService = inject(TranslateService);\n\n afterInitialize$: Observable<any> = createEffect(() => this.actions$.pipe(\n ofType(spxUpdateCheckActions.initialize),\n delay(120000),\n mergeMap(() => [\n spxUpdateCheckActions.runCheck({}),\n ]))\n );\n onRun$: Observable<any> = createEffect(() => this.actions$.pipe(\n ofType(spxUpdateCheckActions.runCheck),\n exhaustMap((action) => {\n if (Capacitor.getPlatform() === 'web') {\n return of(spxUpdateCheckActions.notAvailableOnWeb());\n }\n return from(App.getInfo()).pipe(\n mergeMap((binaryInfo) => {\n // Migrate from e.g. 1.2.x to 1.3.x\n const binaryVersionGroup = getBinaryVersionGroup(binaryInfo.version);\n let channelType = SpxStorage.getSetting(SpxStorageKeyEnum.channelType);\n\n if (SpxStorage.getSetting(SpxStorageKeyEnum.binaryVersionGroup)) {\n SpxStorage.setSetting(SpxStorageKeyEnum.lastBinaryVersionGroup, SpxStorage.getSetting(SpxStorageKeyEnum.binaryVersionGroup)!);\n }\n\n SpxStorage.setSetting(SpxStorageKeyEnum.binaryVersionGroup, `${binaryVersionGroup}.x`);\n SpxStorage.setSetting(SpxStorageKeyEnum.liveUpdateChannel, `${channelType ? channelType : SpxAppChannelTypeEnum.production}-${binaryVersionGroup}.x`);\n // End migrate from e.g. 1.2.x to 1.3.x\n\n return from(LiveUpdate.sync({ channel: SpxStorage.getSetting(SpxStorageKeyEnum.liveUpdateChannel)! }));\n }),\n map((syncResult: SyncResult) => {\n if (syncResult.nextBundleId) {\n SpxStorage.setSetting(SpxStorageKeyEnum.liveUpdate, syncResult.nextBundleId as string);\n if (action.forceWaitForUpdate) {\n LiveUpdate.reload();\n }\n return spxUpdateCheckActions.anUpdateIsReady();\n } else {\n return spxUpdateCheckActions.noUpdateWasFound({ startUpdateAgainAfterTimeout: !action.forceWaitForUpdate });\n }\n }),\n catchError((err) => {\n captureMessage(\"[UPD] Handled: \" + err.message);\n return of(spxUpdateCheckActions.checkFailed({ startUpdateAgainAfterTimeout: false }));\n })\n );\n }),\n ));\n\n whenAndUpdateIsReady$: Observable<any> = createEffect(() => this.actions$.pipe(\n ofType(spxUpdateCheckActions.anUpdateIsReady),\n mergeMap(() => [\n SpxUpdatePendingActions.hasBeenDownloaded(),\n ]))\n );\n\n whenCheckHasFailed$: Observable<any> = createEffect(() => this.actions$.pipe(\n ofType(spxUpdateCheckActions.checkFailed),\n delay(30000),\n mergeMap((action) => !action.startUpdateAgainAfterTimeout ? [] : [\n spxUpdateCheckActions.runCheck({}),\n ]))\n );\n\n whenCheckHasFailedShowError$: Observable<any> = createEffect(() => this.actions$.pipe(\n ofType(spxUpdateCheckActions.checkFailed),\n map(() => spxToasterActions.createError({\n autoClose: SpxToasterAutoCloseSpeedEnum.DEFAULT,\n messageText: this.translateService.instant(spxTextLiveUpdateCheckFailed),\n })),\n ));\n\n whenNoUpdateWasFound$: Observable<any> = createEffect(() => this.actions$.pipe(\n ofType(spxUpdateCheckActions.noUpdateWasFound),\n delay(120000),\n mergeMap((action) => !action.startUpdateAgainAfterTimeout ? [] : [\n spxUpdateCheckActions.runCheck({}),\n ]))\n );\n}\n","import { Actions, createEffect, ofType } from '@ngrx/effects';\n\nimport { Injectable } from '@angular/core';\nimport { LiveUpdate } from \"@capawesome/capacitor-live-update\";\nimport { SpxUpdatePendingActions } from './spx-update-pending.actions';\nimport { tap } from 'rxjs/operators';\n\n@Injectable()\nexport class Effects {\n\n constructor(\n private readonly actions$: Actions,\n ) { }\n\n whenAccepted$ = createEffect(() => this.actions$.pipe(\n ofType(SpxUpdatePendingActions.acceptUpdate),\n tap(() => {\n void LiveUpdate.reload();\n }),\n ), { dispatch: false });\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["initialState","i2","Effects","i1"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEO,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AACrD,IAAA,MAAM,EAAE,gBAAgB;AACxB,IAAA,MAAM,EAAE;QACN,eAAe,EAAE,UAAU,EAAE;QAC7B,WAAW,EAAE,KAAK,EAA+C;QACjE,UAAU,EAAE,UAAU,EAAE;QACxB,UAAU,EAAE,UAAU,EAAE;QACxB,gBAAgB,EAAE,KAAK,EAA+C;QACtE,iBAAiB,EAAE,UAAU,EAAE;QAC/B,QAAQ,EAAE,KAAK,EAAoC;AACpD,KAAA;AACF,CAAA;;ACXM,MAAMA,cAAY,GAAW;AAChC,IAAA,kBAAkB,EAAE,KAAK;AACzB,IAAA,SAAS,EAAE,IAAI;AACf,IAAA,SAAS,EAAE,KAAK;CACnB;;;;;;;ACCD,eAAe,aAAa,CAAC;AACzB,IAAA,IAAI,EAAE,gBAAgB;AACtB,IAAA,OAAO,EAAE,aAAa,CAClBA,cAAY,EACZ,EAAE,CAAC,qBAAqB,CAAC,eAAe,EAAE,CAAC,KAAa,KAAY;QAChE,OAAO;AACH,YAAA,GAAG,KAAK;AACR,YAAA,SAAS,EAAE,QAAQ,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE;AACjC,YAAA,SAAS,EAAE,KAAK;SACnB;IACL,CAAC,CAAC,EACF,EAAE,CAAC,qBAAqB,CAAC,UAAU,EAAE,CAAC,KAAa,KAAY;QAC3D,OAAO;AACH,YAAA,GAAG,KAAK;AACR,YAAA,SAAS,EAAE,KAAK;SACnB;IACL,CAAC,CAAC,EACF,EAAE,CAAC,qBAAqB,CAAC,WAAW,EAAE,CAAC,KAAa,KAAY;QAC5D,OAAO;AACH,YAAA,GAAG,KAAK;AACR,YAAA,kBAAkB,EA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,EAAA,UAAA,EAAA,CAAA;kBADnB;;;;;;;;;;;;MCVY,OAAO,CAAA;AAEhB,IAAA,WAAA,CACqB,QAAiB,EAAA;QAAjB,IAAA,CAAA,QAAQ,GAAR,QAAQ;QAG7B,IAAA,CAAA,aAAa,GAAG,YAAY,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,CACjD,MAAM,CAAC,uBAAuB,CAAC,YAAY,CAAC,EAC5C,GAAG,CAAC,MAAK;AACL,YAAA,KAAK,UAAU,CAAC,MAAM,EAAE;QAC5B,CAAC,CAAC,CACL,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAPnB;8GAJK,OAAO,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAAC,IAAA,CAAA,OAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAAP,OAAO,EAAA,CAAA,CAAA;;2FAAP,OAAO,EAAA,UAAA,EAAA,CAAA;kBADnB;;;;;;;;;;;;ACPD;;AAEG;;;;"}
1
+ {"version":3,"file":"softpak-components-spx-update.mjs","sources":["../../../../projects/softpak/components/spx-update/store/spx-update-check/spx-update-check.actions.ts","../../../../projects/softpak/components/spx-update/store/spx-update-check/spx-update-check.state.ts","../../../../projects/softpak/components/spx-update/store/spx-update-check/spx-update-check.initial.ts","../../../../projects/softpak/components/spx-update/store/spx-update-check/spx-update-check.reducer.ts","../../../../projects/softpak/components/spx-update/spx-update-page.component.ts","../../../../projects/softpak/components/spx-update/spx-update-page.component.html","../../../../projects/softpak/components/spx-update/store/spx-update-pending/spx-update-pending.actions.ts","../../../../projects/softpak/components/spx-update/store/spx-update-pending/spx-update-pending.initial.ts","../../../../projects/softpak/components/spx-update/store/spx-update-pending/spx-update-pending.reducer.ts","../../../../projects/softpak/components/spx-update/spx-update-pending.component.ts","../../../../projects/softpak/components/spx-update/spx-update-pending.component.html","../../../../projects/softpak/components/spx-update/spx-update-url.ts","../../../../projects/softpak/components/spx-update/store/spx-update-check/spx-update-check.effects.ts","../../../../projects/softpak/components/spx-update/store/spx-update-pending/spx-update-pending.effects.ts","../../../../projects/softpak/components/spx-update/softpak-components-spx-update.ts"],"sourcesContent":["import { createActionGroup, emptyProps, props } from '@ngrx/store';\n\nexport const spxUpdateCheckActions = createActionGroup({\n source: 'SpxUpdateCheck',\n events: {\n anUpdateIsReady: emptyProps(),\n checkFailed: props<{ errorReason?: string; startUpdateAgainAfterTimeout?: boolean; }>(),\n clearError: emptyProps(),\n initialize: emptyProps(),\n noUpdateWasFound: props<{ startUpdateAgainAfterTimeout?: boolean; }>(),\n notAvailableOnWeb: emptyProps(),\n reloadStarted: emptyProps(),\n runCheck: props<{ forceWaitForUpdate?: boolean }>(),\n syncStarted: emptyProps(),\n },\n});\n","export enum SpxUpdateCheckStatusEnum {\n failed = 'failed',\n idle = 'idle',\n notAvailableOnWeb = 'notAvailableOnWeb',\n preparing = 'preparing',\n reloading = 'reloading',\n syncing = 'syncing',\n upToDate = 'upToDate',\n updateReady = 'updateReady',\n}\n\nexport interface StateI {\n forceWaitForUpdate: boolean;\n lastErrorReason: string | null;\n lastCheck: string | null;\n showError: boolean;\n status: SpxUpdateCheckStatusEnum;\n}\n","import { SpxUpdateCheckStatusEnum, StateI } from \"./spx-update-check.state\";\n\nexport const initialState: StateI = {\n forceWaitForUpdate: false,\n lastErrorReason: null,\n lastCheck: null,\n showError: false,\n status: SpxUpdateCheckStatusEnum.idle,\n};\n","import { createFeature, createReducer, on } from '@ngrx/store';\n\nimport { DateTime } from 'luxon';\nimport { SpxUpdateCheckStatusEnum, StateI } from './spx-update-check.state';\nimport { initialState } from './spx-update-check.initial';\nimport { spxUpdateCheckActions } from './spx-update-check.actions';\n\nexport default createFeature({\n name: 'spxUpdateCheck',\n reducer: createReducer(\n initialState,\n on(spxUpdateCheckActions.anUpdateIsReady, (state: StateI): StateI => {\n return {\n ...state,\n lastCheck: DateTime.now().toISO(),\n lastErrorReason: null,\n showError: false,\n status: SpxUpdateCheckStatusEnum.updateReady,\n };\n }),\n on(spxUpdateCheckActions.clearError, (state: StateI): StateI => {\n return {\n ...state,\n lastErrorReason: null,\n showError: false,\n };\n }),\n on(spxUpdateCheckActions.checkFailed, (state: StateI, { errorReason }): StateI => {\n return {\n ...state,\n forceWaitForUpdate: false,\n lastErrorReason: errorReason || null,\n showError: true,\n status: SpxUpdateCheckStatusEnum.failed,\n };\n }),\n on(spxUpdateCheckActions.noUpdateWasFound, (state: StateI): StateI => {\n return {\n ...state,\n forceWaitForUpdate: false,\n lastCheck: DateTime.now().toISO(),\n lastErrorReason: null,\n showError: false,\n status: SpxUpdateCheckStatusEnum.upToDate,\n };\n }),\n on(spxUpdateCheckActions.runCheck, (state: StateI, { forceWaitForUpdate }): StateI => {\n return {\n ...state,\n forceWaitForUpdate: forceWaitForUpdate ? true : state.forceWaitForUpdate,\n lastErrorReason: null,\n showError: false,\n status: SpxUpdateCheckStatusEnum.preparing,\n };\n }),\n on(spxUpdateCheckActions.syncStarted, (state: StateI): StateI => {\n return {\n ...state,\n status: SpxUpdateCheckStatusEnum.syncing,\n };\n }),\n on(spxUpdateCheckActions.reloadStarted, (state: StateI): StateI => {\n return {\n ...state,\n status: SpxUpdateCheckStatusEnum.reloading,\n };\n }),\n on(spxUpdateCheckActions.notAvailableOnWeb, (state: StateI): StateI => {\n return {\n ...state,\n forceWaitForUpdate: false,\n status: SpxUpdateCheckStatusEnum.notAvailableOnWeb,\n };\n }),\n ),\n});\n","import { IonContent, IonHeader, IonTitle, IonToolbar, NavController } from '@ionic/angular/standalone';\nimport {\n spxTextCheckingForUpdates,\n spxTextOneMomentPlease,\n spxTextUpdateErrorReason,\n spxTextUpdateAppVersion,\n spxTextUpdateBinaryVersionGroup,\n spxTextUpdateBuildVersion,\n spxTextUpdateLastCheck,\n spxTextUpdateLiveBundle,\n spxTextUpdateLiveChannel,\n spxTextUpdateStatus,\n spxTextUpdateStatusCompleted,\n spxTextUpdateStatusFailed,\n spxTextUpdateStatusPreparing,\n spxTextUpdateStatusReloading,\n spxTextUpdateStatusSyncing,\n spxTextUpdateStatusUpdateReady,\n spxTextUpdateStatusUpToDate,\n spxTextUpdateStatusWebNotAvailable,\n spxTextUpdateVersionInfo\n} from '@softpak/components/spx-translate';\n\nimport { ActivatedRoute } from '@angular/router';\nimport { App } from '@capacitor/app';\nimport { Component, computed, effect, signal } from '@angular/core';\nimport { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';\nimport { SpxStorage, SpxStorageKeyEnum } from '@softpak/components/spx-storage';\nimport { Store } from '@ngrx/store';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { spxUpdateCheckActions } from './store/spx-update-check/spx-update-check.actions';\nimport { SpxUpdateCheckStatusEnum } from './store/spx-update-check/spx-update-check.state';\nimport { default as updCheck } from './store/spx-update-check/spx-update-check.reducer';\n\n@Component({\n selector: 'spx-update-page',\n imports: [\n IonContent,\n IonHeader,\n IonToolbar,\n IonTitle,\n SpxCapitalizePipe,\n TranslatePipe,\n ],\n templateUrl: `./spx-update-page.component.html`,\n standalone: true,\n})\nexport class SpxUpdatePageComponent {\n appVersion = signal<string>('-');\n binaryVersionGroup = signal<string>('-');\n buildVersion = signal<string>('-');\n lastCheck = this.appStore.selectSignal(updCheck.selectLastCheck);\n lastErrorReason = this.appStore.selectSignal(updCheck.selectLastErrorReason);\n forceWaitForUpdate = this.appStore.selectSignal(updCheck.selectForceWaitForUpdate);\n hasStarted = signal<boolean>(false);\n liveBundle = signal<string>('-');\n liveUpdateChannel = signal<string>('-');\n status = this.appStore.selectSignal(updCheck.selectStatus);\n spxTextCheckingForUpdates = spxTextCheckingForUpdates;\n spxTextOneMomentPlease = spxTextOneMomentPlease;\n spxTextUpdateErrorReason = spxTextUpdateErrorReason;\n spxTextUpdateAppVersion = spxTextUpdateAppVersion;\n spxTextUpdateBinaryVersionGroup = spxTextUpdateBinaryVersionGroup;\n spxTextUpdateBuildVersion = spxTextUpdateBuildVersion;\n spxTextUpdateLastCheck = spxTextUpdateLastCheck;\n spxTextUpdateLiveBundle = spxTextUpdateLiveBundle;\n spxTextUpdateLiveChannel = spxTextUpdateLiveChannel;\n spxTextUpdateStatus = spxTextUpdateStatus;\n spxTextUpdateVersionInfo = spxTextUpdateVersionInfo;\n statusText = computed(() => {\n switch (this.status()) {\n case SpxUpdateCheckStatusEnum.preparing:\n return spxTextUpdateStatusPreparing;\n case SpxUpdateCheckStatusEnum.syncing:\n return spxTextUpdateStatusSyncing;\n case SpxUpdateCheckStatusEnum.reloading:\n return spxTextUpdateStatusReloading;\n case SpxUpdateCheckStatusEnum.upToDate:\n return spxTextUpdateStatusUpToDate;\n case SpxUpdateCheckStatusEnum.updateReady:\n return spxTextUpdateStatusUpdateReady;\n case SpxUpdateCheckStatusEnum.failed:\n return spxTextUpdateStatusFailed;\n case SpxUpdateCheckStatusEnum.notAvailableOnWeb:\n return spxTextUpdateStatusWebNotAvailable;\n default:\n return spxTextUpdateStatusCompleted;\n }\n });\n showError = this.appStore.selectSignal(updCheck.selectShowError);\n\n ngOnInit() {\n this.hasStarted.set(true);\n void this.loadVersionInfo();\n this.appStore.dispatch(spxUpdateCheckActions.runCheck({ forceWaitForUpdate: true }));\n }\n\n constructor(\n private readonly appStore: Store,\n private readonly activatedRoute: ActivatedRoute,\n private readonly navController: NavController,\n ) {\n effect(() => {\n if (!this.hasStarted() || this.forceWaitForUpdate() || this.showError()) {\n return;\n }\n if (this.activatedRoute.snapshot.data['url'] === undefined) {\n console.error('configure data property \\'url\\' in route for update page');\n }\n this.navController.navigateRoot(this.activatedRoute.snapshot.data['url']);\n });\n }\n\n private async loadVersionInfo(): Promise<void> {\n const appInfo = await App.getInfo();\n this.appVersion.set(appInfo.version || '-');\n this.buildVersion.set(appInfo.build || '-');\n this.binaryVersionGroup.set(SpxStorage.getSetting(SpxStorageKeyEnum.binaryVersionGroup) || '-');\n this.liveUpdateChannel.set(SpxStorage.getSetting(SpxStorageKeyEnum.liveUpdateChannel) || '-');\n this.liveBundle.set(SpxStorage.getSetting(SpxStorageKeyEnum.liveUpdate) || '-');\n }\n}\n","<ion-header>\n <ion-toolbar>\n <ion-title>\n {{ spxTextCheckingForUpdates | translate | capitalize }}\n </ion-title>\n </ion-toolbar>\n</ion-header>\n\n<ion-content class=\"ion-padding\">\n <p>{{ spxTextOneMomentPlease | translate | capitalize }}...</p>\n <p class=\"mt-2\">\n <strong>{{ spxTextUpdateStatus | translate | capitalize }}:</strong>\n {{ statusText() | translate | capitalize }}\n </p>\n @if (lastErrorReason()) {\n <p class=\"mt-2 text-red-700\">\n <strong>{{ spxTextUpdateErrorReason | translate | capitalize }}:</strong>\n {{ lastErrorReason() }}\n </p>\n }\n @if (lastCheck()) {\n <p class=\"mt-1 text-sm text-zinc-600\">\n <strong>{{ spxTextUpdateLastCheck | translate | capitalize }}:</strong>\n {{ lastCheck() }}\n </p>\n }\n\n <div class=\"mt-6 text-sm text-zinc-600\">\n <p><strong>{{ spxTextUpdateVersionInfo | translate | capitalize }}</strong></p>\n <p>{{ spxTextUpdateAppVersion | translate | capitalize }}: {{ appVersion() }}</p>\n <p>{{ spxTextUpdateBuildVersion | translate | capitalize }}: {{ buildVersion() }}</p>\n <p>{{ spxTextUpdateBinaryVersionGroup | translate | capitalize }}: {{ binaryVersionGroup() }}</p>\n <p>{{ spxTextUpdateLiveChannel | translate | capitalize }}: {{ liveUpdateChannel() }}</p>\n <p>{{ spxTextUpdateLiveBundle | translate | capitalize }}: {{ liveBundle() }}</p>\n </div>\n</ion-content>\n","import { createActionGroup, emptyProps } from '@ngrx/store';\n\nexport const SpxUpdatePendingActions = createActionGroup({\n source: 'SpxUpdatePending',\n events: {\n AcceptUpdate: emptyProps(),\n HasBeenDownloaded: emptyProps(),\n HasBeenInstalled: emptyProps(),\n Postpone: emptyProps(),\n PostponeExpired: emptyProps(),\n },\n});\n","import { StateI } from \"./spx-update-pending.state\";\n\nexport const initialState: StateI = {\n showLiveUpdateReady: false,\n updateIsDownloadedAndPending: false,\n};\n","import { createFeature, createReducer, on } from '@ngrx/store';\n\nimport { SpxUpdatePendingActions } from './spx-update-pending.actions';\nimport { StateI } from './spx-update-pending.state';\nimport { initialState } from './spx-update-pending.initial';\n\nexport default createFeature({\n name: 'spxUpdatePending',\n reducer: createReducer(\n initialState,\n on(SpxUpdatePendingActions.hasBeenDownloaded, (state: StateI): StateI => {\n return {\n ...state,\n showLiveUpdateReady: true,\n updateIsDownloadedAndPending: true,\n };\n }),\n on(SpxUpdatePendingActions.hasBeenInstalled, (state: StateI): StateI => {\n return {\n ...state,\n showLiveUpdateReady: false,\n updateIsDownloadedAndPending: false,\n };\n }),\n on(SpxUpdatePendingActions.postpone, (state: StateI): StateI => {\n return {\n ...state,\n showLiveUpdateReady: false,\n };\n }),\n on(SpxUpdatePendingActions.postponeExpired, (state: StateI): StateI => {\n return {\n ...state,\n showLiveUpdateReady: true,\n };\n }),\n ),\n});\n","import { ChangeDetectionStrategy, Component, HostBinding, signal } from '@angular/core';\nimport { DomSanitizer, SafeStyle } from '@angular/platform-browser';\nimport { SpxSeverityEnum, unsubscribeSubscriptions } from '@softpak/components/spx-helpers';\nimport { spxTextOpenAppStore, spxTextPatchAvailable, spxTextReadyToBeInstalled, spxTextUpdate, spxTextUpdateAvailable } from '@softpak/components/spx-translate';\n\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\nimport { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';\nimport { SpxUpdatePendingActions } from './public-api';\nimport { Store } from '@ngrx/store';\nimport { Subscription } from 'rxjs';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { default as updPending } from './store/spx-update-pending/spx-update-pending.reducer';\n\n@Component({\n selector: 'spx-update-pending',\n imports: [\n SpxButtonComponent,\n SpxCapitalizePipe,\n TranslatePipe,\n ],\n templateUrl: `./spx-update-pending.component.html`,\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SpxUpdatePendingComponent {\n @HostBinding('style') baseStyle?: SafeStyle;\n availableStoreVersion = signal<undefined | string>(undefined);\n currentStoreVersion = signal<undefined | string>(undefined);\n severitySuccess = SpxSeverityEnum.success;\n showLiveUpdateReady = signal<boolean>(false);\n spxTextUpdate = spxTextUpdate;\n spxTextReadyToBeInstalled = spxTextReadyToBeInstalled;\n spxTextPatchAvailable = spxTextPatchAvailable;\n spxTextUpdateAvailable = spxTextUpdateAvailable;\n spxTextOpenAppStore = spxTextOpenAppStore;\n\n private subscriptions: {\n updPending?: Subscription;\n } = {};\n\n ngOnInit() {\n this.subscriptions.updPending = this.appStore.select(updPending.selectShowLiveUpdateReady).subscribe(showLiveUpdateReady => {\n this.showLiveUpdateReady.set(showLiveUpdateReady);\n if (showLiveUpdateReady) {\n this.baseStyle = this.sanitizer.bypassSecurityTrustStyle('display: block;');\n } else {\n this.baseStyle = this.sanitizer.bypassSecurityTrustStyle('display: none;');\n }\n });\n }\n\n ngOnDestroy() {\n unsubscribeSubscriptions(this.subscriptions);\n }\n\n constructor(\n private readonly appStore: Store,\n private sanitizer: DomSanitizer,\n ) {}\n\n onUpdate(): void {\n this.appStore.dispatch(SpxUpdatePendingActions.acceptUpdate());\n }\n}\n","@if (showLiveUpdateReady()) {\n<div class=\"bg-zinc-700 text-black p-3 rounded flex gap-3 mx-auto max-w-lg items-center\">\n <div class=\"grow\">\n <p\n class=\"text-xl font-extrabold bg-clip-text text-transparent bg-[linear-gradient(to_right,theme(colors.green.300),theme(colors.green.100),theme(colors.sky.400),theme(colors.yellow.200),theme(colors.sky.400),theme(colors.green.100),theme(colors.green.300))] bg-[length:200%_auto] animate-gradient\">\n {{ spxTextPatchAvailable | translate | capitalize }}</p>\n <div class=\"text-sm text-zinc-300\">{{ spxTextReadyToBeInstalled | translate | capitalize }}</div>\n </div>\n <spx-button [spxSeverity]=\"severitySuccess\" (spxClick)=\"onUpdate()\">{{ spxTextUpdate | translate | capitalize\n }}</spx-button>\n</div>\n}","export const spxUpdateUrl = '';","import { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { Injectable, inject } from '@angular/core';\nimport { LiveUpdate, SyncResult } from '@capawesome/capacitor-live-update';\nimport { SpxToasterAutoCloseSpeedEnum, spxToasterActions } from '@softpak/components/spx-toaster';\nimport { Observable, concat, from, of } from 'rxjs';\nimport { SpxStorage, SpxStorageKeyEnum } from '@softpak/components/spx-storage';\nimport { catchError, delay, exhaustMap, map, mergeMap } from 'rxjs/operators';\n\nimport { App } from '@capacitor/app';\nimport { Capacitor } from '@capacitor/core';\nimport { SpxAppChannelTypeEnum } from '@softpak/components/spx-app-configuration';\nimport { getBinaryVersionGroup } from '@softpak/components/spx-helpers';\nimport { SpxUpdatePendingActions } from '../spx-update-pending/spx-update-pending.actions';\nimport { TranslateService } from '@ngx-translate/core';\nimport { captureMessage } from '@sentry/angular';\nimport { spxTextLiveUpdateCheckFailed, spxTextLiveUpdateCheckFailedWithReason } from '@softpak/components/spx-translate';\nimport { spxUpdateCheckActions } from './spx-update-check.actions';\n\n@Injectable()\nexport class Effects {\n private readonly actions$ = inject(Actions);\n private readonly translateService = inject(TranslateService);\n\n afterInitialize$: Observable<any> = createEffect(() => this.actions$.pipe(\n ofType(spxUpdateCheckActions.initialize),\n delay(120000),\n mergeMap(() => [\n spxUpdateCheckActions.runCheck({}),\n ]))\n );\n onRun$: Observable<any> = createEffect(() => this.actions$.pipe(\n ofType(spxUpdateCheckActions.runCheck),\n exhaustMap((action) => {\n if (Capacitor.getPlatform() === 'web') {\n return of(spxUpdateCheckActions.notAvailableOnWeb());\n }\n return concat(\n of(spxUpdateCheckActions.syncStarted()),\n from(App.getInfo()).pipe(\n mergeMap((binaryInfo) => {\n // Migrate from e.g. 1.2.x to 1.3.x\n const binaryVersionGroup = getBinaryVersionGroup(binaryInfo.version);\n let channelType = SpxStorage.getSetting(SpxStorageKeyEnum.channelType);\n\n if (SpxStorage.getSetting(SpxStorageKeyEnum.binaryVersionGroup)) {\n SpxStorage.setSetting(SpxStorageKeyEnum.lastBinaryVersionGroup, SpxStorage.getSetting(SpxStorageKeyEnum.binaryVersionGroup)!);\n }\n\n SpxStorage.setSetting(SpxStorageKeyEnum.binaryVersionGroup, `${binaryVersionGroup}.x`);\n SpxStorage.setSetting(SpxStorageKeyEnum.liveUpdateChannel, `${channelType ? channelType : SpxAppChannelTypeEnum.production}-${binaryVersionGroup}.x`);\n // End migrate from e.g. 1.2.x to 1.3.x\n\n return from(LiveUpdate.sync({ channel: SpxStorage.getSetting(SpxStorageKeyEnum.liveUpdateChannel)! }));\n }),\n mergeMap((syncResult: SyncResult) => {\n if (syncResult.nextBundleId) {\n SpxStorage.setSetting(SpxStorageKeyEnum.liveUpdate, syncResult.nextBundleId as string);\n if (action.forceWaitForUpdate) {\n return concat(\n of(spxUpdateCheckActions.reloadStarted()),\n from(LiveUpdate.reload()).pipe(\n map(() => spxUpdateCheckActions.anUpdateIsReady()),\n catchError((err) => {\n const errorReason = this.getReadableErrorReason(err);\n captureMessage(`[UPD] Reload failed: ${errorReason}`);\n return of(spxUpdateCheckActions.checkFailed({\n errorReason,\n startUpdateAgainAfterTimeout: false,\n }));\n }),\n ),\n );\n }\n return of(spxUpdateCheckActions.anUpdateIsReady());\n } else {\n return of(spxUpdateCheckActions.noUpdateWasFound({ startUpdateAgainAfterTimeout: !action.forceWaitForUpdate }));\n }\n }),\n catchError((err) => {\n const errorReason = this.getReadableErrorReason(err);\n captureMessage(`[UPD] Handled: ${errorReason}`);\n return of(spxUpdateCheckActions.checkFailed({\n errorReason,\n startUpdateAgainAfterTimeout: false,\n }));\n })\n )\n );\n }),\n ));\n\n whenAndUpdateIsReady$: Observable<any> = createEffect(() => this.actions$.pipe(\n ofType(spxUpdateCheckActions.anUpdateIsReady),\n mergeMap(() => [\n SpxUpdatePendingActions.hasBeenDownloaded(),\n ]))\n );\n\n whenCheckHasFailed$: Observable<any> = createEffect(() => this.actions$.pipe(\n ofType(spxUpdateCheckActions.checkFailed),\n delay(30000),\n mergeMap((action) => !action.startUpdateAgainAfterTimeout ? [] : [\n spxUpdateCheckActions.runCheck({}),\n ]))\n );\n\n whenCheckHasFailedShowError$: Observable<any> = createEffect(() => this.actions$.pipe(\n ofType(spxUpdateCheckActions.checkFailed),\n map((action) => spxToasterActions.createError({\n autoClose: SpxToasterAutoCloseSpeedEnum.DEFAULT,\n messageText: action.errorReason\n ? this.translateService.instant(spxTextLiveUpdateCheckFailedWithReason, { reason: action.errorReason })\n : this.translateService.instant(spxTextLiveUpdateCheckFailed),\n })),\n ));\n\n whenNoUpdateWasFound$: Observable<any> = createEffect(() => this.actions$.pipe(\n ofType(spxUpdateCheckActions.noUpdateWasFound),\n delay(120000),\n mergeMap((action) => !action.startUpdateAgainAfterTimeout ? [] : [\n spxUpdateCheckActions.runCheck({}),\n ]))\n );\n\n private getReadableErrorReason(err: unknown): string {\n if (err instanceof Error && err.message?.trim()) {\n return err.message.trim();\n }\n if (typeof err === 'string' && err.trim()) {\n return err.trim();\n }\n if (err && typeof err === 'object') {\n const withMessage = err as { message?: unknown };\n if (typeof withMessage.message === 'string' && withMessage.message.trim()) {\n return withMessage.message.trim();\n }\n try {\n const serialized = JSON.stringify(err);\n if (serialized && serialized !== '{}') {\n return serialized.length > 180 ? `${serialized.slice(0, 177)}...` : serialized;\n }\n } catch {\n // ignore serialization errors\n }\n }\n return '';\n }\n}\n","import { Actions, createEffect, ofType } from '@ngrx/effects';\n\nimport { Injectable, inject } from '@angular/core';\nimport { LiveUpdate } from \"@capawesome/capacitor-live-update\";\nimport { SpxToasterAutoCloseSpeedEnum, spxToasterActions } from '@softpak/components/spx-toaster';\nimport { SpxUpdatePendingActions } from './spx-update-pending.actions';\nimport { Store } from '@ngrx/store';\nimport { TranslateService } from '@ngx-translate/core';\nimport { captureMessage } from '@sentry/angular';\nimport { spxTextLiveUpdateCheckFailed, spxTextLiveUpdateCheckFailedWithReason } from '@softpak/components/spx-translate';\nimport { tap } from 'rxjs/operators';\n\n@Injectable()\nexport class Effects {\n private readonly actions$ = inject(Actions);\n private readonly appStore = inject(Store);\n private readonly translateService = inject(TranslateService);\n\n whenAccepted$ = createEffect(() => this.actions$.pipe(\n ofType(SpxUpdatePendingActions.acceptUpdate),\n tap(() => {\n void LiveUpdate.reload().catch((err) => {\n const errorReason = this.getReadableErrorReason(err);\n captureMessage(`[UPD] Accept reload failed: ${errorReason}`);\n this.appStore.dispatch(spxToasterActions.createError({\n autoClose: SpxToasterAutoCloseSpeedEnum.DEFAULT,\n messageText: errorReason\n ? this.translateService.instant(spxTextLiveUpdateCheckFailedWithReason, { reason: errorReason })\n : this.translateService.instant(spxTextLiveUpdateCheckFailed),\n }));\n });\n }),\n ), { dispatch: false });\n\n private getReadableErrorReason(err: unknown): string {\n if (err instanceof Error && err.message?.trim()) {\n return err.message.trim();\n }\n if (typeof err === 'string' && err.trim()) {\n return err.trim();\n }\n if (err && typeof err === 'object') {\n const withMessage = err as { message?: unknown };\n if (typeof withMessage.message === 'string' && withMessage.message.trim()) {\n return withMessage.message.trim();\n }\n try {\n const serialized = JSON.stringify(err);\n if (serialized && serialized !== '{}') {\n return serialized.length > 180 ? `${serialized.slice(0, 177)}...` : serialized;\n }\n } catch {\n // ignore serialization errors\n }\n }\n return '';\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["initialState","i2","Effects"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAEO,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AACrD,IAAA,MAAM,EAAE,gBAAgB;AACxB,IAAA,MAAM,EAAE;QACN,eAAe,EAAE,UAAU,EAAE;QAC7B,WAAW,EAAE,KAAK,EAAqE;QACvF,UAAU,EAAE,UAAU,EAAE;QACxB,UAAU,EAAE,UAAU,EAAE;QACxB,gBAAgB,EAAE,KAAK,EAA+C;QACtE,iBAAiB,EAAE,UAAU,EAAE;QAC/B,aAAa,EAAE,UAAU,EAAE;QAC3B,QAAQ,EAAE,KAAK,EAAoC;QACnD,WAAW,EAAE,UAAU,EAAE;AAC1B,K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AAK,IAAI,EAAE;oBACnC,OAAO,UAAU,CAAC,MAAM,GAAG,GAAG,GAAG,CAAA,EAAG,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,GAAG,UAAU;gBAClF;YACJ;AAAE,YAAA,MAAM;;YAER;QACJ;AACA,QAAA,OAAO,EAAE;IACb;8GA3CS,OAAO,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAAP,OAAO,EAAA,CAAA,CAAA;;2FAAP,OAAO,EAAA,UAAA,EAAA,CAAA;kBADnB;;;;;;;;;;;;ACZD;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softpak/components",
3
- "version": "21.2.0-capwesome.5",
3
+ "version": "21.2.0-capwesome.7",
4
4
  "private": false,
5
5
  "peerDependencies": {
6
6
  "@angular/common": "21.x.x",