@progressive-development/pd-spa-helper 0.3.102 → 0.3.103
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +72 -0
- package/dist/node_modules/@firebase/app/dist/esm/index.esm2017.js +749 -0
- package/dist/node_modules/@firebase/auth/dist/esm2017/index-68602d24.js +6265 -0
- package/dist/node_modules/@firebase/component/dist/esm/index.esm2017.js +341 -0
- package/dist/node_modules/@firebase/firestore/dist/index.esm2017.js +10250 -0
- package/dist/node_modules/@firebase/functions/dist/index.esm2017.js +513 -0
- package/dist/node_modules/@firebase/installations/dist/esm/index.esm2017.js +863 -0
- package/dist/node_modules/@firebase/logger/dist/esm/index.esm2017.js +122 -0
- package/dist/node_modules/@firebase/messaging/dist/esm/index.esm2017.js +1019 -0
- package/dist/node_modules/@firebase/storage/dist/index.esm2017.js +2042 -0
- package/dist/node_modules/@firebase/util/dist/index.esm2017.js +931 -0
- package/dist/node_modules/@firebase/webchannel-wrapper/dist/bloom-blob/esm/bloom_blob_es2018.js +417 -0
- package/dist/node_modules/@firebase/webchannel-wrapper/dist/webchannel-blob/esm/webchannel_blob_es2018.js +2155 -0
- package/dist/node_modules/@lit/reactive-element/decorators/custom-element.js +14 -0
- package/dist/node_modules/@lit/reactive-element/decorators/property.js +20 -0
- package/dist/node_modules/@lit/reactive-element/decorators/query-assigned-elements.js +7 -0
- package/dist/node_modules/@progressive-development/pd-dialog/pd-popup-dialog.js +5 -0
- package/dist/node_modules/@progressive-development/pd-dialog/pd-popup.js +2 -0
- package/dist/node_modules/@progressive-development/pd-dialog/src/PdPopup.js +113 -0
- package/dist/node_modules/@progressive-development/pd-dialog/src/PdPopupDialog.js +189 -0
- package/dist/node_modules/@progressive-development/pd-forms/pd-button.js +2 -0
- package/dist/node_modules/@progressive-development/pd-forms/pd-form-container.js +2 -0
- package/dist/node_modules/@progressive-development/pd-forms/pd-form-row.js +2 -0
- package/dist/node_modules/@progressive-development/pd-forms/pd-hover-box.js +2 -0
- package/dist/node_modules/@progressive-development/pd-forms/pd-input.js +2 -0
- package/dist/node_modules/@progressive-development/pd-forms/src/PdBaseInputElement.js +86 -0
- package/dist/node_modules/@progressive-development/pd-forms/src/PdBaseUi.js +34 -0
- package/dist/node_modules/@progressive-development/pd-forms/src/PdBaseUiInput.js +227 -0
- package/dist/node_modules/@progressive-development/pd-forms/src/PdButton.js +194 -0
- package/dist/node_modules/@progressive-development/pd-forms/src/PdFormContainer.js +167 -0
- package/dist/node_modules/@progressive-development/pd-forms/src/PdFormRow.js +92 -0
- package/dist/node_modules/@progressive-development/pd-forms/src/PdHoverBox.js +108 -0
- package/dist/node_modules/@progressive-development/pd-forms/src/PdInput.js +79 -0
- package/dist/node_modules/@progressive-development/pd-forms/src/generated/locale/be.js +11 -0
- package/dist/node_modules/@progressive-development/pd-forms/src/generated/locale/en.js +11 -0
- package/dist/node_modules/@progressive-development/pd-forms/src/shared-input-field-styles.js +152 -0
- package/dist/node_modules/@progressive-development/pd-forms/src/shared-input-styles.js +64 -0
- package/dist/node_modules/@progressive-development/pd-icon/pd-icon.js +4 -0
- package/dist/node_modules/@progressive-development/pd-icon/src/PdIcon.js +596 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/locales/be.js +15 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/locales/de.js +15 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/locales/en.js +15 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-contact/pd-contact.js +2 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-contact/src/PdContact.js +567 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-content/pd-collapse.js +2 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-content/pd-edit-content.js +2 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-content/src/PdCollapse.js +136 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-content/src/PdEditContent.js +224 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-dialog/pd-popup.js +2 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-dialog/src/PdPopup.js +113 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/pd-checkbox.js +2 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/pd-form-container.js +2 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/pd-form-row.js +2 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/pd-hover-box.js +2 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/pd-input.js +2 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/pd-radio-group.js +2 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/src/PdBaseInputElement.js +86 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/src/PdBaseUi.js +34 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/src/PdBaseUiInput.js +229 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/src/PdCheckbox.js +230 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/src/PdFormContainer.js +167 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/src/PdFormRow.js +92 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/src/PdHoverBox.js +108 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/src/PdInput.js +79 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/src/PdRadioGroup.js +72 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/src/shared-input-field-styles.js +152 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-forms/src/shared-input-styles.js +64 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-icon/pd-icon.js +4 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-icon/src/PdIcon.js +596 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-price/pd-pricetable.js +2 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/@progressive-development/pd-price/src/PdPricetable.js +149 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/fecha/lib/fecha.js +200 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/lit/node_modules/lit-html/directive.js +27 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/lit/node_modules/lit-html/directives/class-map.js +36 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/node_modules/lit/node_modules/lit-html/lit-html.js +242 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/pd-order-contacts.js +2 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/pd-order-summary.js +2 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/src/PdOrderContacts.js +192 -0
- package/dist/node_modules/@progressive-development/pd-order/dist/src/PdOrderSummary.js +243 -0
- package/dist/node_modules/@progressive-development/pd-page/pd-footer.js +2 -0
- package/dist/node_modules/@progressive-development/pd-page/pd-menu.js +2 -0
- package/dist/node_modules/@progressive-development/pd-page/src/PdFooter.js +141 -0
- package/dist/node_modules/@progressive-development/pd-page/src/PdMenu.js +450 -0
- package/dist/node_modules/@progressive-development/pd-shared-styles/src/shared-color-styles.js +30 -0
- package/dist/node_modules/@progressive-development/pd-shared-styles/src/shared-font-styles.js +32 -0
- package/dist/node_modules/@progressive-development/pd-wizard/pd-wizard.js +2 -0
- package/dist/node_modules/@progressive-development/pd-wizard/src/PdSteps.js +191 -0
- package/dist/node_modules/@progressive-development/pd-wizard/src/PdWizard.js +280 -0
- package/dist/node_modules/firebase/app/dist/esm/index.esm.js +35 -0
- package/dist/node_modules/idb/build/index.js +81 -0
- package/dist/node_modules/idb/build/wrap-idb-value.js +148 -0
- package/dist/node_modules/lit/node_modules/lit-html/directive.js +27 -0
- package/dist/node_modules/lit/node_modules/lit-html/directives/class-map.js +36 -0
- package/dist/node_modules/lit/node_modules/lit-html/lit-html.js +242 -0
- package/dist/node_modules/lit-element-router/lit-element-router.js +131 -0
- package/dist/node_modules/lit-element-router/utility/router-utility.js +36 -0
- package/dist/node_modules/mini-rx-store/index.esm.js +458 -0
- package/dist/node_modules/pwa-helpers/media-query.js +17 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/Observable.js +100 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js +147 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js +139 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/config.js +10 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/observable/innerFrom.js +159 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/operators/OperatorSubscriber.js +52 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/operators/catchError.js +28 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/operators/distinctUntilChanged.js +27 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/operators/filter.js +13 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/operators/map.js +13 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/operators/observeOn.js +26 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/operators/tap.js +36 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/operators/withLatestFrom.js +43 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js +18 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/symbol/iterator.js +11 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js +6 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js +14 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/args.js +10 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js +9 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js +13 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js +8 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/executeSchedule.js +23 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js +6 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/isArrayLike.js +6 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/isAsyncIterable.js +7 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js +6 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/isInteropObservable.js +8 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/isIterable.js +8 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/isPromise.js +7 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/isReadableStreamLike.js +46 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/lift.js +22 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js +5 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js +17 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js +11 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/throwUnobservableError.js +6 -0
- package/dist/node_modules/tslib/tslib.es6.js +240 -0
- package/dist/pd-panel-viewer.js +189 -0
- package/dist/pd-panel.js +51 -0
- package/dist/src/PdSpaHelper.js +319 -402
- package/dist/src/defaultpage/default-confirm-popup.js +61 -41
- package/dist/src/defaultpage/default-dialog-popup.js +74 -60
- package/dist/src/defaultpage/default-login.js +31 -20
- package/dist/src/defaultpage/default-popup.js +13 -10
- package/dist/src/defaultpage/default-step-address.js +52 -42
- package/dist/src/defaultpage/default-step-summary.js +58 -49
- package/dist/src/defaultpage/default-view-page.js +31 -23
- package/dist/src/defaultpage/default-wizard-step.js +119 -111
- package/dist/src/defaultpage/default-wizard.js +199 -195
- package/dist/src/generated/locale-wrapper/be-wrapper.js +14 -11
- package/dist/src/generated/locale-wrapper/de-wrapper.js +12 -9
- package/dist/src/generated/locale-wrapper/en-wrapper.js +14 -11
- package/dist/src/generated/locales/be.js +17 -19
- package/dist/src/generated/locales/de.js +17 -19
- package/dist/src/generated/locales/en.js +17 -19
- package/dist/src/helper/helper-utils.js +29 -24
- package/dist/src/model/spa-model.js +6 -3
- package/dist/src/popup/wizard-close-popup.js +37 -27
- package/dist/src/popup/wizard-reload-popup.js +35 -23
- package/dist/src/router/AppMain.js +23 -12
- package/dist/src/service-provider/firebase/auth.js +50 -73
- package/dist/src/service-provider/firebase/firestorage-client.js +194 -243
- package/dist/src/service-provider/firebase/firestore-client.js +19 -25
- package/dist/src/service-provider/firebase/functions-client.js +27 -59
- package/dist/src/service-provider/firebase/messagingFirebaseClient.js +60 -59
- package/dist/src/service-provider/mock/auth.js +54 -54
- package/dist/src/service-provider/mock/function-client.js +28 -27
- package/dist/src/service-provider/mock/storage-client.js +86 -92
- package/dist/src/service-provider/service-provider-impl.js +206 -211
- package/dist/src/service-provider/service-provider-model.js +1 -2
- package/dist/src/store/indexDB.js +133 -180
- package/dist/src/store/mini-rx.store.js +36 -38
- package/dist/src/store/spa-app-actions.js +27 -14
- package/dist/src/store/spa-app-effects.js +60 -40
- package/dist/src/store/spa-app-reducer.js +42 -33
- package/dist/src/store/spa-app-selector.js +31 -15
- package/dist/src/tmpown/pd-loading-state.js +49 -39
- package/dist/src/tmpown/pd-login.js +76 -67
- package/dist/src/tmpown/pd-toast.js +74 -65
- package/package.json +16 -13
- package/.editorconfig +0 -29
- package/.storybook/main.ts +0 -14
- package/.storybook/preview.ts +0 -15
- package/demo/index.html +0 -29
- package/dist/src/InitApplicationData.d.ts +0 -3
- package/dist/src/InitApplicationData.js +0 -8
- package/dist/src/InitApplicationData.js.map +0 -1
- package/dist/src/PdSpaHelper.d.ts +0 -93
- package/dist/src/PdSpaHelper.js.map +0 -1
- package/dist/src/defaultpage/default-confirm-popup.d.ts +0 -19
- package/dist/src/defaultpage/default-confirm-popup.js.map +0 -1
- package/dist/src/defaultpage/default-dialog-popup.d.ts +0 -16
- package/dist/src/defaultpage/default-dialog-popup.js.map +0 -1
- package/dist/src/defaultpage/default-login.d.ts +0 -8
- package/dist/src/defaultpage/default-login.js.map +0 -1
- package/dist/src/defaultpage/default-popup.d.ts +0 -7
- package/dist/src/defaultpage/default-popup.js.map +0 -1
- package/dist/src/defaultpage/default-step-address.d.ts +0 -19
- package/dist/src/defaultpage/default-step-address.js.map +0 -1
- package/dist/src/defaultpage/default-step-summary.d.ts +0 -30
- package/dist/src/defaultpage/default-step-summary.js.map +0 -1
- package/dist/src/defaultpage/default-view-page.d.ts +0 -9
- package/dist/src/defaultpage/default-view-page.js.map +0 -1
- package/dist/src/defaultpage/default-wizard-step.d.ts +0 -34
- package/dist/src/defaultpage/default-wizard-step.js.map +0 -1
- package/dist/src/defaultpage/default-wizard.d.ts +0 -33
- package/dist/src/defaultpage/default-wizard.js.map +0 -1
- package/dist/src/firebase/auth.d.ts +0 -4
- package/dist/src/firebase/auth.js +0 -28
- package/dist/src/firebase/auth.js.map +0 -1
- package/dist/src/firebase/firestore-client.d.ts +0 -9
- package/dist/src/firebase/firestore-client.js +0 -19
- package/dist/src/firebase/firestore-client.js.map +0 -1
- package/dist/src/firebase/functions-client.d.ts +0 -34
- package/dist/src/firebase/functions-client.js +0 -70
- package/dist/src/firebase/functions-client.js.map +0 -1
- package/dist/src/generated/locale-codes.d.ts +0 -13
- package/dist/src/generated/locale-codes.js +0 -25
- package/dist/src/generated/locale-codes.js.map +0 -1
- package/dist/src/generated/locale-wrapper/be-wrapper.d.ts +0 -1
- package/dist/src/generated/locale-wrapper/be-wrapper.js.map +0 -1
- package/dist/src/generated/locale-wrapper/de-wrapper.d.ts +0 -15
- package/dist/src/generated/locale-wrapper/de-wrapper.js.map +0 -1
- package/dist/src/generated/locale-wrapper/en-wrapper.d.ts +0 -1
- package/dist/src/generated/locale-wrapper/en-wrapper.js.map +0 -1
- package/dist/src/generated/locales/be.d.ts +0 -15
- package/dist/src/generated/locales/be.js.map +0 -1
- package/dist/src/generated/locales/de.d.ts +0 -15
- package/dist/src/generated/locales/de.js.map +0 -1
- package/dist/src/generated/locales/en.d.ts +0 -15
- package/dist/src/generated/locales/en.js.map +0 -1
- package/dist/src/helper/helper-utils.d.ts +0 -5
- package/dist/src/helper/helper-utils.js.map +0 -1
- package/dist/src/index.d.ts +0 -22
- package/dist/src/index.js +0 -33
- package/dist/src/index.js.map +0 -1
- package/dist/src/model/spa-model.d.ts +0 -16
- package/dist/src/model/spa-model.js.map +0 -1
- package/dist/src/pd-spa-helper.d.ts +0 -0
- package/dist/src/pd-spa-helper.js +0 -5
- package/dist/src/pd-spa-helper.js.map +0 -1
- package/dist/src/popup/wizard-close-popup.d.ts +0 -10
- package/dist/src/popup/wizard-close-popup.js.map +0 -1
- package/dist/src/popup/wizard-reload-popup.d.ts +0 -13
- package/dist/src/popup/wizard-reload-popup.js.map +0 -1
- package/dist/src/router/AppMain.d.ts +0 -6
- package/dist/src/router/AppMain.js.map +0 -1
- package/dist/src/service-call-controller2.d.ts +0 -16
- package/dist/src/service-call-controller2.js +0 -43
- package/dist/src/service-call-controller2.js.map +0 -1
- package/dist/src/service-provider/firebase/auth.d.ts +0 -14
- package/dist/src/service-provider/firebase/auth.js.map +0 -1
- package/dist/src/service-provider/firebase/firestorage-client.d.ts +0 -20
- package/dist/src/service-provider/firebase/firestorage-client.js.map +0 -1
- package/dist/src/service-provider/firebase/firestore-client.d.ts +0 -11
- package/dist/src/service-provider/firebase/firestore-client.js.map +0 -1
- package/dist/src/service-provider/firebase/functions-client.d.ts +0 -9
- package/dist/src/service-provider/firebase/functions-client.js.map +0 -1
- package/dist/src/service-provider/firebase/messagingFirebaseClient.d.ts +0 -8
- package/dist/src/service-provider/firebase/messagingFirebaseClient.js.map +0 -1
- package/dist/src/service-provider/mock/auth.d.ts +0 -5
- package/dist/src/service-provider/mock/auth.js.map +0 -1
- package/dist/src/service-provider/mock/function-client.d.ts +0 -8
- package/dist/src/service-provider/mock/function-client.js.map +0 -1
- package/dist/src/service-provider/mock/storage-client.d.ts +0 -10
- package/dist/src/service-provider/mock/storage-client.js.map +0 -1
- package/dist/src/service-provider/service-provider-impl.d.ts +0 -21
- package/dist/src/service-provider/service-provider-impl.js.map +0 -1
- package/dist/src/service-provider/service-provider-model.d.ts +0 -136
- package/dist/src/service-provider/service-provider-model.js.map +0 -1
- package/dist/src/store/indexDB.d.ts +0 -27
- package/dist/src/store/indexDB.js.map +0 -1
- package/dist/src/store/mini-rx.store.d.ts +0 -4
- package/dist/src/store/mini-rx.store.js.map +0 -1
- package/dist/src/store/spa-app-actions.d.ts +0 -104
- package/dist/src/store/spa-app-actions.js.map +0 -1
- package/dist/src/store/spa-app-effects.d.ts +0 -23
- package/dist/src/store/spa-app-effects.js.map +0 -1
- package/dist/src/store/spa-app-reducer.d.ts +0 -9
- package/dist/src/store/spa-app-reducer.js.map +0 -1
- package/dist/src/store/spa-app-selector.d.ts +0 -6
- package/dist/src/store/spa-app-selector.js.map +0 -1
- package/dist/src/stories/Button.d.ts +0 -27
- package/dist/src/stories/Button.js +0 -20
- package/dist/src/stories/Button.js.map +0 -1
- package/dist/src/stories/Button.stories.d.ts +0 -9
- package/dist/src/stories/Button.stories.js +0 -41
- package/dist/src/stories/Button.stories.js.map +0 -1
- package/dist/src/stories/Header.d.ts +0 -12
- package/dist/src/stories/Header.js +0 -44
- package/dist/src/stories/Header.js.map +0 -1
- package/dist/src/stories/Header.stories.d.ts +0 -7
- package/dist/src/stories/Header.stories.js +0 -17
- package/dist/src/stories/Header.stories.js.map +0 -1
- package/dist/src/stories/Page.d.ts +0 -12
- package/dist/src/stories/Page.js +0 -61
- package/dist/src/stories/Page.js.map +0 -1
- package/dist/src/stories/Page.stories.d.ts +0 -7
- package/dist/src/stories/Page.stories.js +0 -19
- package/dist/src/stories/Page.stories.js.map +0 -1
- package/dist/src/stories/pd-loading-state.stories.d.ts +0 -30
- package/dist/src/stories/pd-loading-state.stories.js +0 -153
- package/dist/src/stories/pd-loading-state.stories.js.map +0 -1
- package/dist/src/stories/pd-toast.stories.d.ts +0 -23
- package/dist/src/stories/pd-toast.stories.js +0 -34
- package/dist/src/stories/pd-toast.stories.js.map +0 -1
- package/dist/src/tmpown/pd-loading-state.d.ts +0 -9
- package/dist/src/tmpown/pd-loading-state.js.map +0 -1
- package/dist/src/tmpown/pd-login.d.ts +0 -14
- package/dist/src/tmpown/pd-login.js.map +0 -1
- package/dist/src/tmpown/pd-panel-viewer.d.ts +0 -18
- package/dist/src/tmpown/pd-panel-viewer.js +0 -188
- package/dist/src/tmpown/pd-panel-viewer.js.map +0 -1
- package/dist/src/tmpown/pd-panel.d.ts +0 -5
- package/dist/src/tmpown/pd-panel.js +0 -41
- package/dist/src/tmpown/pd-panel.js.map +0 -1
- package/dist/src/tmpown/pd-toast.d.ts +0 -12
- package/dist/src/tmpown/pd-toast.js.map +0 -1
- package/dist/stories/index.stories.d.ts +0 -33
- package/dist/stories/index.stories.js +0 -37
- package/dist/stories/index.stories.js.map +0 -1
- package/dist/test/pd-spa-helper.test.d.ts +0 -1
- package/dist/test/pd-spa-helper.test.js +0 -22
- package/dist/test/pd-spa-helper.test.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/index.d.ts +0 -15
- package/lit-localize.json +0 -15
- package/pd-spa-helper.iml +0 -9
- package/src/PdSpaHelper.ts +0 -619
- package/src/defaultpage/default-confirm-popup.ts +0 -78
- package/src/defaultpage/default-dialog-popup.ts +0 -105
- package/src/defaultpage/default-login.ts +0 -41
- package/src/defaultpage/default-popup.ts +0 -26
- package/src/defaultpage/default-step-address.ts +0 -57
- package/src/defaultpage/default-step-summary.ts +0 -88
- package/src/defaultpage/default-view-page.ts +0 -58
- package/src/defaultpage/default-wizard-step.ts +0 -142
- package/src/defaultpage/default-wizard.ts +0 -273
- package/src/generated/locale-codes.ts +0 -27
- package/src/generated/locale-wrapper/be-wrapper.ts +0 -13
- package/src/generated/locale-wrapper/de-wrapper.ts +0 -11
- package/src/generated/locale-wrapper/en-wrapper.ts +0 -13
- package/src/generated/locales/be.ts +0 -26
- package/src/generated/locales/de.ts +0 -26
- package/src/generated/locales/en.ts +0 -26
- package/src/helper/helper-utils.ts +0 -35
- package/src/index.ts +0 -66
- package/src/model/spa-model.ts +0 -20
- package/src/pd-spa-helper.ts +0 -3
- package/src/popup/wizard-close-popup.ts +0 -52
- package/src/popup/wizard-reload-popup.ts +0 -69
- package/src/router/AppMain.ts +0 -10
- package/src/service-call-controller2.ts +0 -68
- package/src/service-provider/firebase/auth.ts +0 -89
- package/src/service-provider/firebase/firestorage-client.ts +0 -327
- package/src/service-provider/firebase/firestore-client.ts +0 -40
- package/src/service-provider/firebase/functions-client.ts +0 -73
- package/src/service-provider/firebase/messagingFirebaseClient.ts +0 -102
- package/src/service-provider/mock/auth.ts +0 -86
- package/src/service-provider/mock/function-client.ts +0 -42
- package/src/service-provider/mock/storage-client.ts +0 -149
- package/src/service-provider/service-provider-impl.ts +0 -286
- package/src/service-provider/service-provider-model.ts +0 -163
- package/src/store/indexDB.ts +0 -244
- package/src/store/mini-rx.store.ts +0 -48
- package/src/store/spa-app-actions.ts +0 -36
- package/src/store/spa-app-effects.ts +0 -73
- package/src/store/spa-app-reducer.ts +0 -86
- package/src/store/spa-app-selector.ts +0 -41
- package/src/stories/pd-loading-state.stories.ts +0 -168
- package/src/stories/pd-toast.stories.ts +0 -43
- package/src/tmpown/pd-loading-state.ts +0 -177
- package/src/tmpown/pd-login.ts +0 -131
- package/src/tmpown/pd-panel-viewer.ts +0 -193
- package/src/tmpown/pd-panel.ts +0 -43
- package/src/tmpown/pd-toast.ts +0 -118
- package/test/pd-spa-helper.test.ts +0 -26
- package/tsconfig.json +0 -22
- package/web-dev-server.config.mjs +0 -27
- package/web-test-runner.config.mjs +0 -41
- package/xliff/be.xlf +0 -60
- package/xliff/de.xlf +0 -46
- package/xliff/en.xlf +0 -58
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { FirebaseApp } from 'firebase/app';
|
|
2
|
-
import { UploadResult } from "firebase/storage";
|
|
3
|
-
import { FileStorageConfig, StorageDocument, UploadFile } from '../service-provider-model.js';
|
|
4
|
-
/**
|
|
5
|
-
* During start/load application, initialize functions.
|
|
6
|
-
*
|
|
7
|
-
* @param {*} app - initialized app.
|
|
8
|
-
*/
|
|
9
|
-
export declare const initFirestorage: (app: FirebaseApp, defaultStorage?: string, storageConfig?: FileStorageConfig) => void;
|
|
10
|
-
export declare const uploadFirestorageFile: (file: UploadFile) => Promise<UploadResult>;
|
|
11
|
-
export declare const getFirestorageFile: (storageName: string, refKey: string, storageURI: string, includeMetaData?: boolean) => Promise<StorageDocument>;
|
|
12
|
-
export declare const getFirestorageFileList: (storageName: string, refKey: string, subFolder?: string, includeMetaData?: boolean) => Promise<StorageDocument[]>;
|
|
13
|
-
export declare const downloadFileFirestorage: (file: StorageDocument) => Promise<string>;
|
|
14
|
-
/**
|
|
15
|
-
* Löscht eine Datei in Firebase Storage basierend auf den Informationen im StorageDocument.
|
|
16
|
-
*
|
|
17
|
-
* @param deleteFile - Das StorageDocument-Objekt, das die zu löschende Datei beschreibt.
|
|
18
|
-
* @returns Ein Promise, das erfüllt wird, wenn die Datei gelöscht wurde, oder abgelehnt wird, wenn ein Fehler auftritt.
|
|
19
|
-
*/
|
|
20
|
-
export declare function deleteFirestorageDocument(deleteFile: StorageDocument): Promise<void>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"firestorage-client.js","sourceRoot":"","sources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ACpE;IAED,uDAAuD;IACvD,MAAM,SAAS,GAAG,GAAG,CAAC,WAAW,CAAC,OAAO,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IAEhE,IAAI;QACF,mBAAmB;QACnB,MAAM,YAAY,CAAC,SAAS,CAAC,CAAC;QAC9B,OAAO,CAAC,GAAG,CAAC,QAAQ,UAAU,CAAC,QAAQ,wBAAwB,CAAC,CAAC;KAClE;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,CAAC,KAAK,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAAC;QAC7C,MAAM,KAAK,CAAC;KACb;AACH,CAAC;AAGD,wFAAwF;AACxF;;;;;;;;;;;;;;;;;EAiBE","sourcesContent":["import { FirebaseApp } from 'firebase/app';\nimport { FirebaseStorage, FullMetadata, ListResult, StorageReference, UploadResult, deleteObject, getDownloadURL, getMetadata, getStorage, listAll, ref, uploadString } from \"firebase/storage\";\n\nimport { FileStorageConfig, StorageDocument, UploadFile } from '../service-provider-model.js';\nimport { getUser } from '../service-provider-impl.js';\n\nconst DEFAULT_STORAGE = \"default_storage\";\n\nconst storageMap:Map<string, { \n storage: FirebaseStorage,\n references?: {\n key: string,\n storageRef: StorageReference\n }[],\n}> = new Map();\n\n/**\n * During start/load application, initialize functions.\n *\n * @param {*} app - initialized app.\n */\nexport const initFirestorage = (\n app: FirebaseApp, \n defaultStorage?: string, \n storageConfig?: FileStorageConfig\n) => {\n try {\n\n // add default storage\n if (defaultStorage) {\n storageMap.set(DEFAULT_STORAGE, {\n storage: getStorage(app)\n });\n } \n \n // add specific storages\n storageConfig?.storage.forEach(storeConfig => {\n\n const storage = getStorage(app, storeConfig.name);\n const storageRootRef = ref(storage);\n\n storageMap.set(storeConfig.name, {\n storage,\n references: [\n {\n key: \"ROOT\",\n storageRef: storageRootRef\n },\n ...storeConfig.references.map(refConfigString => ({\n key: refConfigString,\n storageRef: ref(storageRootRef, refConfigString)\n }))\n ]\n });\n }); \n\n } catch (error) {\n console.error(error);\n }\n};\n\nexport const uploadFirestorageFile = (file: UploadFile):Promise<UploadResult> => { \n\n if (!storageMap || storageMap.size === 0) {\n throw new Error(\"No storage is configured\");\n } \n\n // get storage\n const {storageName, referenceKey, subFolderName, fileName} = file;\n const storageConf = storageMap.get(storageName || DEFAULT_STORAGE);\n if (!storageConf ) {\n throw new Error(`Invalid storage name: ${storageName || DEFAULT_STORAGE}`);\n } \n if (!storageConf.references || storageConf.references.length === 0) {\n throw new Error(`No references configured for storage: ${storageName || DEFAULT_STORAGE}`);\n }\n\n // get reference to path\n const uploadRefConf = referenceKey ? (storageConf.references.filter(filterRef => filterRef.key === referenceKey)[0]) : storageConf.references[0];\n if (!uploadRefConf || !uploadRefConf.storageRef) {\n throw new Error(`No valid reference for key: ${referenceKey}`);\n }\n\n // create file reference and upload\n const fileRef = ref(uploadRefConf.storageRef, subFolderName ? `${subFolderName}/${fileName}` : fileName);\n\n // default usefull metadata: contentType, size, timeCreated, updated\n\n // additional custom metadata\n const metadata = {\n customMetadata: {\n 'creator': (getUser() as any)?.displayName,\n 'comment': file.description,\n 'name': file.descriptionName,\n 'readonly': file.readonly ? \"true\" : \"false\",\n }\n };\n \n return uploadString(fileRef, file.base64DataURL, 'data_url', metadata);\n};\n\nconst fetchItemsAndFolders = async (\n usedRef: StorageReference,\n storageName: string,\n refKey: string,\n includeMetaData = false,\n includeFolder = false\n): Promise<StorageDocument[]> => {\n try {\n const itemRefs: StorageDocument[] = [];\n const metaPromises: Promise<FullMetadata>[] = [];\n \n // Hole alle Items und Folder direkt unter `usedRef`\n const res: ListResult = await listAll(usedRef);\n\n // Hilfsfunktion zur Verarbeitung der Metadaten\n const processMetadata = (item: StorageDocument, metadata: FullMetadata): StorageDocument => ({\n ...item,\n creation: new Date(metadata.timeCreated),\n documentType: metadata.contentType,\n creator: metadata.customMetadata?.creator,\n descriptionName: metadata.customMetadata?.name,\n description: metadata.customMetadata?.comment,\n size: metadata.size,\n readonly: metadata.customMetadata?.readonly === \"true\",\n metaData: metadata\n });\n \n // 1. Items direkt im usedRef-Ordner verarbeiten\n res.items.forEach((itemRef) => {\n itemRefs.push({\n fileName: itemRef.name,\n filePath: itemRef.fullPath,\n storageName,\n refKey\n });\n\n // Erzeuge die Metadaten-Promises direkt, wenn `includeMetaData` aktiv ist\n if (includeMetaData) {\n metaPromises.push(getMetadata(itemRef));\n }\n });\n\n // 2. Verarbeite alle Ordner direkt unter usedRef, falls includeFolder gesetzt ist\n if (includeFolder) {\n await Promise.all(\n res.prefixes.map(async (folderRef) => {\n const folderRes = await listAll(folderRef);\n folderRes.items.forEach((subItemRef) => {\n itemRefs.push({\n fileName: subItemRef.name,\n filePath: subItemRef.fullPath,\n storageName,\n refKey,\n subFolderName: folderRef.name\n });\n\n // Erzeuge Metadaten-Promises für die Ordner-Inhalte, wenn `includeMetaData` aktiv ist\n if (includeMetaData) {\n metaPromises.push(getMetadata(subItemRef));\n }\n });\n })\n );\n }\n\n // 3. Falls `includeMetaData`, warte auf alle Metadaten und ordne sie den `itemRefs` zu\n if (includeMetaData) {\n const metaResults = await Promise.all(metaPromises);\n return itemRefs.map((item, index) => processMetadata(item, metaResults[index]));\n }\n \n return itemRefs; // Rückgabe ohne Metadaten, falls nicht angefordert\n } catch (error) {\n console.error(\"Error during file and folder listing:\", error);\n throw error;\n }\n}\n\n// Funktion, um `StorageDocument` von einer `storageURI` zu erstellen\nexport const getFirestorageFile = async (\n storageName: string, \n refKey:string,\n storageURI: string,\n includeMetaData = false\n): Promise<StorageDocument> => {\n try {\n \n if (!storageMap || storageMap.size === 0) {\n throw new Error(\"No storage is configured\");\n }\n \n // get storage \n const storageConf = storageMap.get(storageName);\n if (!storageConf ) {\n throw new Error(`Invalid storage name: ${storageName}`);\n } \n const storageRef = ref(storageConf.storage, storageURI);\n\n // Basis-StorageDocument ohne Metadaten\n const storageDocument: StorageDocument = {\n fileName: storageRef.name,\n filePath: storageRef.fullPath,\n storageName,\n refKey,\n };\n\n // Falls Metadaten angefordert, lade und füge sie hinzu\n if (includeMetaData) {\n const metadata = await getMetadata(storageRef);\n\n return {\n ...storageDocument,\n creation: new Date(metadata.timeCreated),\n documentType: metadata.contentType,\n creator: metadata.customMetadata?.creator,\n descriptionName: metadata.customMetadata?.name,\n description: metadata.customMetadata?.comment,\n size: metadata.size,\n readonly: metadata.customMetadata?.readonly === \"true\",\n metaData: metadata\n };\n }\n\n return storageDocument; // Rückgabe ohne Metadaten\n } catch (error) {\n console.error(\"Error creating StorageDocument:\", error);\n throw error;\n }\n};\n\nexport const getFirestorageFileList = (\n storageName: string, \n refKey: string, \n subFolder?: string,\n includeMetaData?: boolean\n):Promise<StorageDocument[]> => { \n\n if (!storageMap || storageMap.size === 0) {\n throw new Error(\"No storage is configured\");\n }\n\n // get storage \n const storageConf = storageMap.get(storageName);\n if (!storageConf ) {\n throw new Error(`Invalid storage name: ${storageName}`);\n } \n if (!storageConf.references || storageConf.references.length === 0) {\n throw new Error(`No references configured for storage: ${storageName || DEFAULT_STORAGE}`);\n }\n\n // get refrence\n const storageRef = storageConf.references.filter(refIt => refIt.key === refKey)[0];\n if (!storageRef) {\n throw new Error(`No reference available for storage: ${storageName || DEFAULT_STORAGE} and ref: ${refKey}`);\n }\n\n const usedRef = subFolder ? ref(storageRef.storageRef, subFolder) : storageRef.storageRef; \n return fetchItemsAndFolders(usedRef, storageName, refKey, includeMetaData, true);\n};\n\n\nexport const downloadFileFirestorage = (file: StorageDocument) => {\n\n if (!storageMap || storageMap.size === 0) {\n throw new Error(\"No storage is configured\");\n }\n\n // get storage \n const storageConf = storageMap.get(file.storageName);\n if (!storageConf ) {\n throw new Error(`Invalid storage name: ${file.storageName}`);\n } \n const usedRef = ref(storageConf.storage, file.filePath);\n return getDownloadURL(usedRef);\n}\n\n/**\n * Löscht eine Datei in Firebase Storage basierend auf den Informationen im StorageDocument.\n *\n * @param deleteFile - Das StorageDocument-Objekt, das die zu löschende Datei beschreibt.\n * @returns Ein Promise, das erfüllt wird, wenn die Datei gelöscht wurde, oder abgelehnt wird, wenn ein Fehler auftritt.\n */\nexport async function deleteFirestorageDocument(deleteFile: StorageDocument): Promise<void> {\n if (!deleteFile.filePath) {\n throw new Error(\"File path is required to delete a document.\");\n }\n\n // Hole die Storage-Konfiguration basierend auf dem storageName\n const storageConf = storageMap.get(deleteFile.storageName);\n if (!storageConf) {\n throw new Error(`Invalid storage name: ${deleteFile.storageName}`);\n }\n\n // Erstelle eine Referenz zur Datei in Firebase Storage\n const deleteRef = ref(storageConf.storage, deleteFile.filePath);\n\n try {\n // Lösche die Datei\n await deleteObject(deleteRef);\n console.log(`File ${deleteFile.fileName} successfully deleted.`);\n } catch (error) {\n console.error(\"Error deleting file:\", error);\n throw error;\n }\n}\n\n\n/* Firestorage Error List: https://firebase.google.com/docs/storage/web/handle-errors */\n/* \nstorage/unknown\tAn unknown error occurred.\nstorage/object-not-found\tNo object exists at the desired reference.\nstorage/bucket-not-found\tNo bucket is configured for Cloud Storage\nstorage/project-not-found\tNo project is configured for Cloud Storage\nstorage/quota-exceeded\tQuota on your Cloud Storage bucket has been exceeded. If you're on the no-cost tier, upgrade to a paid plan. If you're on a paid plan, reach out to Firebase support.\nstorage/unauthenticated\tUser is unauthenticated, please authenticate and try again.\nstorage/unauthorized\tUser is not authorized to perform the desired action, check your security rules to ensure they are correct.\nstorage/retry-limit-exceeded\tThe maximum time limit on an operation (upload, download, delete, etc.) has been excceded. Try uploading again.\nstorage/invalid-checksum\tFile on the client does not match the checksum of the file received by the server. Try uploading again.\nstorage/canceled\tUser canceled the operation.\nstorage/invalid-event-name\tInvalid event name provided. Must be one of [`running`, `progress`, `pause`]\nstorage/invalid-url\tInvalid URL provided to refFromURL(). Must be of the form: gs://bucket/object or https://firebasestorage.googleapis.com/v0/b/bucket/o/object?token=<TOKEN>\nstorage/invalid-argument\tThe argument passed to put() must be `File`, `Blob`, or `UInt8` Array. The argument passed to putString() must be a raw, `Base64`, or `Base64URL` string.\nstorage/no-default-bucket\tNo bucket has been set in your config's storageBucket property.\nstorage/cannot-slice-blob\tCommonly occurs when the local file has changed (deleted, saved again, etc.). Try uploading again after verifying that the file hasn't changed.\nstorage/server-file-wrong-size\n*/"]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { FirebaseApp } from 'firebase/app';
|
|
2
|
-
import { Firestore } from 'firebase/firestore';
|
|
3
|
-
import { CollectionContraint } from '../service-provider-model';
|
|
4
|
-
/**
|
|
5
|
-
* During start/load application, initialize functions.
|
|
6
|
-
*
|
|
7
|
-
* @param {*} app - initialized app.
|
|
8
|
-
*/
|
|
9
|
-
export declare const initFirestore: (app: FirebaseApp) => void;
|
|
10
|
-
export declare const getDB: () => Firestore;
|
|
11
|
-
export declare const getFirebaseCollectionListener: (callback: Function, col: string, constraints?: CollectionContraint[]) => import("@firebase/firestore").Unsubscribe;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"firestore-client.js","sourceRoot":"","sources":["../../../../src/service-provider/firebase/firestore-client.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,UAAU,EAAa,YAAY,EAAE,UAAU,EAAE,KAAK,EAAmB,KAAK,EAAC,MAAM,oBAAoB,CAAC;AAElH,2CAA2C;AAE3C,IAAI,EAAY,CAAC;AAEjB;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,GAAgB,EAAE,EAAE;IAChD,IAAI;QACF,iBAAiB;QACjB,EAAE,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;KACxB;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;KACtB;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAG,GAAa,EAAE,CAAC,EAAE,CAAC;AAExC,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAC3C,QAAkB,EAClB,GAAW,EACX,WAAkC,EAClC,EAAE;IACF,MAAM,gBAAgB,GACpB,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;QACnC,IAAI,UAAU,CAAC,IAAI,KAAK,OAAO,EAAE;YAC/B,OAAO,KAAK,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,KAAK,CAAC,CAAA;SACtE;QACD,MAAM,IAAI,KAAK,CAAC,2BAA2B,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;IACL,MAAM,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,GAAG,gBAAgB,CAAC,CAAC;IAC1D,OAAO,UAAU,CAAC,CAAC,EAAE,CAAC,aAAa,EAAE,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC;AACnE,CAAC,CAAA","sourcesContent":["import { FirebaseApp } from 'firebase/app';\nimport {collection, Firestore, getFirestore, onSnapshot, query, QueryConstraint, where} from 'firebase/firestore';\nimport { CollectionContraint } from '../service-provider-model';\n// import { getAuth } from 'firebase/auth';\n\nlet db:Firestore;\n\n/**\n * During start/load application, initialize functions.\n *\n * @param {*} app - initialized app.\n */\nexport const initFirestore = (app: FirebaseApp) => {\n try {\n // init db access\n db = getFirestore(app);\n } catch (error) {\n console.error(error);\n }\n};\n\nexport const getDB = ():Firestore => db;\n\nexport const getFirebaseCollectionListener = (\n callback: Function, \n col: string, \n constraints?:CollectionContraint[]\n) => {\n const queryConstraints:QueryConstraint[] = \n (constraints || []).map(constraint => {\n if (constraint.type === \"where\") {\n return where(constraint.field, constraint.operator, constraint.value)\n }\n throw new Error(`Unkown constraint type: ${constraint.type}`);\n });\n const q = query(collection(db, col), ...queryConstraints);\n return onSnapshot(q, (querySnapshot) => callback(querySnapshot));\n}\n\n \n"]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { FirebaseApp } from "firebase/app";
|
|
2
|
-
import { FunctionDefinition, FunctionResult, FunctionsConfig } from "../service-provider-model.js";
|
|
3
|
-
/**
|
|
4
|
-
* During start/load application, initialize functions.
|
|
5
|
-
*
|
|
6
|
-
* @param {*} app - initialized app.
|
|
7
|
-
*/
|
|
8
|
-
export declare const initFunctions: (app: FirebaseApp, functionsConfig: FunctionsConfig) => void;
|
|
9
|
-
export declare const callFunction: (def: FunctionDefinition, functionInput: any) => Promise<FunctionResult>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"functions-client.js","sourceRoot":"","sources":["../../../../src/service-provider/firebase/functions-client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAiB,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGhF,MAAM,WAAW,GAAG,IAAI,GAAsC,CAAC;AAE/D;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,GAAgB,EAAE,eAAgC,EAAE,EAAE;IAClF,IAAI;QACA,8CAA8C;QAC9C,MAAM,SAAS,GAAG,YAAY,CAAC,GAAG,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;QAE5D,2BAA2B;QAC3B,eAAe,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YACvC,WAAW,CAAC,GAAG,CAAC,IAAI,EAAE,aAAa,CAAC,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC7D,CAAC,CAAC,CAAC;KAEN;IAAC,OAAO,KAAK,EAAE;QACZ,OAAO,CAAC,KAAK,CAAC,8BAA8B,EAAE,KAAK,CAAC,CAAC;KACxD;AACH,CAAC,CAAA;AAED,MAAM,oBAAoB,GAAG,KAAK,EAAE,GAAuB,EAAE,aAAkB,EAA2B,EAAE;IAC1G,MAAM,OAAO,GAAG,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACrC,IAAI,OAAO,EAAE;QACX,MAAM,UAAU,GAAO,MAAM,OAAO,CAAC,aAAa,CAAC,CAAC;QACpD,IAAI,UAAU;eACP,UAAU,CAAC,IAAI,IAAI,GAAG,CAAC,YAAY,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE;YAC/E,OAAO,UAAU,CAAC,IAAsB,CAAC;SAC1C;QAED,IAAI,UAAU,IAAI,UAAU,CAAC,IAAI,EAAE;YACjC,MAAM,IAAI,KAAK,CAAC,UAAU,UAAU,CAAC,IAAI,CAAC,UAAU,MAAM,UAAU,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;SACzF;QAED;;;;;;;;;;;;;;;;;;;;;;;;;UAyBE;KACH;IACD,OAAO,CAAC,GAAG,CAAC,4BAA4B,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;IACpD,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;AACvE,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,EAAE,GAAuB,EAAE,aAAkB,EAA2B,EAAE,CACzG,oBAAoB,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC","sourcesContent":["import { FirebaseApp } from \"firebase/app\";\nimport { getFunctions, HttpsCallable, httpsCallable } from \"firebase/functions\";\nimport { FunctionDefinition, FunctionResult, FunctionsConfig } from \"../service-provider-model.js\";\n\nconst functionMap = new Map<FunctionDefinition, HttpsCallable>;\n\n/**\n * During start/load application, initialize functions. \n * \n * @param {*} app - initialized app. \n */\nexport const initFunctions = (app: FirebaseApp, functionsConfig: FunctionsConfig) => {\n try {\n // Initialize cloud functions through Firebase\n const functions = getFunctions(app, functionsConfig.region);\n\n // Initialize functions map\n functionsConfig.functions.forEach(func => {\n functionMap.set(func, httpsCallable(functions, func.name));\n });\n\n } catch (error) {\n console.error(\"ToDo: Error programmieren...\", error);\n }\n}\n\nconst internalCallFunction = async (def: FunctionDefinition, functionInput: any): Promise<FunctionResult> => {\n const funcRef = functionMap.get(def); \n if (funcRef) { \n const funcResult:any = await funcRef(functionInput);\n if (funcResult \n && funcResult.data && def.successCodes.includes(funcResult.data.statusCode)) {\n return funcResult.data as FunctionResult;\n }\n\n if (funcResult && funcResult.data) {\n throw new Error(`Error: ${funcResult.data.statusCode} - ${funcResult.data.resultData}`);\n }\n\n /*\n const ne = new Error(\"Invalid result\");\n if (result.data) {\n // Read result of the Cloud Function. \n switch (result.data.statusCode) {\n case 200:\n return resolve(result.data.projects);\n default:\n ne.data = result.data;\n return reject(ne);\n }\n } else {\n return reject(ne);\n }\n })\n .catch((error) => {\n // Getting the Error details.\n const {code} = error;\n const {message} = error;\n const {details} = error;\n\n console.warn(\"Error occured: \", code, message, details);\n console.warn(\"Error: \", error);\n return reject(error);\n })\n */\n } \n console.log(\"No function available for \", def.name);\n throw new Error(\"Illegal state, no data with right state available\");\n}\n\nexport const callFunction = async (def: FunctionDefinition, functionInput: any): Promise<FunctionResult> => \n internalCallFunction(def, functionInput); \n \n"]}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { FirebaseApp } from "firebase/app";
|
|
2
|
-
import { Messaging } from "firebase/messaging";
|
|
3
|
-
import { MessagingConfig } from "../service-provider-model.js";
|
|
4
|
-
export declare const NOTIFICATION_TOKEN = "pd.spa.helper.notification.token";
|
|
5
|
-
export declare function prepareMessaging(app: FirebaseApp, messageConfig: MessagingConfig): void;
|
|
6
|
-
export declare const activateTokenChangeHandler: (appName: string) => void;
|
|
7
|
-
export declare const registerDevice: (registration: ServiceWorkerRegistration) => Promise<void>;
|
|
8
|
-
export declare const getFirebaseMessaging: () => Messaging;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"messagingFirebaseClient.js","sourceRoot":"","sources":["../../../../src/service-provider/firebase/messagingFirebaseClient.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAa,MAAM,oBAAoB,CAAC;AAIvE,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEjE,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAE,0BAA0B,EAA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IAAI,WAAW,KAAK,YAAY,EAAE;YAChC,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;YAC3C,OAAO,EAAE,CAAC,QAAQ,CAAC,0BAA0B,CAAC;gBAC5C,cAAc,EAAE,YAAY;aAC7B,CAAC,CAAC,CAAC;SACL;aAAM;YACL,OAAO,CAAC,GAAG,CAAC,uCAAuC,CAAC,CAAC;SACtD;KACF;SAAM;QACL,OAAO,CAAC,IAAI,CAAC,iDAAiD,CAAC,CAAC;KACjE;AACH,CAAC,CAAA;AAGD,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,EACjC,YAAuC,EACvC,EAAE;IAEF,OAAO,CAAC,GAAG,CAAC,sDAAsD,CAAC,CAAC;IAEpE,+DAA+D;IAC/D,IAAI,YAAY,CAAC,UAAU,KAAK,SAAS,EAAE;QACzC,iDAAiD;QACjD,MAAM,YAAY,CAAC,iBAAiB,EAAE,CAAC;KACxC;IAED,yDAAyD;IACzD,IAAI,YAAY,CAAC,UAAU,KAAK,SAAS,EAAE;QACzC,sDAAsD;QACtD,MAAM,gBAAgB,CAAC,YAAY,CAAC,CAAC;KACtC;IAED,6BAA6B;IAC7B,IAAI,YAAY,CAAC,UAAU,KAAK,QAAQ,EAAE;QACxC,OAAO,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC;KACxD;AAEH,CAAC,CAAA;AAGD,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,EAAE,CAAC,SAAS,CAAC","sourcesContent":["import { FirebaseApp } from \"firebase/app\";\nimport { getMessaging, getToken, Messaging } from \"firebase/messaging\";\nimport { User } from \"firebase/auth\";\n\nimport { MessagingConfig } from \"../service-provider-model.js\";\nimport { update, USER_COLLECTION } from '../../store/indexDB.js';\n\nimport { pdStore } from \"../../store/mini-rx.store.js\";\nimport { updateNewNotificationToken } from \"../../store/spa-app-actions.js\";\nimport { authIdTokenStateChanged } from \"./auth.js\";\n\n\nexport const NOTIFICATION_TOKEN = \"pd.spa.helper.notification.token\";\n\nlet messaging: Messaging;\nlet firebaseMessagingAppConfigKey: MessagingConfig;\n\n\nexport function prepareMessaging(\n app: FirebaseApp,\n messageConfig: MessagingConfig\n) {\n messaging = getMessaging(app);\n firebaseMessagingAppConfigKey = messageConfig;\n}\n\nexport const activateTokenChangeHandler = (appName:string) => { \n authIdTokenStateChanged(async (user:User) => {\n if (user) {\n const token = await user.getIdToken();\n if (token) {\n await update(USER_COLLECTION, {\n id: appName,\n userNameToken: user.displayName,\n userIdToken: token,\n });\n console.log('UserToken stored in local db');\n }\n }\n });\n}\n\nconst initMessageToken = async (\n registration: ServiceWorkerRegistration\n) => {\n \n if (!messaging || !firebaseMessagingAppConfigKey || !registration) {\n throw new Error(\"Messaging, Registration or Key not available\");\n }\n\n // get token from cache or network\n const currentToken = await getToken(\n messaging, \n {\n vapidKey: firebaseMessagingAppConfigKey.apidKey,\n serviceWorkerRegistration: registration\n }\n );\n\n if (currentToken) {\n const storedToken = localStorage.getItem(NOTIFICATION_TOKEN);\n if (storedToken !== currentToken) { \n console.log(\"Update new token in Backend\");\n pdStore().dispatch(updateNewNotificationToken({\n messagingToken: currentToken\n }));\n } else {\n console.log(\"RegisterDevice: Stored token is valid\");\n }\n } else {\n console.warn(\"No token received - no new token was generated.\");\n }\n}\n\n\nexport const registerDevice = async (\n registration: ServiceWorkerRegistration\n) => {\n\n console.log(\"Start registering app for messages and notifications\");\n\n // Noch keine Berechtigung erteilt, diese vom Benutzer abfragen\n if (Notification.permission === \"default\") {\n // TODO: Manually triggered with user information\n await Notification.requestPermission();\n } \n \n // Berechtigung erteilt, Gerät für messaging registrieren\n if (Notification.permission === \"granted\") {\n // FCM-Token abrufen, wenn online oder lokal verfügbar\n await initMessageToken(registration);\n }\n\n // Keine Berechtigung erteilt\n if (Notification.permission === \"denied\") {\n console.warn(\"Messaging not possible, missing rights\");\n }\n \n}\n\n\nexport const getFirebaseMessaging = () => messaging;"]}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare const logoutMock: () => Promise<boolean>;
|
|
2
|
-
export declare const isAuthenticatedMock: () => boolean;
|
|
3
|
-
export declare const getAuthUserMock: () => unknown;
|
|
4
|
-
export declare const authStateChangedMock: (callback: Function) => void;
|
|
5
|
-
export declare const loginMock: (user: string, sec: string) => Promise<unknown>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../../src/service-provider/mock/auth.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAC9B,MAAM,mBAAmB,GAAG,aAAa,CAAC;AAC1C,MAAM,cAAc,GAAG,wBAAwB,CAAC;AAChD,MAAM,aAAa,GAAG,MAAM,CAAC;AAI7B,IAAI,cAAmC,CAAC;AAGxC,MAAM,eAAe,GAAG,GAAG,EAAE;IAC3B,MAAM,QAAQ,GAAI,YAAY,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC5D,OAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B,CAAC,CAAA;AAGD,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,IAAsB,EAAE;IACrD,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAC9B,cAAc,GAAG,SAAS,CAAC;IAC3B,IAAI,gBAAgB,EAAE;QAClB,YAAY,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC;KAChD;IACD,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAY,EAAE;IAC/C,IAAI,cAAc,KAAK,SAAS,EAAE;QAChC,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;QAC1C,cAAc,GAAG,gBAAgB,CAAC,CAAC,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;KAC/D;IACD,OAAO,cAAc,CAAC;AACxB,CAAC,CAAA;AAED,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store/mini-rx.store\";\n\n/*\n * Only for temporary development:\n * Set to true/false if the user should hold only in session (login after each reload)\n * or in the localstore (login until the local store entry is invalid or not available).\n */\nconst LOCALSTORE_ACTIV = true;\nconst LOCALSTORE_ITEM_KEY = 'pdUserLogin';\nconst HARDCODED_USER = 'mock@pd-spa-helper.com';\nconst HARDCODED_PWD = 'mock';\n\n\n\nlet loginAvailable: boolean | undefined;\n\n\nconst checkLocalStore = () => {\n const userItem = localStorage.getItem(LOCALSTORE_ITEM_KEY);\n return userItem === 'true';\n}\n\n\nexport const logoutMock = async (): Promise<boolean> => {\n console.log(\"Do MOCK logout\");\n loginAvailable = undefined;\n if (LOCALSTORE_ACTIV) {\n localStorage.removeItem(LOCALSTORE_ITEM_KEY);\n }\n return Promise.resolve(true);\n};\n\nexport const isAuthenticatedMock = (): boolean => {\n if (loginAvailable === undefined) {\n console.log('MOCK: check authentication');\n loginAvailable = LOCALSTORE_ACTIV ? checkLocalStore() : false;\n }\n return loginAvailable;\n} \n\nexport const getAuthUserMock = (): unknown => \n isAuthenticatedMock() ? {\n uid: \"34234234\",\n displayName: \"userMockName\"\n } : undefined;\n\n\nlet callbackLogin: Function;\nexport const authStateChangedMock = (callback: Function) => {\n callbackLogin = callback;\n console.log(\"Not implemented for MOCK, do call once if authenticated\");\n if (isAuthenticatedMock()) {\n callbackLogin(getAuthUserMock())\n }\n}\n\nexport const loginMock = async (user:string, sec:string): Promise<unknown> => { \n\n console.log('MOCK: do authentication for user: ', user);\n let valid = false;\n if (user === HARDCODED_USER && sec === HARDCODED_PWD) {\n if (LOCALSTORE_ACTIV) {\n localStorage.setItem(LOCALSTORE_ITEM_KEY, 'true');\n }\n valid = true;\n loginAvailable = true; \n }\n\n if (valid) {\n\n const userMock = getAuthUserMock();\n if (callbackLogin) {\n callbackLogin(userMock)\n }\n return Promise.resolve(user); \n }\n\n const err = new Error(\"Invalid login\");\n const error: any = err;\n error.code = \"auth/wrong-password\";\n throw error;\n}\n\n\n\n\n"]}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { FunctionDefinition, FunctionResult } from "../service-provider-model.js";
|
|
2
|
-
declare let mockResponse: Map<string, Function>;
|
|
3
|
-
export declare const callFunctionMock: (def: FunctionDefinition, functionInput: any) => Promise<FunctionResult>;
|
|
4
|
-
export declare const initMockResponse: (mock?: {
|
|
5
|
-
mockResponse?: Map<string, Function>;
|
|
6
|
-
mockWaitTime?: number;
|
|
7
|
-
}) => void;
|
|
8
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"function-client.js","sourceRoot":"","sources":["../../../../src/service-provider/mock/function-client.ts"],"names":[],"mappings":"AAEA,MAAM,eAAe,GAAG,IAAI,CAAC;AAE7B,IAAI,YAAmC,CAAC;AACxC,IAAI,WAAW,GAAG,eAAe,CAAC;AAIlC,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,EAAE,GAAuB,EAAE,aAAkB,EAA2B,EAAE;IAE7G,IAAI,GAAG,CAAC;IACR,IAAI,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,SAAS,EAAE;QAC5B,GAAG,GAAG,GAAG,GAAG,CAAC,IAAI,IAAI,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,MAAM,YAAY,CAAC;KACxD;SAAM,IAAI,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,IAAI,EAAE;QAC5B,GAAG,GAAG,GAAG,GAAG,CAAC,IAAI,IAAI,aAAa,CAAC,MAAM,IAAI,aAAa,CAAC,IAAI,EAAE,CAAC;KACrE;SAAM;QACL,GAAG,GAAG,GAAG,GAAG,CAAC,IAAI,IAAI,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,MAAM,EAAE,CAAC;KAC9C;IACD,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,GAAG,EAAE,aAAa,EAAE,GAAG,CAAC,CAAC;IAE3D,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC1C,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE;YACrB,OAAO,CAAC,MAAM,CAAC,CAAC;QAClB,CAAC,EAAE,WAAW,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;IACL,MAAM,OAAO,EAAE,CAAC;IAEhB,IAAI,YAAY,IAAI,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;QACzC,OAAO,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,CAAE,CAAC,aAAa,CAAC,CAAC,CAAC;KAC/D;IAED,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;AACxD,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,IAG9B,EAAE,EAAE;IACL,YAAY,GAAG,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,YAAY,KAAI,IAAI,GAAG,EAAE,CAAC;IAC/C,WAAW,GAAG,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,YAAY,KAAI,eAAe,CAAC;AACtD,CAAC,CAAA","sourcesContent":["import { FunctionDefinition, FunctionResult } from \"../service-provider-model.js\";\n\nconst DEFAULT_TIMEOUT = 2000;\n\nlet mockResponse: Map<string, Function>;\nlet mockTimeout = DEFAULT_TIMEOUT;\n\n\n\nexport const callFunctionMock = async (def: FunctionDefinition, functionInput: any): Promise<FunctionResult> => {\n \n let key;\n if (functionInput?.detailsId) {\n key = `${def.name}_${functionInput?.object}_detailsId`;\n } else if (functionInput?.type) {\n key = `${def.name}_${functionInput.object}_${functionInput.type}`;\n } else {\n key = `${def.name}_${functionInput?.object}`;\n }\n console.log(\"Mock function call\", def, functionInput, key);\n\n const timeout = () => new Promise((resolve) => {\n window.setTimeout(() => {\n resolve(\"Done\");\n }, mockTimeout);\n });\n await timeout();\n\n if (mockResponse && mockResponse.has(key)) { \n return Promise.resolve(mockResponse.get(key)!(functionInput));\n }\n\n throw new Error(\"No data with right state available\");\n}\n\nexport const initMockResponse = (mock?: {\n mockResponse?: Map<string, Function>, \n mockWaitTime?: number\n }) => {\n mockResponse = mock?.mockResponse || new Map();\n mockTimeout = mock?.mockWaitTime || DEFAULT_TIMEOUT;\n}"]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { FileStorageConfig, StorageDocument, UploadFile } from '../service-provider-model.js';
|
|
2
|
-
/**
|
|
3
|
-
* During start/load application, initialize functions.
|
|
4
|
-
*
|
|
5
|
-
* @param {*} app - initialized app.
|
|
6
|
-
*/
|
|
7
|
-
export declare const initStorageMock: (defaultStorage?: string, storageConfig?: FileStorageConfig) => void;
|
|
8
|
-
export declare const uploadStorageFileMock: (file: UploadFile) => Promise<any>;
|
|
9
|
-
export declare const downloadFileMock: (file: StorageDocument) => Promise<string>;
|
|
10
|
-
export declare const getMockFileList: (storageName: string, refKey: string, subFolder?: string, includeMetadata?: boolean) => Promise<StorageDocument[]>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"storage-client.js","sourceRoot":"","sources":["../../../../src/service-provider/mock/storage-client.ts"],"names":[],"mappings":"AAGA,MAAM,eAAe,GAAG,iBAAiB,CAAC;AAG1C,uCAAuC;AACvC,MAAM,YAAY,GAAG,CAAC,MAAmB,EAAE,EAAE;IAC3C,MAAM,IAAI,GAAS,IAAI,IAAI,CAAC,CAAC,MAAM,CAAC,EAAE;QAClC,IAAI,EAAE,WAAW;KACpB,CAAC,CAAC;IACH,MAAM,GAAG,GAAE,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IAC5C,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACnB,CAAC,CAAA;AAED,MAAM,mBAAmB,GAAG,CAAC,MAAa,EAAE,EAAE;IAC5C,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,wBAAwB,EAAE,EAAE,CAAC,CAAC;IAC1D,MAAM,YAAY,GAAG,IAA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,CAAC,GAAG,KAAK,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IACjJ,IAAI,CAAC,aAAa,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE;QAC/C,MAAM,IAAI,KAAK,CAAC,+BAA+B,YAAY,EAAE,CAAC,CAAC;KAChE;IAED,mCAAmC;IACnC,MAAM,OAAO,GAAG,GAAG,aAAa,CAAC,UAAU,IAAI,aAAa,CAAC,CAAC,CAAC,GAAG,aAAa,IAAI,QAAQ,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC3G,OAAO,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AACvD,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,IAAqB,EAAE,EAAE;IACxD,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAClC,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;AAC7B,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,WAAmB,EACnB,MAAc,EACd,SAAkB,EAClB,eAAyB,EACE,EAAE;IAC7B,OAAO,CAAC,GAAG,CAAC,6BAA6B,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,CAAC,CAAC;IAC5F,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC;YACtB,QAAQ,EAAE,gBAAgB;YAC1B,QAAQ,EAAE,0CAA0C;YACpD,YAAY,EAAE,MAAM;YACpB,WAAW,EAAE,MAAM;SACpB,CAAC,CAAC,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { FileStorageConfig, StorageDocument, UploadFile } from '../service-provider-model.js';\n\n\nconst DEFAULT_STORAGE = \"default_storage\";\n\n\n// Download file in mock implementation\nconst downloadFile = (buffer: ArrayBuffer) => {\n const data: Blob = new Blob([buffer], {\n type: 'image/png'\n });\n const url= window.URL.createObjectURL(data);\n window.open(url);\n}\n\nconst base64ToArrayBuffer = (base64:string) => {\n const test = base64.replace(\"data:image/png;base64,\", \"\");\n const binaryString = atob(test);\n const bytes = new Uint8Array(binaryString.length);\n for (let i = 0; i < binaryString.length; i+=1) {\n bytes[i] = binaryString.charCodeAt(i);\n }\n return bytes.buffer;\n}\n\n\n\n\nclass MockStorage {\n\n private _name: string;\n\n constructor(storageName: string) {\n this._name = storageName;\n }\n\n // eslint-disable-next-line class-methods-use-this\n uploadFile(filePath: string, file: UploadFile): Promise<any> {\n \n downloadFile(base64ToArrayBuffer(file.base64DataURL));\n\n return Promise.resolve({\n fullPath: filePath\n });\n }\n\n}\n\nconst storageMap:Map<string, { \n storage: MockStorage,\n references?: {\n key: string,\n storageRef: string\n }[],\n}> = new Map();\n\n/**\n * During start/load application, initialize functions.\n *\n * @param {*} app - initialized app.\n */\nexport const initStorageMock = (defaultStorage?: string, storageConfig?: FileStorageConfig) => {\n console.log(\"Init mock Storage\");\n try {\n\n // add default storage\n if (defaultStorage) {\n storageMap.set(DEFAULT_STORAGE, {\n storage: new MockStorage(DEFAULT_STORAGE)\n });\n } \n \n // add specific storages\n storageConfig?.storage.forEach(storeConfig => {\n\n const storage = new MockStorage(storeConfig.name);\n const storageRootRef = \"/\";\n\n storageMap.set(storeConfig.name, {\n storage,\n references: [\n {\n key: \"ROOT\",\n storageRef: storageRootRef\n },\n ...storeConfig.references.map(refConfigString => ({\n key: refConfigString,\n storageRef: `${storageRootRef}/${refConfigString}`\n }))\n ]\n });\n }); \n\n } catch (error) {\n console.error(error);\n }\n};\n\n\nexport const uploadStorageFileMock = (file: UploadFile):Promise<any> => { \n\n if (!storageMap || storageMap.size === 0) {\n throw new Error(\"No storage is configured\");\n } \n\n // get storage\n const {storageName, referenceKey, subFolderName, fileName} = file;\n const storageConf = storageMap.get(storageName || DEFAULT_STORAGE);\n if (!storageConf ) {\n throw new Error(`Invalid storage name: ${storageName || DEFAULT_STORAGE}`);\n } \n if (!storageConf.references || storageConf.references.length === 0) {\n throw new Error(`No references configured for storage: ${storageName || DEFAULT_STORAGE}`);\n }\n\n // get reference to path\n const uploadRefConf = referenceKey ? (storageConf.references.filter(filterRef => filterRef.key === referenceKey)[0]) : storageConf.references[0];\n if (!uploadRefConf || !uploadRefConf.storageRef) {\n throw new Error(`No valid reference for key: ${referenceKey}`);\n }\n\n // create file reference and upload\n const fileRef = `${uploadRefConf.storageRef}/${subFolderName ? `${subFolderName}/${fileName}` : fileName}`; \n return storageConf.storage.uploadFile(fileRef, file);\n};\n\nexport const downloadFileMock = (file: StorageDocument) => {\n alert(\"Not implemented for mock\");\n return Promise.resolve(\"\");\n}\n\nexport const getMockFileList = (\n storageName: string, \n refKey: string,\n subFolder?: string,\n includeMetadata?: boolean\n):Promise<StorageDocument[]> => {\n console.log(\"Searching for Documents in \", storageName, refKey, subFolder, includeMetadata);\n return Promise.resolve([{\n fileName: \"workReport.png\",\n filePath: \"workReports/1234234f2fswf/workReport.png\",\n documentType: \"ToDo\",\n storageName, refKey\n }]);\n};\n\n\n\n\n"]}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { FirebaseApp } from "firebase/app";
|
|
2
|
-
import { AppConfiguration, CollectionContraint, FunctionDefinition, FunctionResult, ServiceProviderConfiguration, StorageDocument, UploadFile } from "./service-provider-model.js";
|
|
3
|
-
import { ServiceCallController } from "../service-call-controller2.js";
|
|
4
|
-
export declare const setServiceProvider: (providerParam?: ServiceProviderConfiguration) => void;
|
|
5
|
-
export declare const initController: (controllerParam: ServiceCallController) => void;
|
|
6
|
-
export declare const initAppImpl: (config: AppConfiguration) => void;
|
|
7
|
-
export declare const callFunctionImpl: (def: FunctionDefinition, functionInput: any) => Promise<FunctionResult>;
|
|
8
|
-
export declare const authStateChangedImpl: (callback: Function) => void;
|
|
9
|
-
export declare const isAuthenticatedImpl: () => boolean;
|
|
10
|
-
export declare const loginImpl: (user: string, sec: string) => Promise<unknown>;
|
|
11
|
-
export declare const logoutImpl: () => Promise<boolean>;
|
|
12
|
-
export declare const getUser: () => unknown;
|
|
13
|
-
export declare const uploadFile: (file: UploadFile) => Promise<unknown>;
|
|
14
|
-
export declare const getStorageFileList: (storageName: string, keyRef: string, subFolder?: string, includeMetadata?: boolean) => Promise<StorageDocument[]>;
|
|
15
|
-
export declare const getStorageFile: (storageName: string, refKey: string, storageURI: string, includeMetaData: boolean) => Promise<StorageDocument>;
|
|
16
|
-
export declare const downloadFile: (file: StorageDocument) => Promise<unknown>;
|
|
17
|
-
export declare const deleteFile: (file: StorageDocument) => Promise<unknown>;
|
|
18
|
-
export declare const activateCollectionListener: (callback: Function, col: string, constraints?: CollectionContraint[]) => "" | import("@firebase/firestore").Unsubscribe;
|
|
19
|
-
export declare const registerAppDeviceForNotification: (registration: ServiceWorkerRegistration) => Promise<void>;
|
|
20
|
-
export declare const getMessagingImpl: () => import("@firebase/messaging").Messaging | undefined;
|
|
21
|
-
export declare const getApp: () => FirebaseApp;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"service-provider-impl.js","sourceRoot":"","sources":["../../../src/service-provider/service-provider-impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,aAAa,EAAE,MAAM,cAAc,CAAC;AAE1D,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,QAAQ,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC7G,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,mBAAmB,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAKnH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EAAE,6BAA6B,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC9F,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE/E,OAAO,EAAE,yBAAy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AA2D,CAAC,CAAC;QACzE,OAAO,EAAE,CAAC;KACX;IACD,OAAO,2BAA2B,EAAE,CAAC;AACvC,CAAC,CAAC;AAGF;;+CAE+C;AAC/C,MAAM,CAAC,MAAM,gCAAgC,GAAG,KAAK,EACnD,YAAuC,EACvC,EAAE;IACF,IAAI,QAAQ,KAAK,UAAU,EAAE;QAC3B,OAAO,cAAc,CAAC,YAAY,CAAC,CAAC;KACrC;IACD,IAAI,QAAQ,KAAK,MAAM,EAAE;QACvB,OAAO,CAAC,GAAG,CAAC,sEAAsE,CAAC,CAAC;QACpF,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;KAC1B;IACD,OAAO,2BAA2B,EAAE,CAAC;AACvC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACnC,IAAI,QAAQ,KAAK,UAAU,EAAE;QAC3B,OAAO,oBAAoB,EAAE,CAAC;KAC/B;IACD,IAAI,QAAQ,KAAK,MAAM,EAAE;QACvB,OAAO,CAAC,GAAG,CAAC,sDAAsD,CAAC,CAAC;QACpE,OAAO,SAAS,CAAC;KAClB;IACD,OAAO,2BAA2B,EAAE,CAAC;AACvC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC","sourcesContent":["import { FirebaseApp, initializeApp } from \"firebase/app\";\n\nimport { authStateChanged, getAuthUser, initAuth, isAuthenticated, login, logout } from \"./firebase/auth.js\";\nimport { authStateChangedMock, getAuthUserMock, isAuthenticatedMock, loginMock, logoutMock } from \"./mock/auth.js\";\nimport { \n AppConfiguration, CollectionContraint, FunctionDefinition, FunctionResult, \n ServiceProviderConfiguration, StorageDocument, UploadFile \n} from \"./service-provider-model.js\";\nimport { callFunction, initFunctions } from \"./firebase/functions-client.js\";\nimport { getFirebaseCollectionListener, initFirestore } from \"./firebase/firestore-client.js\";\nimport { callFunctionMock, initMockResponse } from \"./mock/function-client.js\";\nimport { ServiceCallController } from \"../service-call-controller2.js\";\nimport { deleteFirestorageDocument, downloadFileFirestorage, getFirestorageFile, getFirestorageFileList, initFirestorage, uploadFirestorageFile } from \"./firebase/firestorage-client.js\";\nimport { downloadFileMock, getMockFileList, initStorageMock, uploadStorageFileMock } from \"./mock/storage-client.js\";\nimport { activateTokenChangeHandler, getFirebaseMessaging, prepareMessaging, registerDevice } from \"./firebase/messagingFirebaseClient.js\";\n\nlet provider: ServiceProviderConfiguration | undefined;\nlet controller: ServiceCallController;\nlet app:FirebaseApp;\n\nconst throwUndefinedProviderError = () => {\n throw new Error(\"Undefined service provider, please check configuration. 'firebase' or 'mock' allowed here.\");\n}\n\n/* #####################\n * Init Implementation\n * ##################### */\n\nexport const setServiceProvider = (providerParam?: ServiceProviderConfiguration) => {\n provider = providerParam;\n}\n\nexport const initController = (controllerParam: ServiceCallController) => {\n controller = controllerParam\n}\n\nconst initFirebaseApplicationServices = (\n firebaseApp: FirebaseApp,\n config: AppConfiguration\n) => {\n \n // ToDo: Init only of needed\n initAuth(firebaseApp);\n initFirestore(firebaseApp);\n\n if (config.functionsConfig) {\n initFunctions(firebaseApp, config.functionsConfig);\n console.debug(\"Init provider functions\");\n }\n\n if (config.firebaseConfig?.storageBucket && config.storageConfig) {\n initFirestorage(\n firebaseApp, \n config.firebaseConfig?.storageBucket, \n config.storageConfig\n );\n console.debug(\"Init provider storage\");\n }\n\n if (config.messagingConfig) {\n prepareMessaging(firebaseApp, config.messagingConfig);\n console.debug(\"Set firebase app and config for messaging\");\n\n activateTokenChangeHandler(firebaseApp.name);\n console.debug(`idTokenChangeHandler for messaging and app ${firebaseApp.name} activated`);\n }\n\n console.debug(\"Firebase initialized\"); \n}\n\nexport const initAppImpl = (config: AppConfiguration) => {\n\n if (provider === \"firebase\" && config.firebaseConfig) {\n app = initializeApp(config.firebaseConfig); \n // init application services (functions, store) \n initFirebaseApplicationServices(\n app, \n config\n );\n } else if (provider === \"mock\") {\n initMockResponse(config.mock);\n initStorageMock(\"default\", config.storageConfig);\n } else {\n throwUndefinedProviderError();\n }\n}\n\n/* #####################\n * Functions Implementation\n * ##################### */\nexport const callFunctionImpl = async (def: FunctionDefinition, functionInput: any): Promise<FunctionResult> => {\n \n const callController = (promise: Promise<any>) => {\n if (controller) {\n controller.callDataPromise = {func: def, promise};\n }\n }\n \n if (provider === \"firebase\") {\n const promise = callFunction(def, functionInput)\n callController(promise);\n return promise;\n } \n if (provider === \"mock\") {\n const promise = callFunctionMock(def, functionInput)\n callController(promise);\n return promise;\n }\n\n return throwUndefinedProviderError(); \n}\n\n\n\n/* #####################\n * Auth Implementation\n * ##################### */\n\n\nexport const authStateChangedImpl = (\n callback: Function\n) => {\n if (provider === \"firebase\") {\n authStateChanged(callback);\n } else if (provider === \"mock\") {\n authStateChangedMock(callback);\n } else {\n throwUndefinedProviderError();\n }\n}\n\nexport const isAuthenticatedImpl = () => {\n if (provider === \"firebase\") {\n return isAuthenticated();\n } \n if (provider === \"mock\") {\n return isAuthenticatedMock();\n } \n return throwUndefinedProviderError(); \n}\n\nexport const loginImpl = (user: string, sec: string) => {\n\n if (!user) { \n const returnError = new Error(\"empty user\");\n return Promise.reject(returnError);\n }\n if (!sec) {\n const returnError = new Error(\"empty password\");\n return Promise.reject(returnError);\n }\n\n if (provider === \"firebase\") {\n return login(user, sec);\n } \n if (provider === \"mock\") {\n return loginMock(user, sec);\n } \n return throwUndefinedProviderError(); \n}\n\nexport const logoutImpl = () => {\n if (provider === \"firebase\") {\n return logout();\n } \n if (provider === \"mock\") {\n return logoutMock();\n } \n return throwUndefinedProviderError(); \n};\n\n// Refactor: Return defined USer Object\nexport const getUser = () => {\n if (provider === \"firebase\") {\n return getAuthUser();\n } \n if (provider === \"mock\") {\n return getAuthUserMock();\n } \n return throwUndefinedProviderError(); \n}\n\n/* #####################\n * Storage Implementation\n * ##################### */\nexport const uploadFile = (file: UploadFile): Promise<unknown> => { \n if (provider === \"firebase\") {\n return uploadFirestorageFile(file); \n } \n if (provider === \"mock\") {\n return uploadStorageFileMock(file)\n }\n return throwUndefinedProviderError(); \n}\n\nexport const getStorageFileList = (\n storageName: string, \n keyRef: string, \n subFolder?: string, \n includeMetadata?:boolean\n): Promise<StorageDocument[]> => { \n if (provider === \"firebase\") {\n return getFirestorageFileList(storageName, keyRef, subFolder, includeMetadata);\n }\n if (provider === \"mock\") {\n return getMockFileList(storageName, keyRef, subFolder, includeMetadata);\n }\n return throwUndefinedProviderError(); \n}\n\nexport const getStorageFile = ( \n storageName: string, \n refKey:string,\n storageURI: string,\n includeMetaData: boolean,\n): Promise<StorageDocument> => { \n if (provider === \"firebase\") {\n return getFirestorageFile(\n storageName, refKey, storageURI, includeMetaData \n );\n }\n return throwUndefinedProviderError(); \n}\n\nexport const downloadFile = (file: StorageDocument): Promise<unknown> => { \n if (provider === \"firebase\") {\n return downloadFileFirestorage(file);\n } \n if (provider === \"mock\") {\n return downloadFileMock(file)\n }\n return throwUndefinedProviderError(); \n}\n\nexport const deleteFile = (file: StorageDocument): Promise<unknown> => { \n if (provider === \"firebase\") {\n return deleteFirestorageDocument(file);\n }\n return throwUndefinedProviderError(); \n}\n\n/* #########################################\n * Remote Database Implementation\n * ######################################### */\nexport const activateCollectionListener = (\n callback: Function, col: string, constraints?:CollectionContraint[]\n) => { \n if (provider === \"firebase\") {\n return getFirebaseCollectionListener(callback, col, constraints);\n } \n if (provider === \"mock\") {\n console.log(\"getCollectionListener not implemented for MOCK, do noting\");\n return \"\";\n }\n return throwUndefinedProviderError();\n};\n\n\n/* #########################################\n * Messaging Implementation\n * ######################################### */\nexport const registerAppDeviceForNotification = async (\n registration: ServiceWorkerRegistration\n) => { \n if (provider === \"firebase\") {\n return registerDevice(registration);\n }\n if (provider === \"mock\") {\n console.log(\"registerAppDeviceForNotification not implemented for MOCK, do noting\");\n return Promise.resolve();\n }\n return throwUndefinedProviderError();\n};\n\nexport const getMessagingImpl = () => {\n if (provider === \"firebase\") {\n return getFirebaseMessaging();\n }\n if (provider === \"mock\") {\n console.log(\"getMessagingImpl not implemented for MOCK, do noting\");\n return undefined;\n }\n return throwUndefinedProviderError();\n};\n\nexport const getApp = () => app;\n"]}
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import { FirebaseOptions } from "firebase/app";
|
|
2
|
-
import { TemplateResult } from "lit";
|
|
3
|
-
/**
|
|
4
|
-
* Implemeted service provider
|
|
5
|
-
*/
|
|
6
|
-
export type ServiceProviderFirebase = "firebase";
|
|
7
|
-
export type ServiceProviderMock = "mock";
|
|
8
|
-
export type ServiceProviderConfiguration = ServiceProviderFirebase | ServiceProviderMock;
|
|
9
|
-
export interface FunctionResult {
|
|
10
|
-
resultData: unknown;
|
|
11
|
-
statusCode: number;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Function model.
|
|
15
|
-
*/
|
|
16
|
-
export interface FunctionDefinition {
|
|
17
|
-
name: string;
|
|
18
|
-
successCodes: Array<Number>;
|
|
19
|
-
fadeWindow: boolean;
|
|
20
|
-
successTxt: string | TemplateResult;
|
|
21
|
-
pendingTxt: string | TemplateResult;
|
|
22
|
-
param?: any;
|
|
23
|
-
redirect?: string;
|
|
24
|
-
logoutOnFail?: boolean;
|
|
25
|
-
}
|
|
26
|
-
export interface FunctionParam {
|
|
27
|
-
func: FunctionDefinition;
|
|
28
|
-
inputData: any;
|
|
29
|
-
}
|
|
30
|
-
export interface FunctionsConfig {
|
|
31
|
-
region: string;
|
|
32
|
-
functions: Array<FunctionDefinition>;
|
|
33
|
-
postLoginFunc?: FunctionDefinition;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* App data models.
|
|
37
|
-
*/
|
|
38
|
-
export interface MenuElement {
|
|
39
|
-
key: string;
|
|
40
|
-
name: string;
|
|
41
|
-
sec?: string;
|
|
42
|
-
route?: string;
|
|
43
|
-
action?: Function;
|
|
44
|
-
topItem?: boolean;
|
|
45
|
-
ref?: any;
|
|
46
|
-
icon?: string;
|
|
47
|
-
}
|
|
48
|
-
export interface NavigationPage {
|
|
49
|
-
name: string;
|
|
50
|
-
mainClass?: string;
|
|
51
|
-
pattern: Array<string>;
|
|
52
|
-
auth: boolean;
|
|
53
|
-
menu?: Array<MenuElement>;
|
|
54
|
-
topMenu?: Array<MenuElement>;
|
|
55
|
-
withTeaser?: boolean;
|
|
56
|
-
withFooter?: boolean;
|
|
57
|
-
hideMenu?: boolean;
|
|
58
|
-
hideTopMenu?: boolean;
|
|
59
|
-
topMenuItems?: Array<MenuElement>;
|
|
60
|
-
}
|
|
61
|
-
export interface NavigationConfig {
|
|
62
|
-
pages: Array<NavigationPage>;
|
|
63
|
-
includeLogin: boolean;
|
|
64
|
-
}
|
|
65
|
-
export interface LinkObj {
|
|
66
|
-
name: string;
|
|
67
|
-
key: string;
|
|
68
|
-
link?: string;
|
|
69
|
-
action?: Function;
|
|
70
|
-
}
|
|
71
|
-
export interface Footer {
|
|
72
|
-
version: string;
|
|
73
|
-
copyright?: string;
|
|
74
|
-
links: Array<LinkObj>;
|
|
75
|
-
}
|
|
76
|
-
export interface StoreConfig {
|
|
77
|
-
appName: string;
|
|
78
|
-
reducer: any;
|
|
79
|
-
effects: Array<any>;
|
|
80
|
-
}
|
|
81
|
-
export interface FileStorage {
|
|
82
|
-
name: string;
|
|
83
|
-
references: string[];
|
|
84
|
-
}
|
|
85
|
-
export interface FileStorageConfig {
|
|
86
|
-
storage: FileStorage[];
|
|
87
|
-
}
|
|
88
|
-
export interface MessagingConfig {
|
|
89
|
-
apidKey: string;
|
|
90
|
-
}
|
|
91
|
-
export interface AppConfiguration {
|
|
92
|
-
serviceProvider?: ServiceProviderConfiguration;
|
|
93
|
-
mock?: {
|
|
94
|
-
mockResponse?: Map<string, Function>;
|
|
95
|
-
mockWaitTime?: number;
|
|
96
|
-
};
|
|
97
|
-
navigationConfigParam: NavigationConfig;
|
|
98
|
-
storeConfigParam?: StoreConfig;
|
|
99
|
-
firebaseConfig?: FirebaseOptions;
|
|
100
|
-
storageConfig?: FileStorageConfig;
|
|
101
|
-
functionsConfig?: FunctionsConfig;
|
|
102
|
-
messagingConfig?: MessagingConfig;
|
|
103
|
-
}
|
|
104
|
-
export interface UploadFile {
|
|
105
|
-
fileName: string;
|
|
106
|
-
base64DataURL: string;
|
|
107
|
-
descriptionName: string;
|
|
108
|
-
description: string;
|
|
109
|
-
storageName: string;
|
|
110
|
-
referenceKey: string;
|
|
111
|
-
subFolderName?: string;
|
|
112
|
-
readonly?: boolean;
|
|
113
|
-
}
|
|
114
|
-
export interface StorageMetadata {
|
|
115
|
-
}
|
|
116
|
-
export interface StorageDocument {
|
|
117
|
-
storageName: string;
|
|
118
|
-
refKey: string;
|
|
119
|
-
fileName: string;
|
|
120
|
-
filePath: string;
|
|
121
|
-
subFolderName?: string;
|
|
122
|
-
documentType?: string;
|
|
123
|
-
description?: string;
|
|
124
|
-
descriptionName?: string;
|
|
125
|
-
creation?: Date;
|
|
126
|
-
creator?: string;
|
|
127
|
-
size?: number;
|
|
128
|
-
readonly?: boolean;
|
|
129
|
-
metaData?: StorageMetadata;
|
|
130
|
-
}
|
|
131
|
-
export interface CollectionContraint {
|
|
132
|
-
type: "where";
|
|
133
|
-
field: string;
|
|
134
|
-
operator: "<" | ">" | ">=" | "<=" | "==" | "!=" | "array-contains" | "array-contains-any" | "in" | "not-in";
|
|
135
|
-
value: any;
|
|
136
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"service-provider-model.js","sourceRoot":"","sources":["../../../src/service-provider/service-provider-model.ts"],"names":[],"mappings":"","sourcesContent":["import { FirebaseOptions } from \"firebase/app\";\nimport { TemplateResult } from \"lit\";\n\n\n/**\n * Implemeted service provider\n */\nexport type ServiceProviderFirebase = \"firebase\";\nexport type ServiceProviderMock = \"mock\";\nexport type ServiceProviderConfiguration = ServiceProviderFirebase | ServiceProviderMock;\n\n\nexport interface FunctionResult {\n resultData: unknown,\n statusCode: number,\n}\n\n/**\n * Function model.\n */\n\nexport interface FunctionDefinition {\n name: string,\n successCodes: Array<Number>, \n // Fade window during function call (true) or show only background infos (false).\n fadeWindow: boolean,\n successTxt: string | TemplateResult,\n pendingTxt: string | TemplateResult,\n param?: any,\n redirect?: string,\n logoutOnFail?: boolean,\n}\n\nexport interface FunctionParam {\n func: FunctionDefinition,\n inputData: any,\n}\n\nexport interface FunctionsConfig {\n region: string, // 'europe-west3'\n functions: Array<FunctionDefinition>,\n postLoginFunc?: FunctionDefinition,\n}\n\n\n/**\n * App data models.\n */\n\nexport interface MenuElement {\n key: string,\n name: string,\n sec?: string,\n route?: string,\n action?: Function,\n topItem?: boolean,\n ref?: any,\n icon?: string,\n}\n\nexport interface NavigationPage {\n name: string,\n mainClass?: string,\n pattern: Array<string>, \n auth: boolean,\n menu?: Array<MenuElement>,\n topMenu?: Array<MenuElement>,\n withTeaser?: boolean,\n withFooter?: boolean\n hideMenu?: boolean\n hideTopMenu?: boolean\n topMenuItems?: Array<MenuElement>,\n}\n\nexport interface NavigationConfig {\n pages: Array<NavigationPage>,\n includeLogin: boolean\n}\n\nexport interface LinkObj {\n name: string,\n key: string,\n link?: string,\n action?: Function\n}\n\nexport interface Footer {\n version: string,\n copyright?: string,\n links: Array<LinkObj>\n}\n\n\nexport interface StoreConfig {\n appName: string,\n reducer: any,\n effects: Array<any>\n}\n\nexport interface FileStorage {\n name: string,\n references: string[] \n}\n\nexport interface FileStorageConfig {\n storage: FileStorage[],\n}\n\nexport interface MessagingConfig {\n apidKey: string; \n}\n\nexport interface AppConfiguration { \n serviceProvider?: ServiceProviderConfiguration,\n mock?: {\n mockResponse?: Map<string, Function>,\n mockWaitTime?: number,\n }\n navigationConfigParam: NavigationConfig;\n storeConfigParam?: StoreConfig;\n firebaseConfig?: FirebaseOptions;\n storageConfig?: FileStorageConfig;\n functionsConfig?: FunctionsConfig;\n messagingConfig?: MessagingConfig;\n}\n\nexport interface UploadFile { \n fileName: string, \n base64DataURL:string,\n descriptionName:string,\n description:string,\n storageName: string\n referenceKey: string\n subFolderName?: string,\n readonly?: boolean,\n}\n\nexport interface StorageMetadata {\n\n}\n\nexport interface StorageDocument {\n storageName: string, \n refKey: string, \n fileName: string, \n filePath: string,\n subFolderName?: string,\n documentType?: string, \n description?:string, \n descriptionName?: string,\n creation?:Date,\n creator?:string,\n size?: number,\n readonly?: boolean,\n metaData?: StorageMetadata\n}\n\nexport interface CollectionContraint {\n type: \"where\",\n field: string,\n operator: \"<\" | \">\" | \">=\" | \"<=\" | \"==\" | \"!=\" | \"array-contains\" | \"array-contains-any\" | \"in\" | \"not-in\",\n value: any,\n}"]}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export declare const USER_COLLECTION = "dcInternalUser";
|
|
2
|
-
export declare const add: <T>(table: string, el: T, ignoreDuplicates: boolean) => Promise<unknown>;
|
|
3
|
-
export declare const update: <T>(table: string, el: T) => Promise<unknown>;
|
|
4
|
-
export declare const updateAll: <T>(table: string, elArray: T[]) => Promise<unknown>;
|
|
5
|
-
export declare const addAll: <T>(table: string, elArray: T[], ignoreDuplicates: boolean) => Promise<unknown>;
|
|
6
|
-
export declare const deleteAllEl: (table: string, elIdArray: string[]) => Promise<unknown>;
|
|
7
|
-
export declare const get: <T>(table: string, id: string) => Promise<T>;
|
|
8
|
-
export declare const getAll: <T>(table: string, index?: string) => Promise<T[]>;
|
|
9
|
-
export declare const getAllIds: (table: string) => Promise<unknown>;
|
|
10
|
-
export declare const deleteAll: (table: string) => Promise<unknown>;
|
|
11
|
-
export declare const removeDatabase: (dbName: string) => Promise<unknown>;
|
|
12
|
-
/**
|
|
13
|
-
* Init indexDB for application.
|
|
14
|
-
*
|
|
15
|
-
* @param config - config for index db
|
|
16
|
-
* @param successCallback - callback function after db is successfully initialized
|
|
17
|
-
*/
|
|
18
|
-
export declare const initDB: (config: {
|
|
19
|
-
dbName: string;
|
|
20
|
-
dbVersion: number;
|
|
21
|
-
collections: {
|
|
22
|
-
name: string;
|
|
23
|
-
collectionConf: {
|
|
24
|
-
keyPath?: string;
|
|
25
|
-
};
|
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C,CAAC,IAAI,CAAC,EAAE;4BACzC,EAAE,CAAC,iBAAiB,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,cAAc,CAAC,CAAC;yBAChD;oBACH,CAAC,CAAC,CAAC;aACN;QACH,CAAC,CAAC;KACH;AACH,CAAC,CAAC","sourcesContent":["// use version import to initialize modul\n\nimport { pdStore } from \"./mini-rx.store\";\nimport { initIndexDBSucess } from \"./spa-app-actions.js\";\n\nexport const USER_COLLECTION = \"dcInternalUser\";\n\nconst {indexedDB} = window;\nlet db:any;\n\n/*\nEine kurze Verzögerung eingebaut.\n\nFehler im Chrome (einmal, sonst nicht) => Vorher logout durch USerSync (user nicht da).\nUpgrade needed IDBVersionChangeEvent {isTrusted: true, oldVersion: 0, newVersion: 2, dataLoss: \"none\", dataLossMessage: \"\",}\nindexDB2.js:190 Error during background initialize DOMException: Failed to execute 'transaction' on 'IDBDatabase': A version change transaction is running.\n at http://localhost:8000/src/js/indexDB2.js:32:24\n at new Promise (<anonymous>)\n at add (http://localhost:8000/src/js/indexDB2.js:31:46)\n at addBackground (http://localhost:8000/src/js/indexDB2.js:203:38)\n at http://localhost:8000/src/js/indexDB2.js:143:26\n\n*/\n\nexport const add = <T>(table: string, el: T, ignoreDuplicates: boolean) =>\n new Promise((resolve, reject) => {\n const request = db\n .transaction([table], 'readwrite')\n .objectStore(table)\n .add(el);\n request.onsuccess = () => resolve(request.result);\n request.onerror = (event: any) => {\n if (event.target.error.code === 0 && ignoreDuplicates) {\n return resolve('duplicate');\n }\n console.warn('Unable to add data!', event, el);\n return reject(event.target.error);\n };\n });\n\nexport const update = <T>(table: string, el: T) =>\n new Promise((resolve, reject) => {\n const request = db\n .transaction([table], 'readwrite')\n .objectStore(table)\n .put(el);\n request.onsuccess = () => resolve(request.result);\n request.onerror = (event: any) => {\n console.warn('Unable to put data!', event, el);\n return reject(event.target.error);\n };\n }); \n\nexport const updateAll = <T>(table: string, elArray: T[]) =>\n new Promise((resolve, reject) => {\n const promises: unknown[] = [];\n elArray.forEach(el => {\n promises.push(update<T>(table, el));\n });\n\n return Promise.all(promises)\n .then(resArr => resolve(resArr))\n .catch(e => reject(e));\n });\n\n\nexport const addAll = <T>(table: string, elArray: T[], ignoreDuplicates: boolean) =>\n new Promise((resolve, reject) => {\n const promises: unknown[] = [];\n elArray.forEach(el => {\n promises.push(<T>add(table, el, ignoreDuplicates));\n });\n\n return Promise.all(promises)\n .then(resArr => resolve(resArr))\n .catch(e => reject(e));\n });\n\n\nconst deleteEl = (table: string, id: string) =>\n new Promise((resolve, reject) => {\n const request = db\n .transaction([table], 'readwrite')\n .objectStore(table)\n .delete(id);\n\n request.onsuccess = () => resolve(request.result);\n request.onerror = (e: any) => reject(e);\n }); \n\n\nexport const deleteAllEl = (table: string, elIdArray: string[]) =>\n new Promise((resolve, reject) => {\n const promises: unknown[] = [];\n elIdArray.forEach(elId => {\n promises.push(deleteEl(table, elId));\n });\n\n return Promise.all(promises)\n .then(resArr => resolve(resArr))\n .catch(e => reject(e));\n }); \n\n\nexport const get = <T>(table: string, id: string): Promise<T> =>\n new Promise((resolve, reject) => {\n const request = db.transaction([table]).objectStore(table).get(id);\n request.onsuccess = () => resolve(request.result);\n request.onerror = (e: any) => reject(e);\n });\n\nexport const getAll = <T>(table: string, index?: string): Promise<T[]> =>\n new Promise((resolve, reject) => {\n const request = index\n ? db\n .transaction([table], 'readonly')\n .objectStore(table)\n .index(index)\n .openCursor()\n : db.transaction([table], 'readonly').objectStore(table).openCursor();\n // CHECK: getAll => https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore \n const res: T[] = [];\n request.onsuccess = function (event: any) {\n const cursor = event.target.result;\n if (cursor) {\n // cursor.value contains the current record being iterated through\n // this is where you'd do something with the result\n res.push(cursor.value);\n cursor.continue();\n } else {\n // no more results\n resolve(res);\n }\n };\n request.onerror = (e: any) => reject(e);\n });\n\nexport const getAllIds = (table: string) => \n new Promise((resolve, reject) => {\n const request = db.transaction([table], 'readonly').objectStore(table).openCursor();\n // CHECK: getAll => https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore \n const res: unknown[] = [];\n request.onsuccess = function (event: any) {\n const cursor = event.target.result;\n if (cursor) {\n // cursor.value contains the current record being iterated through\n // this is where you'd do something with the result\n res.push(cursor.value.id);\n cursor.continue();\n } else {\n // no more results\n resolve(res);\n }\n };\n request.onerror = (e: any) => reject(e);\n });\n\n\nexport const deleteAll = (table: string) =>\n new Promise((resolve, reject) => {\n const request = db\n .transaction([table], 'readwrite')\n .objectStore(table)\n .clear();\n\n request.onsuccess = () => resolve(request.result);\n request.onerror = (e: any) => reject(e);\n });\n\n\nexport const removeDatabase = (dbName:string) =>\n new Promise((resolve, reject) => {\n db.close();\n const request = indexedDB.deleteDatabase(dbName);\n request.onsuccess = () => resolve(request.result);\n request.onerror = (e: any) => reject(e);\n});\n\n\n/**\n * Init indexDB for application.\n * \n * @param config - config for index db \n * @param successCallback - callback function after db is successfully initialized \n */\nexport const initDB = (\n config: {\n dbName:string,\n dbVersion:number,\n collections: {\n name: string,\n collectionConf: { \n keyPath?: string\n }\n }[]\n }) => {\n if (!indexedDB) {\n window.alert(\"Your browser doesn't support a stable version of IndexedDB.\");\n } else {\n const {dbName, dbVersion, collections} = config;\n const request = indexedDB.open(dbName, dbVersion);\n request.onerror = event => {\n console.log('error during db init:', event);\n };\n\n request.onsuccess = () => {\n db = request.result;\n console.log(`db init success: ${db}`);\n pdStore().dispatch(initIndexDBSucess());\n };\n\n request.onupgradeneeded = (event: any) => {\n console.log('Upgrade needed', event);\n db = event.target.result;\n switch (event.oldVersion) {\n // first call from client, init db\n case 0: \n // create user DB\n db.createObjectStore(USER_COLLECTION, { \n keyPath: \"id\",\n });\n collections.forEach(c => {\n db.createObjectStore(c.name, c.collectionConf);\n });\n break;\n // depending on our needs, add specific versions here to migrate existing db\n // case X: ....\n default:\n console.log('Updating database structure for existing version');\n // Ergänzt alle neuen Collections, wenn alte Versionen aktualisiert werden\n if (!db.objectStoreNames.contains(USER_COLLECTION)) {\n db.createObjectStore(USER_COLLECTION, { \n keyPath: \"id\",\n });\n }\n collections.forEach(c => {\n if (!db.objectStoreNames.contains(c.name)) {\n db.createObjectStore(c.name, c.collectionConf);\n }\n });\n }\n };\n }\n};\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mini-rx.store.js","sourceRoot":"","sources":["../../../src/store/mini-rx.store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAS,eAAe,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAExH,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,sCAAsC,EAAE,MAAM,6BAA6B,CAAC;AAErH,IAAI,KAAY,CAAC;AAEjB,MAAM,eAAe,GAAG,CAAC,OAAc,EAAE,EAAE;IACzC,IAAI,KAAK,EAAE;QACT,oCAAoC;QACpC,KAAK,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;QAC7B,KAAK,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;QAC7B,KAAK,CAAC,MAAM,CAAC,sCAAsC,CAAC,CAAC;QAErD,8BAA8B;QAC9B,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;KACjD;SAAM;QACL,OAAO,CAAC,KAAK,CAAC,oDAAoD,CAAC,CAAC;KACrE;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAkB,EAAE,EAAE;IACpD,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,KAAK,CAAC,CAAC;IAExC,eAAe;IACf,IAAI,CAAC,KAAK,EAAE;QACV,KAAK,GAAG,cAAc,CAAC;YACrB,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;gBACxB,MAAM,EAAE,aAAa;gBACrB,GAAG,KAAK,CAAC,OAAO;aACjB,CAAC,CAAC,CAAC;gBACF,MAAM,EAAE,aAAa;aACtB;YACD,UAAU,EAAE;gBACV,IAAI,eAAe,EAAE;gBACrB,IAAI,sBAAsB,CAAC;oBACzB,IAAI,EAAE,KAAK,CAAC,OAAO;iBACpB,CAAC;gBACF,IAAI,uBAAuB,EAAE;aAC9B;SACF,CAAC,CAAC;QAEH,sDAAsD;QACtD,eAAe,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;KAChC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,GAAU,EAAE,CAAC,KAAK,CAAC","sourcesContent":["import { configureStore, Store, LoggerExtension, ReduxDevtoolsExtension, ImmutableStateExtension } from 'mini-rx-store';\nimport { StoreConfig } from '../service-provider/service-provider-model.js';\nimport { spaAppReducer } from '../store/spa-app-reducer.js';\nimport { appRouteEffect, appToastEffect, registerNotificationTokenSuccessEffect } from '../store/spa-app-effects.js';\n\nlet store: Store;\n\nconst registerEffects = (effects: any[]) => {\n if (store) {\n // Register default app route effect\n store.effect(appRouteEffect);\n store.effect(appToastEffect);\n store.effect(registerNotificationTokenSuccessEffect);\n \n // Register configured effects\n effects.forEach(effect => store.effect(effect));\n } else {\n console.error(\"Store is not initialized. Cannot register effects.\");\n }\n};\n\nexport const initializeStore = (param: StoreConfig) => {\n console.log(\"Initialize Store:\", param);\n\n // create store\n if (!store) {\n store = configureStore({ \n reducers: param.reducer ? {\n spaApp: spaAppReducer,\n ...param.reducer\n } : {\n spaApp: spaAppReducer \n },\n extensions: [\n new LoggerExtension(),\n new ReduxDevtoolsExtension({\n name: param.appName\n }),\n new ImmutableStateExtension()\n ],\n });\n\n // register default effects after store is initialized\n registerEffects(param.effects);\n }\n};\n\nexport const pdStore = (): Store => store;\n"]}
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { TemplateResult } from 'lit';
|
|
2
|
-
import { LoadingState, LoadingSubTask } from '../model/spa-model.js';
|
|
3
|
-
export declare const initIndexDBSucess: (() => {
|
|
4
|
-
type: "SPA_INIT_INDEX_DB_SUCCESS";
|
|
5
|
-
}) & {
|
|
6
|
-
type: "SPA_INIT_INDEX_DB_SUCCESS";
|
|
7
|
-
};
|
|
8
|
-
export declare const loginSucess: (() => {
|
|
9
|
-
type: "SPA_LOGIN_SUCCESS";
|
|
10
|
-
}) & {
|
|
11
|
-
type: "SPA_LOGIN_SUCCESS";
|
|
12
|
-
};
|
|
13
|
-
export declare const nologin: (() => {
|
|
14
|
-
type: "SPA_NO_LOGIN";
|
|
15
|
-
}) & {
|
|
16
|
-
type: "SPA_NO_LOGIN";
|
|
17
|
-
};
|
|
18
|
-
export declare const routeAction: ((payload: string) => {
|
|
19
|
-
payload: string;
|
|
20
|
-
} & {
|
|
21
|
-
type: "SPA_APP_ROUTE";
|
|
22
|
-
}) & {
|
|
23
|
-
type: "SPA_APP_ROUTE";
|
|
24
|
-
};
|
|
25
|
-
export declare const toastAction: ((payload: {
|
|
26
|
-
txt: string | TemplateResult;
|
|
27
|
-
isError: boolean;
|
|
28
|
-
isSuccess: boolean;
|
|
29
|
-
duration?: number | undefined;
|
|
30
|
-
}) => {
|
|
31
|
-
payload: {
|
|
32
|
-
txt: string | TemplateResult;
|
|
33
|
-
isError: boolean;
|
|
34
|
-
isSuccess: boolean;
|
|
35
|
-
duration?: number | undefined;
|
|
36
|
-
};
|
|
37
|
-
} & {
|
|
38
|
-
type: "SPA_APP_TOAST";
|
|
39
|
-
}) & {
|
|
40
|
-
type: "SPA_APP_TOAST";
|
|
41
|
-
};
|
|
42
|
-
export declare const updateInternetOffline: ((payload: boolean) => {
|
|
43
|
-
payload: boolean;
|
|
44
|
-
} & {
|
|
45
|
-
type: "SPA_APP_UPDATE_INTERNET_OFFLINE";
|
|
46
|
-
}) & {
|
|
47
|
-
type: "SPA_APP_UPDATE_INTERNET_OFFLINE";
|
|
48
|
-
};
|
|
49
|
-
export declare const addLoadingState: ((payload: LoadingState) => {
|
|
50
|
-
payload: LoadingState;
|
|
51
|
-
} & {
|
|
52
|
-
type: "SPA_APP_ADD_LOADING";
|
|
53
|
-
}) & {
|
|
54
|
-
type: "SPA_APP_ADD_LOADING";
|
|
55
|
-
};
|
|
56
|
-
export declare const changeSubTask: ((payload: {
|
|
57
|
-
loadingActionId: string;
|
|
58
|
-
newTaskState: LoadingSubTask;
|
|
59
|
-
}) => {
|
|
60
|
-
payload: {
|
|
61
|
-
loadingActionId: string;
|
|
62
|
-
newTaskState: LoadingSubTask;
|
|
63
|
-
};
|
|
64
|
-
} & {
|
|
65
|
-
type: "SPA_APP_CHANGE_SUB_LOADING";
|
|
66
|
-
}) & {
|
|
67
|
-
type: "SPA_APP_CHANGE_SUB_LOADING";
|
|
68
|
-
};
|
|
69
|
-
export declare const removeLoadingState: ((payload: string) => {
|
|
70
|
-
payload: string;
|
|
71
|
-
} & {
|
|
72
|
-
type: "SPA_APP_REMOVE_LOADING";
|
|
73
|
-
}) & {
|
|
74
|
-
type: "SPA_APP_REMOVE_LOADING";
|
|
75
|
-
};
|
|
76
|
-
export declare const updateNewNotificationToken: ((payload: {
|
|
77
|
-
messagingToken: string;
|
|
78
|
-
}) => {
|
|
79
|
-
payload: {
|
|
80
|
-
messagingToken: string;
|
|
81
|
-
};
|
|
82
|
-
} & {
|
|
83
|
-
type: "UPDATE_NOTIFICATION_TOKEN";
|
|
84
|
-
}) & {
|
|
85
|
-
type: "UPDATE_NOTIFICATION_TOKEN";
|
|
86
|
-
};
|
|
87
|
-
export declare const updateNewNotificationTokenSuccess: ((payload: {
|
|
88
|
-
messagingToken: string;
|
|
89
|
-
}) => {
|
|
90
|
-
payload: {
|
|
91
|
-
messagingToken: string;
|
|
92
|
-
};
|
|
93
|
-
} & {
|
|
94
|
-
type: "UPDATE_NOTIFICATION_TOKEN_SUCCESS";
|
|
95
|
-
}) & {
|
|
96
|
-
type: "UPDATE_NOTIFICATION_TOKEN_SUCCESS";
|
|
97
|
-
};
|
|
98
|
-
export declare const updateNewNotificationTokenFail: ((payload: Error) => {
|
|
99
|
-
payload: Error;
|
|
100
|
-
} & {
|
|
101
|
-
type: "UPDATE_NOTIFICATION_TOKEN_FAIL";
|
|
102
|
-
}) & {
|
|
103
|
-
type: "UPDATE_NOTIFICATION_TOKEN_FAIL";
|
|
104
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spa-app-actions.js","sourceRoot":"","sources":["../../../src/store/spa-app-actions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAK5C,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,2BAA2B,CAAC,CAAC;AACrE,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;AACvD,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;AAE9C,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,eAAe,EAAE,OAAO,EAAU,CAAC,CAAC;AAEtE,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,eAAe,EAAE,OAAO,EAKtD,CAAC,CAAC;AAEN,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,iCAAiC,EAAE,OAAO,EAAW,CAAC,CAAC;AAEnG,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,qBAAqB,EAAE,OAAO,EAAgB,CAAC,CAAC;AACtF,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,4BAA4B,EAAE,OAAO,EAGrE,CAAC,CAAC;AACN,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,wBAAwB,EAAE,OAAO,EAAU,CAAC,CAAC;AAGtF,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC,2BAA2B,EAAE,OAAO,EAEjF,CAAC,CAAC;AACN,MAAM,CAAC,MAAM,iCAAiC,GAAG,MAAM,CAAC,mCAAmC,EAAE,OAAO,EAEhG,CAAC,CAAC;AACN,MAAM,CAAC,MAAM,8BAA8B,GAAG,MAAM,CAAC,gCAAgC,EAAE,OAAO,EAAS,CAAC,CAAC","sourcesContent":["import { TemplateResult } from 'lit';\nimport { action, payload } from 'ts-action';\n\nimport { LoadingState, LoadingSubTask } from '../model/spa-model.js';\n\n\nexport const initIndexDBSucess = action('SPA_INIT_INDEX_DB_SUCCESS');\nexport const loginSucess = action('SPA_LOGIN_SUCCESS');\nexport const nologin = action('SPA_NO_LOGIN');\n\nexport const routeAction = action('SPA_APP_ROUTE', payload<string>());\n\nexport const toastAction = action('SPA_APP_TOAST', payload<{\n txt: string | TemplateResult,\n isError: boolean,\n isSuccess: boolean,\n duration? : number,\n}>());\n\nexport const updateInternetOffline = action('SPA_APP_UPDATE_INTERNET_OFFLINE', payload<boolean>());\n\nexport const addLoadingState = action('SPA_APP_ADD_LOADING', payload<LoadingState>());\nexport const changeSubTask = action('SPA_APP_CHANGE_SUB_LOADING', payload<{\n loadingActionId: string,\n newTaskState: LoadingSubTask\n}>());\nexport const removeLoadingState = action('SPA_APP_REMOVE_LOADING', payload<string>());\n\n\nexport const updateNewNotificationToken = action('UPDATE_NOTIFICATION_TOKEN', payload<{\n messagingToken: string\n}>());\nexport const updateNewNotificationTokenSuccess = action('UPDATE_NOTIFICATION_TOKEN_SUCCESS', payload<{\n messagingToken: string\n}>());\nexport const updateNewNotificationTokenFail = action('UPDATE_NOTIFICATION_TOKEN_FAIL', payload<Error>());\n"]}
|