@lenne.tech/ng-base 18.1.2 → 22.0.0
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/CLAUDE.md +55 -0
- package/LICENSE +2 -2
- package/README.md +237 -44
- package/fesm2022/lenne.tech-ng-base-ai.mjs +767 -0
- package/fesm2022/lenne.tech-ng-base-ai.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-auth-provide.mjs +939 -0
- package/fesm2022/lenne.tech-ng-base-auth-provide.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-auth.mjs +454 -0
- package/fesm2022/lenne.tech-ng-base-auth.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-bug-bug-report-dialog-BRzVmKJr.mjs +825 -0
- package/fesm2022/lenne.tech-ng-base-bug-bug-report-dialog-BRzVmKJr.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-bug-bug-report-service-DWoTb_iw.mjs +351 -0
- package/fesm2022/lenne.tech-ng-base-bug-bug-report-service-DWoTb_iw.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-bug-capture-engine-TkjMDdqj.mjs +1046 -0
- package/fesm2022/lenne.tech-ng-base-bug-capture-engine-TkjMDdqj.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-bug-constants-Brm2KGHi.mjs +4 -0
- package/fesm2022/lenne.tech-ng-base-bug-constants-Brm2KGHi.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-bug-messages-BsP4fRQU.mjs +179 -0
- package/fesm2022/lenne.tech-ng-base-bug-messages-BsP4fRQU.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-bug-provide.mjs +26 -0
- package/fesm2022/lenne.tech-ng-base-bug-provide.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-bug-report-Tzlhe1Cm.mjs +62 -0
- package/fesm2022/lenne.tech-ng-base-bug-report-Tzlhe1Cm.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-bug-server.mjs +818 -0
- package/fesm2022/lenne.tech-ng-base-bug-server.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-bug.mjs +196 -0
- package/fesm2022/lenne.tech-ng-base-bug.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-files-ui.mjs +445 -0
- package/fesm2022/lenne.tech-ng-base-files-ui.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-files.mjs +474 -0
- package/fesm2022/lenne.tech-ng-base-files.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-server.mjs +408 -0
- package/fesm2022/lenne.tech-ng-base-server.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-share.mjs +76 -0
- package/fesm2022/lenne.tech-ng-base-share.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-sync.mjs +1096 -0
- package/fesm2022/lenne.tech-ng-base-sync.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-testing.mjs +171 -0
- package/fesm2022/lenne.tech-ng-base-testing.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-ui-provide.mjs +124 -0
- package/fesm2022/lenne.tech-ng-base-ui-provide.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-ui.mjs +34611 -0
- package/fesm2022/lenne.tech-ng-base-ui.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-utils.mjs +287 -0
- package/fesm2022/lenne.tech-ng-base-utils.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base.mjs +615 -902
- package/fesm2022/lenne.tech-ng-base.mjs.map +1 -1
- package/i18n/auth/de.json +17 -0
- package/i18n/auth/en.json +17 -0
- package/i18n/bug/de.json +85 -0
- package/i18n/bug/en.json +85 -0
- package/i18n/de.json +8 -0
- package/i18n/en.json +8 -0
- package/i18n/files/de.json +27 -0
- package/i18n/files/en.json +27 -0
- package/i18n/share/de.json +8 -0
- package/i18n/share/en.json +8 -0
- package/i18n/ui/de.json +38 -0
- package/i18n/ui/en.json +38 -0
- package/package.json +127 -58
- package/types/lenne.tech-ng-base-ai.d.ts +830 -0
- package/types/lenne.tech-ng-base-auth-provide.d.ts +603 -0
- package/types/lenne.tech-ng-base-auth.d.ts +320 -0
- package/types/lenne.tech-ng-base-bug-provide.d.ts +272 -0
- package/types/lenne.tech-ng-base-bug-rolldown-runtime-C25Le4-w.d.ts +1 -0
- package/types/lenne.tech-ng-base-bug-server.d.ts +316 -0
- package/types/lenne.tech-ng-base-bug.d.ts +202 -0
- package/types/lenne.tech-ng-base-files-ui.d.ts +116 -0
- package/types/lenne.tech-ng-base-files.d.ts +288 -0
- package/types/lenne.tech-ng-base-server.d.ts +262 -0
- package/types/lenne.tech-ng-base-share.d.ts +21 -0
- package/types/lenne.tech-ng-base-sync.d.ts +380 -0
- package/types/lenne.tech-ng-base-testing.d.ts +327 -0
- package/types/lenne.tech-ng-base-ui-provide.d.ts +65 -0
- package/types/lenne.tech-ng-base-ui.d.ts +7732 -0
- package/types/lenne.tech-ng-base-utils.d.ts +150 -0
- package/types/lenne.tech-ng-base.d.ts +503 -0
- package/ui/styles/components/accordion.css +3 -0
- package/ui/styles/components/alert-dialog.css +4 -0
- package/ui/styles/components/alert.css +3 -0
- package/ui/styles/components/aspect-ratio.css +3 -0
- package/ui/styles/components/attachment.css +4 -0
- package/ui/styles/components/autocomplete.css +4 -0
- package/ui/styles/components/avatar.css +3 -0
- package/ui/styles/components/badge.css +3 -0
- package/ui/styles/components/breadcrumb.css +3 -0
- package/ui/styles/components/bubble.css +3 -0
- package/ui/styles/components/button-group.css +3 -0
- package/ui/styles/components/button.css +3 -0
- package/ui/styles/components/calendar.css +5 -0
- package/ui/styles/components/card.css +3 -0
- package/ui/styles/components/checkbox.css +3 -0
- package/ui/styles/components/code-block.css +4 -0
- package/ui/styles/components/collapsible.css +3 -0
- package/ui/styles/components/combobox.css +5 -0
- package/ui/styles/components/command.css +5 -0
- package/ui/styles/components/context-menu.css +3 -0
- package/ui/styles/components/date-picker.css +7 -0
- package/ui/styles/components/dialog.css +4 -0
- package/ui/styles/components/drawer.css +3 -0
- package/ui/styles/components/dropdown-menu.css +3 -0
- package/ui/styles/components/empty.css +3 -0
- package/ui/styles/components/field.css +5 -0
- package/ui/styles/components/hover-card.css +3 -0
- package/ui/styles/components/index.css +91 -0
- package/ui/styles/components/input-group.css +6 -0
- package/ui/styles/components/input-otp.css +3 -0
- package/ui/styles/components/input.css +3 -0
- package/ui/styles/components/item.css +4 -0
- package/ui/styles/components/kbd.css +3 -0
- package/ui/styles/components/label.css +3 -0
- package/ui/styles/components/lt-breadcrumb.css +3 -0
- package/ui/styles/components/lt-bug-attachments.css +5 -0
- package/ui/styles/components/lt-bug-journey-timeline.css +5 -0
- package/ui/styles/components/lt-bug-report-dialog.css +15 -0
- package/ui/styles/components/lt-bug-report.css +4 -0
- package/ui/styles/components/lt-color-mode-button.css +3 -0
- package/ui/styles/components/lt-confirm-dialog.css +4 -0
- package/ui/styles/components/lt-data-view.css +5 -0
- package/ui/styles/components/lt-date-picker.css +3 -0
- package/ui/styles/components/lt-date-time-picker.css +5 -0
- package/ui/styles/components/lt-enter-action.css +2 -0
- package/ui/styles/components/lt-footer.css +3 -0
- package/ui/styles/components/lt-form-field.css +4 -0
- package/ui/styles/components/lt-header.css +5 -0
- package/ui/styles/components/lt-imports.css +21 -0
- package/ui/styles/components/lt-navigation-menu.css +3 -0
- package/ui/styles/components/lt-notice.css +3 -0
- package/ui/styles/components/lt-overlay-defaults.css +3 -0
- package/ui/styles/components/lt-page-card.css +3 -0
- package/ui/styles/components/lt-page-title.css +2 -0
- package/ui/styles/components/lt-password-input.css +4 -0
- package/ui/styles/components/lt-readonly-field.css +2 -0
- package/ui/styles/components/lt-select.css +4 -0
- package/ui/styles/components/lt-text-field.css +5 -0
- package/ui/styles/components/lt-toolbar-item.css +2 -0
- package/ui/styles/components/lt-toolbar.css +3 -0
- package/ui/styles/components/lt-tus-upload-component.css +5 -0
- package/ui/styles/components/marker.css +3 -0
- package/ui/styles/components/menubar.css +3 -0
- package/ui/styles/components/message-scroller.css +4 -0
- package/ui/styles/components/message.css +3 -0
- package/ui/styles/components/native-select.css +3 -0
- package/ui/styles/components/navigation-menu.css +3 -0
- package/ui/styles/components/pagination.css +4 -0
- package/ui/styles/components/popover.css +3 -0
- package/ui/styles/components/progress.css +3 -0
- package/ui/styles/components/questionnaire.css +4 -0
- package/ui/styles/components/radio-group.css +3 -0
- package/ui/styles/components/resizable.css +3 -0
- package/ui/styles/components/select.css +3 -0
- package/ui/styles/components/separator.css +3 -0
- package/ui/styles/components/sheet.css +4 -0
- package/ui/styles/components/sidebar.css +9 -0
- package/ui/styles/components/skeleton.css +3 -0
- package/ui/styles/components/slider.css +3 -0
- package/ui/styles/components/sonner.css +4 -0
- package/ui/styles/components/spinner.css +3 -0
- package/ui/styles/components/switch.css +3 -0
- package/ui/styles/components/table.css +3 -0
- package/ui/styles/components/tabs.css +4 -0
- package/ui/styles/components/textarea.css +3 -0
- package/ui/styles/components/toggle-group.css +4 -0
- package/ui/styles/components/toggle.css +3 -0
- package/ui/styles/components/tooltip.css +3 -0
- package/ui/styles/components/trace.css +3 -0
- package/ui/styles/components/typography.css +3 -0
- package/ui/styles/components/utils.css +2 -0
- package/ui/styles/core.css +137 -0
- package/ui/styles/palette.css +94 -0
- package/ui/styles/theme.css +14 -0
- package/ui/styles/transitions.css +131 -0
- package/base-cms/index.d.ts +0 -5
- package/base-cms/interfaces/base-cms-module-config.interface.d.ts +0 -16
- package/base-cms/pages/base-cms/base-cms.component.d.ts +0 -92
- package/base-cms/public-api.d.ts +0 -5
- package/base-components/components/breadcrumb/breadcrumb.component.d.ts +0 -10
- package/base-components/components/change-password/change-password.component.d.ts +0 -24
- package/base-components/components/checkbox/checkbox.component.d.ts +0 -12
- package/base-components/components/delete-account/delete-account.component.d.ts +0 -15
- package/base-components/components/fab-button/fab-button.component.d.ts +0 -16
- package/base-components/components/input/input.component.d.ts +0 -27
- package/base-components/components/loading-bar/loading-bar.component.d.ts +0 -17
- package/base-components/components/model-form/model-form-base.component.d.ts +0 -64
- package/base-components/components/model-form/model-form.component.d.ts +0 -139
- package/base-components/components/model-form-sub/model-form-sub.component.d.ts +0 -56
- package/base-components/components/model-table/model-table.component.d.ts +0 -115
- package/base-components/components/refence-input/refence-input.component.d.ts +0 -84
- package/base-components/components/select/select.component.d.ts +0 -25
- package/base-components/components/skeleton-loader/skeleton-loader.component.d.ts +0 -10
- package/base-components/components/tags/tags.component.d.ts +0 -60
- package/base-components/components/textarea/textarea.component.d.ts +0 -21
- package/base-components/components/toast/toast.component.d.ts +0 -19
- package/base-components/components/upload-image/upload-image.component.d.ts +0 -111
- package/base-components/directives/back-button.directive.d.ts +0 -9
- package/base-components/directives/context-menu.directive.d.ts +0 -22
- package/base-components/directives/sort.directive.d.ts +0 -15
- package/base-components/directives/stop-propagation.directive.d.ts +0 -10
- package/base-components/index.d.ts +0 -5
- package/base-components/pipes/ellipses.pipe.d.ts +0 -10
- package/base-components/public-api.d.ts +0 -26
- package/base-prototype/index.d.ts +0 -5
- package/base-prototype/pages/email-verification/email-verification.component.d.ts +0 -18
- package/base-prototype/pages/forgot-password/forgot-password.component.d.ts +0 -26
- package/base-prototype/pages/login/login.component.d.ts +0 -33
- package/base-prototype/pages/profile/profile.component.d.ts +0 -24
- package/base-prototype/pages/register/register.component.d.ts +0 -31
- package/base-prototype/pages/set-password/set-password.component.d.ts +0 -29
- package/base-prototype/public-api.d.ts +0 -9
- package/esm2022/base-cms/interfaces/base-cms-module-config.interface.mjs +0 -3
- package/esm2022/base-cms/lenne.tech-ng-base-base-cms.mjs +0 -5
- package/esm2022/base-cms/pages/base-cms/base-cms.component.mjs +0 -238
- package/esm2022/base-cms/public-api.mjs +0 -8
- package/esm2022/base-components/components/breadcrumb/breadcrumb.component.mjs +0 -23
- package/esm2022/base-components/components/change-password/change-password.component.mjs +0 -97
- package/esm2022/base-components/components/checkbox/checkbox.component.mjs +0 -38
- package/esm2022/base-components/components/delete-account/delete-account.component.mjs +0 -59
- package/esm2022/base-components/components/fab-button/fab-button.component.mjs +0 -24
- package/esm2022/base-components/components/input/input.component.mjs +0 -75
- package/esm2022/base-components/components/loading-bar/loading-bar.component.mjs +0 -37
- package/esm2022/base-components/components/model-form/model-form-base.component.mjs +0 -145
- package/esm2022/base-components/components/model-form/model-form.component.mjs +0 -591
- package/esm2022/base-components/components/model-form-sub/model-form-sub.component.mjs +0 -117
- package/esm2022/base-components/components/model-table/model-table.component.mjs +0 -478
- package/esm2022/base-components/components/refence-input/refence-input.component.mjs +0 -278
- package/esm2022/base-components/components/select/select.component.mjs +0 -62
- package/esm2022/base-components/components/skeleton-loader/skeleton-loader.component.mjs +0 -33
- package/esm2022/base-components/components/tags/tags.component.mjs +0 -227
- package/esm2022/base-components/components/textarea/textarea.component.mjs +0 -79
- package/esm2022/base-components/components/toast/toast.component.mjs +0 -69
- package/esm2022/base-components/components/upload-image/upload-image.component.mjs +0 -346
- package/esm2022/base-components/directives/back-button.directive.mjs +0 -25
- package/esm2022/base-components/directives/context-menu.directive.mjs +0 -112
- package/esm2022/base-components/directives/sort.directive.mjs +0 -61
- package/esm2022/base-components/directives/stop-propagation.directive.mjs +0 -24
- package/esm2022/base-components/lenne.tech-ng-base-base-components.mjs +0 -5
- package/esm2022/base-components/pipes/ellipses.pipe.mjs +0 -23
- package/esm2022/base-components/public-api.mjs +0 -30
- package/esm2022/base-prototype/lenne.tech-ng-base-base-prototype.mjs +0 -5
- package/esm2022/base-prototype/pages/email-verification/email-verification.component.mjs +0 -60
- package/esm2022/base-prototype/pages/forgot-password/forgot-password.component.mjs +0 -78
- package/esm2022/base-prototype/pages/login/login.component.mjs +0 -114
- package/esm2022/base-prototype/pages/profile/profile.component.mjs +0 -87
- package/esm2022/base-prototype/pages/register/register.component.mjs +0 -100
- package/esm2022/base-prototype/pages/set-password/set-password.component.mjs +0 -91
- package/esm2022/base-prototype/public-api.mjs +0 -11
- package/esm2022/lenne.tech-ng-base.mjs +0 -5
- package/esm2022/public-api.mjs +0 -25
- package/esm2022/shared/classes/auth.class.mjs +0 -14
- package/esm2022/shared/classes/basic-user.class.mjs +0 -49
- package/esm2022/shared/classes/graphql-enum.class.mjs +0 -10
- package/esm2022/shared/classes/graphql-meta.class.mjs +0 -345
- package/esm2022/shared/classes/graphql-type.class.mjs +0 -14
- package/esm2022/shared/classes/helper.class.mjs +0 -307
- package/esm2022/shared/classes/sort.class.mjs +0 -38
- package/esm2022/shared/classes/standard.class.mjs +0 -40
- package/esm2022/shared/decorators/debounce.decorator.mjs +0 -12
- package/esm2022/shared/enums/comparison-operator.enum.mjs +0 -16
- package/esm2022/shared/enums/graphql-request-type.enum.mjs +0 -10
- package/esm2022/shared/enums/logical-operator.enum.mjs +0 -10
- package/esm2022/shared/enums/skeleton-type.enum.mjs +0 -7
- package/esm2022/shared/enums/sort-order.enum.mjs +0 -6
- package/esm2022/shared/enums/toast-type.enum.mjs +0 -8
- package/esm2022/shared/functions/ws-client.function.mjs +0 -39
- package/esm2022/shared/interfaces/base-module-config.interface.mjs +0 -3
- package/esm2022/shared/interfaces/breadcrumb.interface.mjs +0 -2
- package/esm2022/shared/interfaces/can-component-deactivate.interface.mjs +0 -2
- package/esm2022/shared/interfaces/cms-enum-values.interface.mjs +0 -2
- package/esm2022/shared/interfaces/cms-field-config.interface.mjs +0 -2
- package/esm2022/shared/interfaces/cms-model-config.interface.mjs +0 -2
- package/esm2022/shared/interfaces/cms-table-field.interface.mjs +0 -2
- package/esm2022/shared/interfaces/combined-filter-input.interface.mjs +0 -2
- package/esm2022/shared/interfaces/compress-options.interface.mjs +0 -2
- package/esm2022/shared/interfaces/cropping-options.interface.mjs +0 -2
- package/esm2022/shared/interfaces/field-object.interface.mjs +0 -2
- package/esm2022/shared/interfaces/field.interface.mjs +0 -2
- package/esm2022/shared/interfaces/filter-input.interface.mjs +0 -2
- package/esm2022/shared/interfaces/find-args.interface.mjs +0 -2
- package/esm2022/shared/interfaces/graphql-crud-type.interface.mjs +0 -2
- package/esm2022/shared/interfaces/graphql-fields-object.interface.mjs +0 -2
- package/esm2022/shared/interfaces/graphql-options.interface.mjs +0 -2
- package/esm2022/shared/interfaces/graphql-plus-options.interfacen.mjs +0 -2
- package/esm2022/shared/interfaces/graphql-type-collection.interface.mjs +0 -2
- package/esm2022/shared/interfaces/login-config.interface.mjs +0 -2
- package/esm2022/shared/interfaces/register-config.interface.mjs +0 -2
- package/esm2022/shared/interfaces/single-filter-input.interface.mjs +0 -2
- package/esm2022/shared/interfaces/sort-input.interface.mjs +0 -2
- package/esm2022/shared/interfaces/time-components.interface.mjs +0 -2
- package/esm2022/shared/interfaces/toast.interface.mjs +0 -2
- package/esm2022/shared/lenne.tech-ng-base-shared.mjs +0 -5
- package/esm2022/shared/public-api.mjs +0 -74
- package/esm2022/shared/services/auth.service.mjs +0 -152
- package/esm2022/shared/services/breadcrumb.service.mjs +0 -69
- package/esm2022/shared/services/cms.service.mjs +0 -82
- package/esm2022/shared/services/file.service.mjs +0 -86
- package/esm2022/shared/services/forms.service.mjs +0 -61
- package/esm2022/shared/services/graphql-meta.service.mjs +0 -132
- package/esm2022/shared/services/graphql-plus.service.mjs +0 -93
- package/esm2022/shared/services/graphql.service.mjs +0 -510
- package/esm2022/shared/services/image.service.mjs +0 -102
- package/esm2022/shared/services/loader.service.mjs +0 -78
- package/esm2022/shared/services/navigation.service.mjs +0 -38
- package/esm2022/shared/services/scroll.service.mjs +0 -207
- package/esm2022/shared/services/storage.service.mjs +0 -149
- package/esm2022/shared/services/toast.service.mjs +0 -39
- package/esm2022/shared/services/user.service.mjs +0 -160
- package/esm2022/shared/services/ws.service.mjs +0 -17
- package/esm2022/shared/types/graphql-fields.type.mjs +0 -2
- package/esm2022/shared/types/storage.type.mjs +0 -2
- package/esm2022/shared/validators/email.validator.mjs +0 -7
- package/esm2022/shared/validators/match.validator.mjs +0 -22
- package/esm2022/shared/validators/secure-password.validator.mjs +0 -7
- package/esm2022/src/base.module.mjs +0 -64
- package/esm2022/src/decorators/auto-unsubscribe.decorator.mjs +0 -23
- package/esm2022/src/directives/lazy-load.directive.mjs +0 -48
- package/esm2022/src/directives/match-height.directive.mjs +0 -92
- package/esm2022/src/directives/resizable.directive.mjs +0 -92
- package/esm2022/src/factories/apollo-options.factory.mjs +0 -108
- package/esm2022/src/functions/extract-files.function.mjs +0 -87
- package/esm2022/src/guards/auth.guard.mjs +0 -91
- package/esm2022/src/guards/can-deactivate.guard.mjs +0 -16
- package/esm2022/src/guards/logout.guard.mjs +0 -34
- package/esm2022/src/pipes/date-ago.pipe.mjs +0 -64
- package/esm2022/src/pipes/safe-html.pipe.mjs +0 -22
- package/esm2022/src/services/fullscreen.service.mjs +0 -51
- package/esm2022/src/services/seo.service.mjs +0 -109
- package/esm2022/src/services/theme.service.mjs +0 -44
- package/fesm2022/lenne.tech-ng-base-base-cms.mjs +0 -251
- package/fesm2022/lenne.tech-ng-base-base-cms.mjs.map +0 -1
- package/fesm2022/lenne.tech-ng-base-base-components.mjs +0 -2917
- package/fesm2022/lenne.tech-ng-base-base-components.mjs.map +0 -1
- package/fesm2022/lenne.tech-ng-base-base-prototype.mjs +0 -505
- package/fesm2022/lenne.tech-ng-base-base-prototype.mjs.map +0 -1
- package/fesm2022/lenne.tech-ng-base-shared.mjs +0 -2863
- package/fesm2022/lenne.tech-ng-base-shared.mjs.map +0 -1
- package/index.d.ts +0 -5
- package/public-api.d.ts +0 -17
- package/shared/classes/auth.class.d.ts +0 -10
- package/shared/classes/basic-user.class.d.ts +0 -27
- package/shared/classes/graphql-enum.class.d.ts +0 -7
- package/shared/classes/graphql-meta.class.d.ts +0 -66
- package/shared/classes/graphql-type.class.d.ts +0 -13
- package/shared/classes/helper.class.d.ts +0 -99
- package/shared/classes/sort.class.d.ts +0 -12
- package/shared/classes/standard.class.d.ts +0 -32
- package/shared/decorators/debounce.decorator.d.ts +0 -1
- package/shared/enums/comparison-operator.enum.d.ts +0 -14
- package/shared/enums/graphql-request-type.enum.d.ts +0 -8
- package/shared/enums/logical-operator.enum.d.ts +0 -8
- package/shared/enums/skeleton-type.enum.d.ts +0 -5
- package/shared/enums/sort-order.enum.d.ts +0 -4
- package/shared/enums/toast-type.enum.d.ts +0 -6
- package/shared/functions/ws-client.function.d.ts +0 -5
- package/shared/index.d.ts +0 -5
- package/shared/interfaces/base-module-config.interface.d.ts +0 -61
- package/shared/interfaces/breadcrumb.interface.d.ts +0 -4
- package/shared/interfaces/can-component-deactivate.interface.d.ts +0 -7
- package/shared/interfaces/cms-enum-values.interface.d.ts +0 -4
- package/shared/interfaces/cms-field-config.interface.d.ts +0 -45
- package/shared/interfaces/cms-model-config.interface.d.ts +0 -14
- package/shared/interfaces/cms-table-field.interface.d.ts +0 -10
- package/shared/interfaces/combined-filter-input.interface.d.ts +0 -9
- package/shared/interfaces/compress-options.interface.d.ts +0 -15
- package/shared/interfaces/cropping-options.interface.d.ts +0 -12
- package/shared/interfaces/field-object.interface.d.ts +0 -6
- package/shared/interfaces/field.interface.d.ts +0 -5
- package/shared/interfaces/filter-input.interface.d.ts +0 -9
- package/shared/interfaces/find-args.interface.d.ts +0 -11
- package/shared/interfaces/graphql-crud-type.interface.d.ts +0 -7
- package/shared/interfaces/graphql-fields-object.interface.d.ts +0 -6
- package/shared/interfaces/graphql-options.interface.d.ts +0 -11
- package/shared/interfaces/graphql-plus-options.interfacen.d.ts +0 -9
- package/shared/interfaces/graphql-type-collection.interface.d.ts +0 -7
- package/shared/interfaces/login-config.interface.d.ts +0 -6
- package/shared/interfaces/register-config.interface.d.ts +0 -4
- package/shared/interfaces/single-filter-input.interface.d.ts +0 -11
- package/shared/interfaces/sort-input.interface.d.ts +0 -5
- package/shared/interfaces/time-components.interface.d.ts +0 -6
- package/shared/interfaces/toast.interface.d.ts +0 -8
- package/shared/public-api.d.ts +0 -65
- package/shared/services/auth.service.d.ts +0 -44
- package/shared/services/breadcrumb.service.d.ts +0 -32
- package/shared/services/cms.service.d.ts +0 -27
- package/shared/services/file.service.d.ts +0 -22
- package/shared/services/forms.service.d.ts +0 -14
- package/shared/services/graphql-meta.service.d.ts +0 -45
- package/shared/services/graphql-plus.service.d.ts +0 -27
- package/shared/services/graphql.service.d.ts +0 -71
- package/shared/services/image.service.d.ts +0 -27
- package/shared/services/loader.service.d.ts +0 -32
- package/shared/services/navigation.service.d.ts +0 -15
- package/shared/services/scroll.service.d.ts +0 -85
- package/shared/services/storage.service.d.ts +0 -49
- package/shared/services/toast.service.d.ts +0 -15
- package/shared/services/user.service.d.ts +0 -77
- package/shared/services/ws.service.d.ts +0 -8
- package/shared/types/graphql-fields.type.d.ts +0 -5
- package/shared/types/storage.type.d.ts +0 -4
- package/shared/validators/email.validator.d.ts +0 -1
- package/shared/validators/match.validator.d.ts +0 -4
- package/shared/validators/secure-password.validator.d.ts +0 -1
- package/src/base.module.d.ts +0 -16
- package/src/decorators/auto-unsubscribe.decorator.d.ts +0 -5
- package/src/directives/lazy-load.directive.d.ts +0 -17
- package/src/directives/match-height.directive.d.ts +0 -20
- package/src/directives/resizable.directive.d.ts +0 -26
- package/src/factories/apollo-options.factory.d.ts +0 -16
- package/src/functions/extract-files.function.d.ts +0 -15
- package/src/guards/auth.guard.d.ts +0 -27
- package/src/guards/can-deactivate.guard.d.ts +0 -10
- package/src/guards/logout.guard.d.ts +0 -16
- package/src/pipes/date-ago.pipe.d.ts +0 -34
- package/src/pipes/safe-html.pipe.d.ts +0 -13
- package/src/services/fullscreen.service.d.ts +0 -18
- package/src/services/seo.service.d.ts +0 -50
- package/src/services/theme.service.d.ts +0 -17
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
import { EnvironmentProviders, InjectionToken, Signal } from "@angular/core";
|
|
2
|
+
/** The id format a sync model declares (§3). One per model, never mixed. */
|
|
3
|
+
type LtSyncIdFormat = 'objectId' | 'uuidv7';
|
|
4
|
+
/**
|
|
5
|
+
* A record as the device holds it. `version` 0 means "created here, not on the server yet";
|
|
6
|
+
* a tombstone has `deletedAt` set and no `data`.
|
|
7
|
+
*/
|
|
8
|
+
interface LtSyncRecord<T = Record<string, unknown>> {
|
|
9
|
+
data?: T;
|
|
10
|
+
deletedAt: null | string;
|
|
11
|
+
id: string;
|
|
12
|
+
updatedAt: null | string;
|
|
13
|
+
version: number;
|
|
14
|
+
}
|
|
15
|
+
/** Status of one pushed change (§7) */
|
|
16
|
+
type LtSyncItemStatus = 'applied' | 'conflict' | 'merged' | 'not_found' | 'rejected' | 'retry';
|
|
17
|
+
/** One result of a push, in the order the changes were sent (§6.6) */
|
|
18
|
+
interface LtSyncPushResult {
|
|
19
|
+
/** Reason of a `rejected` change, e.g. `VALIDATION_FAILED`, `FORBIDDEN`, `ID_UNAVAILABLE` */
|
|
20
|
+
code?: string;
|
|
21
|
+
details?: unknown;
|
|
22
|
+
id: string;
|
|
23
|
+
mutationId: string;
|
|
24
|
+
/** The server's record on `conflict` and `merged` (a tombstone when it was deleted) */
|
|
25
|
+
record?: {
|
|
26
|
+
data?: Record<string, unknown>;
|
|
27
|
+
deletedAt?: null | string;
|
|
28
|
+
id: string;
|
|
29
|
+
updatedAt?: null | string;
|
|
30
|
+
version: number;
|
|
31
|
+
};
|
|
32
|
+
status: LtSyncItemStatus;
|
|
33
|
+
version?: number;
|
|
34
|
+
}
|
|
35
|
+
/** What `onConflict` receives when the server did not apply a local change */
|
|
36
|
+
interface LtSyncConflict<T = Record<string, unknown>> {
|
|
37
|
+
/** The local change the server refused */
|
|
38
|
+
change: {
|
|
39
|
+
data?: Partial<T>;
|
|
40
|
+
op: 'delete' | 'upsert';
|
|
41
|
+
};
|
|
42
|
+
/** The local record as it was before the conflict was resolved */
|
|
43
|
+
local: LtSyncRecord<T> | undefined;
|
|
44
|
+
/** The server's current record; a tombstone (`deletedAt` set) when it was deleted there */
|
|
45
|
+
server: LtSyncRecord<T>;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The answer of `onConflict`: keep the server's state (`'server'`), or send `data` again on top
|
|
49
|
+
* of it. A record the server deleted stays deleted: an upsert on a tombstone is a conflict again (§6.3).
|
|
50
|
+
*/
|
|
51
|
+
type LtSyncConflictResolution<T = Record<string, unknown>> = 'server' | {
|
|
52
|
+
data: Partial<T>;
|
|
53
|
+
};
|
|
54
|
+
/** Outcome of one sync run */
|
|
55
|
+
interface LtSyncResult {
|
|
56
|
+
applied: number;
|
|
57
|
+
/** Conflicts of this run, after `onConflict` (or the server-wins default) resolved them */
|
|
58
|
+
conflicts: LtSyncPushResult[];
|
|
59
|
+
/** The caller may no longer pull the model (403): its local records and cursor are gone */
|
|
60
|
+
forbidden: boolean;
|
|
61
|
+
/** The server answered 401: sign in again. Nothing was applied, nothing was discarded (§4) */
|
|
62
|
+
needsLogin: boolean;
|
|
63
|
+
/** The server could not be reached */
|
|
64
|
+
offline: boolean;
|
|
65
|
+
rejected: LtSyncPushResult[];
|
|
66
|
+
/** A `410` made the client drop its local records and pull everything again (§8) */
|
|
67
|
+
resynced: boolean;
|
|
68
|
+
/** Changes the server answered `retry`; they go out again with the next sync */
|
|
69
|
+
retried: number;
|
|
70
|
+
/** The server asked to slow down (429 / 503): milliseconds until the next attempt */
|
|
71
|
+
retryAfterMs?: number;
|
|
72
|
+
}
|
|
73
|
+
/** Options of `provideLtSync()` (runtime override `NG_PUBLIC_LT_SYNC_BASE_PATH`) */
|
|
74
|
+
interface LtSyncOptions {
|
|
75
|
+
/** Sync base path (default: '/sync' — must match the nest-server sync module) */
|
|
76
|
+
basePath?: string;
|
|
77
|
+
}
|
|
78
|
+
/** Options of `injectLtOfflineSync()` */
|
|
79
|
+
interface LtOfflineSyncOptions<T = Record<string, unknown>> {
|
|
80
|
+
/** Sync on start, on `online`, on focus and after a hint (default: true). `false` leaves it to `sync()` */
|
|
81
|
+
auto?: boolean;
|
|
82
|
+
/** Listen for the server's hints (`GET <basePath>/hints`, §9) while the tab is visible (default: true) */
|
|
83
|
+
hints?: boolean;
|
|
84
|
+
/** The id format the model declares (default: 'objectId') */
|
|
85
|
+
idFormat?: LtSyncIdFormat;
|
|
86
|
+
/** Resolve a conflict yourself; without it the server's state wins */
|
|
87
|
+
onConflict?: (conflict: LtSyncConflict<T>) => LtSyncConflictResolution<T> | Promise<LtSyncConflictResolution<T>>;
|
|
88
|
+
/** Records per pull page (default: 200; the server caps it, 1000 at most) */
|
|
89
|
+
pageLimit?: number;
|
|
90
|
+
/** Restrict pull and push to one tenant (`X-Tenant-Id`, §4); records and unsent changes are kept per tenant */
|
|
91
|
+
tenantId?: string;
|
|
92
|
+
}
|
|
93
|
+
/** What `injectLtOfflineSync()` returns */
|
|
94
|
+
interface LtOfflineSyncState<T = Record<string, unknown>> {
|
|
95
|
+
/** Conflicts of the last sync, after they were resolved */
|
|
96
|
+
conflicts: Signal<LtSyncPushResult[]>;
|
|
97
|
+
/** Create a record with a client id (§3); it waits in the outbox until a sync sends it */
|
|
98
|
+
create: (data: T) => Promise<LtSyncRecord<T>>;
|
|
99
|
+
/** The last unexpected error (not offline, not 401) */
|
|
100
|
+
error: Signal<Error | null>;
|
|
101
|
+
/** The caller may no longer pull this model (403). Unsent changes cannot be pushed under this account */
|
|
102
|
+
forbidden: Signal<boolean>;
|
|
103
|
+
/** One local record, a tombstone included */
|
|
104
|
+
get: (id: string) => Promise<LtSyncRecord<T> | undefined>;
|
|
105
|
+
/** Time of the last sync that reached the server */
|
|
106
|
+
lastSyncedAt: Signal<Date | null>;
|
|
107
|
+
/** The server answered 401. Nothing was discarded; the next sync after signing in sends everything */
|
|
108
|
+
needsLogin: Signal<boolean>;
|
|
109
|
+
/** The browser is offline, or the last request could not reach the server */
|
|
110
|
+
offline: Signal<boolean>;
|
|
111
|
+
/** Unsent local changes of this model */
|
|
112
|
+
pendingCount: Signal<number>;
|
|
113
|
+
/** The live local records, sorted by id. Empty while no user is signed in */
|
|
114
|
+
records: Signal<readonly LtSyncRecord<T>[]>;
|
|
115
|
+
/** Changes the server rejected in the last sync; they are dropped and the record returns to the server's state (§7) */
|
|
116
|
+
rejected: Signal<LtSyncPushResult[]>;
|
|
117
|
+
/** Delete a record: a tombstone on the server (a hard delete is not reachable through sync) */
|
|
118
|
+
remove: (id: string) => Promise<void>;
|
|
119
|
+
/** Push the outbox, then pull until the server has nothing more */
|
|
120
|
+
sync: () => Promise<LtSyncResult>;
|
|
121
|
+
/** A sync of this model is running in this tab */
|
|
122
|
+
syncing: Signal<boolean>;
|
|
123
|
+
/** Change fields of a record */
|
|
124
|
+
update: (id: string, data: Partial<T>) => Promise<LtSyncRecord<T>>;
|
|
125
|
+
}
|
|
126
|
+
/** Offline-synchronised records of one model, created by {@link injectLtOfflineSync}. */
|
|
127
|
+
type LtOfflineSync<T = Record<string, unknown>> = LtOfflineSyncState<T>;
|
|
128
|
+
/**
|
|
129
|
+
* Offline-first records of one model (counterpart of `useLtOfflineSync()`), bound to the current injection context.
|
|
130
|
+
*
|
|
131
|
+
* Records live in IndexedDB; changes made offline wait in an outbox and go out with the next sync.
|
|
132
|
+
* Triggers: start, `online`, window focus, `visibilitychange` (a hidden tab closes the hint stream), a server hint
|
|
133
|
+
* and every reconnect of the hint stream (protocol §9), 300 ms after a local change; backoff 1 s → 60 s. Tabs
|
|
134
|
+
* coordinate: one syncs at a time (Web Locks), the others pick up the result (BroadcastChannel); without either API
|
|
135
|
+
* it stays correct, only busier.
|
|
136
|
+
*
|
|
137
|
+
* The local data belongs to the signed-in user (`LtAuthStore.user()`, the same signal as `LtAuthService.user()`). A user change re-claims ownership of the
|
|
138
|
+
* local database: another user's data is wiped before anything is shown or pulled. `signOut()` (`LtAuthService` / `LtAuthStore`) sends
|
|
139
|
+
* what is unsent and then deletes it (hook of `provideLtSync()`). An expired session deletes nothing: after signing
|
|
140
|
+
* in again the outbox goes out without duplicates (protocol §4).
|
|
141
|
+
*
|
|
142
|
+
* During SSR or without IndexedDB it is an inert stub (empty records, mutations reject). Without a signed-in user
|
|
143
|
+
* `records` is empty and mutations throw. Everything stops when the injection context is destroyed.
|
|
144
|
+
* Requires `provideLtSync()` and `provideLtAuth()`.
|
|
145
|
+
*
|
|
146
|
+
* @example
|
|
147
|
+
* ```ts
|
|
148
|
+
* export class NotesPage {
|
|
149
|
+
* protected readonly notes = injectLtOfflineSync<{ title: string }>('note');
|
|
150
|
+
*
|
|
151
|
+
* add(title: string) {
|
|
152
|
+
* return this.notes.create({ title });
|
|
153
|
+
* }
|
|
154
|
+
* }
|
|
155
|
+
* // template: @for (note of notes.records(); track note.id) { … } · notes.pendingCount() · notes.offline()
|
|
156
|
+
* ```
|
|
157
|
+
*/
|
|
158
|
+
export declare function injectLtOfflineSync<T extends Record<string, unknown> = Record<string, unknown>>(model: string, options?: LtOfflineSyncOptions<T>): LtOfflineSync<T>;
|
|
159
|
+
/** Resolved sync options (defaults ← `provideLtSync(options)` ← runtime `NG_PUBLIC_LT_SYNC_*`). */
|
|
160
|
+
export declare const LT_SYNC_OPTIONS: InjectionToken<Required<LtSyncOptions>>;
|
|
161
|
+
/**
|
|
162
|
+
* Offline sync with the nest-server sync module (≥ 12.2.0), opt-in.
|
|
163
|
+
*
|
|
164
|
+
* Configures the framework-free engine (API URL, base path, the auth-aware `LT_FETCH`) and registers a sign-out hook:
|
|
165
|
+
* before `POST /iam/sign-out` the outbox of the signed-in user is flushed (≤ 5 s), afterwards the IndexedDB is deleted,
|
|
166
|
+
* so no record, cursor or unsent change survives a sign-out. Requires `provideLtAuth()`.
|
|
167
|
+
*/
|
|
168
|
+
export declare function provideLtSync(options?: LtSyncOptions): EnvironmentProviders;
|
|
169
|
+
/** The request could not reach the server */
|
|
170
|
+
export declare class LtSyncOfflineError extends Error {
|
|
171
|
+
constructor(cause: unknown);
|
|
172
|
+
}
|
|
173
|
+
/** The server answered 401: the session ended. Nothing was applied, nothing is discarded (§4) */
|
|
174
|
+
export declare class LtSyncUnauthorizedError extends Error {
|
|
175
|
+
constructor();
|
|
176
|
+
}
|
|
177
|
+
/** The server asked to slow down: 429 with `Retry-After`, or 503 (§10) */
|
|
178
|
+
export declare class LtSyncBackoffError extends Error {
|
|
179
|
+
readonly status: number;
|
|
180
|
+
readonly retryAfterMs: number | undefined;
|
|
181
|
+
constructor(status: number, retryAfterMs: number | undefined);
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* An ObjectId-hex id with the random tail §3 requires: 4 timestamp bytes plus 8 bytes from a secure
|
|
185
|
+
* source, fresh for every id. A driver's default ObjectId would make the next id predictable.
|
|
186
|
+
*/
|
|
187
|
+
export declare function ltSyncObjectId(): string;
|
|
188
|
+
/** A uuidv7: 48 bits of milliseconds, version 7, the variant, the rest random (`crypto.randomUUID()` is v4) */
|
|
189
|
+
export declare function ltSyncUuidV7(): string;
|
|
190
|
+
/**
|
|
191
|
+
* Environment of the engine, set by `provideLtSync()` from DI (API URL builder, sync base path, the auth-aware
|
|
192
|
+
* `LT_FETCH`). The engine itself stays framework-free; tests call {@link configureLtSync} directly.
|
|
193
|
+
*/
|
|
194
|
+
interface LtSyncEnvironment {
|
|
195
|
+
/** Sync base path (default `/sync`). */
|
|
196
|
+
basePath: string;
|
|
197
|
+
/** Build a full API URL for a path (`LtApiUrlService.buildUrl`). */
|
|
198
|
+
buildApiUrl: (path: string) => string;
|
|
199
|
+
/** `fetch` for every request (the auth-aware `LT_FETCH`: cookie or JWT like every other request). */
|
|
200
|
+
fetch: (input: string, init: RequestInit) => Promise<Response>;
|
|
201
|
+
}
|
|
202
|
+
/** Set the engine environment (done by `provideLtSync()`). */
|
|
203
|
+
export declare function configureLtSync(env: Partial<LtSyncEnvironment>): void;
|
|
204
|
+
/** The sync base path (default `/sync`) */
|
|
205
|
+
export declare function getLtSyncBasePath(): string;
|
|
206
|
+
/** A full URL for a sync path, e.g. `/note?limit=200` or `/hints?models=note` */
|
|
207
|
+
export declare function buildLtSyncUrl(path: string): string;
|
|
208
|
+
/** The configured fetch (auth-aware once `provideLtSync()` ran). */
|
|
209
|
+
export declare function ltSyncFetch(input: string, init: RequestInit): Promise<Response>;
|
|
210
|
+
/** Options of the protocol engine */
|
|
211
|
+
interface LtSyncEngineOptions<T> {
|
|
212
|
+
/** `fetch` for the requests (default: the auth-aware `LT_FETCH` set by `provideLtSync()`) */
|
|
213
|
+
fetch?: (input: string, init: RequestInit) => Promise<Response>;
|
|
214
|
+
idFormat?: LtSyncIdFormat;
|
|
215
|
+
/** The model's name under the sync base path */
|
|
216
|
+
model: string;
|
|
217
|
+
onConflict?: (conflict: LtSyncConflict<T>) => LtSyncConflictResolution<T> | Promise<LtSyncConflictResolution<T>>;
|
|
218
|
+
pageLimit?: number;
|
|
219
|
+
tenantId?: string;
|
|
220
|
+
}
|
|
221
|
+
/** The protocol engine of one model */
|
|
222
|
+
interface LtSyncEngine<T> {
|
|
223
|
+
create: (data: T) => Promise<LtSyncRecord<T>>;
|
|
224
|
+
get: (id: string) => Promise<LtSyncRecord<T> | undefined>;
|
|
225
|
+
/** The live local records, sorted by id */
|
|
226
|
+
list: () => Promise<LtSyncRecord<T>[]>;
|
|
227
|
+
readonly model: string;
|
|
228
|
+
/** Where the engine keeps its data: the model, or the model and the tenant */
|
|
229
|
+
readonly scope: string;
|
|
230
|
+
pendingCount: () => Promise<number>;
|
|
231
|
+
/** Push the outbox only — the sign-out flush. Never throws */
|
|
232
|
+
pushPending: () => Promise<void>;
|
|
233
|
+
remove: (id: string) => Promise<void>;
|
|
234
|
+
/** Push the outbox, then pull until `hasMore` is false. Never throws for offline, 401 or a backoff */
|
|
235
|
+
sync: () => Promise<LtSyncResult>;
|
|
236
|
+
update: (id: string, data: Partial<T>) => Promise<LtSyncRecord<T>>;
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Where a model's local data lives: per model, and per tenant when one is given. A change made
|
|
240
|
+
* under one tenant must never go out with another tenant's `X-Tenant-Id` — the server stamps a
|
|
241
|
+
* create into the tenant of the header — nor show in that tenant's list.
|
|
242
|
+
*/
|
|
243
|
+
export declare function ltSyncScope(model: string, tenantId?: string): string;
|
|
244
|
+
/** Create the protocol engine of one model and register it for the sign-out flush */
|
|
245
|
+
export declare function createLtSyncEngine<T extends Record<string, unknown> = Record<string, unknown>>(options: LtSyncEngineOptions<T>): LtSyncEngine<T>;
|
|
246
|
+
/**
|
|
247
|
+
* Before sign-out: send what is still unsent, for at most `timeoutMs`, never failing. Whatever
|
|
248
|
+
* did not go out is deleted with the rest afterwards — after signing out it could not be pushed
|
|
249
|
+
* under this account anyway (nest-server `SECURITY.md`).
|
|
250
|
+
*
|
|
251
|
+
* Only when the local data belongs to `userId`, the user signing out. After an expired session
|
|
252
|
+
* the outbox of the PREVIOUS user is still on the device; sent now, it would be created and
|
|
253
|
+
* changed under the current user's session and account. It is deleted unsent instead.
|
|
254
|
+
*/
|
|
255
|
+
export declare function flushLtSyncBeforeSignOut(userId: string | undefined, timeoutMs?: number): Promise<void>;
|
|
256
|
+
/** Forget the registered engines (tests) */
|
|
257
|
+
export declare function resetLtSyncEngines(): void;
|
|
258
|
+
/**
|
|
259
|
+
* The hint stream of the offline sync: `GET <basePath>/hints` as server-sent events (protocol §9).
|
|
260
|
+
*
|
|
261
|
+
* Read with `fetch` and a `ReadableStream`, not `EventSource`: an EventSource cannot send an
|
|
262
|
+
* `Authorization` header, so in JWT mode (the fallback the auth-aware fetch switches to when the cookie
|
|
263
|
+
* is refused) it would never be signed in (decision E2 of DEV-3917).
|
|
264
|
+
*
|
|
265
|
+
* The server ends a stream on purpose before its first hint after the re-check interval (30 s by
|
|
266
|
+
* default) and does not replay that hint. So every (re)connect calls `onConnect`, and the caller
|
|
267
|
+
* pulls once — without it a change would wait for the next focus or start whenever hints are
|
|
268
|
+
* further apart than the interval.
|
|
269
|
+
*/
|
|
270
|
+
interface LtSyncHintsOptions {
|
|
271
|
+
/** `fetch` for the stream (default: the auth-aware `LT_FETCH`) */
|
|
272
|
+
fetch?: (input: string, init: RequestInit) => Promise<Response>;
|
|
273
|
+
/** The models to hear about; a model the caller may not pull simply never sends a hint */
|
|
274
|
+
models: string[];
|
|
275
|
+
/** Every (re)connect. Hints sent while disconnected are not replayed: pull once (§9) */
|
|
276
|
+
onConnect: () => void;
|
|
277
|
+
/** A change of `model` was committed: pulling is worthwhile */
|
|
278
|
+
onHint: (model: string) => void;
|
|
279
|
+
/** The stream stopped for good: the server switched SSE off (`404`) or the session ended (`401`) */
|
|
280
|
+
onStop?: (reason: 'disabled' | 'unauthorized') => void;
|
|
281
|
+
/** Restrict to one tenant (`X-Tenant-Id`) */
|
|
282
|
+
tenantId?: string;
|
|
283
|
+
}
|
|
284
|
+
/** One instance listening for the hints of its model */
|
|
285
|
+
interface LtSyncHintSubscriber {
|
|
286
|
+
model: string;
|
|
287
|
+
onConnect: () => void;
|
|
288
|
+
onHint: () => void;
|
|
289
|
+
onStop?: (reason: 'disabled' | 'unauthorized') => void;
|
|
290
|
+
tenantId?: string;
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Listen for the hints of a model on the ONE stream this tab keeps per tenant, for every model in
|
|
294
|
+
* use (`?models=` takes a list, §9). A stream per `useLtOfflineSync()` call would hold a connection
|
|
295
|
+
* each; over HTTP/1.1 a browser allows six per host, so six instances on one page would stall every
|
|
296
|
+
* other request to the API, sign-in and sign-out included. Answers the unsubscribe.
|
|
297
|
+
*/
|
|
298
|
+
export declare function subscribeLtSyncHints(subscriber: LtSyncHintSubscriber): () => void;
|
|
299
|
+
/**
|
|
300
|
+
* Open the hint stream and keep it open — reconnecting after the server ends it, backing off after
|
|
301
|
+
* failures — until the returned `close()` is called or the stream stops for good (`onStop`).
|
|
302
|
+
*/
|
|
303
|
+
export declare function openLtSyncHints(options: LtSyncHintsOptions): () => void;
|
|
304
|
+
/** Name of the database every model shares */
|
|
305
|
+
export declare const LT_SYNC_DB_NAME = "lt-offline-sync";
|
|
306
|
+
/** BroadcastChannel the tabs of an origin use to tell each other about changes */
|
|
307
|
+
export declare const LT_SYNC_CHANNEL_NAME = "lt-offline-sync";
|
|
308
|
+
/** An outbox entry: a protocol push item (§6.2) plus local bookkeeping */
|
|
309
|
+
interface LtSyncOutboxItem {
|
|
310
|
+
/** Set once a push carried the item; it is never changed again, a repeat must carry the same change (§6.5) */
|
|
311
|
+
attempted?: boolean;
|
|
312
|
+
baseVersion?: number;
|
|
313
|
+
data?: Record<string, unknown>;
|
|
314
|
+
id: string;
|
|
315
|
+
mutationId: string;
|
|
316
|
+
op: 'delete' | 'upsert';
|
|
317
|
+
seq?: number;
|
|
318
|
+
}
|
|
319
|
+
/** What `run()` hands its callback: the transaction's operations, scoped to one model */
|
|
320
|
+
interface LtSyncStoreTx {
|
|
321
|
+
addOutbox: (item: LtSyncOutboxItem) => Promise<unknown>;
|
|
322
|
+
/** Delete every local record of the model except `keepIds` */
|
|
323
|
+
clearRecords: (keepIds: Set<string>) => Promise<void>;
|
|
324
|
+
deleteMeta: (key: string) => Promise<unknown>;
|
|
325
|
+
deleteRecord: (id: string) => Promise<unknown>;
|
|
326
|
+
getMeta: <V = unknown>(key: string) => Promise<undefined | V>;
|
|
327
|
+
getRecord: (id: string) => Promise<LtSyncRecord | undefined>;
|
|
328
|
+
/** The model's unsent changes in the order they were made */
|
|
329
|
+
listOutbox: () => Promise<LtSyncOutboxItem[]>;
|
|
330
|
+
listRecords: () => Promise<LtSyncRecord[]>;
|
|
331
|
+
putOutbox: (item: LtSyncOutboxItem) => Promise<unknown>;
|
|
332
|
+
putRecord: (record: LtSyncRecord) => Promise<unknown>;
|
|
333
|
+
removeOutbox: (mutationId: string) => Promise<void>;
|
|
334
|
+
setMeta: (key: string, value: unknown) => Promise<unknown>;
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* The data no longer belongs to the user a sync run started for: signed out (database deleted) or
|
|
338
|
+
* another account claimed it. The run's write was refused, nothing of it was stored.
|
|
339
|
+
*/
|
|
340
|
+
export declare class LtSyncOwnerChangedError extends Error {
|
|
341
|
+
constructor();
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* Run `fn` in one read-write transaction over the scope's records, outbox and meta values. `scope`
|
|
345
|
+
* is a model, or a model and tenant (`note#<tenantId>`).
|
|
346
|
+
*
|
|
347
|
+
* With `owner`, the transaction first checks that the data still belongs to that user and refuses
|
|
348
|
+
* otherwise (`LtSyncOwnerChangedError`). A sync answer can arrive after sign-out deleted the
|
|
349
|
+
* database, or after another account claimed it — in this tab or another one. Unfenced, it would
|
|
350
|
+
* reopen the database and write the previous user's records for the next user to see.
|
|
351
|
+
*/
|
|
352
|
+
export declare function runLtSyncTx<R>(model: string, fn: (tx: LtSyncStoreTx) => Promise<R>, options?: {
|
|
353
|
+
owner?: string;
|
|
354
|
+
}): Promise<R>;
|
|
355
|
+
/** The scopes (model, or model and tenant) that hold unsent changes, in no particular order */
|
|
356
|
+
export declare function listLtSyncPendingModels(): Promise<string[]>;
|
|
357
|
+
/** The user the local data belongs to, if any */
|
|
358
|
+
export declare function getLtSyncOwner(): Promise<string | undefined>;
|
|
359
|
+
/**
|
|
360
|
+
* Bind the local data to the signed-in user, in ONE transaction. The same user keeps it. Anybody
|
|
361
|
+
* else — another user, or nobody at all while data is present — means it is not this user's: every
|
|
362
|
+
* model is wiped before anything is shown or pulled (nest-server `SECURITY.md`). Data without an
|
|
363
|
+
* owner can only be a write that outlived a sign-out, which is exactly what must not be inherited.
|
|
364
|
+
* Answers whether it wiped.
|
|
365
|
+
*/
|
|
366
|
+
export declare function claimLtSyncOwner(userId: string): Promise<boolean>;
|
|
367
|
+
/**
|
|
368
|
+
* Delete every record, cursor and unsent change of every model — on sign-out. Other tabs close
|
|
369
|
+
* their connection on `versionchange` and are told via the channel. A sync answer arriving later
|
|
370
|
+
* finds no owner and is refused (`runLtSyncTx` with `owner`).
|
|
371
|
+
*/
|
|
372
|
+
export declare function deleteLtSyncDatabase(): Promise<void>;
|
|
373
|
+
/** Messages the tabs exchange */
|
|
374
|
+
type LtSyncMessage = {
|
|
375
|
+
scope: string;
|
|
376
|
+
type: 'changed';
|
|
377
|
+
} | {
|
|
378
|
+
type: 'cleared';
|
|
379
|
+
};
|
|
380
|
+
export type { LtOfflineSync, LtOfflineSyncOptions, LtOfflineSyncState, LtSyncConflict, LtSyncConflictResolution, LtSyncEngine, LtSyncEngineOptions, LtSyncEnvironment, LtSyncHintSubscriber, LtSyncHintsOptions, LtSyncIdFormat, LtSyncItemStatus, LtSyncMessage, LtSyncOptions, LtSyncOutboxItem, LtSyncPushResult, LtSyncRecord, LtSyncResult, LtSyncStoreTx };
|