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.
Files changed (171) hide show
  1. package/dist/NamirasoftAccessServer.d.ts +13 -0
  2. package/dist/NamirasoftAccessServer.js +19 -0
  3. package/dist/NamirasoftAccessServer.js.map +1 -0
  4. package/dist/NamirasoftAccessServerBase.d.ts +5 -0
  5. package/dist/NamirasoftAccessServerBase.js +12 -0
  6. package/dist/NamirasoftAccessServerBase.js.map +1 -0
  7. package/dist/NamirasoftAccessServerHealthz.d.ts +4 -0
  8. package/dist/NamirasoftAccessServerHealthz.js +24 -0
  9. package/dist/NamirasoftAccessServerHealthz.js.map +1 -0
  10. package/dist/NamirasoftAccessServerPermission.d.ts +24 -0
  11. package/dist/NamirasoftAccessServerPermission.js +84 -0
  12. package/dist/NamirasoftAccessServerPermission.js.map +1 -0
  13. package/dist/NamirasoftAccessServerPolicy.d.ts +19 -0
  14. package/dist/NamirasoftAccessServerPolicy.js +69 -0
  15. package/dist/NamirasoftAccessServerPolicy.js.map +1 -0
  16. package/dist/NamirasoftAccessServerRole.d.ts +19 -0
  17. package/dist/NamirasoftAccessServerRole.js +69 -0
  18. package/dist/NamirasoftAccessServerRole.js.map +1 -0
  19. package/dist/command/HealthzCommand.d.ts +4 -0
  20. package/dist/command/HealthzCommand.js +15 -0
  21. package/dist/command/HealthzCommand.js.map +1 -0
  22. package/dist/command/HealthzGetCommand.d.ts +5 -0
  23. package/dist/command/HealthzGetCommand.js +37 -0
  24. package/dist/command/HealthzGetCommand.js.map +1 -0
  25. package/dist/command/PermissionCommand.d.ts +4 -0
  26. package/dist/command/PermissionCommand.js +31 -0
  27. package/dist/command/PermissionCommand.js.map +1 -0
  28. package/dist/command/PermissionCreateCommand.d.ts +5 -0
  29. package/dist/command/PermissionCreateCommand.js +75 -0
  30. package/dist/command/PermissionCreateCommand.js.map +1 -0
  31. package/dist/command/PermissionDeleteCommand.d.ts +5 -0
  32. package/dist/command/PermissionDeleteCommand.js +37 -0
  33. package/dist/command/PermissionDeleteCommand.js.map +1 -0
  34. package/dist/command/PermissionGetCommand.d.ts +5 -0
  35. package/dist/command/PermissionGetCommand.js +37 -0
  36. package/dist/command/PermissionGetCommand.js.map +1 -0
  37. package/dist/command/PermissionGetIncomingCommand.d.ts +5 -0
  38. package/dist/command/PermissionGetIncomingCommand.js +37 -0
  39. package/dist/command/PermissionGetIncomingCommand.js.map +1 -0
  40. package/dist/command/PermissionGetOutgoingCommand.d.ts +5 -0
  41. package/dist/command/PermissionGetOutgoingCommand.js +37 -0
  42. package/dist/command/PermissionGetOutgoingCommand.js.map +1 -0
  43. package/dist/command/PermissionListCommand.d.ts +5 -0
  44. package/dist/command/PermissionListCommand.js +37 -0
  45. package/dist/command/PermissionListCommand.js.map +1 -0
  46. package/dist/command/PermissionListIncomingCommand.d.ts +5 -0
  47. package/dist/command/PermissionListIncomingCommand.js +37 -0
  48. package/dist/command/PermissionListIncomingCommand.js.map +1 -0
  49. package/dist/command/PermissionListOutgoingCommand.d.ts +5 -0
  50. package/dist/command/PermissionListOutgoingCommand.js +37 -0
  51. package/dist/command/PermissionListOutgoingCommand.js.map +1 -0
  52. package/dist/command/PermissionUpdateCommand.d.ts +5 -0
  53. package/dist/command/PermissionUpdateCommand.js +75 -0
  54. package/dist/command/PermissionUpdateCommand.js.map +1 -0
  55. package/dist/command/PolicyCommand.d.ts +4 -0
  56. package/dist/command/PolicyCommand.js +27 -0
  57. package/dist/command/PolicyCommand.js.map +1 -0
  58. package/dist/command/PolicyCreateCommand.d.ts +5 -0
  59. package/dist/command/PolicyCreateCommand.js +93 -0
  60. package/dist/command/PolicyCreateCommand.js.map +1 -0
  61. package/dist/command/PolicyDeleteCommand.d.ts +5 -0
  62. package/dist/command/PolicyDeleteCommand.js +37 -0
  63. package/dist/command/PolicyDeleteCommand.js.map +1 -0
  64. package/dist/command/PolicyGetCommand.d.ts +5 -0
  65. package/dist/command/PolicyGetCommand.js +37 -0
  66. package/dist/command/PolicyGetCommand.js.map +1 -0
  67. package/dist/command/PolicyGetIncomingCommand.d.ts +5 -0
  68. package/dist/command/PolicyGetIncomingCommand.js +37 -0
  69. package/dist/command/PolicyGetIncomingCommand.js.map +1 -0
  70. package/dist/command/PolicyListCommand.d.ts +5 -0
  71. package/dist/command/PolicyListCommand.js +37 -0
  72. package/dist/command/PolicyListCommand.js.map +1 -0
  73. package/dist/command/PolicyListIncomingCommand.d.ts +5 -0
  74. package/dist/command/PolicyListIncomingCommand.js +37 -0
  75. package/dist/command/PolicyListIncomingCommand.js.map +1 -0
  76. package/dist/command/PolicyUpdateCommand.d.ts +5 -0
  77. package/dist/command/PolicyUpdateCommand.js +93 -0
  78. package/dist/command/PolicyUpdateCommand.js.map +1 -0
  79. package/dist/command/RoleCommand.d.ts +4 -0
  80. package/dist/command/RoleCommand.js +27 -0
  81. package/dist/command/RoleCommand.js.map +1 -0
  82. package/dist/command/RoleCreateCommand.d.ts +5 -0
  83. package/dist/command/RoleCreateCommand.js +57 -0
  84. package/dist/command/RoleCreateCommand.js.map +1 -0
  85. package/dist/command/RoleDeleteCommand.d.ts +5 -0
  86. package/dist/command/RoleDeleteCommand.js +37 -0
  87. package/dist/command/RoleDeleteCommand.js.map +1 -0
  88. package/dist/command/RoleGetCommand.d.ts +5 -0
  89. package/dist/command/RoleGetCommand.js +37 -0
  90. package/dist/command/RoleGetCommand.js.map +1 -0
  91. package/dist/command/RoleGetIncomingCommand.d.ts +5 -0
  92. package/dist/command/RoleGetIncomingCommand.js +37 -0
  93. package/dist/command/RoleGetIncomingCommand.js.map +1 -0
  94. package/dist/command/RoleListCommand.d.ts +5 -0
  95. package/dist/command/RoleListCommand.js +37 -0
  96. package/dist/command/RoleListCommand.js.map +1 -0
  97. package/dist/command/RoleListIncomingCommand.d.ts +5 -0
  98. package/dist/command/RoleListIncomingCommand.js +37 -0
  99. package/dist/command/RoleListIncomingCommand.js.map +1 -0
  100. package/dist/command/RoleUpdateCommand.d.ts +5 -0
  101. package/dist/command/RoleUpdateCommand.js +57 -0
  102. package/dist/command/RoleUpdateCommand.js.map +1 -0
  103. package/dist/command/cli.d.ts +2 -0
  104. package/dist/command/cli.js +18 -0
  105. package/dist/command/cli.js.map +1 -0
  106. package/dist/index.d.ts +40 -0
  107. package/dist/index.js +57 -0
  108. package/dist/index.js.map +1 -0
  109. package/dist/row/PermissionInputRow.d.ts +6 -0
  110. package/dist/row/PermissionInputRow.js +3 -0
  111. package/dist/row/PermissionInputRow.js.map +1 -0
  112. package/dist/row/PermissionRow.d.ts +8 -0
  113. package/dist/row/PermissionRow.js +3 -0
  114. package/dist/row/PermissionRow.js.map +1 -0
  115. package/dist/row/PoleRow.d.ts +6 -0
  116. package/dist/row/PoleRow.js +3 -0
  117. package/dist/row/PoleRow.js.map +1 -0
  118. package/dist/row/PolicyInputRow.d.ts +8 -0
  119. package/dist/row/PolicyInputRow.js +3 -0
  120. package/dist/row/PolicyInputRow.js.map +1 -0
  121. package/dist/row/PolicyRow.d.ts +10 -0
  122. package/dist/row/PolicyRow.js +3 -0
  123. package/dist/row/PolicyRow.js.map +1 -0
  124. package/dist/row/RoleInputRow.d.ts +4 -0
  125. package/dist/row/RoleInputRow.js +3 -0
  126. package/dist/row/RoleInputRow.js.map +1 -0
  127. package/logo.png +0 -0
  128. package/package.json +28 -0
  129. package/src/NamirasoftAccessServer.ts +42 -0
  130. package/src/NamirasoftAccessServerBase.ts +30 -0
  131. package/src/NamirasoftAccessServerHealthz.ts +30 -0
  132. package/src/NamirasoftAccessServerPermission.ts +84 -0
  133. package/src/NamirasoftAccessServerPolicy.ts +71 -0
  134. package/src/NamirasoftAccessServerRole.ts +71 -0
  135. package/src/command/HealthzCommand.ts +32 -0
  136. package/src/command/HealthzGetCommand.ts +44 -0
  137. package/src/command/PermissionCommand.ts +48 -0
  138. package/src/command/PermissionCreateCommand.ts +82 -0
  139. package/src/command/PermissionDeleteCommand.ts +44 -0
  140. package/src/command/PermissionGetCommand.ts +44 -0
  141. package/src/command/PermissionGetIncomingCommand.ts +44 -0
  142. package/src/command/PermissionGetOutgoingCommand.ts +44 -0
  143. package/src/command/PermissionListCommand.ts +44 -0
  144. package/src/command/PermissionListIncomingCommand.ts +44 -0
  145. package/src/command/PermissionListOutgoingCommand.ts +44 -0
  146. package/src/command/PermissionUpdateCommand.ts +82 -0
  147. package/src/command/PolicyCommand.ts +44 -0
  148. package/src/command/PolicyCreateCommand.ts +100 -0
  149. package/src/command/PolicyDeleteCommand.ts +44 -0
  150. package/src/command/PolicyGetCommand.ts +44 -0
  151. package/src/command/PolicyGetIncomingCommand.ts +44 -0
  152. package/src/command/PolicyListCommand.ts +44 -0
  153. package/src/command/PolicyListIncomingCommand.ts +44 -0
  154. package/src/command/PolicyUpdateCommand.ts +100 -0
  155. package/src/command/RoleCommand.ts +44 -0
  156. package/src/command/RoleCreateCommand.ts +64 -0
  157. package/src/command/RoleDeleteCommand.ts +44 -0
  158. package/src/command/RoleGetCommand.ts +44 -0
  159. package/src/command/RoleGetIncomingCommand.ts +44 -0
  160. package/src/command/RoleListCommand.ts +44 -0
  161. package/src/command/RoleListIncomingCommand.ts +44 -0
  162. package/src/command/RoleUpdateCommand.ts +64 -0
  163. package/src/command/cli.ts +37 -0
  164. package/src/index.ts +60 -0
  165. package/src/row/PermissionInputRow.ts +27 -0
  166. package/src/row/PermissionRow.ts +29 -0
  167. package/src/row/PoleRow.ts +27 -0
  168. package/src/row/PolicyInputRow.ts +29 -0
  169. package/src/row/PolicyRow.ts +31 -0
  170. package/src/row/RoleInputRow.ts +25 -0
  171. 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
+ };