namirasoft-access 1.3.7 → 1.3.8

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.
@@ -2,6 +2,7 @@ import { NamirasoftAccessServerAccess } from "./NamirasoftAccessServerAccess";
2
2
  import { NamirasoftAccessServerHealthz } from "./NamirasoftAccessServerHealthz";
3
3
  import { NamirasoftAccessServerPermission } from "./NamirasoftAccessServerPermission";
4
4
  import { NamirasoftAccessServerPolicy } from "./NamirasoftAccessServerPolicy";
5
+ import { NamirasoftAccessServerProduct } from "./NamirasoftAccessServerProduct";
5
6
  import { NamirasoftAccessServerRole } from "./NamirasoftAccessServerRole";
6
7
  import { TokenManager } from "namirasoft-account";
7
8
  export declare class NamirasoftAccessServer {
@@ -11,5 +12,6 @@ export declare class NamirasoftAccessServer {
11
12
  policy: NamirasoftAccessServerPolicy;
12
13
  role: NamirasoftAccessServerRole;
13
14
  access: NamirasoftAccessServerAccess;
15
+ product: NamirasoftAccessServerProduct;
14
16
  constructor(manager: TokenManager, onError: (error: Error) => void);
15
17
  }
@@ -5,6 +5,7 @@ const NamirasoftAccessServerAccess_1 = require("./NamirasoftAccessServerAccess")
5
5
  const NamirasoftAccessServerHealthz_1 = require("./NamirasoftAccessServerHealthz");
6
6
  const NamirasoftAccessServerPermission_1 = require("./NamirasoftAccessServerPermission");
7
7
  const NamirasoftAccessServerPolicy_1 = require("./NamirasoftAccessServerPolicy");
8
+ const NamirasoftAccessServerProduct_1 = require("./NamirasoftAccessServerProduct");
8
9
  const NamirasoftAccessServerRole_1 = require("./NamirasoftAccessServerRole");
9
10
  class NamirasoftAccessServer {
10
11
  constructor(manager, onError) {
@@ -14,6 +15,7 @@ class NamirasoftAccessServer {
14
15
  this.policy = new NamirasoftAccessServerPolicy_1.NamirasoftAccessServerPolicy(manager, onError);
15
16
  this.role = new NamirasoftAccessServerRole_1.NamirasoftAccessServerRole(manager, onError);
16
17
  this.access = new NamirasoftAccessServerAccess_1.NamirasoftAccessServerAccess(manager, onError);
18
+ this.product = new NamirasoftAccessServerProduct_1.NamirasoftAccessServerProduct(manager, onError);
17
19
  }
18
20
  }
19
21
  exports.NamirasoftAccessServer = NamirasoftAccessServer;
@@ -1 +1 @@
1
- {"version":3,"file":"NamirasoftAccessServer.js","sourceRoot":"","sources":["../src/NamirasoftAccessServer.ts"],"names":[],"mappings":";;;AAoBA,iFAA8E;AAC9E,mFAAgF;AAChF,yFAAsF;AACtF,iFAA8E;AAC9E,6EAA0E;AAG1E,MAAa,sBAAsB;IAQ/B,YAAY,OAAqB,EAAE,OAA+B;QAE9D,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,IAAI,6DAA6B,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACnE,IAAI,CAAC,UAAU,GAAG,IAAI,mEAAgC,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACzE,IAAI,CAAC,MAAM,GAAG,IAAI,2DAA4B,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACjE,IAAI,CAAC,IAAI,GAAG,IAAI,uDAA0B,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC7D,IAAI,CAAC,MAAM,GAAG,IAAI,2DAA4B,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACrE,CAAC;CACJ;AAjBD,wDAiBC;AAAA,CAAC"}
1
+ {"version":3,"file":"NamirasoftAccessServer.js","sourceRoot":"","sources":["../src/NamirasoftAccessServer.ts"],"names":[],"mappings":";;;AAoBA,iFAA8E;AAC9E,mFAAgF;AAChF,yFAAsF;AACtF,iFAA8E;AAC9E,mFAAgF;AAChF,6EAA0E;AAG1E,MAAa,sBAAsB;IAS/B,YAAY,OAAqB,EAAE,OAA+B;QAE9D,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,IAAI,6DAA6B,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACnE,IAAI,CAAC,UAAU,GAAG,IAAI,mEAAgC,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACzE,IAAI,CAAC,MAAM,GAAG,IAAI,2DAA4B,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACjE,IAAI,CAAC,IAAI,GAAG,IAAI,uDAA0B,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC7D,IAAI,CAAC,MAAM,GAAG,IAAI,2DAA4B,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACjE,IAAI,CAAC,OAAO,GAAG,IAAI,6DAA6B,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACvE,CAAC;CACJ;AAnBD,wDAmBC;AAAA,CAAC"}
@@ -4,7 +4,7 @@ exports.NamirasoftAccessServerBase = void 0;
4
4
  const namirasoft_account_1 = require("namirasoft-account");
5
5
  class NamirasoftAccessServerBase extends namirasoft_account_1.NamirasoftServerBase {
6
6
  constructor(manager, onError) {
7
- super(`https://access.namirasoft.com/api/v1`, `1.3.6`, manager, onError);
7
+ super(`https://access.namirasoft.com/api/v1`, `1.3.8`, manager, onError);
8
8
  }
9
9
  }
10
10
  exports.NamirasoftAccessServerBase = NamirasoftAccessServerBase;
@@ -0,0 +1,4 @@
1
+ import { NamirasoftAccessServerBase } from "./NamirasoftAccessServerBase";
2
+ export declare class NamirasoftAccessServerProduct extends NamirasoftAccessServerBase {
3
+ Set(product_id: string, body: any): Promise<void>;
4
+ }
@@ -0,0 +1,24 @@
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.NamirasoftAccessServerProduct = void 0;
13
+ const NamirasoftAccessServerBase_1 = require("./NamirasoftAccessServerBase");
14
+ class NamirasoftAccessServerProduct extends NamirasoftAccessServerBase_1.NamirasoftAccessServerBase {
15
+ Set(product_id, body) {
16
+ return __awaiter(this, void 0, void 0, function* () {
17
+ let path = `/product/${product_id}`;
18
+ yield this._get(path, {}, body);
19
+ });
20
+ }
21
+ }
22
+ exports.NamirasoftAccessServerProduct = NamirasoftAccessServerProduct;
23
+ ;
24
+ //# sourceMappingURL=NamirasoftAccessServerProduct.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NamirasoftAccessServerProduct.js","sourceRoot":"","sources":["../src/NamirasoftAccessServerProduct.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,6EAA0E;AAE1E,MAAa,6BAA8B,SAAQ,uDAA0B;IAEnE,GAAG,CAAC,UAAkB,EAAE,IAAS;;YAEnC,IAAI,IAAI,GAAG,YAAY,UAAU,EAAE,CAAC;YACpC,MAAM,IAAI,CAAC,IAAI,CAAO,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;QAC1C,CAAC;KAAA;CACJ;AAPD,sEAOC;AAAA,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { BaseNavigatorCommand } from "namirasoft-node-cli";
2
+ export declare class ProductCommand extends BaseNavigatorCommand {
3
+ constructor(argv: string[]);
4
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProductCommand = void 0;
4
+ const namirasoft_node_cli_1 = require("namirasoft-node-cli");
5
+ const ProductSetCommand_1 = require("./ProductSetCommand");
6
+ class ProductCommand extends namirasoft_node_cli_1.BaseNavigatorCommand {
7
+ constructor(argv) {
8
+ super(argv, {
9
+ "set": ProductSetCommand_1.ProductSetCommand,
10
+ });
11
+ }
12
+ }
13
+ exports.ProductCommand = ProductCommand;
14
+ ;
15
+ //# sourceMappingURL=ProductCommand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProductCommand.js","sourceRoot":"","sources":["../../src/command/ProductCommand.ts"],"names":[],"mappings":";;;AAoBA,6DAA2D;AAC3D,2DAAwD;AAExD,MAAa,cAAe,SAAQ,0CAAoB;IAEpD,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE;YACR,KAAK,EAAE,qCAAiB;SAC3B,CAAC,CAAC;IACP,CAAC;CACJ;AARD,wCAQC;AAAA,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { BaseFinalCommand } from "namirasoft-node-cli";
2
+ export declare class ProductSetCommand extends BaseFinalCommand {
3
+ constructor(argv: string[]);
4
+ exec(): Promise<void>;
5
+ }
@@ -0,0 +1,48 @@
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.ProductSetCommand = 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 ProductSetCommand extends namirasoft_node_cli_1.BaseFinalCommand {
18
+ constructor(argv) {
19
+ super(argv, ["product_id"], [
20
+ {
21
+ name: "body",
22
+ short: "",
23
+ description: "Provides the value of 'body' in body",
24
+ optional: false,
25
+ args: ["body"],
26
+ defaults: [""]
27
+ }
28
+ ]);
29
+ }
30
+ exec() {
31
+ return __awaiter(this, void 0, void 0, function* () {
32
+ let token = this.app.storage.getNSAToken();
33
+ if (token == null)
34
+ throw new Error("Token is not available. Please login first using:\nns-access account config \nor \n{this.command} account login.");
35
+ let storage = new namirasoft_core_1.IStorageMemory();
36
+ let manager = new namirasoft_account_1.TokenManager(storage, () => { });
37
+ manager.setValue(token, false);
38
+ let server = new NamirasoftAccessServer_1.NamirasoftAccessServer(manager, e => this.app.logger.error(e.message));
39
+ let ans = yield server.product.Set(this.arg_values[0], {
40
+ body: this.option_values.body
41
+ });
42
+ this.app.logger.success(JSON.stringify(ans));
43
+ });
44
+ }
45
+ }
46
+ exports.ProductSetCommand = ProductSetCommand;
47
+ ;
48
+ //# sourceMappingURL=ProductSetCommand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProductSetCommand.js","sourceRoot":"","sources":["../../src/command/ProductSetCommand.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,YAAY,CAAC,EAAE;YACxB;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;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,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE;gBACnD,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI;aAChC,CAAC,CAAC;YACH,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;QACjD,CAAC;KAAA;CACJ;AA7BD,8CA6BC;AAAA,CAAC"}
@@ -7,6 +7,7 @@ const namirasoft_node_cli_1 = require("namirasoft-node-cli");
7
7
  const HealthzCommand_1 = require("./HealthzCommand");
8
8
  const PermissionCommand_1 = require("./PermissionCommand");
9
9
  const PolicyCommand_1 = require("./PolicyCommand");
10
+ const ProductCommand_1 = require("./ProductCommand");
10
11
  const RoleCommand_1 = require("./RoleCommand");
11
12
  let app = new namirasoft_node_cli_1.Application("ns-access", new namirasoft_node_cli_1.BaseStorage(), {
12
13
  "healthz": HealthzCommand_1.HealthzCommand,
@@ -14,6 +15,7 @@ let app = new namirasoft_node_cli_1.Application("ns-access", new namirasoft_node
14
15
  "policy": PolicyCommand_1.PolicyCommand,
15
16
  "role": RoleCommand_1.RoleCommand,
16
17
  "access": AccessCommand_1.AccessCommand,
18
+ "product": ProductCommand_1.ProductCommand,
17
19
  "account": namirasoft_account_1.AccountCommand
18
20
  });
19
21
  app.run();
@@ -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,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,QAAQ,EAAE,6BAAa;IACvB,SAAS,EAAE,mCAAc;CAC5B,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,qDAAkD;AAClD,2DAAwD;AACxD,mDAAgD;AAChD,qDAAkD;AAClD,+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,QAAQ,EAAE,6BAAa;IACvB,SAAS,EAAE,+BAAc;IACzB,SAAS,EAAE,mCAAc;CAC5B,CAAC,CAAC;AACP,GAAG,CAAC,GAAG,EAAE,CAAC"}
package/dist/index.d.ts CHANGED
@@ -5,6 +5,7 @@ export * from "./NamirasoftAccessServerBase";
5
5
  export * from "./NamirasoftAccessServerHealthz";
6
6
  export * from "./NamirasoftAccessServerPermission";
7
7
  export * from "./NamirasoftAccessServerPolicy";
8
+ export * from "./NamirasoftAccessServerProduct";
8
9
  export * from "./NamirasoftAccessServerRole";
9
10
  export * from "./command/AccessCommand";
10
11
  export * from "./command/AccessGetCommand";
@@ -29,6 +30,8 @@ export * from "./command/PolicyGetIncomingCommand";
29
30
  export * from "./command/PolicyListCommand";
30
31
  export * from "./command/PolicyListIncomingCommand";
31
32
  export * from "./command/PolicyUpdateCommand";
33
+ export * from "./command/ProductCommand";
34
+ export * from "./command/ProductSetCommand";
32
35
  export * from "./command/RoleCommand";
33
36
  export * from "./command/RoleCreateCommand";
34
37
  export * from "./command/RoleDeleteCommand";
package/dist/index.js CHANGED
@@ -21,6 +21,7 @@ __exportStar(require("./NamirasoftAccessServerBase"), exports);
21
21
  __exportStar(require("./NamirasoftAccessServerHealthz"), exports);
22
22
  __exportStar(require("./NamirasoftAccessServerPermission"), exports);
23
23
  __exportStar(require("./NamirasoftAccessServerPolicy"), exports);
24
+ __exportStar(require("./NamirasoftAccessServerProduct"), exports);
24
25
  __exportStar(require("./NamirasoftAccessServerRole"), exports);
25
26
  __exportStar(require("./command/AccessCommand"), exports);
26
27
  __exportStar(require("./command/AccessGetCommand"), exports);
@@ -45,6 +46,8 @@ __exportStar(require("./command/PolicyGetIncomingCommand"), exports);
45
46
  __exportStar(require("./command/PolicyListCommand"), exports);
46
47
  __exportStar(require("./command/PolicyListIncomingCommand"), exports);
47
48
  __exportStar(require("./command/PolicyUpdateCommand"), exports);
49
+ __exportStar(require("./command/ProductCommand"), exports);
50
+ __exportStar(require("./command/ProductSetCommand"), exports);
48
51
  __exportStar(require("./command/RoleCommand"), exports);
49
52
  __exportStar(require("./command/RoleCreateCommand"), exports);
50
53
  __exportStar(require("./command/RoleDeleteCommand"), exports);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAoBA,kDAAgC;AAChC,2DAAyC;AACzC,iEAA+C;AAC/C,+DAA6C;AAC7C,kEAAgD;AAChD,qEAAmD;AACnD,iEAA+C;AAC/C,+DAA6C;AAC7C,0DAAwC;AACxC,6DAA2C;AAC3C,kEAAgD;AAChD,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,kDAAgC;AAChC,2DAAyC;AACzC,sDAAoC;AACpC,gDAA8B;AAC9B,uDAAqC;AACrC,kDAAgC;AAChC,qDAAmC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAoBA,kDAAgC;AAChC,2DAAyC;AACzC,iEAA+C;AAC/C,+DAA6C;AAC7C,kEAAgD;AAChD,qEAAmD;AACnD,iEAA+C;AAC/C,kEAAgD;AAChD,+DAA6C;AAC7C,0DAAwC;AACxC,6DAA2C;AAC3C,kEAAgD;AAChD,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,2DAAyC;AACzC,8DAA4C;AAC5C,wDAAsC;AACtC,8DAA4C;AAC5C,8DAA4C;AAC5C,2DAAyC;AACzC,mEAAiD;AACjD,4DAA0C;AAC1C,oEAAkD;AAClD,8DAA4C;AAC5C,kDAAgC;AAChC,2DAAyC;AACzC,sDAAoC;AACpC,gDAA8B;AAC9B,uDAAqC;AACrC,kDAAgC;AAChC,qDAAmC"}
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "framework": "npm",
9
9
  "application": "package",
10
10
  "private": false,
11
- "version": "1.3.7",
11
+ "version": "1.3.8",
12
12
  "author": "Amir Abolhasani",
13
13
  "license": "MIT",
14
14
  "main": "./dist/index.js",
@@ -22,6 +22,7 @@ import { NamirasoftAccessServerAccess } from "./NamirasoftAccessServerAccess";
22
22
  import { NamirasoftAccessServerHealthz } from "./NamirasoftAccessServerHealthz";
23
23
  import { NamirasoftAccessServerPermission } from "./NamirasoftAccessServerPermission";
24
24
  import { NamirasoftAccessServerPolicy } from "./NamirasoftAccessServerPolicy";
25
+ import { NamirasoftAccessServerProduct } from "./NamirasoftAccessServerProduct";
25
26
  import { NamirasoftAccessServerRole } from "./NamirasoftAccessServerRole";
26
27
  import { TokenManager } from "namirasoft-account";
27
28
 
@@ -33,6 +34,7 @@ export class NamirasoftAccessServer
33
34
  policy: NamirasoftAccessServerPolicy;
34
35
  role: NamirasoftAccessServerRole;
35
36
  access: NamirasoftAccessServerAccess;
37
+ product: NamirasoftAccessServerProduct;
36
38
  constructor(manager: TokenManager, onError: (error: Error) => void)
37
39
  {
38
40
  this.manager = manager;
@@ -41,5 +43,6 @@ export class NamirasoftAccessServer
41
43
  this.policy = new NamirasoftAccessServerPolicy(manager, onError);
42
44
  this.role = new NamirasoftAccessServerRole(manager, onError);
43
45
  this.access = new NamirasoftAccessServerAccess(manager, onError);
46
+ this.product = new NamirasoftAccessServerProduct(manager, onError);
44
47
  }
45
48
  };
@@ -25,6 +25,6 @@ export class NamirasoftAccessServerBase extends NamirasoftServerBase
25
25
  {
26
26
  constructor(manager: TokenManager, onError: (error: Error) => void)
27
27
  {
28
- super(`https://access.namirasoft.com/api/v1`, `1.3.6`, manager, onError);
28
+ super(`https://access.namirasoft.com/api/v1`, `1.3.8`, manager, onError);
29
29
  }
30
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 NamirasoftAccessServerProduct extends NamirasoftAccessServerBase
24
+ {
25
+ async Set(product_id: string, body: any): Promise<void>
26
+ {
27
+ let path = `/product/${product_id}`;
28
+ await this._get<void>(path, {}, body);
29
+ }
30
+ };
@@ -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 { ProductSetCommand } from "./ProductSetCommand";
23
+
24
+ export class ProductCommand extends BaseNavigatorCommand
25
+ {
26
+ constructor(argv: string[])
27
+ {
28
+ super(argv, {
29
+ "set": ProductSetCommand,
30
+ });
31
+ }
32
+ };
@@ -0,0 +1,55 @@
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 ProductSetCommand extends BaseFinalCommand
27
+ {
28
+ constructor(argv: string[])
29
+ {
30
+ super(argv, ["product_id"], [
31
+ {
32
+ name: "body",
33
+ short: "",
34
+ description: "Provides the value of 'body' in body",
35
+ optional: false,
36
+ args: ["body"],
37
+ defaults: [""]
38
+ }
39
+ ]);
40
+ }
41
+ override async exec()
42
+ {
43
+ let token = this.app.storage.getNSAToken();
44
+ if (token == null)
45
+ throw new Error("Token is not available. Please login first using:\nns-access account config \nor \n{this.command} account login.");
46
+ let storage = new IStorageMemory();
47
+ let manager = new TokenManager(storage, () => { });
48
+ manager.setValue(token, false);
49
+ let server = new NamirasoftAccessServer(manager, e => this.app.logger.error(e.message));
50
+ let ans = await server.product.Set(this.arg_values[0], {
51
+ body: this.option_values.body
52
+ });
53
+ this.app.logger.success(JSON.stringify(ans));
54
+ }
55
+ };
@@ -25,6 +25,7 @@ import { Application, BaseStorage } from "namirasoft-node-cli";
25
25
  import { HealthzCommand } from "./HealthzCommand";
26
26
  import { PermissionCommand } from "./PermissionCommand";
27
27
  import { PolicyCommand } from "./PolicyCommand";
28
+ import { ProductCommand } from "./ProductCommand";
28
29
  import { RoleCommand } from "./RoleCommand";
29
30
 
30
31
  let app = new Application("ns-access", new BaseStorage(),
@@ -34,6 +35,7 @@ let app = new Application("ns-access", new BaseStorage(),
34
35
  "policy": PolicyCommand,
35
36
  "role": RoleCommand,
36
37
  "access": AccessCommand,
38
+ "product": ProductCommand,
37
39
  "account": AccountCommand
38
40
  });
39
41
  app.run();
package/src/index.ts CHANGED
@@ -25,6 +25,7 @@ export * from "./NamirasoftAccessServerBase";
25
25
  export * from "./NamirasoftAccessServerHealthz";
26
26
  export * from "./NamirasoftAccessServerPermission";
27
27
  export * from "./NamirasoftAccessServerPolicy";
28
+ export * from "./NamirasoftAccessServerProduct";
28
29
  export * from "./NamirasoftAccessServerRole";
29
30
  export * from "./command/AccessCommand";
30
31
  export * from "./command/AccessGetCommand";
@@ -49,6 +50,8 @@ export * from "./command/PolicyGetIncomingCommand";
49
50
  export * from "./command/PolicyListCommand";
50
51
  export * from "./command/PolicyListIncomingCommand";
51
52
  export * from "./command/PolicyUpdateCommand";
53
+ export * from "./command/ProductCommand";
54
+ export * from "./command/ProductSetCommand";
52
55
  export * from "./command/RoleCommand";
53
56
  export * from "./command/RoleCreateCommand";
54
57
  export * from "./command/RoleDeleteCommand";