namirasoft-access 1.3.7 → 1.3.9

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 (43) hide show
  1. package/dist/NamirasoftAccessServer.d.ts +2 -0
  2. package/dist/NamirasoftAccessServer.js +2 -0
  3. package/dist/NamirasoftAccessServer.js.map +1 -1
  4. package/dist/NamirasoftAccessServerAccess.d.ts +3 -1
  5. package/dist/NamirasoftAccessServerAccess.js +3 -3
  6. package/dist/NamirasoftAccessServerAccess.js.map +1 -1
  7. package/dist/NamirasoftAccessServerBase.js +1 -1
  8. package/dist/NamirasoftAccessServerProduct.d.ts +4 -0
  9. package/dist/NamirasoftAccessServerProduct.js +24 -0
  10. package/dist/NamirasoftAccessServerProduct.js.map +1 -0
  11. package/dist/command/AccessSetOwnerCommand.js +13 -2
  12. package/dist/command/AccessSetOwnerCommand.js.map +1 -1
  13. package/dist/command/PermissionCreateCommand.js +10 -1
  14. package/dist/command/PermissionCreateCommand.js.map +1 -1
  15. package/dist/command/PermissionUpdateCommand.js +10 -1
  16. package/dist/command/PermissionUpdateCommand.js.map +1 -1
  17. package/dist/command/ProductCommand.d.ts +4 -0
  18. package/dist/command/ProductCommand.js +15 -0
  19. package/dist/command/ProductCommand.js.map +1 -0
  20. package/dist/command/ProductSetCommand.d.ts +5 -0
  21. package/dist/command/ProductSetCommand.js +48 -0
  22. package/dist/command/ProductSetCommand.js.map +1 -0
  23. package/dist/command/cli.js +2 -0
  24. package/dist/command/cli.js.map +1 -1
  25. package/dist/index.d.ts +3 -0
  26. package/dist/index.js +3 -0
  27. package/dist/index.js.map +1 -1
  28. package/dist/row/PermissionInputRow.d.ts +1 -0
  29. package/dist/row/PermissionRow.d.ts +1 -0
  30. package/package.json +2 -2
  31. package/src/NamirasoftAccessServer.ts +3 -0
  32. package/src/NamirasoftAccessServerAccess.ts +3 -3
  33. package/src/NamirasoftAccessServerBase.ts +1 -1
  34. package/src/NamirasoftAccessServerProduct.ts +30 -0
  35. package/src/command/AccessSetOwnerCommand.ts +13 -2
  36. package/src/command/PermissionCreateCommand.ts +10 -1
  37. package/src/command/PermissionUpdateCommand.ts +10 -1
  38. package/src/command/ProductCommand.ts +32 -0
  39. package/src/command/ProductSetCommand.ts +55 -0
  40. package/src/command/cli.ts +2 -0
  41. package/src/index.ts +3 -0
  42. package/src/row/PermissionInputRow.ts +1 -0
  43. package/src/row/PermissionRow.ts +1 -0
@@ -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"}
@@ -2,5 +2,7 @@ import { AccessRow } from "./row/AccessRow";
2
2
  import { NamirasoftAccessServerBase } from "./NamirasoftAccessServerBase";
3
3
  export declare class NamirasoftAccessServerAccess extends NamirasoftAccessServerBase {
4
4
  Get(user_id: string): Promise<AccessRow>;
5
- SetOwner(owner_id: string): Promise<AccessRow>;
5
+ SetOwner(body: {
6
+ owner_id: (string | null);
7
+ }): Promise<AccessRow>;
6
8
  }
@@ -19,10 +19,10 @@ class NamirasoftAccessServerAccess extends NamirasoftAccessServerBase_1.Namiraso
19
19
  return data;
20
20
  });
21
21
  }
22
- SetOwner(owner_id) {
22
+ SetOwner(body) {
23
23
  return __awaiter(this, void 0, void 0, function* () {
24
- let path = `/access/owner/${owner_id}`;
25
- let { data } = yield this._put(path, {});
24
+ let path = `/access/owner`;
25
+ let { data } = yield this._put(path, {}, body);
26
26
  return data;
27
27
  });
28
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"NamirasoftAccessServerAccess.js","sourceRoot":"","sources":["../src/NamirasoftAccessServerAccess.ts"],"names":[],"mappings":";;;;;;;;;;;;AAqBA,6EAA0E;AAE1E,MAAa,4BAA6B,SAAQ,uDAA0B;IAElE,GAAG,CAAC,OAAe;;YAErB,IAAI,IAAI,GAAG,WAAW,OAAO,EAAE,CAAC;YAChC,IAAI,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,IAAI,CAAY,IAAI,EAAE,EAAE,CAAC,CAAC;YACpD,OAAO,IAAI,CAAC;QAChB,CAAC;KAAA;IACK,QAAQ,CAAC,QAAgB;;YAE3B,IAAI,IAAI,GAAG,iBAAiB,QAAQ,EAAE,CAAC;YACvC,IAAI,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,IAAI,CAAY,IAAI,EAAE,EAAE,CAAC,CAAC;YACpD,OAAO,IAAI,CAAC;QAChB,CAAC;KAAA;CACJ;AAdD,oEAcC;AAAA,CAAC"}
1
+ {"version":3,"file":"NamirasoftAccessServerAccess.js","sourceRoot":"","sources":["../src/NamirasoftAccessServerAccess.ts"],"names":[],"mappings":";;;;;;;;;;;;AAqBA,6EAA0E;AAE1E,MAAa,4BAA6B,SAAQ,uDAA0B;IAElE,GAAG,CAAC,OAAe;;YAErB,IAAI,IAAI,GAAG,WAAW,OAAO,EAAE,CAAC;YAChC,IAAI,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,IAAI,CAAY,IAAI,EAAE,EAAE,CAAC,CAAC;YACpD,OAAO,IAAI,CAAC;QAChB,CAAC;KAAA;IACK,QAAQ,CAAC,IAAmC;;YAE9C,IAAI,IAAI,GAAG,eAAe,CAAC;YAC3B,IAAI,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,IAAI,CAAY,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;YAC1D,OAAO,IAAI,CAAC;QAChB,CAAC;KAAA;CACJ;AAdD,oEAcC;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.9`, 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"}
@@ -16,7 +16,16 @@ const NamirasoftAccessServer_1 = require("../NamirasoftAccessServer");
16
16
  const namirasoft_account_1 = require("namirasoft-account");
17
17
  class AccessSetOwnerCommand extends namirasoft_node_cli_1.BaseFinalCommand {
18
18
  constructor(argv) {
19
- super(argv, ["owner_id"], []);
19
+ super(argv, [], [
20
+ {
21
+ name: "owner_id",
22
+ short: "",
23
+ description: "Provides the value of 'owner_id' in body",
24
+ optional: true,
25
+ args: ["owner_id"],
26
+ defaults: [""]
27
+ }
28
+ ]);
20
29
  }
21
30
  exec() {
22
31
  return __awaiter(this, void 0, void 0, function* () {
@@ -27,7 +36,9 @@ class AccessSetOwnerCommand extends namirasoft_node_cli_1.BaseFinalCommand {
27
36
  let manager = new namirasoft_account_1.TokenManager(storage, () => { });
28
37
  manager.setValue(token, false);
29
38
  let server = new NamirasoftAccessServer_1.NamirasoftAccessServer(manager, e => this.app.logger.error(e.message));
30
- let ans = yield server.access.SetOwner(this.arg_values[0]);
39
+ let ans = yield server.access.SetOwner({
40
+ owner_id: this.option_values.owner_id
41
+ });
31
42
  this.app.logger.success(JSON.stringify(ans));
32
43
  });
33
44
  }
@@ -1 +1 @@
1
- {"version":3,"file":"AccessSetOwnerCommand.js","sourceRoot":"","sources":["../../src/command/AccessSetOwnerCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,6DAAuD;AACvD,qDAAiD;AACjD,sEAAmE;AACnE,2DAAkD;AAElD,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E,UAAU;gBAChB,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,0CAA0C;gBACvD,QAAQ,EAAE,IAAI;gBACd,IAAI,EAAE,CAAC,UAAU,CAAC;gBAClB,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,MAAM,CAAC,QAAQ,CAAC;gBACnC,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ;aACxC,CAAC,CAAC;YACH,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;QACjD,CAAC;KAAA;CACJ;AA7BD,sDA6BC;AAAA,CAAC"}
@@ -48,6 +48,14 @@ class PermissionCreateCommand extends namirasoft_node_cli_1.BaseFinalCommand {
48
48
  optional: false,
49
49
  args: ["email"],
50
50
  defaults: [""]
51
+ },
52
+ {
53
+ name: "default",
54
+ short: "",
55
+ description: "Provides the value of 'default' in body",
56
+ optional: false,
57
+ args: ["default"],
58
+ defaults: [""]
51
59
  }
52
60
  ]);
53
61
  }
@@ -64,7 +72,8 @@ class PermissionCreateCommand extends namirasoft_node_cli_1.BaseFinalCommand {
64
72
  to_user_id: this.option_values.to_user_id,
65
73
  firstName: this.option_values.firstName,
66
74
  lastName: this.option_values.lastName,
67
- email: this.option_values.email
75
+ email: this.option_values.email,
76
+ default: this.option_values.default
68
77
  });
69
78
  this.app.logger.success(JSON.stringify(ans));
70
79
  });
@@ -1 +1 @@
1
- {"version":3,"file":"PermissionCreateCommand.js","sourceRoot":"","sources":["../../src/command/PermissionCreateCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,6DAAuD;AACvD,qDAAiD;AACjD,sEAAmE;AACnE,2DAAkD;AAElD,MAAa,uBAAwB,SAAQ,sCAAgB;IAEzD,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE;YACZ;gBACI,IAAI,EAAE,YAAY;gBAClB,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,4CAA4C;gBACzD,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,CAAC,YAAY,CAAC;gBACpB,QAAQ,EAAE,CAAC,EAAE,CAAC;aACjB;YACD;gBACI,IAAI,EAAE,WAAW;gBACjB,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,2CAA2C;gBACxD,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,CAAC,WAAW,CAAC;gBACnB,QAAQ,EAAE,CAAC,EAAE,CAAC;aACjB;YACD;gBACI,IAAI,EAAE,UAAU;gBAChB,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,0CAA0C;gBACvD,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,CAAC,UAAU,CAAC;gBAClB,QAAQ,EAAE,CAAC,EAAE,CAAC;aACjB;YACD;gBACI,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,uCAAuC;gBACpD,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE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ACxI,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,UAAU,CAAC,MAAM,CAAC;gBACrC,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC,UAAU;gBACzC,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,SAAS;gBACvC,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ;gBACrC,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,KAAK;gBAC/B,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;AAjED,0DAiEC;AAAA,CAAC"}
@@ -48,6 +48,14 @@ class PermissionUpdateCommand extends namirasoft_node_cli_1.BaseFinalCommand {
48
48
  optional: false,
49
49
  args: ["email"],
50
50
  defaults: [""]
51
+ },
52
+ {
53
+ name: "default",
54
+ short: "",
55
+ description: "Provides the value of 'default' in body",
56
+ optional: false,
57
+ args: ["default"],
58
+ defaults: [""]
51
59
  }
52
60
  ]);
53
61
  }
@@ -64,7 +72,8 @@ class PermissionUpdateCommand extends namirasoft_node_cli_1.BaseFinalCommand {
64
72
  to_user_id: this.option_values.to_user_id,
65
73
  firstName: this.option_values.firstName,
66
74
  lastName: this.option_values.lastName,
67
- email: this.option_values.email
75
+ email: this.option_values.email,
76
+ default: this.option_values.default
68
77
  });
69
78
  this.app.logger.success(JSON.stringify(ans));
70
79
  });
@@ -1 +1 @@
1
- {"version":3,"file":"PermissionUpdateCommand.js","sourceRoot":"","sources":["../../src/command/PermissionUpdateCommand.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,IAAI,CAAC,EAAE;YAChB;gBACI,IAAI,EAAE,YAAY;gBAClB,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,4CAA4C;gBACzD,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,CAAC,YAAY,CAAC;gBACpB,QAAQ,EAAE,CAAC,EAAE,CAAC;aACjB;YACD;gBACI,IAAI,EAAE,WAAW;gBACjB,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,2CAA2C;gBACxD,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,CAAC,WAAW,CAAC;gBACnB,QAAQ,EAAE,CAAC,EAAE,CAAC;aACjB;YACD;gBACI,IAAI,EAAE,UAAU;gBAChB,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,0CAA0C;gBACvD,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,CAAC,UAAU,CAAC;gBAClB,QAAQ,EAAE,CAAC,EAAE,CAAC;aACjB;YACD;gBACI,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,uCAAuC;gBACpD,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,CAAC,OAAO,CAAC;gBACf,QAAQ,EAAE,CAAC,EAAE,CAAC;aACjB;SACA,CAAC,CAAC;IACX,CAAC;IACc,IAAI;;YAEf,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO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AAE,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,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE;gBACzD,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC,UAAU;gBACzC,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,SAAS;gBACvC,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ;gBACrC,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,KAAK;gBAC/B,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;AAjED,0DAiEC;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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,kDAAgC;AAChC,2DAAyC;AACzC,sDAAoC;AACpC,gDAA8B;AAC9B,uDAAqC;AACrC,kDAAgC;AAChC,qDAAmC"}
@@ -3,4 +3,5 @@ export type PermissionInputRow = {
3
3
  firstName: string;
4
4
  lastName: string;
5
5
  email: string;
6
+ default: boolean;
6
7
  };
@@ -5,4 +5,5 @@ export type PermissionRow = {
5
5
  firstName: string;
6
6
  lastName: string;
7
7
  email: string;
8
+ default: boolean;
8
9
  };
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.9",
12
12
  "author": "Amir Abolhasani",
13
13
  "license": "MIT",
14
14
  "main": "./dist/index.js",
@@ -17,7 +17,7 @@
17
17
  "build": ""
18
18
  },
19
19
  "dependencies": {
20
- "namirasoft-core": "^1.3.41",
20
+ "namirasoft-core": "^1.3.46",
21
21
  "namirasoft-site": "^1.3.4",
22
22
  "namirasoft-node-cli": "^1.3.8",
23
23
  "namirasoft-account": "^1.3.22"
@@ -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
  };
@@ -29,10 +29,10 @@ export class NamirasoftAccessServerAccess extends NamirasoftAccessServerBase
29
29
  let { data } = await this._get<AccessRow>(path, {});
30
30
  return data;
31
31
  }
32
- async SetOwner(owner_id: string): Promise<AccessRow>
32
+ async SetOwner(body: { owner_id: (string | null) }): Promise<AccessRow>
33
33
  {
34
- let path = `/access/owner/${owner_id}`;
35
- let { data } = await this._put<AccessRow>(path, {});
34
+ let path = `/access/owner`;
35
+ let { data } = await this._put<AccessRow>(path, {}, body);
36
36
  return data;
37
37
  }
38
38
  };
@@ -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.9`, 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
+ };
@@ -27,7 +27,16 @@ export class AccessSetOwnerCommand extends BaseFinalCommand
27
27
  {
28
28
  constructor(argv: string[])
29
29
  {
30
- super(argv, ["owner_id"], []);
30
+ super(argv, [], [
31
+ {
32
+ name: "owner_id",
33
+ short: "",
34
+ description: "Provides the value of 'owner_id' in body",
35
+ optional: true,
36
+ args: ["owner_id"],
37
+ defaults: [""]
38
+ }
39
+ ]);
31
40
  }
32
41
  override async exec()
33
42
  {
@@ -38,7 +47,9 @@ export class AccessSetOwnerCommand extends BaseFinalCommand
38
47
  let manager = new TokenManager(storage, () => { });
39
48
  manager.setValue(token, false);
40
49
  let server = new NamirasoftAccessServer(manager, e => this.app.logger.error(e.message));
41
- let ans = await server.access.SetOwner(this.arg_values[0]);
50
+ let ans = await server.access.SetOwner({
51
+ owner_id: this.option_values.owner_id
52
+ });
42
53
  this.app.logger.success(JSON.stringify(ans));
43
54
  }
44
55
  };
@@ -59,6 +59,14 @@ export class PermissionCreateCommand extends BaseFinalCommand
59
59
  optional: false,
60
60
  args: ["email"],
61
61
  defaults: [""]
62
+ },
63
+ {
64
+ name: "default",
65
+ short: "",
66
+ description: "Provides the value of 'default' in body",
67
+ optional: false,
68
+ args: ["default"],
69
+ defaults: [""]
62
70
  }
63
71
  ]);
64
72
  }
@@ -75,7 +83,8 @@ export class PermissionCreateCommand extends BaseFinalCommand
75
83
  to_user_id: this.option_values.to_user_id,
76
84
  firstName: this.option_values.firstName,
77
85
  lastName: this.option_values.lastName,
78
- email: this.option_values.email
86
+ email: this.option_values.email,
87
+ default: this.option_values.default
79
88
  });
80
89
  this.app.logger.success(JSON.stringify(ans));
81
90
  }
@@ -59,6 +59,14 @@ export class PermissionUpdateCommand extends BaseFinalCommand
59
59
  optional: false,
60
60
  args: ["email"],
61
61
  defaults: [""]
62
+ },
63
+ {
64
+ name: "default",
65
+ short: "",
66
+ description: "Provides the value of 'default' in body",
67
+ optional: false,
68
+ args: ["default"],
69
+ defaults: [""]
62
70
  }
63
71
  ]);
64
72
  }
@@ -75,7 +83,8 @@ export class PermissionUpdateCommand extends BaseFinalCommand
75
83
  to_user_id: this.option_values.to_user_id,
76
84
  firstName: this.option_values.firstName,
77
85
  lastName: this.option_values.lastName,
78
- email: this.option_values.email
86
+ email: this.option_values.email,
87
+ default: this.option_values.default
79
88
  });
80
89
  this.app.logger.success(JSON.stringify(ans));
81
90
  }
@@ -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";
@@ -24,4 +24,5 @@ export type PermissionInputRow =
24
24
  firstName: string;
25
25
  lastName: string;
26
26
  email: string;
27
+ default: boolean;
27
28
  }
@@ -26,4 +26,5 @@ export type PermissionRow =
26
26
  firstName: string;
27
27
  lastName: string;
28
28
  email: string;
29
+ default: boolean;
29
30
  }