@fluxo-dev/api-client-base 0.0.24 → 0.0.26

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/index.cjs.js CHANGED
@@ -1737,8 +1737,8 @@ class FluxoStateDispatcher {
1737
1737
  static dispatchAllowedFrontends(frontends) {
1738
1738
  state.store.dispatch(state.setAllowedFrontends(frontends));
1739
1739
  }
1740
- static dispatchSetRouteRules(rules) {
1741
- state.store.dispatch(state.setRouteRules(rules));
1740
+ static dispatchHasAdminAccess(hasAdminAccess) {
1741
+ state.store.dispatch(state.setHasAdminAccess(hasAdminAccess));
1742
1742
  }
1743
1743
  static dispatchSetConfiguration(items) {
1744
1744
  state.store.dispatch(state.setConfiguration(items));
@@ -1923,6 +1923,17 @@ class ConfigurationService {
1923
1923
  frontend: frontendId
1924
1924
  });
1925
1925
  }
1926
+ getFrontendByDomainRole(domainRoleId) {
1927
+ return HttpClient.Instance().client.get(`client/frontend/${domainRoleId}`);
1928
+ }
1929
+ updateFrontendDomainRole(domainRoleId, frontends) {
1930
+ return HttpClient.Instance().client.post(`client/frontend/${domainRoleId}`, {
1931
+ frontendIds: frontends
1932
+ });
1933
+ }
1934
+ getAllDomainRoleFrontends() {
1935
+ return HttpClient.Instance().client.get(`client/frontend`);
1936
+ }
1926
1937
  }
1927
1938
 
1928
1939
  class UserService {
@@ -2050,34 +2061,12 @@ class PermissionService {
2050
2061
  }
2051
2062
  }
2052
2063
 
2053
- class RouteRuleService extends BaseCommonService {
2054
- constructor() {
2055
- super('route-rule');
2056
- }
2057
- getRouteRulesForScope(scope, packageName) {
2058
- return HttpClient.Instance().client.get(`route-rule?scope=${scope}&packageName=${packageName}`);
2059
- }
2060
- getPermissions(routeRuleId) {
2061
- return HttpClient.Instance().client.get(`route-rule/${routeRuleId}/permissions`);
2062
- }
2063
- addPermission(routeRuleId, permissionId) {
2064
- return HttpClient.Instance().client.post(`route-rule/${routeRuleId}/permissions`, {
2065
- domainRoleId: routeRuleId,
2066
- permissionId: permissionId
2067
- });
2068
- }
2069
- removePermission(routeRuleId, permissionId) {
2070
- return HttpClient.Instance().client.delete(`route-rule/${routeRuleId}/permissions/${permissionId}`);
2071
- }
2072
- }
2073
-
2074
2064
  class SecurityFacade {
2075
2065
  constructor() {
2076
2066
  this._userService = new UserService();
2077
2067
  this._apiKeyService = new ApiKeyService();
2078
2068
  this._domainRoleService = new DomainRoleService();
2079
2069
  this._permissionService = new PermissionService();
2080
- this._routeRuleService = new RouteRuleService();
2081
2070
  this._currentUserService = new CurrentUser();
2082
2071
  }
2083
2072
  get user() {
@@ -2089,9 +2078,6 @@ class SecurityFacade {
2089
2078
  get permission() {
2090
2079
  return this._permissionService;
2091
2080
  }
2092
- get routeRule() {
2093
- return this._routeRuleService;
2094
- }
2095
2081
  get apiKey() {
2096
2082
  return this._apiKeyService;
2097
2083
  }
@@ -2576,6 +2562,39 @@ class WorkflowService {
2576
2562
  }
2577
2563
  }
2578
2564
 
2565
+ class MailServerService {
2566
+ getConfiguration() {
2567
+ return __awaiter(this, void 0, void 0, function* () {
2568
+ return HttpClient.Instance().client.get('/communication/email-server/configuration');
2569
+ });
2570
+ }
2571
+ saveConfiguration(configuration) {
2572
+ return __awaiter(this, void 0, void 0, function* () {
2573
+ return HttpClient.Instance().client.post('/communication/email-server/configuration', configuration);
2574
+ });
2575
+ }
2576
+ sendTestEmail(command) {
2577
+ return __awaiter(this, void 0, void 0, function* () {
2578
+ return HttpClient.Instance().client.post('/communication/email-server/test', command);
2579
+ });
2580
+ }
2581
+ }
2582
+
2583
+ exports.EmailServerProviderType = void 0;
2584
+ (function (EmailServerProviderType) {
2585
+ EmailServerProviderType[EmailServerProviderType["Direct"] = 0] = "Direct";
2586
+ EmailServerProviderType[EmailServerProviderType["Mailgun"] = 1] = "Mailgun";
2587
+ })(exports.EmailServerProviderType || (exports.EmailServerProviderType = {}));
2588
+
2589
+ class CommunicationFacade {
2590
+ constructor() {
2591
+ this._mailServerService = new MailServerService();
2592
+ }
2593
+ get mailServer() {
2594
+ return this._mailServerService;
2595
+ }
2596
+ }
2597
+
2579
2598
  class FluxoClientBase {
2580
2599
  constructor() {
2581
2600
  this._authenticationType = null;
@@ -2587,6 +2606,7 @@ class FluxoClientBase {
2587
2606
  this._reportingService = null;
2588
2607
  this._printingService = null;
2589
2608
  this._workflowService = null;
2609
+ this._communicationFacade = null;
2590
2610
  this._config = null;
2591
2611
  this._modules = [];
2592
2612
  this.getBearerToken = () => {
@@ -2633,6 +2653,7 @@ class FluxoClientBase {
2633
2653
  this._reportingService = new ReportingService();
2634
2654
  this._printingService = new PrintingService();
2635
2655
  this._workflowService = new WorkflowService();
2656
+ this._communicationFacade = new CommunicationFacade();
2636
2657
  console.info('7) Sub services initialized');
2637
2658
  if (setState) state.store.dispatch(state.setFluxoClientConfiguration(config));
2638
2659
  console.info('-*-*-*- FluxoClient setup finished -*-*-*-');
@@ -2648,6 +2669,9 @@ class FluxoClientBase {
2648
2669
  get auth() {
2649
2670
  return this._authService;
2650
2671
  }
2672
+ get communication() {
2673
+ return this._communicationFacade;
2674
+ }
2651
2675
  get configuration() {
2652
2676
  return this._configurationService;
2653
2677
  }
@@ -2910,6 +2934,7 @@ exports.ApiKeyService = ApiKeyService;
2910
2934
  exports.AppService = AppService;
2911
2935
  exports.AppServiceService = AppServiceService;
2912
2936
  exports.BaseCommonService = BaseCommonService;
2937
+ exports.CommunicationFacade = CommunicationFacade;
2913
2938
  exports.CurrentUser = CurrentUser;
2914
2939
  exports.DocumentationService = DocumentationService;
2915
2940
  exports.DomainRoleService = DomainRoleService;
@@ -2920,10 +2945,10 @@ exports.FluxoClientSys = FluxoClientSys;
2920
2945
  exports.FluxoStateDispatcher = FluxoStateDispatcher;
2921
2946
  exports.HttpClient = HttpClient;
2922
2947
  exports.IntellisenseService = IntellisenseService;
2948
+ exports.MailServerService = MailServerService;
2923
2949
  exports.PermissionService = PermissionService;
2924
2950
  exports.PrintingService = PrintingService;
2925
2951
  exports.ReportingService = ReportingService;
2926
- exports.RouteRuleService = RouteRuleService;
2927
2952
  exports.ServerFilterHelper = ServerFilterHelper;
2928
2953
  exports.UserService = UserService;
2929
2954
  exports.WorkflowService = WorkflowService;
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@fluxo-dev/api-client-base",
3
- "version": "0.0.24",
3
+ "version": "0.0.26",
4
4
  "type": "commonjs",
5
5
  "peerDependencies": {
6
- "@fluxo-dev/state": "0.0.24"
6
+ "@fluxo-dev/state": "0.0.26"
7
7
  },
8
8
  "main": "./index.cjs.js"
9
9
  }
package/src/index.d.ts CHANGED
@@ -13,7 +13,7 @@ export * from './lib/security/user';
13
13
  export * from './lib/security/apikey';
14
14
  export * from './lib/security/domain-role';
15
15
  export * from './lib/security/permission';
16
- export * from './lib/security/route-rule';
16
+ export * from './lib/communication';
17
17
  export * from './lib/korebi';
18
18
  export * from './lib/apps';
19
19
  export * from './lib/utils';
@@ -0,0 +1,6 @@
1
+ import { MailServerService } from "./mail-server";
2
+ export declare class CommunicationFacade {
3
+ private _mailServerService;
4
+ constructor();
5
+ get mailServer(): MailServerService;
6
+ }
@@ -0,0 +1,2 @@
1
+ export * from './mail-server/index';
2
+ export * from './communication.facade';
@@ -0,0 +1,2 @@
1
+ export * from './mail-server.service';
2
+ export * from './models';
@@ -0,0 +1,8 @@
1
+ import { CreateEmailServerConfigCommand } from "./models/create-email-server-config-command";
2
+ import { SendTestEmailCommand } from "./models/send-test-email-command";
3
+ import { EmailServerConfig } from "./models/email-server-config";
4
+ export declare class MailServerService {
5
+ getConfiguration(): Promise<EmailServerConfig>;
6
+ saveConfiguration(configuration: CreateEmailServerConfigCommand): Promise<void>;
7
+ sendTestEmail(command: SendTestEmailCommand): Promise<any>;
8
+ }
@@ -0,0 +1,14 @@
1
+ import { EmailServerProviderType } from "./email-server-provider-type";
2
+ export interface CreateEmailServerConfigCommand {
3
+ fromName?: string;
4
+ fromAddress?: string;
5
+ type: EmailServerProviderType;
6
+ directServer?: string;
7
+ directPort?: number;
8
+ directUser?: string;
9
+ directPassword?: string;
10
+ directUseSsl?: boolean;
11
+ mailgunDomain?: string;
12
+ mailgunApiKey?: string;
13
+ mailgunBaseUrl?: string;
14
+ }
@@ -0,0 +1,14 @@
1
+ import { EmailServerProviderType } from "./email-server-provider-type";
2
+ export interface EmailServerConfig {
3
+ fromName?: string;
4
+ fromAddress?: string;
5
+ type?: EmailServerProviderType | string;
6
+ directServer?: string;
7
+ directPort?: number;
8
+ directUser?: string;
9
+ directPassword?: string;
10
+ directUseSsl?: boolean;
11
+ mailgunDomain?: string;
12
+ mailgunApiKey?: string;
13
+ mailgunBaseUrl?: string;
14
+ }
@@ -0,0 +1,4 @@
1
+ export declare enum EmailServerProviderType {
2
+ Direct = 0,
3
+ Mailgun = 1
4
+ }
@@ -0,0 +1,4 @@
1
+ export * from './email-server-provider-type';
2
+ export * from './email-server-config';
3
+ export * from './send-test-email-command';
4
+ export * from './create-email-server-config-command';
@@ -0,0 +1,3 @@
1
+ export interface SendTestEmailCommand {
2
+ emailAddress: string;
3
+ }
@@ -3,7 +3,6 @@ import { ClientUi } from "./client-ui";
3
3
  import { FeatureList } from "./models/feature-list";
4
4
  import { FluxoApp } from "../apps/models/fluxo-app";
5
5
  import { DomainRole } from "../security/domain-role/index";
6
- import { RouteRuleWithPermissions } from "../security/route-rule/index";
7
6
  import { Permission } from "../security/permission/index";
8
7
  import { AppMenu } from "./app-menu";
9
8
  import { AppMenuCreateCommand } from "./app-menu-create-command";
@@ -14,10 +13,10 @@ export type InitialConfiguration = {
14
13
  ui: ClientUi;
15
14
  domainRoles: DomainRole[];
16
15
  permissions: any[];
17
- routeRules: RouteRuleWithPermissions[];
18
16
  frontends: string[];
19
17
  currentFrontend: string;
20
- isFluxoConfigured: boolean;
18
+ isUserLogged: boolean;
19
+ hasAdminAccess: boolean;
21
20
  };
22
21
  export declare class ConfigurationService {
23
22
  getInitialConfiguration(): Promise<InitialConfiguration>;
@@ -33,4 +32,10 @@ export declare class ConfigurationService {
33
32
  addMenuItemPermission(domainRoleId: number, permissionId: number): Promise<void>;
34
33
  removeMenuItemPermission(domainRoleId: number, permissionId: number): Promise<void>;
35
34
  setLastFrontend(frontendId: string): Promise<void>;
35
+ getFrontendByDomainRole(domainRoleId: number): Promise<string[]>;
36
+ updateFrontendDomainRole(domainRoleId: number, frontends: string[]): Promise<void>;
37
+ getAllDomainRoleFrontends(): Promise<{
38
+ domainRoleId: number;
39
+ frontends: string[];
40
+ }[]>;
36
41
  }
@@ -4,6 +4,7 @@ import { ConfigurationService } from "./configuration/configuration.service";
4
4
  import { KorebiFacade } from "./korebi/korebi-facade";
5
5
  import { AppService, PrintingService, ReportingService, WorkflowService } from "@fluxo-dev/api-client-base";
6
6
  import { FluxoClientConfiguration } from "@fluxo-dev/state";
7
+ import { CommunicationFacade } from "./communication";
7
8
  export interface FluxoClientInterface {
8
9
  get clientConfig(): FluxoClientConfiguration;
9
10
  get security(): SecurityFacade;
@@ -14,4 +15,5 @@ export interface FluxoClientInterface {
14
15
  get reporting(): ReportingService;
15
16
  get printing(): PrintingService;
16
17
  get workflow(): WorkflowService;
18
+ get communication(): CommunicationFacade;
17
19
  }
@@ -9,6 +9,7 @@ import { ReportingService } from "./reporting";
9
9
  import { PrintingService } from "./printing";
10
10
  import { WorkflowService } from "./workflow";
11
11
  import { FluxoClientInterface } from "./fluxo-client-interface";
12
+ import { CommunicationFacade } from "./communication";
12
13
  export declare abstract class FluxoClientBase implements FluxoClientInterface {
13
14
  get modules(): any[];
14
15
  static get HttpClient(): HttpClient;
@@ -21,6 +22,7 @@ export declare abstract class FluxoClientBase implements FluxoClientInterface {
21
22
  private _reportingService;
22
23
  private _printingService;
23
24
  private _workflowService;
25
+ private _communicationFacade;
24
26
  private _config;
25
27
  private _modules;
26
28
  register(module: any): void;
@@ -32,6 +34,7 @@ export declare abstract class FluxoClientBase implements FluxoClientInterface {
32
34
  get clientConfig(): FluxoClientConfiguration;
33
35
  get security(): SecurityFacade;
34
36
  get auth(): AuthService;
37
+ get communication(): CommunicationFacade;
35
38
  get configuration(): ConfigurationService;
36
39
  get korebi(): KorebiFacade;
37
40
  get apps(): AppService;
@@ -11,7 +11,7 @@ export declare class FluxoStateDispatcher {
11
11
  static dispatchCloseNavbar(): void;
12
12
  static dispatchSetAppMenu(items: AppMenuItem[]): void;
13
13
  static dispatchAllowedFrontends(frontends: string[]): void;
14
- static dispatchSetRouteRules(rules: any): void;
14
+ static dispatchHasAdminAccess(hasAdminAccess: boolean): void;
15
15
  static dispatchSetConfiguration(items: any): void;
16
16
  static dispatchSetSysFeatures(items: any): void;
17
17
  static dispatchSetJitAppsFeatures(items: any): void;
@@ -5,5 +5,6 @@ export interface ReportsList {
5
5
  namespace: string;
6
6
  reportTypeId: string;
7
7
  category: string;
8
+ name: string;
8
9
  reports: ReportInfo[];
9
10
  }
@@ -2,7 +2,6 @@ import { UserService } from "./user/user-service";
2
2
  import { DomainRoleService } from "./domain-role";
3
3
  import { ApiKeyService } from "./apikey";
4
4
  import { PermissionService } from "./permission/permission.service";
5
- import { RouteRuleService } from "./route-rule/route-rule.service";
6
5
  import { CurrentUser } from "@fluxo-dev/api-client-base";
7
6
  export declare class SecurityFacade {
8
7
  private readonly _userService;
@@ -10,12 +9,10 @@ export declare class SecurityFacade {
10
9
  private readonly _apiKeyService;
11
10
  private readonly _domainRoleService;
12
11
  private readonly _permissionService;
13
- private readonly _routeRuleService;
14
12
  constructor();
15
13
  get user(): UserService;
16
14
  get currentUser(): CurrentUser;
17
15
  get permission(): PermissionService;
18
- get routeRule(): RouteRuleService;
19
16
  get apiKey(): ApiKeyService;
20
17
  get domainRole(): DomainRoleService;
21
18
  }
@@ -1,3 +0,0 @@
1
- export * from './route-rule';
2
- export * from './route-rule.service';
3
- export * from './route-rule-with-permissions';
@@ -1,4 +0,0 @@
1
- export interface RouteRuleWithPermissions {
2
- route: string;
3
- permissions: string[];
4
- }
@@ -1,7 +0,0 @@
1
- export interface RouteRule {
2
- id?: number;
3
- scope: string;
4
- packageName: string;
5
- route: string;
6
- permissionsCount?: number;
7
- }
@@ -1,10 +0,0 @@
1
- import { RouteRule } from "./route-rule";
2
- import { BaseCommonService } from "../../infrastructure";
3
- import { Permission } from "../permission";
4
- export declare class RouteRuleService extends BaseCommonService<RouteRule> {
5
- constructor();
6
- getRouteRulesForScope(scope: string, packageName: string): Promise<RouteRule[]>;
7
- getPermissions(routeRuleId: string): Promise<Permission[]>;
8
- addPermission(routeRuleId: number, permissionId: number): Promise<void>;
9
- removePermission(routeRuleId: number, permissionId: number): Promise<void>;
10
- }