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,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.RoleListIncomingCommand = void 0;
|
|
13
|
+
const namirasoft_node_cli_1 = require("namirasoft-node-cli");
|
|
14
|
+
const namirasoft_core_1 = require("namirasoft-core");
|
|
15
|
+
const NamirasoftAccessServer_1 = require("../NamirasoftAccessServer");
|
|
16
|
+
const namirasoft_account_1 = require("namirasoft-account");
|
|
17
|
+
class RoleListIncomingCommand extends namirasoft_node_cli_1.BaseFinalCommand {
|
|
18
|
+
constructor(argv) {
|
|
19
|
+
super(argv, ["filters", "page", "size"], []);
|
|
20
|
+
}
|
|
21
|
+
exec() {
|
|
22
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
let token = this.app.storage.getNSAToken();
|
|
24
|
+
if (token == null)
|
|
25
|
+
throw new Error("Token is not available. Please login first using:\nns-access account config \nor \n{this.command} account login.");
|
|
26
|
+
let storage = new namirasoft_core_1.IStorageMemory();
|
|
27
|
+
let manager = new namirasoft_account_1.TokenManager(storage, () => { });
|
|
28
|
+
manager.setValue(token, false);
|
|
29
|
+
let server = new NamirasoftAccessServer_1.NamirasoftAccessServer(manager, e => this.app.logger.error(e.message));
|
|
30
|
+
let ans = yield server.role.ListIncoming(this.arg_values[0], this.arg_values[1], this.arg_values[2]);
|
|
31
|
+
this.app.logger.success(JSON.stringify(ans));
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.RoleListIncomingCommand = RoleListIncomingCommand;
|
|
36
|
+
;
|
|
37
|
+
//# sourceMappingURL=RoleListIncomingCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RoleListIncomingCommand.js","sourceRoot":"","sources":["../../src/command/RoleListIncomingCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,6DAAuD;AACvD,qDAAiD;AACjD,sEAAmE;AACnE,2DAAkD;AAElD,MAAa,uBAAwB,SAAQ,sCAAgB;IAEzD,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;IACjD,CAAC;IACc,IAAI;;YAEf,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;YAC3C,IAAI,KAAK,IAAI,IAAI;gBACb,MAAM,IAAI,KAAK,CAAC,kHAAkH,CAAC,CAAC;YACxI,IAAI,OAAO,GAAG,IAAI,gCAAc,EAAE,CAAC;YACnC,IAAI,OAAO,GAAG,IAAI,iCAAY,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;YACnD,OAAO,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;YAC/B,IAAI,MAAM,GAAG,IAAI,+CAAsB,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;YACxF,IAAI,GAAG,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;YACrG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;QACjD,CAAC;KAAA;CACJ;AAlBD,0DAkBC;AAAA,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.RoleUpdateCommand = void 0;
|
|
13
|
+
const namirasoft_node_cli_1 = require("namirasoft-node-cli");
|
|
14
|
+
const namirasoft_core_1 = require("namirasoft-core");
|
|
15
|
+
const NamirasoftAccessServer_1 = require("../NamirasoftAccessServer");
|
|
16
|
+
const namirasoft_account_1 = require("namirasoft-account");
|
|
17
|
+
class RoleUpdateCommand extends namirasoft_node_cli_1.BaseFinalCommand {
|
|
18
|
+
constructor(argv) {
|
|
19
|
+
super(argv, ["id"], [
|
|
20
|
+
{
|
|
21
|
+
name: "name",
|
|
22
|
+
short: "",
|
|
23
|
+
description: "Provides the value of 'name' in body",
|
|
24
|
+
optional: false,
|
|
25
|
+
args: ["name"],
|
|
26
|
+
defaults: [""]
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "description",
|
|
30
|
+
short: "",
|
|
31
|
+
description: "Provides the value of 'description' in body",
|
|
32
|
+
optional: false,
|
|
33
|
+
args: ["description"],
|
|
34
|
+
defaults: [""]
|
|
35
|
+
}
|
|
36
|
+
]);
|
|
37
|
+
}
|
|
38
|
+
exec() {
|
|
39
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
let token = this.app.storage.getNSAToken();
|
|
41
|
+
if (token == null)
|
|
42
|
+
throw new Error("Token is not available. Please login first using:\nns-access account config \nor \n{this.command} account login.");
|
|
43
|
+
let storage = new namirasoft_core_1.IStorageMemory();
|
|
44
|
+
let manager = new namirasoft_account_1.TokenManager(storage, () => { });
|
|
45
|
+
manager.setValue(token, false);
|
|
46
|
+
let server = new NamirasoftAccessServer_1.NamirasoftAccessServer(manager, e => this.app.logger.error(e.message));
|
|
47
|
+
let ans = yield server.role.Update(this.arg_values[0], {
|
|
48
|
+
name: this.option_values.name,
|
|
49
|
+
description: this.option_values.description
|
|
50
|
+
});
|
|
51
|
+
this.app.logger.success(JSON.stringify(ans));
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.RoleUpdateCommand = RoleUpdateCommand;
|
|
56
|
+
;
|
|
57
|
+
//# sourceMappingURL=RoleUpdateCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RoleUpdateCommand.js","sourceRoot":"","sources":["../../src/command/RoleUpdateCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,6DAAuD;AACvD,qDAAiD;AACjD,sEAAmE;AACnE,2DAAkD;AAElD,MAAa,iBAAkB,SAAQ,sCAAgB;IAEnD,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE;YAChB;gBACI,IAAI,EAAE,MAAM;gBACZ,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,sCAAsC;gBACnD,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,CAAC,MAAM,CAAC;gBACd,QAAQ,EAAE,CAAC,EAAE,CAAC;aACjB;YACD;gBACI,IAAI,EAAE,aAAa;gBACnB,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,6CAA6C;gBAC1D,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,CAAC,aAAa,CAAC;gBACrB,QAAQ,EAAE,CAAC,EAAE,CAAC;aACjB;SACA,CAAC,CAAC;IACX,CAAC;IACc,IAAI;;YAEf,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;YAC3C,IAAI,KAAK,IAAI,IAAI;gBACb,MAAM,IAAI,KAAK,CAAC,kHAAkH,CAAC,CAAC;YACxI,IAAI,OAAO,GAAG,IAAI,gCAAc,EAAE,CAAC;YACnC,IAAI,OAAO,GAAG,IAAI,iCAAY,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;YACnD,OAAO,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;YAC/B,IAAI,MAAM,GAAG,IAAI,+CAAsB,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;YACxF,IAAI,GAAG,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE;gBACnD,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI;gBAC7B,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC,WAAW;aAC9C,CAAC,CAAC;YACH,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;QACjD,CAAC;KAAA;CACJ;AAtCD,8CAsCC;AAAA,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const namirasoft_account_1 = require("namirasoft-account");
|
|
5
|
+
const namirasoft_node_cli_1 = require("namirasoft-node-cli");
|
|
6
|
+
const HealthzCommand_1 = require("./HealthzCommand");
|
|
7
|
+
const PermissionCommand_1 = require("./PermissionCommand");
|
|
8
|
+
const PolicyCommand_1 = require("./PolicyCommand");
|
|
9
|
+
const RoleCommand_1 = require("./RoleCommand");
|
|
10
|
+
let app = new namirasoft_node_cli_1.Application("ns-access", new namirasoft_node_cli_1.BaseStorage(), {
|
|
11
|
+
"healthz": HealthzCommand_1.HealthzCommand,
|
|
12
|
+
"permission": PermissionCommand_1.PermissionCommand,
|
|
13
|
+
"policy": PolicyCommand_1.PolicyCommand,
|
|
14
|
+
"role": RoleCommand_1.RoleCommand,
|
|
15
|
+
"account": namirasoft_account_1.AccountCommand
|
|
16
|
+
});
|
|
17
|
+
app.run();
|
|
18
|
+
//# sourceMappingURL=cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/command/cli.ts"],"names":[],"mappings":";;;AAqBA,2DAAoD;AACpD,6DAA+D;AAC/D,qDAAkD;AAClD,2DAAwD;AACxD,mDAAgD;AAChD,+CAA4C;AAE5C,IAAI,GAAG,GAAG,IAAI,iCAAW,CAAC,WAAW,EAAE,IAAI,iCAAW,EAAE,EACpD;IACI,SAAS,EAAE,+BAAc;IACzB,YAAY,EAAE,qCAAiB;IAC/B,QAAQ,EAAE,6BAAa;IACvB,MAAM,EAAE,yBAAW;IACnB,SAAS,EAAE,mCAAc;CAC5B,CAAC,CAAC;AACP,GAAG,CAAC,GAAG,EAAE,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export * from "./NamirasoftAccessServer";
|
|
2
|
+
export * from "./NamirasoftAccessServerBase";
|
|
3
|
+
export * from "./NamirasoftAccessServerHealthz";
|
|
4
|
+
export * from "./NamirasoftAccessServerPermission";
|
|
5
|
+
export * from "./NamirasoftAccessServerPolicy";
|
|
6
|
+
export * from "./NamirasoftAccessServerRole";
|
|
7
|
+
export * from "./command/HealthzCommand";
|
|
8
|
+
export * from "./command/HealthzGetCommand";
|
|
9
|
+
export * from "./command/PermissionCommand";
|
|
10
|
+
export * from "./command/PermissionCreateCommand";
|
|
11
|
+
export * from "./command/PermissionDeleteCommand";
|
|
12
|
+
export * from "./command/PermissionGetCommand";
|
|
13
|
+
export * from "./command/PermissionGetIncomingCommand";
|
|
14
|
+
export * from "./command/PermissionGetOutgoingCommand";
|
|
15
|
+
export * from "./command/PermissionListCommand";
|
|
16
|
+
export * from "./command/PermissionListIncomingCommand";
|
|
17
|
+
export * from "./command/PermissionListOutgoingCommand";
|
|
18
|
+
export * from "./command/PermissionUpdateCommand";
|
|
19
|
+
export * from "./command/PolicyCommand";
|
|
20
|
+
export * from "./command/PolicyCreateCommand";
|
|
21
|
+
export * from "./command/PolicyDeleteCommand";
|
|
22
|
+
export * from "./command/PolicyGetCommand";
|
|
23
|
+
export * from "./command/PolicyGetIncomingCommand";
|
|
24
|
+
export * from "./command/PolicyListCommand";
|
|
25
|
+
export * from "./command/PolicyListIncomingCommand";
|
|
26
|
+
export * from "./command/PolicyUpdateCommand";
|
|
27
|
+
export * from "./command/RoleCommand";
|
|
28
|
+
export * from "./command/RoleCreateCommand";
|
|
29
|
+
export * from "./command/RoleDeleteCommand";
|
|
30
|
+
export * from "./command/RoleGetCommand";
|
|
31
|
+
export * from "./command/RoleGetIncomingCommand";
|
|
32
|
+
export * from "./command/RoleListCommand";
|
|
33
|
+
export * from "./command/RoleListIncomingCommand";
|
|
34
|
+
export * from "./command/RoleUpdateCommand";
|
|
35
|
+
export * from "./row/PermissionInputRow";
|
|
36
|
+
export * from "./row/PermissionRow";
|
|
37
|
+
export * from "./row/PoleRow";
|
|
38
|
+
export * from "./row/PolicyInputRow";
|
|
39
|
+
export * from "./row/PolicyRow";
|
|
40
|
+
export * from "./row/RoleInputRow";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./NamirasoftAccessServer"), exports);
|
|
18
|
+
__exportStar(require("./NamirasoftAccessServerBase"), exports);
|
|
19
|
+
__exportStar(require("./NamirasoftAccessServerHealthz"), exports);
|
|
20
|
+
__exportStar(require("./NamirasoftAccessServerPermission"), exports);
|
|
21
|
+
__exportStar(require("./NamirasoftAccessServerPolicy"), exports);
|
|
22
|
+
__exportStar(require("./NamirasoftAccessServerRole"), exports);
|
|
23
|
+
__exportStar(require("./command/HealthzCommand"), exports);
|
|
24
|
+
__exportStar(require("./command/HealthzGetCommand"), exports);
|
|
25
|
+
__exportStar(require("./command/PermissionCommand"), exports);
|
|
26
|
+
__exportStar(require("./command/PermissionCreateCommand"), exports);
|
|
27
|
+
__exportStar(require("./command/PermissionDeleteCommand"), exports);
|
|
28
|
+
__exportStar(require("./command/PermissionGetCommand"), exports);
|
|
29
|
+
__exportStar(require("./command/PermissionGetIncomingCommand"), exports);
|
|
30
|
+
__exportStar(require("./command/PermissionGetOutgoingCommand"), exports);
|
|
31
|
+
__exportStar(require("./command/PermissionListCommand"), exports);
|
|
32
|
+
__exportStar(require("./command/PermissionListIncomingCommand"), exports);
|
|
33
|
+
__exportStar(require("./command/PermissionListOutgoingCommand"), exports);
|
|
34
|
+
__exportStar(require("./command/PermissionUpdateCommand"), exports);
|
|
35
|
+
__exportStar(require("./command/PolicyCommand"), exports);
|
|
36
|
+
__exportStar(require("./command/PolicyCreateCommand"), exports);
|
|
37
|
+
__exportStar(require("./command/PolicyDeleteCommand"), exports);
|
|
38
|
+
__exportStar(require("./command/PolicyGetCommand"), exports);
|
|
39
|
+
__exportStar(require("./command/PolicyGetIncomingCommand"), exports);
|
|
40
|
+
__exportStar(require("./command/PolicyListCommand"), exports);
|
|
41
|
+
__exportStar(require("./command/PolicyListIncomingCommand"), exports);
|
|
42
|
+
__exportStar(require("./command/PolicyUpdateCommand"), exports);
|
|
43
|
+
__exportStar(require("./command/RoleCommand"), exports);
|
|
44
|
+
__exportStar(require("./command/RoleCreateCommand"), exports);
|
|
45
|
+
__exportStar(require("./command/RoleDeleteCommand"), exports);
|
|
46
|
+
__exportStar(require("./command/RoleGetCommand"), exports);
|
|
47
|
+
__exportStar(require("./command/RoleGetIncomingCommand"), exports);
|
|
48
|
+
__exportStar(require("./command/RoleListCommand"), exports);
|
|
49
|
+
__exportStar(require("./command/RoleListIncomingCommand"), exports);
|
|
50
|
+
__exportStar(require("./command/RoleUpdateCommand"), exports);
|
|
51
|
+
__exportStar(require("./row/PermissionInputRow"), exports);
|
|
52
|
+
__exportStar(require("./row/PermissionRow"), exports);
|
|
53
|
+
__exportStar(require("./row/PoleRow"), exports);
|
|
54
|
+
__exportStar(require("./row/PolicyInputRow"), exports);
|
|
55
|
+
__exportStar(require("./row/PolicyRow"), exports);
|
|
56
|
+
__exportStar(require("./row/RoleInputRow"), exports);
|
|
57
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAoBA,2DAAyC;AACzC,+DAA6C;AAC7C,kEAAgD;AAChD,qEAAmD;AACnD,iEAA+C;AAC/C,+DAA6C;AAC7C,2DAAyC;AACzC,8DAA4C;AAC5C,8DAA4C;AAC5C,oEAAkD;AAClD,oEAAkD;AAClD,iEAA+C;AAC/C,yEAAuD;AACvD,yEAAuD;AACvD,kEAAgD;AAChD,0EAAwD;AACxD,0EAAwD;AACxD,oEAAkD;AAClD,0DAAwC;AACxC,gEAA8C;AAC9C,gEAA8C;AAC9C,6DAA2C;AAC3C,qEAAmD;AACnD,8DAA4C;AAC5C,sEAAoD;AACpD,gEAA8C;AAC9C,wDAAsC;AACtC,8DAA4C;AAC5C,8DAA4C;AAC5C,2DAAyC;AACzC,mEAAiD;AACjD,4DAA0C;AAC1C,oEAAkD;AAClD,8DAA4C;AAC5C,2DAAyC;AACzC,sDAAoC;AACpC,gDAA8B;AAC9B,uDAAqC;AACrC,kDAAgC;AAChC,qDAAmC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PermissionInputRow.js","sourceRoot":"","sources":["../../src/row/PermissionInputRow.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PermissionRow.js","sourceRoot":"","sources":["../../src/row/PermissionRow.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PoleRow.js","sourceRoot":"","sources":["../../src/row/PoleRow.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PolicyInputRow.js","sourceRoot":"","sources":["../../src/row/PolicyInputRow.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PolicyRow.js","sourceRoot":"","sources":["../../src/row/PolicyRow.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RoleInputRow.js","sourceRoot":"","sources":["../../src/row/RoleInputRow.ts"],"names":[],"mappings":""}
|
package/logo.png
ADDED
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "namirasoft-access",
|
|
3
|
+
"title": "Namirasoft Access NPM Package",
|
|
4
|
+
"description": "Namira Software Corporation Access NPM Package",
|
|
5
|
+
"icon": "logo.png",
|
|
6
|
+
"logo": "https://static.namirasoft.com/image/namirasoft/access/logo/name.png",
|
|
7
|
+
"language": "ts",
|
|
8
|
+
"framework": "npm",
|
|
9
|
+
"application": "package",
|
|
10
|
+
"private": false,
|
|
11
|
+
"version": "1.3.1",
|
|
12
|
+
"author": "Amir Abolhasani",
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"main": "./dist/index.js",
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": ""
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"namirasoft-core": "^1.3.41",
|
|
21
|
+
"namirasoft-site": "^1.3.4",
|
|
22
|
+
"namirasoft-node-cli": "^1.3.8",
|
|
23
|
+
"namirasoft-account": "^1.3.22"
|
|
24
|
+
},
|
|
25
|
+
"bin": {
|
|
26
|
+
"ns-access": "./dist/command/cli.js"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
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 { NamirasoftAccessServerHealthz } from "./NamirasoftAccessServerHealthz";
|
|
22
|
+
import { NamirasoftAccessServerPermission } from "./NamirasoftAccessServerPermission";
|
|
23
|
+
import { NamirasoftAccessServerPolicy } from "./NamirasoftAccessServerPolicy";
|
|
24
|
+
import { NamirasoftAccessServerRole } from "./NamirasoftAccessServerRole";
|
|
25
|
+
import { TokenManager } from "namirasoft-account";
|
|
26
|
+
|
|
27
|
+
export class NamirasoftAccessServer
|
|
28
|
+
{
|
|
29
|
+
manager: TokenManager;
|
|
30
|
+
healthz: NamirasoftAccessServerHealthz;
|
|
31
|
+
permission: NamirasoftAccessServerPermission;
|
|
32
|
+
policy: NamirasoftAccessServerPolicy;
|
|
33
|
+
role: NamirasoftAccessServerRole;
|
|
34
|
+
constructor(manager: TokenManager, onError: (error: Error) => void)
|
|
35
|
+
{
|
|
36
|
+
this.manager = manager;
|
|
37
|
+
this.healthz = new NamirasoftAccessServerHealthz(manager, onError);
|
|
38
|
+
this.permission = new NamirasoftAccessServerPermission(manager, onError);
|
|
39
|
+
this.policy = new NamirasoftAccessServerPolicy(manager, onError);
|
|
40
|
+
this.role = new NamirasoftAccessServerRole(manager, onError);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
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 { NamirasoftServerBase } from "namirasoft-account";
|
|
22
|
+
import { TokenManager } from "namirasoft-account";
|
|
23
|
+
|
|
24
|
+
export class NamirasoftAccessServerBase extends NamirasoftServerBase
|
|
25
|
+
{
|
|
26
|
+
constructor(manager: TokenManager, onError: (error: Error) => void)
|
|
27
|
+
{
|
|
28
|
+
super(`https://access.namirasoft.com/api/v1`, `1.3.1`, manager, onError);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
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 { NamirasoftAccessServerBase } from "./NamirasoftAccessServerBase";
|
|
22
|
+
|
|
23
|
+
export class NamirasoftAccessServerHealthz extends NamirasoftAccessServerBase
|
|
24
|
+
{
|
|
25
|
+
async Get(): Promise<void>
|
|
26
|
+
{
|
|
27
|
+
let path = `/healthz`;
|
|
28
|
+
await this._get<void>(path, {});
|
|
29
|
+
}
|
|
30
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
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 { PermissionInputRow } from "./row/PermissionInputRow";
|
|
24
|
+
import { PermissionRow } from "./row/PermissionRow";
|
|
25
|
+
|
|
26
|
+
export class NamirasoftAccessServerPermission extends NamirasoftAccessServerBase
|
|
27
|
+
{
|
|
28
|
+
async List(filters: FilterItem[] | null, page: (number | null), size: (number | null)): Promise<{ rows: PermissionRow[], count: (number | null) }>
|
|
29
|
+
{
|
|
30
|
+
let filters_string_value: string = FilterItem.stringify(filters);
|
|
31
|
+
let path = `/permission/list`;
|
|
32
|
+
let { data } = await this._get<{ rows: PermissionRow[], count: (number | null) }>(path, { filters: filters_string_value, page, size });
|
|
33
|
+
return data;
|
|
34
|
+
}
|
|
35
|
+
async ListOutgoing(filters: FilterItem[] | null, page: (number | null), size: (number | null)): Promise<{ rows: PermissionRow[], count: (number | null) }>
|
|
36
|
+
{
|
|
37
|
+
let filters_string_value: string = FilterItem.stringify(filters);
|
|
38
|
+
let path = `/permission/outgoing/list`;
|
|
39
|
+
let { data } = await this._get<{ rows: PermissionRow[], count: (number | null) }>(path, { filters: filters_string_value, page, size });
|
|
40
|
+
return data;
|
|
41
|
+
}
|
|
42
|
+
async ListIncoming(filters: FilterItem[] | null, page: (number | null), size: (number | null)): Promise<{ rows: PermissionRow[], count: (number | null) }>
|
|
43
|
+
{
|
|
44
|
+
let filters_string_value: string = FilterItem.stringify(filters);
|
|
45
|
+
let path = `/permission/incoming/list`;
|
|
46
|
+
let { data } = await this._get<{ rows: PermissionRow[], count: (number | null) }>(path, { filters: filters_string_value, page, size });
|
|
47
|
+
return data;
|
|
48
|
+
}
|
|
49
|
+
async Get(id: string): Promise<PermissionRow>
|
|
50
|
+
{
|
|
51
|
+
let path = `/permission/${id}`;
|
|
52
|
+
let { data } = await this._get<PermissionRow>(path, {});
|
|
53
|
+
return data;
|
|
54
|
+
}
|
|
55
|
+
async GetIncoming(id: string): Promise<PermissionRow>
|
|
56
|
+
{
|
|
57
|
+
let path = `/permission/incoming/${id}`;
|
|
58
|
+
let { data } = await this._get<PermissionRow>(path, {});
|
|
59
|
+
return data;
|
|
60
|
+
}
|
|
61
|
+
async GetOutgoing(id: string): Promise<PermissionRow>
|
|
62
|
+
{
|
|
63
|
+
let path = `/permission/outgoing/${id}`;
|
|
64
|
+
let { data } = await this._get<PermissionRow>(path, {});
|
|
65
|
+
return data;
|
|
66
|
+
}
|
|
67
|
+
async Create(body: PermissionInputRow): Promise<PermissionRow>
|
|
68
|
+
{
|
|
69
|
+
let path = `/permission`;
|
|
70
|
+
let { data } = await this._post<PermissionRow>(path, {}, body);
|
|
71
|
+
return data;
|
|
72
|
+
}
|
|
73
|
+
async Update(id: string, body: PermissionInputRow): Promise<PermissionRow>
|
|
74
|
+
{
|
|
75
|
+
let path = `/permission/${id}`;
|
|
76
|
+
let { data } = await this._put<PermissionRow>(path, {}, body);
|
|
77
|
+
return data;
|
|
78
|
+
}
|
|
79
|
+
async Delete(id: string): Promise<void>
|
|
80
|
+
{
|
|
81
|
+
let path = `/permission/${id}`;
|
|
82
|
+
await this._delete<void>(path, {});
|
|
83
|
+
}
|
|
84
|
+
};
|