@openfort/openfort-node 0.5.5 → 0.5.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.
Files changed (51) hide show
  1. package/.eslintrc.json +9 -0
  2. package/dist/generated/api/apis.d.ts +1 -1
  3. package/dist/index.d.ts +5 -8
  4. package/dist/index.js +27 -31
  5. package/dist/index.js.map +1 -1
  6. package/dist/model/validationError.d.ts +4 -0
  7. package/dist/model/validationError.js +11 -0
  8. package/dist/model/validationError.js.map +1 -0
  9. package/dist/utility/httpErrorHandler.d.ts +1 -0
  10. package/dist/utility/httpErrorHandler.js +54 -0
  11. package/dist/utility/httpErrorHandler.js.map +1 -0
  12. package/dist/utility/observable.d.ts +5 -0
  13. package/dist/utility/observable.js +3 -0
  14. package/dist/utility/observable.js.map +1 -0
  15. package/dist/utility/observer.d.ts +19 -0
  16. package/dist/utility/observer.js +8 -0
  17. package/dist/utility/observer.js.map +1 -0
  18. package/dist/version.d.ts +1 -1
  19. package/dist/version.js +1 -1
  20. package/dist/wrapper/accountsApiWrapper.d.ts +4 -3
  21. package/dist/wrapper/accountsApiWrapper.js +15 -50
  22. package/dist/wrapper/accountsApiWrapper.js.map +1 -1
  23. package/dist/wrapper/baseApiWrapper.d.ts +14 -0
  24. package/dist/wrapper/baseApiWrapper.js +20 -0
  25. package/dist/wrapper/baseApiWrapper.js.map +1 -0
  26. package/dist/wrapper/contractsApiWrapper.d.ts +4 -3
  27. package/dist/wrapper/contractsApiWrapper.js +14 -43
  28. package/dist/wrapper/contractsApiWrapper.js.map +1 -1
  29. package/dist/wrapper/playersApiWrapper.d.ts +4 -3
  30. package/dist/wrapper/playersApiWrapper.js +19 -78
  31. package/dist/wrapper/playersApiWrapper.js.map +1 -1
  32. package/dist/wrapper/policiesApiWrapper.d.ts +4 -3
  33. package/dist/wrapper/policiesApiWrapper.js +18 -71
  34. package/dist/wrapper/policiesApiWrapper.js.map +1 -1
  35. package/dist/wrapper/policyRulesApiWrapper.d.ts +4 -3
  36. package/dist/wrapper/policyRulesApiWrapper.js +13 -36
  37. package/dist/wrapper/policyRulesApiWrapper.js.map +1 -1
  38. package/dist/wrapper/projectsApiWrapper.d.ts +4 -3
  39. package/dist/wrapper/projectsApiWrapper.js +13 -36
  40. package/dist/wrapper/projectsApiWrapper.js.map +1 -1
  41. package/dist/wrapper/sessionsApiWrapper.d.ts +4 -3
  42. package/dist/wrapper/sessionsApiWrapper.js +13 -36
  43. package/dist/wrapper/sessionsApiWrapper.js.map +1 -1
  44. package/dist/wrapper/transactionIntentsApiWrapper.d.ts +4 -3
  45. package/dist/wrapper/transactionIntentsApiWrapper.js +15 -50
  46. package/dist/wrapper/transactionIntentsApiWrapper.js.map +1 -1
  47. package/package.json +1 -1
  48. package/tsconfig.tsbuildinfo +1 -1
  49. package/dist/wrapper/httpErrorHandler.d.ts +0 -5
  50. package/dist/wrapper/httpErrorHandler.js +0 -46
  51. package/dist/wrapper/httpErrorHandler.js.map +0 -1
@@ -10,22 +10,19 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.PlayersApiWrapper = void 0;
13
- const httpErrorHandler_1 = require("./httpErrorHandler");
13
+ const baseApiWrapper_1 = require("./baseApiWrapper");
14
14
  const playersApi_1 = require("../generated/api/playersApi");
15
- const model_1 = require("../model");
16
- const version_1 = require("../version");
17
- class PlayersApiWrapper {
15
+ const httpErrorHandler_1 = require("../utility/httpErrorHandler");
16
+ let PlayersApiWrapper = class PlayersApiWrapper extends baseApiWrapper_1.BaseApiWrapper {
18
17
  constructor(accessToken, basePath) {
19
- this._api = new playersApi_1.PlayersApi(basePath);
20
- this._api.accessToken = accessToken;
21
- this._api.defaultHeaders["User-Agent"] = `${version_1.PACKAGE}@${version_1.VERSION}`;
18
+ super(playersApi_1.PlayersApi, accessToken, basePath);
22
19
  }
23
20
  /**
24
21
  * Creates a player object.
25
22
  * @param req Parameters to create a player
26
23
  */
27
24
  async create(req) {
28
- const response = await this._api.createPlayer(req);
25
+ const response = await this.api.createPlayer(req);
29
26
  return response.body;
30
27
  }
31
28
  /**
@@ -34,7 +31,7 @@ class PlayersApiWrapper {
34
31
  */
35
32
  async createAccount(req) {
36
33
  const { player, ...body } = req;
37
- const response = await this._api.createPlayerAccount(player, body);
34
+ const response = await this.api.createPlayerAccount(player, body);
38
35
  return response.body;
39
36
  }
40
37
  /**
@@ -43,7 +40,7 @@ class PlayersApiWrapper {
43
40
  */
44
41
  async createSession(req) {
45
42
  const { playerId, ...body } = req;
46
- const response = await this._api.createPlayerSession(playerId, body);
43
+ const response = await this.api.createPlayerSession(playerId, body);
47
44
  return response.body;
48
45
  }
49
46
  /**
@@ -51,7 +48,7 @@ class PlayersApiWrapper {
51
48
  * @param req Criteria to get the player.
52
49
  */
53
50
  async get(req) {
54
- const response = await this._api.getPlayer(req.id, req.expand);
51
+ const response = await this.api.getPlayer(req.id, req.expand);
55
52
  return response.body;
56
53
  }
57
54
  /**
@@ -59,7 +56,7 @@ class PlayersApiWrapper {
59
56
  * @param req Criteria to get the accounts list.
60
57
  */
61
58
  async listAccounts(req) {
62
- const response = await this._api.getPlayerAccounts(req.id, req.expand);
59
+ const response = await this.api.getPlayerAccounts(req.id, req.expand);
63
60
  return response.body;
64
61
  }
65
62
  /**
@@ -67,7 +64,7 @@ class PlayersApiWrapper {
67
64
  * @param req Criteria to retrieve player inventory.
68
65
  */
69
66
  async getInventory(req) {
70
- const response = await this._api.getPlayerInventory(req.id, req.chainId);
67
+ const response = await this.api.getPlayerInventory(req.id, req.chainId);
71
68
  return response.body;
72
69
  }
73
70
  /**
@@ -75,7 +72,7 @@ class PlayersApiWrapper {
75
72
  * @param req Criteria to retrieve the list of the players
76
73
  */
77
74
  async list(req) {
78
- const response = await this._api.getPlayers(req?.expand, req?.limit, req?.filter ? JSON.stringify(req.filter) : undefined, req?.order, req?.skip);
75
+ const response = await this.api.getPlayers(req?.expand, req?.limit, req?.filter ? JSON.stringify(req.filter) : undefined, req?.order, req?.skip);
79
76
  return response.body;
80
77
  }
81
78
  /**
@@ -84,7 +81,7 @@ class PlayersApiWrapper {
84
81
  */
85
82
  async revokeSession(req) {
86
83
  const { playerId, ...body } = req;
87
- const response = await this._api.revokePlayerSession(playerId, body);
84
+ const response = await this.api.revokePlayerSession(playerId, body);
88
85
  return response.body;
89
86
  }
90
87
  /**
@@ -93,7 +90,7 @@ class PlayersApiWrapper {
93
90
  */
94
91
  async transferAccountOwnership(req) {
95
92
  const { playerId, ...body } = req;
96
- const response = await this._api.transferAccountOwnership(playerId, body);
93
+ const response = await this.api.transferAccountOwnership(playerId, body);
97
94
  return response.body;
98
95
  }
99
96
  /**
@@ -102,69 +99,13 @@ class PlayersApiWrapper {
102
99
  */
103
100
  async update(req) {
104
101
  const { id, ...body } = req;
105
- const response = await this._api.updatePlayer(id, body);
102
+ const response = await this.api.updatePlayer(id, body);
106
103
  return response.body;
107
104
  }
108
- }
109
- __decorate([
110
- (0, httpErrorHandler_1.httpErrorHandler)(),
111
- __metadata("design:type", Function),
112
- __metadata("design:paramtypes", [model_1.CreatePlayerRequest]),
113
- __metadata("design:returntype", Promise)
114
- ], PlayersApiWrapper.prototype, "create", null);
115
- __decorate([
116
- (0, httpErrorHandler_1.httpErrorHandler)(),
117
- __metadata("design:type", Function),
118
- __metadata("design:paramtypes", [model_1.CreateAccountRequest]),
119
- __metadata("design:returntype", Promise)
120
- ], PlayersApiWrapper.prototype, "createAccount", null);
121
- __decorate([
122
- (0, httpErrorHandler_1.httpErrorHandler)(),
123
- __metadata("design:type", Function),
124
- __metadata("design:paramtypes", [Object]),
125
- __metadata("design:returntype", Promise)
126
- ], PlayersApiWrapper.prototype, "createSession", null);
127
- __decorate([
128
- (0, httpErrorHandler_1.httpErrorHandler)(),
129
- __metadata("design:type", Function),
130
- __metadata("design:paramtypes", [Object]),
131
- __metadata("design:returntype", Promise)
132
- ], PlayersApiWrapper.prototype, "get", null);
133
- __decorate([
134
- (0, httpErrorHandler_1.httpErrorHandler)(),
135
- __metadata("design:type", Function),
136
- __metadata("design:paramtypes", [Object]),
137
- __metadata("design:returntype", Promise)
138
- ], PlayersApiWrapper.prototype, "listAccounts", null);
139
- __decorate([
140
- (0, httpErrorHandler_1.httpErrorHandler)(),
141
- __metadata("design:type", Function),
142
- __metadata("design:paramtypes", [Object]),
143
- __metadata("design:returntype", Promise)
144
- ], PlayersApiWrapper.prototype, "getInventory", null);
145
- __decorate([
146
- (0, httpErrorHandler_1.httpErrorHandler)(),
147
- __metadata("design:type", Function),
148
- __metadata("design:paramtypes", [Object]),
149
- __metadata("design:returntype", Promise)
150
- ], PlayersApiWrapper.prototype, "list", null);
151
- __decorate([
152
- (0, httpErrorHandler_1.httpErrorHandler)(),
153
- __metadata("design:type", Function),
154
- __metadata("design:paramtypes", [Object]),
155
- __metadata("design:returntype", Promise)
156
- ], PlayersApiWrapper.prototype, "revokeSession", null);
157
- __decorate([
158
- (0, httpErrorHandler_1.httpErrorHandler)(),
159
- __metadata("design:type", Function),
160
- __metadata("design:paramtypes", [Object]),
161
- __metadata("design:returntype", Promise)
162
- ], PlayersApiWrapper.prototype, "transferAccountOwnership", null);
163
- __decorate([
164
- (0, httpErrorHandler_1.httpErrorHandler)(),
165
- __metadata("design:type", Function),
166
- __metadata("design:paramtypes", [Object]),
167
- __metadata("design:returntype", Promise)
168
- ], PlayersApiWrapper.prototype, "update", null);
105
+ };
106
+ PlayersApiWrapper = __decorate([
107
+ httpErrorHandler_1.httpErrorHandler,
108
+ __metadata("design:paramtypes", [String, String])
109
+ ], PlayersApiWrapper);
169
110
  exports.PlayersApiWrapper = PlayersApiWrapper;
170
111
  //# sourceMappingURL=playersApiWrapper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"playersApiWrapper.js","sourceRoot":"","sources":["../../src/wrapper/playersApiWrapper.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAAoD;AACpD,4DAAuD;AACvD,oCAkBkB;AAClB,w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C1B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;QACvD,OAAO,QAAQ,CAAC,IAAI,CAAC;IACzB,CAAC;CACJ,CAAA;AA3GY,iBAAiB;IAD7B,mCAAgB;;GACJ,iBAAiB,CA2G7B;AA3GY,8CAAiB"}
@@ -1,6 +1,7 @@
1
- import { PoliciesResponse, PolicyDeleteResponse, PolicyResponse, PolicyRuleResponse, PolicyRulesResponse, ListPoliciesRequest, GetPolicyRequest, GetAllowFunctionsRequest, GasReport, UpdatePolicyAllowFunctionRequest, GetPolicyTotalGasUsageRequest, CreatePolicyRequest, UpdatePolicyRequest, CreatePolicyRuleRequest } from "../model";
2
- export declare class PoliciesApiWrapper {
3
- private readonly _api;
1
+ import { CreatePolicyRequest, CreatePolicyRuleRequest, GasReport, GetAllowFunctionsRequest, GetPolicyRequest, GetPolicyTotalGasUsageRequest, ListPoliciesRequest, PoliciesResponse, PolicyDeleteResponse, PolicyResponse, PolicyRuleResponse, PolicyRulesResponse, UpdatePolicyAllowFunctionRequest, UpdatePolicyRequest } from "../model";
2
+ import { BaseApiWrapper } from "./baseApiWrapper";
3
+ import { PoliciesApi } from "../generated/api/policiesApi";
4
+ export declare class PoliciesApiWrapper extends BaseApiWrapper<PoliciesApi> {
4
5
  constructor(accessToken: string, basePath?: string);
5
6
  /**
6
7
  * Creates policy
@@ -10,22 +10,19 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.PoliciesApiWrapper = void 0;
13
- const httpErrorHandler_1 = require("./httpErrorHandler");
13
+ const baseApiWrapper_1 = require("./baseApiWrapper");
14
14
  const policiesApi_1 = require("../generated/api/policiesApi");
15
- const model_1 = require("../model");
16
- const version_1 = require("../version");
17
- class PoliciesApiWrapper {
15
+ const httpErrorHandler_1 = require("../utility/httpErrorHandler");
16
+ let PoliciesApiWrapper = class PoliciesApiWrapper extends baseApiWrapper_1.BaseApiWrapper {
18
17
  constructor(accessToken, basePath) {
19
- this._api = new policiesApi_1.PoliciesApi(basePath);
20
- this._api.accessToken = accessToken;
21
- this._api.defaultHeaders["User-Agent"] = `${version_1.PACKAGE}@${version_1.VERSION}`;
18
+ super(policiesApi_1.PoliciesApi, accessToken, basePath);
22
19
  }
23
20
  /**
24
21
  * Creates policy
25
22
  * @param req parameters to create
26
23
  */
27
24
  async create(req) {
28
- const response = await this._api.createPolicy(req);
25
+ const response = await this.api.createPolicy(req);
29
26
  return response.body;
30
27
  }
31
28
  /**
@@ -34,7 +31,7 @@ class PoliciesApiWrapper {
34
31
  */
35
32
  async update(req) {
36
33
  const { id, ...body } = req;
37
- const response = await this._api.updatePolicy(id, body);
34
+ const response = await this.api.updatePolicy(id, body);
38
35
  return response.body;
39
36
  }
40
37
  /**
@@ -43,7 +40,7 @@ class PoliciesApiWrapper {
43
40
  */
44
41
  async createAllowFunction(req) {
45
42
  const { policy, ...body } = req;
46
- const response = await this._api.createPolicyAllowFunction(policy, body);
43
+ const response = await this.api.createPolicyAllowFunction(policy, body);
47
44
  return response.body;
48
45
  }
49
46
  /**
@@ -51,7 +48,7 @@ class PoliciesApiWrapper {
51
48
  * @param id
52
49
  */
53
50
  async delete(id) {
54
- const response = await this._api.deletePolicy(id);
51
+ const response = await this.api.deletePolicy(id);
55
52
  return response.body;
56
53
  }
57
54
  /**
@@ -59,7 +56,7 @@ class PoliciesApiWrapper {
59
56
  * @param req Criteria to retrieve the policies by
60
57
  */
61
58
  async list(req) {
62
- const response = await this._api.getPolicies(req?.limit, req?.expand);
59
+ const response = await this.api.getPolicies(req?.limit, req?.expand);
63
60
  return response.body;
64
61
  }
65
62
  /**
@@ -67,7 +64,7 @@ class PoliciesApiWrapper {
67
64
  * @param req Criteria to retrieve the policy by
68
65
  */
69
66
  async get(req) {
70
- const response = await this._api.getPolicy(req.id, req.expand);
67
+ const response = await this.api.getPolicy(req.id, req.expand);
71
68
  return response.body;
72
69
  }
73
70
  /**
@@ -75,7 +72,7 @@ class PoliciesApiWrapper {
75
72
  * @param req Criteria to get allow functions
76
73
  */
77
74
  async getAllowFunctions(req) {
78
- const response = await this._api.getPolicyAllowFunctions(req.id, req.expand);
75
+ const response = await this.api.getPolicyAllowFunctions(req.id, req.expand);
79
76
  return response.body;
80
77
  }
81
78
  /**
@@ -83,7 +80,7 @@ class PoliciesApiWrapper {
83
80
  * @param req Criteria to get usage
84
81
  */
85
82
  async getPolicyTotalGasUsage(req) {
86
- const response = await this._api.getPolicyTotalGasUsage(req.id);
83
+ const response = await this.api.getPolicyTotalGasUsage(req.id);
87
84
  return response.body;
88
85
  }
89
86
  /**
@@ -92,63 +89,13 @@ class PoliciesApiWrapper {
92
89
  */
93
90
  async updateAllowFunction(req) {
94
91
  const { policy, policyRule, ...body } = req;
95
- const response = await this._api.updatePolicyAllowFunction(policy, policyRule, body);
92
+ const response = await this.api.updatePolicyAllowFunction(policy, policyRule, body);
96
93
  return response.body;
97
94
  }
98
- }
99
- __decorate([
100
- (0, httpErrorHandler_1.httpErrorHandler)(),
101
- __metadata("design:type", Function),
102
- __metadata("design:paramtypes", [model_1.CreatePolicyRequest]),
103
- __metadata("design:returntype", Promise)
104
- ], PoliciesApiWrapper.prototype, "create", null);
105
- __decorate([
106
- (0, httpErrorHandler_1.httpErrorHandler)(),
107
- __metadata("design:type", Function),
108
- __metadata("design:paramtypes", [Object]),
109
- __metadata("design:returntype", Promise)
110
- ], PoliciesApiWrapper.prototype, "update", null);
111
- __decorate([
112
- (0, httpErrorHandler_1.httpErrorHandler)(),
113
- __metadata("design:type", Function),
114
- __metadata("design:paramtypes", [model_1.CreatePolicyRuleRequest]),
115
- __metadata("design:returntype", Promise)
116
- ], PoliciesApiWrapper.prototype, "createAllowFunction", null);
117
- __decorate([
118
- (0, httpErrorHandler_1.httpErrorHandler)(),
119
- __metadata("design:type", Function),
120
- __metadata("design:paramtypes", [String]),
121
- __metadata("design:returntype", Promise)
122
- ], PoliciesApiWrapper.prototype, "delete", null);
123
- __decorate([
124
- (0, httpErrorHandler_1.httpErrorHandler)(),
125
- __metadata("design:type", Function),
126
- __metadata("design:paramtypes", [Object]),
127
- __metadata("design:returntype", Promise)
128
- ], PoliciesApiWrapper.prototype, "list", null);
129
- __decorate([
130
- (0, httpErrorHandler_1.httpErrorHandler)(),
131
- __metadata("design:type", Function),
132
- __metadata("design:paramtypes", [Object]),
133
- __metadata("design:returntype", Promise)
134
- ], PoliciesApiWrapper.prototype, "get", null);
135
- __decorate([
136
- (0, httpErrorHandler_1.httpErrorHandler)(),
137
- __metadata("design:type", Function),
138
- __metadata("design:paramtypes", [Object]),
139
- __metadata("design:returntype", Promise)
140
- ], PoliciesApiWrapper.prototype, "getAllowFunctions", null);
141
- __decorate([
142
- (0, httpErrorHandler_1.httpErrorHandler)(),
143
- __metadata("design:type", Function),
144
- __metadata("design:paramtypes", [Object]),
145
- __metadata("design:returntype", Promise)
146
- ], PoliciesApiWrapper.prototype, "getPolicyTotalGasUsage", null);
147
- __decorate([
148
- (0, httpErrorHandler_1.httpErrorHandler)(),
149
- __metadata("design:type", Function),
150
- __metadata("design:paramtypes", [Object]),
151
- __metadata("design:returntype", Promise)
152
- ], PoliciesApiWrapper.prototype, "updateAllowFunction", null);
95
+ };
96
+ PoliciesApiWrapper = __decorate([
97
+ httpErrorHandler_1.httpErrorHandler,
98
+ __metadata("design:paramtypes", [String, String])
99
+ ], PoliciesApiWrapper);
153
100
  exports.PoliciesApiWrapper = PoliciesApiWrapper;
154
101
  //# sourceMappingURL=policiesApiWrapper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"policiesApiWrapper.js","sourceRoot":"","sources":["../../src/wrapper/policiesApiWrapper.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAAoD;AACpD,8DAAyD;AACzD,oCAekB;AAClB,wCAA4C;AAE5C,MAAa,kBAAkB;IAG3B,YAAY,WAAmB,EAAE,QAAiB;QAC9C,IAA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AAC,GAAqC;QAClE,MAAM,EAAC,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI,EAAC,GAAG,GAAG,CAAC;QAC1C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,yBAAyB,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;QACpF,OAAO,QAAQ,CAAC,IAAI,CAAC;IACzB,CAAC;CACJ,CAAA;AAxFY,kBAAkB;IAD9B,mCAAgB;;GACJ,kBAAkB,CAwF9B;AAxFY,gDAAkB"}
@@ -1,6 +1,7 @@
1
- import { GetPolicyRulesRequest, PolicyRuleDeleteResponse, PolicyRuleResponse, PolicyRulesResponse, CreatePolicyRuleRequest, UpdatePolicyRuleRequest } from "../model";
2
- export declare class PolicyRulesApiWrapper {
3
- private readonly _api;
1
+ import { CreatePolicyRuleRequest, GetPolicyRulesRequest, PolicyRuleDeleteResponse, PolicyRuleResponse, PolicyRulesResponse, UpdatePolicyRuleRequest } from "../model";
2
+ import { BaseApiWrapper } from "./baseApiWrapper";
3
+ import { PolicyRulesApi } from "../generated/api/apis";
4
+ export declare class PolicyRulesApiWrapper extends BaseApiWrapper<PolicyRulesApi> {
4
5
  constructor(accessToken: string, basePath?: string);
5
6
  /**
6
7
  * Creates an allow function object.
@@ -10,22 +10,19 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.PolicyRulesApiWrapper = void 0;
13
- const httpErrorHandler_1 = require("./httpErrorHandler");
13
+ const baseApiWrapper_1 = require("./baseApiWrapper");
14
14
  const apis_1 = require("../generated/api/apis");
15
- const model_1 = require("../model");
16
- const version_1 = require("../version");
17
- class PolicyRulesApiWrapper {
15
+ const httpErrorHandler_1 = require("../utility/httpErrorHandler");
16
+ let PolicyRulesApiWrapper = class PolicyRulesApiWrapper extends baseApiWrapper_1.BaseApiWrapper {
18
17
  constructor(accessToken, basePath) {
19
- this._api = new apis_1.PolicyRulesApi(basePath);
20
- this._api.accessToken = accessToken;
21
- this._api.defaultHeaders["User-Agent"] = `${version_1.PACKAGE}@${version_1.VERSION}`;
18
+ super(apis_1.PolicyRulesApi, accessToken, basePath);
22
19
  }
23
20
  /**
24
21
  * Creates an allow function object.
25
22
  * @param req Parameters to create policy rules.
26
23
  */
27
24
  async create(req) {
28
- const response = await this._api.createPolicyRules(req);
25
+ const response = await this.api.createPolicyRules(req);
29
26
  return response.body;
30
27
  }
31
28
  /**
@@ -33,7 +30,7 @@ class PolicyRulesApiWrapper {
33
30
  * @param req Criteria to get policy rules by.
34
31
  */
35
32
  async list(req) {
36
- const response = await this._api.getPolicyRules(req?.expand, req?.policy);
33
+ const response = await this.api.getPolicyRules(req?.expand, req?.policy);
37
34
  return response.body;
38
35
  }
39
36
  /**
@@ -42,7 +39,7 @@ class PolicyRulesApiWrapper {
42
39
  */
43
40
  async update(req) {
44
41
  const { id, ...request } = req;
45
- const response = await this._api.updatePolicyRules(id, request);
42
+ const response = await this.api.updatePolicyRules(id, request);
46
43
  return response.body;
47
44
  }
48
45
  /**
@@ -50,33 +47,13 @@ class PolicyRulesApiWrapper {
50
47
  * @param id Id of the policy rule
51
48
  */
52
49
  async delete(id) {
53
- const response = await this._api.deletePolicyRules(id);
50
+ const response = await this.api.deletePolicyRules(id);
54
51
  return response.body;
55
52
  }
56
- }
57
- __decorate([
58
- (0, httpErrorHandler_1.httpErrorHandler)(),
59
- __metadata("design:type", Function),
60
- __metadata("design:paramtypes", [model_1.CreatePolicyRuleRequest]),
61
- __metadata("design:returntype", Promise)
62
- ], PolicyRulesApiWrapper.prototype, "create", null);
63
- __decorate([
64
- (0, httpErrorHandler_1.httpErrorHandler)(),
65
- __metadata("design:type", Function),
66
- __metadata("design:paramtypes", [Object]),
67
- __metadata("design:returntype", Promise)
68
- ], PolicyRulesApiWrapper.prototype, "list", null);
69
- __decorate([
70
- (0, httpErrorHandler_1.httpErrorHandler)(),
71
- __metadata("design:type", Function),
72
- __metadata("design:paramtypes", [Object]),
73
- __metadata("design:returntype", Promise)
74
- ], PolicyRulesApiWrapper.prototype, "update", null);
75
- __decorate([
76
- (0, httpErrorHandler_1.httpErrorHandler)(),
77
- __metadata("design:type", Function),
78
- __metadata("design:paramtypes", [String]),
79
- __metadata("design:returntype", Promise)
80
- ], PolicyRulesApiWrapper.prototype, "delete", null);
53
+ };
54
+ PolicyRulesApiWrapper = __decorate([
55
+ httpErrorHandler_1.httpErrorHandler,
56
+ __metadata("design:paramtypes", [String, String])
57
+ ], PolicyRulesApiWrapper);
81
58
  exports.PolicyRulesApiWrapper = PolicyRulesApiWrapper;
82
59
  //# sourceMappingURL=policyRulesApiWrapper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"policyRulesApiWrapper.js","sourceRoot":"","sources":["../../src/wrapper/policyRulesApiWrapper.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAAoD;AACpD,gDAAqD;AACrD,oCAOkB;AAClB,wCAA4C;AAE5C,MAAa,qBAAqB;IAG9B,YAAY,WAAmB,EAAE,QAAiB;QAC9C,IAAI,CAAC,IAAI,GAAG,IAAI,qBAAc,CAAC,QAAQ,CAAC,CAAC;QACzC,IAAI,CAAC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QACpC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,GAAG,GAAG,iBAAO,IAAI,iBAAO,EAAE,CAAC;IACrE,CAAC;IAED;;;OAGG;IAEU,AAAN,KAAK,CAAC,MAAM,CAAC,GAA4B;QAC5C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC;QACxD,OAAO,QAAQ,CAAC,IAAI,CAAC;IACzB,CAAC;IAED;;;OAGG;IAEU,AAAN,KAAK,CAAC,IAAI,CAAC,GAA2B;QACzC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE,MAAM,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,OAAO,QAAQ,CAAC,IAAI,CAAC;IACzB,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,IAAI,CAAC,GAA2B;QACzC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;QACzE,OAAO,QAAQ,CAAC,IAAI,CAAC;IACzB,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,MAAM,CAAC,GAA4B;QAC5C,MAAM,EAAC,EAAE,EAAE,GAAG,OAAO,EAAC,GAAG,GAAG,CAAC;QAC7B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QAC/D,OAAO,QAAQ,CAAC,IAAI,CAAC;IACzB,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,MAAM,CAAC,EAAU;QAC1B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC;QACtD,OAAO,QAAQ,CAAC,IAAI,CAAC;IACzB,CAAC;CACJ,CAAA;AAzCY,qBAAqB;IADjC,mCAAgB;;GACJ,qBAAqB,CAyCjC;AAzCY,sDAAqB"}
@@ -1,6 +1,7 @@
1
- import { UpdateProjectRequest, ProjectResponse, ProjectsResponse, ProjectRequest } from "../model";
2
- export declare class ProjectsApiWrapper {
3
- private readonly _api;
1
+ import { ProjectRequest, ProjectResponse, ProjectsResponse, UpdateProjectRequest } from "../model";
2
+ import { BaseApiWrapper } from "./baseApiWrapper";
3
+ import { ProjectsApi } from "../generated/api/projectsApi";
4
+ export declare class ProjectsApiWrapper extends BaseApiWrapper<ProjectsApi> {
4
5
  constructor(accessToken: string, basePath?: string);
5
6
  /**
6
7
  * Creates a project object.
@@ -10,22 +10,19 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.ProjectsApiWrapper = void 0;
13
- const httpErrorHandler_1 = require("./httpErrorHandler");
13
+ const baseApiWrapper_1 = require("./baseApiWrapper");
14
14
  const projectsApi_1 = require("../generated/api/projectsApi");
15
- const model_1 = require("../model");
16
- const version_1 = require("../version");
17
- class ProjectsApiWrapper {
15
+ const httpErrorHandler_1 = require("../utility/httpErrorHandler");
16
+ let ProjectsApiWrapper = class ProjectsApiWrapper extends baseApiWrapper_1.BaseApiWrapper {
18
17
  constructor(accessToken, basePath) {
19
- this._api = new projectsApi_1.ProjectsApi(basePath);
20
- this._api.accessToken = accessToken;
21
- this._api.defaultHeaders["User-Agent"] = `${version_1.PACKAGE}@${version_1.VERSION}`;
18
+ super(projectsApi_1.ProjectsApi, accessToken, basePath);
22
19
  }
23
20
  /**
24
21
  * Creates a project object.
25
22
  * @param req Parameters to create project
26
23
  */
27
24
  async create(req) {
28
- const response = await this._api.createProject(req);
25
+ const response = await this.api.createProject(req);
29
26
  return response.body;
30
27
  }
31
28
  /**
@@ -33,7 +30,7 @@ class ProjectsApiWrapper {
33
30
  * @param id Id of the project
34
31
  */
35
32
  async get(id) {
36
- const response = await this._api.getProject(id);
33
+ const response = await this.api.getProject(id);
37
34
  return response.body;
38
35
  }
39
36
  /**
@@ -41,7 +38,7 @@ class ProjectsApiWrapper {
41
38
  * @param project
42
39
  */
43
40
  async list() {
44
- const response = await this._api.getProjects();
41
+ const response = await this.api.getProjects();
45
42
  return response.body;
46
43
  }
47
44
  /**
@@ -50,33 +47,13 @@ class ProjectsApiWrapper {
50
47
  */
51
48
  async updateProject(req) {
52
49
  const { id, ...request } = req;
53
- const response = await this._api.updateProject(id, request);
50
+ const response = await this.api.updateProject(id, request);
54
51
  return response.body;
55
52
  }
56
- }
57
- __decorate([
58
- (0, httpErrorHandler_1.httpErrorHandler)(),
59
- __metadata("design:type", Function),
60
- __metadata("design:paramtypes", [model_1.ProjectRequest]),
61
- __metadata("design:returntype", Promise)
62
- ], ProjectsApiWrapper.prototype, "create", null);
63
- __decorate([
64
- (0, httpErrorHandler_1.httpErrorHandler)(),
65
- __metadata("design:type", Function),
66
- __metadata("design:paramtypes", [String]),
67
- __metadata("design:returntype", Promise)
68
- ], ProjectsApiWrapper.prototype, "get", null);
69
- __decorate([
70
- (0, httpErrorHandler_1.httpErrorHandler)(),
71
- __metadata("design:type", Function),
72
- __metadata("design:paramtypes", []),
73
- __metadata("design:returntype", Promise)
74
- ], ProjectsApiWrapper.prototype, "list", null);
75
- __decorate([
76
- (0, httpErrorHandler_1.httpErrorHandler)(),
77
- __metadata("design:type", Function),
78
- __metadata("design:paramtypes", [Object]),
79
- __metadata("design:returntype", Promise)
80
- ], ProjectsApiWrapper.prototype, "updateProject", null);
53
+ };
54
+ ProjectsApiWrapper = __decorate([
55
+ httpErrorHandler_1.httpErrorHandler,
56
+ __metadata("design:paramtypes", [String, String])
57
+ ], ProjectsApiWrapper);
81
58
  exports.ProjectsApiWrapper = ProjectsApiWrapper;
82
59
  //# sourceMappingURL=projectsApiWrapper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"projectsApiWrapper.js","sourceRoot":"","sources":["../../src/wrapper/projectsApiWrapper.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAAoD;AACpD,8DAAyD;AACzD,oCAAiG;AACjG,wCAA4C;AAE5C,MAAa,kBAAkB;IAG3B,YAAY,WAAmB,EAAE,QAAiB;QAC9C,IAAI,CAAC,IAAI,GAAG,IAAI,yBAAW,CAAC,QAAQ,CAAC,CAAC;QACtC,IAAI,CAAC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QACpC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,GAAG,GAAG,iBAAO,IAAI,iBAAO,EAAE,CAAC;IACrE,CAAC;IAED;;;OAGG;IAEU,AAAN,KAAK,CAAC,MAAM,CAAC,GAAmB;QACnC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,aAAa,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AED;;;OAGG;IACI,KAAK,CAAC,MAAM,CAAC,GAAmB;QACnC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QACnD,OAAO,QAAQ,CAAC,IAAI,CAAC;IACzB,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,GAAG,CAAC,EAAU;QACvB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;QAC/C,OAAO,QAAQ,CAAC,IAAI,CAAC;IACzB,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,IAAI;QACb,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;QAC9C,OAAO,QAAQ,CAAC,IAAI,CAAC;IACzB,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,aAAa,CAAC,GAAyB;QAChD,MAAM,EAAC,EAAE,EAAE,GAAG,OAAO,EAAC,GAAG,GAAG,CAAC;QAC7B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QAC3D,OAAO,QAAQ,CAAC,IAAI,CAAC;IACzB,CAAC;CACJ,CAAA;AAzCY,kBAAkB;IAD9B,mCAAgB;;GACJ,kBAAkB,CAyC9B;AAzCY,gDAAkB"}
@@ -1,6 +1,7 @@
1
- import { ListSessionsRequest, SignatureSessionRequest, SessionResponse, SessionsResponse, CreateSessionRequest, RevokeSessionRequest } from "../model";
2
- export declare class SessionsApiWrapper {
3
- private readonly _api;
1
+ import { CreateSessionRequest, ListSessionsRequest, RevokeSessionRequest, SessionResponse, SessionsResponse, SignatureSessionRequest } from "../model";
2
+ import { BaseApiWrapper } from "./baseApiWrapper";
3
+ import { SessionsApi } from "../generated/api/sessionsApi";
4
+ export declare class SessionsApiWrapper extends BaseApiWrapper<SessionsApi> {
4
5
  constructor(accessToken: string, basePath?: string);
5
6
  /**
6
7
  * Creates the session for the account.