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

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,6 +1737,9 @@ class FluxoStateDispatcher {
1737
1737
  static dispatchAllowedFrontends(frontends) {
1738
1738
  state.store.dispatch(state.setAllowedFrontends(frontends));
1739
1739
  }
1740
+ static dispatchHasAdminAccess(hasAdminAccess) {
1741
+ state.store.dispatch(state.setHasAdminAccess(hasAdminAccess));
1742
+ }
1740
1743
  static dispatchSetRouteRules(rules) {
1741
1744
  state.store.dispatch(state.setRouteRules(rules));
1742
1745
  }
@@ -1923,6 +1926,17 @@ class ConfigurationService {
1923
1926
  frontend: frontendId
1924
1927
  });
1925
1928
  }
1929
+ getFrontendByDomainRole(domainRoleId) {
1930
+ return HttpClient.Instance().client.get(`client/frontend/${domainRoleId}`);
1931
+ }
1932
+ updateFrontendDomainRole(domainRoleId, frontends) {
1933
+ return HttpClient.Instance().client.post(`client/frontend/${domainRoleId}`, {
1934
+ frontendIds: frontends
1935
+ });
1936
+ }
1937
+ getAllDomainRoleFrontends() {
1938
+ return HttpClient.Instance().client.get(`client/frontend`);
1939
+ }
1926
1940
  }
1927
1941
 
1928
1942
  class UserService {
@@ -2576,6 +2590,39 @@ class WorkflowService {
2576
2590
  }
2577
2591
  }
2578
2592
 
2593
+ class MailServerService {
2594
+ getConfiguration() {
2595
+ return __awaiter(this, void 0, void 0, function* () {
2596
+ return HttpClient.Instance().client.get('/communication/email-server/configuration');
2597
+ });
2598
+ }
2599
+ saveConfiguration(configuration) {
2600
+ return __awaiter(this, void 0, void 0, function* () {
2601
+ return HttpClient.Instance().client.post('/communication/email-server/configuration', configuration);
2602
+ });
2603
+ }
2604
+ sendTestEmail(command) {
2605
+ return __awaiter(this, void 0, void 0, function* () {
2606
+ return HttpClient.Instance().client.post('/communication/email-server/test', command);
2607
+ });
2608
+ }
2609
+ }
2610
+
2611
+ exports.EmailServerProviderType = void 0;
2612
+ (function (EmailServerProviderType) {
2613
+ EmailServerProviderType[EmailServerProviderType["Direct"] = 0] = "Direct";
2614
+ EmailServerProviderType[EmailServerProviderType["Mailgun"] = 1] = "Mailgun";
2615
+ })(exports.EmailServerProviderType || (exports.EmailServerProviderType = {}));
2616
+
2617
+ class CommunicationFacade {
2618
+ constructor() {
2619
+ this._mailServerService = new MailServerService();
2620
+ }
2621
+ get mailServer() {
2622
+ return this._mailServerService;
2623
+ }
2624
+ }
2625
+
2579
2626
  class FluxoClientBase {
2580
2627
  constructor() {
2581
2628
  this._authenticationType = null;
@@ -2587,6 +2634,7 @@ class FluxoClientBase {
2587
2634
  this._reportingService = null;
2588
2635
  this._printingService = null;
2589
2636
  this._workflowService = null;
2637
+ this._communicationFacade = null;
2590
2638
  this._config = null;
2591
2639
  this._modules = [];
2592
2640
  this.getBearerToken = () => {
@@ -2633,6 +2681,7 @@ class FluxoClientBase {
2633
2681
  this._reportingService = new ReportingService();
2634
2682
  this._printingService = new PrintingService();
2635
2683
  this._workflowService = new WorkflowService();
2684
+ this._communicationFacade = new CommunicationFacade();
2636
2685
  console.info('7) Sub services initialized');
2637
2686
  if (setState) state.store.dispatch(state.setFluxoClientConfiguration(config));
2638
2687
  console.info('-*-*-*- FluxoClient setup finished -*-*-*-');
@@ -2648,6 +2697,9 @@ class FluxoClientBase {
2648
2697
  get auth() {
2649
2698
  return this._authService;
2650
2699
  }
2700
+ get communication() {
2701
+ return this._communicationFacade;
2702
+ }
2651
2703
  get configuration() {
2652
2704
  return this._configurationService;
2653
2705
  }
@@ -2910,6 +2962,7 @@ exports.ApiKeyService = ApiKeyService;
2910
2962
  exports.AppService = AppService;
2911
2963
  exports.AppServiceService = AppServiceService;
2912
2964
  exports.BaseCommonService = BaseCommonService;
2965
+ exports.CommunicationFacade = CommunicationFacade;
2913
2966
  exports.CurrentUser = CurrentUser;
2914
2967
  exports.DocumentationService = DocumentationService;
2915
2968
  exports.DomainRoleService = DomainRoleService;
@@ -2920,6 +2973,7 @@ exports.FluxoClientSys = FluxoClientSys;
2920
2973
  exports.FluxoStateDispatcher = FluxoStateDispatcher;
2921
2974
  exports.HttpClient = HttpClient;
2922
2975
  exports.IntellisenseService = IntellisenseService;
2976
+ exports.MailServerService = MailServerService;
2923
2977
  exports.PermissionService = PermissionService;
2924
2978
  exports.PrintingService = PrintingService;
2925
2979
  exports.ReportingService = ReportingService;
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.25",
4
4
  "type": "commonjs",
5
5
  "peerDependencies": {
6
- "@fluxo-dev/state": "0.0.24"
6
+ "@fluxo-dev/state": "0.0.25"
7
7
  },
8
8
  "main": "./index.cjs.js"
9
9
  }
package/src/index.d.ts CHANGED
@@ -14,6 +14,7 @@ export * from './lib/security/apikey';
14
14
  export * from './lib/security/domain-role';
15
15
  export * from './lib/security/permission';
16
16
  export * from './lib/security/route-rule';
17
+ export * from './lib/communication';
17
18
  export * from './lib/korebi';
18
19
  export * from './lib/apps';
19
20
  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
+ }
@@ -17,7 +17,8 @@ export type InitialConfiguration = {
17
17
  routeRules: RouteRuleWithPermissions[];
18
18
  frontends: string[];
19
19
  currentFrontend: string;
20
- isFluxoConfigured: boolean;
20
+ isUserLogged: boolean;
21
+ hasAdminAccess: boolean;
21
22
  };
22
23
  export declare class ConfigurationService {
23
24
  getInitialConfiguration(): Promise<InitialConfiguration>;
@@ -33,4 +34,10 @@ export declare class ConfigurationService {
33
34
  addMenuItemPermission(domainRoleId: number, permissionId: number): Promise<void>;
34
35
  removeMenuItemPermission(domainRoleId: number, permissionId: number): Promise<void>;
35
36
  setLastFrontend(frontendId: string): Promise<void>;
37
+ getFrontendByDomainRole(domainRoleId: number): Promise<string[]>;
38
+ updateFrontendDomainRole(domainRoleId: number, frontends: string[]): Promise<void>;
39
+ getAllDomainRoleFrontends(): Promise<{
40
+ domainRoleId: number;
41
+ frontends: string[];
42
+ }[]>;
36
43
  }
@@ -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,6 +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 dispatchHasAdminAccess(hasAdminAccess: boolean): void;
14
15
  static dispatchSetRouteRules(rules: any): void;
15
16
  static dispatchSetConfiguration(items: any): void;
16
17
  static dispatchSetSysFeatures(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
  }