@keynetra/client 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -0
- package/package.json +26 -0
- package/src/apis/AccessApi.ts +326 -0
- package/src/apis/AuthApi.ts +193 -0
- package/src/apis/DevApi.ts +168 -0
- package/src/apis/HealthApi.ts +216 -0
- package/src/apis/ManagementApi.ts +2641 -0
- package/src/apis/PlaygroundApi.ts +131 -0
- package/src/apis/index.ts +8 -0
- package/src/index.ts +6 -0
- package/src/keynetra-client.ts +35 -0
- package/src/models/ACLCreate.ts +111 -0
- package/src/models/ACLOut.ts +137 -0
- package/src/models/AccessDecisionResponse.ts +115 -0
- package/src/models/AccessRequest.ts +106 -0
- package/src/models/AdminLoginRequest.ts +75 -0
- package/src/models/AdminLoginResponse.ts +100 -0
- package/src/models/AuditRecordOut.ts +172 -0
- package/src/models/AuthModelCreate.ts +66 -0
- package/src/models/AuthModelOut.ts +102 -0
- package/src/models/BatchAccessItem.ts +74 -0
- package/src/models/BatchAccessRequest.ts +98 -0
- package/src/models/BatchAccessResponse.ts +82 -0
- package/src/models/BatchAccessResult.ts +83 -0
- package/src/models/DataValue.ts +46 -0
- package/src/models/HTTPValidationError.ts +73 -0
- package/src/models/ImpactAnalysisRequest.ts +66 -0
- package/src/models/ImpactAnalysisResponse.ts +73 -0
- package/src/models/LocationInner.ts +46 -0
- package/src/models/MetaBody.ts +89 -0
- package/src/models/PermissionCreate.ts +66 -0
- package/src/models/PermissionOut.ts +75 -0
- package/src/models/PermissionUpdate.ts +66 -0
- package/src/models/PlaygroundEvaluateRequest.ts +90 -0
- package/src/models/PlaygroundInput.ts +89 -0
- package/src/models/PlaygroundPolicy.ts +98 -0
- package/src/models/PolicyCreate.ts +98 -0
- package/src/models/PolicyOut.ts +110 -0
- package/src/models/PolicySimulationInput.ts +81 -0
- package/src/models/PolicySimulationRequest.ts +81 -0
- package/src/models/PolicySimulationResponse.ts +75 -0
- package/src/models/RelationshipCreate.ts +102 -0
- package/src/models/RelationshipOut.ts +111 -0
- package/src/models/RoleCreate.ts +66 -0
- package/src/models/RoleOut.ts +75 -0
- package/src/models/RoleUpdate.ts +66 -0
- package/src/models/SimulationResponse.ts +115 -0
- package/src/models/SuccessResponseACLOut.ts +97 -0
- package/src/models/SuccessResponseAccessDecisionResponse.ts +97 -0
- package/src/models/SuccessResponseAdminLoginResponse.ts +97 -0
- package/src/models/SuccessResponseAuthModelOut.ts +97 -0
- package/src/models/SuccessResponseBatchAccessResponse.ts +97 -0
- package/src/models/SuccessResponseDictStrAny.ts +90 -0
- package/src/models/SuccessResponseDictStrInt.ts +90 -0
- package/src/models/SuccessResponseDictStrObject.ts +90 -0
- package/src/models/SuccessResponseDictStrStr.ts +90 -0
- package/src/models/SuccessResponseDictStrUnionIntStr.ts +97 -0
- package/src/models/SuccessResponseImpactAnalysisResponse.ts +97 -0
- package/src/models/SuccessResponseListACLOut.ts +97 -0
- package/src/models/SuccessResponseListAuditRecordOut.ts +97 -0
- package/src/models/SuccessResponseListDictStrStr.ts +90 -0
- package/src/models/SuccessResponseListPermissionOut.ts +97 -0
- package/src/models/SuccessResponseListPolicyOut.ts +97 -0
- package/src/models/SuccessResponseListRoleOut.ts +97 -0
- package/src/models/SuccessResponsePermissionOut.ts +97 -0
- package/src/models/SuccessResponsePolicyOut.ts +97 -0
- package/src/models/SuccessResponsePolicySimulationResponse.ts +97 -0
- package/src/models/SuccessResponseRelationshipOut.ts +97 -0
- package/src/models/SuccessResponseSimulationResponse.ts +97 -0
- package/src/models/ValidationError.ts +108 -0
- package/src/models/index.ts +61 -0
- package/src/runtime.ts +450 -0
package/README.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# @keynetra/client
|
|
2
|
+
|
|
3
|
+
[](https://opensource.org/licenses/Apache-2.0)
|
|
4
|
+
[]()
|
|
5
|
+
[](https://docs.keynetra.com/sdks/typescript)
|
|
6
|
+
|
|
7
|
+
Official TypeScript Client SDK for the [KeyNetra](https://keynetra.com) authorization platform. 🛡️
|
|
8
|
+
|
|
9
|
+
KeyNetra provides high-performance, distributed authorization as a service. This SDK allows your TypeScript applications to integrate seamlessly with KeyNetra for access control and policy management.
|
|
10
|
+
|
|
11
|
+
## ✨ Features
|
|
12
|
+
|
|
13
|
+
- **🚀 Unified Client**: Simple entry point for all API operations.
|
|
14
|
+
- **🛡️ Type Safety**: Full type definitions for requests and responses.
|
|
15
|
+
- **🔑 Security**: Built-in support for API Key and Bearer token authentication.
|
|
16
|
+
- **⚡ Performance**: Optimized for low-latency authorization checks.
|
|
17
|
+
|
|
18
|
+
## 📦 Installation
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install @keynetra/client
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## 🚀 Quick Start
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
import { KeyNetraClient } from "@keynetra/client";
|
|
28
|
+
|
|
29
|
+
const client = new KeyNetraClient({
|
|
30
|
+
baseUrl: "http://localhost:8080",
|
|
31
|
+
apiKey: "YOUR_API_KEY"
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
// Perform an access check
|
|
35
|
+
const decision = await client.access.checkAccess({
|
|
36
|
+
subject: "user:123",
|
|
37
|
+
action: "read",
|
|
38
|
+
resource: "document:456"
|
|
39
|
+
});
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
## 📚 Documentation
|
|
45
|
+
|
|
46
|
+
For full API documentation, please visit the [KeyNetra Documentation Portal](https://docs.keynetra.com/sdks/typescript).
|
|
47
|
+
|
|
48
|
+
## 🤝 Support
|
|
49
|
+
|
|
50
|
+
- **Source**: [https://github.com/keynetra/keynetra-client-typescript](https://github.com/keynetra/keynetra-client-typescript)
|
|
51
|
+
- **Issues**: [GitHub Issues](https://github.com/keynetra/keynetra-client-typescript/issues)
|
|
52
|
+
- **License**: Apache-2.0
|
|
53
|
+
|
package/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@keynetra/client",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Official TypeScript Client SDK for the KeyNetra authorization platform.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"src",
|
|
12
|
+
"README.md"
|
|
13
|
+
],
|
|
14
|
+
"author": "KeyNetra <business.keynetra@gmail.com>",
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/keynetra/keynetra-client-typescript.git"
|
|
18
|
+
},
|
|
19
|
+
"homepage": "https://github.com/keynetra/keynetra-client-typescript",
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsc -p tsconfig.json"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"typescript": "^5.0.0"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* KeyNetra
|
|
5
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 0.1.1
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
import * as runtime from '../runtime';
|
|
17
|
+
import type {
|
|
18
|
+
AccessRequest,
|
|
19
|
+
BatchAccessRequest,
|
|
20
|
+
HTTPValidationError,
|
|
21
|
+
SuccessResponseAccessDecisionResponse,
|
|
22
|
+
SuccessResponseBatchAccessResponse,
|
|
23
|
+
SuccessResponseSimulationResponse,
|
|
24
|
+
} from '../models/index';
|
|
25
|
+
import {
|
|
26
|
+
AccessRequestFromJSON,
|
|
27
|
+
AccessRequestToJSON,
|
|
28
|
+
BatchAccessRequestFromJSON,
|
|
29
|
+
BatchAccessRequestToJSON,
|
|
30
|
+
HTTPValidationErrorFromJSON,
|
|
31
|
+
HTTPValidationErrorToJSON,
|
|
32
|
+
SuccessResponseAccessDecisionResponseFromJSON,
|
|
33
|
+
SuccessResponseAccessDecisionResponseToJSON,
|
|
34
|
+
SuccessResponseBatchAccessResponseFromJSON,
|
|
35
|
+
SuccessResponseBatchAccessResponseToJSON,
|
|
36
|
+
SuccessResponseSimulationResponseFromJSON,
|
|
37
|
+
SuccessResponseSimulationResponseToJSON,
|
|
38
|
+
} from '../models/index';
|
|
39
|
+
|
|
40
|
+
export interface CheckAccessBatchCheckAccessBatchPostRequest {
|
|
41
|
+
batchAccessRequest: BatchAccessRequest;
|
|
42
|
+
policySet?: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface CheckAccessCheckAccessPostRequest {
|
|
46
|
+
accessRequest: AccessRequest;
|
|
47
|
+
policySet?: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface SimulateSimulatePostRequest {
|
|
51
|
+
accessRequest: AccessRequest;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* AccessApi - interface
|
|
56
|
+
*
|
|
57
|
+
* @export
|
|
58
|
+
* @interface AccessApiInterface
|
|
59
|
+
*/
|
|
60
|
+
export interface AccessApiInterface {
|
|
61
|
+
/**
|
|
62
|
+
* Creates request options for checkAccessBatchCheckAccessBatchPost without sending the request
|
|
63
|
+
* @param {BatchAccessRequest} batchAccessRequest
|
|
64
|
+
* @param {string} [policySet]
|
|
65
|
+
* @throws {RequiredError}
|
|
66
|
+
* @memberof AccessApiInterface
|
|
67
|
+
*/
|
|
68
|
+
checkAccessBatchCheckAccessBatchPostRequestOpts(requestParameters: CheckAccessBatchCheckAccessBatchPostRequest): Promise<runtime.RequestOpts>;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
*
|
|
72
|
+
* @summary Check Access Batch
|
|
73
|
+
* @param {BatchAccessRequest} batchAccessRequest
|
|
74
|
+
* @param {string} [policySet]
|
|
75
|
+
* @param {*} [options] Override http request option.
|
|
76
|
+
* @throws {RequiredError}
|
|
77
|
+
* @memberof AccessApiInterface
|
|
78
|
+
*/
|
|
79
|
+
checkAccessBatchCheckAccessBatchPostRaw(requestParameters: CheckAccessBatchCheckAccessBatchPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SuccessResponseBatchAccessResponse>>;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Check Access Batch
|
|
83
|
+
*/
|
|
84
|
+
checkAccessBatchCheckAccessBatchPost(requestParameters: CheckAccessBatchCheckAccessBatchPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SuccessResponseBatchAccessResponse>;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Creates request options for checkAccessCheckAccessPost without sending the request
|
|
88
|
+
* @param {AccessRequest} accessRequest
|
|
89
|
+
* @param {string} [policySet]
|
|
90
|
+
* @throws {RequiredError}
|
|
91
|
+
* @memberof AccessApiInterface
|
|
92
|
+
*/
|
|
93
|
+
checkAccessCheckAccessPostRequestOpts(requestParameters: CheckAccessCheckAccessPostRequest): Promise<runtime.RequestOpts>;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
*
|
|
97
|
+
* @summary Check Access
|
|
98
|
+
* @param {AccessRequest} accessRequest
|
|
99
|
+
* @param {string} [policySet]
|
|
100
|
+
* @param {*} [options] Override http request option.
|
|
101
|
+
* @throws {RequiredError}
|
|
102
|
+
* @memberof AccessApiInterface
|
|
103
|
+
*/
|
|
104
|
+
checkAccessCheckAccessPostRaw(requestParameters: CheckAccessCheckAccessPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SuccessResponseAccessDecisionResponse>>;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Check Access
|
|
108
|
+
*/
|
|
109
|
+
checkAccessCheckAccessPost(requestParameters: CheckAccessCheckAccessPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SuccessResponseAccessDecisionResponse>;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Creates request options for simulateSimulatePost without sending the request
|
|
113
|
+
* @param {AccessRequest} accessRequest
|
|
114
|
+
* @throws {RequiredError}
|
|
115
|
+
* @memberof AccessApiInterface
|
|
116
|
+
*/
|
|
117
|
+
simulateSimulatePostRequestOpts(requestParameters: SimulateSimulatePostRequest): Promise<runtime.RequestOpts>;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
*
|
|
121
|
+
* @summary Simulate
|
|
122
|
+
* @param {AccessRequest} accessRequest
|
|
123
|
+
* @param {*} [options] Override http request option.
|
|
124
|
+
* @throws {RequiredError}
|
|
125
|
+
* @memberof AccessApiInterface
|
|
126
|
+
*/
|
|
127
|
+
simulateSimulatePostRaw(requestParameters: SimulateSimulatePostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SuccessResponseSimulationResponse>>;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Simulate
|
|
131
|
+
*/
|
|
132
|
+
simulateSimulatePost(requestParameters: SimulateSimulatePostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SuccessResponseSimulationResponse>;
|
|
133
|
+
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
*
|
|
138
|
+
*/
|
|
139
|
+
export class AccessApi extends runtime.BaseAPI implements AccessApiInterface {
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Creates request options for checkAccessBatchCheckAccessBatchPost without sending the request
|
|
143
|
+
*/
|
|
144
|
+
async checkAccessBatchCheckAccessBatchPostRequestOpts(requestParameters: CheckAccessBatchCheckAccessBatchPostRequest): Promise<runtime.RequestOpts> {
|
|
145
|
+
if (requestParameters['batchAccessRequest'] == null) {
|
|
146
|
+
throw new runtime.RequiredError(
|
|
147
|
+
'batchAccessRequest',
|
|
148
|
+
'Required parameter "batchAccessRequest" was null or undefined when calling checkAccessBatchCheckAccessBatchPost().'
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
const queryParameters: any = {};
|
|
153
|
+
|
|
154
|
+
if (requestParameters['policySet'] != null) {
|
|
155
|
+
queryParameters['policy_set'] = requestParameters['policySet'];
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
159
|
+
|
|
160
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
161
|
+
|
|
162
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
163
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // APIKeyHeader authentication
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
167
|
+
const token = this.configuration.accessToken;
|
|
168
|
+
const tokenString = await token("HTTPBearer", []);
|
|
169
|
+
|
|
170
|
+
if (tokenString) {
|
|
171
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
let urlPath = `/check-access-batch`;
|
|
176
|
+
|
|
177
|
+
return {
|
|
178
|
+
path: urlPath,
|
|
179
|
+
method: 'POST',
|
|
180
|
+
headers: headerParameters,
|
|
181
|
+
query: queryParameters,
|
|
182
|
+
body: BatchAccessRequestToJSON(requestParameters['batchAccessRequest']),
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Check Access Batch
|
|
188
|
+
*/
|
|
189
|
+
async checkAccessBatchCheckAccessBatchPostRaw(requestParameters: CheckAccessBatchCheckAccessBatchPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SuccessResponseBatchAccessResponse>> {
|
|
190
|
+
const requestOptions = await this.checkAccessBatchCheckAccessBatchPostRequestOpts(requestParameters);
|
|
191
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
192
|
+
|
|
193
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => SuccessResponseBatchAccessResponseFromJSON(jsonValue));
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Check Access Batch
|
|
198
|
+
*/
|
|
199
|
+
async checkAccessBatchCheckAccessBatchPost(requestParameters: CheckAccessBatchCheckAccessBatchPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SuccessResponseBatchAccessResponse> {
|
|
200
|
+
const response = await this.checkAccessBatchCheckAccessBatchPostRaw(requestParameters, initOverrides);
|
|
201
|
+
return await response.value();
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Creates request options for checkAccessCheckAccessPost without sending the request
|
|
206
|
+
*/
|
|
207
|
+
async checkAccessCheckAccessPostRequestOpts(requestParameters: CheckAccessCheckAccessPostRequest): Promise<runtime.RequestOpts> {
|
|
208
|
+
if (requestParameters['accessRequest'] == null) {
|
|
209
|
+
throw new runtime.RequiredError(
|
|
210
|
+
'accessRequest',
|
|
211
|
+
'Required parameter "accessRequest" was null or undefined when calling checkAccessCheckAccessPost().'
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
const queryParameters: any = {};
|
|
216
|
+
|
|
217
|
+
if (requestParameters['policySet'] != null) {
|
|
218
|
+
queryParameters['policy_set'] = requestParameters['policySet'];
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
222
|
+
|
|
223
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
224
|
+
|
|
225
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
226
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // APIKeyHeader authentication
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
230
|
+
const token = this.configuration.accessToken;
|
|
231
|
+
const tokenString = await token("HTTPBearer", []);
|
|
232
|
+
|
|
233
|
+
if (tokenString) {
|
|
234
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
let urlPath = `/check-access`;
|
|
239
|
+
|
|
240
|
+
return {
|
|
241
|
+
path: urlPath,
|
|
242
|
+
method: 'POST',
|
|
243
|
+
headers: headerParameters,
|
|
244
|
+
query: queryParameters,
|
|
245
|
+
body: AccessRequestToJSON(requestParameters['accessRequest']),
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Check Access
|
|
251
|
+
*/
|
|
252
|
+
async checkAccessCheckAccessPostRaw(requestParameters: CheckAccessCheckAccessPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SuccessResponseAccessDecisionResponse>> {
|
|
253
|
+
const requestOptions = await this.checkAccessCheckAccessPostRequestOpts(requestParameters);
|
|
254
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
255
|
+
|
|
256
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => SuccessResponseAccessDecisionResponseFromJSON(jsonValue));
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Check Access
|
|
261
|
+
*/
|
|
262
|
+
async checkAccessCheckAccessPost(requestParameters: CheckAccessCheckAccessPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SuccessResponseAccessDecisionResponse> {
|
|
263
|
+
const response = await this.checkAccessCheckAccessPostRaw(requestParameters, initOverrides);
|
|
264
|
+
return await response.value();
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Creates request options for simulateSimulatePost without sending the request
|
|
269
|
+
*/
|
|
270
|
+
async simulateSimulatePostRequestOpts(requestParameters: SimulateSimulatePostRequest): Promise<runtime.RequestOpts> {
|
|
271
|
+
if (requestParameters['accessRequest'] == null) {
|
|
272
|
+
throw new runtime.RequiredError(
|
|
273
|
+
'accessRequest',
|
|
274
|
+
'Required parameter "accessRequest" was null or undefined when calling simulateSimulatePost().'
|
|
275
|
+
);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
const queryParameters: any = {};
|
|
279
|
+
|
|
280
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
281
|
+
|
|
282
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
283
|
+
|
|
284
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
285
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // APIKeyHeader authentication
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
289
|
+
const token = this.configuration.accessToken;
|
|
290
|
+
const tokenString = await token("HTTPBearer", []);
|
|
291
|
+
|
|
292
|
+
if (tokenString) {
|
|
293
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
let urlPath = `/simulate`;
|
|
298
|
+
|
|
299
|
+
return {
|
|
300
|
+
path: urlPath,
|
|
301
|
+
method: 'POST',
|
|
302
|
+
headers: headerParameters,
|
|
303
|
+
query: queryParameters,
|
|
304
|
+
body: AccessRequestToJSON(requestParameters['accessRequest']),
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* Simulate
|
|
310
|
+
*/
|
|
311
|
+
async simulateSimulatePostRaw(requestParameters: SimulateSimulatePostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SuccessResponseSimulationResponse>> {
|
|
312
|
+
const requestOptions = await this.simulateSimulatePostRequestOpts(requestParameters);
|
|
313
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
314
|
+
|
|
315
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => SuccessResponseSimulationResponseFromJSON(jsonValue));
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* Simulate
|
|
320
|
+
*/
|
|
321
|
+
async simulateSimulatePost(requestParameters: SimulateSimulatePostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SuccessResponseSimulationResponse> {
|
|
322
|
+
const response = await this.simulateSimulatePostRaw(requestParameters, initOverrides);
|
|
323
|
+
return await response.value();
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* KeyNetra
|
|
5
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 0.1.1
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
import * as runtime from '../runtime';
|
|
17
|
+
import type {
|
|
18
|
+
AdminLoginRequest,
|
|
19
|
+
HTTPValidationError,
|
|
20
|
+
SuccessResponseAdminLoginResponse,
|
|
21
|
+
} from '../models/index';
|
|
22
|
+
import {
|
|
23
|
+
AdminLoginRequestFromJSON,
|
|
24
|
+
AdminLoginRequestToJSON,
|
|
25
|
+
HTTPValidationErrorFromJSON,
|
|
26
|
+
HTTPValidationErrorToJSON,
|
|
27
|
+
SuccessResponseAdminLoginResponseFromJSON,
|
|
28
|
+
SuccessResponseAdminLoginResponseToJSON,
|
|
29
|
+
} from '../models/index';
|
|
30
|
+
|
|
31
|
+
export interface AdminLoginAdminLoginPostRequest {
|
|
32
|
+
adminLoginRequest: AdminLoginRequest;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface AdminLoginAdminLoginPost0Request {
|
|
36
|
+
adminLoginRequest: AdminLoginRequest;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* AuthApi - interface
|
|
41
|
+
*
|
|
42
|
+
* @export
|
|
43
|
+
* @interface AuthApiInterface
|
|
44
|
+
*/
|
|
45
|
+
export interface AuthApiInterface {
|
|
46
|
+
/**
|
|
47
|
+
* Creates request options for adminLoginAdminLoginPost without sending the request
|
|
48
|
+
* @param {AdminLoginRequest} adminLoginRequest
|
|
49
|
+
* @throws {RequiredError}
|
|
50
|
+
* @memberof AuthApiInterface
|
|
51
|
+
*/
|
|
52
|
+
adminLoginAdminLoginPostRequestOpts(requestParameters: AdminLoginAdminLoginPostRequest): Promise<runtime.RequestOpts>;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
*
|
|
56
|
+
* @summary Admin Login
|
|
57
|
+
* @param {AdminLoginRequest} adminLoginRequest
|
|
58
|
+
* @param {*} [options] Override http request option.
|
|
59
|
+
* @throws {RequiredError}
|
|
60
|
+
* @memberof AuthApiInterface
|
|
61
|
+
*/
|
|
62
|
+
adminLoginAdminLoginPostRaw(requestParameters: AdminLoginAdminLoginPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SuccessResponseAdminLoginResponse>>;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Admin Login
|
|
66
|
+
*/
|
|
67
|
+
adminLoginAdminLoginPost(requestParameters: AdminLoginAdminLoginPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SuccessResponseAdminLoginResponse>;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Creates request options for adminLoginAdminLoginPost_1 without sending the request
|
|
71
|
+
* @param {AdminLoginRequest} adminLoginRequest
|
|
72
|
+
* @throws {RequiredError}
|
|
73
|
+
* @memberof AuthApiInterface
|
|
74
|
+
*/
|
|
75
|
+
adminLoginAdminLoginPost_1RequestOpts(requestParameters: AdminLoginAdminLoginPost0Request): Promise<runtime.RequestOpts>;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
*
|
|
79
|
+
* @summary Admin Login
|
|
80
|
+
* @param {AdminLoginRequest} adminLoginRequest
|
|
81
|
+
* @param {*} [options] Override http request option.
|
|
82
|
+
* @throws {RequiredError}
|
|
83
|
+
* @memberof AuthApiInterface
|
|
84
|
+
*/
|
|
85
|
+
adminLoginAdminLoginPost_1Raw(requestParameters: AdminLoginAdminLoginPost0Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SuccessResponseAdminLoginResponse>>;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Admin Login
|
|
89
|
+
*/
|
|
90
|
+
adminLoginAdminLoginPost_1(requestParameters: AdminLoginAdminLoginPost0Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SuccessResponseAdminLoginResponse>;
|
|
91
|
+
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
*
|
|
96
|
+
*/
|
|
97
|
+
export class AuthApi extends runtime.BaseAPI implements AuthApiInterface {
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Creates request options for adminLoginAdminLoginPost without sending the request
|
|
101
|
+
*/
|
|
102
|
+
async adminLoginAdminLoginPostRequestOpts(requestParameters: AdminLoginAdminLoginPostRequest): Promise<runtime.RequestOpts> {
|
|
103
|
+
if (requestParameters['adminLoginRequest'] == null) {
|
|
104
|
+
throw new runtime.RequiredError(
|
|
105
|
+
'adminLoginRequest',
|
|
106
|
+
'Required parameter "adminLoginRequest" was null or undefined when calling adminLoginAdminLoginPost().'
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const queryParameters: any = {};
|
|
111
|
+
|
|
112
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
113
|
+
|
|
114
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
let urlPath = `/admin/login`;
|
|
118
|
+
|
|
119
|
+
return {
|
|
120
|
+
path: urlPath,
|
|
121
|
+
method: 'POST',
|
|
122
|
+
headers: headerParameters,
|
|
123
|
+
query: queryParameters,
|
|
124
|
+
body: AdminLoginRequestToJSON(requestParameters['adminLoginRequest']),
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Admin Login
|
|
130
|
+
*/
|
|
131
|
+
async adminLoginAdminLoginPostRaw(requestParameters: AdminLoginAdminLoginPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SuccessResponseAdminLoginResponse>> {
|
|
132
|
+
const requestOptions = await this.adminLoginAdminLoginPostRequestOpts(requestParameters);
|
|
133
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
134
|
+
|
|
135
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => SuccessResponseAdminLoginResponseFromJSON(jsonValue));
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Admin Login
|
|
140
|
+
*/
|
|
141
|
+
async adminLoginAdminLoginPost(requestParameters: AdminLoginAdminLoginPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SuccessResponseAdminLoginResponse> {
|
|
142
|
+
const response = await this.adminLoginAdminLoginPostRaw(requestParameters, initOverrides);
|
|
143
|
+
return await response.value();
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Creates request options for adminLoginAdminLoginPost_1 without sending the request
|
|
148
|
+
*/
|
|
149
|
+
async adminLoginAdminLoginPost_1RequestOpts(requestParameters: AdminLoginAdminLoginPost0Request): Promise<runtime.RequestOpts> {
|
|
150
|
+
if (requestParameters['adminLoginRequest'] == null) {
|
|
151
|
+
throw new runtime.RequiredError(
|
|
152
|
+
'adminLoginRequest',
|
|
153
|
+
'Required parameter "adminLoginRequest" was null or undefined when calling adminLoginAdminLoginPost_1().'
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
const queryParameters: any = {};
|
|
158
|
+
|
|
159
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
160
|
+
|
|
161
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
let urlPath = `/admin/login`;
|
|
165
|
+
|
|
166
|
+
return {
|
|
167
|
+
path: urlPath,
|
|
168
|
+
method: 'POST',
|
|
169
|
+
headers: headerParameters,
|
|
170
|
+
query: queryParameters,
|
|
171
|
+
body: AdminLoginRequestToJSON(requestParameters['adminLoginRequest']),
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Admin Login
|
|
177
|
+
*/
|
|
178
|
+
async adminLoginAdminLoginPost_1Raw(requestParameters: AdminLoginAdminLoginPost0Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SuccessResponseAdminLoginResponse>> {
|
|
179
|
+
const requestOptions = await this.adminLoginAdminLoginPost_1RequestOpts(requestParameters);
|
|
180
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
181
|
+
|
|
182
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => SuccessResponseAdminLoginResponseFromJSON(jsonValue));
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Admin Login
|
|
187
|
+
*/
|
|
188
|
+
async adminLoginAdminLoginPost_1(requestParameters: AdminLoginAdminLoginPost0Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SuccessResponseAdminLoginResponse> {
|
|
189
|
+
const response = await this.adminLoginAdminLoginPost_1Raw(requestParameters, initOverrides);
|
|
190
|
+
return await response.value();
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
}
|