namirasoft-access 1.3.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/dist/NamirasoftAccessServer.d.ts +13 -0
- package/dist/NamirasoftAccessServer.js +19 -0
- package/dist/NamirasoftAccessServer.js.map +1 -0
- package/dist/NamirasoftAccessServerBase.d.ts +5 -0
- package/dist/NamirasoftAccessServerBase.js +12 -0
- package/dist/NamirasoftAccessServerBase.js.map +1 -0
- package/dist/NamirasoftAccessServerHealthz.d.ts +4 -0
- package/dist/NamirasoftAccessServerHealthz.js +24 -0
- package/dist/NamirasoftAccessServerHealthz.js.map +1 -0
- package/dist/NamirasoftAccessServerPermission.d.ts +24 -0
- package/dist/NamirasoftAccessServerPermission.js +84 -0
- package/dist/NamirasoftAccessServerPermission.js.map +1 -0
- package/dist/NamirasoftAccessServerPolicy.d.ts +19 -0
- package/dist/NamirasoftAccessServerPolicy.js +69 -0
- package/dist/NamirasoftAccessServerPolicy.js.map +1 -0
- package/dist/NamirasoftAccessServerRole.d.ts +19 -0
- package/dist/NamirasoftAccessServerRole.js +69 -0
- package/dist/NamirasoftAccessServerRole.js.map +1 -0
- package/dist/command/HealthzCommand.d.ts +4 -0
- package/dist/command/HealthzCommand.js +15 -0
- package/dist/command/HealthzCommand.js.map +1 -0
- package/dist/command/HealthzGetCommand.d.ts +5 -0
- package/dist/command/HealthzGetCommand.js +37 -0
- package/dist/command/HealthzGetCommand.js.map +1 -0
- package/dist/command/PermissionCommand.d.ts +4 -0
- package/dist/command/PermissionCommand.js +31 -0
- package/dist/command/PermissionCommand.js.map +1 -0
- package/dist/command/PermissionCreateCommand.d.ts +5 -0
- package/dist/command/PermissionCreateCommand.js +75 -0
- package/dist/command/PermissionCreateCommand.js.map +1 -0
- package/dist/command/PermissionDeleteCommand.d.ts +5 -0
- package/dist/command/PermissionDeleteCommand.js +37 -0
- package/dist/command/PermissionDeleteCommand.js.map +1 -0
- package/dist/command/PermissionGetCommand.d.ts +5 -0
- package/dist/command/PermissionGetCommand.js +37 -0
- package/dist/command/PermissionGetCommand.js.map +1 -0
- package/dist/command/PermissionGetIncomingCommand.d.ts +5 -0
- package/dist/command/PermissionGetIncomingCommand.js +37 -0
- package/dist/command/PermissionGetIncomingCommand.js.map +1 -0
- package/dist/command/PermissionGetOutgoingCommand.d.ts +5 -0
- package/dist/command/PermissionGetOutgoingCommand.js +37 -0
- package/dist/command/PermissionGetOutgoingCommand.js.map +1 -0
- package/dist/command/PermissionListCommand.d.ts +5 -0
- package/dist/command/PermissionListCommand.js +37 -0
- package/dist/command/PermissionListCommand.js.map +1 -0
- package/dist/command/PermissionListIncomingCommand.d.ts +5 -0
- package/dist/command/PermissionListIncomingCommand.js +37 -0
- package/dist/command/PermissionListIncomingCommand.js.map +1 -0
- package/dist/command/PermissionListOutgoingCommand.d.ts +5 -0
- package/dist/command/PermissionListOutgoingCommand.js +37 -0
- package/dist/command/PermissionListOutgoingCommand.js.map +1 -0
- package/dist/command/PermissionUpdateCommand.d.ts +5 -0
- package/dist/command/PermissionUpdateCommand.js +75 -0
- package/dist/command/PermissionUpdateCommand.js.map +1 -0
- package/dist/command/PolicyCommand.d.ts +4 -0
- package/dist/command/PolicyCommand.js +27 -0
- package/dist/command/PolicyCommand.js.map +1 -0
- package/dist/command/PolicyCreateCommand.d.ts +5 -0
- package/dist/command/PolicyCreateCommand.js +93 -0
- package/dist/command/PolicyCreateCommand.js.map +1 -0
- package/dist/command/PolicyDeleteCommand.d.ts +5 -0
- package/dist/command/PolicyDeleteCommand.js +37 -0
- package/dist/command/PolicyDeleteCommand.js.map +1 -0
- package/dist/command/PolicyGetCommand.d.ts +5 -0
- package/dist/command/PolicyGetCommand.js +37 -0
- package/dist/command/PolicyGetCommand.js.map +1 -0
- package/dist/command/PolicyGetIncomingCommand.d.ts +5 -0
- package/dist/command/PolicyGetIncomingCommand.js +37 -0
- package/dist/command/PolicyGetIncomingCommand.js.map +1 -0
- package/dist/command/PolicyListCommand.d.ts +5 -0
- package/dist/command/PolicyListCommand.js +37 -0
- package/dist/command/PolicyListCommand.js.map +1 -0
- package/dist/command/PolicyListIncomingCommand.d.ts +5 -0
- package/dist/command/PolicyListIncomingCommand.js +37 -0
- package/dist/command/PolicyListIncomingCommand.js.map +1 -0
- package/dist/command/PolicyUpdateCommand.d.ts +5 -0
- package/dist/command/PolicyUpdateCommand.js +93 -0
- package/dist/command/PolicyUpdateCommand.js.map +1 -0
- package/dist/command/RoleCommand.d.ts +4 -0
- package/dist/command/RoleCommand.js +27 -0
- package/dist/command/RoleCommand.js.map +1 -0
- package/dist/command/RoleCreateCommand.d.ts +5 -0
- package/dist/command/RoleCreateCommand.js +57 -0
- package/dist/command/RoleCreateCommand.js.map +1 -0
- package/dist/command/RoleDeleteCommand.d.ts +5 -0
- package/dist/command/RoleDeleteCommand.js +37 -0
- package/dist/command/RoleDeleteCommand.js.map +1 -0
- package/dist/command/RoleGetCommand.d.ts +5 -0
- package/dist/command/RoleGetCommand.js +37 -0
- package/dist/command/RoleGetCommand.js.map +1 -0
- package/dist/command/RoleGetIncomingCommand.d.ts +5 -0
- package/dist/command/RoleGetIncomingCommand.js +37 -0
- package/dist/command/RoleGetIncomingCommand.js.map +1 -0
- package/dist/command/RoleListCommand.d.ts +5 -0
- package/dist/command/RoleListCommand.js +37 -0
- package/dist/command/RoleListCommand.js.map +1 -0
- package/dist/command/RoleListIncomingCommand.d.ts +5 -0
- package/dist/command/RoleListIncomingCommand.js +37 -0
- package/dist/command/RoleListIncomingCommand.js.map +1 -0
- package/dist/command/RoleUpdateCommand.d.ts +5 -0
- package/dist/command/RoleUpdateCommand.js +57 -0
- package/dist/command/RoleUpdateCommand.js.map +1 -0
- package/dist/command/cli.d.ts +2 -0
- package/dist/command/cli.js +18 -0
- package/dist/command/cli.js.map +1 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.js +57 -0
- package/dist/index.js.map +1 -0
- package/dist/row/PermissionInputRow.d.ts +6 -0
- package/dist/row/PermissionInputRow.js +3 -0
- package/dist/row/PermissionInputRow.js.map +1 -0
- package/dist/row/PermissionRow.d.ts +8 -0
- package/dist/row/PermissionRow.js +3 -0
- package/dist/row/PermissionRow.js.map +1 -0
- package/dist/row/PoleRow.d.ts +6 -0
- package/dist/row/PoleRow.js +3 -0
- package/dist/row/PoleRow.js.map +1 -0
- package/dist/row/PolicyInputRow.d.ts +8 -0
- package/dist/row/PolicyInputRow.js +3 -0
- package/dist/row/PolicyInputRow.js.map +1 -0
- package/dist/row/PolicyRow.d.ts +10 -0
- package/dist/row/PolicyRow.js +3 -0
- package/dist/row/PolicyRow.js.map +1 -0
- package/dist/row/RoleInputRow.d.ts +4 -0
- package/dist/row/RoleInputRow.js +3 -0
- package/dist/row/RoleInputRow.js.map +1 -0
- package/logo.png +0 -0
- package/package.json +28 -0
- package/src/NamirasoftAccessServer.ts +42 -0
- package/src/NamirasoftAccessServerBase.ts +30 -0
- package/src/NamirasoftAccessServerHealthz.ts +30 -0
- package/src/NamirasoftAccessServerPermission.ts +84 -0
- package/src/NamirasoftAccessServerPolicy.ts +71 -0
- package/src/NamirasoftAccessServerRole.ts +71 -0
- package/src/command/HealthzCommand.ts +32 -0
- package/src/command/HealthzGetCommand.ts +44 -0
- package/src/command/PermissionCommand.ts +48 -0
- package/src/command/PermissionCreateCommand.ts +82 -0
- package/src/command/PermissionDeleteCommand.ts +44 -0
- package/src/command/PermissionGetCommand.ts +44 -0
- package/src/command/PermissionGetIncomingCommand.ts +44 -0
- package/src/command/PermissionGetOutgoingCommand.ts +44 -0
- package/src/command/PermissionListCommand.ts +44 -0
- package/src/command/PermissionListIncomingCommand.ts +44 -0
- package/src/command/PermissionListOutgoingCommand.ts +44 -0
- package/src/command/PermissionUpdateCommand.ts +82 -0
- package/src/command/PolicyCommand.ts +44 -0
- package/src/command/PolicyCreateCommand.ts +100 -0
- package/src/command/PolicyDeleteCommand.ts +44 -0
- package/src/command/PolicyGetCommand.ts +44 -0
- package/src/command/PolicyGetIncomingCommand.ts +44 -0
- package/src/command/PolicyListCommand.ts +44 -0
- package/src/command/PolicyListIncomingCommand.ts +44 -0
- package/src/command/PolicyUpdateCommand.ts +100 -0
- package/src/command/RoleCommand.ts +44 -0
- package/src/command/RoleCreateCommand.ts +64 -0
- package/src/command/RoleDeleteCommand.ts +44 -0
- package/src/command/RoleGetCommand.ts +44 -0
- package/src/command/RoleGetIncomingCommand.ts +44 -0
- package/src/command/RoleListCommand.ts +44 -0
- package/src/command/RoleListIncomingCommand.ts +44 -0
- package/src/command/RoleUpdateCommand.ts +64 -0
- package/src/command/cli.ts +37 -0
- package/src/index.ts +60 -0
- package/src/row/PermissionInputRow.ts +27 -0
- package/src/row/PermissionRow.ts +29 -0
- package/src/row/PoleRow.ts +27 -0
- package/src/row/PolicyInputRow.ts +29 -0
- package/src/row/PolicyRow.ts +31 -0
- package/src/row/RoleInputRow.ts +25 -0
- package/tsconfig.json +42 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/****************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* This is an Auto-Generated File */
|
|
4
|
+
/* Made By */
|
|
5
|
+
/* Namirasoft SDK Generator NPM Package */
|
|
6
|
+
/* */
|
|
7
|
+
/****************************************************************/
|
|
8
|
+
/****************************************************************/
|
|
9
|
+
/* */
|
|
10
|
+
/* Please do not make any change to this file */
|
|
11
|
+
/* If any changed is reqired, ns-sdkg command must be used */
|
|
12
|
+
/* */
|
|
13
|
+
/****************************************************************/
|
|
14
|
+
/****************************************************************/
|
|
15
|
+
/* */
|
|
16
|
+
/* Namira Software Corporation */
|
|
17
|
+
/* https://namirasoft.com */
|
|
18
|
+
/* */
|
|
19
|
+
/****************************************************************/
|
|
20
|
+
|
|
21
|
+
import { FilterItem } from "namirasoft-core";
|
|
22
|
+
import { NamirasoftAccessServerBase } from "./NamirasoftAccessServerBase";
|
|
23
|
+
import { PolicyInputRow } from "./row/PolicyInputRow";
|
|
24
|
+
import { PolicyRow } from "./row/PolicyRow";
|
|
25
|
+
|
|
26
|
+
export class NamirasoftAccessServerPolicy extends NamirasoftAccessServerBase
|
|
27
|
+
{
|
|
28
|
+
async List(filters: FilterItem[] | null, page: (number | null), size: (number | null)): Promise<{ rows: PolicyRow[], count: (number | null) }>
|
|
29
|
+
{
|
|
30
|
+
let filters_string_value: string = FilterItem.stringify(filters);
|
|
31
|
+
let path = `/policy/list`;
|
|
32
|
+
let { data } = await this._get<{ rows: PolicyRow[], count: (number | null) }>(path, { filters: filters_string_value, page, size });
|
|
33
|
+
return data;
|
|
34
|
+
}
|
|
35
|
+
async ListIncoming(filters: FilterItem[] | null, page: (number | null), size: (number | null)): Promise<{ rows: PolicyRow[], count: (number | null) }>
|
|
36
|
+
{
|
|
37
|
+
let filters_string_value: string = FilterItem.stringify(filters);
|
|
38
|
+
let path = `/policy/incoming/list`;
|
|
39
|
+
let { data } = await this._get<{ rows: PolicyRow[], count: (number | null) }>(path, { filters: filters_string_value, page, size });
|
|
40
|
+
return data;
|
|
41
|
+
}
|
|
42
|
+
async Get(id: string): Promise<PolicyRow>
|
|
43
|
+
{
|
|
44
|
+
let path = `/policy/${id}`;
|
|
45
|
+
let { data } = await this._get<PolicyRow>(path, {});
|
|
46
|
+
return data;
|
|
47
|
+
}
|
|
48
|
+
async GetIncoming(id: string): Promise<PolicyRow>
|
|
49
|
+
{
|
|
50
|
+
let path = `/policy/incoming/${id}`;
|
|
51
|
+
let { data } = await this._get<PolicyRow>(path, {});
|
|
52
|
+
return data;
|
|
53
|
+
}
|
|
54
|
+
async Create(body: PolicyInputRow): Promise<PolicyRow>
|
|
55
|
+
{
|
|
56
|
+
let path = `/policy`;
|
|
57
|
+
let { data } = await this._post<PolicyRow>(path, {}, body);
|
|
58
|
+
return data;
|
|
59
|
+
}
|
|
60
|
+
async Update(id: string, body: PolicyInputRow): Promise<PolicyRow>
|
|
61
|
+
{
|
|
62
|
+
let path = `/policy/${id}`;
|
|
63
|
+
let { data } = await this._put<PolicyRow>(path, {}, body);
|
|
64
|
+
return data;
|
|
65
|
+
}
|
|
66
|
+
async Delete(id: string): Promise<void>
|
|
67
|
+
{
|
|
68
|
+
let path = `/policy/${id}`;
|
|
69
|
+
await this._delete<void>(path, {});
|
|
70
|
+
}
|
|
71
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/****************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* This is an Auto-Generated File */
|
|
4
|
+
/* Made By */
|
|
5
|
+
/* Namirasoft SDK Generator NPM Package */
|
|
6
|
+
/* */
|
|
7
|
+
/****************************************************************/
|
|
8
|
+
/****************************************************************/
|
|
9
|
+
/* */
|
|
10
|
+
/* Please do not make any change to this file */
|
|
11
|
+
/* If any changed is reqired, ns-sdkg command must be used */
|
|
12
|
+
/* */
|
|
13
|
+
/****************************************************************/
|
|
14
|
+
/****************************************************************/
|
|
15
|
+
/* */
|
|
16
|
+
/* Namira Software Corporation */
|
|
17
|
+
/* https://namirasoft.com */
|
|
18
|
+
/* */
|
|
19
|
+
/****************************************************************/
|
|
20
|
+
|
|
21
|
+
import { FilterItem } from "namirasoft-core";
|
|
22
|
+
import { NamirasoftAccessServerBase } from "./NamirasoftAccessServerBase";
|
|
23
|
+
import { PoleRow } from "./row/PoleRow";
|
|
24
|
+
import { RoleInputRow } from "./row/RoleInputRow";
|
|
25
|
+
|
|
26
|
+
export class NamirasoftAccessServerRole extends NamirasoftAccessServerBase
|
|
27
|
+
{
|
|
28
|
+
async List(filters: FilterItem[] | null, page: (number | null), size: (number | null)): Promise<{ rows: PoleRow[], count: (number | null) }>
|
|
29
|
+
{
|
|
30
|
+
let filters_string_value: string = FilterItem.stringify(filters);
|
|
31
|
+
let path = `/role/list`;
|
|
32
|
+
let { data } = await this._get<{ rows: PoleRow[], count: (number | null) }>(path, { filters: filters_string_value, page, size });
|
|
33
|
+
return data;
|
|
34
|
+
}
|
|
35
|
+
async ListIncoming(filters: FilterItem[] | null, page: (number | null), size: (number | null)): Promise<{ rows: PoleRow[], count: (number | null) }>
|
|
36
|
+
{
|
|
37
|
+
let filters_string_value: string = FilterItem.stringify(filters);
|
|
38
|
+
let path = `/role/incoming/list`;
|
|
39
|
+
let { data } = await this._get<{ rows: PoleRow[], count: (number | null) }>(path, { filters: filters_string_value, page, size });
|
|
40
|
+
return data;
|
|
41
|
+
}
|
|
42
|
+
async Get(id: string): Promise<PoleRow>
|
|
43
|
+
{
|
|
44
|
+
let path = `/role/${id}`;
|
|
45
|
+
let { data } = await this._get<PoleRow>(path, {});
|
|
46
|
+
return data;
|
|
47
|
+
}
|
|
48
|
+
async GetIncoming(id: string): Promise<PoleRow>
|
|
49
|
+
{
|
|
50
|
+
let path = `/role/incoming/${id}`;
|
|
51
|
+
let { data } = await this._get<PoleRow>(path, {});
|
|
52
|
+
return data;
|
|
53
|
+
}
|
|
54
|
+
async Create(body: RoleInputRow): Promise<PoleRow>
|
|
55
|
+
{
|
|
56
|
+
let path = `/role`;
|
|
57
|
+
let { data } = await this._post<PoleRow>(path, {}, body);
|
|
58
|
+
return data;
|
|
59
|
+
}
|
|
60
|
+
async Update(id: string, body: RoleInputRow): Promise<PoleRow>
|
|
61
|
+
{
|
|
62
|
+
let path = `/role/${id}`;
|
|
63
|
+
let { data } = await this._put<PoleRow>(path, {}, body);
|
|
64
|
+
return data;
|
|
65
|
+
}
|
|
66
|
+
async Delete(id: string): Promise<void>
|
|
67
|
+
{
|
|
68
|
+
let path = `/role/${id}`;
|
|
69
|
+
await this._delete<void>(path, {});
|
|
70
|
+
}
|
|
71
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/****************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* This is an Auto-Generated File */
|
|
4
|
+
/* Made By */
|
|
5
|
+
/* Namirasoft SDK Generator NPM Package */
|
|
6
|
+
/* */
|
|
7
|
+
/****************************************************************/
|
|
8
|
+
/****************************************************************/
|
|
9
|
+
/* */
|
|
10
|
+
/* Please do not make any change to this file */
|
|
11
|
+
/* If any changed is reqired, ns-sdkg command must be used */
|
|
12
|
+
/* */
|
|
13
|
+
/****************************************************************/
|
|
14
|
+
/****************************************************************/
|
|
15
|
+
/* */
|
|
16
|
+
/* Namira Software Corporation */
|
|
17
|
+
/* https://namirasoft.com */
|
|
18
|
+
/* */
|
|
19
|
+
/****************************************************************/
|
|
20
|
+
|
|
21
|
+
import { BaseNavigatorCommand } from "namirasoft-node-cli";
|
|
22
|
+
import { HealthzGetCommand } from "./HealthzGetCommand";
|
|
23
|
+
|
|
24
|
+
export class HealthzCommand extends BaseNavigatorCommand
|
|
25
|
+
{
|
|
26
|
+
constructor(argv: string[])
|
|
27
|
+
{
|
|
28
|
+
super(argv, {
|
|
29
|
+
"get": HealthzGetCommand,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/****************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* This is an Auto-Generated File */
|
|
4
|
+
/* Made By */
|
|
5
|
+
/* Namirasoft SDK Generator NPM Package */
|
|
6
|
+
/* */
|
|
7
|
+
/****************************************************************/
|
|
8
|
+
/****************************************************************/
|
|
9
|
+
/* */
|
|
10
|
+
/* Please do not make any change to this file */
|
|
11
|
+
/* If any changed is reqired, ns-sdkg command must be used */
|
|
12
|
+
/* */
|
|
13
|
+
/****************************************************************/
|
|
14
|
+
/****************************************************************/
|
|
15
|
+
/* */
|
|
16
|
+
/* Namira Software Corporation */
|
|
17
|
+
/* https://namirasoft.com */
|
|
18
|
+
/* */
|
|
19
|
+
/****************************************************************/
|
|
20
|
+
|
|
21
|
+
import { BaseFinalCommand } from "namirasoft-node-cli";
|
|
22
|
+
import { IStorageMemory } from "namirasoft-core";
|
|
23
|
+
import { NamirasoftAccessServer } from "../NamirasoftAccessServer";
|
|
24
|
+
import { TokenManager } from "namirasoft-account";
|
|
25
|
+
|
|
26
|
+
export class HealthzGetCommand extends BaseFinalCommand
|
|
27
|
+
{
|
|
28
|
+
constructor(argv: string[])
|
|
29
|
+
{
|
|
30
|
+
super(argv, [], []);
|
|
31
|
+
}
|
|
32
|
+
override async exec()
|
|
33
|
+
{
|
|
34
|
+
let token = this.app.storage.getNSAToken();
|
|
35
|
+
if (token == null)
|
|
36
|
+
throw new Error("Token is not available. Please login first using:\nns-access account config \nor \n{this.command} account login.");
|
|
37
|
+
let storage = new IStorageMemory();
|
|
38
|
+
let manager = new TokenManager(storage, () => { });
|
|
39
|
+
manager.setValue(token, false);
|
|
40
|
+
let server = new NamirasoftAccessServer(manager, e => this.app.logger.error(e.message));
|
|
41
|
+
let ans = await server.healthz.Get();
|
|
42
|
+
this.app.logger.success(JSON.stringify(ans));
|
|
43
|
+
}
|
|
44
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/****************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* This is an Auto-Generated File */
|
|
4
|
+
/* Made By */
|
|
5
|
+
/* Namirasoft SDK Generator NPM Package */
|
|
6
|
+
/* */
|
|
7
|
+
/****************************************************************/
|
|
8
|
+
/****************************************************************/
|
|
9
|
+
/* */
|
|
10
|
+
/* Please do not make any change to this file */
|
|
11
|
+
/* If any changed is reqired, ns-sdkg command must be used */
|
|
12
|
+
/* */
|
|
13
|
+
/****************************************************************/
|
|
14
|
+
/****************************************************************/
|
|
15
|
+
/* */
|
|
16
|
+
/* Namira Software Corporation */
|
|
17
|
+
/* https://namirasoft.com */
|
|
18
|
+
/* */
|
|
19
|
+
/****************************************************************/
|
|
20
|
+
|
|
21
|
+
import { BaseNavigatorCommand } from "namirasoft-node-cli";
|
|
22
|
+
import { PermissionCreateCommand } from "./PermissionCreateCommand";
|
|
23
|
+
import { PermissionDeleteCommand } from "./PermissionDeleteCommand";
|
|
24
|
+
import { PermissionGetCommand } from "./PermissionGetCommand";
|
|
25
|
+
import { PermissionGetIncomingCommand } from "./PermissionGetIncomingCommand";
|
|
26
|
+
import { PermissionGetOutgoingCommand } from "./PermissionGetOutgoingCommand";
|
|
27
|
+
import { PermissionListCommand } from "./PermissionListCommand";
|
|
28
|
+
import { PermissionListIncomingCommand } from "./PermissionListIncomingCommand";
|
|
29
|
+
import { PermissionListOutgoingCommand } from "./PermissionListOutgoingCommand";
|
|
30
|
+
import { PermissionUpdateCommand } from "./PermissionUpdateCommand";
|
|
31
|
+
|
|
32
|
+
export class PermissionCommand extends BaseNavigatorCommand
|
|
33
|
+
{
|
|
34
|
+
constructor(argv: string[])
|
|
35
|
+
{
|
|
36
|
+
super(argv, {
|
|
37
|
+
"list": PermissionListCommand,
|
|
38
|
+
"listoutgoing": PermissionListOutgoingCommand,
|
|
39
|
+
"listincoming": PermissionListIncomingCommand,
|
|
40
|
+
"get": PermissionGetCommand,
|
|
41
|
+
"getincoming": PermissionGetIncomingCommand,
|
|
42
|
+
"getoutgoing": PermissionGetOutgoingCommand,
|
|
43
|
+
"create": PermissionCreateCommand,
|
|
44
|
+
"update": PermissionUpdateCommand,
|
|
45
|
+
"delete": PermissionDeleteCommand,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/****************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* This is an Auto-Generated File */
|
|
4
|
+
/* Made By */
|
|
5
|
+
/* Namirasoft SDK Generator NPM Package */
|
|
6
|
+
/* */
|
|
7
|
+
/****************************************************************/
|
|
8
|
+
/****************************************************************/
|
|
9
|
+
/* */
|
|
10
|
+
/* Please do not make any change to this file */
|
|
11
|
+
/* If any changed is reqired, ns-sdkg command must be used */
|
|
12
|
+
/* */
|
|
13
|
+
/****************************************************************/
|
|
14
|
+
/****************************************************************/
|
|
15
|
+
/* */
|
|
16
|
+
/* Namira Software Corporation */
|
|
17
|
+
/* https://namirasoft.com */
|
|
18
|
+
/* */
|
|
19
|
+
/****************************************************************/
|
|
20
|
+
|
|
21
|
+
import { BaseFinalCommand } from "namirasoft-node-cli";
|
|
22
|
+
import { IStorageMemory } from "namirasoft-core";
|
|
23
|
+
import { NamirasoftAccessServer } from "../NamirasoftAccessServer";
|
|
24
|
+
import { TokenManager } from "namirasoft-account";
|
|
25
|
+
|
|
26
|
+
export class PermissionCreateCommand extends BaseFinalCommand
|
|
27
|
+
{
|
|
28
|
+
constructor(argv: string[])
|
|
29
|
+
{
|
|
30
|
+
super(argv, [], [
|
|
31
|
+
{
|
|
32
|
+
name: "to_user_id",
|
|
33
|
+
short: "",
|
|
34
|
+
description: "Provides the value of 'to_user_id' in body",
|
|
35
|
+
optional: false,
|
|
36
|
+
args: ["to_user_id"],
|
|
37
|
+
defaults: [""]
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: "firstName",
|
|
41
|
+
short: "",
|
|
42
|
+
description: "Provides the value of 'firstName' in body",
|
|
43
|
+
optional: false,
|
|
44
|
+
args: ["firstName"],
|
|
45
|
+
defaults: [""]
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: "lastName",
|
|
49
|
+
short: "",
|
|
50
|
+
description: "Provides the value of 'lastName' in body",
|
|
51
|
+
optional: false,
|
|
52
|
+
args: ["lastName"],
|
|
53
|
+
defaults: [""]
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: "email",
|
|
57
|
+
short: "",
|
|
58
|
+
description: "Provides the value of 'email' in body",
|
|
59
|
+
optional: false,
|
|
60
|
+
args: ["email"],
|
|
61
|
+
defaults: [""]
|
|
62
|
+
}
|
|
63
|
+
]);
|
|
64
|
+
}
|
|
65
|
+
override async exec()
|
|
66
|
+
{
|
|
67
|
+
let token = this.app.storage.getNSAToken();
|
|
68
|
+
if (token == null)
|
|
69
|
+
throw new Error("Token is not available. Please login first using:\nns-access account config \nor \n{this.command} account login.");
|
|
70
|
+
let storage = new IStorageMemory();
|
|
71
|
+
let manager = new TokenManager(storage, () => { });
|
|
72
|
+
manager.setValue(token, false);
|
|
73
|
+
let server = new NamirasoftAccessServer(manager, e => this.app.logger.error(e.message));
|
|
74
|
+
let ans = await server.permission.Create({
|
|
75
|
+
to_user_id: this.option_values.to_user_id,
|
|
76
|
+
firstName: this.option_values.firstName,
|
|
77
|
+
lastName: this.option_values.lastName,
|
|
78
|
+
email: this.option_values.email
|
|
79
|
+
});
|
|
80
|
+
this.app.logger.success(JSON.stringify(ans));
|
|
81
|
+
}
|
|
82
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/****************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* This is an Auto-Generated File */
|
|
4
|
+
/* Made By */
|
|
5
|
+
/* Namirasoft SDK Generator NPM Package */
|
|
6
|
+
/* */
|
|
7
|
+
/****************************************************************/
|
|
8
|
+
/****************************************************************/
|
|
9
|
+
/* */
|
|
10
|
+
/* Please do not make any change to this file */
|
|
11
|
+
/* If any changed is reqired, ns-sdkg command must be used */
|
|
12
|
+
/* */
|
|
13
|
+
/****************************************************************/
|
|
14
|
+
/****************************************************************/
|
|
15
|
+
/* */
|
|
16
|
+
/* Namira Software Corporation */
|
|
17
|
+
/* https://namirasoft.com */
|
|
18
|
+
/* */
|
|
19
|
+
/****************************************************************/
|
|
20
|
+
|
|
21
|
+
import { BaseFinalCommand } from "namirasoft-node-cli";
|
|
22
|
+
import { IStorageMemory } from "namirasoft-core";
|
|
23
|
+
import { NamirasoftAccessServer } from "../NamirasoftAccessServer";
|
|
24
|
+
import { TokenManager } from "namirasoft-account";
|
|
25
|
+
|
|
26
|
+
export class PermissionDeleteCommand extends BaseFinalCommand
|
|
27
|
+
{
|
|
28
|
+
constructor(argv: string[])
|
|
29
|
+
{
|
|
30
|
+
super(argv, ["id"], []);
|
|
31
|
+
}
|
|
32
|
+
override async exec()
|
|
33
|
+
{
|
|
34
|
+
let token = this.app.storage.getNSAToken();
|
|
35
|
+
if (token == null)
|
|
36
|
+
throw new Error("Token is not available. Please login first using:\nns-access account config \nor \n{this.command} account login.");
|
|
37
|
+
let storage = new IStorageMemory();
|
|
38
|
+
let manager = new TokenManager(storage, () => { });
|
|
39
|
+
manager.setValue(token, false);
|
|
40
|
+
let server = new NamirasoftAccessServer(manager, e => this.app.logger.error(e.message));
|
|
41
|
+
let ans = await server.permission.Delete(this.arg_values[0]);
|
|
42
|
+
this.app.logger.success(JSON.stringify(ans));
|
|
43
|
+
}
|
|
44
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/****************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* This is an Auto-Generated File */
|
|
4
|
+
/* Made By */
|
|
5
|
+
/* Namirasoft SDK Generator NPM Package */
|
|
6
|
+
/* */
|
|
7
|
+
/****************************************************************/
|
|
8
|
+
/****************************************************************/
|
|
9
|
+
/* */
|
|
10
|
+
/* Please do not make any change to this file */
|
|
11
|
+
/* If any changed is reqired, ns-sdkg command must be used */
|
|
12
|
+
/* */
|
|
13
|
+
/****************************************************************/
|
|
14
|
+
/****************************************************************/
|
|
15
|
+
/* */
|
|
16
|
+
/* Namira Software Corporation */
|
|
17
|
+
/* https://namirasoft.com */
|
|
18
|
+
/* */
|
|
19
|
+
/****************************************************************/
|
|
20
|
+
|
|
21
|
+
import { BaseFinalCommand } from "namirasoft-node-cli";
|
|
22
|
+
import { IStorageMemory } from "namirasoft-core";
|
|
23
|
+
import { NamirasoftAccessServer } from "../NamirasoftAccessServer";
|
|
24
|
+
import { TokenManager } from "namirasoft-account";
|
|
25
|
+
|
|
26
|
+
export class PermissionGetCommand extends BaseFinalCommand
|
|
27
|
+
{
|
|
28
|
+
constructor(argv: string[])
|
|
29
|
+
{
|
|
30
|
+
super(argv, ["id"], []);
|
|
31
|
+
}
|
|
32
|
+
override async exec()
|
|
33
|
+
{
|
|
34
|
+
let token = this.app.storage.getNSAToken();
|
|
35
|
+
if (token == null)
|
|
36
|
+
throw new Error("Token is not available. Please login first using:\nns-access account config \nor \n{this.command} account login.");
|
|
37
|
+
let storage = new IStorageMemory();
|
|
38
|
+
let manager = new TokenManager(storage, () => { });
|
|
39
|
+
manager.setValue(token, false);
|
|
40
|
+
let server = new NamirasoftAccessServer(manager, e => this.app.logger.error(e.message));
|
|
41
|
+
let ans = await server.permission.Get(this.arg_values[0]);
|
|
42
|
+
this.app.logger.success(JSON.stringify(ans));
|
|
43
|
+
}
|
|
44
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/****************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* This is an Auto-Generated File */
|
|
4
|
+
/* Made By */
|
|
5
|
+
/* Namirasoft SDK Generator NPM Package */
|
|
6
|
+
/* */
|
|
7
|
+
/****************************************************************/
|
|
8
|
+
/****************************************************************/
|
|
9
|
+
/* */
|
|
10
|
+
/* Please do not make any change to this file */
|
|
11
|
+
/* If any changed is reqired, ns-sdkg command must be used */
|
|
12
|
+
/* */
|
|
13
|
+
/****************************************************************/
|
|
14
|
+
/****************************************************************/
|
|
15
|
+
/* */
|
|
16
|
+
/* Namira Software Corporation */
|
|
17
|
+
/* https://namirasoft.com */
|
|
18
|
+
/* */
|
|
19
|
+
/****************************************************************/
|
|
20
|
+
|
|
21
|
+
import { BaseFinalCommand } from "namirasoft-node-cli";
|
|
22
|
+
import { IStorageMemory } from "namirasoft-core";
|
|
23
|
+
import { NamirasoftAccessServer } from "../NamirasoftAccessServer";
|
|
24
|
+
import { TokenManager } from "namirasoft-account";
|
|
25
|
+
|
|
26
|
+
export class PermissionGetIncomingCommand extends BaseFinalCommand
|
|
27
|
+
{
|
|
28
|
+
constructor(argv: string[])
|
|
29
|
+
{
|
|
30
|
+
super(argv, ["id"], []);
|
|
31
|
+
}
|
|
32
|
+
override async exec()
|
|
33
|
+
{
|
|
34
|
+
let token = this.app.storage.getNSAToken();
|
|
35
|
+
if (token == null)
|
|
36
|
+
throw new Error("Token is not available. Please login first using:\nns-access account config \nor \n{this.command} account login.");
|
|
37
|
+
let storage = new IStorageMemory();
|
|
38
|
+
let manager = new TokenManager(storage, () => { });
|
|
39
|
+
manager.setValue(token, false);
|
|
40
|
+
let server = new NamirasoftAccessServer(manager, e => this.app.logger.error(e.message));
|
|
41
|
+
let ans = await server.permission.GetIncoming(this.arg_values[0]);
|
|
42
|
+
this.app.logger.success(JSON.stringify(ans));
|
|
43
|
+
}
|
|
44
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/****************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* This is an Auto-Generated File */
|
|
4
|
+
/* Made By */
|
|
5
|
+
/* Namirasoft SDK Generator NPM Package */
|
|
6
|
+
/* */
|
|
7
|
+
/****************************************************************/
|
|
8
|
+
/****************************************************************/
|
|
9
|
+
/* */
|
|
10
|
+
/* Please do not make any change to this file */
|
|
11
|
+
/* If any changed is reqired, ns-sdkg command must be used */
|
|
12
|
+
/* */
|
|
13
|
+
/****************************************************************/
|
|
14
|
+
/****************************************************************/
|
|
15
|
+
/* */
|
|
16
|
+
/* Namira Software Corporation */
|
|
17
|
+
/* https://namirasoft.com */
|
|
18
|
+
/* */
|
|
19
|
+
/****************************************************************/
|
|
20
|
+
|
|
21
|
+
import { BaseFinalCommand } from "namirasoft-node-cli";
|
|
22
|
+
import { IStorageMemory } from "namirasoft-core";
|
|
23
|
+
import { NamirasoftAccessServer } from "../NamirasoftAccessServer";
|
|
24
|
+
import { TokenManager } from "namirasoft-account";
|
|
25
|
+
|
|
26
|
+
export class PermissionGetOutgoingCommand extends BaseFinalCommand
|
|
27
|
+
{
|
|
28
|
+
constructor(argv: string[])
|
|
29
|
+
{
|
|
30
|
+
super(argv, ["id"], []);
|
|
31
|
+
}
|
|
32
|
+
override async exec()
|
|
33
|
+
{
|
|
34
|
+
let token = this.app.storage.getNSAToken();
|
|
35
|
+
if (token == null)
|
|
36
|
+
throw new Error("Token is not available. Please login first using:\nns-access account config \nor \n{this.command} account login.");
|
|
37
|
+
let storage = new IStorageMemory();
|
|
38
|
+
let manager = new TokenManager(storage, () => { });
|
|
39
|
+
manager.setValue(token, false);
|
|
40
|
+
let server = new NamirasoftAccessServer(manager, e => this.app.logger.error(e.message));
|
|
41
|
+
let ans = await server.permission.GetOutgoing(this.arg_values[0]);
|
|
42
|
+
this.app.logger.success(JSON.stringify(ans));
|
|
43
|
+
}
|
|
44
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/****************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* This is an Auto-Generated File */
|
|
4
|
+
/* Made By */
|
|
5
|
+
/* Namirasoft SDK Generator NPM Package */
|
|
6
|
+
/* */
|
|
7
|
+
/****************************************************************/
|
|
8
|
+
/****************************************************************/
|
|
9
|
+
/* */
|
|
10
|
+
/* Please do not make any change to this file */
|
|
11
|
+
/* If any changed is reqired, ns-sdkg command must be used */
|
|
12
|
+
/* */
|
|
13
|
+
/****************************************************************/
|
|
14
|
+
/****************************************************************/
|
|
15
|
+
/* */
|
|
16
|
+
/* Namira Software Corporation */
|
|
17
|
+
/* https://namirasoft.com */
|
|
18
|
+
/* */
|
|
19
|
+
/****************************************************************/
|
|
20
|
+
|
|
21
|
+
import { BaseFinalCommand } from "namirasoft-node-cli";
|
|
22
|
+
import { IStorageMemory } from "namirasoft-core";
|
|
23
|
+
import { NamirasoftAccessServer } from "../NamirasoftAccessServer";
|
|
24
|
+
import { TokenManager } from "namirasoft-account";
|
|
25
|
+
|
|
26
|
+
export class PermissionListCommand extends BaseFinalCommand
|
|
27
|
+
{
|
|
28
|
+
constructor(argv: string[])
|
|
29
|
+
{
|
|
30
|
+
super(argv, ["filters", "page", "size"], []);
|
|
31
|
+
}
|
|
32
|
+
override async exec()
|
|
33
|
+
{
|
|
34
|
+
let token = this.app.storage.getNSAToken();
|
|
35
|
+
if (token == null)
|
|
36
|
+
throw new Error("Token is not available. Please login first using:\nns-access account config \nor \n{this.command} account login.");
|
|
37
|
+
let storage = new IStorageMemory();
|
|
38
|
+
let manager = new TokenManager(storage, () => { });
|
|
39
|
+
manager.setValue(token, false);
|
|
40
|
+
let server = new NamirasoftAccessServer(manager, e => this.app.logger.error(e.message));
|
|
41
|
+
let ans = await server.permission.List(this.arg_values[0], this.arg_values[1], this.arg_values[2]);
|
|
42
|
+
this.app.logger.success(JSON.stringify(ans));
|
|
43
|
+
}
|
|
44
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/****************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* This is an Auto-Generated File */
|
|
4
|
+
/* Made By */
|
|
5
|
+
/* Namirasoft SDK Generator NPM Package */
|
|
6
|
+
/* */
|
|
7
|
+
/****************************************************************/
|
|
8
|
+
/****************************************************************/
|
|
9
|
+
/* */
|
|
10
|
+
/* Please do not make any change to this file */
|
|
11
|
+
/* If any changed is reqired, ns-sdkg command must be used */
|
|
12
|
+
/* */
|
|
13
|
+
/****************************************************************/
|
|
14
|
+
/****************************************************************/
|
|
15
|
+
/* */
|
|
16
|
+
/* Namira Software Corporation */
|
|
17
|
+
/* https://namirasoft.com */
|
|
18
|
+
/* */
|
|
19
|
+
/****************************************************************/
|
|
20
|
+
|
|
21
|
+
import { BaseFinalCommand } from "namirasoft-node-cli";
|
|
22
|
+
import { IStorageMemory } from "namirasoft-core";
|
|
23
|
+
import { NamirasoftAccessServer } from "../NamirasoftAccessServer";
|
|
24
|
+
import { TokenManager } from "namirasoft-account";
|
|
25
|
+
|
|
26
|
+
export class PermissionListIncomingCommand extends BaseFinalCommand
|
|
27
|
+
{
|
|
28
|
+
constructor(argv: string[])
|
|
29
|
+
{
|
|
30
|
+
super(argv, ["filters", "page", "size"], []);
|
|
31
|
+
}
|
|
32
|
+
override async exec()
|
|
33
|
+
{
|
|
34
|
+
let token = this.app.storage.getNSAToken();
|
|
35
|
+
if (token == null)
|
|
36
|
+
throw new Error("Token is not available. Please login first using:\nns-access account config \nor \n{this.command} account login.");
|
|
37
|
+
let storage = new IStorageMemory();
|
|
38
|
+
let manager = new TokenManager(storage, () => { });
|
|
39
|
+
manager.setValue(token, false);
|
|
40
|
+
let server = new NamirasoftAccessServer(manager, e => this.app.logger.error(e.message));
|
|
41
|
+
let ans = await server.permission.ListIncoming(this.arg_values[0], this.arg_values[1], this.arg_values[2]);
|
|
42
|
+
this.app.logger.success(JSON.stringify(ans));
|
|
43
|
+
}
|
|
44
|
+
};
|