namirasoft-access 1.4.6 → 1.4.7
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 +2 -0
- package/dist/NamirasoftAccessServer.js +2 -0
- package/dist/NamirasoftAccessServer.js.map +1 -1
- package/dist/NamirasoftAccessServerBase.js +1 -1
- package/dist/NamirasoftAccessServerUserRole.d.ts +9 -0
- package/dist/NamirasoftAccessServerUserRole.js +28 -0
- package/dist/NamirasoftAccessServerUserRole.js.map +1 -0
- package/dist/command/UserRoleCommand.d.ts +4 -0
- package/dist/command/UserRoleCommand.js +15 -0
- package/dist/command/UserRoleCommand.js.map +1 -0
- package/dist/command/UserRoleSetCommand.d.ts +5 -0
- package/dist/command/UserRoleSetCommand.js +58 -0
- package/dist/command/UserRoleSetCommand.js.map +1 -0
- package/dist/command/cli.js +2 -0
- package/dist/command/cli.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/NamirasoftAccessServer.ts +3 -0
- package/src/NamirasoftAccessServerBase.ts +1 -1
- package/src/NamirasoftAccessServerUserRole.ts +36 -0
- package/src/command/UserRoleCommand.ts +32 -0
- package/src/command/UserRoleSetCommand.ts +65 -0
- package/src/command/cli.ts +2 -0
- package/src/index.ts +3 -0
|
@@ -13,6 +13,7 @@ import { NamirasoftAccessServerRole } from "./NamirasoftAccessServerRole";
|
|
|
13
13
|
import { NamirasoftAccessServerRoleCategory } from "./NamirasoftAccessServerRoleCategory";
|
|
14
14
|
import { NamirasoftAccessServerRoleField } from "./NamirasoftAccessServerRoleField";
|
|
15
15
|
import { NamirasoftAccessServerRoleTag } from "./NamirasoftAccessServerRoleTag";
|
|
16
|
+
import { NamirasoftAccessServerUserRole } from "./NamirasoftAccessServerUserRole";
|
|
16
17
|
import { NamirasoftAccessServerValue } from "./NamirasoftAccessServerValue";
|
|
17
18
|
import { TokenManager } from "namirasoft-account";
|
|
18
19
|
export declare class NamirasoftAccessServer {
|
|
@@ -33,5 +34,6 @@ export declare class NamirasoftAccessServer {
|
|
|
33
34
|
role: NamirasoftAccessServerRole;
|
|
34
35
|
access: NamirasoftAccessServerAccess;
|
|
35
36
|
product: NamirasoftAccessServerProduct;
|
|
37
|
+
userrole: NamirasoftAccessServerUserRole;
|
|
36
38
|
constructor(base_url: string, manager: TokenManager, onError: (error: Error) => void);
|
|
37
39
|
}
|
|
@@ -16,6 +16,7 @@ const NamirasoftAccessServerRole_1 = require("./NamirasoftAccessServerRole");
|
|
|
16
16
|
const NamirasoftAccessServerRoleCategory_1 = require("./NamirasoftAccessServerRoleCategory");
|
|
17
17
|
const NamirasoftAccessServerRoleField_1 = require("./NamirasoftAccessServerRoleField");
|
|
18
18
|
const NamirasoftAccessServerRoleTag_1 = require("./NamirasoftAccessServerRoleTag");
|
|
19
|
+
const NamirasoftAccessServerUserRole_1 = require("./NamirasoftAccessServerUserRole");
|
|
19
20
|
const NamirasoftAccessServerValue_1 = require("./NamirasoftAccessServerValue");
|
|
20
21
|
class NamirasoftAccessServer {
|
|
21
22
|
constructor(base_url, manager, onError) {
|
|
@@ -36,6 +37,7 @@ class NamirasoftAccessServer {
|
|
|
36
37
|
this.role = new NamirasoftAccessServerRole_1.NamirasoftAccessServerRole(base_url, manager, onError);
|
|
37
38
|
this.access = new NamirasoftAccessServerAccess_1.NamirasoftAccessServerAccess(base_url, manager, onError);
|
|
38
39
|
this.product = new NamirasoftAccessServerProduct_1.NamirasoftAccessServerProduct(base_url, manager, onError);
|
|
40
|
+
this.userrole = new NamirasoftAccessServerUserRole_1.NamirasoftAccessServerUserRole(base_url, manager, onError);
|
|
39
41
|
}
|
|
40
42
|
}
|
|
41
43
|
exports.NamirasoftAccessServer = NamirasoftAccessServer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NamirasoftAccessServer.js","sourceRoot":"","sources":["../src/NamirasoftAccessServer.ts"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irasoft_account_1 = require("namirasoft-account");
|
|
5
5
|
class NamirasoftAccessServerBase extends namirasoft_account_1.NamirasoftServerBase {
|
|
6
6
|
constructor(base_url, manager, onError) {
|
|
7
|
-
super(base_url, `1.4.
|
|
7
|
+
super(base_url, `1.4.7`, manager, onError);
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
exports.NamirasoftAccessServerBase = NamirasoftAccessServerBase;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { NamirasoftAccessServerBase } from "./NamirasoftAccessServerBase";
|
|
2
|
+
import { TokenManager } from "namirasoft-account";
|
|
3
|
+
export declare class NamirasoftAccessServerUserRole extends NamirasoftAccessServerBase {
|
|
4
|
+
constructor(base_url: string, manager: TokenManager, onError: (error: Error) => void);
|
|
5
|
+
Set(body: {
|
|
6
|
+
user_id: (string | null);
|
|
7
|
+
role_id: (string | null);
|
|
8
|
+
}): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
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.NamirasoftAccessServerUserRole = void 0;
|
|
13
|
+
const NamirasoftAccessServerBase_1 = require("./NamirasoftAccessServerBase");
|
|
14
|
+
class NamirasoftAccessServerUserRole extends NamirasoftAccessServerBase_1.NamirasoftAccessServerBase {
|
|
15
|
+
constructor(base_url, manager, onError) {
|
|
16
|
+
super(base_url, manager, onError);
|
|
17
|
+
this.Set = this.Set.bind(this);
|
|
18
|
+
}
|
|
19
|
+
Set(body) {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
let path = `/user/role`;
|
|
22
|
+
yield this._put(path, {}, body);
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.NamirasoftAccessServerUserRole = NamirasoftAccessServerUserRole;
|
|
27
|
+
;
|
|
28
|
+
//# sourceMappingURL=NamirasoftAccessServerUserRole.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NamirasoftAccessServerUserRole.js","sourceRoot":"","sources":["../src/NamirasoftAccessServerUserRole.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,6EAA0E;AAG1E,MAAa,8BAA+B,SAAQ,uDAA0B;IAE1E,YAAY,QAAgB,EAAE,OAAqB,EAAE,OAA+B;QAEhF,KAAK,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QAClC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IACK,GAAG,CAAC,IAA4D;;YAElE,IAAI,IAAI,GAAG,YAAY,CAAC;YACxB,MAAM,IAAI,CAAC,IAAI,CAAO,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;QAC1C,CAAC;KAAA;CACJ;AAZD,wEAYC;AAAA,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserRoleCommand = void 0;
|
|
4
|
+
const namirasoft_node_cli_1 = require("namirasoft-node-cli");
|
|
5
|
+
const UserRoleSetCommand_1 = require("./UserRoleSetCommand");
|
|
6
|
+
class UserRoleCommand extends namirasoft_node_cli_1.BaseNavigatorCommand {
|
|
7
|
+
constructor(argv) {
|
|
8
|
+
super(argv, {
|
|
9
|
+
"set": UserRoleSetCommand_1.UserRoleSetCommand,
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.UserRoleCommand = UserRoleCommand;
|
|
14
|
+
;
|
|
15
|
+
//# sourceMappingURL=UserRoleCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserRoleCommand.js","sourceRoot":"","sources":["../../src/command/UserRoleCommand.ts"],"names":[],"mappings":";;;AAoBA,6DAA2D;AAC3D,6DAA0D;AAE1D,MAAa,eAAgB,SAAQ,0CAAoB;IAErD,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE;YACR,KAAK,EAAE,uCAAkB;SAC5B,CAAC,CAAC;IACP,CAAC;CACJ;AARD,0CAQC;AAAA,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
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.UserRoleSetCommand = 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 UserRoleSetCommand extends namirasoft_node_cli_1.BaseFinalCommand {
|
|
18
|
+
constructor(argv) {
|
|
19
|
+
super(argv, [], [
|
|
20
|
+
{
|
|
21
|
+
name: "user_id",
|
|
22
|
+
short: "",
|
|
23
|
+
description: "Provides the value of 'user_id' in body",
|
|
24
|
+
optional: true,
|
|
25
|
+
args: ["user_id"],
|
|
26
|
+
defaults: [""]
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "role_id",
|
|
30
|
+
short: "",
|
|
31
|
+
description: "Provides the value of 'role_id' in body",
|
|
32
|
+
optional: true,
|
|
33
|
+
args: ["role_id"],
|
|
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 url = this.app.storage.getItem("ns-access-server-url");
|
|
47
|
+
let server = new NamirasoftAccessServer_1.NamirasoftAccessServer(url, manager, e => this.app.logger.error(e.message));
|
|
48
|
+
let ans = yield server.userrole.Set({
|
|
49
|
+
user_id: this.option_values.user_id,
|
|
50
|
+
role_id: this.option_values.role_id
|
|
51
|
+
});
|
|
52
|
+
this.app.logger.success(JSON.stringify(ans));
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.UserRoleSetCommand = UserRoleSetCommand;
|
|
57
|
+
;
|
|
58
|
+
//# sourceMappingURL=UserRoleSetCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+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AG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;YAC7F,IAAI,GAAG,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC;gBAChC,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,OAAO;gBACnC,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,OAAO;aACtC,CAAC,CAAC;YACH,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;QACjD,CAAC;KAAA;CACJ;AAvCD,gDAuCC;AAAA,CAAC"}
|
package/dist/command/cli.js
CHANGED
|
@@ -19,6 +19,7 @@ const RoleCategoryCommand_1 = require("./RoleCategoryCommand");
|
|
|
19
19
|
const RoleCommand_1 = require("./RoleCommand");
|
|
20
20
|
const RoleFieldCommand_1 = require("./RoleFieldCommand");
|
|
21
21
|
const RoleTagCommand_1 = require("./RoleTagCommand");
|
|
22
|
+
const UserRoleCommand_1 = require("./UserRoleCommand");
|
|
22
23
|
const ValueCommand_1 = require("./ValueCommand");
|
|
23
24
|
let app = new namirasoft_node_cli_1.Application("ns-access", new namirasoft_node_cli_1.BaseStorage(), {
|
|
24
25
|
"healthz": HealthzCommand_1.HealthzCommand,
|
|
@@ -37,6 +38,7 @@ let app = new namirasoft_node_cli_1.Application("ns-access", new namirasoft_node
|
|
|
37
38
|
"role": RoleCommand_1.RoleCommand,
|
|
38
39
|
"access": AccessCommand_1.AccessCommand,
|
|
39
40
|
"product": ProductCommand_1.ProductCommand,
|
|
41
|
+
"userrole": UserRoleCommand_1.UserRoleCommand,
|
|
40
42
|
"account": namirasoft_account_1.AccountCommand,
|
|
41
43
|
"config": (argv) => new namirasoft_node_cli_2.ConfigCommand(argv, ["ns-access-server-url"])
|
|
42
44
|
});
|
package/dist/command/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/command/cli.ts"],"names":[],"mappings":";;;AAqBA,mDAAgD;AAChD,2DAAoD;AACpD,6DAA+D;AAC/D,6DAAoD;AACpD,qDAAkD;AAClD,2EAAwE;AACxE,2DAAwD;AACxD,qEAAkE;AAClE,iEAA8D;AAC9D,mEAAgE;AAChE,mDAAgD;AAChD,6DAA0D;AAC1D,yDAAsD;AACtD,qDAAkD;AAClD,+DAA4D;AAC5D,+CAA4C;AAC5C,yDAAsD;AACtD,qDAAkD;AAClD,iDAA8C;AAE9C,IAAI,GAAG,GAAG,IAAI,iCAAW,CAAC,WAAW,EAAE,IAAI,iCAAW,EAAE,EACpD;IACI,SAAS,EAAE,+BAAc;IACzB,OAAO,EAAE,2BAAY;IACrB,oBAAoB,EAAE,qDAAyB;IAC/C,iBAAiB,EAAE,+CAAsB;IACzC,eAAe,EAAE,2CAAoB;IACrC,YAAY,EAAE,qCAAiB;IAC/B,gBAAgB,EAAE,6CAAqB;IACvC,aAAa,EAAE,uCAAkB;IACjC,WAAW,EAAE,mCAAgB;IAC7B,QAAQ,EAAE,6BAAa;IACvB,cAAc,EAAE,yCAAmB;IACnC,WAAW,EAAE,mCAAgB;IAC7B,SAAS,EAAE,+BAAc;IACzB,MAAM,EAAE,yBAAW;IACnB,QAAQ,EAAE,6BAAa;IACvB,SAAS,EAAE,+BAAc;IACzB,SAAS,EAAE,mCAAc;IACzB,QAAQ,EAAE,CAAC,IAAc,EAAE,EAAE,CAAC,IAAI,mCAAa,CAAC,IAAI,EAAE,CAAC,sBAAsB,CAAC,CAAC;CAClF,CAAC,CAAC;AACP,GAAG,CAAC,GAAG,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/command/cli.ts"],"names":[],"mappings":";;;AAqBA,mDAAgD;AAChD,2DAAoD;AACpD,6DAA+D;AAC/D,6DAAoD;AACpD,qDAAkD;AAClD,2EAAwE;AACxE,2DAAwD;AACxD,qEAAkE;AAClE,iEAA8D;AAC9D,mEAAgE;AAChE,mDAAgD;AAChD,6DAA0D;AAC1D,yDAAsD;AACtD,qDAAkD;AAClD,+DAA4D;AAC5D,+CAA4C;AAC5C,yDAAsD;AACtD,qDAAkD;AAClD,uDAAoD;AACpD,iDAA8C;AAE9C,IAAI,GAAG,GAAG,IAAI,iCAAW,CAAC,WAAW,EAAE,IAAI,iCAAW,EAAE,EACpD;IACI,SAAS,EAAE,+BAAc;IACzB,OAAO,EAAE,2BAAY;IACrB,oBAAoB,EAAE,qDAAyB;IAC/C,iBAAiB,EAAE,+CAAsB;IACzC,eAAe,EAAE,2CAAoB;IACrC,YAAY,EAAE,qCAAiB;IAC/B,gBAAgB,EAAE,6CAAqB;IACvC,aAAa,EAAE,uCAAkB;IACjC,WAAW,EAAE,mCAAgB;IAC7B,QAAQ,EAAE,6BAAa;IACvB,cAAc,EAAE,yCAAmB;IACnC,WAAW,EAAE,mCAAgB;IAC7B,SAAS,EAAE,+BAAc;IACzB,MAAM,EAAE,yBAAW;IACnB,QAAQ,EAAE,6BAAa;IACvB,SAAS,EAAE,+BAAc;IACzB,UAAU,EAAE,iCAAe;IAC3B,SAAS,EAAE,mCAAc;IACzB,QAAQ,EAAE,CAAC,IAAc,EAAE,EAAE,CAAC,IAAI,mCAAa,CAAC,IAAI,EAAE,CAAC,sBAAsB,CAAC,CAAC;CAClF,CAAC,CAAC;AACP,GAAG,CAAC,GAAG,EAAE,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export * from "./NamirasoftAccessServerRole";
|
|
|
16
16
|
export * from "./NamirasoftAccessServerRoleCategory";
|
|
17
17
|
export * from "./NamirasoftAccessServerRoleField";
|
|
18
18
|
export * from "./NamirasoftAccessServerRoleTag";
|
|
19
|
+
export * from "./NamirasoftAccessServerUserRole";
|
|
19
20
|
export * from "./NamirasoftAccessServerValue";
|
|
20
21
|
export * from "./command/AccessCommand";
|
|
21
22
|
export * from "./command/AccessGetCommand";
|
|
@@ -102,6 +103,8 @@ export * from "./command/RoleTagGetCommand";
|
|
|
102
103
|
export * from "./command/RoleTagListCommand";
|
|
103
104
|
export * from "./command/RoleTagUpdateCommand";
|
|
104
105
|
export * from "./command/RoleUpdateCommand";
|
|
106
|
+
export * from "./command/UserRoleCommand";
|
|
107
|
+
export * from "./command/UserRoleSetCommand";
|
|
105
108
|
export * from "./command/ValueCommand";
|
|
106
109
|
export * from "./command/ValueListCommand";
|
|
107
110
|
export * from "./meta/MetaDatabase";
|
package/dist/index.js
CHANGED
|
@@ -32,6 +32,7 @@ __exportStar(require("./NamirasoftAccessServerRole"), exports);
|
|
|
32
32
|
__exportStar(require("./NamirasoftAccessServerRoleCategory"), exports);
|
|
33
33
|
__exportStar(require("./NamirasoftAccessServerRoleField"), exports);
|
|
34
34
|
__exportStar(require("./NamirasoftAccessServerRoleTag"), exports);
|
|
35
|
+
__exportStar(require("./NamirasoftAccessServerUserRole"), exports);
|
|
35
36
|
__exportStar(require("./NamirasoftAccessServerValue"), exports);
|
|
36
37
|
__exportStar(require("./command/AccessCommand"), exports);
|
|
37
38
|
__exportStar(require("./command/AccessGetCommand"), exports);
|
|
@@ -118,6 +119,8 @@ __exportStar(require("./command/RoleTagGetCommand"), exports);
|
|
|
118
119
|
__exportStar(require("./command/RoleTagListCommand"), exports);
|
|
119
120
|
__exportStar(require("./command/RoleTagUpdateCommand"), exports);
|
|
120
121
|
__exportStar(require("./command/RoleUpdateCommand"), exports);
|
|
122
|
+
__exportStar(require("./command/UserRoleCommand"), exports);
|
|
123
|
+
__exportStar(require("./command/UserRoleSetCommand"), exports);
|
|
121
124
|
__exportStar(require("./command/ValueCommand"), exports);
|
|
122
125
|
__exportStar(require("./command/ValueListCommand"), exports);
|
|
123
126
|
__exportStar(require("./meta/MetaDatabase"), exports);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;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iEAA+C;AAC/C,8DAA4C;AAC5C,4DAA0C;AAC1C,+DAA6C;AAC7C,yDAAuC;AACvC,6DAA2C;AAC3C,sDAAoC;AACpC,qEAAmD;AACnD,kEAAgD;AAChD,6DAA2C;AAC3C,gEAA8C;AAC9C,iEAA+C;AAC/C,8DAA4C;AAC5C,yDAAuC;AACvC,4DAA0C;AAC1C,+DAA6C;AAC7C,4DAA0C;AAC1C,uDAAqC;AACrC,0DAAwC;AACxC,kDAAgC;AAChC,+DAA6C;AAC7C,4DAA0C;AAC1C,0DAAwC;AACxC,8DAA4C;AAC5C,2DAAyC;AACzC,2DAAyC;AACzC,sDAAoC;AACpC,yDAAuC;AACvC,0DAAwC;AACxC,uDAAqC;AACrC,uDAAqC;AACrC,kDAAgC;AAChC,qDAAmC;AACnC,mDAAiC;AACjC,wDAAsC;AACtC,qDAAmC;AACnC,qDAAmC;AACnC,gDAA8B;AAC9B,mDAAiC"}
|
package/package.json
CHANGED
|
@@ -33,6 +33,7 @@ import { NamirasoftAccessServerRole } from "./NamirasoftAccessServerRole";
|
|
|
33
33
|
import { NamirasoftAccessServerRoleCategory } from "./NamirasoftAccessServerRoleCategory";
|
|
34
34
|
import { NamirasoftAccessServerRoleField } from "./NamirasoftAccessServerRoleField";
|
|
35
35
|
import { NamirasoftAccessServerRoleTag } from "./NamirasoftAccessServerRoleTag";
|
|
36
|
+
import { NamirasoftAccessServerUserRole } from "./NamirasoftAccessServerUserRole";
|
|
36
37
|
import { NamirasoftAccessServerValue } from "./NamirasoftAccessServerValue";
|
|
37
38
|
import { TokenManager } from "namirasoft-account";
|
|
38
39
|
|
|
@@ -55,6 +56,7 @@ export class NamirasoftAccessServer
|
|
|
55
56
|
role: NamirasoftAccessServerRole;
|
|
56
57
|
access: NamirasoftAccessServerAccess;
|
|
57
58
|
product: NamirasoftAccessServerProduct;
|
|
59
|
+
userrole: NamirasoftAccessServerUserRole;
|
|
58
60
|
constructor(base_url: string, manager: TokenManager, onError: (error: Error) => void)
|
|
59
61
|
{
|
|
60
62
|
this.manager = manager;
|
|
@@ -74,5 +76,6 @@ export class NamirasoftAccessServer
|
|
|
74
76
|
this.role = new NamirasoftAccessServerRole(base_url, manager, onError);
|
|
75
77
|
this.access = new NamirasoftAccessServerAccess(base_url, manager, onError);
|
|
76
78
|
this.product = new NamirasoftAccessServerProduct(base_url, manager, onError);
|
|
79
|
+
this.userrole = new NamirasoftAccessServerUserRole(base_url, manager, onError);
|
|
77
80
|
}
|
|
78
81
|
};
|
|
@@ -25,6 +25,6 @@ export class NamirasoftAccessServerBase extends NamirasoftServerBase
|
|
|
25
25
|
{
|
|
26
26
|
constructor(base_url: string, manager: TokenManager, onError: (error: Error) => void)
|
|
27
27
|
{
|
|
28
|
-
super(base_url, `1.4.
|
|
28
|
+
super(base_url, `1.4.7`, manager, onError);
|
|
29
29
|
}
|
|
30
30
|
};
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
import { TokenManager } from "namirasoft-account";
|
|
23
|
+
|
|
24
|
+
export class NamirasoftAccessServerUserRole extends NamirasoftAccessServerBase
|
|
25
|
+
{
|
|
26
|
+
constructor(base_url: string, manager: TokenManager, onError: (error: Error) => void)
|
|
27
|
+
{
|
|
28
|
+
super(base_url, manager, onError);
|
|
29
|
+
this.Set = this.Set.bind(this);
|
|
30
|
+
}
|
|
31
|
+
async Set(body: { user_id: (string | null), role_id: (string | null) }): Promise<void>
|
|
32
|
+
{
|
|
33
|
+
let path = `/user/role`;
|
|
34
|
+
await this._put<void>(path, {}, body);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
@@ -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 { UserRoleSetCommand } from "./UserRoleSetCommand";
|
|
23
|
+
|
|
24
|
+
export class UserRoleCommand extends BaseNavigatorCommand
|
|
25
|
+
{
|
|
26
|
+
constructor(argv: string[])
|
|
27
|
+
{
|
|
28
|
+
super(argv, {
|
|
29
|
+
"set": UserRoleSetCommand,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
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 UserRoleSetCommand extends BaseFinalCommand
|
|
27
|
+
{
|
|
28
|
+
constructor(argv: string[])
|
|
29
|
+
{
|
|
30
|
+
super(argv, [], [
|
|
31
|
+
{
|
|
32
|
+
name: "user_id",
|
|
33
|
+
short: "",
|
|
34
|
+
description: "Provides the value of 'user_id' in body",
|
|
35
|
+
optional: true,
|
|
36
|
+
args: ["user_id"],
|
|
37
|
+
defaults: [""]
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: "role_id",
|
|
41
|
+
short: "",
|
|
42
|
+
description: "Provides the value of 'role_id' in body",
|
|
43
|
+
optional: true,
|
|
44
|
+
args: ["role_id"],
|
|
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 url = this.app.storage.getItem("ns-access-server-url");
|
|
58
|
+
let server = new NamirasoftAccessServer(url, manager, e => this.app.logger.error(e.message));
|
|
59
|
+
let ans = await server.userrole.Set({
|
|
60
|
+
user_id: this.option_values.user_id,
|
|
61
|
+
role_id: this.option_values.role_id
|
|
62
|
+
});
|
|
63
|
+
this.app.logger.success(JSON.stringify(ans));
|
|
64
|
+
}
|
|
65
|
+
};
|
package/src/command/cli.ts
CHANGED
|
@@ -37,6 +37,7 @@ import { RoleCategoryCommand } from "./RoleCategoryCommand";
|
|
|
37
37
|
import { RoleCommand } from "./RoleCommand";
|
|
38
38
|
import { RoleFieldCommand } from "./RoleFieldCommand";
|
|
39
39
|
import { RoleTagCommand } from "./RoleTagCommand";
|
|
40
|
+
import { UserRoleCommand } from "./UserRoleCommand";
|
|
40
41
|
import { ValueCommand } from "./ValueCommand";
|
|
41
42
|
|
|
42
43
|
let app = new Application("ns-access", new BaseStorage(),
|
|
@@ -57,6 +58,7 @@ let app = new Application("ns-access", new BaseStorage(),
|
|
|
57
58
|
"role": RoleCommand,
|
|
58
59
|
"access": AccessCommand,
|
|
59
60
|
"product": ProductCommand,
|
|
61
|
+
"userrole": UserRoleCommand,
|
|
60
62
|
"account": AccountCommand,
|
|
61
63
|
"config": (argv: string[]) => new ConfigCommand(argv, ["ns-access-server-url"])
|
|
62
64
|
});
|
package/src/index.ts
CHANGED
|
@@ -36,6 +36,7 @@ export * from "./NamirasoftAccessServerRole";
|
|
|
36
36
|
export * from "./NamirasoftAccessServerRoleCategory";
|
|
37
37
|
export * from "./NamirasoftAccessServerRoleField";
|
|
38
38
|
export * from "./NamirasoftAccessServerRoleTag";
|
|
39
|
+
export * from "./NamirasoftAccessServerUserRole";
|
|
39
40
|
export * from "./NamirasoftAccessServerValue";
|
|
40
41
|
export * from "./command/AccessCommand";
|
|
41
42
|
export * from "./command/AccessGetCommand";
|
|
@@ -122,6 +123,8 @@ export * from "./command/RoleTagGetCommand";
|
|
|
122
123
|
export * from "./command/RoleTagListCommand";
|
|
123
124
|
export * from "./command/RoleTagUpdateCommand";
|
|
124
125
|
export * from "./command/RoleUpdateCommand";
|
|
126
|
+
export * from "./command/UserRoleCommand";
|
|
127
|
+
export * from "./command/UserRoleSetCommand";
|
|
125
128
|
export * from "./command/ValueCommand";
|
|
126
129
|
export * from "./command/ValueListCommand";
|
|
127
130
|
export * from "./meta/MetaDatabase";
|