ngx-techlify-core 11.4.6 → 11.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -24
- package/bundles/ngx-techlify-core.umd.js +7861 -7849
- package/bundles/ngx-techlify-core.umd.js.map +1 -1
- package/bundles/ngx-techlify-core.umd.min.js +2 -2
- package/bundles/ngx-techlify-core.umd.min.js.map +1 -1
- package/esm2015/lib/action-popup/action-popup.component.js +32 -32
- package/esm2015/lib/action-popup/action-popup.model.js +3 -3
- package/esm2015/lib/action-popup/action-popup.module.js +26 -26
- package/esm2015/lib/action-popup/index.js +3 -3
- package/esm2015/lib/audit-log/audit-log-for-model/audit-log-for-model-routing.module.js +12 -12
- package/esm2015/lib/audit-log/audit-log-for-model/audit-log-for-model.component.js +49 -49
- package/esm2015/lib/audit-log/audit-log-for-model/audit-log-for-model.module.js +25 -25
- package/esm2015/lib/audit-log/audit-log-list/audit-log-list-routing.module.js +12 -12
- package/esm2015/lib/audit-log/audit-log-list/audit-log-list.component.js +132 -132
- package/esm2015/lib/audit-log/audit-log-list/audit-log-list.module.js +29 -29
- package/esm2015/lib/audit-log/audit-log-list-filter/audit-log-list-filter-routing.module.js +12 -12
- package/esm2015/lib/audit-log/audit-log-list-filter/audit-log-list-filter.component.js +67 -67
- package/esm2015/lib/audit-log/audit-log-list-filter/audit-log-list-filter.module.js +25 -25
- package/esm2015/lib/audit-log/audit-log-routing.module.js +19 -19
- package/esm2015/lib/audit-log/audit-log-view/audit-log-view-routing.module.js +12 -12
- package/esm2015/lib/audit-log/audit-log-view/audit-log-view.component.js +60 -60
- package/esm2015/lib/audit-log/audit-log-view/audit-log-view.module.js +21 -21
- package/esm2015/lib/audit-log/audit-log-view-model/audit-log-view-model-routing.module.js +12 -12
- package/esm2015/lib/audit-log/audit-log-view-model/audit-log-view-model.component.js +57 -57
- package/esm2015/lib/audit-log/audit-log-view-model/audit-log-view-model.module.js +21 -21
- package/esm2015/lib/audit-log/audit-log.module.js +20 -20
- package/esm2015/lib/audit-log/audit-logs-view-model/audit-logs-view-model-routing.module.js +12 -12
- package/esm2015/lib/audit-log/audit-logs-view-model/audit-logs-view-model.component.js +35 -35
- package/esm2015/lib/audit-log/audit-logs-view-model/audit-logs-view-model.module.js +21 -21
- package/esm2015/lib/core/alert.service.js +39 -39
- package/esm2015/lib/core/api-prefix.interceptor.js +28 -28
- package/esm2015/lib/core/authentication.guard.js +39 -39
- package/esm2015/lib/core/authentication.service.js +59 -59
- package/esm2015/lib/core/cache.interceptor.js +60 -60
- package/esm2015/lib/core/config.service.js +47 -47
- package/esm2015/lib/core/core.module.js +42 -42
- package/esm2015/lib/core/credentials.service.js +84 -84
- package/esm2015/lib/core/dataManager.service.js +120 -120
- package/esm2015/lib/core/error-handler.interceptor.js +53 -53
- package/esm2015/lib/core/error-handler.service.js +59 -59
- package/esm2015/lib/core/form-validator.service.js +23 -23
- package/esm2015/lib/core/header.interceptor.js +22 -22
- package/esm2015/lib/core/http-cache.service.js +110 -110
- package/esm2015/lib/core/http.service.js +82 -82
- package/esm2015/lib/core/index.js +21 -21
- package/esm2015/lib/core/logger.service.js +100 -100
- package/esm2015/lib/core/route-reusable-strategy.js +35 -35
- package/esm2015/lib/core/snack/snack.component.js +33 -33
- package/esm2015/lib/core/snack/snack.module.js +25 -25
- package/esm2015/lib/core/storage.service.js +36 -36
- package/esm2015/lib/core/techlify-config.model.js +28 -28
- package/esm2015/lib/core/token.interceptor.js +30 -30
- package/esm2015/lib/data-table/data-table.component.js +190 -190
- package/esm2015/lib/data-table/data-table.model.js +11 -11
- package/esm2015/lib/data-table/data-table.module.js +25 -25
- package/esm2015/lib/data-table/index.js +3 -3
- package/esm2015/lib/date-validator.js +10 -10
- package/esm2015/lib/document-viewer/document-viewer.component.js +58 -58
- package/esm2015/lib/document-viewer/document-viewer.module.js +25 -25
- package/esm2015/lib/document-viewer/index.js +3 -3
- package/esm2015/lib/document-viewer/viewer-config.model.js +3 -3
- package/esm2015/lib/email-subscription/email-subscription-for-user/email-subscription-for-user-routing.module.js +26 -26
- package/esm2015/lib/email-subscription/email-subscription-for-user/email-subscription-for-user.component.js +72 -72
- package/esm2015/lib/email-subscription/email-subscription-for-user/email-subscription-for-user.module.js +23 -23
- package/esm2015/lib/email-subscription/email-subscription-for-user/index.js +2 -2
- package/esm2015/lib/email-subscription/email-subscription-routing.module.js +12 -12
- package/esm2015/lib/email-subscription/email-subscription-type/email-subscription-type-form/email-subscription-type-form-routing.module.js +12 -12
- package/esm2015/lib/email-subscription/email-subscription-type/email-subscription-type-form/email-subscription-type-form.component.js +102 -102
- package/esm2015/lib/email-subscription/email-subscription-type/email-subscription-type-form/email-subscription-type-form.module.js +28 -28
- package/esm2015/lib/email-subscription/email-subscription-type/email-subscription-type-form/index.js +2 -2
- package/esm2015/lib/email-subscription/email-subscription-type/email-subscription-type-list/email-subscription-type-list-routing.module.js +28 -28
- package/esm2015/lib/email-subscription/email-subscription-type/email-subscription-type-list/email-subscription-type-list.component.js +153 -153
- package/esm2015/lib/email-subscription/email-subscription-type/email-subscription-type-list/email-subscription-type-list.module.js +27 -27
- package/esm2015/lib/email-subscription/email-subscription-type/email-subscription-type-list/index.js +1 -1
- package/esm2015/lib/email-subscription/email-subscription-type/email-subscription-type-routing.module.js +12 -12
- package/esm2015/lib/email-subscription/email-subscription-type/email-subscription-type.module.js +15 -15
- package/esm2015/lib/email-subscription/email-subscription-user/email-subscription-user-form/email-subscription-user-form-routing.module.js +12 -12
- package/esm2015/lib/email-subscription/email-subscription-user/email-subscription-user-form/email-subscription-user-form.component.js +99 -99
- package/esm2015/lib/email-subscription/email-subscription-user/email-subscription-user-form/email-subscription-user-form.module.js +27 -27
- package/esm2015/lib/email-subscription/email-subscription-user/email-subscription-user-form/index.js +2 -2
- package/esm2015/lib/email-subscription/email-subscription-user/email-subscription-user-list/email-subscription-user-list-routing.module.js +28 -28
- package/esm2015/lib/email-subscription/email-subscription-user/email-subscription-user-list/email-subscription-user-list.component.js +155 -155
- package/esm2015/lib/email-subscription/email-subscription-user/email-subscription-user-list/email-subscription-user-list.module.js +29 -29
- package/esm2015/lib/email-subscription/email-subscription-user/email-subscription-user-list/index.js +2 -2
- package/esm2015/lib/email-subscription/email-subscription-user/email-subscription-user-list-filter/email-subscription-user-list-filter-routing.module.js +12 -12
- package/esm2015/lib/email-subscription/email-subscription-user/email-subscription-user-list-filter/email-subscription-user-list-filter.component.js +50 -50
- package/esm2015/lib/email-subscription/email-subscription-user/email-subscription-user-list-filter/email-subscription-user-list-filter.module.js +25 -25
- package/esm2015/lib/email-subscription/email-subscription-user/email-subscription-user-list-filter/index.js +2 -2
- package/esm2015/lib/email-subscription/email-subscription-user/email-subscription-user-routing.module.js +12 -12
- package/esm2015/lib/email-subscription/email-subscription-user/email-subscription-user.module.js +15 -15
- package/esm2015/lib/email-subscription/email-subscription.module.js +15 -15
- package/esm2015/lib/entity-files/entity-file-form/entity-file-form.component.js +138 -138
- package/esm2015/lib/entity-files/entity-file.service.js +42 -42
- package/esm2015/lib/entity-files/entity-files-view-all.component.js +208 -204
- package/esm2015/lib/entity-files/entity-files-view-all.module.js +34 -34
- package/esm2015/lib/entity-files/index.js +3 -3
- package/esm2015/lib/export-excel/export-excel-button/export-excel-button.component.js +32 -32
- package/esm2015/lib/export-excel/export-excel.module.js +17 -17
- package/esm2015/lib/file-dropper/file-dropper.component.js +122 -122
- package/esm2015/lib/file-dropper/file-dropper.model.js +3 -3
- package/esm2015/lib/file-dropper/file-dropper.module.js +21 -21
- package/esm2015/lib/file-dropper/index.js +3 -3
- package/esm2015/lib/import-csv/data-import/data-import.component.js +18 -18
- package/esm2015/lib/import-csv/failed-items-list/failed-items-list.component.js +33 -33
- package/esm2015/lib/import-csv/field-mapping/field-mapping.component.js +148 -148
- package/esm2015/lib/import-csv/import-csv-config.js +2 -2
- package/esm2015/lib/import-csv/import-csv.component.js +196 -196
- package/esm2015/lib/import-csv/import-csv.module.js +46 -46
- package/esm2015/lib/import-csv/import-history-list/import-history-list.component.js +71 -71
- package/esm2015/lib/import-csv/import-success/import-success.component.js +19 -19
- package/esm2015/lib/loader/index.js +2 -2
- package/esm2015/lib/loader/loader.component.js +22 -22
- package/esm2015/lib/loader/loader.module.js +21 -21
- package/esm2015/lib/login-history-for-user/login-history-for-user-routing.module.js +20 -20
- package/esm2015/lib/login-history-for-user/login-history-for-user.component.js +88 -88
- package/esm2015/lib/login-history-for-user/login-history-for-user.module.js +27 -27
- package/esm2015/lib/material.module.js +60 -60
- package/esm2015/lib/note/comment-form/comment-form.component.js +73 -73
- package/esm2015/lib/note/index.js +4 -4
- package/esm2015/lib/note/note-form/note-form.component.js +81 -81
- package/esm2015/lib/note/note-list/note-list.component.js +151 -151
- package/esm2015/lib/note/note.module.js +36 -36
- package/esm2015/lib/note/note.service.js +31 -31
- package/esm2015/lib/read-more/read-more.component.js +43 -43
- package/esm2015/lib/read-more/read-more.module.js +21 -21
- package/esm2015/lib/searchable-selector/index.js +3 -3
- package/esm2015/lib/searchable-selector/mat-select-infinite-scroll.directive.js +81 -81
- package/esm2015/lib/searchable-selector/searchable-selector.component.js +307 -307
- package/esm2015/lib/searchable-selector/searchable-selector.module.js +28 -28
- package/esm2015/lib/techlify-feature/on-off-switch/on-off-switch.component.js +27 -27
- package/esm2015/lib/techlify-feature/techlify-feature-enabled.directive.js +78 -78
- package/esm2015/lib/techlify-feature/techlify-feature-listing.component.js +177 -177
- package/esm2015/lib/techlify-feature/techlify-feature.module.js +30 -30
- package/esm2015/lib/techlify-feature/techlify-feature.routing.js +12 -12
- package/esm2015/lib/techlify-feature/techlify-feature.service.js +28 -28
- package/esm2015/lib/techlify-tagger-tag-form-field/techlify-tagger-tag-form-config.model.js +15 -15
- package/esm2015/lib/techlify-tagger-tag-form-field/techlify-tagger-tag-form-field.component.js +269 -269
- package/esm2015/lib/techlify-tagger-tag-form-field/techlify-tagger-tag-form-field.module.js +25 -25
- package/esm2015/lib/techlify-tagger-tag-selector/techlify-tagger-tag-selector.component.js +168 -168
- package/esm2015/lib/techlify-tagger-tag-selector/techlify-tagger-tag-selector.module.js +29 -29
- package/esm2015/lib/techlify-update/techlify-update-form/techlify-update-form.component.js +114 -114
- package/esm2015/lib/techlify-update/techlify-update-form/techlify-update-form.module.js +28 -28
- package/esm2015/lib/techlify-update/techlify-update-history/techlify-update-history-routing.module.js +22 -22
- package/esm2015/lib/techlify-update/techlify-update-history/techlify-update-history.component.js +143 -143
- package/esm2015/lib/techlify-update/techlify-update-history/techlify-update-history.module.js +28 -28
- package/esm2015/lib/techlify-update/techlify-update-routing.module.js +22 -22
- package/esm2015/lib/techlify-update/techlify-update.module.js +30 -30
- package/esm2015/lib/techlify-update/techlify-update.service.js +43 -43
- package/esm2015/lib/techlify-update/techlify-updates-list/techlify-updates-list.component.js +161 -161
- package/esm2015/lib/techlify-update/update-notifier/update-notifier-snack/update-notifier-snack.component.js +82 -82
- package/esm2015/lib/techlify-update/update-notifier/update-notifier.component.js +62 -62
- package/esm2015/lib/techlify-update/update-notifier/update-notifier.module.js +29 -29
- package/esm2015/lib/techlify-update/update-view/update-view.component.js +36 -36
- package/esm2015/lib/techlify-update/update-view/update-view.module.js +24 -24
- package/esm2015/lib/timeline-filter/calculate-timeline.js +102 -102
- package/esm2015/lib/timeline-filter/index.js +4 -4
- package/esm2015/lib/timeline-filter/timeline-filter-routing.module.js +12 -12
- package/esm2015/lib/timeline-filter/timeline-filter.component.js +213 -213
- package/esm2015/lib/timeline-filter/timeline-filter.module.js +23 -23
- package/esm2015/lib/timeline-filter/timeline.model.js +18 -18
- package/esm2015/lib/utility/date-utils.service.js +48 -48
- package/esm2015/lib/utility/index.js +4 -4
- package/esm2015/lib/utility/num-items-selector.component.js +29 -29
- package/esm2015/lib/utility/number-selector.component.js +38 -38
- package/esm2015/lib/utility/utility.module.js +20 -20
- package/esm2015/ngx-techlify-core.js +59 -59
- package/esm2015/public-api.js +95 -95
- package/fesm2015/ngx-techlify-core.js +6726 -6722
- package/fesm2015/ngx-techlify-core.js.map +1 -1
- package/lib/action-popup/action-popup.component.d.ts +14 -14
- package/lib/action-popup/action-popup.model.d.ts +5 -5
- package/lib/action-popup/action-popup.module.d.ts +2 -2
- package/lib/action-popup/index.d.ts +2 -2
- package/lib/audit-log/audit-log-for-model/audit-log-for-model-routing.module.d.ts +2 -2
- package/lib/audit-log/audit-log-for-model/audit-log-for-model.component.d.ts +12 -12
- package/lib/audit-log/audit-log-for-model/audit-log-for-model.module.d.ts +2 -2
- package/lib/audit-log/audit-log-list/audit-log-list-routing.module.d.ts +2 -2
- package/lib/audit-log/audit-log-list/audit-log-list.component.d.ts +32 -32
- package/lib/audit-log/audit-log-list/audit-log-list.module.d.ts +2 -2
- package/lib/audit-log/audit-log-list-filter/audit-log-list-filter-routing.module.d.ts +2 -2
- package/lib/audit-log/audit-log-list-filter/audit-log-list-filter.component.d.ts +19 -19
- package/lib/audit-log/audit-log-list-filter/audit-log-list-filter.module.d.ts +2 -2
- package/lib/audit-log/audit-log-routing.module.d.ts +2 -2
- package/lib/audit-log/audit-log-view/audit-log-view-routing.module.d.ts +2 -2
- package/lib/audit-log/audit-log-view/audit-log-view.component.d.ts +17 -17
- package/lib/audit-log/audit-log-view/audit-log-view.module.d.ts +2 -2
- package/lib/audit-log/audit-log-view-model/audit-log-view-model-routing.module.d.ts +2 -2
- package/lib/audit-log/audit-log-view-model/audit-log-view-model.component.d.ts +15 -15
- package/lib/audit-log/audit-log-view-model/audit-log-view-model.module.d.ts +2 -2
- package/lib/audit-log/audit-log.module.d.ts +2 -2
- package/lib/audit-log/audit-logs-view-model/audit-logs-view-model-routing.module.d.ts +2 -2
- package/lib/audit-log/audit-logs-view-model/audit-logs-view-model.component.d.ts +11 -11
- package/lib/audit-log/audit-logs-view-model/audit-logs-view-model.module.d.ts +2 -2
- package/lib/core/alert.service.d.ts +12 -12
- package/lib/core/api-prefix.interceptor.d.ts +11 -11
- package/lib/core/authentication.guard.d.ts +10 -10
- package/lib/core/authentication.service.d.ts +23 -23
- package/lib/core/cache.interceptor.d.ts +21 -21
- package/lib/core/config.service.d.ts +19 -19
- package/lib/core/core.module.d.ts +3 -3
- package/lib/core/credentials.service.d.ts +36 -36
- package/lib/core/dataManager.service.d.ts +70 -70
- package/lib/core/error-handler.interceptor.d.ts +14 -14
- package/lib/core/error-handler.service.d.ts +14 -14
- package/lib/core/form-validator.service.d.ts +8 -8
- package/lib/core/header.interceptor.d.ts +8 -8
- package/lib/core/http-cache.service.d.ts +54 -54
- package/lib/core/http.service.d.ts +56 -56
- package/lib/core/index.d.ts +20 -20
- package/lib/core/logger.service.d.ts +85 -85
- package/lib/core/route-reusable-strategy.d.ts +13 -13
- package/lib/core/snack/snack.component.d.ts +8 -8
- package/lib/core/snack/snack.module.d.ts +2 -2
- package/lib/core/storage.service.d.ts +15 -15
- package/lib/core/techlify-config.model.d.ts +18 -18
- package/lib/core/token.interceptor.d.ts +11 -11
- package/lib/data-table/data-table.component.d.ts +60 -60
- package/lib/data-table/data-table.model.d.ts +46 -46
- package/lib/data-table/data-table.module.d.ts +2 -2
- package/lib/data-table/index.d.ts +2 -2
- package/lib/date-validator.d.ts +1 -1
- package/lib/document-viewer/document-viewer.component.d.ts +16 -16
- package/lib/document-viewer/document-viewer.module.d.ts +2 -2
- package/lib/document-viewer/index.d.ts +2 -2
- package/lib/document-viewer/viewer-config.model.d.ts +5 -5
- package/lib/email-subscription/email-subscription-for-user/email-subscription-for-user-routing.module.d.ts +7 -7
- package/lib/email-subscription/email-subscription-for-user/email-subscription-for-user.component.d.ts +17 -17
- package/lib/email-subscription/email-subscription-for-user/email-subscription-for-user.module.d.ts +2 -2
- package/lib/email-subscription/email-subscription-for-user/index.d.ts +1 -1
- package/lib/email-subscription/email-subscription-routing.module.d.ts +2 -2
- package/lib/email-subscription/email-subscription-type/email-subscription-type-form/email-subscription-type-form-routing.module.d.ts +2 -2
- package/lib/email-subscription/email-subscription-type/email-subscription-type-form/email-subscription-type-form.component.d.ts +32 -32
- package/lib/email-subscription/email-subscription-type/email-subscription-type-form/email-subscription-type-form.module.d.ts +2 -2
- package/lib/email-subscription/email-subscription-type/email-subscription-type-form/index.d.ts +1 -1
- package/lib/email-subscription/email-subscription-type/email-subscription-type-list/email-subscription-type-list-routing.module.d.ts +9 -9
- package/lib/email-subscription/email-subscription-type/email-subscription-type-list/email-subscription-type-list.component.d.ts +30 -30
- package/lib/email-subscription/email-subscription-type/email-subscription-type-list/email-subscription-type-list.module.d.ts +2 -2
- package/lib/email-subscription/email-subscription-type/email-subscription-type-list/index.d.ts +1 -1
- package/lib/email-subscription/email-subscription-type/email-subscription-type-routing.module.d.ts +2 -2
- package/lib/email-subscription/email-subscription-type/email-subscription-type.module.d.ts +2 -2
- package/lib/email-subscription/email-subscription-user/email-subscription-user-form/email-subscription-user-form-routing.module.d.ts +2 -2
- package/lib/email-subscription/email-subscription-user/email-subscription-user-form/email-subscription-user-form.component.d.ts +32 -32
- package/lib/email-subscription/email-subscription-user/email-subscription-user-form/email-subscription-user-form.module.d.ts +2 -2
- package/lib/email-subscription/email-subscription-user/email-subscription-user-form/index.d.ts +1 -1
- package/lib/email-subscription/email-subscription-user/email-subscription-user-list/email-subscription-user-list-routing.module.d.ts +9 -9
- package/lib/email-subscription/email-subscription-user/email-subscription-user-list/email-subscription-user-list.component.d.ts +32 -32
- package/lib/email-subscription/email-subscription-user/email-subscription-user-list/email-subscription-user-list.module.d.ts +2 -2
- package/lib/email-subscription/email-subscription-user/email-subscription-user-list/index.d.ts +1 -1
- package/lib/email-subscription/email-subscription-user/email-subscription-user-list-filter/email-subscription-user-list-filter-routing.module.d.ts +2 -2
- package/lib/email-subscription/email-subscription-user/email-subscription-user-list-filter/email-subscription-user-list-filter.component.d.ts +13 -13
- package/lib/email-subscription/email-subscription-user/email-subscription-user-list-filter/email-subscription-user-list-filter.module.d.ts +2 -2
- package/lib/email-subscription/email-subscription-user/email-subscription-user-list-filter/index.d.ts +1 -1
- package/lib/email-subscription/email-subscription-user/email-subscription-user-routing.module.d.ts +2 -2
- package/lib/email-subscription/email-subscription-user/email-subscription-user.module.d.ts +2 -2
- package/lib/email-subscription/email-subscription.module.d.ts +2 -2
- package/lib/entity-files/entity-file-form/entity-file-form.component.d.ts +34 -34
- package/lib/entity-files/entity-file.service.d.ts +10 -10
- package/lib/entity-files/entity-files-view-all.component.d.ts +45 -44
- package/lib/entity-files/entity-files-view-all.module.d.ts +2 -2
- package/lib/entity-files/index.d.ts +2 -2
- package/lib/export-excel/export-excel-button/export-excel-button.component.d.ts +8 -8
- package/lib/export-excel/export-excel.module.d.ts +2 -2
- package/lib/file-dropper/file-dropper.component.d.ts +33 -33
- package/lib/file-dropper/file-dropper.model.d.ts +10 -10
- package/lib/file-dropper/file-dropper.module.d.ts +2 -2
- package/lib/file-dropper/index.d.ts +2 -2
- package/lib/import-csv/data-import/data-import.component.d.ts +6 -6
- package/lib/import-csv/failed-items-list/failed-items-list.component.d.ts +12 -12
- package/lib/import-csv/field-mapping/field-mapping.component.d.ts +34 -34
- package/lib/import-csv/import-csv-config.d.ts +17 -17
- package/lib/import-csv/import-csv.component.d.ts +33 -33
- package/lib/import-csv/import-csv.module.d.ts +2 -2
- package/lib/import-csv/import-history-list/import-history-list.component.d.ts +21 -21
- package/lib/import-csv/import-success/import-success.component.d.ts +8 -8
- package/lib/loader/index.d.ts +1 -1
- package/lib/loader/loader.component.d.ts +8 -8
- package/lib/loader/loader.module.d.ts +2 -2
- package/lib/login-history-for-user/login-history-for-user-routing.module.d.ts +2 -2
- package/lib/login-history-for-user/login-history-for-user.component.d.ts +23 -23
- package/lib/login-history-for-user/login-history-for-user.module.d.ts +2 -2
- package/lib/material.module.d.ts +2 -2
- package/lib/note/comment-form/comment-form.component.d.ts +22 -22
- package/lib/note/index.d.ts +3 -3
- package/lib/note/note-form/note-form.component.d.ts +27 -27
- package/lib/note/note-list/note-list.component.d.ts +28 -28
- package/lib/note/note.module.d.ts +2 -2
- package/lib/note/note.service.d.ts +9 -9
- package/lib/read-more/read-more.component.d.ts +12 -12
- package/lib/read-more/read-more.module.d.ts +2 -2
- package/lib/searchable-selector/index.d.ts +2 -2
- package/lib/searchable-selector/mat-select-infinite-scroll.directive.d.ts +23 -23
- package/lib/searchable-selector/searchable-selector.component.d.ts +81 -81
- package/lib/searchable-selector/searchable-selector.module.d.ts +2 -2
- package/lib/techlify-feature/on-off-switch/on-off-switch.component.d.ts +9 -9
- package/lib/techlify-feature/techlify-feature-enabled.directive.d.ts +17 -17
- package/lib/techlify-feature/techlify-feature-listing.component.d.ts +37 -37
- package/lib/techlify-feature/techlify-feature.module.d.ts +2 -2
- package/lib/techlify-feature/techlify-feature.routing.d.ts +2 -2
- package/lib/techlify-feature/techlify-feature.service.d.ts +8 -8
- package/lib/techlify-tagger-tag-form-field/techlify-tagger-tag-form-config.model.d.ts +12 -12
- package/lib/techlify-tagger-tag-form-field/techlify-tagger-tag-form-field.component.d.ts +76 -76
- package/lib/techlify-tagger-tag-form-field/techlify-tagger-tag-form-field.module.d.ts +2 -2
- package/lib/techlify-tagger-tag-selector/techlify-tagger-tag-selector.component.d.ts +58 -58
- package/lib/techlify-tagger-tag-selector/techlify-tagger-tag-selector.module.d.ts +2 -2
- package/lib/techlify-update/techlify-update-form/techlify-update-form.component.d.ts +30 -30
- package/lib/techlify-update/techlify-update-form/techlify-update-form.module.d.ts +2 -2
- package/lib/techlify-update/techlify-update-history/techlify-update-history-routing.module.d.ts +2 -2
- package/lib/techlify-update/techlify-update-history/techlify-update-history.component.d.ts +31 -31
- package/lib/techlify-update/techlify-update-history/techlify-update-history.module.d.ts +2 -2
- package/lib/techlify-update/techlify-update-routing.module.d.ts +2 -2
- package/lib/techlify-update/techlify-update.module.d.ts +2 -2
- package/lib/techlify-update/techlify-update.service.d.ts +13 -13
- package/lib/techlify-update/techlify-updates-list/techlify-updates-list.component.d.ts +31 -31
- package/lib/techlify-update/update-notifier/update-notifier-snack/update-notifier-snack.component.d.ts +25 -25
- package/lib/techlify-update/update-notifier/update-notifier.component.d.ts +16 -16
- package/lib/techlify-update/update-notifier/update-notifier.module.d.ts +2 -2
- package/lib/techlify-update/update-view/update-view.component.d.ts +14 -14
- package/lib/techlify-update/update-view/update-view.module.d.ts +2 -2
- package/lib/timeline-filter/calculate-timeline.d.ts +6 -6
- package/lib/timeline-filter/index.d.ts +3 -3
- package/lib/timeline-filter/timeline-filter-routing.module.d.ts +2 -2
- package/lib/timeline-filter/timeline-filter.component.d.ts +61 -61
- package/lib/timeline-filter/timeline-filter.module.d.ts +2 -2
- package/lib/timeline-filter/timeline.model.d.ts +17 -17
- package/lib/utility/date-utils.service.d.ts +21 -21
- package/lib/utility/index.d.ts +3 -3
- package/lib/utility/num-items-selector.component.d.ts +16 -16
- package/lib/utility/number-selector.component.d.ts +20 -20
- package/lib/utility/utility.module.d.ts +2 -2
- package/ngx-techlify-core.d.ts +59 -59
- package/ngx-techlify-core.metadata.json +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +91 -91
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
import { Injectable } from '@angular/core';
|
|
2
|
-
import { HttpResponse } from '@angular/common/http';
|
|
3
|
-
import { HttpCacheService } from './http-cache.service';
|
|
4
|
-
import { Observable } from 'rxjs';
|
|
5
|
-
import * as i0 from "@angular/core";
|
|
6
|
-
import * as i1 from "./http-cache.service";
|
|
7
|
-
/**
|
|
8
|
-
* Caches HTTP requests.
|
|
9
|
-
* Use ExtendedHttpClient fluent API to configure caching for each request.
|
|
10
|
-
*/
|
|
11
|
-
export class CacheInterceptor {
|
|
12
|
-
constructor(httpCacheService) {
|
|
13
|
-
this.httpCacheService = httpCacheService;
|
|
14
|
-
this.forceUpdate = false;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Configures interceptor options
|
|
18
|
-
* @param {{update: boolean}} options If update option is enabled, forces request to be made and updates cache entry.
|
|
19
|
-
* @return {CacheInterceptor} The configured instance.
|
|
20
|
-
*/
|
|
21
|
-
configure(options) {
|
|
22
|
-
const instance = new CacheInterceptor(this.httpCacheService);
|
|
23
|
-
if (options && options.update) {
|
|
24
|
-
instance.forceUpdate = true;
|
|
25
|
-
}
|
|
26
|
-
return instance;
|
|
27
|
-
}
|
|
28
|
-
intercept(request, next) {
|
|
29
|
-
if (request.method !== 'GET') {
|
|
30
|
-
return next.handle(request);
|
|
31
|
-
}
|
|
32
|
-
return new Observable((subscriber) => {
|
|
33
|
-
const cachedData = this.forceUpdate ? null : this.httpCacheService.getCacheData(request.urlWithParams);
|
|
34
|
-
if (cachedData !== null) {
|
|
35
|
-
// Create new response to avoid side-effects
|
|
36
|
-
subscriber.next(new HttpResponse(cachedData));
|
|
37
|
-
subscriber.complete();
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
next.handle(request)
|
|
41
|
-
.subscribe(event => {
|
|
42
|
-
if (event instanceof HttpResponse) {
|
|
43
|
-
this.httpCacheService.setCacheData(request.urlWithParams, event);
|
|
44
|
-
}
|
|
45
|
-
subscriber.next(event);
|
|
46
|
-
}, error => subscriber.error(error), () => subscriber.complete());
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
CacheInterceptor.ɵprov = i0.ɵɵdefineInjectable({ factory: function CacheInterceptor_Factory() { return new CacheInterceptor(i0.ɵɵinject(i1.HttpCacheService)); }, token: CacheInterceptor, providedIn: "root" });
|
|
52
|
-
CacheInterceptor.decorators = [
|
|
53
|
-
{ type: Injectable, args: [{
|
|
54
|
-
providedIn: 'root'
|
|
55
|
-
},] }
|
|
56
|
-
];
|
|
57
|
-
CacheInterceptor.ctorParameters = () => [
|
|
58
|
-
{ type: HttpCacheService }
|
|
59
|
-
];
|
|
60
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import { HttpResponse } from '@angular/common/http';
|
|
3
|
+
import { HttpCacheService } from './http-cache.service';
|
|
4
|
+
import { Observable } from 'rxjs';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
import * as i1 from "./http-cache.service";
|
|
7
|
+
/**
|
|
8
|
+
* Caches HTTP requests.
|
|
9
|
+
* Use ExtendedHttpClient fluent API to configure caching for each request.
|
|
10
|
+
*/
|
|
11
|
+
export class CacheInterceptor {
|
|
12
|
+
constructor(httpCacheService) {
|
|
13
|
+
this.httpCacheService = httpCacheService;
|
|
14
|
+
this.forceUpdate = false;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Configures interceptor options
|
|
18
|
+
* @param {{update: boolean}} options If update option is enabled, forces request to be made and updates cache entry.
|
|
19
|
+
* @return {CacheInterceptor} The configured instance.
|
|
20
|
+
*/
|
|
21
|
+
configure(options) {
|
|
22
|
+
const instance = new CacheInterceptor(this.httpCacheService);
|
|
23
|
+
if (options && options.update) {
|
|
24
|
+
instance.forceUpdate = true;
|
|
25
|
+
}
|
|
26
|
+
return instance;
|
|
27
|
+
}
|
|
28
|
+
intercept(request, next) {
|
|
29
|
+
if (request.method !== 'GET') {
|
|
30
|
+
return next.handle(request);
|
|
31
|
+
}
|
|
32
|
+
return new Observable((subscriber) => {
|
|
33
|
+
const cachedData = this.forceUpdate ? null : this.httpCacheService.getCacheData(request.urlWithParams);
|
|
34
|
+
if (cachedData !== null) {
|
|
35
|
+
// Create new response to avoid side-effects
|
|
36
|
+
subscriber.next(new HttpResponse(cachedData));
|
|
37
|
+
subscriber.complete();
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
next.handle(request)
|
|
41
|
+
.subscribe(event => {
|
|
42
|
+
if (event instanceof HttpResponse) {
|
|
43
|
+
this.httpCacheService.setCacheData(request.urlWithParams, event);
|
|
44
|
+
}
|
|
45
|
+
subscriber.next(event);
|
|
46
|
+
}, error => subscriber.error(error), () => subscriber.complete());
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
CacheInterceptor.ɵprov = i0.ɵɵdefineInjectable({ factory: function CacheInterceptor_Factory() { return new CacheInterceptor(i0.ɵɵinject(i1.HttpCacheService)); }, token: CacheInterceptor, providedIn: "root" });
|
|
52
|
+
CacheInterceptor.decorators = [
|
|
53
|
+
{ type: Injectable, args: [{
|
|
54
|
+
providedIn: 'root'
|
|
55
|
+
},] }
|
|
56
|
+
];
|
|
57
|
+
CacheInterceptor.ctorParameters = () => [
|
|
58
|
+
{ type: HttpCacheService }
|
|
59
|
+
];
|
|
60
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FjaGUuaW50ZXJjZXB0b3IuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtdGVjaGxpZnktY29yZS9zcmMvbGliL2NvcmUvY2FjaGUuaW50ZXJjZXB0b3IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUMzQyxPQUFPLEVBQXdELFlBQVksRUFBRSxNQUFNLHNCQUFzQixDQUFDO0FBQzFHLE9BQU8sRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLHNCQUFzQixDQUFDO0FBQ3hELE9BQU8sRUFBRSxVQUFVLEVBQWMsTUFBTSxNQUFNLENBQUM7OztBQUU5Qzs7O0dBR0c7QUFJSCxNQUFNLE9BQU8sZ0JBQWdCO0lBSTNCLFlBQW9CLGdCQUFrQztRQUFsQyxxQkFBZ0IsR0FBaEIsZ0JBQWdCLENBQWtCO1FBRjlDLGdCQUFXLEdBQUcsS0FBSyxDQUFDO0lBRThCLENBQUM7SUFFM0Q7Ozs7T0FJRztJQUNILFNBQVMsQ0FBQyxPQUFxQztRQUM3QyxNQUFNLFFBQVEsR0FBRyxJQUFJLGdCQUFnQixDQUFDLElBQUksQ0FBQyxnQkFBZ0IsQ0FBQyxDQUFDO1FBQzdELElBQUksT0FBTyxJQUFJLE9BQU8s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oaXMuZm9yY2VVcGRhdGUgPyBudWxsIDogdGhpcy5odHRwQ2FjaGVTZXJ2aWNlLmdldENhY2hlRGF0YShyZXF1ZXN0LnVybFdpdGhQYXJhbXMpO1xyXG4gICAgICBpZiAoY2FjaGVkRGF0YSAhPT0gbnVsbCkge1xyXG4gICAgICAgIC8vIENyZWF0ZSBuZXcgcmVzcG9uc2UgdG8gYXZvaWQgc2lkZS1lZmZlY3RzXHJcbiAgICAgICAgc3Vic2NyaWJlci5uZXh0KG5ldyBIdHRwUmVzcG9uc2UoY2FjaGVkRGF0YSBhcyBPYmplY3QpKTtcclxuICAgICAgICBzdWJzY3JpYmVyLmNvbXBsZXRlKCk7XHJcbiAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgbmV4dC5oYW5kbGUocmVxdWVzdClcclxuICAgICAgICAgIC5zdWJzY3JpYmUoXHJcbiAgICAgICAgICAgIGV2ZW50ID0+IHtcclxuICAgICAgICAgICAgICBpZiAoZXZlbnQgaW5zdGFuY2VvZiBIdHRwUmVzcG9uc2UpIHtcclxuICAgICAgICAgICAgICAgIHRoaXMuaHR0cENhY2hlU2VydmljZS5zZXRDYWNoZURhdGEocmVxdWVzdC51cmxXaXRoUGFyYW1zLCBldmVudCk7XHJcbiAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgIHN1YnNjcmliZXIubmV4dChldmVudCk7XHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIGVycm9yID0+IHN1YnNjcmliZXIuZXJyb3IoZXJyb3IpLFxyXG4gICAgICAgICAgICAoKSA9PiBzdWJzY3JpYmVyLmNvbXBsZXRlKClcclxuICAgICAgICAgICk7XHJcbiAgICAgIH1cclxuICAgIH0pO1xyXG4gIH1cclxuXHJcbn1cclxuIl19
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import { Injectable } from '@angular/core';
|
|
2
|
-
import { TechlifyConfig } from "./techlify-config.model";
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
import * as i1 from "./techlify-config.model";
|
|
5
|
-
/**
|
|
6
|
-
* Service that provides settings for all other services
|
|
7
|
-
*
|
|
8
|
-
* @author Joshua Kissoon
|
|
9
|
-
* @since 20170709
|
|
10
|
-
*/
|
|
11
|
-
export class ConfigService {
|
|
12
|
-
constructor(config) {
|
|
13
|
-
this.config = config;
|
|
14
|
-
}
|
|
15
|
-
getConfigsRaw() {
|
|
16
|
-
return this.config.rawConfigs;
|
|
17
|
-
}
|
|
18
|
-
getProjectKey() {
|
|
19
|
-
return this.config.projectKey;
|
|
20
|
-
}
|
|
21
|
-
getApiUrl() {
|
|
22
|
-
return this.config.apiUrl;
|
|
23
|
-
}
|
|
24
|
-
getAuthClientSecret() {
|
|
25
|
-
return this.config.authClientSecret;
|
|
26
|
-
}
|
|
27
|
-
getStorage() {
|
|
28
|
-
return this.config.storage ? this.config.storage : localStorage;
|
|
29
|
-
}
|
|
30
|
-
getAuthGrantType() {
|
|
31
|
-
return this.config.authGrantType;
|
|
32
|
-
}
|
|
33
|
-
getCredentialsKey() {
|
|
34
|
-
return this.config.projectKey + "_" + ConfigService.BASE_CREDENTIALS;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
ConfigService.BASE_CREDENTIALS = "credentials";
|
|
38
|
-
ConfigService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ConfigService_Factory() { return new ConfigService(i0.ɵɵinject(i1.TechlifyConfig)); }, token: ConfigService, providedIn: "root" });
|
|
39
|
-
ConfigService.decorators = [
|
|
40
|
-
{ type: Injectable, args: [{
|
|
41
|
-
providedIn: 'root'
|
|
42
|
-
},] }
|
|
43
|
-
];
|
|
44
|
-
ConfigService.ctorParameters = () => [
|
|
45
|
-
{ type: TechlifyConfig }
|
|
46
|
-
];
|
|
47
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import { TechlifyConfig } from "./techlify-config.model";
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import * as i1 from "./techlify-config.model";
|
|
5
|
+
/**
|
|
6
|
+
* Service that provides settings for all other services
|
|
7
|
+
*
|
|
8
|
+
* @author Joshua Kissoon
|
|
9
|
+
* @since 20170709
|
|
10
|
+
*/
|
|
11
|
+
export class ConfigService {
|
|
12
|
+
constructor(config) {
|
|
13
|
+
this.config = config;
|
|
14
|
+
}
|
|
15
|
+
getConfigsRaw() {
|
|
16
|
+
return this.config.rawConfigs;
|
|
17
|
+
}
|
|
18
|
+
getProjectKey() {
|
|
19
|
+
return this.config.projectKey;
|
|
20
|
+
}
|
|
21
|
+
getApiUrl() {
|
|
22
|
+
return this.config.apiUrl;
|
|
23
|
+
}
|
|
24
|
+
getAuthClientSecret() {
|
|
25
|
+
return this.config.authClientSecret;
|
|
26
|
+
}
|
|
27
|
+
getStorage() {
|
|
28
|
+
return this.config.storage ? this.config.storage : localStorage;
|
|
29
|
+
}
|
|
30
|
+
getAuthGrantType() {
|
|
31
|
+
return this.config.authGrantType;
|
|
32
|
+
}
|
|
33
|
+
getCredentialsKey() {
|
|
34
|
+
return this.config.projectKey + "_" + ConfigService.BASE_CREDENTIALS;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
ConfigService.BASE_CREDENTIALS = "credentials";
|
|
38
|
+
ConfigService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ConfigService_Factory() { return new ConfigService(i0.ɵɵinject(i1.TechlifyConfig)); }, token: ConfigService, providedIn: "root" });
|
|
39
|
+
ConfigService.decorators = [
|
|
40
|
+
{ type: Injectable, args: [{
|
|
41
|
+
providedIn: 'root'
|
|
42
|
+
},] }
|
|
43
|
+
];
|
|
44
|
+
ConfigService.ctorParameters = () => [
|
|
45
|
+
{ type: TechlifyConfig }
|
|
46
|
+
];
|
|
47
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlnLnNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcy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VybiB0aGlzLmNvbmZpZy5hcGlVcmw7XHJcbiAgfVxyXG5cclxuICBnZXRBdXRoQ2xpZW50U2VjcmV0KCkge1xyXG4gICAgcmV0dXJuIHRoaXMuY29uZmlnLmF1dGhDbGllbnRTZWNyZXQ7XHJcbiAgfVxyXG5cclxuICBnZXRTdG9yYWdlKCkge1xyXG4gICAgcmV0dXJuIHRoaXMuY29uZmlnLnN0b3JhZ2UgPyB0aGlzLmNvbmZpZy5zdG9yYWdlIDogbG9jYWxTdG9yYWdlO1xyXG4gIH1cclxuXHJcbiAgZ2V0QXV0aEdyYW50VHlwZSgpIHtcclxuICAgIHJldHVybiB0aGlzLmNvbmZpZy5hdXRoR3JhbnRUeXBlO1xyXG4gIH1cclxuXHJcbiAgZ2V0Q3JlZGVudGlhbHNLZXkoKSB7XHJcbiAgICByZXR1cm4gdGhpcy5jb25maWcucHJvamVjdEtleSArIFwiX1wiICsgQ29uZmlnU2VydmljZS5CQVNFX0NSRURFTlRJQUxTO1xyXG4gIH1cclxuXHJcbn1cclxuIl19
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { NgModule, Optional, SkipSelf } from '@angular/core';
|
|
2
|
-
import { CommonModule } from '@angular/common';
|
|
3
|
-
import { HttpClientModule, HttpClient } from '@angular/common/http';
|
|
4
|
-
import { RouteReuseStrategy, RouterModule } from '@angular/router';
|
|
5
|
-
import { RouteReusableStrategy } from './route-reusable-strategy';
|
|
6
|
-
import { HttpService } from './http.service';
|
|
7
|
-
import { SnackModule } from './snack/snack.module';
|
|
8
|
-
export class CoreModule {
|
|
9
|
-
constructor(parentModule) {
|
|
10
|
-
// Import guard
|
|
11
|
-
if (parentModule) {
|
|
12
|
-
throw new Error(`${parentModule} has already been loaded. Import Core module in the root module only.`);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
CoreModule.decorators = [
|
|
17
|
-
{ type: NgModule, args: [{
|
|
18
|
-
imports: [
|
|
19
|
-
CommonModule,
|
|
20
|
-
HttpClientModule,
|
|
21
|
-
RouterModule,
|
|
22
|
-
SnackModule
|
|
23
|
-
],
|
|
24
|
-
providers: [
|
|
25
|
-
{
|
|
26
|
-
provide: HttpClient,
|
|
27
|
-
useClass: HttpService
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
provide: RouteReuseStrategy,
|
|
31
|
-
useClass: RouteReusableStrategy
|
|
32
|
-
}
|
|
33
|
-
],
|
|
34
|
-
exports: [
|
|
35
|
-
SnackModule
|
|
36
|
-
]
|
|
37
|
-
},] }
|
|
38
|
-
];
|
|
39
|
-
CoreModule.ctorParameters = () => [
|
|
40
|
-
{ type: CoreModule, decorators: [{ type: Optional }, { type: SkipSelf }] }
|
|
41
|
-
];
|
|
42
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
import { NgModule, Optional, SkipSelf } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { HttpClientModule, HttpClient } from '@angular/common/http';
|
|
4
|
+
import { RouteReuseStrategy, RouterModule } from '@angular/router';
|
|
5
|
+
import { RouteReusableStrategy } from './route-reusable-strategy';
|
|
6
|
+
import { HttpService } from './http.service';
|
|
7
|
+
import { SnackModule } from './snack/snack.module';
|
|
8
|
+
export class CoreModule {
|
|
9
|
+
constructor(parentModule) {
|
|
10
|
+
// Import guard
|
|
11
|
+
if (parentModule) {
|
|
12
|
+
throw new Error(`${parentModule} has already been loaded. Import Core module in the root module only.`);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
CoreModule.decorators = [
|
|
17
|
+
{ type: NgModule, args: [{
|
|
18
|
+
imports: [
|
|
19
|
+
CommonModule,
|
|
20
|
+
HttpClientModule,
|
|
21
|
+
RouterModule,
|
|
22
|
+
SnackModule
|
|
23
|
+
],
|
|
24
|
+
providers: [
|
|
25
|
+
{
|
|
26
|
+
provide: HttpClient,
|
|
27
|
+
useClass: HttpService
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
provide: RouteReuseStrategy,
|
|
31
|
+
useClass: RouteReusableStrategy
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
exports: [
|
|
35
|
+
SnackModule
|
|
36
|
+
]
|
|
37
|
+
},] }
|
|
38
|
+
];
|
|
39
|
+
CoreModule.ctorParameters = () => [
|
|
40
|
+
{ type: CoreModule, decorators: [{ type: Optional }, { type: SkipSelf }] }
|
|
41
|
+
];
|
|
42
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29yZS5tb2R1bGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtdGVjaGxpZnktY29yZS9zcmMvbGliL2NvcmUvY29yZS5tb2R1bGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFFBQVEsRUFBRSxRQUFRLEVBQUUsUUFBUSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQzdELE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUMvQyxPQUFPLEVBQXFCLGdCQUFnQixFQUFFLFVBQVUsRUFBRSxNQUFNLHNCQUFzQixDQUFDO0FBQ3ZGLE9BQU8sRUFBRSxrQkFBa0IsRUFBRSxZQUFZLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUVuRSxPQUFPLEVBQUUscUJBQXFCLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUdsRSxPQUFPLEVBQUUsV0FBVyxFQUFFLE1BQU0sZ0JBQWdCLENBQUM7QUFHN0MsT0FBTyxFQUFFLFdBQVcsRUFBRSxNQUFNLHNCQUFzQixDQUFDO0FBdUJuRCxNQUFNLE9BQU8sVUFBVTtJQUVyQixZQUFvQyxZQUF3QjtRQUMxRCxlQUFlO1FBQ2YsSUFBSSxZQUFZLEVBQUU7WUFDaEIs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ICAgIGlmIChwYXJlbnRNb2R1bGUpIHtcclxuICAgICAgdGhyb3cgbmV3IEVycm9yKGAke3BhcmVudE1vZHVsZX0gaGFzIGFscmVhZHkgYmVlbiBsb2FkZWQuIEltcG9ydCBDb3JlIG1vZHVsZSBpbiB0aGUgcm9vdCBtb2R1bGUgb25seS5gKTtcclxuICAgIH1cclxuICB9XHJcblxyXG59XHJcbiJdfQ==
|
|
@@ -1,84 +1,84 @@
|
|
|
1
|
-
import { Injectable } from '@angular/core';
|
|
2
|
-
import { ConfigService } from './config.service';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
import * as i1 from "./config.service";
|
|
5
|
-
/**
|
|
6
|
-
* Provides storage for authentication credentials.
|
|
7
|
-
* The Credentials interface should be replaced with proper implementation.
|
|
8
|
-
*/
|
|
9
|
-
export class CredentialsService {
|
|
10
|
-
constructor(configService) {
|
|
11
|
-
this.configService = configService;
|
|
12
|
-
this._credentials = null;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Checks is the user is authenticated.
|
|
16
|
-
* @return True if the user is authenticated.
|
|
17
|
-
*/
|
|
18
|
-
get isAuthenticated() {
|
|
19
|
-
return !!this.credentials;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Gets the user credentials.
|
|
23
|
-
* @return The user credentials or null if the user is not authenticated.
|
|
24
|
-
*/
|
|
25
|
-
get credentials() {
|
|
26
|
-
if (!this._credentials) {
|
|
27
|
-
this._credentials = JSON.parse(sessionStorage.getItem(this.configService.getCredentialsKey()) || localStorage.getItem(this.configService.getCredentialsKey()));
|
|
28
|
-
}
|
|
29
|
-
return this._credentials;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Sets the user credentials.
|
|
33
|
-
* The credentials may be persisted across sessions by setting the `remember` parameter to true.
|
|
34
|
-
* Otherwise, the credentials are only persisted for the current session.
|
|
35
|
-
* @param credentials The user credentials.
|
|
36
|
-
* @param remember True to remember credentials across sessions.
|
|
37
|
-
*/
|
|
38
|
-
setCredentials(credentials, remember) {
|
|
39
|
-
this._credentials = credentials || null;
|
|
40
|
-
if (credentials) {
|
|
41
|
-
(remember ? localStorage : sessionStorage).setItem(this.configService.getCredentialsKey(), JSON.stringify(credentials));
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
sessionStorage.clear();
|
|
45
|
-
localStorage.clear();
|
|
46
|
-
this._credentials = null;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
getAccessToken() {
|
|
50
|
-
var _a, _b, _c, _d;
|
|
51
|
-
const expiration = ((_b = (_a = this.credentials) === null || _a === void 0 ? void 0 : _a.token) === null || _b === void 0 ? void 0 : _b.expires_in) || '';
|
|
52
|
-
const token = ((_d = (_c = this.credentials) === null || _c === void 0 ? void 0 : _c.token) === null || _d === void 0 ? void 0 : _d.access_token) || '';
|
|
53
|
-
if (!token || !expiration) {
|
|
54
|
-
return null;
|
|
55
|
-
}
|
|
56
|
-
if (Date.now() > parseInt(expiration)) {
|
|
57
|
-
this.setCredentials();
|
|
58
|
-
return null;
|
|
59
|
-
}
|
|
60
|
-
return token;
|
|
61
|
-
}
|
|
62
|
-
getExpiration() {
|
|
63
|
-
var _a, _b;
|
|
64
|
-
return ((_b = (_a = this.credentials) === null || _a === void 0 ? void 0 : _a.token) === null || _b === void 0 ? void 0 : _b.expires_in) || '';
|
|
65
|
-
}
|
|
66
|
-
getRefreshToken() {
|
|
67
|
-
var _a, _b;
|
|
68
|
-
return ((_b = (_a = this.credentials) === null || _a === void 0 ? void 0 : _a.token) === null || _b === void 0 ? void 0 : _b.refresh_token) || '';
|
|
69
|
-
}
|
|
70
|
-
refresh() {
|
|
71
|
-
this._credentials = null;
|
|
72
|
-
return this;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
CredentialsService.ɵprov = i0.ɵɵdefineInjectable({ factory: function CredentialsService_Factory() { return new CredentialsService(i0.ɵɵinject(i1.ConfigService)); }, token: CredentialsService, providedIn: "root" });
|
|
76
|
-
CredentialsService.decorators = [
|
|
77
|
-
{ type: Injectable, args: [{
|
|
78
|
-
providedIn: 'root'
|
|
79
|
-
},] }
|
|
80
|
-
];
|
|
81
|
-
CredentialsService.ctorParameters = () => [
|
|
82
|
-
{ type: ConfigService }
|
|
83
|
-
];
|
|
84
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import { ConfigService } from './config.service';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import * as i1 from "./config.service";
|
|
5
|
+
/**
|
|
6
|
+
* Provides storage for authentication credentials.
|
|
7
|
+
* The Credentials interface should be replaced with proper implementation.
|
|
8
|
+
*/
|
|
9
|
+
export class CredentialsService {
|
|
10
|
+
constructor(configService) {
|
|
11
|
+
this.configService = configService;
|
|
12
|
+
this._credentials = null;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Checks is the user is authenticated.
|
|
16
|
+
* @return True if the user is authenticated.
|
|
17
|
+
*/
|
|
18
|
+
get isAuthenticated() {
|
|
19
|
+
return !!this.credentials;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Gets the user credentials.
|
|
23
|
+
* @return The user credentials or null if the user is not authenticated.
|
|
24
|
+
*/
|
|
25
|
+
get credentials() {
|
|
26
|
+
if (!this._credentials) {
|
|
27
|
+
this._credentials = JSON.parse(sessionStorage.getItem(this.configService.getCredentialsKey()) || localStorage.getItem(this.configService.getCredentialsKey()));
|
|
28
|
+
}
|
|
29
|
+
return this._credentials;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Sets the user credentials.
|
|
33
|
+
* The credentials may be persisted across sessions by setting the `remember` parameter to true.
|
|
34
|
+
* Otherwise, the credentials are only persisted for the current session.
|
|
35
|
+
* @param credentials The user credentials.
|
|
36
|
+
* @param remember True to remember credentials across sessions.
|
|
37
|
+
*/
|
|
38
|
+
setCredentials(credentials, remember) {
|
|
39
|
+
this._credentials = credentials || null;
|
|
40
|
+
if (credentials) {
|
|
41
|
+
(remember ? localStorage : sessionStorage).setItem(this.configService.getCredentialsKey(), JSON.stringify(credentials));
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
sessionStorage.clear();
|
|
45
|
+
localStorage.clear();
|
|
46
|
+
this._credentials = null;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
getAccessToken() {
|
|
50
|
+
var _a, _b, _c, _d;
|
|
51
|
+
const expiration = ((_b = (_a = this.credentials) === null || _a === void 0 ? void 0 : _a.token) === null || _b === void 0 ? void 0 : _b.expires_in) || '';
|
|
52
|
+
const token = ((_d = (_c = this.credentials) === null || _c === void 0 ? void 0 : _c.token) === null || _d === void 0 ? void 0 : _d.access_token) || '';
|
|
53
|
+
if (!token || !expiration) {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
if (Date.now() > parseInt(expiration)) {
|
|
57
|
+
this.setCredentials();
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
return token;
|
|
61
|
+
}
|
|
62
|
+
getExpiration() {
|
|
63
|
+
var _a, _b;
|
|
64
|
+
return ((_b = (_a = this.credentials) === null || _a === void 0 ? void 0 : _a.token) === null || _b === void 0 ? void 0 : _b.expires_in) || '';
|
|
65
|
+
}
|
|
66
|
+
getRefreshToken() {
|
|
67
|
+
var _a, _b;
|
|
68
|
+
return ((_b = (_a = this.credentials) === null || _a === void 0 ? void 0 : _a.token) === null || _b === void 0 ? void 0 : _b.refresh_token) || '';
|
|
69
|
+
}
|
|
70
|
+
refresh() {
|
|
71
|
+
this._credentials = null;
|
|
72
|
+
return this;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
CredentialsService.ɵprov = i0.ɵɵdefineInjectable({ factory: function CredentialsService_Factory() { return new CredentialsService(i0.ɵɵinject(i1.ConfigService)); }, token: CredentialsService, providedIn: "root" });
|
|
76
|
+
CredentialsService.decorators = [
|
|
77
|
+
{ type: Injectable, args: [{
|
|
78
|
+
providedIn: 'root'
|
|
79
|
+
},] }
|
|
80
|
+
];
|
|
81
|
+
CredentialsService.ctorParameters = () => [
|
|
82
|
+
{ type: ConfigService }
|
|
83
|
+
];
|
|
84
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3JlZGVudGlhbHMuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL25neC10ZWNobGlmeS1jb3JlL3NyYy9saWIvY29yZS9jcmVkZW50aWFscy5zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDM0MsT0FBTyxFQUFFLGFBQWEsRUFBRSxNQUFNLGtCQUFrQixDQUFDOzs7QUFRakQ7OztHQUdHO0FBSUgsTUFBTSxPQUFPLGtCQUFrQjtJQUk3QixZQUFvQixhQUE0QjtRQUE1QixrQkFBYSxHQUFiLGFBQWEsQ0FBZTtRQUZ4QyxpQkFBWSxHQUF1QixJQUFJLENBQUM7SUFHaEQsQ0FBQztJQUVEOzs7T0FHRztJQUNILElBQUksZUFBZTtRQUNqQixPQUFPLENBQUMsQ0FBQyxJQUFJLENBQUMsV0FBVyxDQUFDO0lBQzVCLENBQUM7SUFFRDs7O09BR0c7SUFDSCxJQUFJLFdBQVc7UUFDYixJQUFJLENBQUMsSUFBSSxDQUFDLFlBQVksRUFBRTtZQUN0QixJQUFJLENBQUMsWUFBWSxHQUFHLElBQUksQ0FBQyxLQUFLLENBQUMsY0FBYyxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsYUFBYSxDQUFDLGlCQUFpQixFQUFFLENBQUMsSUFBSSxZQUFZLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxhQUFhLENBQUMsaUJBQWlCLEVBQUUsQ0FBQyxDQUFD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