@fluxo-dev/api-client-base 0.0.8
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/.babelrc +12 -0
- package/.eslintrc.json +18 -0
- package/README.md +7 -0
- package/jest.config.ts +11 -0
- package/package.json +8 -0
- package/project.json +43 -0
- package/src/index.ts +39 -0
- package/src/lib/apps/apps.service.ts +46 -0
- package/src/lib/apps/index.ts +2 -0
- package/src/lib/apps/models/app-state.ts +4 -0
- package/src/lib/apps/models/app-type.ts +4 -0
- package/src/lib/apps/models/embedded-module.ts +106 -0
- package/src/lib/apps/models/fluxo-app-menu.ts +12 -0
- package/src/lib/apps/models/fluxo-app.ts +17 -0
- package/src/lib/apps/models/fluxo-embedded-module-configuration.ts +10 -0
- package/src/lib/apps/models/fluxo-frontend-app-configuration.ts +12 -0
- package/src/lib/apps/models/flx-app-routes.ts +5 -0
- package/src/lib/apps/models/flx-route.ts +6 -0
- package/src/lib/apps/models/index.ts +9 -0
- package/src/lib/auth/auth-service.ts +149 -0
- package/src/lib/configuration/app-menu-create-command.ts +9 -0
- package/src/lib/configuration/app-menu-item.ts +14 -0
- package/src/lib/configuration/app-menu.ts +15 -0
- package/src/lib/configuration/client-ui.ts +5 -0
- package/src/lib/configuration/configuration.service.ts +57 -0
- package/src/lib/configuration/index.ts +5 -0
- package/src/lib/configuration/models/feature-list.ts +8 -0
- package/src/lib/configuration/models/feature.ts +11 -0
- package/src/lib/configuration/models/index.ts +3 -0
- package/src/lib/configuration/models/module.ts +5 -0
- package/src/lib/constants/local-storage.ts +4 -0
- package/src/lib/fluxo-client-base-sys.ts +28 -0
- package/src/lib/fluxo-client-interface.ts +27 -0
- package/src/lib/fluxo-client.ts +142 -0
- package/src/lib/fluxo-state-dispatcher.ts +81 -0
- package/src/lib/http-client/http-client.ts +75 -0
- package/src/lib/infrastructure/base-common-service.ts +45 -0
- package/src/lib/infrastructure/index.ts +1 -0
- package/src/lib/interfaces/crud-service-interface.ts +9 -0
- package/src/lib/interfaces/index.ts +2 -0
- package/src/lib/interfaces/rc-paginated-result.ts +6 -0
- package/src/lib/korebi/app-service/app-service.service.ts +8 -0
- package/src/lib/korebi/app-service/index.ts +3 -0
- package/src/lib/korebi/app-service/model/dynamic-api-service.ts +15 -0
- package/src/lib/korebi/app-service/model/dynamic-api-services-method.ts +6 -0
- package/src/lib/korebi/documentation/documentation.service.ts +26 -0
- package/src/lib/korebi/documentation/index.ts +3 -0
- package/src/lib/korebi/documentation/intellisense.service.ts +21 -0
- package/src/lib/korebi/documentation/models/command-input-type.ts +11 -0
- package/src/lib/korebi/documentation/models/command-metadata.ts +10 -0
- package/src/lib/korebi/documentation/models/command-output-type.ts +6 -0
- package/src/lib/korebi/documentation/models/command.ts +19 -0
- package/src/lib/korebi/documentation/models/documentation.ts +13 -0
- package/src/lib/korebi/documentation/models/index.ts +8 -0
- package/src/lib/korebi/documentation/models/korebi-profile.ts +5 -0
- package/src/lib/korebi/documentation/models/type-meta-structure.ts +11 -0
- package/src/lib/korebi/documentation/models/type-specs.ts +5 -0
- package/src/lib/korebi/dynamic-configuration/dynamic-configuration.service.ts +17 -0
- package/src/lib/korebi/dynamic-configuration/index.ts +8 -0
- package/src/lib/korebi/dynamic-configuration/model/attribute-marker-location.ts +7 -0
- package/src/lib/korebi/dynamic-configuration/model/command-json-configuration.ts +20 -0
- package/src/lib/korebi/dynamic-configuration/model/instruction-json-configuration.ts +19 -0
- package/src/lib/korebi/dynamic-configuration/model/profile-json-configuration.ts +6 -0
- package/src/lib/korebi/dynamic-configuration/model/rest-adapter-info.ts +9 -0
- package/src/lib/korebi/dynamic-configuration/model/startup-exception-context.ts +44 -0
- package/src/lib/korebi/dynamic-configuration/model/tenant-json-configuration.ts +6 -0
- package/src/lib/korebi/index.ts +3 -0
- package/src/lib/korebi/korebi-facade.ts +33 -0
- package/src/lib/modules/fluxo-module.ts +13 -0
- package/src/lib/printing/index.ts +2 -0
- package/src/lib/printing/models/add-printer-command.ts +12 -0
- package/src/lib/printing/models/create-print-server-command.ts +11 -0
- package/src/lib/printing/models/index.ts +9 -0
- package/src/lib/printing/models/print-server-managed-type.ts +4 -0
- package/src/lib/printing/models/print-server-type.ts +4 -0
- package/src/lib/printing/models/printer-manufacturer.ts +3 -0
- package/src/lib/printing/models/printer-type.ts +4 -0
- package/src/lib/printing/models/update-print-server-command.ts +4 -0
- package/src/lib/printing/models/virtual-print-server.ts +14 -0
- package/src/lib/printing/models/virtual-printer.ts +14 -0
- package/src/lib/printing/printing.service.ts +32 -0
- package/src/lib/reporting/index.ts +2 -0
- package/src/lib/reporting/models/create-report-command.ts +8 -0
- package/src/lib/reporting/models/index.ts +7 -0
- package/src/lib/reporting/models/parameters-schema.ts +8 -0
- package/src/lib/reporting/models/print-report-command.ts +5 -0
- package/src/lib/reporting/models/report-info.ts +5 -0
- package/src/lib/reporting/models/report-parameter.ts +6 -0
- package/src/lib/reporting/models/report.ts +10 -0
- package/src/lib/reporting/models/reports-list.ts +10 -0
- package/src/lib/reporting/reporting.service.ts +33 -0
- package/src/lib/security/apikey/apikey-service.ts +30 -0
- package/src/lib/security/apikey/apikey.ts +7 -0
- package/src/lib/security/apikey/index.ts +3 -0
- package/src/lib/security/apikey/new-apikey.ts +4 -0
- package/src/lib/security/domain-role/domain-role.service.ts +22 -0
- package/src/lib/security/domain-role/domain-role.ts +7 -0
- package/src/lib/security/domain-role/index.ts +2 -0
- package/src/lib/security/permission/create-custom-permission-command.ts +7 -0
- package/src/lib/security/permission/create-permission-scope-command.ts +6 -0
- package/src/lib/security/permission/index.ts +8 -0
- package/src/lib/security/permission/install-permission-command.ts +7 -0
- package/src/lib/security/permission/permission-identifier.ts +4 -0
- package/src/lib/security/permission/permission-scope.ts +7 -0
- package/src/lib/security/permission/permission.service.ts +38 -0
- package/src/lib/security/permission/permission.ts +9 -0
- package/src/lib/security/permission/structured-permission.ts +22 -0
- package/src/lib/security/route-rule/index.ts +3 -0
- package/src/lib/security/route-rule/route-rule-with-permissions.ts +4 -0
- package/src/lib/security/route-rule/route-rule.service.ts +26 -0
- package/src/lib/security/route-rule/route-rule.ts +7 -0
- package/src/lib/security/security-facade.ts +42 -0
- package/src/lib/security/user/change-password.ts +4 -0
- package/src/lib/security/user/forgot-password.ts +5 -0
- package/src/lib/security/user/identityOperationResult.ts +9 -0
- package/src/lib/security/user/index.ts +2 -0
- package/src/lib/security/user/new-account-confirmation.ts +4 -0
- package/src/lib/security/user/new-user.ts +12 -0
- package/src/lib/security/user/user-service.ts +83 -0
- package/src/lib/security/user/user.ts +19 -0
- package/src/lib/utils/index.ts +1 -0
- package/src/lib/utils/server-filter-helper.ts +34 -0
- package/src/lib/workflow/index.ts +2 -0
- package/src/lib/workflow/models/action-category-definition.ts +7 -0
- package/src/lib/workflow/models/action-definition.ts +12 -0
- package/src/lib/workflow/models/action-input-definition.ts +8 -0
- package/src/lib/workflow/models/action-output-definition.ts +4 -0
- package/src/lib/workflow/models/index.ts +11 -0
- package/src/lib/workflow/models/trigger-category-definition.ts +6 -0
- package/src/lib/workflow/models/trigger-definition.ts +11 -0
- package/src/lib/workflow/models/workflow-action-input-type.ts +6 -0
- package/src/lib/workflow/models/workflow-action-input.ts +6 -0
- package/src/lib/workflow/models/workflow-action.ts +14 -0
- package/src/lib/workflow/models/workflow-trigger.ts +11 -0
- package/src/lib/workflow/models/workflow.ts +10 -0
- package/src/lib/workflow/workflow.service.ts +17 -0
- package/tsconfig.json +20 -0
- package/tsconfig.lib.json +24 -0
- package/tsconfig.spec.json +20 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './model/rest-adapter-info';
|
|
2
|
+
export * from './model/attribute-marker-location';
|
|
3
|
+
export * from './model/tenant-json-configuration';
|
|
4
|
+
export * from './model/command-json-configuration';
|
|
5
|
+
export * from './model/profile-json-configuration';
|
|
6
|
+
export * from './model/instruction-json-configuration';
|
|
7
|
+
export * from './dynamic-configuration.service';
|
|
8
|
+
export * from './model/startup-exception-context';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {AttributeMarkerLocation} from "./attribute-marker-location";
|
|
2
|
+
import {RestAdapterInfo} from "./rest-adapter-info";
|
|
3
|
+
import {InstructionJsonConfiguration} from "./instruction-json-configuration";
|
|
4
|
+
|
|
5
|
+
export interface CommandJsonConfiguration {
|
|
6
|
+
commandAlias: string;
|
|
7
|
+
name: string;
|
|
8
|
+
documentation: string;
|
|
9
|
+
enabled: boolean;
|
|
10
|
+
avoidTraceEveryResult: boolean;
|
|
11
|
+
continueOnError: boolean;
|
|
12
|
+
mainInstruction?: InstructionJsonConfiguration;
|
|
13
|
+
otherInstructions?: InstructionJsonConfiguration[];
|
|
14
|
+
commandMetadata?: { [key: string]: any; };
|
|
15
|
+
commandOutputMetadata?: { [key: string]: any; };
|
|
16
|
+
commandConstants?: { [key: string]: any; };
|
|
17
|
+
inputTypes?: string[];
|
|
18
|
+
restAdapterInfo?: RestAdapterInfo;
|
|
19
|
+
attributeMarkerLocation?: AttributeMarkerLocation;
|
|
20
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface InstructionJsonConfiguration {
|
|
2
|
+
instructionType: 'function' | 'action';
|
|
3
|
+
paramsNumber: number;
|
|
4
|
+
input1FullyQualifiedName?: string | null;
|
|
5
|
+
input2FullyQualifiedName?: string | null;
|
|
6
|
+
input3FullyQualifiedName?: string | null;
|
|
7
|
+
input4FullyQualifiedName?: string | null;
|
|
8
|
+
serviceFullyQualifiedName?: string | null;
|
|
9
|
+
outputFullyQualifiedName?: string | null;
|
|
10
|
+
instructionName?: string;
|
|
11
|
+
setAsVariable?: string;
|
|
12
|
+
setAsResult?: string;
|
|
13
|
+
setOperationInputReferences?: any[];
|
|
14
|
+
isScript: boolean;
|
|
15
|
+
scriptCode?: string;
|
|
16
|
+
complexScriptCode?: string;
|
|
17
|
+
isAsync: boolean;
|
|
18
|
+
throwExceptionIfOperationResultIsDefault?: boolean;
|
|
19
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export interface StartupExceptionContext {
|
|
2
|
+
eventExceptions: EventBuildException[];
|
|
3
|
+
buildExceptions: { [key: string]: CommandBuildException; };
|
|
4
|
+
parseExceptions: CommandParseException[];
|
|
5
|
+
startupExceptionsToString: string;
|
|
6
|
+
containsErrors: boolean;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface EventBuildException {
|
|
10
|
+
exception1: any;
|
|
11
|
+
eventName: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface CommandBuildException {
|
|
15
|
+
props: CommandContextMetadataProperties;
|
|
16
|
+
commandName: string;
|
|
17
|
+
commandConfigurationException: ExceptionDto;
|
|
18
|
+
reAdded: boolean;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface CommandParseException {
|
|
22
|
+
message: string;
|
|
23
|
+
exception: ExceptionDto;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface ExceptionDto {
|
|
27
|
+
message: string;
|
|
28
|
+
stackTrace: string;
|
|
29
|
+
innerExceptionMessage: string;
|
|
30
|
+
innerInnerException: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface CommandContextMetadataProperties {
|
|
34
|
+
commandDescription: string;
|
|
35
|
+
profileName: string;
|
|
36
|
+
originalCommandName: string;
|
|
37
|
+
completeCommandName: string;
|
|
38
|
+
commandType: string;
|
|
39
|
+
configurationType: string;
|
|
40
|
+
commandAlias: string;
|
|
41
|
+
definitionType: string;
|
|
42
|
+
namespace: string;
|
|
43
|
+
containingAssembly: string;
|
|
44
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {DocumentationService, IntellisenseService} from "./documentation";
|
|
2
|
+
import {AppServiceService} from "./app-service";
|
|
3
|
+
import {DynamicConfigurationService} from "@fluxo-dev/api-client-base";
|
|
4
|
+
|
|
5
|
+
export class KorebiFacade {
|
|
6
|
+
private readonly _documentationService: DocumentationService;
|
|
7
|
+
private readonly _appServiceService: AppServiceService;
|
|
8
|
+
private readonly _dynamicConfigurationService: DynamicConfigurationService;
|
|
9
|
+
private readonly _intellisenseService: IntellisenseService;
|
|
10
|
+
|
|
11
|
+
constructor() {
|
|
12
|
+
this._documentationService = new DocumentationService();
|
|
13
|
+
this._appServiceService = new AppServiceService();
|
|
14
|
+
this._dynamicConfigurationService = new DynamicConfigurationService();
|
|
15
|
+
this._intellisenseService = new IntellisenseService();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
get documentation(): DocumentationService {
|
|
19
|
+
return this._documentationService;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
get appService(): AppServiceService {
|
|
23
|
+
return this._appServiceService;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
get dynamicConfiguration(): DynamicConfigurationService {
|
|
27
|
+
return this._dynamicConfigurationService;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
get intellisense(): IntellisenseService {
|
|
31
|
+
return this._intellisenseService;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {PrinterType} from "./printer-type";
|
|
2
|
+
import {PrinterManufacturer} from "./printer-manufacturer";
|
|
3
|
+
|
|
4
|
+
export interface AddPrinterCommand {
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
type: PrinterType;
|
|
8
|
+
manufacturer: PrinterManufacturer;
|
|
9
|
+
ipAddress: string;
|
|
10
|
+
port: number;
|
|
11
|
+
mappedPrinterName: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import {PrintServerType} from "./print-server-type";
|
|
2
|
+
import {PrintServerManagedType} from "./print-server-managed-type";
|
|
3
|
+
|
|
4
|
+
export interface CreatePrintServerCommand {
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
type: PrintServerType;
|
|
8
|
+
managedType: PrintServerManagedType;
|
|
9
|
+
ipAddress: string | null;
|
|
10
|
+
port: number;
|
|
11
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './printer-type';
|
|
2
|
+
export * from './virtual-printer';
|
|
3
|
+
export * from './print-server-type';
|
|
4
|
+
export * from './add-printer-command';
|
|
5
|
+
export * from './printer-manufacturer';
|
|
6
|
+
export * from './virtual-print-server';
|
|
7
|
+
export * from './print-server-managed-type';
|
|
8
|
+
export * from './create-print-server-command';
|
|
9
|
+
export * from './update-print-server-command';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {PrintServerType} from "./print-server-type";
|
|
2
|
+
import {PrintServerManagedType} from "./print-server-managed-type";
|
|
3
|
+
import {VirtualPrinter} from "./virtual-printer";
|
|
4
|
+
|
|
5
|
+
export interface VirtualPrintServer {
|
|
6
|
+
id: number;
|
|
7
|
+
name: string;
|
|
8
|
+
description: string;
|
|
9
|
+
type: PrintServerType;
|
|
10
|
+
managedType: PrintServerManagedType;
|
|
11
|
+
printers: VirtualPrinter[];
|
|
12
|
+
ipAddress: string;
|
|
13
|
+
port: number;
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {PrinterType} from "./printer-type";
|
|
2
|
+
import {PrinterManufacturer} from "./printer-manufacturer";
|
|
3
|
+
|
|
4
|
+
export interface VirtualPrinter {
|
|
5
|
+
id: number;
|
|
6
|
+
mappedPrinterName: string;
|
|
7
|
+
printServerId: number;
|
|
8
|
+
type: PrinterType;
|
|
9
|
+
description: string;
|
|
10
|
+
name: string;
|
|
11
|
+
manufacturer: PrinterManufacturer | null;
|
|
12
|
+
ipAddress: string | null;
|
|
13
|
+
port: number | null;
|
|
14
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import {VirtualPrintServer} from "./models/virtual-print-server";
|
|
2
|
+
import {HttpClient} from "../http-client/http-client";
|
|
3
|
+
import {AddPrinterCommand} from "./models/add-printer-command";
|
|
4
|
+
import {CreatePrintServerCommand} from "./models/create-print-server-command";
|
|
5
|
+
import {UpdatePrintServerCommand} from "./models/update-print-server-command";
|
|
6
|
+
|
|
7
|
+
export class PrintingService {
|
|
8
|
+
|
|
9
|
+
public GetPrintServerList(): Promise<VirtualPrintServer[]> {
|
|
10
|
+
return HttpClient.Instance().client.get(`print-server?includes=Printers`);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
public GetPrintServer(printServerId: number): Promise<VirtualPrintServer> {
|
|
14
|
+
return HttpClient.Instance().client.get(`print-server/${printServerId}`);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
public UpdatePrintServer(printServerId: number, command: UpdatePrintServerCommand) {
|
|
18
|
+
return HttpClient.Instance().client.put(`print-server/${printServerId}`, command);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
public GetPrintServerPrinters(printServerId: number): Promise<string[]> {
|
|
22
|
+
return HttpClient.Instance().client.get(`print-server/${printServerId}/printers`);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
public CreatePrintServer(command: CreatePrintServerCommand) {
|
|
26
|
+
return HttpClient.Instance().client.post(`print-server`, command);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
public AddPrinter(printServerId: number, command: AddPrinterCommand) {
|
|
30
|
+
return HttpClient.Instance().client.post(`print-server/${printServerId}/virtual-printers`, command);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {ReportsList} from "./models/reports-list";
|
|
2
|
+
import {HttpClient} from "../http-client/http-client";
|
|
3
|
+
import {CreateReportCommand} from "./models/create-report-command";
|
|
4
|
+
import {Report} from "./models/report";
|
|
5
|
+
import {ParametersSchema} from "./models/parameters-schema";
|
|
6
|
+
import {PrintReportCommand} from "./models/print-report-command";
|
|
7
|
+
|
|
8
|
+
export class ReportingService {
|
|
9
|
+
|
|
10
|
+
public getReportsList(scopeFilter?: string): Promise<ReportsList[]> {
|
|
11
|
+
return HttpClient.Instance().client.get(scopeFilter ? `reports/types/list?scopeFilter=${scopeFilter}` : 'reports/types/list');
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
public createReport(command: CreateReportCommand): Promise<number> {
|
|
15
|
+
return HttpClient.Instance().client.post('reports', command);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
public getReportById(id: number): Promise<Report> {
|
|
19
|
+
return HttpClient.Instance().client.get(`reports/${id}`);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
public deleteReport(id: number): Promise<void> {
|
|
23
|
+
return HttpClient.Instance().client.delete(`reports/${id}`);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
public getParametersSchema(fullScope: string): Promise<ParametersSchema> {
|
|
27
|
+
return HttpClient.Instance().client.get(`reports/params/schema/${fullScope}`);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
public print(command: PrintReportCommand): Promise<void> {
|
|
31
|
+
return HttpClient.Instance().client.post('reports/print', command);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { HttpClient } from "../../http-client/http-client";
|
|
2
|
+
import { BaseCommonService } from "../../infrastructure/base-common-service";
|
|
3
|
+
import { ApiKey } from "./apikey";
|
|
4
|
+
import { NewApiKey } from "./new-apikey";
|
|
5
|
+
|
|
6
|
+
export class ApiKeyService {
|
|
7
|
+
|
|
8
|
+
constructor() {
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
public getApiKeys(): Promise<ApiKey[]> {
|
|
12
|
+
return HttpClient.Instance().client.get(`/identity/apikey`);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
public create(apiKey: NewApiKey): Promise<string> {
|
|
16
|
+
return HttpClient.Instance().client.post(`/identity/apikey`, apiKey);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public delete(apiKeyId: number): Promise<void> {
|
|
20
|
+
return HttpClient.Instance().client.delete(`/identity/apikey/${apiKeyId}`);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
public enable(apiKeyId: number): Promise<void> {
|
|
24
|
+
return HttpClient.Instance().client.get(`/identity/apikey/${apiKeyId}/enable`);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
public disable(apiKeyId: number): Promise<void> {
|
|
28
|
+
return HttpClient.Instance().client.get(`/identity/apikey/${apiKeyId}/disable`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {DomainRole} from "./domain-role";
|
|
2
|
+
import {BaseCommonService} from "../../infrastructure";
|
|
3
|
+
import {HttpClient} from "../../http-client/http-client";
|
|
4
|
+
import {Permission} from "../permission";
|
|
5
|
+
|
|
6
|
+
export class DomainRoleService extends BaseCommonService<DomainRole> {
|
|
7
|
+
constructor() {
|
|
8
|
+
super('domainroles');
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
public getPermissions(domainRoleId: string): Promise<Permission[]> {
|
|
12
|
+
return HttpClient.Instance().client.get(`domainroles/${domainRoleId}/permissions`);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
public addPermission(domainRoleId: number, permissionId: number): Promise<void> {
|
|
16
|
+
return HttpClient.Instance().client.post(`domainroles/${domainRoleId}/permissions`, {domainRoleId: domainRoleId, permissionId: permissionId});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public removePermission(domainRoleId: number, permissionId: number): Promise<void> {
|
|
20
|
+
return HttpClient.Instance().client.delete(`domainroles/${domainRoleId}/permissions/${permissionId}`);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './permission.service';
|
|
2
|
+
export * from './permission-identifier';
|
|
3
|
+
export * from './install-permission-command';
|
|
4
|
+
export * from './permission';
|
|
5
|
+
export * from './structured-permission';
|
|
6
|
+
export * from './create-permission-scope-command';
|
|
7
|
+
export * from './permission-scope';
|
|
8
|
+
export * from './create-custom-permission-command';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import {InstallPermissionCommand} from "./install-permission-command";
|
|
2
|
+
import {HttpClient} from "../../http-client/http-client";
|
|
3
|
+
import {Permission} from "./permission";
|
|
4
|
+
import {CreatePermissionScopeCommand} from "./create-permission-scope-command";
|
|
5
|
+
import {PermissionScope} from "./permission-scope";
|
|
6
|
+
import {CreateCustomPermissionCommand} from "./create-custom-permission-command";
|
|
7
|
+
|
|
8
|
+
export class PermissionService {
|
|
9
|
+
|
|
10
|
+
public getPermissionScopes(): Promise<PermissionScope[]> {
|
|
11
|
+
return HttpClient.Instance().client.get('identity/permissions/scopes');
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
public getPermissionsInScope(scope: string, packageName: string, namespace: string): Promise<Permission[]> {
|
|
15
|
+
return HttpClient.Instance().client.get(`identity/permissions/${scope}/${packageName}/${namespace}`);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
public createPermissionScope(data: CreatePermissionScopeCommand): Promise<void> {
|
|
19
|
+
return HttpClient.Instance().client.post(`identity/permissions/scopes`, data);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
public deletePermissionScope(scope: string, packageName: string, namespace: string): Promise<void> {
|
|
23
|
+
return HttpClient.Instance().client.delete(`identity/permissions/scopes/${scope}/${packageName}/${namespace}`);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
public installPermissions(data: InstallPermissionCommand): Promise<void> {
|
|
27
|
+
return HttpClient.Instance().client.post('apps/permissions/install', data);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
public createCustomPermission(data: CreateCustomPermissionCommand): Promise<void> {
|
|
31
|
+
return HttpClient.Instance().client.post('identity/permissions/custom', data);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
public deleteCustomPermission(permissionId: number): Promise<void> {
|
|
35
|
+
return HttpClient.Instance().client.delete(`identity/permissions/custom/${permissionId}`);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {Permission} from "./permission";
|
|
2
|
+
|
|
3
|
+
export interface StructuredPermissions {
|
|
4
|
+
scopes: StructuredPermissionsScope[];
|
|
5
|
+
scopesCount: number;
|
|
6
|
+
packageNamesCount: number;
|
|
7
|
+
permissionsCount: number;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface StructuredPermissionsScope {
|
|
11
|
+
name: string;
|
|
12
|
+
packageNames: StructuredPermissionsPackageName[];
|
|
13
|
+
packageNamesCount: number;
|
|
14
|
+
permissionsCount: number;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface StructuredPermissionsPackageName {
|
|
18
|
+
name: string;
|
|
19
|
+
parentScope: string;
|
|
20
|
+
|
|
21
|
+
permissions: Permission[];
|
|
22
|
+
}
|