@wavemaker/app-ng-runtime 11.8.0-next.24904 → 11.8.0-next.27301
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.
- app-ng-runtime/build-task/bundles/index.umd.js +5 -5
- app-ng-runtime/build-task/esm2022/basic/progress/progress-bar/progress-bar.build.mjs +1 -1
- app-ng-runtime/build-task/esm2022/page/page.build.mjs +3 -2
- app-ng-runtime/build-task/fesm2022/index.mjs +2 -1
- app-ng-runtime/build-task/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/components/advanced/carousel/bundles/index.umd.js +5 -5
- app-ng-runtime/components/advanced/carousel/esm2022/carousel.animator.mjs +3 -2
- app-ng-runtime/components/advanced/carousel/esm2022/carousel.directive.mjs +1 -1
- app-ng-runtime/components/advanced/carousel/fesm2022/index.mjs +2 -1
- app-ng-runtime/components/advanced/carousel/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/components/advanced/login/bundles/index.umd.js +6 -6
- app-ng-runtime/components/advanced/login/esm2022/login.component.mjs +4 -3
- app-ng-runtime/components/advanced/login/fesm2022/index.mjs +3 -2
- app-ng-runtime/components/advanced/login/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/components/base/bundles/index.umd.js +203 -171
- app-ng-runtime/components/base/esm2022/directives/show-in-device.directive.mjs +1 -1
- app-ng-runtime/components/base/esm2022/pipes/custom-pipes.mjs +12 -11
- app-ng-runtime/components/base/esm2022/pipes/wm-pipe.mjs +3 -2
- app-ng-runtime/components/base/esm2022/utils/data-utils.mjs +30 -29
- app-ng-runtime/components/base/esm2022/utils/form-utils.mjs +47 -41
- app-ng-runtime/components/base/esm2022/utils/live-utils.mjs +8 -7
- app-ng-runtime/components/base/esm2022/utils/widget-utils.mjs +28 -27
- app-ng-runtime/components/base/esm2022/widgets/common/base/base-container.component.mjs +4 -3
- app-ng-runtime/components/base/esm2022/widgets/common/base/base-field-validations.mjs +24 -21
- app-ng-runtime/components/base/esm2022/widgets/common/base/base.component.mjs +12 -11
- app-ng-runtime/components/base/esm2022/widgets/common/base/dataset-aware-nav.component.mjs +40 -14
- app-ng-runtime/components/base/esm2022/widgets/common/base/partial-container.directive.mjs +3 -2
- app-ng-runtime/components/base/esm2022/widgets/common/dialog/dialog.service.mjs +3 -2
- app-ng-runtime/components/base/esm2022/widgets/common/lazy-load/lazy-load.directive.mjs +1 -1
- app-ng-runtime/components/base/esm2022/widgets/common/partial/partial.directive.mjs +3 -2
- app-ng-runtime/components/base/esm2022/widgets/common/partial-param/partial-param.directive.mjs +3 -2
- app-ng-runtime/components/base/esm2022/widgets/common/smooth-scroll/smooth-scroll.directive.mjs +6 -5
- app-ng-runtime/components/base/esm2022/widgets/framework/deviceview.mjs +1 -1
- app-ng-runtime/components/base/esm2022/widgets/framework/property-change-handler.mjs +3 -2
- app-ng-runtime/components/base/esm2022/widgets/framework/widget-proxy-provider.mjs +4 -3
- app-ng-runtime/components/base/fesm2022/index.mjs +206 -173
- app-ng-runtime/components/base/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/components/base/pipes/custom-pipes.d.ts +1 -1
- app-ng-runtime/components/base/utils/data-utils.d.ts +0 -1
- app-ng-runtime/components/base/utils/widget-utils.d.ts +2 -2
- app-ng-runtime/components/base/widgets/common/base/base-field-validations.d.ts +1 -1
- app-ng-runtime/components/base/widgets/common/base/partial-container.directive.d.ts +1 -1
- app-ng-runtime/components/basic/default/bundles/index.umd.js +10 -10
- app-ng-runtime/components/basic/default/esm2022/label/label.directive.mjs +4 -3
- app-ng-runtime/components/basic/default/esm2022/spinner/spinner.component.mjs +6 -5
- app-ng-runtime/components/basic/default/fesm2022/index.mjs +7 -6
- app-ng-runtime/components/basic/default/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/components/basic/progress/bundles/index.umd.js +13 -13
- app-ng-runtime/components/basic/progress/esm2022/progress-bar/progress-bar.component.mjs +5 -4
- app-ng-runtime/components/basic/progress/esm2022/progress-circle/progress-circle.component.mjs +6 -5
- app-ng-runtime/components/basic/progress/esm2022/utils.mjs +3 -3
- app-ng-runtime/components/basic/progress/fesm2022/index.mjs +10 -9
- app-ng-runtime/components/basic/progress/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/components/basic/rich-text-editor/bundles/index.umd.js +15 -10
- app-ng-runtime/components/basic/rich-text-editor/esm2022/rich-text-editor.component.mjs +14 -8
- app-ng-runtime/components/basic/rich-text-editor/fesm2022/index.mjs +13 -7
- app-ng-runtime/components/basic/rich-text-editor/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/components/basic/rich-text-editor/rich-text-editor.component.d.ts +2 -2
- app-ng-runtime/components/basic/search/bundles/index.umd.js +67 -65
- app-ng-runtime/components/basic/search/esm2022/data-provider/data-provider.mjs +1 -1
- app-ng-runtime/components/basic/search/esm2022/data-provider/local-data-provider.mjs +26 -23
- app-ng-runtime/components/basic/search/esm2022/data-provider/remote-data-provider.mjs +12 -11
- app-ng-runtime/components/basic/search/esm2022/search.component.mjs +31 -30
- app-ng-runtime/components/basic/search/fesm2022/index.mjs +66 -63
- app-ng-runtime/components/basic/search/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/components/basic/tree/bundles/index.umd.js +9 -9
- app-ng-runtime/components/basic/tree/esm2022/tree.component.mjs +7 -6
- app-ng-runtime/components/basic/tree/fesm2022/index.mjs +6 -5
- app-ng-runtime/components/basic/tree/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/components/chart/bundles/index.umd.js +72 -63
- app-ng-runtime/components/chart/chart.component.d.ts +1 -1
- app-ng-runtime/components/chart/chart.utils.d.ts +3 -3
- app-ng-runtime/components/chart/esm2022/chart.component.mjs +58 -48
- app-ng-runtime/components/chart/esm2022/chart.utils.mjs +14 -13
- app-ng-runtime/components/chart/fesm2022/index.mjs +69 -59
- app-ng-runtime/components/chart/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/components/containers/accordion/bundles/index.umd.js +16 -16
- app-ng-runtime/components/containers/accordion/esm2022/accordion.directive.mjs +14 -13
- app-ng-runtime/components/containers/accordion/fesm2022/index.mjs +13 -12
- app-ng-runtime/components/containers/accordion/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/components/containers/panel/bundles/index.umd.js +5 -5
- app-ng-runtime/components/containers/panel/esm2022/panel.component.mjs +3 -2
- app-ng-runtime/components/containers/panel/fesm2022/index.mjs +2 -1
- app-ng-runtime/components/containers/panel/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/components/containers/panel/panel.component.d.ts +1 -1
- app-ng-runtime/components/containers/tabs/bundles/index.umd.js +17 -17
- app-ng-runtime/components/containers/tabs/esm2022/tabs.component.mjs +15 -14
- app-ng-runtime/components/containers/tabs/fesm2022/index.mjs +14 -13
- app-ng-runtime/components/containers/tabs/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/components/data/form/bundles/index.umd.js +75 -75
- app-ng-runtime/components/data/form/esm2022/form-action/form-action.directive.mjs +3 -2
- app-ng-runtime/components/data/form/esm2022/form-field/form-field.directive.mjs +10 -9
- app-ng-runtime/components/data/form/esm2022/form.component.mjs +54 -53
- app-ng-runtime/components/data/form/esm2022/live-filter/live-filter.directive.mjs +3 -2
- app-ng-runtime/components/data/form/esm2022/live-form/live-form.directive.mjs +11 -10
- app-ng-runtime/components/data/form/fesm2022/index.mjs +77 -76
- app-ng-runtime/components/data/form/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/components/data/form/form.component.d.ts +2 -2
- app-ng-runtime/components/data/form/live-form/live-form.directive.d.ts +1 -1
- app-ng-runtime/components/data/list/bundles/index.umd.js +692 -687
- app-ng-runtime/components/data/list/esm2022/list-item.directive.mjs +1 -1
- app-ng-runtime/components/data/list/esm2022/list.animator.mjs +5 -3
- app-ng-runtime/components/data/list/esm2022/list.component.mjs +687 -682
- app-ng-runtime/components/data/list/fesm2022/index.mjs +690 -684
- app-ng-runtime/components/data/list/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/components/data/list/list.component.d.ts +53 -53
- app-ng-runtime/components/data/live-table/bundles/index.umd.js +1 -1
- app-ng-runtime/components/data/live-table/esm2022/live-table.component.mjs +2 -2
- app-ng-runtime/components/data/live-table/fesm2022/index.mjs +1 -1
- app-ng-runtime/components/data/live-table/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/components/data/pagination/bundles/index.umd.js +14 -14
- app-ng-runtime/components/data/pagination/esm2022/pagination.component.mjs +12 -11
- app-ng-runtime/components/data/pagination/fesm2022/index.mjs +11 -10
- app-ng-runtime/components/data/pagination/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/components/data/table/bundles/index.umd.js +175 -172
- app-ng-runtime/components/data/table/esm2022/table-action/table-action.directive.mjs +3 -2
- app-ng-runtime/components/data/table/esm2022/table-column/table-column.directive.mjs +19 -18
- app-ng-runtime/components/data/table/esm2022/table-cud.directive.mjs +7 -6
- app-ng-runtime/components/data/table/esm2022/table-filter.directive.mjs +53 -55
- app-ng-runtime/components/data/table/esm2022/table-row-action/table-row-action.directive.mjs +3 -2
- app-ng-runtime/components/data/table/esm2022/table.component.mjs +98 -91
- app-ng-runtime/components/data/table/fesm2022/index.mjs +172 -168
- app-ng-runtime/components/data/table/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/components/data/table/table-column/table-column.directive.d.ts +6 -6
- app-ng-runtime/components/data/table/table.component.d.ts +2 -2
- app-ng-runtime/components/dialogs/default/bundles/index.umd.js +2 -2
- app-ng-runtime/components/dialogs/default/esm2022/base-dialog.mjs +3 -3
- app-ng-runtime/components/dialogs/default/esm2022/dialog-body/dialog-body.directive.mjs +1 -1
- app-ng-runtime/components/dialogs/default/fesm2022/index.mjs +1 -1
- app-ng-runtime/components/dialogs/default/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/components/input/calendar/bundles/index.umd.js +33 -31
- app-ng-runtime/components/input/calendar/esm2022/calendar.component.mjs +31 -28
- app-ng-runtime/components/input/calendar/fesm2022/index.mjs +30 -27
- app-ng-runtime/components/input/calendar/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/components/input/chips/bundles/index.umd.js +29 -28
- app-ng-runtime/components/input/chips/chips.component.d.ts +1 -1
- app-ng-runtime/components/input/chips/esm2022/chips.component.mjs +27 -25
- app-ng-runtime/components/input/chips/fesm2022/index.mjs +26 -24
- app-ng-runtime/components/input/chips/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/components/input/default/base-form.component.d.ts +3 -3
- app-ng-runtime/components/input/default/bundles/index.umd.js +75 -62
- app-ng-runtime/components/input/default/checkbox/checkbox.component.d.ts +1 -0
- app-ng-runtime/components/input/default/dataset-aware-form.component.d.ts +4 -4
- app-ng-runtime/components/input/default/esm2022/base-form.component.mjs +14 -8
- app-ng-runtime/components/input/default/esm2022/caption-position.directive.mjs +3 -2
- app-ng-runtime/components/input/default/esm2022/checkbox/checkbox.component.mjs +2 -2
- app-ng-runtime/components/input/default/esm2022/checkboxset/checkboxset.component.mjs +6 -4
- app-ng-runtime/components/input/default/esm2022/dataset-aware-form.component.mjs +29 -23
- app-ng-runtime/components/input/default/esm2022/radioset/radioset.component.mjs +4 -3
- app-ng-runtime/components/input/default/esm2022/select/select.component.mjs +4 -3
- app-ng-runtime/components/input/default/esm2022/switch/switch.component.mjs +6 -5
- app-ng-runtime/components/input/default/esm2022/text/base/base-input.mjs +4 -3
- app-ng-runtime/components/input/default/esm2022/text/locale/number-locale.mjs +20 -18
- app-ng-runtime/components/input/default/esm2022/text/text/input-text.component.mjs +2 -2
- app-ng-runtime/components/input/default/fesm2022/index.mjs +75 -62
- app-ng-runtime/components/input/default/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/components/input/epoch/base-date-time.component.d.ts +1 -1
- app-ng-runtime/components/input/epoch/bundles/index.umd.js +53 -51
- app-ng-runtime/components/input/epoch/esm2022/base-date-time.component.mjs +34 -31
- app-ng-runtime/components/input/epoch/esm2022/date/date.component.mjs +5 -4
- app-ng-runtime/components/input/epoch/esm2022/date-time/date-time-picker.component.mjs +5 -4
- app-ng-runtime/components/input/epoch/esm2022/date-time/date-time.component.mjs +7 -6
- app-ng-runtime/components/input/epoch/esm2022/picker/picker.component.mjs +1 -1
- app-ng-runtime/components/input/epoch/esm2022/time/time.component.mjs +6 -5
- app-ng-runtime/components/input/epoch/fesm2022/index.mjs +48 -45
- app-ng-runtime/components/input/epoch/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/components/input/file-upload/bundles/index.umd.js +15 -15
- app-ng-runtime/components/input/file-upload/esm2022/file-upload.component.mjs +13 -12
- app-ng-runtime/components/input/file-upload/fesm2022/index.mjs +12 -11
- app-ng-runtime/components/input/file-upload/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/components/input/rating/bundles/index.umd.js +12 -12
- app-ng-runtime/components/input/rating/esm2022/rating.component.mjs +10 -9
- app-ng-runtime/components/input/rating/fesm2022/index.mjs +9 -8
- app-ng-runtime/components/input/rating/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/components/navigation/breadcrumb/bundles/index.umd.js +1 -1
- app-ng-runtime/components/navigation/breadcrumb/esm2022/breadcrumb.component.mjs +2 -2
- app-ng-runtime/components/navigation/breadcrumb/fesm2022/index.mjs +1 -1
- app-ng-runtime/components/navigation/breadcrumb/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/components/navigation/menu/bundles/index.umd.js +23 -22
- app-ng-runtime/components/navigation/menu/esm2022/menu-adapator.component.mjs +3 -2
- app-ng-runtime/components/navigation/menu/esm2022/menu-dropdown-item/menu-dropdown-item.component.mjs +6 -5
- app-ng-runtime/components/navigation/menu/esm2022/menu.component.mjs +8 -7
- app-ng-runtime/components/navigation/menu/esm2022/nav/nav.component.mjs +10 -8
- app-ng-runtime/components/navigation/menu/fesm2022/index.mjs +20 -18
- app-ng-runtime/components/navigation/menu/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/components/navigation/menu/menu-dropdown-item/menu-dropdown-item.component.d.ts +12 -1
- app-ng-runtime/components/navigation/popover/esm2022/popover.component.mjs +1 -1
- app-ng-runtime/components/navigation/popover/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/components/prefab/bundles/index.umd.js +6 -6
- app-ng-runtime/components/prefab/esm2022/prefab-container/prefab-container.directive.mjs +3 -2
- app-ng-runtime/components/prefab/esm2022/prefab.directive.mjs +3 -2
- app-ng-runtime/components/prefab/fesm2022/index.mjs +3 -2
- app-ng-runtime/components/prefab/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/core/bundles/index.umd.js +119 -130
- app-ng-runtime/core/esm2022/public_api.mjs +2 -2
- app-ng-runtime/core/esm2022/services/field-type.service.mjs +3 -2
- app-ng-runtime/core/esm2022/services/field-widget.service.mjs +3 -2
- app-ng-runtime/core/esm2022/services/pagination.service.mjs +7 -6
- app-ng-runtime/core/esm2022/services/state-persistence.service.mjs +17 -16
- app-ng-runtime/core/esm2022/services/utils.service.mjs +3 -2
- app-ng-runtime/core/esm2022/services/viewport.service.mjs +3 -2
- app-ng-runtime/core/esm2022/utils/build-utils.mjs +5 -4
- app-ng-runtime/core/esm2022/utils/expression-parser.mjs +5 -4
- app-ng-runtime/core/esm2022/utils/lru-cache.mjs +3 -2
- app-ng-runtime/core/esm2022/utils/utils.mjs +79 -82
- app-ng-runtime/core/esm2022/utils/watcher.mjs +9 -7
- app-ng-runtime/core/fesm2022/index.mjs +117 -123
- app-ng-runtime/core/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/core/public_api.d.ts +1 -1
- app-ng-runtime/core/services/pagination.service.d.ts +1 -1
- app-ng-runtime/core/utils/utils.d.ts +5 -9
- app-ng-runtime/http/bundles/index.umd.js +7 -7
- app-ng-runtime/http/esm2022/http.service.mjs +5 -4
- app-ng-runtime/http/esm2022/wm-http-request.mjs +1 -1
- app-ng-runtime/http/esm2022/wm-http-response.mjs +1 -1
- app-ng-runtime/http/fesm2022/index.mjs +4 -3
- app-ng-runtime/http/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/mobile/components/basic/default/bundles/index.umd.js +24 -20
- app-ng-runtime/mobile/components/basic/default/esm2022/anchor/anchor.directive.mjs +5 -4
- app-ng-runtime/mobile/components/basic/default/esm2022/file-browser/file-browser.component.mjs +12 -8
- app-ng-runtime/mobile/components/basic/default/esm2022/file-browser/file-selector.service.mjs +5 -3
- app-ng-runtime/mobile/components/basic/default/esm2022/image-cache/image-cache.directive.mjs +3 -2
- app-ng-runtime/mobile/components/basic/default/esm2022/process-manager/process-manager.component.mjs +5 -4
- app-ng-runtime/mobile/components/basic/default/fesm2022/index.mjs +21 -16
- app-ng-runtime/mobile/components/basic/default/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/mobile/components/containers/segmented-control/bundles/index.umd.js +7 -7
- app-ng-runtime/mobile/components/containers/segmented-control/esm2022/segment-content/segment-content.component.mjs +2 -2
- app-ng-runtime/mobile/components/containers/segmented-control/esm2022/segmented-control.component.mjs +4 -3
- app-ng-runtime/mobile/components/containers/segmented-control/fesm2022/index.mjs +4 -3
- app-ng-runtime/mobile/components/containers/segmented-control/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/mobile/components/data/media-list/bundles/index.umd.js +8 -8
- app-ng-runtime/mobile/components/data/media-list/esm2022/media-list.component.mjs +4 -3
- app-ng-runtime/mobile/components/data/media-list/fesm2022/index.mjs +3 -2
- app-ng-runtime/mobile/components/data/media-list/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/mobile/components/page/default/bundles/index.umd.js +5 -5
- app-ng-runtime/mobile/components/page/default/esm2022/page.directive.mjs +3 -2
- app-ng-runtime/mobile/components/page/default/fesm2022/index.mjs +2 -1
- app-ng-runtime/mobile/components/page/default/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/mobile/components/page/tab-bar/bundles/index.umd.js +9 -9
- app-ng-runtime/mobile/components/page/tab-bar/esm2022/tabbar.component.mjs +7 -6
- app-ng-runtime/mobile/components/page/tab-bar/fesm2022/index.mjs +6 -5
- app-ng-runtime/mobile/components/page/tab-bar/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/mobile/core/bundles/index.umd.js +25 -25
- app-ng-runtime/mobile/core/esm2022/services/device-file-download.service.mjs +5 -4
- app-ng-runtime/mobile/core/esm2022/services/device-file-opener.service.mjs +3 -2
- app-ng-runtime/mobile/core/esm2022/services/device-file-upload.service.mjs +4 -3
- app-ng-runtime/mobile/core/esm2022/services/device-file.service.mjs +6 -5
- app-ng-runtime/mobile/core/esm2022/services/device.service.mjs +3 -2
- app-ng-runtime/mobile/core/esm2022/services/ext-app-message.service.mjs +5 -4
- app-ng-runtime/mobile/core/esm2022/services/network.service.mjs +9 -8
- app-ng-runtime/mobile/core/fesm2022/index.mjs +22 -21
- app-ng-runtime/mobile/core/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/mobile/core/services/ext-app-message.service.d.ts +1 -1
- app-ng-runtime/mobile/core/services/network.service.d.ts +7 -1
- app-ng-runtime/mobile/offline/bundles/index.umd.js +161 -144
- app-ng-runtime/mobile/offline/esm2022/models/local-db-store.mjs +23 -21
- app-ng-runtime/mobile/offline/esm2022/services/change-log.service.mjs +7 -6
- app-ng-runtime/mobile/offline/esm2022/services/local-db-data-pull.service.mjs +37 -35
- app-ng-runtime/mobile/offline/esm2022/services/local-db-management.service.mjs +54 -45
- app-ng-runtime/mobile/offline/esm2022/services/local-db.service.mjs +5 -4
- app-ng-runtime/mobile/offline/esm2022/services/workers/error-blocker.mjs +4 -3
- app-ng-runtime/mobile/offline/esm2022/services/workers/file-handler.mjs +18 -13
- app-ng-runtime/mobile/offline/esm2022/services/workers/multi-part-param-transformer.mjs +9 -5
- app-ng-runtime/mobile/offline/esm2022/utils/live-variable.utils.mjs +12 -11
- app-ng-runtime/mobile/offline/esm2022/utils/query-executor.utils.mjs +5 -4
- app-ng-runtime/mobile/offline/esm2022/utils/security.utils.mjs +3 -2
- app-ng-runtime/mobile/offline/fesm2022/index.mjs +156 -138
- app-ng-runtime/mobile/offline/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/mobile/runtime/bundles/index.umd.js +11 -8
- app-ng-runtime/mobile/runtime/esm2022/mobile-runtime.module.mjs +3 -2
- app-ng-runtime/mobile/runtime/esm2022/services/cookie.service.mjs +6 -2
- app-ng-runtime/mobile/runtime/esm2022/services/http-interceptor.service.mjs +4 -3
- app-ng-runtime/mobile/runtime/fesm2022/index.mjs +8 -4
- app-ng-runtime/mobile/runtime/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/mobile/runtime-dynamic/bundles/index.umd.js +2 -2
- app-ng-runtime/mobile/runtime-dynamic/esm2022/services/live-sync.service.mjs +3 -3
- app-ng-runtime/mobile/runtime-dynamic/fesm2022/index.mjs +2 -2
- app-ng-runtime/mobile/runtime-dynamic/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/mobile/variables/bundles/index.umd.js +23 -16
- app-ng-runtime/mobile/variables/esm2022/services/camera-service.mjs +2 -2
- app-ng-runtime/mobile/variables/esm2022/services/datasync-service.mjs +10 -9
- app-ng-runtime/mobile/variables/esm2022/services/file-service.mjs +11 -3
- app-ng-runtime/mobile/variables/fesm2022/index.mjs +19 -11
- app-ng-runtime/mobile/variables/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/oAuth/bundles/index.umd.js +12 -12
- app-ng-runtime/oAuth/esm2022/oAuth.service.mjs +4 -3
- app-ng-runtime/oAuth/esm2022/oAuth.utils.mjs +8 -7
- app-ng-runtime/oAuth/fesm2022/index.mjs +9 -8
- app-ng-runtime/oAuth/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/package.json +1 -1
- app-ng-runtime/runtime/base/bundles/index.umd.js +121 -120
- app-ng-runtime/runtime/base/esm2022/components/base-layout.component.mjs +4 -3
- app-ng-runtime/runtime/base/esm2022/components/base-page.component.mjs +14 -13
- app-ng-runtime/runtime/base/esm2022/components/base-partial.component.mjs +13 -12
- app-ng-runtime/runtime/base/esm2022/components/base-prefab.component.mjs +15 -14
- app-ng-runtime/runtime/base/esm2022/components/base-spa-page.component.mjs +14 -13
- app-ng-runtime/runtime/base/esm2022/components/custom-toaster.component.mjs +6 -5
- app-ng-runtime/runtime/base/esm2022/directives/accessroles.directive.mjs +11 -10
- app-ng-runtime/runtime/base/esm2022/guards/page-not-found.guard.mjs +1 -1
- app-ng-runtime/runtime/base/esm2022/guards/role.guard.mjs +3 -2
- app-ng-runtime/runtime/base/esm2022/services/app-defaults.service.mjs +1 -1
- app-ng-runtime/runtime/base/esm2022/services/app.manager.service.mjs +17 -14
- app-ng-runtime/runtime/base/esm2022/services/app.service.mjs +7 -6
- app-ng-runtime/runtime/base/esm2022/services/dynamic-component-ref-provider.service.mjs +3 -2
- app-ng-runtime/runtime/base/esm2022/services/http-interceptor.services.mjs +4 -3
- app-ng-runtime/runtime/base/esm2022/services/i18n.service.mjs +12 -10
- app-ng-runtime/runtime/base/esm2022/services/navigation.service.mjs +8 -7
- app-ng-runtime/runtime/base/esm2022/services/prefab-manager.service.mjs +3 -2
- app-ng-runtime/runtime/base/esm2022/services/spinner.service.mjs +7 -6
- app-ng-runtime/runtime/base/esm2022/services/toaster.service.mjs +6 -5
- app-ng-runtime/runtime/base/esm2022/util/wm-route-reuse-strategy.mjs +6 -7
- app-ng-runtime/runtime/base/fesm2022/index.mjs +119 -117
- app-ng-runtime/runtime/base/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/runtime/base/services/i18n.service.d.ts +1 -1
- app-ng-runtime/runtime/dynamic/bundles/index.umd.js +7 -7
- app-ng-runtime/runtime/dynamic/esm2022/app/services/component-ref-provider.service.mjs +4 -3
- app-ng-runtime/runtime/dynamic/esm2022/main.mjs +3 -2
- app-ng-runtime/runtime/dynamic/fesm2022/index.mjs +4 -3
- app-ng-runtime/runtime/dynamic/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/scripts/jquery-ui/ui/widgets/droppable.js +7 -7
- app-ng-runtime/scripts/jquery-ui/ui/widgets/resizable.js +13 -10
- app-ng-runtime/scripts/jquery-ui/ui/widgets/sortable.js +7 -7
- app-ng-runtime/security/bundles/index.umd.js +14 -14
- app-ng-runtime/security/esm2022/security.service.mjs +12 -11
- app-ng-runtime/security/fesm2022/index.mjs +11 -10
- app-ng-runtime/security/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/security/security.service.d.ts +1 -1
- app-ng-runtime/swipey/esm2022/swipe.animation.mjs +1 -1
- app-ng-runtime/swipey/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/transpiler/bundles/index.umd.js +10 -9
- app-ng-runtime/transpiler/esm2022/build.mjs +8 -6
- app-ng-runtime/transpiler/fesm2022/index.mjs +7 -5
- app-ng-runtime/transpiler/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/variables/bundles/index.umd.js +155 -145
- app-ng-runtime/variables/esm2022/manager/action/login-action.manager.mjs +15 -14
- app-ng-runtime/variables/esm2022/manager/action/notification-action.manager.mjs +9 -8
- app-ng-runtime/variables/esm2022/manager/variable/base-variable.manager.mjs +3 -2
- app-ng-runtime/variables/esm2022/manager/variable/web-socket-variable.manager.mjs +11 -10
- app-ng-runtime/variables/esm2022/service/variables.service.mjs +7 -6
- app-ng-runtime/variables/esm2022/util/action/navigation-action.utils.mjs +4 -4
- app-ng-runtime/variables/esm2022/util/variable/pagination.utils.mjs +30 -23
- app-ng-runtime/variables/esm2022/util/variable/service-variable.utils.mjs +29 -28
- app-ng-runtime/variables/esm2022/util/variable/variables.utils.mjs +75 -70
- app-ng-runtime/variables/fesm2022/index.mjs +169 -158
- app-ng-runtime/variables/fesm2022/index.mjs.map +1 -1
- app-ng-runtime/variables/util/variable/service-variable.utils.d.ts +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@awesome-cordova-plugins/file/ngx'), require('@wm/core'), require('@wm/mobile/core'), require('@wm/security'), require('@awesome-cordova-plugins/app-version/ngx'), require('@awesome-cordova-plugins/sqlite/ngx'), require('@wm/variables'), require('rxjs'), require('@wavemaker/variables')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', '@angular/core', '@angular/common', '@awesome-cordova-plugins/file/ngx', '@wm/core', '@wm/mobile/core', '@wm/security', '@awesome-cordova-plugins/app-version/ngx', '@awesome-cordova-plugins/sqlite/ngx', '@wm/variables', 'rxjs', '@wavemaker/variables'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.wm = global.wm || {}, global.wm.mobile = global.wm.mobile || {}, global.wm.mobile.offline = {}), global.ng.core, global.ng.common, global.awesomeCordova.plugins, global.wm.core, global.wm.mobile.core, global.wm.security, global.awesomeCordova.plugins, global.awesomeCordova.plugins, global.wm.variables, global.rxjs, global.wm_common_variables));
|
|
5
|
-
})(this, (function (exports, i0, common, i3$1, i1$1, i3, i5, i1, i6, variables, rxjs, variables$1) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@awesome-cordova-plugins/file/ngx'), require('@wm/core'), require('@wm/mobile/core'), require('@wm/security'), require('@awesome-cordova-plugins/app-version/ngx'), require('@awesome-cordova-plugins/sqlite/ngx'), require('@wm/variables'), require('lodash-es'), require('rxjs'), require('@wavemaker/variables')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', '@angular/core', '@angular/common', '@awesome-cordova-plugins/file/ngx', '@wm/core', '@wm/mobile/core', '@wm/security', '@awesome-cordova-plugins/app-version/ngx', '@awesome-cordova-plugins/sqlite/ngx', '@wm/variables', 'lodash-es', 'rxjs', '@wavemaker/variables'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.wm = global.wm || {}, global.wm.mobile = global.wm.mobile || {}, global.wm.mobile.offline = {}), global.ng.core, global.ng.common, global.awesomeCordova.plugins, global.wm.core, global.wm.mobile.core, global.wm.security, global.awesomeCordova.plugins, global.awesomeCordova.plugins, global.wm.variables, global._, global.rxjs, global.wm_common_variables));
|
|
5
|
+
})(this, (function (exports, i0, common, i3$1, i1$1, i3, i5, i1, i6, variables, lodashEs, rxjs, variables$1) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopNamespaceDefault(e) {
|
|
8
8
|
var n = Object.create(null);
|
|
@@ -124,7 +124,7 @@
|
|
|
124
124
|
|
|
125
125
|
const insertRecordSqlTemplate = (schema) => {
|
|
126
126
|
const columnNames = [], placeHolder = [];
|
|
127
|
-
|
|
127
|
+
lodashEs.forEach(schema.columns, col => {
|
|
128
128
|
columnNames.push(escapeName(col.name));
|
|
129
129
|
placeHolder.push('?');
|
|
130
130
|
});
|
|
@@ -132,14 +132,14 @@
|
|
|
132
132
|
};
|
|
133
133
|
const replaceRecordSqlTemplate = (schema) => {
|
|
134
134
|
const columnNames = [], placeHolder = [];
|
|
135
|
-
|
|
135
|
+
lodashEs.forEach(schema.columns, col => {
|
|
136
136
|
columnNames.push(escapeName(col.name));
|
|
137
137
|
placeHolder.push('?');
|
|
138
138
|
});
|
|
139
139
|
return `REPLACE INTO ${escapeName(schema.name)} (${columnNames.join(',')}) VALUES (${placeHolder.join(',')})`;
|
|
140
140
|
};
|
|
141
141
|
const deleteRecordTemplate = (schema) => {
|
|
142
|
-
const primaryKeyField =
|
|
142
|
+
const primaryKeyField = lodashEs.find(schema.columns, 'primaryKey');
|
|
143
143
|
if (primaryKeyField) {
|
|
144
144
|
return `DELETE FROM ${escapeName(schema.name)} WHERE ${escapeName(primaryKeyField.name)} = ?`;
|
|
145
145
|
}
|
|
@@ -153,7 +153,7 @@
|
|
|
153
153
|
if (col.foreignRelations) {
|
|
154
154
|
col.foreignRelations.forEach(foreignRelation => {
|
|
155
155
|
childTableName = foreignRelation.sourceFieldName;
|
|
156
|
-
|
|
156
|
+
lodashEs.forEach(foreignRelation.dataMapper, (childCol, childFiledName) => {
|
|
157
157
|
columns.push(childTableName + '.' + escapeName(childCol.name) + ' as \'' + childFiledName + '\'');
|
|
158
158
|
});
|
|
159
159
|
joins.push(` LEFT JOIN ${escapeName(foreignRelation.targetTable)} ${childTableName}
|
|
@@ -180,7 +180,7 @@
|
|
|
180
180
|
const generateWherClause = (store, filterCriteria) => {
|
|
181
181
|
let conditions;
|
|
182
182
|
const fieldToColumnMapping = store.fieldToColumnMapping, tableName = store.entitySchema.name;
|
|
183
|
-
if (!
|
|
183
|
+
if (!lodashEs.isEmpty(filterCriteria) && lodashEs.isString(filterCriteria)) {
|
|
184
184
|
return ' WHERE ' + filterCriteria;
|
|
185
185
|
}
|
|
186
186
|
if (filterCriteria) {
|
|
@@ -212,8 +212,8 @@
|
|
|
212
212
|
};
|
|
213
213
|
const generateOrderByClause = (store, sort) => {
|
|
214
214
|
if (sort) {
|
|
215
|
-
return ' ORDER BY ' +
|
|
216
|
-
const splits =
|
|
215
|
+
return ' ORDER BY ' + lodashEs.map(sort.split(','), field => {
|
|
216
|
+
const splits = lodashEs.trim(field).split(' ');
|
|
217
217
|
splits[0] = escapeName(store.entitySchema.name) + '.' + escapeName(store.fieldToColumnMapping[splits[0]]);
|
|
218
218
|
return splits.join(' ');
|
|
219
219
|
}).join(',');
|
|
@@ -230,7 +230,7 @@
|
|
|
230
230
|
if (col.foreignRelations) {
|
|
231
231
|
col.foreignRelations.forEach(foreignRelation => {
|
|
232
232
|
let childEntity = null;
|
|
233
|
-
|
|
233
|
+
lodashEs.forEach(foreignRelation.dataMapper, function (childCol, childFieldName) {
|
|
234
234
|
const fieldValue = dataObj[childFieldName];
|
|
235
235
|
if (i1$1.isDefined(fieldValue) && fieldValue !== null && fieldValue !== '') {
|
|
236
236
|
childEntity = childEntity || {};
|
|
@@ -241,7 +241,7 @@
|
|
|
241
241
|
dataObj[foreignRelation.sourceFieldName] = childEntity;
|
|
242
242
|
});
|
|
243
243
|
}
|
|
244
|
-
else if (col.sqlType === 'boolean' && !
|
|
244
|
+
else if (col.sqlType === 'boolean' && !lodashEs.isNil(val)) {
|
|
245
245
|
dataObj[col.fieldName] = (val === 1);
|
|
246
246
|
}
|
|
247
247
|
});
|
|
@@ -258,7 +258,7 @@
|
|
|
258
258
|
return false;
|
|
259
259
|
});
|
|
260
260
|
}
|
|
261
|
-
if (
|
|
261
|
+
if (lodashEs.isNil(value)) {
|
|
262
262
|
return col.defaultValue;
|
|
263
263
|
}
|
|
264
264
|
else if (col.sqlType === 'boolean') {
|
|
@@ -281,14 +281,14 @@
|
|
|
281
281
|
this.localDbManagementService = localDbManagementService;
|
|
282
282
|
this.sqliteObject = sqliteObject;
|
|
283
283
|
this.fieldToColumnMapping = {};
|
|
284
|
-
this.primaryKeyField =
|
|
284
|
+
this.primaryKeyField = lodashEs.find(this.entitySchema.columns, 'primaryKey');
|
|
285
285
|
this.primaryKeyName = this.primaryKeyField ? this.primaryKeyField.fieldName : undefined;
|
|
286
286
|
this.entitySchema.columns.forEach(c => {
|
|
287
287
|
this.fieldToColumnMapping[c.fieldName] = c.name;
|
|
288
288
|
if (c.foreignRelations) {
|
|
289
289
|
c.foreignRelations.forEach(foreignRelation => {
|
|
290
290
|
this.fieldToColumnMapping[foreignRelation.targetPath] = c.name;
|
|
291
|
-
|
|
291
|
+
lodashEs.forEach(foreignRelation.dataMapper, (childCol, childFieldName) => {
|
|
292
292
|
this.fieldToColumnMapping[childFieldName] = foreignRelation.sourceFieldName + '.' + childCol.name;
|
|
293
293
|
});
|
|
294
294
|
});
|
|
@@ -304,7 +304,7 @@
|
|
|
304
304
|
if (this.primaryKeyName) {
|
|
305
305
|
const idValue = entity[this.primaryKeyName];
|
|
306
306
|
if (this.primaryKeyField.sqlType === 'number'
|
|
307
|
-
&& (!i1$1.isDefined(idValue) || (
|
|
307
|
+
&& (!i1$1.isDefined(idValue) || (lodashEs.isString(idValue) && lodashEs.isEmpty(lodashEs.trim(idValue))))) {
|
|
308
308
|
if (this.primaryKeyField.generatorType === 'identity') {
|
|
309
309
|
// updating the id with the latest id obtained from nextId.
|
|
310
310
|
entity[this.primaryKeyName] = this.localDbManagementService.nextIdCount();
|
|
@@ -433,8 +433,8 @@
|
|
|
433
433
|
*/
|
|
434
434
|
saveAll(entities) {
|
|
435
435
|
// filtering the null entities
|
|
436
|
-
entities =
|
|
437
|
-
const queries =
|
|
436
|
+
entities = lodashEs.filter(entities, null);
|
|
437
|
+
const queries = lodashEs.map(entities, entity => {
|
|
438
438
|
const rowData = mapObjToRow(this, entity);
|
|
439
439
|
const params = this.entitySchema.columns.map(f => rowData[f.name]);
|
|
440
440
|
return [this.replaceRecordSqlTemplate, params];
|
|
@@ -473,13 +473,13 @@
|
|
|
473
473
|
* Converts form data object to map for storing request in local database..
|
|
474
474
|
*/
|
|
475
475
|
serializeFormDataToMap(formData) {
|
|
476
|
-
const blobColumns =
|
|
476
|
+
const blobColumns = lodashEs.filter(this.entitySchema.columns, {
|
|
477
477
|
'sqlType': 'blob'
|
|
478
478
|
}), promises = [];
|
|
479
479
|
let map = {};
|
|
480
480
|
if (formData && typeof formData.append === 'function' && formData.rowData) {
|
|
481
|
-
|
|
482
|
-
if (fieldData &&
|
|
481
|
+
lodashEs.forEach(formData.rowData, (fieldData, fieldName) => {
|
|
482
|
+
if (fieldData && lodashEs.find(blobColumns, { 'fieldName': fieldName })) {
|
|
483
483
|
promises.push(this.saveBlobToFile(fieldData).then(localFile => {
|
|
484
484
|
map[fieldName] = localFile;
|
|
485
485
|
}));
|
|
@@ -499,7 +499,7 @@
|
|
|
499
499
|
*/
|
|
500
500
|
deserializeMapToFormData(map) {
|
|
501
501
|
const formData = new FormData(), blobColumns = this.entitySchema.columns.filter(c => c.sqlType === 'blob'), promises = [];
|
|
502
|
-
|
|
502
|
+
lodashEs.forEach(blobColumns, column => {
|
|
503
503
|
const value = map[column.fieldName];
|
|
504
504
|
if (value && value.wmLocalPath) {
|
|
505
505
|
promises.push(i1$1.convertToBlob(value.wmLocalPath)
|
|
@@ -513,7 +513,8 @@
|
|
|
513
513
|
return Promise.all(promises).then(() => formData);
|
|
514
514
|
}
|
|
515
515
|
createTableSql(schema) {
|
|
516
|
-
|
|
516
|
+
// @ts-ignore
|
|
517
|
+
const fieldStr = lodashEs.reduce(schema.columns, (result, f) => {
|
|
517
518
|
let str = escapeName(f.name);
|
|
518
519
|
if (f.primaryKey) {
|
|
519
520
|
if (f.sqlType === 'number' && f.generatorType === 'databaseIdentity') {
|
|
@@ -655,7 +656,8 @@
|
|
|
655
656
|
return new Promise((resolve, reject) => {
|
|
656
657
|
// Before closing databases, give some time for the pending transactions (if any).
|
|
657
658
|
setTimeout(() => {
|
|
658
|
-
|
|
659
|
+
// @ts-ignore
|
|
660
|
+
const closePromises = lodashEs.map(lodashEs.values(this.databases), db => db.sqliteObject.close());
|
|
659
661
|
Promise.all(closePromises).then(resolve, reject);
|
|
660
662
|
}, 1000);
|
|
661
663
|
});
|
|
@@ -679,14 +681,14 @@
|
|
|
679
681
|
return Promise.reject(`Query by name ' ${queryName} ' Not Found`);
|
|
680
682
|
}
|
|
681
683
|
queryData = this.databases[dbName].queries[queryName];
|
|
682
|
-
paramPromises =
|
|
684
|
+
paramPromises = lodashEs.chain(queryData.params)
|
|
683
685
|
.filter(p => p.variableType !== 'PROMPT')
|
|
684
686
|
.forEach(p => {
|
|
685
687
|
const paramValue = this.systemProperties[p.variableType].value(p.name, params);
|
|
686
688
|
return i1$1.toPromise(paramValue).then(v => params[p.name] = v);
|
|
687
689
|
}).value();
|
|
688
690
|
return Promise.all(paramPromises).then(() => {
|
|
689
|
-
params =
|
|
691
|
+
params = lodashEs.map(queryData.params, p => {
|
|
690
692
|
// Sqlite will accept DateTime value as below format.
|
|
691
693
|
if (typeof params[p.name] !== 'string'
|
|
692
694
|
&& (p.type === i1$1.DataType.DATETIME || p.type === i1$1.DataType.LOCALDATETIME)) {
|
|
@@ -701,18 +703,18 @@
|
|
|
701
703
|
return this.executeSQLQuery(dbName, queryData.query, params)
|
|
702
704
|
.then(result => {
|
|
703
705
|
let firstRow, needTransform;
|
|
704
|
-
if (!
|
|
706
|
+
if (!lodashEs.isEmpty(result.rows)) {
|
|
705
707
|
firstRow = result.rows[0];
|
|
706
|
-
needTransform =
|
|
707
|
-
if (!
|
|
708
|
-
result.rows =
|
|
708
|
+
needTransform = lodashEs.find(queryData.response.properties, p => !firstRow.hasOwnProperty(p.fieldName));
|
|
709
|
+
if (!lodashEs.isUndefined(needTransform)) {
|
|
710
|
+
result.rows = lodashEs.map(result.rows, row => {
|
|
709
711
|
const transformedRow = {}, rowWithUpperKeys = {};
|
|
710
712
|
// This is to make search for data as case-insensitive
|
|
711
|
-
|
|
712
|
-
|
|
713
|
+
lodashEs.forEach(row, (v, k) => rowWithUpperKeys[k.toUpperCase()] = v);
|
|
714
|
+
lodashEs.forEach(queryData.response.properties, p => {
|
|
713
715
|
// format the value depending on the typeRef specified in properties.
|
|
714
716
|
const propType = i1$1.extractType(p.fieldType.typeRef);
|
|
715
|
-
i1$1.DEFAULT_FORMATS[
|
|
717
|
+
i1$1.DEFAULT_FORMATS[lodashEs.toUpper(propType)];
|
|
716
718
|
const fieldVal = row[p.name];
|
|
717
719
|
if (fieldVal && typeof fieldVal !== 'string'
|
|
718
720
|
&& (propType === i1$1.DataType.DATETIME || propType === i1$1.DataType.LOCALDATETIME || propType === i1$1.DataType.DATE)) {
|
|
@@ -746,7 +748,7 @@
|
|
|
746
748
|
*/
|
|
747
749
|
exportDB() {
|
|
748
750
|
return new Promise((resolve, reject) => {
|
|
749
|
-
const folderToExport = 'offline_temp_' +
|
|
751
|
+
const folderToExport = 'offline_temp_' + lodashEs.now(), folderToExportFullPath = cordova.file.cacheDirectory + folderToExport + '/', zipFileName = '_offline_data.zip', metaInfo = {
|
|
750
752
|
app: null,
|
|
751
753
|
OS: '',
|
|
752
754
|
createdOn: 0
|
|
@@ -776,7 +778,7 @@
|
|
|
776
778
|
else if (i1$1.isAndroid()) {
|
|
777
779
|
metaInfo.OS = 'ANDROID';
|
|
778
780
|
}
|
|
779
|
-
metaInfo.createdOn =
|
|
781
|
+
metaInfo.createdOn = lodashEs.now();
|
|
780
782
|
return metaInfo;
|
|
781
783
|
}).then(() => i1$1.executePromiseChain(this.getCallbacksFor('preExport'), [folderToExportFullPath, metaInfo]))
|
|
782
784
|
.then(() => {
|
|
@@ -829,7 +831,7 @@
|
|
|
829
831
|
*/
|
|
830
832
|
importDB(zipPath, revertIfFails) {
|
|
831
833
|
return new Promise((resolve, reject) => {
|
|
832
|
-
const importFolder = 'offline_temp_' +
|
|
834
|
+
const importFolder = 'offline_temp_' + lodashEs.now(), importFolderFullPath = cordova.file.cacheDirectory + importFolder + '/';
|
|
833
835
|
let zipMeta;
|
|
834
836
|
// Create a temporary folder to unzip the contents of the zip.
|
|
835
837
|
this.file.createDir(cordova.file.cacheDirectory, importFolder, false)
|
|
@@ -949,7 +951,7 @@
|
|
|
949
951
|
.then(metadata => this.loadNamedQueries(metadata))
|
|
950
952
|
.then(metadata => this.loadOfflineConfig(metadata))
|
|
951
953
|
.then(metadata => {
|
|
952
|
-
return Promise.all(
|
|
954
|
+
return Promise.all(lodashEs.map(metadata, dbMetadata => {
|
|
953
955
|
return this.openDatabase(dbMetadata)
|
|
954
956
|
.then(database => {
|
|
955
957
|
this.databases[dbMetadata.schema.name] = database;
|
|
@@ -968,9 +970,9 @@
|
|
|
968
970
|
.then(() => this.disableForeignKeys())
|
|
969
971
|
.then(() => this.deviceService.getAppBuildTime())
|
|
970
972
|
.then(dbSeedCreationTime => {
|
|
971
|
-
return i1$1.executePromiseChain(
|
|
973
|
+
return i1$1.executePromiseChain(lodashEs.map(this.callbacks, 'onDbCreate'), [{
|
|
972
974
|
'databases': this.databases,
|
|
973
|
-
'dbCreatedOn':
|
|
975
|
+
'dbCreatedOn': lodashEs.now(),
|
|
974
976
|
'dbSeedCreatedOn': dbSeedCreationTime
|
|
975
977
|
}]);
|
|
976
978
|
}).then(() => this.databases);
|
|
@@ -1030,13 +1032,13 @@
|
|
|
1030
1032
|
let defaultValue = col.columnValue ? col.columnValue.defaultValue : '';
|
|
1031
1033
|
const type = col.sqlType;
|
|
1032
1034
|
if (type === 'number' && !col.primaryKey) {
|
|
1033
|
-
defaultValue =
|
|
1035
|
+
defaultValue = lodashEs.isEmpty(defaultValue) ? null : lodashEs.parseInt(defaultValue);
|
|
1034
1036
|
}
|
|
1035
1037
|
else if (type === 'boolean') {
|
|
1036
|
-
defaultValue =
|
|
1038
|
+
defaultValue = lodashEs.isEmpty(defaultValue) ? null : (defaultValue === 'true' ? 1 : 0);
|
|
1037
1039
|
}
|
|
1038
1040
|
else {
|
|
1039
|
-
defaultValue =
|
|
1041
|
+
defaultValue = lodashEs.isEmpty(defaultValue) ? null : defaultValue;
|
|
1040
1042
|
}
|
|
1041
1043
|
reqEntity.columns.push({
|
|
1042
1044
|
name: col['name'],
|
|
@@ -1047,10 +1049,10 @@
|
|
|
1047
1049
|
defaultValue: defaultValue
|
|
1048
1050
|
});
|
|
1049
1051
|
});
|
|
1050
|
-
|
|
1052
|
+
lodashEs.forEach(entity.relations, r => {
|
|
1051
1053
|
let targetEntitySchema, targetEntity, col, sourceColumn, mapping;
|
|
1052
1054
|
if (r.cardinality === 'ManyToOne' || r.cardinality === 'OneToOne') {
|
|
1053
|
-
targetEntity =
|
|
1055
|
+
targetEntity = lodashEs.find(schema.tables, t => t.name === r.targetTable);
|
|
1054
1056
|
mapping = r.mappings[0];
|
|
1055
1057
|
if (targetEntity) {
|
|
1056
1058
|
targetEntity = targetEntity.entityName;
|
|
@@ -1067,7 +1069,8 @@
|
|
|
1067
1069
|
targetFieldName: targetEntitySchema.columns.find(column => column.name === mapping.targetColumn).fieldName
|
|
1068
1070
|
};
|
|
1069
1071
|
foreignRelation.targetPath = foreignRelation.sourceFieldName + '.' + foreignRelation.targetFieldName;
|
|
1070
|
-
|
|
1072
|
+
// @ts-ignore
|
|
1073
|
+
foreignRelation.dataMapper = lodashEs.chain(targetEntitySchema.columns)
|
|
1071
1074
|
.keyBy(childCol => foreignRelation.sourceFieldName + '.' + childCol.fieldName)
|
|
1072
1075
|
.mapValues(childCol => new ColumnInfo(childCol.name, childCol.fieldName)).value();
|
|
1073
1076
|
col.foreignRelations = col.foreignRelations || [];
|
|
@@ -1080,25 +1083,25 @@
|
|
|
1080
1083
|
// Loads necessary details of queries
|
|
1081
1084
|
compactQueries(queriesByDB) {
|
|
1082
1085
|
const queries = new Map();
|
|
1083
|
-
|
|
1086
|
+
lodashEs.forEach(queriesByDB.queries, queryData => {
|
|
1084
1087
|
let query, params;
|
|
1085
1088
|
if (queryData.nativeSql && queryData.type === 'SELECT') {
|
|
1086
|
-
query =
|
|
1087
|
-
params =
|
|
1088
|
-
const paramObj =
|
|
1089
|
+
query = lodashEs.isEmpty(queryData.offlineQueryString) ? queryData.queryString : queryData.offlineQueryString;
|
|
1090
|
+
params = lodashEs.map(this.extractQueryParams(query), p => {
|
|
1091
|
+
const paramObj = lodashEs.find(queryData.parameters, { 'name': p });
|
|
1089
1092
|
return {
|
|
1090
1093
|
name: paramObj.name,
|
|
1091
1094
|
type: paramObj.type,
|
|
1092
1095
|
variableType: paramObj.variableType
|
|
1093
1096
|
};
|
|
1094
1097
|
});
|
|
1095
|
-
params.forEach(p => query =
|
|
1098
|
+
params.forEach(p => query = lodashEs.replace(query, ':' + p.name, '?'));
|
|
1096
1099
|
queries[queryData.name] = {
|
|
1097
1100
|
name: queryData.name,
|
|
1098
1101
|
query: query,
|
|
1099
1102
|
params: params,
|
|
1100
1103
|
response: {
|
|
1101
|
-
properties:
|
|
1104
|
+
properties: lodashEs.map(queryData.response.properties, p => {
|
|
1102
1105
|
p.nameInUpperCase = p.name.toUpperCase();
|
|
1103
1106
|
return p;
|
|
1104
1107
|
})
|
|
@@ -1124,7 +1127,7 @@
|
|
|
1124
1127
|
return dbInfo;
|
|
1125
1128
|
}
|
|
1126
1129
|
convertBoolToInt(bool) {
|
|
1127
|
-
return
|
|
1130
|
+
return lodashEs.toString(bool) === 'true' ? 1 : 0;
|
|
1128
1131
|
}
|
|
1129
1132
|
convertIntToBool(int) {
|
|
1130
1133
|
return int ? true : false;
|
|
@@ -1134,7 +1137,8 @@
|
|
|
1134
1137
|
* @returns {*}
|
|
1135
1138
|
*/
|
|
1136
1139
|
disableForeignKeys() {
|
|
1137
|
-
|
|
1140
|
+
// @ts-ignore
|
|
1141
|
+
return Promise.all(lodashEs.map(this.databases, db => this.executeSQLQuery(db.schema.name, 'PRAGMA foreign_keys = OFF')));
|
|
1138
1142
|
}
|
|
1139
1143
|
/**
|
|
1140
1144
|
* Executes SQL query;
|
|
@@ -1217,7 +1221,7 @@
|
|
|
1217
1221
|
getMetaInfo(fileNameRegex) {
|
|
1218
1222
|
const folder = cordova.file.applicationDirectory + META_LOCATION + '/';
|
|
1219
1223
|
return this.deviceFileService.listFiles(folder, fileNameRegex)
|
|
1220
|
-
.then(files => Promise.all(
|
|
1224
|
+
.then(files => Promise.all(lodashEs.map(files, f => {
|
|
1221
1225
|
return new Promise((resolve, reject) => {
|
|
1222
1226
|
// Cordova File reader has buffer issues with large files.
|
|
1223
1227
|
// so, using ajax to retrieve local json
|
|
@@ -1245,7 +1249,7 @@
|
|
|
1245
1249
|
return this.getMetaInfo(/.+_dataModel\.json$/)
|
|
1246
1250
|
.then((schemas) => {
|
|
1247
1251
|
const metadata = new Map();
|
|
1248
|
-
schemas =
|
|
1252
|
+
schemas = lodashEs.isArray(schemas) ? schemas : [schemas];
|
|
1249
1253
|
schemas.push(OFFLINE_WAVEMAKER_DATABASE_SCHEMA);
|
|
1250
1254
|
schemas.map(s => this.compactSchema(s))
|
|
1251
1255
|
.forEach(s => {
|
|
@@ -1263,7 +1267,7 @@
|
|
|
1263
1267
|
loadNamedQueries(metadata) {
|
|
1264
1268
|
return this.getMetaInfo(/.+_query\.json$/)
|
|
1265
1269
|
.then((queriesByDBs) => {
|
|
1266
|
-
queriesByDBs =
|
|
1270
|
+
queriesByDBs = lodashEs.isArray(queriesByDBs) ? queriesByDBs : [queriesByDBs];
|
|
1267
1271
|
queriesByDBs.map(e => metadata[e.name].queries = this.compactQueries(e));
|
|
1268
1272
|
return metadata;
|
|
1269
1273
|
});
|
|
@@ -1277,10 +1281,12 @@
|
|
|
1277
1281
|
loadOfflineConfig(metadata) {
|
|
1278
1282
|
return this.getMetaInfo(/.+_offline\.json$/)
|
|
1279
1283
|
.then(configs => {
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
+
lodashEs.forEach(configs, config => {
|
|
1285
|
+
// @ts-ignore
|
|
1286
|
+
lodashEs.forEach(config.entities, entityConfig => {
|
|
1287
|
+
// @ts-ignore
|
|
1288
|
+
const entitySchema = lodashEs.find(metadata[config.name].schema.entities, schema => schema.name === entityConfig.name);
|
|
1289
|
+
lodashEs.assignIn(entitySchema, entityConfig);
|
|
1284
1290
|
});
|
|
1285
1291
|
});
|
|
1286
1292
|
return metadata;
|
|
@@ -1289,14 +1295,14 @@
|
|
|
1289
1295
|
logSql(sqliteObject) {
|
|
1290
1296
|
const logger = console, originalExecuteSql = sqliteObject.executeSql;
|
|
1291
1297
|
sqliteObject.executeSql = (sql, params, logOutput) => {
|
|
1292
|
-
const startTime =
|
|
1298
|
+
const startTime = lodashEs.now();
|
|
1293
1299
|
return originalExecuteSql.call(sqliteObject, sql, params).then(result => {
|
|
1294
1300
|
if (logOutput || this._logSql) {
|
|
1295
1301
|
const objArr = [], rowCount = result.rows.length;
|
|
1296
1302
|
for (let i = 0; i < rowCount; i++) {
|
|
1297
1303
|
objArr.push(result.rows.item(i));
|
|
1298
1304
|
}
|
|
1299
|
-
logger.debug('SQL "%s" with params %O took [%d ms]. And the result is %O', sql, params,
|
|
1305
|
+
logger.debug('SQL "%s" with params %O took [%d ms]. And the result is %O', sql, params, lodashEs.now() - startTime, objArr);
|
|
1300
1306
|
}
|
|
1301
1307
|
return result;
|
|
1302
1308
|
}, error => {
|
|
@@ -1324,10 +1330,12 @@
|
|
|
1324
1330
|
* @returns {*}
|
|
1325
1331
|
*/
|
|
1326
1332
|
normalizeData() {
|
|
1327
|
-
return Promise.all(
|
|
1328
|
-
|
|
1329
|
-
|
|
1333
|
+
return Promise.all(lodashEs.map(this.databases, database => {
|
|
1334
|
+
// @ts-ignore
|
|
1335
|
+
return Promise.all(lodashEs.map(database.schema.entities, entitySchema => {
|
|
1336
|
+
return Promise.all(lodashEs.map(entitySchema.columns, column => {
|
|
1330
1337
|
if (column.sqlType === 'boolean') {
|
|
1338
|
+
// @ts-ignore
|
|
1331
1339
|
return this.normalizeBooleanData(database.schema.name, entitySchema.name, column.name);
|
|
1332
1340
|
}
|
|
1333
1341
|
}));
|
|
@@ -1341,12 +1349,13 @@
|
|
|
1341
1349
|
}).then(sqliteObject => {
|
|
1342
1350
|
database.sqliteObject = sqliteObject;
|
|
1343
1351
|
this.logSql(sqliteObject);
|
|
1344
|
-
const storePromises =
|
|
1352
|
+
const storePromises = lodashEs.map(database.schema.entities, entitySchema => {
|
|
1353
|
+
// @ts-ignore
|
|
1345
1354
|
const store = new LocalDBStore(this.deviceFileService, entitySchema, this.file, this, sqliteObject);
|
|
1346
1355
|
return store.create();
|
|
1347
1356
|
});
|
|
1348
1357
|
return Promise.all(storePromises).then(stores => {
|
|
1349
|
-
|
|
1358
|
+
lodashEs.forEach(stores, store => {
|
|
1350
1359
|
database.stores[store.entitySchema.entityName] = store;
|
|
1351
1360
|
});
|
|
1352
1361
|
return database;
|
|
@@ -1493,10 +1502,10 @@
|
|
|
1493
1502
|
getLastPushInfo() {
|
|
1494
1503
|
return this.localKeyValueService.get(LAST_PUSH_INFO_KEY)
|
|
1495
1504
|
.then(info => {
|
|
1496
|
-
if (
|
|
1505
|
+
if (lodashEs.isString(info.startTime)) {
|
|
1497
1506
|
info.startTime = new Date(info.startTime);
|
|
1498
1507
|
}
|
|
1499
|
-
if (
|
|
1508
|
+
if (lodashEs.isString(info.endTime)) {
|
|
1500
1509
|
info.endTime = new Date(info.endTime);
|
|
1501
1510
|
}
|
|
1502
1511
|
return info;
|
|
@@ -1525,7 +1534,7 @@
|
|
|
1525
1534
|
* @returns {boolean} returns true, if a flush process is in progress. Otherwise, returns false.
|
|
1526
1535
|
*/
|
|
1527
1536
|
isFlushInProgress() {
|
|
1528
|
-
return !(
|
|
1537
|
+
return !(lodashEs.isUndefined(this.deferredFlush) || lodashEs.isNull(this.deferredFlush));
|
|
1529
1538
|
}
|
|
1530
1539
|
/**
|
|
1531
1540
|
* Stops the ongoing flush process.
|
|
@@ -1617,11 +1626,11 @@
|
|
|
1617
1626
|
.then(() => i1$1.executePromiseChain(this.getWorkers('transformParamsFromMap'), [change]))
|
|
1618
1627
|
.then(() => this.pushService.push(change))
|
|
1619
1628
|
.then(function () {
|
|
1620
|
-
return i1$1.executePromiseChain(
|
|
1629
|
+
return i1$1.executePromiseChain(lodashEs.reverse(self.getWorkers('postCallSuccess')), [change, arguments])
|
|
1621
1630
|
.then(() => change);
|
|
1622
1631
|
}).catch(function () {
|
|
1623
1632
|
if (self.networkService.isConnected()) {
|
|
1624
|
-
return i1$1.executePromiseChain(
|
|
1633
|
+
return i1$1.executePromiseChain(lodashEs.reverse(self.getWorkers('postCallError')), [change, arguments])
|
|
1625
1634
|
.catch(i1$1.noop).then(() => Promise.reject(change));
|
|
1626
1635
|
}
|
|
1627
1636
|
return Promise.reject(change);
|
|
@@ -1643,7 +1652,7 @@
|
|
|
1643
1652
|
});
|
|
1644
1653
|
}
|
|
1645
1654
|
getWorkers(type) {
|
|
1646
|
-
return
|
|
1655
|
+
return lodashEs.map(this.workers, w => w[type] && w[type].bind(w));
|
|
1647
1656
|
}
|
|
1648
1657
|
static { this.ɵfac = function ChangeLogService_Factory(t) { return new (t || ChangeLogService)(i0__namespace.ɵɵinject(LocalDBManagementService), i0__namespace.ɵɵinject(LocalKeyValueService), i0__namespace.ɵɵinject(PushService), i0__namespace.ɵɵinject(i3__namespace.NetworkService)); }; }
|
|
1649
1658
|
static { this.ɵprov = /*@__PURE__*/ i0__namespace.ɵɵdefineInjectable({ token: ChangeLogService, factory: ChangeLogService.ɵfac, providedIn: 'root' }); }
|
|
@@ -1728,7 +1737,7 @@
|
|
|
1728
1737
|
insertTableData(params, successCallback, failureCallback, options = {}) {
|
|
1729
1738
|
this.getStore(params).then(store => {
|
|
1730
1739
|
const isPKAutoIncremented = (store.primaryKeyField && store.primaryKeyField.generatorType === 'identity');
|
|
1731
|
-
if (
|
|
1740
|
+
if (lodashEs.get(options, 'resetPrimaryKey') !== false && isPKAutoIncremented && params.data[store.primaryKeyName]) {
|
|
1732
1741
|
delete params.data[store.primaryKeyName];
|
|
1733
1742
|
}
|
|
1734
1743
|
return store.add(params.data).then(() => {
|
|
@@ -1869,7 +1878,7 @@
|
|
|
1869
1878
|
return fieldName;
|
|
1870
1879
|
}
|
|
1871
1880
|
convertFieldNameToColumnName(store, filterGroup, options) {
|
|
1872
|
-
|
|
1881
|
+
lodashEs.forEach(filterGroup.rules, rule => {
|
|
1873
1882
|
if (rule.rules) {
|
|
1874
1883
|
this.convertFieldNameToColumnName(store, rule);
|
|
1875
1884
|
}
|
|
@@ -1879,7 +1888,7 @@
|
|
|
1879
1888
|
});
|
|
1880
1889
|
// handling the scenario where variable options can have filterField. For example: search filter query
|
|
1881
1890
|
if (options && options.filterFields) {
|
|
1882
|
-
options.filterFields =
|
|
1891
|
+
options.filterFields = lodashEs.mapKeys(options.filterFields, (v, k) => {
|
|
1883
1892
|
return this.getColumnName(store, k);
|
|
1884
1893
|
});
|
|
1885
1894
|
}
|
|
@@ -1905,7 +1914,7 @@
|
|
|
1905
1914
|
*/
|
|
1906
1915
|
preCall(change) {
|
|
1907
1916
|
if (change.service === 'DatabaseService') {
|
|
1908
|
-
change.params.data =
|
|
1917
|
+
change.params.data = lodashEs.mapValues(change.params.data, v => {
|
|
1909
1918
|
const remoteUrl = this.fileStore[v];
|
|
1910
1919
|
if (remoteUrl) {
|
|
1911
1920
|
this.logger.debug('swapped file path from %s -> %s', v, remoteUrl);
|
|
@@ -1976,23 +1985,27 @@
|
|
|
1976
1985
|
*/
|
|
1977
1986
|
updateDBChange(change, oldUploadDir, uploadDir) {
|
|
1978
1987
|
const modifiedProperties = {}, entityName = change.params.entityName, dataModelName = change.params.dataModelName;
|
|
1979
|
-
change.params.data =
|
|
1988
|
+
change.params.data = lodashEs.mapValues(change.params.data, function (v, k) {
|
|
1980
1989
|
let mv = v, isModified = false;
|
|
1981
|
-
if (
|
|
1982
|
-
mv =
|
|
1983
|
-
isModified = !
|
|
1984
|
-
}
|
|
1985
|
-
else
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1990
|
+
if (lodashEs.isString(v)) {
|
|
1991
|
+
mv = lodashEs.replace(v, oldUploadDir, uploadDir);
|
|
1992
|
+
isModified = !lodashEs.isEqual(mv, v);
|
|
1993
|
+
}
|
|
1994
|
+
else { // @ts-ignore
|
|
1995
|
+
if (lodashEs.isObject(v) && v.wmLocalPath) {
|
|
1996
|
+
// insertMultiPartData and updateMultiPartData
|
|
1997
|
+
// @ts-ignore
|
|
1998
|
+
mv = lodashEs.replace(v.wmLocalPath, oldUploadDir, uploadDir);
|
|
1999
|
+
// @ts-ignore
|
|
2000
|
+
isModified = !lodashEs.isEqual(mv, v.wmLocalPath);
|
|
2001
|
+
}
|
|
1989
2002
|
}
|
|
1990
2003
|
if (isModified) {
|
|
1991
2004
|
modifiedProperties[k] = mv;
|
|
1992
2005
|
}
|
|
1993
2006
|
return mv;
|
|
1994
2007
|
});
|
|
1995
|
-
if (!
|
|
2008
|
+
if (!lodashEs.isEmpty(modifiedProperties)) {
|
|
1996
2009
|
this.localDBManagementService.getStore(dataModelName, entityName)
|
|
1997
2010
|
.then(store => {
|
|
1998
2011
|
// If there is a primary for the entity, then update actual row with the modifications
|
|
@@ -2000,7 +2013,7 @@
|
|
|
2000
2013
|
const primaryKeyName = store.primaryKeyName;
|
|
2001
2014
|
const primaryKey = change.params.data[primaryKeyName];
|
|
2002
2015
|
return store.get(primaryKey)
|
|
2003
|
-
.then(obj => store.save(
|
|
2016
|
+
.then(obj => store.save(lodashEs.assignIn(obj, modifiedProperties)));
|
|
2004
2017
|
}
|
|
2005
2018
|
}).then(() => {
|
|
2006
2019
|
change.params = JSON.stringify(change.params);
|
|
@@ -2019,7 +2032,7 @@
|
|
|
2019
2032
|
change.params = JSON.parse(change.params);
|
|
2020
2033
|
if (change.service === 'OfflineFileUploadService'
|
|
2021
2034
|
&& change.operation === 'uploadToServer') {
|
|
2022
|
-
change.params.file =
|
|
2035
|
+
change.params.file = lodashEs.replace(change.params.file, metaInfo.uploadDir, this.uploadDir);
|
|
2023
2036
|
change.params = JSON.stringify(change.params);
|
|
2024
2037
|
return this.changeLogService.getStore().then(store => store.save(change));
|
|
2025
2038
|
}
|
|
@@ -2083,7 +2096,7 @@
|
|
|
2083
2096
|
const dataModelName = change.params.dataModelName;
|
|
2084
2097
|
return this.localDBManagementService.getStore(dataModelName, entityName).then(store => {
|
|
2085
2098
|
const id = change['dataLocalId'] || change.params.data[store.primaryKeyName];
|
|
2086
|
-
if (!(
|
|
2099
|
+
if (!(lodashEs.isUndefined(id) || lodashEs.isNull(id))) {
|
|
2087
2100
|
this.removeError(dataModelName, entityName, id);
|
|
2088
2101
|
}
|
|
2089
2102
|
});
|
|
@@ -2096,7 +2109,7 @@
|
|
|
2096
2109
|
const dataModelName = change.params.dataModelName;
|
|
2097
2110
|
return this.localDBManagementService.getStore(dataModelName, entityName).then(store => {
|
|
2098
2111
|
const id = change['dataLocalId'] || (change.params.data && change.params.data[store.primaryKeyName]) || change.params[store.primaryKeyName] || change.params.id;
|
|
2099
|
-
if (!(
|
|
2112
|
+
if (!(lodashEs.isUndefined(id) || lodashEs.isNull(id))) {
|
|
2100
2113
|
this.recordError(dataModelName, entityName, id);
|
|
2101
2114
|
}
|
|
2102
2115
|
});
|
|
@@ -2322,8 +2335,10 @@
|
|
|
2322
2335
|
case 'insertMultiPartTableData':
|
|
2323
2336
|
case 'updateMultiPartTableData':
|
|
2324
2337
|
// clean up files
|
|
2325
|
-
|
|
2326
|
-
|
|
2338
|
+
lodashEs.forEach(change.params.data, v => {
|
|
2339
|
+
// @ts-ignore
|
|
2340
|
+
if (lodashEs.isObject(v) && v.wmLocalPath) {
|
|
2341
|
+
// @ts-ignore
|
|
2327
2342
|
this.deviceFileService.removeFile(v.wmLocalPath);
|
|
2328
2343
|
}
|
|
2329
2344
|
});
|
|
@@ -2359,8 +2374,9 @@
|
|
|
2359
2374
|
* As save method called with FormData object, empty row is inserted.
|
|
2360
2375
|
* Since FormData is converted to map, update the record details now.
|
|
2361
2376
|
*/
|
|
2362
|
-
store.save(
|
|
2363
|
-
|
|
2377
|
+
store.save(lodashEs.mapValues(map, function (v) {
|
|
2378
|
+
// @ts-ignore
|
|
2379
|
+
return (lodashEs.isObject(v) && v.wmLocalPath) || v;
|
|
2364
2380
|
}));
|
|
2365
2381
|
return map;
|
|
2366
2382
|
});
|
|
@@ -2418,15 +2434,15 @@
|
|
|
2418
2434
|
const onlineHandler = this.httpService.sendCallAsObservable;
|
|
2419
2435
|
if (onlineHandler) {
|
|
2420
2436
|
this.httpService.sendCallAsObservable = (reqParams, params) => {
|
|
2421
|
-
if (!params &&
|
|
2437
|
+
if (!params && lodashEs.get(reqParams, 'url')) {
|
|
2422
2438
|
params = { url: reqParams.url };
|
|
2423
2439
|
}
|
|
2424
2440
|
// reqParams will contain the full path of insert/update call which will be processed again in parseConfig method
|
|
2425
2441
|
// and will be appended again with '/services/./.' which will result in deployedUrl + '/service/./.' + '/service/./.' which is wrong.
|
|
2426
2442
|
// Hence passing url in params
|
|
2427
|
-
const clonedParamsUrl =
|
|
2428
|
-
params =
|
|
2429
|
-
const operation =
|
|
2443
|
+
const clonedParamsUrl = lodashEs.clone(params.url);
|
|
2444
|
+
params = lodashEs.extend(params, reqParams);
|
|
2445
|
+
const operation = lodashEs.find(apiConfiguration, { name: lodashEs.get(params, 'operation') });
|
|
2430
2446
|
if (this.networkService.isConnected() || params.onlyOnline || !operation || !params.dataModelName) {
|
|
2431
2447
|
return rxjs.from(this.remoteDBcall(operation, onlineHandler, params));
|
|
2432
2448
|
}
|
|
@@ -2475,7 +2491,7 @@
|
|
|
2475
2491
|
}
|
|
2476
2492
|
// set hasBlob flag on params when blob field is present
|
|
2477
2493
|
hasBlob(store) {
|
|
2478
|
-
const blobColumns =
|
|
2494
|
+
const blobColumns = lodashEs.filter(store.entitySchema.columns, {
|
|
2479
2495
|
'sqlType': 'blob'
|
|
2480
2496
|
});
|
|
2481
2497
|
return !!blobColumns.length;
|
|
@@ -2518,8 +2534,8 @@
|
|
|
2518
2534
|
store.saveAll(response.body.content);
|
|
2519
2535
|
}
|
|
2520
2536
|
else if (operation.type === 'INSERT') {
|
|
2521
|
-
params =
|
|
2522
|
-
params.data =
|
|
2537
|
+
params = lodashEs.clone(params);
|
|
2538
|
+
params.data = lodashEs.clone(response.body);
|
|
2523
2539
|
this.offlineDBService[operation.name](params, i1$1.noop, i1$1.noop, {
|
|
2524
2540
|
resetPrimaryKey: false
|
|
2525
2541
|
});
|
|
@@ -2542,10 +2558,10 @@
|
|
|
2542
2558
|
prepareToCascade(params) {
|
|
2543
2559
|
return this.getStore(params).then(store => {
|
|
2544
2560
|
const childObjectPromises = [];
|
|
2545
|
-
|
|
2561
|
+
lodashEs.forEach(params.data, (v, k) => {
|
|
2546
2562
|
let column, foreignRelation, childParams;
|
|
2547
2563
|
// NOTE: Save only one-to-one relations for cascade
|
|
2548
|
-
if (
|
|
2564
|
+
if (lodashEs.isObject(v) && !lodashEs.isArray(v)) {
|
|
2549
2565
|
column = store.entitySchema.columns.find(c => {
|
|
2550
2566
|
if (c.primaryKey && c.foreignRelations) {
|
|
2551
2567
|
foreignRelation = c.foreignRelations.find(f => f.sourceFieldName === k);
|
|
@@ -2554,7 +2570,7 @@
|
|
|
2554
2570
|
});
|
|
2555
2571
|
}
|
|
2556
2572
|
if (column) {
|
|
2557
|
-
childParams =
|
|
2573
|
+
childParams = lodashEs.cloneDeep(params);
|
|
2558
2574
|
childParams.entityName = foreignRelation.targetEntity;
|
|
2559
2575
|
childParams.data = v;
|
|
2560
2576
|
const childPromise = this.getStore(childParams).then(childStore => {
|
|
@@ -2672,7 +2688,7 @@
|
|
|
2672
2688
|
isOfflineBehaviourAdded$1 = true;
|
|
2673
2689
|
const orig = this.httpService.sendCallAsObservable;
|
|
2674
2690
|
this.httpService.sendCallAsObservable = (reqParams, params) => {
|
|
2675
|
-
if (!params &&
|
|
2691
|
+
if (!params && lodashEs.get(reqParams, 'url')) {
|
|
2676
2692
|
params = { url: reqParams.url };
|
|
2677
2693
|
}
|
|
2678
2694
|
if (!this.networkService.isConnected() && params.url.indexOf('/queryExecutor/') > 0) {
|
|
@@ -2684,7 +2700,7 @@
|
|
|
2684
2700
|
};
|
|
2685
2701
|
}
|
|
2686
2702
|
executeLocally(params) {
|
|
2687
|
-
const url = params.url, hasUrlParams = url.indexOf('?') > 0, dbName = this.substring(url, 'services/', '/queryExecutor'), queryName = this.substring(url, 'queries/', hasUrlParams ? '?' : undefined), urlParams = hasUrlParams ? this.getHttpParamMap(this.substring(url, '?', undefined)) : {}, dataParams = this.getHttpParamMap(params.dataParams), queryParams =
|
|
2703
|
+
const url = params.url, hasUrlParams = url.indexOf('?') > 0, dbName = this.substring(url, 'services/', '/queryExecutor'), queryName = this.substring(url, 'queries/', hasUrlParams ? '?' : undefined), urlParams = hasUrlParams ? this.getHttpParamMap(this.substring(url, '?', undefined)) : {}, dataParams = this.getHttpParamMap(params.dataParams), queryParams = lodashEs.extend(urlParams, dataParams);
|
|
2688
2704
|
return this.localDBManagementService.executeNamedQuery(dbName, queryName, queryParams)
|
|
2689
2705
|
.then(result => {
|
|
2690
2706
|
const rows = result.rows;
|
|
@@ -2723,7 +2739,7 @@
|
|
|
2723
2739
|
str = decodeURIComponent(str);
|
|
2724
2740
|
str.split('&').forEach(c => {
|
|
2725
2741
|
const csplits = c.split('=');
|
|
2726
|
-
if (
|
|
2742
|
+
if (lodashEs.isEmpty(lodashEs.trim(csplits[1])) || !NUMBER_REGEX.test(csplits[1])) {
|
|
2727
2743
|
result[csplits[0]] = csplits[1];
|
|
2728
2744
|
}
|
|
2729
2745
|
else {
|
|
@@ -2744,7 +2760,7 @@
|
|
|
2744
2760
|
this.deviceService = deviceService;
|
|
2745
2761
|
this.networkService = networkService;
|
|
2746
2762
|
this.securityService = securityService;
|
|
2747
|
-
this.saveSecurityConfigLocally =
|
|
2763
|
+
this.saveSecurityConfigLocally = lodashEs.debounce((config) => {
|
|
2748
2764
|
this._saveSecurityConfigLocally(config);
|
|
2749
2765
|
}, 1000);
|
|
2750
2766
|
}
|
|
@@ -2981,7 +2997,7 @@
|
|
|
2981
2997
|
const promises = {};
|
|
2982
2998
|
return {
|
|
2983
2999
|
start: promise => {
|
|
2984
|
-
promise.$$pullProcessId = 'PULL_' +
|
|
3000
|
+
promise.$$pullProcessId = 'PULL_' + lodashEs.now();
|
|
2985
3001
|
},
|
|
2986
3002
|
add: (pullPromise, promise) => {
|
|
2987
3003
|
const pullProcessId = pullPromise.$$pullProcessId;
|
|
@@ -2992,15 +3008,15 @@
|
|
|
2992
3008
|
},
|
|
2993
3009
|
remove: (pullPromise, promise) => {
|
|
2994
3010
|
const pullProcessId = pullPromise.$$pullProcessId;
|
|
2995
|
-
|
|
2996
|
-
if (
|
|
3011
|
+
lodashEs.remove(promises[pullProcessId], promise);
|
|
3012
|
+
if (lodashEs.isEmpty(promises[pullProcessId])) {
|
|
2997
3013
|
delete promises[pullProcessId];
|
|
2998
3014
|
}
|
|
2999
3015
|
},
|
|
3000
3016
|
abort: (pullPromise) => {
|
|
3001
3017
|
const pullProcessId = pullPromise.$$pullProcessId;
|
|
3002
3018
|
if (promises[pullProcessId]) {
|
|
3003
|
-
|
|
3019
|
+
lodashEs.forEach(promises[pullProcessId], function (p) {
|
|
3004
3020
|
if (p && p.abort) {
|
|
3005
3021
|
p.abort();
|
|
3006
3022
|
}
|
|
@@ -3047,22 +3063,22 @@
|
|
|
3047
3063
|
* @returns {any}
|
|
3048
3064
|
*/
|
|
3049
3065
|
addDeltaCriteria(db, entityName, query) {
|
|
3050
|
-
const entitySchema = db.schema.entities[entityName], deltaFieldName = entitySchema.pullConfig.deltaFieldName, deltaField =
|
|
3066
|
+
const entitySchema = db.schema.entities[entityName], deltaFieldName = entitySchema.pullConfig.deltaFieldName, deltaField = lodashEs.find(entitySchema.columns, { 'fieldName': deltaFieldName }) || {};
|
|
3051
3067
|
let isBundledEntity;
|
|
3052
|
-
if (!
|
|
3068
|
+
if (!lodashEs.isEmpty(deltaFieldName)) {
|
|
3053
3069
|
return this.localDBManagementService.isBundled(db.schema.name, entityName)
|
|
3054
3070
|
.then(flag => isBundledEntity = flag)
|
|
3055
3071
|
.then(() => this.getLastPullInfo())
|
|
3056
3072
|
.then(lastPullInfo => {
|
|
3057
3073
|
let lastPullTime = (lastPullInfo && lastPullInfo.startTime && lastPullInfo.startTime.getTime());
|
|
3058
|
-
const lastPullDBInfo =
|
|
3074
|
+
const lastPullDBInfo = lodashEs.find(lastPullInfo && lastPullInfo.databases, { 'name': db.schema.name }), lastPullEntityInfo = lodashEs.find(lastPullDBInfo && lastPullDBInfo.entities, { 'entityName': entityName }) || {};
|
|
3059
3075
|
if (!lastPullTime && isBundledEntity) {
|
|
3060
3076
|
// For bundled entity when there is no last pull, fetch records that got modified after db creation.
|
|
3061
3077
|
lastPullTime = (lastPullInfo && lastPullInfo.endTime && lastPullInfo.endTime.getTime());
|
|
3062
3078
|
lastPullEntityInfo.query = query;
|
|
3063
3079
|
}
|
|
3064
3080
|
if (lastPullEntityInfo.query === query && lastPullTime > 0) {
|
|
3065
|
-
if (
|
|
3081
|
+
if (lodashEs.isEmpty(query)) {
|
|
3066
3082
|
query = '';
|
|
3067
3083
|
}
|
|
3068
3084
|
else {
|
|
@@ -3111,17 +3127,17 @@
|
|
|
3111
3127
|
}
|
|
3112
3128
|
return query;
|
|
3113
3129
|
}).then(query => {
|
|
3114
|
-
filter =
|
|
3130
|
+
filter = lodashEs.isEmpty(query) ? '' : 'q=' + query;
|
|
3115
3131
|
return this.getTotalRecordsToPull(db, entitySchema, filter, pullPromise);
|
|
3116
3132
|
}).then(maxNoOfRecords => {
|
|
3117
3133
|
const pageSize = entitySchema.pullConfig.size || 100, maxNoOfPages = Math.ceil(maxNoOfRecords / pageSize);
|
|
3118
3134
|
result.totalRecordsToPull = maxNoOfRecords;
|
|
3119
3135
|
let sort = entitySchema.pullConfig.orderBy;
|
|
3120
|
-
sort = (
|
|
3136
|
+
sort = (lodashEs.isEmpty(sort) ? '' : sort + ',') + store.primaryKeyName;
|
|
3121
3137
|
progressObserver.next(result);
|
|
3122
3138
|
const _progressObserver = { next: data => {
|
|
3123
3139
|
inProgress++;
|
|
3124
|
-
data =
|
|
3140
|
+
data = lodashEs.slice(data, 0, result.totalRecordsToPull - result.pulledRecordCount);
|
|
3125
3141
|
store.saveAll(data).then(() => {
|
|
3126
3142
|
result.pulledRecordCount += data ? data.length : 0;
|
|
3127
3143
|
progressObserver.next(result);
|
|
@@ -3147,7 +3163,7 @@
|
|
|
3147
3163
|
}
|
|
3148
3164
|
// If expression starts with 'bind:', then expression is evaluated and result is returned.
|
|
3149
3165
|
evalIfBind(expression) {
|
|
3150
|
-
if (
|
|
3166
|
+
if (lodashEs.startsWith(expression, 'bind:')) {
|
|
3151
3167
|
expression = expression.replace(/\[\$\i\]/g, '[0]');
|
|
3152
3168
|
return i1$1.$parseExpr(expression.replace('bind:', ''))(this.app);
|
|
3153
3169
|
}
|
|
@@ -3190,8 +3206,8 @@
|
|
|
3190
3206
|
};
|
|
3191
3207
|
return this.retryIfNetworkFails(() => {
|
|
3192
3208
|
return this.executeDatabaseCountQuery(params).then(function (response) {
|
|
3193
|
-
const totalRecordCount = response, maxRecordsToPull =
|
|
3194
|
-
if (
|
|
3209
|
+
const totalRecordCount = response, maxRecordsToPull = parseInt(entitySchema.pullConfig.maxNumberOfRecords);
|
|
3210
|
+
if (lodashEs.isNaN(maxRecordsToPull) || maxRecordsToPull <= 0 || totalRecordCount < maxRecordsToPull) {
|
|
3195
3211
|
return totalRecordCount;
|
|
3196
3212
|
}
|
|
3197
3213
|
return maxRecordsToPull;
|
|
@@ -3204,23 +3220,23 @@
|
|
|
3204
3220
|
return this.localDBManagementService.isBundled(db.schema.name, entityName)
|
|
3205
3221
|
.then(isBundledEntity => {
|
|
3206
3222
|
let hasNullAttributeValue = false;
|
|
3207
|
-
if (isBundledEntity ||
|
|
3208
|
-
query =
|
|
3209
|
-
query =
|
|
3223
|
+
if (isBundledEntity || lodashEs.isEmpty(entitySchema.pullConfig.query)) {
|
|
3224
|
+
query = lodashEs.cloneDeep(entitySchema.pullConfig.filter);
|
|
3225
|
+
query = lodashEs.map(query, v => {
|
|
3210
3226
|
v.attributeValue = this.evalIfBind(v.attributeValue);
|
|
3211
|
-
hasNullAttributeValue = hasNullAttributeValue ||
|
|
3227
|
+
hasNullAttributeValue = hasNullAttributeValue || lodashEs.isNil(v.attributeValue);
|
|
3212
3228
|
return v;
|
|
3213
3229
|
});
|
|
3214
3230
|
if (hasNullAttributeValue) {
|
|
3215
3231
|
return Promise.reject('Null criteria values are present');
|
|
3216
3232
|
}
|
|
3217
|
-
query =
|
|
3233
|
+
query = lodashEs.sortBy(query, 'attributeName');
|
|
3218
3234
|
query = variables$1.LiveVariableUtils.getSearchQuery(query, ' AND ', true);
|
|
3219
3235
|
}
|
|
3220
3236
|
else {
|
|
3221
3237
|
query = this.evalIfBind(entitySchema.pullConfig.query);
|
|
3222
3238
|
}
|
|
3223
|
-
if (
|
|
3239
|
+
if (lodashEs.isNil(query)) {
|
|
3224
3240
|
return Promise.resolve(null);
|
|
3225
3241
|
}
|
|
3226
3242
|
return Promise.resolve(encodeURIComponent(query));
|
|
@@ -3244,7 +3260,8 @@
|
|
|
3244
3260
|
totalTaskCount: 0
|
|
3245
3261
|
};
|
|
3246
3262
|
const storePromises = [];
|
|
3247
|
-
|
|
3263
|
+
lodashEs.forEach(db.schema.entities, entity => {
|
|
3264
|
+
// @ts-ignore
|
|
3248
3265
|
storePromises.push(this.localDBManagementService.getStore(datamodelName, entity.entityName));
|
|
3249
3266
|
});
|
|
3250
3267
|
return new Promise((resolve, reject) => {
|
|
@@ -3258,21 +3275,21 @@
|
|
|
3258
3275
|
entities.push(store.entitySchema);
|
|
3259
3276
|
}
|
|
3260
3277
|
});
|
|
3261
|
-
const pullPromises =
|
|
3278
|
+
const pullPromises = lodashEs.chain(entities)
|
|
3262
3279
|
.map(entity => {
|
|
3263
3280
|
const _progressObserver = {
|
|
3264
3281
|
next: info => {
|
|
3265
|
-
const i =
|
|
3282
|
+
const i = lodashEs.findIndex(result.entities, { 'entityName': info.entityName });
|
|
3266
3283
|
if (i >= 0) {
|
|
3267
3284
|
result.entities[i] = info;
|
|
3268
3285
|
}
|
|
3269
3286
|
else {
|
|
3270
3287
|
result.entities.push(info);
|
|
3271
3288
|
}
|
|
3272
|
-
result.pulledRecordCount =
|
|
3289
|
+
result.pulledRecordCount = lodashEs.reduce(result.entities, function (sum, entityPullInfo) {
|
|
3273
3290
|
return sum + entityPullInfo.pulledRecordCount;
|
|
3274
3291
|
}, 0);
|
|
3275
|
-
result.totalRecordsToPull =
|
|
3292
|
+
result.totalRecordsToPull = lodashEs.reduce(result.entities, function (sum, entityPullInfo) {
|
|
3276
3293
|
return sum + entityPullInfo.totalRecordsToPull;
|
|
3277
3294
|
}, 0);
|
|
3278
3295
|
progressObserver.next(result);
|
|
@@ -3364,7 +3381,7 @@
|
|
|
3364
3381
|
getDb(dbName) {
|
|
3365
3382
|
return this.localDBManagementService.loadDatabases()
|
|
3366
3383
|
.then(databases => {
|
|
3367
|
-
const db =
|
|
3384
|
+
const db = lodashEs.find(databases, { 'name': dbName });
|
|
3368
3385
|
return db || Promise.reject('Local database (' + dbName + ') not found');
|
|
3369
3386
|
});
|
|
3370
3387
|
}
|
|
@@ -3374,10 +3391,10 @@
|
|
|
3374
3391
|
*/
|
|
3375
3392
|
getLastPullInfo() {
|
|
3376
3393
|
return this.localKeyValueService.get(LAST_PULL_INFO_KEY).then(info => {
|
|
3377
|
-
if (
|
|
3394
|
+
if (lodashEs.isString(info.startTime)) {
|
|
3378
3395
|
info.startTime = new Date(info.startTime);
|
|
3379
3396
|
}
|
|
3380
|
-
if (
|
|
3397
|
+
if (lodashEs.isString(info.endTime)) {
|
|
3381
3398
|
info.endTime = new Date(info.endTime);
|
|
3382
3399
|
}
|
|
3383
3400
|
return info;
|
|
@@ -3404,28 +3421,28 @@
|
|
|
3404
3421
|
};
|
|
3405
3422
|
this.localDBManagementService.loadDatabases()
|
|
3406
3423
|
.then(databases => {
|
|
3407
|
-
const dataPullPromises =
|
|
3424
|
+
const dataPullPromises = lodashEs.chain(databases).filter(function (db) {
|
|
3408
3425
|
return !db.schema.isInternal;
|
|
3409
3426
|
}).map(db => {
|
|
3410
3427
|
pullProcessManager.start(deferred.promise);
|
|
3411
3428
|
const _progressObserver = { next: data => {
|
|
3412
|
-
const i =
|
|
3429
|
+
const i = lodashEs.findIndex(pullInfo.databases, { 'name': data.name });
|
|
3413
3430
|
if (i >= 0) {
|
|
3414
3431
|
pullInfo.databases[i] = data;
|
|
3415
3432
|
}
|
|
3416
3433
|
else {
|
|
3417
3434
|
pullInfo.databases.push(data);
|
|
3418
3435
|
}
|
|
3419
|
-
pullInfo.totalTaskCount =
|
|
3436
|
+
pullInfo.totalTaskCount = lodashEs.reduce(pullInfo.databases, function (sum, dbPullInfo) {
|
|
3420
3437
|
return sum + dbPullInfo.totalTaskCount;
|
|
3421
3438
|
}, 0);
|
|
3422
|
-
pullInfo.completedTaskCount =
|
|
3439
|
+
pullInfo.completedTaskCount = lodashEs.reduce(pullInfo.databases, function (sum, dbPullInfo) {
|
|
3423
3440
|
return sum + dbPullInfo.completedTaskCount;
|
|
3424
3441
|
}, 0);
|
|
3425
|
-
pullInfo.totalPulledRecordCount =
|
|
3442
|
+
pullInfo.totalPulledRecordCount = lodashEs.reduce(pullInfo.databases, function (sum, dbPullInfo) {
|
|
3426
3443
|
return sum + dbPullInfo.pulledRecordCount;
|
|
3427
3444
|
}, 0);
|
|
3428
|
-
pullInfo.totalRecordsToPull =
|
|
3445
|
+
pullInfo.totalRecordsToPull = lodashEs.reduce(pullInfo.databases, function (sum, dbPullInfo) {
|
|
3429
3446
|
return sum + dbPullInfo.totalRecordsToPull;
|
|
3430
3447
|
}, 0);
|
|
3431
3448
|
progressObserver.next(pullInfo);
|