@eui/core 19.3.3-snapshot-1754655052849 → 21.0.0-alpha.1
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/CHANGELOG.md +86 -0
- package/docs/directives/TranslateMockDirective.html +0 -43
- package/docs/injectables/ApiQueueService.html +1 -55
- package/docs/injectables/EuiAppShellService.html +1 -103
- package/docs/injectables/EuiDynamicComponentService.html +0 -67
- package/docs/injectables/EuiDynamicMenuService.html +1 -43
- package/docs/injectables/EuiPermissionService.html +1 -43
- package/docs/injectables/EuiThemeService.html +1 -55
- package/docs/injectables/GlobalErrorHandler.html +0 -43
- package/docs/injectables/I18nLoader.html +1 -55
- package/docs/injectables/I18nService.html +1 -79
- package/docs/injectables/LocalForageService.html +1 -43
- package/docs/injectables/LocalStorageService.html +0 -54
- package/docs/injectables/LocaleService.html +1 -91
- package/docs/injectables/LocaleServiceMock.html +1 -31
- package/docs/injectables/LogService.html +1 -55
- package/docs/injectables/SessionStorageService.html +0 -43
- package/docs/injectables/StoreService.html +1 -42
- package/docs/injectables/UserService.html +1 -31
- package/docs/interceptors/AddLangParamInterceptor.html +0 -43
- package/docs/interceptors/HttpErrorHandlerInterceptor.html +0 -67
- package/docs/interceptors/UxRequestErrorModelInterceptor.html +0 -43
- package/docs/js/menu-wc.js +6 -6
- package/docs/js/menu-wc_es5.js +1 -1
- package/docs/js/search/search_index.js +2 -2
- package/docs/properties.html +1 -1
- package/fesm2022/eui-core.mjs +224 -315
- package/fesm2022/eui-core.mjs.map +1 -1
- package/index.d.ts +2470 -5
- package/index.d.ts.map +1 -1
- package/package.json +11 -11
- package/eui-core.d.ts.map +0 -1
- package/lib/eui-core.module.d.ts +0 -21
- package/lib/eui-core.module.d.ts.map +0 -1
- package/lib/helpers/css-utils.d.ts +0 -35
- package/lib/helpers/css-utils.d.ts.map +0 -1
- package/lib/helpers/date-helpers.d.ts +0 -3
- package/lib/helpers/date-helpers.d.ts.map +0 -1
- package/lib/helpers/dom-helpers.d.ts +0 -34
- package/lib/helpers/dom-helpers.d.ts.map +0 -1
- package/lib/helpers/event-helpers.d.ts +0 -2
- package/lib/helpers/event-helpers.d.ts.map +0 -1
- package/lib/helpers/form-helpers.d.ts +0 -11
- package/lib/helpers/form-helpers.d.ts.map +0 -1
- package/lib/helpers/format-helpers.d.ts +0 -13
- package/lib/helpers/format-helpers.d.ts.map +0 -1
- package/lib/helpers/http-helpers.d.ts +0 -8
- package/lib/helpers/http-helpers.d.ts.map +0 -1
- package/lib/helpers/index.d.ts +0 -10
- package/lib/helpers/index.d.ts.map +0 -1
- package/lib/helpers/injector.d.ts +0 -11
- package/lib/helpers/injector.d.ts.map +0 -1
- package/lib/helpers/utils.d.ts +0 -7
- package/lib/helpers/utils.d.ts.map +0 -1
- package/lib/interceptors/add-lang-param.interceptor.d.ts +0 -17
- package/lib/interceptors/add-lang-param.interceptor.d.ts.map +0 -1
- package/lib/interceptors/cache-prevention.interceptor.d.ts +0 -9
- package/lib/interceptors/cache-prevention.interceptor.d.ts.map +0 -1
- package/lib/interceptors/cors-security.interceptor.d.ts +0 -9
- package/lib/interceptors/cors-security.interceptor.d.ts.map +0 -1
- package/lib/interceptors/csrf-prevention.interceptor.d.ts +0 -9
- package/lib/interceptors/csrf-prevention.interceptor.d.ts.map +0 -1
- package/lib/interceptors/eu-login-session-timeout-handling.interceptor.d.ts +0 -20
- package/lib/interceptors/eu-login-session-timeout-handling.interceptor.d.ts.map +0 -1
- package/lib/interceptors/index.d.ts +0 -7
- package/lib/interceptors/index.d.ts.map +0 -1
- package/lib/interceptors/ux-request-error-model.interceptor.d.ts +0 -14
- package/lib/interceptors/ux-request-error-model.interceptor.d.ts.map +0 -1
- package/lib/services/app/eui-init-app.d.ts +0 -12
- package/lib/services/app/eui-init-app.d.ts.map +0 -1
- package/lib/services/app/eui-pre-init-app.d.ts +0 -17
- package/lib/services/app/eui-pre-init-app.d.ts.map +0 -1
- package/lib/services/app/eui-startup.d.ts +0 -5
- package/lib/services/app/eui-startup.d.ts.map +0 -1
- package/lib/services/app/factories/log.d.ts +0 -26
- package/lib/services/app/factories/log.d.ts.map +0 -1
- package/lib/services/app/index.d.ts +0 -3
- package/lib/services/app/index.d.ts.map +0 -1
- package/lib/services/config/defaults.d.ts +0 -12
- package/lib/services/config/defaults.d.ts.map +0 -1
- package/lib/services/config/tokens.d.ts +0 -20
- package/lib/services/config/tokens.d.ts.map +0 -1
- package/lib/services/dynamic-component/dynamic-component.service.d.ts +0 -42
- package/lib/services/dynamic-component/dynamic-component.service.d.ts.map +0 -1
- package/lib/services/dynamic-menu/dynamic-menu.service.d.ts +0 -15
- package/lib/services/dynamic-menu/dynamic-menu.service.d.ts.map +0 -1
- package/lib/services/errors/eui.error.d.ts +0 -14
- package/lib/services/errors/eui.error.d.ts.map +0 -1
- package/lib/services/errors/global-error-handler.d.ts +0 -11
- package/lib/services/errors/global-error-handler.d.ts.map +0 -1
- package/lib/services/errors/http-error-handler-callback-functions.d.ts +0 -7
- package/lib/services/errors/http-error-handler-callback-functions.d.ts.map +0 -1
- package/lib/services/errors/http-error-handler.interceptor.d.ts +0 -23
- package/lib/services/errors/http-error-handler.interceptor.d.ts.map +0 -1
- package/lib/services/errors/index.d.ts +0 -5
- package/lib/services/errors/index.d.ts.map +0 -1
- package/lib/services/eui-app-shell.service.d.ts +0 -110
- package/lib/services/eui-app-shell.service.d.ts.map +0 -1
- package/lib/services/eui-theme.service.d.ts +0 -52
- package/lib/services/eui-theme.service.d.ts.map +0 -1
- package/lib/services/eui-timezone.service.d.ts +0 -270
- package/lib/services/eui-timezone.service.d.ts.map +0 -1
- package/lib/services/growl/eui-growl.service.d.ts +0 -23
- package/lib/services/growl/eui-growl.service.d.ts.map +0 -1
- package/lib/services/growl/index.d.ts +0 -2
- package/lib/services/growl/index.d.ts.map +0 -1
- package/lib/services/i18n/i18n.loader.d.ts +0 -93
- package/lib/services/i18n/i18n.loader.d.ts.map +0 -1
- package/lib/services/i18n/i18n.resource.d.ts +0 -36
- package/lib/services/i18n/i18n.resource.d.ts.map +0 -1
- package/lib/services/i18n/i18n.service.d.ts +0 -102
- package/lib/services/i18n/i18n.service.d.ts.map +0 -1
- package/lib/services/i18n/index.d.ts +0 -4
- package/lib/services/i18n/index.d.ts.map +0 -1
- package/lib/services/index.d.ts +0 -20
- package/lib/services/index.d.ts.map +0 -1
- package/lib/services/loader/eui-loader.model.d.ts +0 -97
- package/lib/services/loader/eui-loader.model.d.ts.map +0 -1
- package/lib/services/loader/eui-loader.service.d.ts +0 -143
- package/lib/services/loader/eui-loader.service.d.ts.map +0 -1
- package/lib/services/loader/index.d.ts +0 -3
- package/lib/services/loader/index.d.ts.map +0 -1
- package/lib/services/locale/index.d.ts +0 -3
- package/lib/services/locale/index.d.ts.map +0 -1
- package/lib/services/locale/locale.service.d.ts +0 -103
- package/lib/services/locale/locale.service.d.ts.map +0 -1
- package/lib/services/locale/locale.service.mock.d.ts +0 -16
- package/lib/services/locale/locale.service.mock.d.ts.map +0 -1
- package/lib/services/log/index.d.ts +0 -4
- package/lib/services/log/index.d.ts.map +0 -1
- package/lib/services/log/log.module.d.ts +0 -16
- package/lib/services/log/log.module.d.ts.map +0 -1
- package/lib/services/log/log.service.d.ts +0 -28
- package/lib/services/log/log.service.d.ts.map +0 -1
- package/lib/services/log/log.service.mock.d.ts +0 -5
- package/lib/services/log/log.service.mock.d.ts.map +0 -1
- package/lib/services/permission/permission.service.d.ts +0 -188
- package/lib/services/permission/permission.service.d.ts.map +0 -1
- package/lib/services/queue/api-queue.service.d.ts +0 -278
- package/lib/services/queue/api-queue.service.d.ts.map +0 -1
- package/lib/services/queue/api-queue.service.mock.d.ts +0 -14
- package/lib/services/queue/api-queue.service.mock.d.ts.map +0 -1
- package/lib/services/queue/index.d.ts +0 -3
- package/lib/services/queue/index.d.ts.map +0 -1
- package/lib/services/storage/async-storage.service.d.ts +0 -45
- package/lib/services/storage/async-storage.service.d.ts.map +0 -1
- package/lib/services/storage/async-storage.service.mock.d.ts +0 -12
- package/lib/services/storage/async-storage.service.mock.d.ts.map +0 -1
- package/lib/services/storage/index.d.ts +0 -8
- package/lib/services/storage/index.d.ts.map +0 -1
- package/lib/services/storage/local-forage.service.d.ts +0 -49
- package/lib/services/storage/local-forage.service.d.ts.map +0 -1
- package/lib/services/storage/local-storage.service.d.ts +0 -36
- package/lib/services/storage/local-storage.service.d.ts.map +0 -1
- package/lib/services/storage/session-storage.service.d.ts +0 -35
- package/lib/services/storage/session-storage.service.d.ts.map +0 -1
- package/lib/services/storage/storage.service.d.ts +0 -29
- package/lib/services/storage/storage.service.d.ts.map +0 -1
- package/lib/services/storage/storage.service.mock.d.ts +0 -8
- package/lib/services/storage/storage.service.mock.d.ts.map +0 -1
- package/lib/services/store/actions/app.actions.d.ts +0 -119
- package/lib/services/store/actions/app.actions.d.ts.map +0 -1
- package/lib/services/store/actions/i18n.actions.d.ts +0 -21
- package/lib/services/store/actions/i18n.actions.d.ts.map +0 -1
- package/lib/services/store/actions/index.d.ts +0 -6
- package/lib/services/store/actions/index.d.ts.map +0 -1
- package/lib/services/store/actions/locale.actions.d.ts +0 -21
- package/lib/services/store/actions/locale.actions.d.ts.map +0 -1
- package/lib/services/store/actions/notifications.actions.d.ts +0 -20
- package/lib/services/store/actions/notifications.actions.d.ts.map +0 -1
- package/lib/services/store/actions/user.actions.d.ts +0 -57
- package/lib/services/store/actions/user.actions.d.ts.map +0 -1
- package/lib/services/store/index.d.ts +0 -5
- package/lib/services/store/index.d.ts.map +0 -1
- package/lib/services/store/ngrx_kit.d.ts +0 -54
- package/lib/services/store/ngrx_kit.d.ts.map +0 -1
- package/lib/services/store/reducers/app.reducers.d.ts +0 -7
- package/lib/services/store/reducers/app.reducers.d.ts.map +0 -1
- package/lib/services/store/reducers/core.reducers.d.ts +0 -7
- package/lib/services/store/reducers/core.reducers.d.ts.map +0 -1
- package/lib/services/store/reducers/i18n.reducers.d.ts +0 -7
- package/lib/services/store/reducers/i18n.reducers.d.ts.map +0 -1
- package/lib/services/store/reducers/index.d.ts +0 -8
- package/lib/services/store/reducers/index.d.ts.map +0 -1
- package/lib/services/store/reducers/locale.reducers.d.ts +0 -7
- package/lib/services/store/reducers/locale.reducers.d.ts.map +0 -1
- package/lib/services/store/reducers/meta.reducers.d.ts +0 -32
- package/lib/services/store/reducers/meta.reducers.d.ts.map +0 -1
- package/lib/services/store/reducers/notifications.reducers.d.ts +0 -7
- package/lib/services/store/reducers/notifications.reducers.d.ts.map +0 -1
- package/lib/services/store/reducers/user.reducers.d.ts +0 -7
- package/lib/services/store/reducers/user.reducers.d.ts.map +0 -1
- package/lib/services/store/store.service.d.ts +0 -72
- package/lib/services/store/store.service.d.ts.map +0 -1
- package/lib/services/store/store.service.mock.d.ts +0 -15
- package/lib/services/store/store.service.mock.d.ts.map +0 -1
- package/lib/services/user/index.d.ts +0 -3
- package/lib/services/user/index.d.ts.map +0 -1
- package/lib/services/user/user.service.d.ts +0 -46
- package/lib/services/user/user.service.d.ts.map +0 -1
- package/lib/services/user/user.service.mock.d.ts +0 -15
- package/lib/services/user/user.service.mock.d.ts.map +0 -1
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
|
-
import { EuiServiceStatus, LocaleState } from '@eui/base';
|
|
3
|
-
import { LocaleService } from './locale.service';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
export declare class LocaleServiceMock<T extends LocaleState = LocaleState> extends LocaleService<T> {
|
|
6
|
-
protected locale_id: string;
|
|
7
|
-
private DEFAULT_LOCALE;
|
|
8
|
-
private stateSub;
|
|
9
|
-
constructor(locale_id: string);
|
|
10
|
-
getState(): Observable<T>;
|
|
11
|
-
updateState(state: T): void;
|
|
12
|
-
init(state?: T): Observable<EuiServiceStatus>;
|
|
13
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<LocaleServiceMock<any>, [{ optional: true; }]>;
|
|
14
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<LocaleServiceMock<any>>;
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=locale.service.mock.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"locale.service.mock.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/locale/locale.service.mock.ts"],"names":[],"mappings":"AACA,OAAO,EAAmB,UAAU,EAAM,MAAM,MAAM,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;;AAKjD,qBACa,iBAAiB,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,CAAE,SAAQ,aAAa,CAAC,CAAC,CAAC;cAI1B,SAAS,EAAE,MAAM;IAH/E,OAAO,CAAC,cAAc,CAAQ;IAC9B,OAAO,CAAC,QAAQ,CAAgF;gBAElC,SAAS,EAAE,MAAM;IAItE,QAAQ,IAAI,UAAU,CAAC,CAAC,CAAC;IAIzB,WAAW,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI;IAU3B,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,gBAAgB,CAAC;yCAtB7C,iBAAiB;6CAAjB,iBAAiB;CA0B7B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/log/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ModuleWithProviders } from '@angular/core';
|
|
2
|
-
import { LogConfig } from '@eui/base';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
/**
|
|
5
|
-
* Log Module
|
|
6
|
-
*/
|
|
7
|
-
export declare class LogModule {
|
|
8
|
-
/** method called in your root module to provide the LogService */
|
|
9
|
-
static forRoot(config?: LogConfig): ModuleWithProviders<LogModule>;
|
|
10
|
-
/** method called in your other (non root, lazy loaded) modules to import a different instance of LogService */
|
|
11
|
-
static forChild(config?: LogConfig): ModuleWithProviders<LogModule>;
|
|
12
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<LogModule, never>;
|
|
13
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<LogModule, never, never, never>;
|
|
14
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<LogModule>;
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=log.module.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"log.module.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/log/log.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,mBAAmB,EAAY,MAAM,eAAe,CAAC;AACxF,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;;AAQtC;;GAEG;AACH,qBACa,SAAS;IAClB,kEAAkE;IAClE,MAAM,CAAC,OAAO,CAAC,MAAM,GAAE,SAA8B,GAAG,mBAAmB,CAAC,SAAS,CAAC;IAUtF,+GAA+G;IAC/G,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAE,SAA8B,GAAG,mBAAmB,CAAC,SAAS,CAAC;yCAb9E,SAAS;0CAAT,SAAS;0CAAT,SAAS;CAsBrB"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { InjectionToken } from '@angular/core';
|
|
2
|
-
import { LogAppender, Logger, LogLevel } from '@eui/base';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare const BASE_LOGGER_NAME_TOKEN: InjectionToken<string>;
|
|
5
|
-
export declare const LOG_LEVEL_TOKEN: InjectionToken<LogLevel>;
|
|
6
|
-
export declare const LOG_APPENDERS_TOKEN: InjectionToken<LogAppender<import("@eui/base").LogAppenderConfig>[]>;
|
|
7
|
-
/**
|
|
8
|
-
* Log service, responsible for getting or creating loggers. It itself acts as a base logger
|
|
9
|
-
*/
|
|
10
|
-
export declare class LogService extends Logger {
|
|
11
|
-
protected name: string;
|
|
12
|
-
protected level: LogLevel;
|
|
13
|
-
protected appenders: LogAppender[];
|
|
14
|
-
/** the list of persistent loggers */
|
|
15
|
-
protected loggers: {};
|
|
16
|
-
constructor(name: string, level: LogLevel, appenders: LogAppender[]);
|
|
17
|
-
/**
|
|
18
|
-
* Gets a logger by name. If the logger does not exist, it is created
|
|
19
|
-
*
|
|
20
|
-
* @param loggerName logger name
|
|
21
|
-
* @param persist optional parameter. Set it to true if you want to reuse the logger. By default, it is set to false
|
|
22
|
-
* @returns the logger
|
|
23
|
-
*/
|
|
24
|
-
getLogger(loggerName: string, persist?: boolean): Logger;
|
|
25
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<LogService, never>;
|
|
26
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<LogService>;
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=log.service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"log.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/log/log.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,cAAc,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;;AAE1D,eAAO,MAAM,sBAAsB,wBAAiD,CAAC;AACrF,eAAO,MAAM,eAAe,0BAA4C,CAAC;AACzE,eAAO,MAAM,mBAAmB,sEAAqD,CAAC;AAEtF;;GAEG;AACH,qBACa,UAAW,SAAQ,MAAM;cAKqB,IAAI,EAAE,MAAM;cACnB,KAAK,EAAE,QAAQ;cACX,SAAS,EAAE,WAAW,EAAE;IAN5E,qCAAqC;IACrC,SAAS,CAAC,OAAO,KAAM;gBAGgC,IAAI,EAAE,MAAM,EACnB,KAAK,EAAE,QAAQ,EACX,SAAS,EAAE,WAAW,EAAE;IAK5E;;;;;;OAMG;IACH,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,UAAQ,GAAG,MAAM;yCAnB7C,UAAU;6CAAV,UAAU;CA8BtB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"log.service.mock.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/log/log.service.mock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,qBAAa,cAAe,SAAQ,UAAU;IAC1C,SAAS,IAAI,UAAU;CAG1B"}
|
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
import { EuiService, EuiServiceStatus, EuiUserRight } from '@eui/base';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { LogService } from '../log';
|
|
4
|
-
import { StoreService } from '../store';
|
|
5
|
-
import * as i0 from "@angular/core";
|
|
6
|
-
/**
|
|
7
|
-
* Service for managing user permissions within the application.
|
|
8
|
-
* This class extends `EuiService` and is responsible for handling user rights and permissions.
|
|
9
|
-
* It provides methods to initialize the service with user rights, check specific rights and permissions,
|
|
10
|
-
* and subscribe to changes in the user rights state.
|
|
11
|
-
*
|
|
12
|
-
* @extends {EuiService<EuiUserRight[]>}
|
|
13
|
-
* @see EuiService
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* // Example of using the EuiPermissionService in an application
|
|
17
|
-
* const permissionService = new EuiPermissionService();
|
|
18
|
-
* permissionService.init([{ id: 'ADMIN', permissions: ['CREATE', 'READ', 'UPDATE', 'DELETE'] }]);
|
|
19
|
-
* if (permissionService.checkRight('ADMIN')) {
|
|
20
|
-
* console.log('User has ADMIN rights');
|
|
21
|
-
* }
|
|
22
|
-
*/
|
|
23
|
-
export declare class EuiPermissionService extends EuiService<EuiUserRight[]> {
|
|
24
|
-
private log;
|
|
25
|
-
protected store: StoreService;
|
|
26
|
-
private readonly logger;
|
|
27
|
-
constructor(log: LogService, store: StoreService);
|
|
28
|
-
/**
|
|
29
|
-
* Initializes the permission service with a set of user rights.
|
|
30
|
-
* This method sets up the initial state of the service based on the provided user rights.
|
|
31
|
-
* It should be called before using other methods of the service to ensure it is properly configured.
|
|
32
|
-
*
|
|
33
|
-
* @param {EuiUserRight[]} rights - An array of user rights to initialize the service with.
|
|
34
|
-
* Each `EuiUserRight` object should contain at least an `id` property,
|
|
35
|
-
* and optionally a `permissions` property which is an array of strings.
|
|
36
|
-
*
|
|
37
|
-
* @returns {Observable<EuiServiceStatus>} An Observable that emits the status of the initialization.
|
|
38
|
-
* The status object includes a `success` boolean indicating
|
|
39
|
-
* whether the initialization was successful, and an `error` property
|
|
40
|
-
* with a message in case of failure.
|
|
41
|
-
*
|
|
42
|
-
* @example
|
|
43
|
-
* // Example of initializing the service with two user rights
|
|
44
|
-
* const userRights = [
|
|
45
|
-
* { id: 'ADMIN', permissions: ['CREATE', 'READ', 'UPDATE', 'DELETE'] },
|
|
46
|
-
* { id: 'USER', permissions: ['READ'] }
|
|
47
|
-
* ];
|
|
48
|
-
* permissionService.init(userRights).subscribe(status => {
|
|
49
|
-
* if (status.success) {
|
|
50
|
-
* console.log('Initialization successful');
|
|
51
|
-
* } else {
|
|
52
|
-
* console.error('Initialization failed:', status.error);
|
|
53
|
-
* }
|
|
54
|
-
* });
|
|
55
|
-
*
|
|
56
|
-
* @throws {Error} Throws an error if the `rights` parameter is not an array of `EuiUserRight` objects.
|
|
57
|
-
*/
|
|
58
|
-
init(rights: EuiUserRight[]): Observable<EuiServiceStatus>;
|
|
59
|
-
/**
|
|
60
|
-
* Retrieves the current user rights from the service's state.
|
|
61
|
-
* This getter provides access to the array of `EuiUserRight` objects that represent the current rights
|
|
62
|
-
* of the user. It is a protected method, intended for internal use within the service or by subclasses.
|
|
63
|
-
*
|
|
64
|
-
* @returns {EuiUserRight[]} An array of `EuiUserRight` objects representing the current user rights.
|
|
65
|
-
* Each `EuiUserRight` object typically contains an `id` property, and may
|
|
66
|
-
* also include a `permissions` property which is an array of strings.
|
|
67
|
-
*
|
|
68
|
-
* @example
|
|
69
|
-
* // Example of accessing user rights within a subclass or within the service
|
|
70
|
-
* const currentRights = this.userRights;
|
|
71
|
-
* currentRights.forEach(right => {
|
|
72
|
-
* console.log(`Right ID: ${right.id}, Permissions: ${right.permissions.join(', ')}`);
|
|
73
|
-
* });
|
|
74
|
-
*
|
|
75
|
-
* @protected
|
|
76
|
-
*/
|
|
77
|
-
protected get userRights(): EuiUserRight[];
|
|
78
|
-
/**
|
|
79
|
-
* Retrieves the current state of user rights by subscribing to changes.
|
|
80
|
-
* This method is used to access the current state of user rights in the service. It returns an Observable
|
|
81
|
-
* that emits the current user rights. The method is generic and can be parameterized to return a specific
|
|
82
|
-
* type that extends from `EuiUserRight[]`.
|
|
83
|
-
*
|
|
84
|
-
* @template K - The type of the user rights state to be returned. Defaults to `EuiUserRight[]` if not specified.
|
|
85
|
-
*
|
|
86
|
-
* @returns {Observable<K>} An Observable that emits the current state of user rights.
|
|
87
|
-
* The type of the emitted value is `K`, which is `EuiUserRight[]` by default.
|
|
88
|
-
*
|
|
89
|
-
* @example
|
|
90
|
-
* // Example of subscribing to the user rights state
|
|
91
|
-
* permissionService.getState().subscribe(currentRights => {
|
|
92
|
-
* console.log('Current User Rights:', currentRights);
|
|
93
|
-
* });
|
|
94
|
-
*
|
|
95
|
-
* // Example with a specific type
|
|
96
|
-
* permissionService.getState<CustomUserRightType[]>().subscribe(customRights => {
|
|
97
|
-
* console.log('Custom User Rights:', customRights);
|
|
98
|
-
* });
|
|
99
|
-
*/
|
|
100
|
-
getState<K = EuiUserRight[]>(): Observable<K>;
|
|
101
|
-
/**
|
|
102
|
-
* Updates the state of the service with a new set of user rights.
|
|
103
|
-
* This method is used to modify the current user rights in the service. It takes an array of `EuiUserRight`
|
|
104
|
-
* objects and updates the service's state. This change is then propagated to all subscribers of the state.
|
|
105
|
-
*
|
|
106
|
-
* @param {EuiUserRight[]} rights - An array of `EuiUserRight` objects to update the service's state with.
|
|
107
|
-
* Each `EuiUserRight` object should contain an `id` property,
|
|
108
|
-
* and optionally a `permissions` property which is an array of strings.
|
|
109
|
-
*
|
|
110
|
-
* @example
|
|
111
|
-
* // Example of updating the service's state with new user rights
|
|
112
|
-
* const newUserRights = [
|
|
113
|
-
* { id: 'USER', permissions: ['READ', 'COMMENT'] },
|
|
114
|
-
* { id: 'MODERATOR', permissions: ['READ', 'WRITE', 'DELETE'] }
|
|
115
|
-
* ];
|
|
116
|
-
* permissionService.updateState(newUserRights);
|
|
117
|
-
*/
|
|
118
|
-
updateState(rights: EuiUserRight[]): void;
|
|
119
|
-
/**
|
|
120
|
-
* Checks if the user has the specified attribute permission.
|
|
121
|
-
* This method interprets a string that represents a combination of rights and/or permissions
|
|
122
|
-
* and determines whether the user has the specified permissions. The string format can be
|
|
123
|
-
* 'RIGHT.PERMISSION' or just 'RIGHT'. For multiple rights, it can be 'RIGHT1.RIGHT2.PERMISSION'.
|
|
124
|
-
*
|
|
125
|
-
* @param {string} rightsAndPermission - A string representing the rights and/or permissions to check.
|
|
126
|
-
* Format can be 'RIGHT', 'RIGHT.PERMISSION', or 'RIGHT1.RIGHT2.PERMISSION'.
|
|
127
|
-
*
|
|
128
|
-
* @returns {boolean} True if the user has the specified attribute permission, false otherwise.
|
|
129
|
-
*
|
|
130
|
-
* @example
|
|
131
|
-
* // Check a single right
|
|
132
|
-
* const hasRight = permissionService.checkAttributePermission('VIEW');
|
|
133
|
-
*
|
|
134
|
-
* // Check a right with a specific permission
|
|
135
|
-
* const hasRightWithPermission = permissionService.checkAttributePermission('EDIT.APPROVE');
|
|
136
|
-
*
|
|
137
|
-
* // Check multiple rights with a specific permission
|
|
138
|
-
* const hasMultipleRights = permissionService.checkAttributePermission('ADMIN.VIEW.APPROVE');
|
|
139
|
-
*/
|
|
140
|
-
checkAttributePermission(rightsAndPermission: string): boolean;
|
|
141
|
-
/**
|
|
142
|
-
* Checks if the user has a specific right.
|
|
143
|
-
* This method determines whether the user possesses a particular right identified by its ID.
|
|
144
|
-
*
|
|
145
|
-
* @param {string} rightId - The ID of the right to check.
|
|
146
|
-
*
|
|
147
|
-
* @returns {boolean} True if the user has the specified right, false otherwise.
|
|
148
|
-
*
|
|
149
|
-
* @example
|
|
150
|
-
* // Check if the user has the 'ADMIN' right
|
|
151
|
-
* const isAdmin = permissionService.checkRight('ADMIN');
|
|
152
|
-
*/
|
|
153
|
-
checkRight(rightId: string): boolean;
|
|
154
|
-
/**
|
|
155
|
-
* Checks if the user has a specific permission within a right.
|
|
156
|
-
* This method determines whether the user has a specific permission associated with a given right.
|
|
157
|
-
*
|
|
158
|
-
* @param {string} rightId - The ID of the right.
|
|
159
|
-
* @param {string} permission - The permission to check within the right.
|
|
160
|
-
*
|
|
161
|
-
* @returns {boolean} True if the user has the specified permission in the given right, false otherwise.
|
|
162
|
-
*
|
|
163
|
-
* @example
|
|
164
|
-
* // Check if the user has 'APPROVE' permission in the 'EDIT' right
|
|
165
|
-
* const canApproveEdit = permissionService.checkPermission('EDIT', 'APPROVE');
|
|
166
|
-
*/
|
|
167
|
-
checkPermission(rightId: string, permission: string): boolean;
|
|
168
|
-
/**
|
|
169
|
-
* Checks if the user has all the specified rights.
|
|
170
|
-
* This private method determines whether the user possesses all the rights provided in the array.
|
|
171
|
-
* Each right in the array is checked against the user's current rights.
|
|
172
|
-
*
|
|
173
|
-
* @param {EuiUserRight[]} rights - An array of rights to check against the user's rights.
|
|
174
|
-
*
|
|
175
|
-
* @returns {boolean} True if the user has all the specified rights, false otherwise.
|
|
176
|
-
*
|
|
177
|
-
* @example
|
|
178
|
-
* // Example usage within the service
|
|
179
|
-
* const requiredRights = [{ id: 'VIEW' }, { id: 'EDIT' }];
|
|
180
|
-
* const hasAllRequiredRights = this.haveAllRights(requiredRights);
|
|
181
|
-
*
|
|
182
|
-
* @private
|
|
183
|
-
*/
|
|
184
|
-
private haveAllRights;
|
|
185
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<EuiPermissionService, [{ optional: true; }, null]>;
|
|
186
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<EuiPermissionService>;
|
|
187
|
-
}
|
|
188
|
-
//# sourceMappingURL=permission.service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"permission.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/permission/permission.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,YAAY,EAAgC,MAAM,WAAW,CAAC;AACrG,OAAO,EAAE,UAAU,EAAM,MAAM,MAAM,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;;AAIxC;;;;;;;;;;;;;;;;GAgBG;AACH,qBAGa,oBAAqB,SAAQ,UAAU,CAAC,YAAY,EAAE,CAAC;IAIhD,OAAO,CAAC,GAAG;IACvB,SAAS,CAAC,KAAK,EAAE,YAAY;IAJjC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;gBAGR,GAAG,EAAE,UAAU,EACzB,KAAK,EAAE,YAAY;IAQjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,UAAU,CAAC,gBAAgB,CAAC;IAa1D;;;;;;;;;;;;;;;;;OAiBG;IACH,SAAS,KAAK,UAAU,IAAI,YAAY,EAAE,CAEzC;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,QAAQ,CAAC,CAAC,GAAG,YAAY,EAAE,KAAK,UAAU,CAAC,CAAC,CAAC;IAO7C;;;;;;;;;;;;;;;;OAgBG;IACH,WAAW,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,IAAI;IAIzC;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,wBAAwB,CAAC,mBAAmB,EAAE,MAAM,GAAG,OAAO;IAmB9D;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAIpC;;;;;;;;;;;;OAYG;IACH,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO;IAO7D;;;;;;;;;;;;;;;OAeG;IACH,OAAO,CAAC,aAAa;yCA5NZ,oBAAoB;6CAApB,oBAAoB;CAmOhC"}
|
|
@@ -1,278 +0,0 @@
|
|
|
1
|
-
import { HttpClient } from '@angular/common/http';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { ApiQueueItem } from '@eui/base';
|
|
4
|
-
import { LogService } from '../log';
|
|
5
|
-
import { StoreService } from '../store';
|
|
6
|
-
import * as i0 from "@angular/core";
|
|
7
|
-
/**
|
|
8
|
-
* Service class for managing and processing a queue of API requests.
|
|
9
|
-
*
|
|
10
|
-
* This service provides functionality to add, remove, process, and manage HTTP requests stored in a queue.
|
|
11
|
-
* It enables sequential or bulk processing of requests, ensuring controlled execution and handling of API calls.
|
|
12
|
-
* The service methods offer features like processing individual items, processing all items in the queue either
|
|
13
|
-
* sequentially or all at once, and removing items from the queue. Each method is designed to handle specific aspects
|
|
14
|
-
* of queue management and processing, with attention to details like order of execution and error handling.
|
|
15
|
-
*
|
|
16
|
-
* Usage of this service is ideal in scenarios where API requests need to be managed in a queue structure, allowing
|
|
17
|
-
* for controlled execution and monitoring of these requests.
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* // Adding a new item to the queue
|
|
21
|
-
* apiQueueService.addQueueItem({ id: 'item124', method: 'POST', uri: '/api/data', payload: {...} });
|
|
22
|
-
*
|
|
23
|
-
* // Processing a single item from the queue
|
|
24
|
-
* apiQueueService.processQueueItem('item123').subscribe(result => {
|
|
25
|
-
* console.log('Processed item 123 with result:', result);
|
|
26
|
-
* });
|
|
27
|
-
*
|
|
28
|
-
* // Processing all items in the queue in sequential order
|
|
29
|
-
* apiQueueService.processAllQueueItemsSequential(false).subscribe(results => {
|
|
30
|
-
* console.log('Processed all items in descending order of their timestamp:', results);
|
|
31
|
-
* });
|
|
32
|
-
*
|
|
33
|
-
* // Removing an item from the queue
|
|
34
|
-
* apiQueueService.removeQueueItem('item123');
|
|
35
|
-
*
|
|
36
|
-
* // Processing all items in the queue and continuing on error
|
|
37
|
-
* apiQueueService.processAllQueueItems(true).subscribe(results => {
|
|
38
|
-
* console.log('Processed all items in the queue with continuation on errors:', results);
|
|
39
|
-
* });
|
|
40
|
-
*/
|
|
41
|
-
export declare class ApiQueueService {
|
|
42
|
-
protected store: StoreService;
|
|
43
|
-
protected http: HttpClient;
|
|
44
|
-
protected logService: LogService;
|
|
45
|
-
private readonly logger;
|
|
46
|
-
private readonly getAppState;
|
|
47
|
-
private getApiQueue;
|
|
48
|
-
private getApiQueueItem;
|
|
49
|
-
constructor(store: StoreService, http: HttpClient, logService: LogService);
|
|
50
|
-
/**
|
|
51
|
-
* Adds an item to the queue by dispatching an action to the store.
|
|
52
|
-
* This function is specifically designed to enqueue API call requests represented by `ApiQueueItem` objects.
|
|
53
|
-
* Each item is identified by a unique `id`, which is used to manage the queue.
|
|
54
|
-
*
|
|
55
|
-
* @param {string} id - The unique identifier for the queue item. It's crucial to ensure that this ID is unique within the queue.
|
|
56
|
-
* If an item with the same ID already exists, the new item will overwrite the existing one.
|
|
57
|
-
* WARNING: Duplicate IDs will lead to overwriting of queue items.
|
|
58
|
-
*
|
|
59
|
-
* @param {ApiQueueItem} item - The item to be enqueued. This should be an object of type `ApiQueueItem`.
|
|
60
|
-
* The `method` property of the item must be one of the allowed methods ('post', 'put', 'get').
|
|
61
|
-
* If an unsupported method is provided, the function will throw an error.
|
|
62
|
-
*
|
|
63
|
-
* @throws {Error} Throws an error if the `method` property of the `item` is not one of the allowed methods.
|
|
64
|
-
* The error message is: `[ApiQueue] method "${item.method}" is not allowed`.
|
|
65
|
-
*
|
|
66
|
-
* @example
|
|
67
|
-
* // Example of adding an item to the API queue
|
|
68
|
-
* addQueueItem('12345', { method: 'post', url: '/api/data', payload: {...} });
|
|
69
|
-
*
|
|
70
|
-
* @returns {void} This function does not return a value. It adds the item to the queue via a dispatch action.
|
|
71
|
-
*/
|
|
72
|
-
addQueueItem(id: string, item: ApiQueueItem): void;
|
|
73
|
-
/**
|
|
74
|
-
* Retrieves the current state of the API queue and converts it into an array of Observables.
|
|
75
|
-
*
|
|
76
|
-
* This method subscribes to the store to access the API queue. It then maps the queue object,
|
|
77
|
-
* which is an associative array, into a linear array of ApiQueueItem instances. If the queue is empty,
|
|
78
|
-
* a warning is logged. This method is useful for tracking the state and contents of the API queue
|
|
79
|
-
* at a given moment.
|
|
80
|
-
*
|
|
81
|
-
* Note: This method takes a snapshot of the queue at the time of subscription. It does not provide
|
|
82
|
-
* a continuous stream of queue updates. To get real-time updates, consider subscribing directly
|
|
83
|
-
* to the store's observable.
|
|
84
|
-
*
|
|
85
|
-
* @returns {Observable<ApiQueueItem[]>} An Observable that emits an array of ApiQueueItem.
|
|
86
|
-
* The array represents all items currently in the queue. If the queue is empty, it emits an empty array.
|
|
87
|
-
*
|
|
88
|
-
* @example
|
|
89
|
-
* // Example usage
|
|
90
|
-
* this.getQueue().subscribe(queueItems => {
|
|
91
|
-
* console.log('Current queue items:', queueItems);
|
|
92
|
-
* });
|
|
93
|
-
*/
|
|
94
|
-
getQueue(): Observable<ApiQueueItem[]>;
|
|
95
|
-
/**
|
|
96
|
-
* Retrieves a specific item from the API queue by its ID.
|
|
97
|
-
*
|
|
98
|
-
* This method subscribes to the store and selects a single item from the API queue based on the provided ID.
|
|
99
|
-
* It employs a pipeline to fetch the item: the `getApiQueueItem` selector is used to retrieve the item,
|
|
100
|
-
* and a `map` operator processes the result. If the item with the specified ID does not exist in the queue,
|
|
101
|
-
* a warning is logged, and `null` is returned.
|
|
102
|
-
*
|
|
103
|
-
* This method is ideal for accessing a specific queue item when its ID is known, allowing for targeted
|
|
104
|
-
* operations or checks on that particular item.
|
|
105
|
-
*
|
|
106
|
-
* @param {string} id - The unique identifier of the item within the queue.
|
|
107
|
-
* @returns {Observable<ApiQueueItem | null>} An Observable emitting the requested ApiQueueItem.
|
|
108
|
-
* If no item with the given ID exists in the queue, the Observable emits `null`.
|
|
109
|
-
*
|
|
110
|
-
* @example
|
|
111
|
-
* // Example usage
|
|
112
|
-
* this.getQueueItem('item123').subscribe(item => {
|
|
113
|
-
* if (item) {
|
|
114
|
-
* console.log('Found item:', item);
|
|
115
|
-
* } else {
|
|
116
|
-
* console.log('Item not found in the queue');
|
|
117
|
-
* }
|
|
118
|
-
* });
|
|
119
|
-
*/
|
|
120
|
-
getQueueItem(id: string): Observable<ApiQueueItem>;
|
|
121
|
-
/**
|
|
122
|
-
* Removes a specific item from the API queue using its ID.
|
|
123
|
-
*
|
|
124
|
-
* This method dispatches an action to remove an item from the queue, identified by the provided ID.
|
|
125
|
-
* It is essential for managing the queue by eliminating items that are no longer needed or have been processed.
|
|
126
|
-
* The function does not return any value, as it primarily triggers an action within the store.
|
|
127
|
-
*
|
|
128
|
-
* Note: This method assumes the existence of the item in the queue. It does not perform a check
|
|
129
|
-
* to confirm the presence of the item before attempting to remove it. Therefore, it's recommended
|
|
130
|
-
* to verify the item's existence in the queue if uncertainty exists.
|
|
131
|
-
*
|
|
132
|
-
* @param {string} id - The unique identifier of the item to be removed from the queue.
|
|
133
|
-
*
|
|
134
|
-
* @example
|
|
135
|
-
* // Example usage
|
|
136
|
-
* this.removeQueueItem('item123');
|
|
137
|
-
* // The item with ID 'item123' will be dispatched for removal from the queue.
|
|
138
|
-
*/
|
|
139
|
-
removeQueueItem(id: string): void;
|
|
140
|
-
/**
|
|
141
|
-
* Clears all items from the API queue.
|
|
142
|
-
*
|
|
143
|
-
* This method dispatches an action to empty the entire API queue, effectively removing all items that are currently queued.
|
|
144
|
-
* It is useful for scenarios where a complete reset of the queue is required, such as during initialization or after processing
|
|
145
|
-
* a batch of items. The function does not return any value, as its primary purpose is to trigger a state change in the store.
|
|
146
|
-
*
|
|
147
|
-
* Note: Use this method with caution as it will irreversibly clear all items in the queue. Ensure that this action does not
|
|
148
|
-
* disrupt any ongoing processes that rely on the queue's contents.
|
|
149
|
-
*
|
|
150
|
-
* @example
|
|
151
|
-
* // Example usage
|
|
152
|
-
* this.removeAllQueueItem();
|
|
153
|
-
* // This will dispatch an action to empty the entire API queue.
|
|
154
|
-
*/
|
|
155
|
-
removeAllQueueItem(): void;
|
|
156
|
-
/**
|
|
157
|
-
* Processes an item from the API queue identified by its ID.
|
|
158
|
-
*
|
|
159
|
-
* Retrieves the specified item from the queue and applies processing logic as defined in `buildHttpRequest`.
|
|
160
|
-
* If the item is not found, logs a warning and returns an Observable emitting `null`.
|
|
161
|
-
*
|
|
162
|
-
* @param {string} id - The unique identifier of the item within the queue to be processed.
|
|
163
|
-
* @returns {Observable<any>} An Observable that emits the result of processing the queue item.
|
|
164
|
-
* If the item does not exist, the Observable emits `null`.
|
|
165
|
-
*
|
|
166
|
-
* @example
|
|
167
|
-
* // Example usage
|
|
168
|
-
* this.processQueueItem('item123').subscribe(result => {
|
|
169
|
-
* if (result) {
|
|
170
|
-
* console.log('Processing result:', result);
|
|
171
|
-
* } else {
|
|
172
|
-
* console.log('Item not found in the queue');
|
|
173
|
-
* }
|
|
174
|
-
* });
|
|
175
|
-
*/
|
|
176
|
-
processQueueItem<T>(id: string): Observable<T>;
|
|
177
|
-
/**
|
|
178
|
-
* Processes all items in the API queue and collects their responses.
|
|
179
|
-
*
|
|
180
|
-
* Iterates over each item in the queue and processes them using `buildHttpRequest`. If a request fails,
|
|
181
|
-
* the method can either continue processing the remaining items or stop, based on the `continueOnError` parameter.
|
|
182
|
-
* It returns an Observable that emits an array containing the responses or errors from all the processed items.
|
|
183
|
-
*
|
|
184
|
-
* The function currently returns `Observable<any[]>` indicating an array of any type. Future improvements
|
|
185
|
-
* should aim to specify a more accurate return type or utilize generics for increased type safety.
|
|
186
|
-
*
|
|
187
|
-
* @param {boolean} [continueOnError=true] - Determines whether to continue with the next item in the queue
|
|
188
|
-
* after a request failure. Defaults to `true`.
|
|
189
|
-
* @returns {Observable<any[]>} An Observable emitting an array of either responses or errors from the processed
|
|
190
|
-
* queue items.
|
|
191
|
-
*
|
|
192
|
-
* @example
|
|
193
|
-
* this.processAllQueueItems().subscribe(results => {
|
|
194
|
-
* // Handle the array of responses or errors
|
|
195
|
-
* });
|
|
196
|
-
*/
|
|
197
|
-
processAllQueueItems<T>(continueOnError?: boolean): Observable<T[]>;
|
|
198
|
-
/**
|
|
199
|
-
* Processes all items in the queue sequentially, based on their timestamp ordering.
|
|
200
|
-
*
|
|
201
|
-
* This method first orders the items in the API queue by their timestamp, either in ascending or descending
|
|
202
|
-
* order as specified by the `ascending` parameter. It then processes each item using `buildHttpRequest`, ensuring
|
|
203
|
-
* that each request is completed before the next begins. This sequential processing is crucial when the order of
|
|
204
|
-
* execution matters for HTTP requests in the queue. The method returns an Observable that emits the responses
|
|
205
|
-
* following the same order as the queue items were processed.
|
|
206
|
-
*
|
|
207
|
-
* The function currently returns `Observable<any>`, indicating a broad type. Future improvements should focus on
|
|
208
|
-
* specifying a more accurate return type or utilizing generics for increased type safety.
|
|
209
|
-
*
|
|
210
|
-
* @param {boolean} [ascending=true] - Determines whether the queue items are processed in ascending order of their
|
|
211
|
-
* timestamp. Defaults to `true`.
|
|
212
|
-
* @returns {Observable<any>} An Observable emitting the responses of the HTTP requests in the order they were processed.
|
|
213
|
-
*
|
|
214
|
-
* @example
|
|
215
|
-
* this.processAllQueueItemsSequential().subscribe(response => {
|
|
216
|
-
* // Handle each response in the order of queue processing
|
|
217
|
-
* });
|
|
218
|
-
*/
|
|
219
|
-
processAllQueueItemsSequential<T>(ascending?: boolean): Observable<T>;
|
|
220
|
-
/**
|
|
221
|
-
* Compares two queue items based on their timestamp and determines their order.
|
|
222
|
-
*
|
|
223
|
-
* This protected method is used to sort queue items. It takes two queue items as input, each represented
|
|
224
|
-
* as a tuple containing an item ID and the `ApiQueueItem` object. The method compares these items based on
|
|
225
|
-
* the `timestamp` property of the `ApiQueueItem` objects. It returns a number indicating the order in which
|
|
226
|
-
* these items should be sorted.
|
|
227
|
-
*
|
|
228
|
-
* A positive return value indicates that the first item should come after the second, a negative value
|
|
229
|
-
* indicates the opposite, and zero indicates that they are equal in terms of timestamp.
|
|
230
|
-
*
|
|
231
|
-
* @param {[string, ApiQueueItem]} a - The first queue item tuple for comparison.
|
|
232
|
-
* @param {[string, ApiQueueItem]} b - The second queue item tuple for comparison.
|
|
233
|
-
* @returns {number} A number indicating the order of the items: negative if `a` is earlier than `b`,
|
|
234
|
-
* positive if `a` is later than `b`, and zero if they are equal.
|
|
235
|
-
* @beta
|
|
236
|
-
*/
|
|
237
|
-
protected sortOnTimestamp(a: [string, ApiQueueItem], b: [string, ApiQueueItem]): number;
|
|
238
|
-
/**
|
|
239
|
-
* Constructs and executes an HTTP request based on the provided queue item details.
|
|
240
|
-
*
|
|
241
|
-
* This private method takes an ID and an `ApiQueueItem` object to build and execute an HTTP request.
|
|
242
|
-
* It determines the HTTP method (like GET, POST, etc.) from the `method` property of the `ApiQueueItem`,
|
|
243
|
-
* and uses the `uri` and `payload` properties for the request's URL and body, respectively. After the
|
|
244
|
-
* request is executed, the corresponding queue item is removed from the queue.
|
|
245
|
-
*
|
|
246
|
-
* The method is generic, allowing the caller to specify the expected response type `T`. By default,
|
|
247
|
-
* it uses `any` type, but specifying a more concrete type enhances type safety and clarity in usage.
|
|
248
|
-
*
|
|
249
|
-
* @param {string} id - The ID of the queue item being processed.
|
|
250
|
-
* @param {ApiQueueItem} item - The queue item containing details for the HTTP request.
|
|
251
|
-
* @returns {Observable<T>} An Observable of type T, representing the response of the HTTP request.
|
|
252
|
-
*
|
|
253
|
-
* @example
|
|
254
|
-
* // Example usage for a specific response type
|
|
255
|
-
* this.buildHttpRequest<MyResponseType>('item123', queueItem)
|
|
256
|
-
* .subscribe(response => {
|
|
257
|
-
* // Handle the response
|
|
258
|
-
* });
|
|
259
|
-
*
|
|
260
|
-
* @template T - The expected type of the HTTP response. Defaults to `any`.
|
|
261
|
-
*/
|
|
262
|
-
private buildHttpRequest;
|
|
263
|
-
/**
|
|
264
|
-
* A state reducer that adds an item to the API queue.
|
|
265
|
-
* @param state
|
|
266
|
-
* @param action
|
|
267
|
-
*/
|
|
268
|
-
private addApiQueueItem;
|
|
269
|
-
/**
|
|
270
|
-
* A state reducer that removes an item from the API queue.
|
|
271
|
-
* @param state
|
|
272
|
-
* @param action
|
|
273
|
-
*/
|
|
274
|
-
private removeApiQueueItem;
|
|
275
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ApiQueueService, [null, null, { optional: true; }]>;
|
|
276
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<ApiQueueService>;
|
|
277
|
-
}
|
|
278
|
-
//# sourceMappingURL=api-queue.service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api-queue.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/queue/api-queue.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAsB,MAAM,MAAM,CAAC;AAEtD,OAAO,EAAY,YAAY,EAA+B,MAAM,WAAW,CAAC;AAEhF,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;;AAGxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,qBAGa,eAAe;IAOpB,SAAS,CAAC,KAAK,EAAE,YAAY;IAC7B,SAAS,CAAC,IAAI,EAAE,UAAU;IACd,SAAS,CAAC,UAAU,EAAE,UAAU;IARhD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAiC;IAC7D,OAAO,CAAC,WAAW,CAA+B;IAClD,OAAO,CAAC,eAAe,CAAuD;gBAGhE,KAAK,EAAE,YAAY,EACnB,IAAI,EAAE,UAAU,EACJ,UAAU,EAAE,UAAU;IAWhD;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,GAAG,IAAI;IAUlD;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,QAAQ,IAAI,UAAU,CAAC,YAAY,EAAE,CAAC;IActC;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,UAAU,CAAC,YAAY,CAAC;IAalD;;;;;;;;;;;;;;;;;OAiBG;IACH,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAIjC;;;;;;;;;;;;;;OAcG;IACH,kBAAkB,IAAI,IAAI;IAI1B;;;;;;;;;;;;;;;;;;;OAmBG;IACH,gBAAgB,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC;IAc9C;;;;;;;;;;;;;;;;;;;OAmBG;IACH,oBAAoB,CAAC,CAAC,EAAE,eAAe,UAAO,GAAG,UAAU,CAAC,CAAC,EAAE,CAAC;IAqBhE;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,8BAA8B,CAAC,CAAC,EAAE,SAAS,UAAO,GAAG,UAAU,CAAC,CAAC,CAAC;IAWlE;;;;;;;;;;;;;;;;OAgBG;IACH,SAAS,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,MAAM,EAAE,YAAY,CAAC,EAAE,CAAC,EAAE,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,MAAM;IAIvF;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,OAAO,CAAC,gBAAgB;IAIxB;;;;OAIG;IACH,OAAO,CAAC,eAAe,CAOrB;IAEF;;;;OAIG;IACH,OAAO,CAAC,kBAAkB,CASxB;yCA9VO,eAAe;6CAAf,eAAe;CA+V3B"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ApiQueueService } from './api-queue.service';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { ApiQueueItem } from '@eui/base';
|
|
4
|
-
export declare class ApiQueueServiceMock extends ApiQueueService {
|
|
5
|
-
constructor();
|
|
6
|
-
getQueue(): Observable<ApiQueueItem[]>;
|
|
7
|
-
getQueueItem(id: string): Observable<ApiQueueItem>;
|
|
8
|
-
removeAllQueueItem(): void;
|
|
9
|
-
processAllQueueItems<T>(): Observable<T>;
|
|
10
|
-
addQueueItem(): void;
|
|
11
|
-
removeQueueItem(): void;
|
|
12
|
-
processQueueItem<T>(): Observable<T>;
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=api-queue.service.mock.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api-queue.service.mock.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/queue/api-queue.service.mock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAM,MAAM,MAAM,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,qBAAa,mBAAoB,SAAQ,eAAe;;IAI3C,QAAQ,IAAI,UAAU,CAAC,YAAY,EAAE,CAAC;IAGtC,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,UAAU,CAAC,YAAY,CAAC;IAGlD,kBAAkB,IAAI,IAAI;IAC1B,oBAAoB,CAAC,CAAC,KAAK,UAAU,CAAC,CAAC,CAAC;IAGxC,YAAY,IAAI,IAAI;IACpB,eAAe,IAAI,IAAI;IACvB,gBAAgB,CAAC,CAAC,KAAK,UAAU,CAAC,CAAC,CAAC;CAGhD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/queue/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { StorageService } from './storage.service';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
/**
|
|
4
|
-
* Generic asynchronous storage service. Concrete asynchronous storage services must extend this class
|
|
5
|
-
*/
|
|
6
|
-
export declare abstract class AsyncStorageService extends StorageService {
|
|
7
|
-
/**
|
|
8
|
-
* reflects the readiness of the storage
|
|
9
|
-
* @returns one time emission Observable<any>
|
|
10
|
-
*/
|
|
11
|
-
abstract ready(): Observable<any>;
|
|
12
|
-
/**
|
|
13
|
-
* retrieve an object from async storage
|
|
14
|
-
* @param key the associated key
|
|
15
|
-
* @returns one time emission Observable of value
|
|
16
|
-
*/
|
|
17
|
-
abstract get(key: string): Observable<any>;
|
|
18
|
-
abstract get<T>(key: string): Observable<T>;
|
|
19
|
-
/**
|
|
20
|
-
* sets an object in async storage
|
|
21
|
-
* @param key the associated key
|
|
22
|
-
* @param value the value to set
|
|
23
|
-
* @returns one time emission Observable
|
|
24
|
-
*/
|
|
25
|
-
abstract set(key: string, value: any): Observable<any>;
|
|
26
|
-
abstract set<T>(key: string, value: T): Observable<any>;
|
|
27
|
-
/**
|
|
28
|
-
* removes an object from async storage
|
|
29
|
-
* @param key the associated key
|
|
30
|
-
* @returns one time emission Observable
|
|
31
|
-
*/
|
|
32
|
-
abstract remove(key: string): Observable<any>;
|
|
33
|
-
/**
|
|
34
|
-
* asynchronous helper for set function
|
|
35
|
-
* @param key the associated key
|
|
36
|
-
* @param value the value to set
|
|
37
|
-
*/
|
|
38
|
-
setAsync(key: string, value: any): void;
|
|
39
|
-
/**
|
|
40
|
-
* asynchronous helper for remove function
|
|
41
|
-
* @param key the associated key
|
|
42
|
-
*/
|
|
43
|
-
removeAsync(key: string): void;
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=async-storage.service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"async-storage.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/storage/async-storage.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElC;;GAEG;AACH,8BAAsB,mBAAoB,SAAQ,cAAc;IAC5D;;;OAGG;IAGH,QAAQ,CAAC,KAAK,IAAI,UAAU,CAAC,GAAG,CAAC;IAEjC;;;;OAIG;aAGe,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAC,GAAG,CAAC;aACjC,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC;IAEpD;;;;;OAKG;aAGe,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,UAAU,CAAC,GAAG,CAAC;aAG7C,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC;IAEhE;;;;OAIG;aAGe,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAC,GAAG,CAAC;IAEtD;;;;OAIG;IAGH,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI;IAKvC;;;OAGG;IACH,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;CAGjC"}
|