@progressive-development/pd-spa-helper 0.8.1-i → 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/PdSpaHelper.d.ts.map +1 -1
  2. package/dist/PdSpaHelper.js +13 -10
  3. package/dist/defaultpage/default-step-address.d.ts.map +1 -1
  4. package/dist/defaultpage/default-step-address.js +0 -1
  5. package/dist/defaultpage/default-wizard-step.d.ts.map +1 -1
  6. package/dist/defaultpage/default-wizard-step.js +0 -2
  7. package/dist/defaultpage/default-wizard.d.ts.map +1 -1
  8. package/dist/defaultpage/default-wizard.js +14 -7
  9. package/dist/helper/date-helper.d.ts.map +1 -1
  10. package/dist/helper/date-helper.js +2 -1
  11. package/dist/helper/logger.d.ts +14 -0
  12. package/dist/helper/logger.d.ts.map +1 -0
  13. package/dist/helper/logger.js +54 -0
  14. package/dist/helper/refresh-id-token.d.ts.map +1 -1
  15. package/dist/helper/refresh-id-token.js +8 -3
  16. package/dist/index.d.ts +1 -0
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js +3 -0
  19. package/dist/router/PdRouterService.d.ts.map +1 -1
  20. package/dist/router/PdRouterService.js +12 -8
  21. package/dist/service-provider/firebase/auth.d.ts.map +1 -1
  22. package/dist/service-provider/firebase/auth.js +3 -2
  23. package/dist/service-provider/firebase/firestorage-client.d.ts.map +1 -1
  24. package/dist/service-provider/firebase/firestorage-client.js +7 -5
  25. package/dist/service-provider/firebase/firestore-client.d.ts.map +1 -1
  26. package/dist/service-provider/firebase/firestore-client.js +2 -1
  27. package/dist/service-provider/firebase/functions-client.d.ts.map +1 -1
  28. package/dist/service-provider/firebase/functions-client.js +5 -3
  29. package/dist/service-provider/firebase/messagingFirebaseClient.d.ts.map +1 -1
  30. package/dist/service-provider/firebase/messagingFirebaseClient.js +8 -6
  31. package/dist/service-provider/service-provider-impl.d.ts.map +1 -1
  32. package/dist/service-provider/service-provider-impl.js +13 -9
  33. package/dist/store/indexDB.d.ts.map +1 -1
  34. package/dist/store/indexDB.js +11 -6
  35. package/dist/store/mini-rx.store.d.ts.map +1 -1
  36. package/dist/store/mini-rx.store.js +3 -2
  37. package/dist/store/spa-app-effects.d.ts +3 -3
  38. package/dist/store/spa-app-effects.d.ts.map +1 -1
  39. package/dist/store/spa-app-effects.js +3 -2
  40. package/dist/store/spa-app-selector.d.ts +4 -4
  41. package/dist/store/spa-app-selector.d.ts.map +1 -1
  42. package/package.json +7 -7
@@ -1 +1 @@
1
- {"version":3,"file":"PdSpaHelper.d.ts","sourceRoot":"","sources":["../src/PdSpaHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EAEV,cAAc,EACd,cAAc,EAEf,MAAM,KAAK,CAAC;AAGb,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAEpC,OAAO,0CAA0C,CAAC;AAClD,OAAO,4CAA4C,CAAC;AACpD,OAAO,qDAAqD,CAAC;AAC7D,OAAO,8CAA8C,CAAC;AAStD,OAAO,EACL,gBAAgB,EAChB,MAAM,EAGN,cAAc,EACf,MAAM,8CAA8C,CAAC;AAItD,OAAO,EAAkB,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGpE,OAAO,gCAAgC,CAAC;AACxC,OAAO,oCAAoC,CAAC;AAE5C,OAAO,sBAAsB,CAAC;AAC9B,OAAO,8BAA8B,CAAC;AAQtC,eAAO,MAAM,uBAAuB,sBAAsB,CAAC;AAuD3D;;;;;;;GAOG;AACH,eAAO,MAAM,SAAS,GAAI,QAAQ,gBAAgB,SAgCjD,CAAC;AAIF;;GAEG;AACH,8BAAsB,WAAY,SAAQ,UAAU;IAGlD,KAAK,SAAe;IAEpB;;OAEG;IAEH,KAAK,EAAE,OAAO,GAAG,SAAS,CAAC;IAG3B,QAAQ,EAAE,GAAG,GAAG,SAAS,CAAC;IAG1B,aAAa,EAAE,YAAY,EAAE,CAAM;IAEnC;;;OAGG;IAEH,SAAS,CAAC,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AAE,OAAO,GAAG,MAAM;IAE9D,SAAS,CAAC,aAAa,CAAC,CAAC,EAAE,WAAW,GAAG,IAAI;IAkB7C,aAAa,CAAC,CAAC,EAAE,WAAW,GAAG,IAAI;IASnC,qBAAqB,CAAC,CAAC,EAAE,GAAG;IAW5B,uBAAuB,CAAC,CAAC,EAAE,WAAW;IAYtC,iBAAiB,CAAC,CAAC,EAAE,GAAG;IAexB,qBAAqB,CAAC,CAAC,EAAE,GAAG;IAgB5B,MAAM,CAAC,YAAY;IAUnB,gBAAgB,CAAC,EAAE,EAAE,WAAW;CAUjC"}
@@ -17,6 +17,7 @@ import { PdToast } from "./tmpown/pd-toast.js";
17
17
  import "./tmpown/pd-loading-state.js";
18
18
  import { setCurrentFormatLocale } from "./helper/locale-format.js";
19
19
  import { pdRouterService } from "./router/PdRouterService.js";
20
+ import { createLogger } from "./helper/logger.js";
20
21
  var __defProp = Object.defineProperty;
21
22
  var __decorateClass = (decorators, target, key, kind) => {
22
23
  var result = void 0;
@@ -58,8 +59,9 @@ const transformRoutes = () => {
58
59
  });
59
60
  return routeDefs;
60
61
  };
62
+ const spaLogger = createLogger("PdSpaHelper");
61
63
  const startInit = (config) => {
62
- console.log("Start init for config: ", config);
64
+ spaLogger.debug("Start init for config: ", config);
63
65
  setServiceProvider(config.serviceProvider);
64
66
  if (config.storeConfigParam) {
65
67
  initializeStore(config.storeConfigParam);
@@ -77,7 +79,7 @@ const startInit = (config) => {
77
79
  transformedRoutes = transformRoutes();
78
80
  pdRouterService.configureRoutes(transformedRoutes);
79
81
  document.dispatchEvent(new CustomEvent("init-app-event"));
80
- console.log("Init done, Event created");
82
+ spaLogger.debug("Init done, init-app-event created");
81
83
  };
82
84
  const TOP_MENU_HEIGHT = 30;
83
85
  const _PdSpaHelper = (_a = class extends LitElement {
@@ -110,10 +112,10 @@ const _PdSpaHelper = (_a = class extends LitElement {
110
112
  }
111
113
  });
112
114
  document.addEventListener("init-app-event", () => {
113
- console.log("Init event catched");
115
+ spaLogger.debug("Init event catched, ignore here...");
114
116
  });
115
117
  if (navigationConfig.includeLogin) {
116
- console.log("Login included, activate login handler");
118
+ spaLogger.debug("Login included, activate login handler");
117
119
  this.activateLoginHandler();
118
120
  }
119
121
  this.addEventListener("toast-event", this._createTemporaryToast);
@@ -128,7 +130,7 @@ const _PdSpaHelper = (_a = class extends LitElement {
128
130
  });
129
131
  this.addEventListener(APP_CONF_EVENT, this._setConfInDetail);
130
132
  this._subscription = pdStore().select(getLoadingSelector).subscribe((loadingState) => {
131
- console.log("Loading State: ", loadingState);
133
+ spaLogger.debug("Loading State: ", loadingState);
132
134
  this._loadingState = loadingState;
133
135
  });
134
136
  }
@@ -155,10 +157,13 @@ const _PdSpaHelper = (_a = class extends LitElement {
155
157
  * Only implemented for firebase provider.
156
158
  */
157
159
  activateLoginHandler() {
158
- console.log("Activate Login Handler");
160
+ spaLogger.debug("Activate Login Handler");
159
161
  const callback = async (user) => {
160
162
  var _a2;
161
- console.log("My callback user:", user);
163
+ spaLogger.debug(
164
+ "Activate Login Handler => callback called for user:",
165
+ user == null ? void 0 : user.email
166
+ );
162
167
  if (user) {
163
168
  const tokenResult = await user.getIdTokenResult();
164
169
  const claims = tokenResult.claims;
@@ -293,7 +298,7 @@ const _PdSpaHelper = (_a = class extends LitElement {
293
298
  })
294
299
  );
295
300
  }
296
- console.debug("Login Event: ", e, window.location.href, redirectRoute);
301
+ spaLogger.debug("Login Event: ", e, window.location.href, redirectRoute);
297
302
  }
298
303
  _localeChange(e) {
299
304
  const newLocale = e.detail;
@@ -358,8 +363,6 @@ const _PdSpaHelper = (_a = class extends LitElement {
358
363
  _scrollToContent(el) {
359
364
  if (el) {
360
365
  const rect = el.getBoundingClientRect();
361
- console.log("Rect: ", rect);
362
- console.log("Offset Top/Height: ", el.offsetTop, el.offsetHeight);
363
366
  window.scrollBy({
364
367
  top: rect.top - (this._teaserClosed ? 80 : 450),
365
368
  left: 0,
@@ -1 +1 @@
1
- {"version":3,"file":"default-step-address.d.ts","sourceRoot":"","sources":["../../src/defaultpage/default-step-address.ts"],"names":[],"mappings":"AAGA,OAAO,qDAAqD,CAAC;AAE7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,8BAAsB,kBAAkB,CAAC,CAAC,CAAE,SAAQ,iBAAiB,CAAC,CAAC,EAAE,GAAG,CAAC;IAE3E,KAAK,CAAC,EAAE,OAAO,CAAC;IAGhB,QAAQ,CAAC,EAAE,GAAG,CAAC;IAGf,WAAW,EAAE,OAAO,CAAS;IAG7B,iBAAiB,EAAE,OAAO,CAAS;IAGnC,gBAAgB,EAAE,OAAO,CAAS;IAElC,OAAO,EAAE,MAAM,CAAyB;IAExC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAE/B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAE/B,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAEpC,cAAc;IAoBd,WAAW,CAAC,YAAY,EAAE,CAAC,EAAE,mBAAmB,EAAE,GAAG;;;;;;;;;IAgBrD,mBAAmB,IAAI,OAAO;CAI/B"}
1
+ {"version":3,"file":"default-step-address.d.ts","sourceRoot":"","sources":["../../src/defaultpage/default-step-address.ts"],"names":[],"mappings":"AAGA,OAAO,qDAAqD,CAAC;AAE7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,8BAAsB,kBAAkB,CAAC,CAAC,CAAE,SAAQ,iBAAiB,CAAC,CAAC,EAAE,GAAG,CAAC;IAE3E,KAAK,CAAC,EAAE,OAAO,CAAC;IAGhB,QAAQ,CAAC,EAAE,GAAG,CAAC;IAGf,WAAW,EAAE,OAAO,CAAS;IAG7B,iBAAiB,EAAE,OAAO,CAAS;IAGnC,gBAAgB,EAAE,OAAO,CAAS;IAElC,OAAO,EAAE,MAAM,CAAyB;IAExC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAE/B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAE/B,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAEpC,cAAc;IAmBd,WAAW,CAAC,YAAY,EAAE,CAAC,EAAE,mBAAmB,EAAE,GAAG;;;;;;;;;IAgBrD,mBAAmB,IAAI,OAAO;CAI/B"}
@@ -21,7 +21,6 @@ class DefaultStepAddress extends DefaultWizardStep {
21
21
  }
22
22
  renderContacts() {
23
23
  var _a, _b, _c, _d;
24
- console.log("render default step: ", this.withPropertyDate);
25
24
  return html`
26
25
  ${this._addressInfo ? html` <p>${this._addressInfo}</p> ` : ""}
27
26
  <pd-order-contacts
@@ -1 +1 @@
1
- {"version":3,"file":"default-wizard-step.d.ts","sourceRoot":"","sources":["../../src/defaultpage/default-wizard-step.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAMjC;;GAEG;AACH,8BAAsB,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAE,SAAQ,UAAU;IAE9D,UAAU,EAAE,MAAM,CAAK;IAGvB,gBAAgB,EAAE,OAAO,CAAS;IAGlC,SAAS,EAAE,MAAM,CAAM;IAEvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB,OAAO,CAAC,MAAM,CAAM;IAEpB,YAAY;IAcZ,SAAS,CAAC,KAAK,EAAE,GAAG;IAMpB,aAAa,CAAC,CAAC,EAAE,GAAG;IAiCpB;;;;;;;;OAQG;IAEH,SAAS,CAAC,4BAA4B,CAAC,YAAY,EAAE,CAAC,GAAG,CAAC;IAK1D,SAAS,CAAC,oBAAoB;IAM9B,SAAS,CAAC,cAAc;IAmBxB,SAAS,CAAC,WAAW,CAAC,YAAY,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC;IAOvD;;;;OAIG;IAEH,eAAe,CAAC,aAAa,EAAE,CAAC,GAAG,IAAI;IAIvC,QAAQ,CAAC,mBAAmB,IAAI,OAAO;CACxC"}
1
+ {"version":3,"file":"default-wizard-step.d.ts","sourceRoot":"","sources":["../../src/defaultpage/default-wizard-step.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAMjC;;GAEG;AACH,8BAAsB,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAE,SAAQ,UAAU;IAE9D,UAAU,EAAE,MAAM,CAAK;IAGvB,gBAAgB,EAAE,OAAO,CAAS;IAGlC,SAAS,EAAE,MAAM,CAAM;IAEvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB,OAAO,CAAC,MAAM,CAAM;IAEpB,YAAY;IAcZ,SAAS,CAAC,KAAK,EAAE,GAAG;IAMpB,aAAa,CAAC,CAAC,EAAE,GAAG;IAiCpB;;;;;;;;OAQG;IAEH,SAAS,CAAC,4BAA4B,CAAC,YAAY,EAAE,CAAC,GAAG,CAAC;IAK1D,SAAS,CAAC,oBAAoB;IAM9B,SAAS,CAAC,cAAc;IAgBxB,SAAS,CAAC,WAAW,CAAC,YAAY,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC;IAOvD;;;;OAIG;IAEH,eAAe,CAAC,aAAa,EAAE,CAAC,GAAG,IAAI;IAIvC,QAAQ,CAAC,mBAAmB,IAAI,OAAO;CACxC"}
@@ -80,11 +80,9 @@ class DefaultWizardStep extends LitElement {
80
80
  // eslint-disable-next-line class-methods-use-this
81
81
  _doInputChange() {
82
82
  if (timeoutInputRef) {
83
- console.log("_doInputChange: Reset Timeout");
84
83
  window.clearTimeout(timeoutInputRef);
85
84
  }
86
85
  timeoutInputRef = window.setTimeout(() => {
87
- console.log("_doInputChange: Timeout expired");
88
86
  this.dispatchEvent(
89
87
  new CustomEvent("wizard-step-update", {
90
88
  detail: this._prepareDataFromForm(),
@@ -1 +1 @@
1
- {"version":3,"file":"default-wizard.d.ts","sourceRoot":"","sources":["../../src/defaultpage/default-wizard.ts"],"names":[],"mappings":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OAAO,oDAAoD,CAAC;AAC5D,OAAO,8CAA8C,CAAC;AAEtD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAUzD;;GAEG;AACH,8BAAsB,aAAa,CAAC,CAAC,CAAE,SAAQ,eAAe;IAC5D,SAAS,CAAC,WAAW,EAAE,OAAO,CAAS;IAEvC,SAAS,CAAC,cAAc,EAAE,OAAO,CAAS;IAG1C,QAAQ,CAAC,YAAY,EAAE,KAAK,CAAC;QAC3B,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,GAAG,EAAE,MAAM,CAAC;KACb,CAAC,CAAC;IAGH,iBAAiB,EAAE,MAAM,CAAK;IAG9B,cAAc,CAAC,EAAE,CAAC,CAAC;IAGnB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B,MAAM;IAqBN,OAAO,CAAC,gBAAgB;IAYxB,SAAS,CAAC,kBAAkB,CAAC,UAAU,EAAE,MAAM;IAoD/C,OAAO,CAAC,qBAAqB;IAe7B,SAAS,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,EAAE,CAAC;IAkBhD,SAAS,CAAC,kBAAkB;IAe5B,SAAS,CAAC,CAAC,EAAE,WAAW;IA+CxB,aAAa;IASb,SAAS,CAAC,CAAC,EAAE,GAAG;IAUhB,mBAAmB,IAAI,IAAI;IA+C3B,QAAQ,CAAC,YAAY,IAAI,IAAI;IAE7B,QAAQ,CAAC,YAAY,IAAI,kBAAkB;IAE3C,QAAQ,CAAC,WAAW,IAAI,kBAAkB;IAE1C,QAAQ,CAAC,aAAa,IAAI,IAAI;IAE9B,MAAM,CAAC,cAAc;CAStB"}
@@ -8,6 +8,7 @@ import { RUNNING_WIZARD_STORAGE_ELEMENTS } from "../model/spa-model.js";
8
8
  import { WizardReloadPopup } from "../popup/wizard-reload-popup.js";
9
9
  import { WizardClosePopup } from "../popup/wizard-close-popup.js";
10
10
  import { ABORT_EVENT_NAME, STORE_EVENT_NAME } from "./default-confirm-popup.js";
11
+ import { createLogger } from "../helper/logger.js";
11
12
  var __defProp = Object.defineProperty;
12
13
  var __decorateClass = (decorators, target, key, kind) => {
13
14
  var result = void 0;
@@ -17,6 +18,7 @@ var __decorateClass = (decorators, target, key, kind) => {
17
18
  if (result) __defProp(target, key, result);
18
19
  return result;
19
20
  };
21
+ const wizzardLogger = createLogger("PdDefaultWizard");
20
22
  const _DefaultWizard = class _DefaultWizard2 extends DefaultViewPage {
21
23
  constructor() {
22
24
  super(...arguments);
@@ -50,10 +52,10 @@ const _DefaultWizard = class _DefaultWizard2 extends DefaultViewPage {
50
52
  }
51
53
  _reloadFromStorage(storageKey) {
52
54
  var _a;
53
- console.log(`call reload ${storageKey}`);
55
+ wizzardLogger.debug(`call _reloadFromStorage ${storageKey}`);
54
56
  if (storageKey) {
55
57
  const storageEl = this.getWizardStorage()[storageKey];
56
- console.log("reload el", storageEl);
58
+ wizzardLogger.debug("reload storageEl", storageEl);
57
59
  if (storageEl && storageEl.orderFormData !== void 0) {
58
60
  const popup = new WizardReloadPopup();
59
61
  popup.reloadItem = storageEl;
@@ -70,7 +72,9 @@ const _DefaultWizard = class _DefaultWizard2 extends DefaultViewPage {
70
72
  });
71
73
  popup.addEventListener(STORE_EVENT_NAME, () => {
72
74
  var _a2, _b;
73
- console.debug(`Reload storage element from ${storageEl.timestamp}`);
75
+ wizzardLogger.debug(
76
+ `Reload storage element from ${storageEl.timestamp}`
77
+ );
74
78
  this._orderFormData = storageEl.orderFormData;
75
79
  this._currentOrderStep = storageEl.wizardStep;
76
80
  (_a2 = this.shadowRoot) == null ? void 0 : _a2.removeChild(popup);
@@ -90,7 +94,10 @@ const _DefaultWizard = class _DefaultWizard2 extends DefaultViewPage {
90
94
  }
91
95
  _doStorageEventUpdate(event) {
92
96
  if (event.detail) {
93
- console.log("event detail set, store prepared data: ", event.detail);
97
+ wizzardLogger.debug(
98
+ "event detail set, store prepared data: ",
99
+ event.detail
100
+ );
94
101
  const preparedOrder = {
95
102
  ...this._orderFormData || {},
96
103
  ...event.detail
@@ -111,7 +118,7 @@ const _DefaultWizard = class _DefaultWizard2 extends DefaultViewPage {
111
118
  RUNNING_WIZARD_STORAGE_ELEMENTS,
112
119
  JSON.stringify(storageWizard)
113
120
  );
114
- console.debug(
121
+ wizzardLogger.debug(
115
122
  `Update wizard local storage for key ${this._withLocalStorageId}`
116
123
  );
117
124
  }
@@ -124,7 +131,7 @@ const _DefaultWizard = class _DefaultWizard2 extends DefaultViewPage {
124
131
  RUNNING_WIZARD_STORAGE_ELEMENTS,
125
132
  JSON.stringify(storageWizard)
126
133
  );
127
- console.debug(
134
+ wizzardLogger.debug(
128
135
  `Remove wizard local storage for key ${this._withLocalStorageId}`
129
136
  );
130
137
  }
@@ -162,7 +169,7 @@ const _DefaultWizard = class _DefaultWizard2 extends DefaultViewPage {
162
169
  setNextStep();
163
170
  }
164
171
  } else {
165
- console.log("Validation rejected: ", detail);
172
+ wizzardLogger.warn("Validation rejected: ", detail);
166
173
  }
167
174
  }
168
175
  _previousStep() {
@@ -1 +1 @@
1
- {"version":3,"file":"date-helper.d.ts","sourceRoot":"","sources":["../../src/helper/date-helper.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,GAC5B,aAAa,IAAI,GAAG,MAAM,EAC1B,SAAS,IAAI,GAAG,MAAM,KACrB,MAsBF,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAI,SAAS,MAAM,KAAG,MAK1D,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAI,OAAO,MAAM,KAAG,MAKxD,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B,GACrC,QAAQ,IAAI,GAAG,MAAM,EACrB,MAAM,IAAI,GAAG,MAAM,KAClB,MAKF,CAAC;AAEF,eAAO,MAAM,YAAY,GACvB,OAAO,IAAI,GAAG,MAAM,GAAG,MAAM,EAC7B,cAAc,MAAM,WAmBrB,CAAC;AAEF,eAAO,MAAM,eAA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;AAED,wBAAgB,cAAc,CAC5B,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,EACxC,QAAQ,EAAE,OAAO,GAChB,MAAM,CA6BR;AAED,eAAO,MAAM,WAAW,GACtB,MAAM,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,EACxC,WAAW,OAAO,WAuBnB,CAAC;AAGF,eAAO,MAAM,0BAA0B,GAAI,YAAY,MAAM,KAAG,MAI/D,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { parse } from "date-fns";
2
2
  import { UNDEF } from "../model/spa-model.js";
3
3
  import { getCurrentFormatLocale, getCurrentTimeZone } from "./locale-format.js";
4
+ import { defaultLogger } from "./logger.js";
4
5
  const calculateDueWeeks = (billingDate, dueDate) => {
5
6
  const billingDateObj = typeof billingDate === "string" ? new Date(billingDate) : billingDate;
6
7
  const dueDateObj = typeof dueDate === "string" ? new Date(dueDate) : dueDate;
@@ -42,7 +43,7 @@ const formatToTime = (date, emptyResult) => {
42
43
  });
43
44
  }
44
45
  } catch (error) {
45
- console.error("Failed calll", date, error);
46
+ defaultLogger.warn("Failed formatToTime calll", date, error);
46
47
  }
47
48
  return resultStr;
48
49
  };
@@ -0,0 +1,14 @@
1
+ declare class Logger {
2
+ private context;
3
+ constructor(context?: string);
4
+ private shouldLog;
5
+ private log;
6
+ debug(msg: string, ...args: unknown[]): void;
7
+ info(msg: string, ...args: unknown[]): void;
8
+ warn(msg: string, ...args: unknown[]): void;
9
+ error(msg: string, ...args: unknown[]): void;
10
+ }
11
+ export declare const createLogger: (context: string) => Logger;
12
+ export declare const defaultLogger: Logger;
13
+ export {};
14
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/helper/logger.ts"],"names":[],"mappings":"AAmBA,cAAM,MAAM;IACE,OAAO,CAAC,OAAO;gBAAP,OAAO,GAAE,MAAW;IAExC,OAAO,CAAC,SAAS;IAOjB,OAAO,CAAC,GAAG;IAqBX,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE;IAGrC,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE;IAGpC,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE;IAGpC,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE;CAGtC;AAED,eAAO,MAAM,YAAY,GAAI,SAAS,MAAM,WAAwB,CAAC;AAErE,eAAO,MAAM,aAAa,QAAwB,CAAC"}
@@ -0,0 +1,54 @@
1
+ const LOG_LEVEL_MAP = /* @__PURE__ */ new Map([
2
+ ["debug", 0],
3
+ ["info", 1],
4
+ ["warn", 2],
5
+ ["error", 3]
6
+ ]);
7
+ const isValidLevel = (level) => LOG_LEVEL_MAP.has(level);
8
+ const ENV_LOG_LEVEL = void 0;
9
+ const LOG_LEVEL = isValidLevel(ENV_LOG_LEVEL) ? ENV_LOG_LEVEL : "info";
10
+ class Logger {
11
+ constructor(context = "") {
12
+ this.context = context;
13
+ }
14
+ shouldLog(level) {
15
+ return (LOG_LEVEL_MAP.get(level) || 0) >= (LOG_LEVEL_MAP.get(LOG_LEVEL) || 3);
16
+ }
17
+ log(level, message, ...args) {
18
+ if (!this.shouldLog(level)) return;
19
+ const timestamp = (/* @__PURE__ */ new Date()).toISOString();
20
+ const prefix = `[${timestamp}] [${this.context}]`;
21
+ switch (level) {
22
+ case "debug":
23
+ console.debug(prefix, message, ...args);
24
+ break;
25
+ case "info":
26
+ console.info(prefix, message, ...args);
27
+ break;
28
+ case "warn":
29
+ console.warn(prefix, message, ...args);
30
+ break;
31
+ case "error":
32
+ console.error(prefix, message, ...args);
33
+ break;
34
+ }
35
+ }
36
+ debug(msg, ...args) {
37
+ this.log("debug", msg, ...args);
38
+ }
39
+ info(msg, ...args) {
40
+ this.log("info", msg, ...args);
41
+ }
42
+ warn(msg, ...args) {
43
+ this.log("warn", msg, ...args);
44
+ }
45
+ error(msg, ...args) {
46
+ this.log("error", msg, ...args);
47
+ }
48
+ }
49
+ const createLogger = (context) => new Logger(context);
50
+ const defaultLogger = createLogger("PdSpa");
51
+ export {
52
+ createLogger,
53
+ defaultLogger
54
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"refresh-id-token.d.ts","sourceRoot":"","sources":["../../src/helper/refresh-id-token.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,eAAO,MAAM,4BAA4B,QAAa,OAAO,CAAC,OAAO,CAqBpE,CAAC"}
1
+ {"version":3,"file":"refresh-id-token.d.ts","sourceRoot":"","sources":["../../src/helper/refresh-id-token.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,eAAO,MAAM,4BAA4B,QAAa,OAAO,CAAC,OAAO,CAwBpE,CAAC"}
@@ -1,11 +1,13 @@
1
1
  import { getUserIdToken } from "../service-provider/service-provider-impl.js";
2
2
  import { update, USER_COLLECTION } from "../store/indexDB.js";
3
+ import { createLogger } from "./logger.js";
4
+ const userLogger = createLogger("PdUserAuth");
3
5
  const refreshAndPersistUserIdToken = async () => {
4
6
  try {
5
7
  const userResult = await getUserIdToken(true);
6
8
  const { userName, userToken, appName } = userResult || {};
7
9
  if (!userToken) {
8
- console.warn("Token refresh skipped: no valid userToken returned.");
10
+ userLogger.warn("Token refresh skipped: no valid userToken returned.");
9
11
  return false;
10
12
  }
11
13
  await update(USER_COLLECTION, {
@@ -13,12 +15,15 @@ const refreshAndPersistUserIdToken = async () => {
13
15
  userNameToken: userName,
14
16
  userIdToken: userToken
15
17
  });
16
- console.log(
18
+ userLogger.info(
17
19
  `[TokenRefresh] ID Token refreshed & saved to local DB for app: ${appName}`
18
20
  );
19
21
  return true;
20
22
  } catch (error) {
21
- console.error(`[TokenRefresh] Failed to refresh and persist token:`, error);
23
+ userLogger.error(
24
+ `[TokenRefresh] Failed to refresh and persist token:`,
25
+ error
26
+ );
22
27
  return false;
23
28
  }
24
29
  };
package/dist/index.d.ts CHANGED
@@ -16,6 +16,7 @@ export { DefaultPopup } from './defaultpage/default-popup.js';
16
16
  export { DefaultWizard } from './defaultpage/default-wizard.js';
17
17
  export { DefaultWizardStep } from './defaultpage/default-wizard-step.js';
18
18
  export { DefaultStepAddress } from './defaultpage/default-step-address.js';
19
+ export { createLogger, defaultLogger } from './helper/logger.js';
19
20
  export { DefaultStepSummary } from './defaultpage/default-step-summary.js';
20
21
  export type { OrderStep } from './defaultpage/default-step-summary.js';
21
22
  export { loginImpl, logoutImpl, getUser, isAuthenticatedImpl, callFunctionImpl, uploadFile, downloadFile, deleteFile, getStorageFileList, getStorageFile, getStorageConfiguration, activateCollectionListener, registerAppDeviceForNotification, getApp, getMessagingImpl, getUserIdToken, } from './service-provider/service-provider-impl.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAErC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,KAAK,UAAU,MAAM,8CAA8C,CAAC;AAC3E,OAAO,KAAK,WAAW,MAAM,sBAAsB,CAAC;AAEpD,OAAO,KAAK,gBAAgB,MAAM,oCAAoC,CAAC;AACvE,OAAO,KAAK,YAAY,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,YAAY,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,aAAa,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,cAAc,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,YAAY,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAErE,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,wCAAwC,CAAC;AAChD,YAAY,EAAE,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mB,EACnB,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,uBAAuB,EACvB,0BAA0B,EAC1B,gCAAgC,EAChC,MAAM,EACN,gBAAgB,EAChB,cAAc,GACf,MAAM,6CAA6C,CAAC;AAErD,OAAO,EAAE,4BAA4B,EAAE,MAAM,8BAA8B,CAAC;AAE5E,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D,OAAO,KAAK,QAAQ,MAAM,4BAA4B,CAAC;AACvD,OAAO,KAAK,UAAU,MAAM,6BAA6B,CAAC;AAE1D,OAAO,KAAK,IAAI,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,SAAS,IAAI,UAAU,EAAE,MAAM,0CAA0C,CAAC;AACnF,OAAO,EAAE,SAAS,IAAI,UAAU,EAAE,MAAM,0CAA0C,CAAC;AACnF,OAAO,EAAE,SAAS,IAAI,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAEnF,eAAO,MAAM,kBAAkB,GAC7B,SAAS,GAAG,EACZ,KAAK,MAAM,GAAG,cAAc,EAC5B,WAAW,OAAO,EAClB,SAAS,OAAO,SAajB,CAAC"}
package/dist/index.js CHANGED
@@ -14,6 +14,7 @@ import { DefaultPopup } from "./defaultpage/default-popup.js";
14
14
  import { DefaultWizard } from "./defaultpage/default-wizard.js";
15
15
  import { DefaultWizardStep } from "./defaultpage/default-wizard-step.js";
16
16
  import { DefaultStepAddress } from "./defaultpage/default-step-address.js";
17
+ import { createLogger, defaultLogger } from "./helper/logger.js";
17
18
  import { DefaultStepSummary } from "./defaultpage/default-step-summary.js";
18
19
  import { activateCollectionListener, callFunctionImpl, deleteFile, downloadFile, getApp, getMessagingImpl, getStorageConfiguration, getStorageFile, getStorageFileList, getUser, getUserIdToken, isAuthenticatedImpl, loginImpl, logoutImpl, registerAppDeviceForNotification, uploadFile } from "./service-provider/service-provider-impl.js";
19
20
  import { refreshAndPersistUserIdToken } from "./helper/refresh-id-token.js";
@@ -53,7 +54,9 @@ export {
53
54
  activateCollectionListener,
54
55
  templates as beTemplaes,
55
56
  callFunctionImpl,
57
+ createLogger,
56
58
  templates2 as deTemplaes,
59
+ defaultLogger,
57
60
  deleteFile,
58
61
  dispatchToastEvent,
59
62
  downloadFile,
@@ -1 +1 @@
1
- {"version":3,"file":"PdRouterService.d.ts","sourceRoot":"","sources":["../../src/router/PdRouterService.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGnE,KAAK,kBAAkB,GAAG,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC;AAE1D,cAAM,eAAe;IACnB,OAAO,CAAC,MAAM,CAAqC;IAEnD,OAAO,CAAC,gBAAgB,CAA4B;IAEpD,OAAO,CAAC,YAAY,CAAc;;IAQlC;;OAEG;IACI,eAAe,CAAC,WAAW,EAAE,eAAe,EAAE;IA8DrD;;OAEG;IACU,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,UAAQ;IAejD;;OAEG;IACI,aAAa,CAAC,OAAO,EAAE,kBAAkB;IAIhD;;OAEG;YACW,OAAO;CAwDtB;AAaD,eAAO,MAAM,eAAe,iBAAwB,CAAC"}
1
+ {"version":3,"file":"PdRouterService.d.ts","sourceRoot":"","sources":["../../src/router/PdRouterService.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAMnE,KAAK,kBAAkB,GAAG,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC;AAE1D,cAAM,eAAe;IACnB,OAAO,CAAC,MAAM,CAAqC;IAEnD,OAAO,CAAC,gBAAgB,CAA4B;IAEpD,OAAO,CAAC,YAAY,CAAc;;IAQlC;;OAEG;IACI,eAAe,CAAC,WAAW,EAAE,eAAe,EAAE;IAgErD;;OAEG;IACU,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,UAAQ;IAejD;;OAEG;IACI,aAAa,CAAC,OAAO,EAAE,kBAAkB;IAIhD;;OAEG;YACW,OAAO;CAwDtB;AAaD,eAAO,MAAM,eAAe,iBAAwB,CAAC"}
@@ -2,6 +2,8 @@ import UniversalRouter from "universal-router";
2
2
  import { firstValueFrom, first, filter } from "rxjs";
3
3
  import { selectAuthUser } from "../store/spa-app-selector.js";
4
4
  import { pdStore } from "../store/mini-rx.store.js";
5
+ import { createLogger } from "../helper/logger.js";
6
+ const routingLogger = createLogger("PdRouterService");
5
7
  class PdRouterService {
6
8
  constructor() {
7
9
  this.router = null;
@@ -15,7 +17,7 @@ class PdRouterService {
15
17
  * Setzt die Routen-Konfiguration. Muss vor Verwendung von navigate() aufgerufen werden.
16
18
  */
17
19
  configureRoutes(definitions) {
18
- console.log(
20
+ routingLogger.debug(
19
21
  "############ CONFIGURE ROUTING SERVICE ##################",
20
22
  definitions
21
23
  );
@@ -27,7 +29,9 @@ class PdRouterService {
27
29
  if (def.auth) {
28
30
  let authResult;
29
31
  if (!((_a = context.userCheck) == null ? void 0 : _a.loginCheckFinish)) {
32
+ routingLogger.debug("Check login is running, wait for result...");
30
33
  authResult = await waitForFinalAuthState();
34
+ routingLogger.debug("Check login is done, go on");
31
35
  context.userCheck = authResult;
32
36
  }
33
37
  if (!((_b = context.userCheck) == null ? void 0 : _b.user)) {
@@ -56,7 +60,7 @@ class PdRouterService {
56
60
  }
57
61
  };
58
62
  });
59
- console.log("######### Universal routes: ", universalRoutes);
63
+ routingLogger.debug("Universal routes transformed: ", universalRoutes);
60
64
  this.router = new UniversalRouter(universalRoutes);
61
65
  this.resolve(location.pathname + location.search);
62
66
  }
@@ -67,7 +71,7 @@ class PdRouterService {
67
71
  const fullPath = new URL(path, window.location.origin).pathname + new URL(path, window.location.origin).search;
68
72
  const current = window.location.pathname + window.location.search;
69
73
  if (!force && current === fullPath) {
70
- console.debug("[PdRouter] Navigation skipped (same path):", path);
74
+ routingLogger.debug("Navigation skipped (same path):", path);
71
75
  return;
72
76
  }
73
77
  history.pushState({}, "", path);
@@ -84,15 +88,15 @@ class PdRouterService {
84
88
  */
85
89
  async resolve(path) {
86
90
  if (!this.router) {
87
- console.warn("[PdRouter] Router not yet configured");
91
+ routingLogger.warn("Router not yet configured");
88
92
  return;
89
93
  }
90
94
  const url = new URL(path, window.location.origin);
91
95
  const pathname = url.pathname;
92
96
  const query = Object.fromEntries(url.searchParams.entries());
93
97
  try {
94
- console.debug(
95
- "[PdRouter] bevore resolve Current location:",
98
+ routingLogger.debug(
99
+ "Bevore resolve current location:",
96
100
  location.pathname
97
101
  );
98
102
  const userCheck = await firstValueFrom(
@@ -108,7 +112,7 @@ class PdRouterService {
108
112
  return;
109
113
  }
110
114
  if (!result || typeof result !== "object" || !result.route) {
111
- console.warn("[PdRouter] Invalid route result:", result);
115
+ routingLogger.warn("Invalid route result:", result);
112
116
  return;
113
117
  }
114
118
  const routeInfo = {
@@ -120,7 +124,7 @@ class PdRouterService {
120
124
  this.currentRoute = routeInfo.route;
121
125
  this.onChangeHandlers.forEach((fn) => fn(routeInfo));
122
126
  } catch (err) {
123
- console.error("[PdRouter] Routing error:", err);
127
+ routingLogger.error("Routing error:", err);
124
128
  }
125
129
  }
126
130
  }
@@ -1 +1 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/service-provider/firebase/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAOL,IAAI,EACL,MAAM,eAAe,CAAC;AAIvB;;;;GAIG;AACH,eAAO,MAAM,QAAQ,GAAI,UAAU,WAAW,SAG7C,CAAC;AAEF,eAAO,MAAM,MAAM,QAAa,OAAO,CAAC,OAAO,CAU9C,CAAC;AAEF,eAAO,MAAM,eAAe,QAAO,OAOlC,CAAC;AAEF,eAAO,MAAM,WAAW,QAAO,OAK9B,CAAC;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AI,CAMnE,CAAC"}
@@ -1,8 +1,10 @@
1
1
  import { getAuth, onIdTokenChanged, onAuthStateChanged, signInWithEmailAndPassword, signOut } from "firebase/auth";
2
+ import { createLogger } from "../../helper/logger.js";
3
+ const authLogger = createLogger("PdUserAuth");
2
4
  let auth;
3
5
  const initAuth = (appParam) => {
4
6
  auth = getAuth(appParam);
5
- console.log("App for auth is set: ", auth);
7
+ authLogger.debug("App for auth is set: ", auth);
6
8
  };
7
9
  const logout = async () => {
8
10
  if (!auth) {
@@ -20,7 +22,6 @@ const isAuthenticated = () => {
20
22
  throw new Error("isAuthenticated: Auth was not initialized");
21
23
  }
22
24
  const authCheck = auth.currentUser !== null;
23
- console.log("Check auth: ", authCheck);
24
25
  return authCheck;
25
26
  };
26
27
  const getAuthUser = () => {
@@ -1 +1 @@
1
- {"version":3,"file":"firestorage-client.d.ts","sourceRoot":"","sources":["../../../src/service-provider/firebase/firestorage-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAKL,YAAY,EAQb,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,UAAU,EACX,MAAM,8BAA8B,CAAC;AAkBtC;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAC1B,KAAK,WAAW,EAChB,iBAAiB,MAAM,EACvB,gBAAgB,iBAAiB,SAkClC,CAAC;AAEF,eAAO,MAAM,kBAAkB,QAAO,iBAAiB,GAAG,SAC7C,CAAC;AAEd,eAAO,MAAM,qBAAqB,GAChC,MAAM,UAAU,KACf,OAAO,CAAC,YAAY,CA8CtB,CAAC;AAsFF,eAAO,MAAM,kBAAkB,GAC7B,aAAa,MAAM,EACnB,QAAQ,MAAM,EACd,YAAY,MAAM,EAClB,yBAAuB,KACtB,OAAO,CAAC,eAAe,CA2CzB,CAAC;AAEF,eAAO,MAAM,sBAAsB,GACjC,aAAa,MAAM,EACnB,QAAQ,MAAM,EACd,YAAY,MAAM,EAClB,kBAAkB,OAAO,KACxB,OAAO,CAAC,eAAe,EAAE,CAoC3B,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,MAAM,eAAe,oBAY5D,CAAC;AAEF;;;;;GAKG;AACH,wBAAsB,yBAAyB,CAC7C,UAAU,EAAE,eAAe,GAC1B,OAAO,CAAC,IAAI,CAAC,CAsBf"}
1
+ {"version":3,"file":"firestorage-client.d.ts","sourceRoot":"","sources":["../../../src/service-provider/firebase/firestorage-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAKL,YAAY,EAQb,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,UAAU,EACX,MAAM,8BAA8B,CAAC;AAqBtC;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAC1B,KAAK,WAAW,EAChB,iBAAiB,MAAM,EACvB,gBAAgB,iBAAiB,SAkClC,CAAC;AAEF,eAAO,MAAM,kBAAkB,QAAO,iBAAiB,GAAG,SAC7C,CAAC;AAEd,eAAO,MAAM,qBAAqB,GAChC,MAAM,UAAU,KACf,OAAO,CAAC,YAAY,CA8CtB,CAAC;AAsFF,eAAO,MAAM,kBAAkB,GAC7B,aAAa,MAAM,EACnB,QAAQ,MAAM,EACd,YAAY,MAAM,EAClB,yBAAuB,KACtB,OAAO,CAAC,eAAe,CA2CzB,CAAC;AAEF,eAAO,MAAM,sBAAsB,GACjC,aAAa,MAAM,EACnB,QAAQ,MAAM,EACd,YAAY,MAAM,EAClB,kBAAkB,OAAO,KACxB,OAAO,CAAC,eAAe,EAAE,CAoC3B,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,MAAM,eAAe,oBAY5D,CAAC;AAEF;;;;;GAKG;AACH,wBAAsB,yBAAyB,CAC7C,UAAU,EAAE,eAAe,GAC1B,OAAO,CAAC,IAAI,CAAC,CAsBf"}
@@ -1,5 +1,7 @@
1
1
  import { getStorage, ref, uploadString, getMetadata, getDownloadURL, deleteObject, listAll } from "firebase/storage";
2
2
  import { getUser } from "../service-provider-impl.js";
3
+ import { createLogger } from "../../helper/logger.js";
4
+ const storageLogger = createLogger("PdStorage");
3
5
  const DEFAULT_STORAGE = "default_storage";
4
6
  let storageConf;
5
7
  const storageMap = /* @__PURE__ */ new Map();
@@ -29,7 +31,7 @@ const initFirestorage = (app, defaultStorage, storageConfig) => {
29
31
  });
30
32
  });
31
33
  } catch (error) {
32
- console.error(error);
34
+ storageLogger.error("Init error", error);
33
35
  }
34
36
  };
35
37
  const getFirestorageConf = () => storageConf;
@@ -125,7 +127,7 @@ const fetchItemsAndFolders = async (usedRef, storageName, refKey, includeMetaDat
125
127
  }
126
128
  return itemRefs;
127
129
  } catch (error) {
128
- console.error("Error during file and folder listing:", error);
130
+ storageLogger.error("Error during file and folder listing:", error);
129
131
  throw error;
130
132
  }
131
133
  };
@@ -162,7 +164,7 @@ const getFirestorageFile = async (storageName, refKey, storageURI, includeMetaDa
162
164
  }
163
165
  return storageDocument;
164
166
  } catch (error) {
165
- console.error("Error creating StorageDocument:", error);
167
+ storageLogger.error("Error creating StorageDocument:", error);
166
168
  throw error;
167
169
  }
168
170
  };
@@ -218,9 +220,9 @@ async function deleteFirestorageDocument(deleteFile) {
218
220
  const deleteRef = ref(storageConf2.storage, deleteFile.filePath);
219
221
  try {
220
222
  await deleteObject(deleteRef);
221
- console.log(`File ${deleteFile.fileName} successfully deleted.`);
223
+ storageLogger.info(`File ${deleteFile.fileName} successfully deleted.`);
222
224
  } catch (error) {
223
- console.error("Error deleting file:", error);
225
+ storageLogger.error("Error deleting file:", error);
224
226
  throw error;
225
227
  }
226
228
  }
@@ -1 +1 @@
1
- {"version":3,"file":"firestore-client.d.ts","sourceRoot":"","sources":["../../../src/service-provider/firebase/firestore-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAEL,SAAS,EAMV,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAKhE;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,KAAK,WAAW,SAO7C,CAAC;AAEF,eAAO,MAAM,KAAK,QAAO,SAAe,CAAC;AAEzC,eAAO,MAAM,6BAA6B,GACxC,UAAU,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,EAC9B,KAAK,MAAM,EACX,cAAc,mBAAmB,EAAE,8CAYpC,CAAC"}
1
+ {"version":3,"file":"firestore-client.d.ts","sourceRoot":"","sources":["../../../src/service-provider/firebase/firestore-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAEL,SAAS,EAMV,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAMhE;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,KAAK,WAAW,SAO7C,CAAC;AAEF,eAAO,MAAM,KAAK,QAAO,SAAe,CAAC;AAEzC,eAAO,MAAM,6BAA6B,GACxC,UAAU,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,EAC9B,KAAK,MAAM,EACX,cAAc,mBAAmB,EAAE,8CAYpC,CAAC"}
@@ -1,10 +1,11 @@
1
1
  import { getFirestore, where, query, collection, onSnapshot } from "firebase/firestore";
2
+ import { defaultLogger } from "../../helper/logger.js";
2
3
  let db;
3
4
  const initFirestore = (app) => {
4
5
  try {
5
6
  db = getFirestore(app);
6
7
  } catch (error) {
7
- console.error(error);
8
+ defaultLogger.error("Error during firestore init", error);
8
9
  }
9
10
  };
10
11
  const getFirebaseCollectionListener = (callback, col, constraints) => {
@@ -1 +1 @@
1
- {"version":3,"file":"functions-client.d.ts","sourceRoot":"","sources":["../../../src/service-provider/firebase/functions-client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAG3C,OAAO,EAEL,kBAAkB,EAClB,cAAc,EACd,eAAe,EAEhB,MAAM,8BAA8B,CAAC;AAOtC;;;;GAIG;AACH,eAAO,MAAM,aAAa,GACxB,KAAK,WAAW,EAChB,iBAAiB,eAAe,SAajC,CAAC;AAgGF,eAAO,MAAM,YAAY,GACvB,KAAK,kBAAkB,EACvB,eAAe,GAAG,KACjB,OAAO,CAAC,cAAc,CAA6C,CAAC"}
1
+ {"version":3,"file":"functions-client.d.ts","sourceRoot":"","sources":["../../../src/service-provider/firebase/functions-client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAG3C,OAAO,EAEL,kBAAkB,EAClB,cAAc,EACd,eAAe,EAEhB,MAAM,8BAA8B,CAAC;AAUtC;;;;GAIG;AACH,eAAO,MAAM,aAAa,GACxB,KAAK,WAAW,EAChB,iBAAiB,eAAe,SAajC,CAAC;AAgGF,eAAO,MAAM,YAAY,GACvB,KAAK,kBAAkB,EACvB,eAAe,GAAG,KACjB,OAAO,CAAC,cAAc,CAA6C,CAAC"}
@@ -3,6 +3,8 @@ import { getFunctions, httpsCallable } from "firebase/functions";
3
3
  import { SC_INVALID_USER, BusinessError } from "../service-provider-model.js";
4
4
  import { pdStore } from "../../store/mini-rx.store.js";
5
5
  import { toastAction } from "../../store/spa-app-actions.js";
6
+ import { createLogger } from "../../helper/logger.js";
7
+ const functionLogger = createLogger("PdFunctions");
6
8
  const functionMap = /* @__PURE__ */ new Map();
7
9
  const initFunctions = (app, functionsConfig) => {
8
10
  try {
@@ -11,13 +13,13 @@ const initFunctions = (app, functionsConfig) => {
11
13
  functionMap.set(func, httpsCallable(functions, func.name));
12
14
  });
13
15
  } catch (error) {
14
- console.error("ToDo: Error programmieren...", error);
16
+ functionLogger.error("error during function result", error);
15
17
  }
16
18
  };
17
19
  const internalCallFunction = async (def, functionInput) => {
18
20
  const funcRef = functionMap.get(def);
19
21
  if (!funcRef) {
20
- console.error("No function available for ", def.name);
22
+ functionLogger.error("No function available for ", def.name);
21
23
  throw new Error("Illegal state, no function available");
22
24
  }
23
25
  try {
@@ -38,7 +40,7 @@ const internalCallFunction = async (def, functionInput) => {
38
40
  }
39
41
  throw new Error(`Unexpected error: ${statusCode} - ${resultData}`);
40
42
  } catch (error) {
41
- console.error("Error in internalCallFunction:", error);
43
+ functionLogger.error("Error in internalCallFunction:", error);
42
44
  throw error;
43
45
  }
44
46
  };
@@ -1 +1 @@
1
- {"version":3,"file":"messagingFirebaseClient.d.ts","sourceRoot":"","sources":["../../../src/service-provider/firebase/messagingFirebaseClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAA0B,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGvE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAO/D,eAAO,MAAM,kBAAkB,qCAAqC,CAAC;AAKrE,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,WAAW,EAChB,aAAa,EAAE,eAAe,QAI/B;AAED,eAAO,MAAM,0BAA0B,GAAI,SAAS,MAAM,SAczD,CAAC;AA8BF,eAAO,MAAM,cAAc,GACzB,cAAc,yBAAyB,kBAoBxC,CAAC;AAEF,eAAO,MAAM,oBAAoB,iBAAkB,CAAC"}
1
+ {"version":3,"file":"messagingFirebaseClient.d.ts","sourceRoot":"","sources":["../../../src/service-provider/firebase/messagingFirebaseClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAA0B,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGvE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAQ/D,eAAO,MAAM,kBAAkB,qCAAqC,CAAC;AAOrE,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,WAAW,EAChB,aAAa,EAAE,eAAe,QAI/B;AAED,eAAO,MAAM,0BAA0B,GAAI,SAAS,MAAM,SAczD,CAAC;AA8BF,eAAO,MAAM,cAAc,GACzB,cAAc,yBAAyB,kBAoBxC,CAAC;AAEF,eAAO,MAAM,oBAAoB,iBAAkB,CAAC"}
@@ -3,7 +3,9 @@ import { update, USER_COLLECTION } from "../../store/indexDB.js";
3
3
  import { pdStore } from "../../store/mini-rx.store.js";
4
4
  import { updateNewNotificationToken } from "../../store/spa-app-actions.js";
5
5
  import { authIdTokenStateChanged } from "./auth.js";
6
+ import { createLogger } from "../../helper/logger.js";
6
7
  const NOTIFICATION_TOKEN = "pd.spa.helper.notification.token";
8
+ const messagingLogger = createLogger("PdMessaging");
7
9
  let messaging;
8
10
  let firebaseMessagingAppConfigKey;
9
11
  function prepareMessaging(app, messageConfig) {
@@ -20,7 +22,7 @@ const activateTokenChangeHandler = (appName) => {
20
22
  userNameToken: user.displayName,
21
23
  userIdToken: token
22
24
  });
23
- console.log("UserToken stored in local db");
25
+ messagingLogger.info("UserToken stored in local db");
24
26
  }
25
27
  }
26
28
  });
@@ -36,21 +38,21 @@ const initMessageToken = async (registration) => {
36
38
  if (currentToken) {
37
39
  const storedToken = localStorage.getItem(NOTIFICATION_TOKEN);
38
40
  if (storedToken !== currentToken) {
39
- console.log("Update new token in Backend");
41
+ messagingLogger.info("Update new token in Backend");
40
42
  pdStore().dispatch(
41
43
  updateNewNotificationToken({
42
44
  messagingToken: currentToken
43
45
  })
44
46
  );
45
47
  } else {
46
- console.log("RegisterDevice: Stored token is valid");
48
+ messagingLogger.info("RegisterDevice: Stored token is valid");
47
49
  }
48
50
  } else {
49
- console.warn("No token received - no new token was generated.");
51
+ messagingLogger.warn("No token received - no new token was generated.");
50
52
  }
51
53
  };
52
54
  const registerDevice = async (registration) => {
53
- console.log("Start registering app for messages and notifications");
55
+ messagingLogger.info("Start registering app for messages and notifications");
54
56
  if (Notification.permission === "default") {
55
57
  await Notification.requestPermission();
56
58
  }
@@ -58,7 +60,7 @@ const registerDevice = async (registration) => {
58
60
  await initMessageToken(registration);
59
61
  }
60
62
  if (Notification.permission === "denied") {
61
- console.warn("Messaging not possible, missing rights");
63
+ messagingLogger.warn("Messaging not possible, missing rights");
62
64
  }
63
65
  };
64
66
  const getFirebaseMessaging = () => messaging;
@@ -1 +1 @@
1
- {"version":3,"file":"service-provider-impl.d.ts","sourceRoot":"","sources":["../../src/service-provider/service-provider-impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAiB,MAAM,cAAc,CAAC;AAkB1D,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,4BAA4B,EAC5B,eAAe,EACf,UAAU,EACX,MAAM,6BAA6B,CAAC;AA2CrC,eAAO,MAAM,kBAAkB,GAC7B,gBAAgB,4BAA4B,SAG7C,CAAC;AAqCF,eAAO,MAAM,WAAW,GAAI,QAAQ,gBAAgB,SAWnD,CAAC;AAKF,eAAO,MAAM,gBAAgB,GAC3B,KAAK,kBAAkB,EACvB,eAAe,GAAG,KACjB,OAAO,CAAC,cAAc,CASxB,CAAC;AAMF,eAAO,MAAM,oBAAoB,GAAI,UAAU,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,SAQjE,CAAC;AAEF,eAAO,MAAM,mBAAmB,eAQ/B,CAAC;AAEF,eAAO,MAAM,kCAAkC,GAC7C,WAAW,MAAM,KAChB,OAAO,CAAC,OAAO,CAMjB,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,EAAE,KAAK,MAAM,qBAiBlD,CAAC;AAEF,eAAO,MAAM,UAAU,wBAQtB,CAAC;AAGF,eAAO,MAAM,OAAO,eAQnB,CAAC;AAKF,eAAO,MAAM,UAAU,GAAI,MAAM,UAAU,KAAG,OAAO,CAAC,OAAO,CAQ5D,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC7B,aAAa,MAAM,EACnB,QAAQ,MAAM,EACd,YAAY,MAAM,EAClB,kBAAkB,OAAO,KACxB,OAAO,CAAC,eAAe,EAAE,CAa3B,CAAC;AAEF,eAAO,MAAM,cAAc,GACzB,aAAa,MAAM,EACnB,QAAQ,MAAM,EACd,YAAY,MAAM,EAClB,iBAAiB,OAAO,KACvB,OAAO,CAAC,eAAe,CAKzB,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,MAAM,eAAe,KAAG,OAAO,CAAC,OAAO,CAQnE,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,MAAM,eAAe,KAAG,OAAO,CAAC,OAAO,CAKjE,CAAC;AAEF,eAAO,MAAM,uBAAuB,QAAO,iBAAiB,GAAG,SAK9D,CAAC;AAKF,eAAO,MAAM,0BAA0B,GACrC,UAAU,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,EAC9B,KAAK,MAAM,EACX,cAAc,mBAAmB,EAAE,mDAUpC,CAAC;AAKF,eAAO,MAAM,gCAAgC,GAC3C,cAAc,yBAAyB,kBAYxC,CAAC;AAEF,eAAO,MAAM,gBAAgB,2DAS5B,CAAC;AAEF,eAAO,MAAM,cAAc,GACzB,SAAS,OAAO,KACf,OAAO,CACN;IACE,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB,GACD,SAAS,CAgBZ,CAAC;AAEF,eAAO,MAAM,MAAM,mBAAY,CAAC"}
1
+ {"version":3,"file":"service-provider-impl.d.ts","sourceRoot":"","sources":["../../src/service-provider/service-provider-impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAiB,MAAM,cAAc,CAAC;AAkB1D,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,4BAA4B,EAC5B,eAAe,EACf,UAAU,EACX,MAAM,6BAA6B,CAAC;AA8CrC,eAAO,MAAM,kBAAkB,GAC7B,gBAAgB,4BAA4B,SAG7C,CAAC;AAqCF,eAAO,MAAM,WAAW,GAAI,QAAQ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AC3C,cAAc,yBAAyB,kBAYxC,CAAC;AAEF,eAAO,MAAM,gBAAgB,2DAS5B,CAAC;AAEF,eAAO,MAAM,cAAc,GACzB,SAAS,OAAO,KACf,OAAO,CACN;IACE,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB,GACD,SAAS,CAgBZ,CAAC;AAEF,eAAO,MAAM,MAAM,mBAAY,CAAC"}
@@ -8,6 +8,8 @@ import { initFirestorage, uploadFirestorageFile, getFirestorageFileList, getFire
8
8
  import { initStorageMock, uploadStorageFileMock, getMockFileList, downloadFileMock } from "./mock/storage-client.js";
9
9
  import { prepareMessaging, activateTokenChangeHandler, registerDevice, getFirebaseMessaging } from "./firebase/messagingFirebaseClient.js";
10
10
  import "../PdSpaHelper.js";
11
+ import { createLogger } from "../helper/logger.js";
12
+ const serviceLogger = createLogger("PdServiceProvider");
11
13
  let provider;
12
14
  let app;
13
15
  const throwUndefinedProviderError = () => {
@@ -24,7 +26,7 @@ const initFirebaseApplicationServices = (firebaseApp, config) => {
24
26
  initFirestore(firebaseApp);
25
27
  if (config.functionsConfig) {
26
28
  initFunctions(firebaseApp, config.functionsConfig);
27
- console.debug("Init provider functions");
29
+ serviceLogger.debug("Init provider functions");
28
30
  }
29
31
  if (((_a = config.firebaseConfig) == null ? void 0 : _a.storageBucket) && config.storageConfig) {
30
32
  initFirestorage(
@@ -32,17 +34,17 @@ const initFirebaseApplicationServices = (firebaseApp, config) => {
32
34
  (_b = config.firebaseConfig) == null ? void 0 : _b.storageBucket,
33
35
  config.storageConfig
34
36
  );
35
- console.debug("Init provider storage");
37
+ serviceLogger.debug("Init provider storage");
36
38
  }
37
39
  if (config.messagingConfig) {
38
40
  prepareMessaging(firebaseApp, config.messagingConfig);
39
- console.debug("Set firebase app and config for messaging");
41
+ serviceLogger.debug("Set firebase app and config for messaging");
40
42
  activateTokenChangeHandler(firebaseApp.name);
41
- console.debug(
43
+ serviceLogger.debug(
42
44
  `idTokenChangeHandler for messaging and app ${firebaseApp.name} activated`
43
45
  );
44
46
  }
45
- console.debug("Firebase initialized");
47
+ serviceLogger.debug("Firebase initialized");
46
48
  };
47
49
  const initAppImpl = (config) => {
48
50
  if (provider === "firebase" && config.firebaseConfig) {
@@ -172,7 +174,9 @@ const activateCollectionListener = (callback, col, constraints) => {
172
174
  return getFirebaseCollectionListener(callback, col, constraints);
173
175
  }
174
176
  if (provider === "mock") {
175
- console.log("getCollectionListener not implemented for MOCK, do noting");
177
+ serviceLogger.warn(
178
+ "getCollectionListener not implemented for MOCK, do noting"
179
+ );
176
180
  return "";
177
181
  }
178
182
  return throwUndefinedProviderError();
@@ -182,7 +186,7 @@ const registerAppDeviceForNotification = async (registration) => {
182
186
  return registerDevice(registration);
183
187
  }
184
188
  if (provider === "mock") {
185
- console.log(
189
+ serviceLogger.warn(
186
190
  "registerAppDeviceForNotification not implemented for MOCK, do noting"
187
191
  );
188
192
  return Promise.resolve();
@@ -194,7 +198,7 @@ const getMessagingImpl = () => {
194
198
  return getFirebaseMessaging();
195
199
  }
196
200
  if (provider === "mock") {
197
- console.log("getMessagingImpl not implemented for MOCK, do noting");
201
+ serviceLogger.warn("getMessagingImpl not implemented for MOCK, do noting");
198
202
  return void 0;
199
203
  }
200
204
  return throwUndefinedProviderError();
@@ -208,7 +212,7 @@ const getUserIdToken = async (refresh) => {
208
212
  } : void 0;
209
213
  }
210
214
  if (provider === "mock") {
211
- console.log("getUserIdToken not implemented for MOCK, do noting");
215
+ serviceLogger.warn("getUserIdToken not implemented for MOCK, do noting");
212
216
  return void 0;
213
217
  }
214
218
  return throwUndefinedProviderError();
@@ -1 +1 @@
1
- {"version":3,"file":"indexDB.d.ts","sourceRoot":"","sources":["../../src/store/indexDB.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,eAAe,mBAAmB,CAAC;AAmBhD,eAAO,MAAM,GAAG,GAAI,CAAC,EAAE,OAAO,MAAM,EAAE,IAAI,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AO,MAAM,EAAE,IAAI,CAAC,EAAE,kBAAkB,OAAO,qBAclE,CAAC;AAEL,eAAO,MAAM,MAAM,GAAI,CAAC,EAAE,OAAO,MAAM,EAAE,IAAI,CAAC,qBAW1C,CAAC;AAEL,eAAO,MAAM,SAAS,GAAI,CAAC,EAAE,OAAO,MAAM,EAAE,SAAS,CAAC,EAAE,qBAUpD,CAAC;AAEL,eAAO,MAAM,MAAM,GAAI,CAAC,EACtB,OAAO,MAAM,EACb,SAAS,CAAC,EAAE,EACZ,kBAAkB,OAAO,qBAWvB,CAAC;AAaL,eAAO,MAAM,WAAW,GAAI,OAAO,MAAM,EAAE,WAAW,MAAM,EAAE,qBAU1D,CAAC;AAEL,eAAO,MAAM,GAAG,GAAI,CAAC,EAAE,OAAO,MAAM,EAAE,IAAI,MAAM,KAAG,OAAO,CAAC,CAAC,CAKxD,CAAC;AAEL,eAAO,MAAM,MAAM,GAAI,CAAC,EAAE,OAAO,MAAM,EAAE,QAAQ,MAAM,KAAG,OAAO,CAAC,CAAC,EAAE,CAwBjE,CAAC;AAEL,eAAO,MAAM,SAAS,GAAI,OAAO,MAAM,qBAqBnC,CAAC;AAEL,eAAO,MAAM,SAAS,GAAI,OAAO,MAAM,qBASnC,CAAC;AAEL,eAAO,MAAM,cAAc,GAAI,QAAQ,MAAM,qBAMzC,CAAC;AAEL;;;;;GAKG;AACH,eAAO,MAAM,MAAM,GAAI,QAAQ;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE;QACX,IAAI,EAAE,MAAM,CAAC;QACb,cAAc,EAAE;YACd,OAAO,CAAC,EAAE,MAAM,CAAC;SAClB,CAAC;KACH,EAAE,CAAC;CACL,SAgDA,CAAC"}
@@ -1,5 +1,7 @@
1
+ import { createLogger } from "../helper/logger.js";
1
2
  import { pdStore } from "./mini-rx.store.js";
2
3
  import { initIndexDBSucess } from "./spa-app-actions.js";
4
+ const dbLogger = createLogger("PdIndexDB");
3
5
  const USER_COLLECTION = "dcInternalUser";
4
6
  const { indexedDB } = window;
5
7
  let db;
@@ -10,7 +12,7 @@ const add = (table, el, ignoreDuplicates) => new Promise((resolve, reject) => {
10
12
  if (event.target.error.code === 0 && ignoreDuplicates) {
11
13
  return resolve("duplicate");
12
14
  }
13
- console.warn("Unable to add data!", event, el);
15
+ dbLogger.warn("Unable to add data!", event, el);
14
16
  return reject(event.target.error);
15
17
  };
16
18
  });
@@ -18,7 +20,7 @@ const update = (table, el) => new Promise((resolve, reject) => {
18
20
  const request = db.transaction([table], "readwrite").objectStore(table).put(el);
19
21
  request.onsuccess = () => resolve(request.result);
20
22
  request.onerror = (event) => {
21
- console.warn("Unable to put data!", event, el);
23
+ dbLogger.warn("Unable to put data!", event, el);
22
24
  return reject(event.target.error);
23
25
  };
24
26
  });
@@ -99,17 +101,18 @@ const initDB = (config) => {
99
101
  const { dbName, dbVersion, collections } = config;
100
102
  const request = indexedDB.open(dbName, dbVersion);
101
103
  request.onerror = (event) => {
102
- console.log("error during db init:", event);
104
+ dbLogger.error("Error during init:", event);
103
105
  };
104
106
  request.onsuccess = () => {
105
107
  db = request.result;
106
- console.log(`db init success: ${db}`);
108
+ dbLogger.debug(`init success: ${db}`);
107
109
  pdStore().dispatch(initIndexDBSucess());
108
110
  };
109
111
  request.onupgradeneeded = (event) => {
110
- console.log("Upgrade needed", event);
112
+ dbLogger.info("Upgrade needed", event);
111
113
  db = event.target.result;
112
114
  switch (event.oldVersion) {
115
+ // first call from client, init db
113
116
  case 0:
114
117
  db.createObjectStore(USER_COLLECTION, {
115
118
  keyPath: "id"
@@ -118,8 +121,10 @@ const initDB = (config) => {
118
121
  db.createObjectStore(c.name, c.collectionConf);
119
122
  });
120
123
  break;
124
+ // depending on our needs, add specific versions here to migrate existing db
125
+ // case X: ....
121
126
  default:
122
- console.log("Updating database structure for existing version");
127
+ dbLogger.info("Updating database structure for existing version");
123
128
  if (!db.objectStoreNames.contains(USER_COLLECTION)) {
124
129
  db.createObjectStore(USER_COLLECTION, {
125
130
  keyPath: "id"
@@ -1 +1 @@
1
- {"version":3,"file":"mini-rx.store.d.ts","sourceRoot":"","sources":["../../src/store/mini-rx.store.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,EAIN,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAwB5E,eAAO,MAAM,eAAe,GAAI,OAAO,WAAW,SA0BjD,CAAC;AAEF,eAAO,MAAM,OAAO,QAAO,KAAc,CAAC"}
1
+ {"version":3,"file":"mini-rx.store.d.ts","sourceRoot":"","sources":["../../src/store/mini-rx.store.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,EAIN,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAyB5E,eAAO,MAAM,eAAe,GAAI,OAAO,WAAW,SA0BjD,CAAC;AAEF,eAAO,MAAM,OAAO,QAAO,KAAc,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { configureStore, LoggerExtension, ReduxDevtoolsExtension, ImmutableStateExtension } from "mini-rx-store";
2
2
  import { spaAppReducer } from "./spa-app-reducer.js";
3
3
  import { appRouteEffect, appToastEffect, registerNotificationTokenSuccessEffect } from "./spa-app-effects.js";
4
+ import { defaultLogger } from "../helper/logger.js";
4
5
  let store;
5
6
  const registerEffects = (effects) => {
6
7
  if (store) {
@@ -9,11 +10,11 @@ const registerEffects = (effects) => {
9
10
  store.effect(registerNotificationTokenSuccessEffect);
10
11
  effects.forEach((effect) => store.effect(effect));
11
12
  } else {
12
- console.error("Store is not initialized. Cannot register effects.");
13
+ defaultLogger.error("Store is not initialized. Cannot register effects.");
13
14
  }
14
15
  };
15
16
  const initializeStore = (param) => {
16
- console.log("Initialize Store:", param);
17
+ defaultLogger.debug("Initialize Store:", param);
17
18
  if (!store) {
18
19
  store = configureStore({
19
20
  reducers: param.reducer ? {
@@ -3,7 +3,7 @@ export declare const appRouteEffect: import('rxjs').Observable<{
3
3
  payload: string;
4
4
  } & {
5
5
  type: "SPA_APP_ROUTE";
6
- }> & import('mini-rx-store/lib/models.js').HasEffectMetadata;
6
+ }> & import('@mini-rx/common').HasEffectMetadata;
7
7
  export declare const appToastEffect: import('rxjs').Observable<{
8
8
  payload: {
9
9
  txt: string | import('lit-html').TemplateResult;
@@ -13,12 +13,12 @@ export declare const appToastEffect: import('rxjs').Observable<{
13
13
  };
14
14
  } & {
15
15
  type: "SPA_APP_TOAST";
16
- }> & import('mini-rx-store/lib/models.js').HasEffectMetadata;
16
+ }> & import('@mini-rx/common').HasEffectMetadata;
17
17
  export declare const registerNotificationTokenSuccessEffect: import('rxjs').Observable<{
18
18
  payload: {
19
19
  messagingToken: string;
20
20
  };
21
21
  } & {
22
22
  type: "UPDATE_NOTIFICATION_TOKEN_SUCCESS";
23
- }> & import('mini-rx-store/lib/models.js').HasEffectMetadata;
23
+ }> & import('@mini-rx/common').HasEffectMetadata;
24
24
  //# sourceMappingURL=spa-app-effects.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"spa-app-effects.d.ts","sourceRoot":"","sources":["../../src/store/spa-app-effects.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,eAAe,GAAI,OAAO,WAAW,SAEjD,CAAC;AAIF,eAAO,MAAM,cAAc;;;;4DAoB1B,CAAC;AAEF,eAAO,MAAM,cAAc;;;;;;;;;4DAyB1B,CAAC;AAEF,eAAO,MAAM,sCAAsC;;;;;;4DAUlD,CAAC"}
1
+ {"version":3,"file":"spa-app-effects.d.ts","sourceRoot":"","sources":["../../src/store/spa-app-effects.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,eAAe,GAAI,OAAO,WAAW,SAEjD,CAAC;AAIF,eAAO,MAAM,cAAc;;;;gDAoB1B,CAAC;AAEF,eAAO,MAAM,cAAc;;;;;;;;;gDAyB1B,CAAC;AAEF,eAAO,MAAM,sCAAsC;;;;;;gDAUlD,CAAC"}
@@ -3,6 +3,7 @@ import { tap } from "rxjs/operators";
3
3
  import { ofType } from "ts-action-operators";
4
4
  import { routeAction, toastAction, updateNewNotificationTokenSuccess } from "./spa-app-actions.js";
5
5
  import { NOTIFICATION_TOKEN } from "../service-provider/firebase/messagingFirebaseClient.js";
6
+ import { defaultLogger } from "../helper/logger.js";
6
7
  let routeElement;
7
8
  const setRouteElement = (param) => {
8
9
  routeElement = param;
@@ -12,7 +13,7 @@ const appRouteEffect = createEffect(
12
13
  ofType(routeAction),
13
14
  tap((action) => {
14
15
  if (!routeElement) {
15
- console.error("No route element set for appRouteEffect");
16
+ defaultLogger.error("No route element set for appRouteEffect");
16
17
  } else {
17
18
  routeElement.dispatchEvent(
18
19
  new CustomEvent("route-event", {
@@ -33,7 +34,7 @@ const appToastEffect = createEffect(
33
34
  ofType(toastAction),
34
35
  tap((action) => {
35
36
  if (!routeElement) {
36
- console.error("No route element set for appToastEffect");
37
+ defaultLogger.error("No route element set for appToastEffect");
37
38
  } else {
38
39
  routeElement.dispatchEvent(
39
40
  new CustomEvent("toast-event", {
@@ -1,10 +1,10 @@
1
- export declare const getLoadingSelector: import('mini-rx-store/lib/selector.js').Selector<object, import('../model/spa-model.js').LoadingState[]>;
2
- export declare const getOfflineSelector: import('mini-rx-store/lib/selector.js').Selector<object, boolean>;
3
- export declare const getInitStatusSelector: import('mini-rx-store/lib/selector.js').Selector<object, {
1
+ export declare const getLoadingSelector: import('mini-rx-store/src/lib/selector.js').Selector<object, import('../model/spa-model.js').LoadingState[]>;
2
+ export declare const getOfflineSelector: import('mini-rx-store/src/lib/selector.js').Selector<object, boolean>;
3
+ export declare const getInitStatusSelector: import('mini-rx-store/src/lib/selector.js').Selector<object, {
4
4
  login: boolean;
5
5
  indexedDB: boolean | undefined;
6
6
  }>;
7
- export declare const selectAuthUser: import('mini-rx-store/lib/selector.js').Selector<object, {
7
+ export declare const selectAuthUser: import('mini-rx-store/src/lib/selector.js').Selector<object, {
8
8
  user: import('../model/spa-model.js').AppUser | undefined;
9
9
  loginCheckFinish: boolean;
10
10
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"spa-app-selector.d.ts","sourceRoot":"","sources":["../../src/store/spa-app-selector.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,kBAAkB,0GAuB9B,CAAC;AAEF,eAAO,MAAM,kBAAkB,mEAG9B,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;EAMjC,CAAC;AAEF,eAAO,MAAM,cAAc;;;EAM1B,CAAC"}
1
+ {"version":3,"file":"spa-app-selector.d.ts","sourceRoot":"","sources":["../../src/store/spa-app-selector.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,kBAAkB,8GAuB9B,CAAC;AAEF,eAAO,MAAM,kBAAkB,uEAG9B,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;EAMjC,CAAC;AAEF,eAAO,MAAM,cAAc;;;EAM1B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progressive-development/pd-spa-helper",
3
- "version": "0.8.1-i",
3
+ "version": "0.8.2",
4
4
  "description": "Webcomponent pd-spa-helper following open-wc recommendations",
5
5
  "author": "PD Progressive Development",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -37,7 +37,7 @@
37
37
  "@lit/localize": "^0.12.2",
38
38
  "@progressive-development/pd-content": "^0.6.2",
39
39
  "@progressive-development/pd-dialog": "^0.6.0",
40
- "@progressive-development/pd-forms": "^0.6.0",
40
+ "@progressive-development/pd-forms": "^0.6.1",
41
41
  "@progressive-development/pd-icon": "^0.6.1",
42
42
  "@progressive-development/pd-order": "^0.6.0",
43
43
  "@progressive-development/pd-page": "^0.6.0",
@@ -46,7 +46,7 @@
46
46
  "date-fns": "^2.30.0",
47
47
  "firebase": "^10.14.1",
48
48
  "lit": "^3.3.0",
49
- "mini-rx-store": "^5.1.0",
49
+ "mini-rx-store": "^6.0.1",
50
50
  "rxjs": "^7.8.2",
51
51
  "ts-action": "^11.0.0",
52
52
  "ts-action-operators": "^9.1.2",
@@ -62,8 +62,8 @@
62
62
  "@storybook/test": "^8.6.14",
63
63
  "@storybook/web-components": "^8.0.10",
64
64
  "@storybook/web-components-vite": "^8.6.14",
65
- "@typescript-eslint/eslint-plugin": "^8.32.1",
66
- "@typescript-eslint/parser": "^8.32.1",
65
+ "@typescript-eslint/eslint-plugin": "^8.33.1",
66
+ "@typescript-eslint/parser": "^8.33.1",
67
67
  "eslint": "^8.57.1",
68
68
  "eslint-config-prettier": "^9.1.0",
69
69
  "eslint-plugin-storybook": "^0.8.0",
@@ -71,9 +71,9 @@
71
71
  "rollup-plugin-visualizer": "^5.14.0",
72
72
  "storybook": "^8.6.14",
73
73
  "typescript": "^5.8.3",
74
- "vite": "^5.4.19",
74
+ "vite": "^6.3.5",
75
75
  "vite-plugin-dts": "^4.5.4",
76
- "vitest": "^2.1.9"
76
+ "vitest": "^3.2.2"
77
77
  },
78
78
  "customElements": "custom-elements.json",
79
79
  "keywords": [