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,64 @@
|
|
|
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 RoleCreateCommand extends BaseFinalCommand
|
|
27
|
+
{
|
|
28
|
+
constructor(argv: string[])
|
|
29
|
+
{
|
|
30
|
+
super(argv, [], [
|
|
31
|
+
{
|
|
32
|
+
name: "name",
|
|
33
|
+
short: "",
|
|
34
|
+
description: "Provides the value of 'name' in body",
|
|
35
|
+
optional: false,
|
|
36
|
+
args: ["name"],
|
|
37
|
+
defaults: [""]
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: "description",
|
|
41
|
+
short: "",
|
|
42
|
+
description: "Provides the value of 'description' in body",
|
|
43
|
+
optional: false,
|
|
44
|
+
args: ["description"],
|
|
45
|
+
defaults: [""]
|
|
46
|
+
}
|
|
47
|
+
]);
|
|
48
|
+
}
|
|
49
|
+
override async exec()
|
|
50
|
+
{
|
|
51
|
+
let token = this.app.storage.getNSAToken();
|
|
52
|
+
if (token == null)
|
|
53
|
+
throw new Error("Token is not available. Please login first using:\nns-access account config \nor \n{this.command} account login.");
|
|
54
|
+
let storage = new IStorageMemory();
|
|
55
|
+
let manager = new TokenManager(storage, () => { });
|
|
56
|
+
manager.setValue(token, false);
|
|
57
|
+
let server = new NamirasoftAccessServer(manager, e => this.app.logger.error(e.message));
|
|
58
|
+
let ans = await server.role.Create({
|
|
59
|
+
name: this.option_values.name,
|
|
60
|
+
description: this.option_values.description
|
|
61
|
+
});
|
|
62
|
+
this.app.logger.success(JSON.stringify(ans));
|
|
63
|
+
}
|
|
64
|
+
};
|
|
@@ -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 RoleDeleteCommand 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.role.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 RoleGetCommand 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.role.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 RoleGetIncomingCommand 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.role.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 RoleListCommand 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.role.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 RoleListIncomingCommand 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.role.ListIncoming(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,64 @@
|
|
|
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 RoleUpdateCommand extends BaseFinalCommand
|
|
27
|
+
{
|
|
28
|
+
constructor(argv: string[])
|
|
29
|
+
{
|
|
30
|
+
super(argv, ["id"], [
|
|
31
|
+
{
|
|
32
|
+
name: "name",
|
|
33
|
+
short: "",
|
|
34
|
+
description: "Provides the value of 'name' in body",
|
|
35
|
+
optional: false,
|
|
36
|
+
args: ["name"],
|
|
37
|
+
defaults: [""]
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: "description",
|
|
41
|
+
short: "",
|
|
42
|
+
description: "Provides the value of 'description' in body",
|
|
43
|
+
optional: false,
|
|
44
|
+
args: ["description"],
|
|
45
|
+
defaults: [""]
|
|
46
|
+
}
|
|
47
|
+
]);
|
|
48
|
+
}
|
|
49
|
+
override async exec()
|
|
50
|
+
{
|
|
51
|
+
let token = this.app.storage.getNSAToken();
|
|
52
|
+
if (token == null)
|
|
53
|
+
throw new Error("Token is not available. Please login first using:\nns-access account config \nor \n{this.command} account login.");
|
|
54
|
+
let storage = new IStorageMemory();
|
|
55
|
+
let manager = new TokenManager(storage, () => { });
|
|
56
|
+
manager.setValue(token, false);
|
|
57
|
+
let server = new NamirasoftAccessServer(manager, e => this.app.logger.error(e.message));
|
|
58
|
+
let ans = await server.role.Update(this.arg_values[0], {
|
|
59
|
+
name: this.option_values.name,
|
|
60
|
+
description: this.option_values.description
|
|
61
|
+
});
|
|
62
|
+
this.app.logger.success(JSON.stringify(ans));
|
|
63
|
+
}
|
|
64
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/****************************************************************/
|
|
3
|
+
/* */
|
|
4
|
+
/* This is an Auto-Generated File */
|
|
5
|
+
/* Made By */
|
|
6
|
+
/* Namirasoft SDK Generator NPM Package */
|
|
7
|
+
/* */
|
|
8
|
+
/****************************************************************/
|
|
9
|
+
/****************************************************************/
|
|
10
|
+
/* */
|
|
11
|
+
/* Please do not make any change to this file */
|
|
12
|
+
/* If any changed is reqired, ns-sdkg command must be used */
|
|
13
|
+
/* */
|
|
14
|
+
/****************************************************************/
|
|
15
|
+
/****************************************************************/
|
|
16
|
+
/* */
|
|
17
|
+
/* Namira Software Corporation */
|
|
18
|
+
/* https://namirasoft.com */
|
|
19
|
+
/* */
|
|
20
|
+
/****************************************************************/
|
|
21
|
+
|
|
22
|
+
import { AccountCommand } from "namirasoft-account";
|
|
23
|
+
import { Application, BaseStorage } from "namirasoft-node-cli";
|
|
24
|
+
import { HealthzCommand } from "./HealthzCommand";
|
|
25
|
+
import { PermissionCommand } from "./PermissionCommand";
|
|
26
|
+
import { PolicyCommand } from "./PolicyCommand";
|
|
27
|
+
import { RoleCommand } from "./RoleCommand";
|
|
28
|
+
|
|
29
|
+
let app = new Application("ns-access", new BaseStorage(),
|
|
30
|
+
{
|
|
31
|
+
"healthz": HealthzCommand,
|
|
32
|
+
"permission": PermissionCommand,
|
|
33
|
+
"policy": PolicyCommand,
|
|
34
|
+
"role": RoleCommand,
|
|
35
|
+
"account": AccountCommand
|
|
36
|
+
});
|
|
37
|
+
app.run();
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
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
|
+
export * from "./NamirasoftAccessServer";
|
|
22
|
+
export * from "./NamirasoftAccessServerBase";
|
|
23
|
+
export * from "./NamirasoftAccessServerHealthz";
|
|
24
|
+
export * from "./NamirasoftAccessServerPermission";
|
|
25
|
+
export * from "./NamirasoftAccessServerPolicy";
|
|
26
|
+
export * from "./NamirasoftAccessServerRole";
|
|
27
|
+
export * from "./command/HealthzCommand";
|
|
28
|
+
export * from "./command/HealthzGetCommand";
|
|
29
|
+
export * from "./command/PermissionCommand";
|
|
30
|
+
export * from "./command/PermissionCreateCommand";
|
|
31
|
+
export * from "./command/PermissionDeleteCommand";
|
|
32
|
+
export * from "./command/PermissionGetCommand";
|
|
33
|
+
export * from "./command/PermissionGetIncomingCommand";
|
|
34
|
+
export * from "./command/PermissionGetOutgoingCommand";
|
|
35
|
+
export * from "./command/PermissionListCommand";
|
|
36
|
+
export * from "./command/PermissionListIncomingCommand";
|
|
37
|
+
export * from "./command/PermissionListOutgoingCommand";
|
|
38
|
+
export * from "./command/PermissionUpdateCommand";
|
|
39
|
+
export * from "./command/PolicyCommand";
|
|
40
|
+
export * from "./command/PolicyCreateCommand";
|
|
41
|
+
export * from "./command/PolicyDeleteCommand";
|
|
42
|
+
export * from "./command/PolicyGetCommand";
|
|
43
|
+
export * from "./command/PolicyGetIncomingCommand";
|
|
44
|
+
export * from "./command/PolicyListCommand";
|
|
45
|
+
export * from "./command/PolicyListIncomingCommand";
|
|
46
|
+
export * from "./command/PolicyUpdateCommand";
|
|
47
|
+
export * from "./command/RoleCommand";
|
|
48
|
+
export * from "./command/RoleCreateCommand";
|
|
49
|
+
export * from "./command/RoleDeleteCommand";
|
|
50
|
+
export * from "./command/RoleGetCommand";
|
|
51
|
+
export * from "./command/RoleGetIncomingCommand";
|
|
52
|
+
export * from "./command/RoleListCommand";
|
|
53
|
+
export * from "./command/RoleListIncomingCommand";
|
|
54
|
+
export * from "./command/RoleUpdateCommand";
|
|
55
|
+
export * from "./row/PermissionInputRow";
|
|
56
|
+
export * from "./row/PermissionRow";
|
|
57
|
+
export * from "./row/PoleRow";
|
|
58
|
+
export * from "./row/PolicyInputRow";
|
|
59
|
+
export * from "./row/PolicyRow";
|
|
60
|
+
export * from "./row/RoleInputRow";
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
export type PermissionInputRow =
|
|
22
|
+
{
|
|
23
|
+
to_user_id: string;
|
|
24
|
+
firstName: string;
|
|
25
|
+
lastName: string;
|
|
26
|
+
email: string;
|
|
27
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
export type PermissionRow =
|
|
22
|
+
{
|
|
23
|
+
id: string;
|
|
24
|
+
user_id: string;
|
|
25
|
+
to_user_id: string;
|
|
26
|
+
firstName: string;
|
|
27
|
+
lastName: string;
|
|
28
|
+
email: string;
|
|
29
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
export type PoleRow =
|
|
22
|
+
{
|
|
23
|
+
id: string;
|
|
24
|
+
user_id: string;
|
|
25
|
+
name: string;
|
|
26
|
+
description: string;
|
|
27
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
export type PolicyInputRow =
|
|
22
|
+
{
|
|
23
|
+
product_id: (string | null);
|
|
24
|
+
name: (string | null);
|
|
25
|
+
actions: string;
|
|
26
|
+
entity_ids: string;
|
|
27
|
+
allow: boolean;
|
|
28
|
+
description: string;
|
|
29
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
export type PolicyRow =
|
|
22
|
+
{
|
|
23
|
+
id: string;
|
|
24
|
+
user_id: string;
|
|
25
|
+
product_id: (string | null);
|
|
26
|
+
name: (string | null);
|
|
27
|
+
actions: string;
|
|
28
|
+
entity_ids: string;
|
|
29
|
+
allow: boolean;
|
|
30
|
+
description: string;
|
|
31
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
export type RoleInputRow =
|
|
22
|
+
{
|
|
23
|
+
name: string;
|
|
24
|
+
description: string;
|
|
25
|
+
}
|