@lwshen/vault-hub-ts-fetch-client 0.0.1-beta.2
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/.openapi-generator/FILES +35 -0
- package/.openapi-generator/VERSION +1 -0
- package/.openapi-generator-ignore +23 -0
- package/README.md +46 -0
- package/dist/apis/APIKeyApi.d.ts +64 -0
- package/dist/apis/APIKeyApi.js +270 -0
- package/dist/apis/AuditApi.d.ts +33 -0
- package/dist/apis/AuditApi.js +142 -0
- package/dist/apis/AuthApi.d.ts +48 -0
- package/dist/apis/AuthApi.js +211 -0
- package/dist/apis/CliApi.d.ts +48 -0
- package/dist/apis/CliApi.js +209 -0
- package/dist/apis/DefaultApi.d.ts +26 -0
- package/dist/apis/DefaultApi.js +121 -0
- package/dist/apis/UserApi.d.ts +26 -0
- package/dist/apis/UserApi.js +121 -0
- package/dist/apis/VaultApi.d.ts +71 -0
- package/dist/apis/VaultApi.js +302 -0
- package/dist/apis/index.d.ts +7 -0
- package/dist/apis/index.js +25 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +21 -0
- package/dist/models/APIKeysResponse.d.ts +51 -0
- package/dist/models/APIKeysResponse.js +64 -0
- package/dist/models/AuditLog.d.ts +80 -0
- package/dist/models/AuditLog.js +81 -0
- package/dist/models/AuditLogsResponse.d.ts +51 -0
- package/dist/models/AuditLogsResponse.js +64 -0
- package/dist/models/CreateAPIKeyRequest.d.ts +44 -0
- package/dist/models/CreateAPIKeyRequest.js +55 -0
- package/dist/models/CreateAPIKeyResponse.d.ts +39 -0
- package/dist/models/CreateAPIKeyResponse.js +56 -0
- package/dist/models/CreateVaultRequest.d.ts +50 -0
- package/dist/models/CreateVaultRequest.js +59 -0
- package/dist/models/EnableClientEncryption.d.ts +25 -0
- package/dist/models/EnableClientEncryption.js +51 -0
- package/dist/models/GetUserResponse.d.ts +44 -0
- package/dist/models/GetUserResponse.js +55 -0
- package/dist/models/HealthCheckResponse.d.ts +38 -0
- package/dist/models/HealthCheckResponse.js +51 -0
- package/dist/models/LoginRequest.d.ts +38 -0
- package/dist/models/LoginRequest.js +55 -0
- package/dist/models/LoginResponse.d.ts +32 -0
- package/dist/models/LoginResponse.js +51 -0
- package/dist/models/SignupRequest.d.ts +44 -0
- package/dist/models/SignupRequest.js +59 -0
- package/dist/models/SignupResponse.d.ts +32 -0
- package/dist/models/SignupResponse.js +51 -0
- package/dist/models/UpdateAPIKeyRequest.d.ts +50 -0
- package/dist/models/UpdateAPIKeyRequest.js +55 -0
- package/dist/models/UpdateVaultRequest.d.ts +50 -0
- package/dist/models/UpdateVaultRequest.js +55 -0
- package/dist/models/Vault.d.ts +74 -0
- package/dist/models/Vault.js +69 -0
- package/dist/models/VaultAPIKey.d.ts +75 -0
- package/dist/models/VaultAPIKey.js +72 -0
- package/dist/models/VaultLite.d.ts +56 -0
- package/dist/models/VaultLite.js +61 -0
- package/dist/models/index.d.ts +18 -0
- package/dist/models/index.js +36 -0
- package/dist/runtime.d.ts +184 -0
- package/dist/runtime.js +564 -0
- package/package.json +19 -0
- package/src/apis/APIKeyApi.ts +219 -0
- package/src/apis/AuditApi.ts +98 -0
- package/src/apis/AuthApi.ts +144 -0
- package/src/apis/CliApi.ts +133 -0
- package/src/apis/DefaultApi.ts +56 -0
- package/src/apis/UserApi.ts +56 -0
- package/src/apis/VaultApi.ts +226 -0
- package/src/apis/index.ts +9 -0
- package/src/index.ts +5 -0
- package/src/models/APIKeysResponse.ts +101 -0
- package/src/models/AuditLog.ts +141 -0
- package/src/models/AuditLogsResponse.ts +101 -0
- package/src/models/CreateAPIKeyRequest.ts +82 -0
- package/src/models/CreateAPIKeyResponse.ts +83 -0
- package/src/models/CreateVaultRequest.ts +91 -0
- package/src/models/EnableClientEncryption.ts +53 -0
- package/src/models/GetUserResponse.ts +82 -0
- package/src/models/HealthCheckResponse.ts +73 -0
- package/src/models/LoginRequest.ts +75 -0
- package/src/models/LoginResponse.ts +66 -0
- package/src/models/SignupRequest.ts +84 -0
- package/src/models/SignupResponse.ts +66 -0
- package/src/models/UpdateAPIKeyRequest.ts +89 -0
- package/src/models/UpdateVaultRequest.ts +89 -0
- package/src/models/Vault.ts +124 -0
- package/src/models/VaultAPIKey.ts +133 -0
- package/src/models/VaultLite.ts +99 -0
- package/src/models/index.ts +20 -0
- package/src/runtime.ts +432 -0
- package/tsconfig.json +20 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Vault Hub Server
|
|
5
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
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
|
+
GetUserResponse,
|
|
19
|
+
} from '../models/index';
|
|
20
|
+
import {
|
|
21
|
+
GetUserResponseFromJSON,
|
|
22
|
+
GetUserResponseToJSON,
|
|
23
|
+
} from '../models/index';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
export class UserApi extends runtime.BaseAPI {
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Get current user by credential
|
|
32
|
+
*/
|
|
33
|
+
async getCurrentUserRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetUserResponse>> {
|
|
34
|
+
const queryParameters: any = {};
|
|
35
|
+
|
|
36
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
37
|
+
|
|
38
|
+
const response = await this.request({
|
|
39
|
+
path: `/api/user`,
|
|
40
|
+
method: 'GET',
|
|
41
|
+
headers: headerParameters,
|
|
42
|
+
query: queryParameters,
|
|
43
|
+
}, initOverrides);
|
|
44
|
+
|
|
45
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => GetUserResponseFromJSON(jsonValue));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Get current user by credential
|
|
50
|
+
*/
|
|
51
|
+
async getCurrentUser(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetUserResponse> {
|
|
52
|
+
const response = await this.getCurrentUserRaw(initOverrides);
|
|
53
|
+
return await response.value();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
}
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Vault Hub Server
|
|
5
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
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
|
+
CreateVaultRequest,
|
|
19
|
+
UpdateVaultRequest,
|
|
20
|
+
Vault,
|
|
21
|
+
VaultLite,
|
|
22
|
+
} from '../models/index';
|
|
23
|
+
import {
|
|
24
|
+
CreateVaultRequestFromJSON,
|
|
25
|
+
CreateVaultRequestToJSON,
|
|
26
|
+
UpdateVaultRequestFromJSON,
|
|
27
|
+
UpdateVaultRequestToJSON,
|
|
28
|
+
VaultFromJSON,
|
|
29
|
+
VaultToJSON,
|
|
30
|
+
VaultLiteFromJSON,
|
|
31
|
+
VaultLiteToJSON,
|
|
32
|
+
} from '../models/index';
|
|
33
|
+
|
|
34
|
+
export interface CreateVaultOperationRequest {
|
|
35
|
+
createVaultRequest: CreateVaultRequest;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface DeleteVaultRequest {
|
|
39
|
+
uniqueId: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface GetVaultRequest {
|
|
43
|
+
uniqueId: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface UpdateVaultOperationRequest {
|
|
47
|
+
uniqueId: string;
|
|
48
|
+
updateVaultRequest: UpdateVaultRequest;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
*
|
|
53
|
+
*/
|
|
54
|
+
export class VaultApi extends runtime.BaseAPI {
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Create a new vault
|
|
58
|
+
*/
|
|
59
|
+
async createVaultRaw(requestParameters: CreateVaultOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Vault>> {
|
|
60
|
+
if (requestParameters['createVaultRequest'] == null) {
|
|
61
|
+
throw new runtime.RequiredError(
|
|
62
|
+
'createVaultRequest',
|
|
63
|
+
'Required parameter "createVaultRequest" was null or undefined when calling createVault().'
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const queryParameters: any = {};
|
|
68
|
+
|
|
69
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
70
|
+
|
|
71
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
72
|
+
|
|
73
|
+
const response = await this.request({
|
|
74
|
+
path: `/api/vaults`,
|
|
75
|
+
method: 'POST',
|
|
76
|
+
headers: headerParameters,
|
|
77
|
+
query: queryParameters,
|
|
78
|
+
body: CreateVaultRequestToJSON(requestParameters['createVaultRequest']),
|
|
79
|
+
}, initOverrides);
|
|
80
|
+
|
|
81
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => VaultFromJSON(jsonValue));
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Create a new vault
|
|
86
|
+
*/
|
|
87
|
+
async createVault(createVaultRequest: CreateVaultRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Vault> {
|
|
88
|
+
const response = await this.createVaultRaw({ createVaultRequest: createVaultRequest }, initOverrides);
|
|
89
|
+
return await response.value();
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Delete a vault
|
|
94
|
+
*/
|
|
95
|
+
async deleteVaultRaw(requestParameters: DeleteVaultRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
96
|
+
if (requestParameters['uniqueId'] == null) {
|
|
97
|
+
throw new runtime.RequiredError(
|
|
98
|
+
'uniqueId',
|
|
99
|
+
'Required parameter "uniqueId" was null or undefined when calling deleteVault().'
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const queryParameters: any = {};
|
|
104
|
+
|
|
105
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
106
|
+
|
|
107
|
+
const response = await this.request({
|
|
108
|
+
path: `/api/vaults/{uniqueId}`.replace(`{${"uniqueId"}}`, encodeURIComponent(String(requestParameters['uniqueId']))),
|
|
109
|
+
method: 'DELETE',
|
|
110
|
+
headers: headerParameters,
|
|
111
|
+
query: queryParameters,
|
|
112
|
+
}, initOverrides);
|
|
113
|
+
|
|
114
|
+
return new runtime.VoidApiResponse(response);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Delete a vault
|
|
119
|
+
*/
|
|
120
|
+
async deleteVault(uniqueId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
121
|
+
await this.deleteVaultRaw({ uniqueId: uniqueId }, initOverrides);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Get a specific vault by Unique ID
|
|
126
|
+
*/
|
|
127
|
+
async getVaultRaw(requestParameters: GetVaultRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Vault>> {
|
|
128
|
+
if (requestParameters['uniqueId'] == null) {
|
|
129
|
+
throw new runtime.RequiredError(
|
|
130
|
+
'uniqueId',
|
|
131
|
+
'Required parameter "uniqueId" was null or undefined when calling getVault().'
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
const queryParameters: any = {};
|
|
136
|
+
|
|
137
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
138
|
+
|
|
139
|
+
const response = await this.request({
|
|
140
|
+
path: `/api/vaults/{uniqueId}`.replace(`{${"uniqueId"}}`, encodeURIComponent(String(requestParameters['uniqueId']))),
|
|
141
|
+
method: 'GET',
|
|
142
|
+
headers: headerParameters,
|
|
143
|
+
query: queryParameters,
|
|
144
|
+
}, initOverrides);
|
|
145
|
+
|
|
146
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => VaultFromJSON(jsonValue));
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Get a specific vault by Unique ID
|
|
151
|
+
*/
|
|
152
|
+
async getVault(uniqueId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Vault> {
|
|
153
|
+
const response = await this.getVaultRaw({ uniqueId: uniqueId }, initOverrides);
|
|
154
|
+
return await response.value();
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Get all vaults for the current user
|
|
159
|
+
*/
|
|
160
|
+
async getVaultsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<VaultLite>>> {
|
|
161
|
+
const queryParameters: any = {};
|
|
162
|
+
|
|
163
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
164
|
+
|
|
165
|
+
const response = await this.request({
|
|
166
|
+
path: `/api/vaults`,
|
|
167
|
+
method: 'GET',
|
|
168
|
+
headers: headerParameters,
|
|
169
|
+
query: queryParameters,
|
|
170
|
+
}, initOverrides);
|
|
171
|
+
|
|
172
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(VaultLiteFromJSON));
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Get all vaults for the current user
|
|
177
|
+
*/
|
|
178
|
+
async getVaults(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<VaultLite>> {
|
|
179
|
+
const response = await this.getVaultsRaw(initOverrides);
|
|
180
|
+
return await response.value();
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Update a vault
|
|
185
|
+
*/
|
|
186
|
+
async updateVaultRaw(requestParameters: UpdateVaultOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Vault>> {
|
|
187
|
+
if (requestParameters['uniqueId'] == null) {
|
|
188
|
+
throw new runtime.RequiredError(
|
|
189
|
+
'uniqueId',
|
|
190
|
+
'Required parameter "uniqueId" was null or undefined when calling updateVault().'
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
if (requestParameters['updateVaultRequest'] == null) {
|
|
195
|
+
throw new runtime.RequiredError(
|
|
196
|
+
'updateVaultRequest',
|
|
197
|
+
'Required parameter "updateVaultRequest" was null or undefined when calling updateVault().'
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
const queryParameters: any = {};
|
|
202
|
+
|
|
203
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
204
|
+
|
|
205
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
206
|
+
|
|
207
|
+
const response = await this.request({
|
|
208
|
+
path: `/api/vaults/{uniqueId}`.replace(`{${"uniqueId"}}`, encodeURIComponent(String(requestParameters['uniqueId']))),
|
|
209
|
+
method: 'PUT',
|
|
210
|
+
headers: headerParameters,
|
|
211
|
+
query: queryParameters,
|
|
212
|
+
body: UpdateVaultRequestToJSON(requestParameters['updateVaultRequest']),
|
|
213
|
+
}, initOverrides);
|
|
214
|
+
|
|
215
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => VaultFromJSON(jsonValue));
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Update a vault
|
|
220
|
+
*/
|
|
221
|
+
async updateVault(uniqueId: string, updateVaultRequest: UpdateVaultRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Vault> {
|
|
222
|
+
const response = await this.updateVaultRaw({ uniqueId: uniqueId, updateVaultRequest: updateVaultRequest }, initOverrides);
|
|
223
|
+
return await response.value();
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Vault Hub Server
|
|
5
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
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
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
import type { VaultAPIKey } from './VaultAPIKey';
|
|
17
|
+
import {
|
|
18
|
+
VaultAPIKeyFromJSON,
|
|
19
|
+
VaultAPIKeyFromJSONTyped,
|
|
20
|
+
VaultAPIKeyToJSON,
|
|
21
|
+
VaultAPIKeyToJSONTyped,
|
|
22
|
+
} from './VaultAPIKey';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @export
|
|
27
|
+
* @interface APIKeysResponse
|
|
28
|
+
*/
|
|
29
|
+
export interface APIKeysResponse {
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @type {Array<VaultAPIKey>}
|
|
33
|
+
* @memberof APIKeysResponse
|
|
34
|
+
*/
|
|
35
|
+
apiKeys: Array<VaultAPIKey>;
|
|
36
|
+
/**
|
|
37
|
+
* Total number of API keys
|
|
38
|
+
* @type {number}
|
|
39
|
+
* @memberof APIKeysResponse
|
|
40
|
+
*/
|
|
41
|
+
totalCount: number;
|
|
42
|
+
/**
|
|
43
|
+
* Number of API keys per page
|
|
44
|
+
* @type {number}
|
|
45
|
+
* @memberof APIKeysResponse
|
|
46
|
+
*/
|
|
47
|
+
pageSize: number;
|
|
48
|
+
/**
|
|
49
|
+
* Current page index (starting from 1)
|
|
50
|
+
* @type {number}
|
|
51
|
+
* @memberof APIKeysResponse
|
|
52
|
+
*/
|
|
53
|
+
pageIndex: number;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Check if a given object implements the APIKeysResponse interface.
|
|
58
|
+
*/
|
|
59
|
+
export function instanceOfAPIKeysResponse(value: object): value is APIKeysResponse {
|
|
60
|
+
if (!('apiKeys' in value) || value['apiKeys'] === undefined) return false;
|
|
61
|
+
if (!('totalCount' in value) || value['totalCount'] === undefined) return false;
|
|
62
|
+
if (!('pageSize' in value) || value['pageSize'] === undefined) return false;
|
|
63
|
+
if (!('pageIndex' in value) || value['pageIndex'] === undefined) return false;
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function APIKeysResponseFromJSON(json: any): APIKeysResponse {
|
|
68
|
+
return APIKeysResponseFromJSONTyped(json, false);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function APIKeysResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): APIKeysResponse {
|
|
72
|
+
if (json == null) {
|
|
73
|
+
return json;
|
|
74
|
+
}
|
|
75
|
+
return {
|
|
76
|
+
|
|
77
|
+
'apiKeys': ((json['apiKeys'] as Array<any>).map(VaultAPIKeyFromJSON)),
|
|
78
|
+
'totalCount': json['totalCount'],
|
|
79
|
+
'pageSize': json['pageSize'],
|
|
80
|
+
'pageIndex': json['pageIndex'],
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export function APIKeysResponseToJSON(json: any): APIKeysResponse {
|
|
85
|
+
return APIKeysResponseToJSONTyped(json, false);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export function APIKeysResponseToJSONTyped(value?: APIKeysResponse | null, ignoreDiscriminator: boolean = false): any {
|
|
89
|
+
if (value == null) {
|
|
90
|
+
return value;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return {
|
|
94
|
+
|
|
95
|
+
'apiKeys': ((value['apiKeys'] as Array<any>).map(VaultAPIKeyToJSON)),
|
|
96
|
+
'totalCount': value['totalCount'],
|
|
97
|
+
'pageSize': value['pageSize'],
|
|
98
|
+
'pageIndex': value['pageIndex'],
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Vault Hub Server
|
|
5
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
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
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
import type { VaultAPIKey } from './VaultAPIKey';
|
|
17
|
+
import {
|
|
18
|
+
VaultAPIKeyFromJSON,
|
|
19
|
+
VaultAPIKeyFromJSONTyped,
|
|
20
|
+
VaultAPIKeyToJSON,
|
|
21
|
+
VaultAPIKeyToJSONTyped,
|
|
22
|
+
} from './VaultAPIKey';
|
|
23
|
+
import type { VaultLite } from './VaultLite';
|
|
24
|
+
import {
|
|
25
|
+
VaultLiteFromJSON,
|
|
26
|
+
VaultLiteFromJSONTyped,
|
|
27
|
+
VaultLiteToJSON,
|
|
28
|
+
VaultLiteToJSONTyped,
|
|
29
|
+
} from './VaultLite';
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* @export
|
|
34
|
+
* @interface AuditLog
|
|
35
|
+
*/
|
|
36
|
+
export interface AuditLog {
|
|
37
|
+
/**
|
|
38
|
+
* When the action occurred
|
|
39
|
+
* @type {Date}
|
|
40
|
+
* @memberof AuditLog
|
|
41
|
+
*/
|
|
42
|
+
createdAt: Date;
|
|
43
|
+
/**
|
|
44
|
+
*
|
|
45
|
+
* @type {VaultLite}
|
|
46
|
+
* @memberof AuditLog
|
|
47
|
+
*/
|
|
48
|
+
vault?: VaultLite;
|
|
49
|
+
/**
|
|
50
|
+
*
|
|
51
|
+
* @type {VaultAPIKey}
|
|
52
|
+
* @memberof AuditLog
|
|
53
|
+
*/
|
|
54
|
+
apiKey?: VaultAPIKey;
|
|
55
|
+
/**
|
|
56
|
+
* Type of action performed
|
|
57
|
+
* @type {string}
|
|
58
|
+
* @memberof AuditLog
|
|
59
|
+
*/
|
|
60
|
+
action: AuditLogActionEnum;
|
|
61
|
+
/**
|
|
62
|
+
* IP address from which the action was performed
|
|
63
|
+
* @type {string}
|
|
64
|
+
* @memberof AuditLog
|
|
65
|
+
*/
|
|
66
|
+
ipAddress?: string;
|
|
67
|
+
/**
|
|
68
|
+
* User agent string from the client
|
|
69
|
+
* @type {string}
|
|
70
|
+
* @memberof AuditLog
|
|
71
|
+
*/
|
|
72
|
+
userAgent?: string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* @export
|
|
78
|
+
*/
|
|
79
|
+
export const AuditLogActionEnum = {
|
|
80
|
+
ReadVault: 'read_vault',
|
|
81
|
+
UpdateVault: 'update_vault',
|
|
82
|
+
DeleteVault: 'delete_vault',
|
|
83
|
+
CreateVault: 'create_vault',
|
|
84
|
+
LoginUser: 'login_user',
|
|
85
|
+
RegisterUser: 'register_user',
|
|
86
|
+
LogoutUser: 'logout_user',
|
|
87
|
+
CreateApiKey: 'create_api_key',
|
|
88
|
+
UpdateApiKey: 'update_api_key',
|
|
89
|
+
DeleteApiKey: 'delete_api_key'
|
|
90
|
+
} as const;
|
|
91
|
+
export type AuditLogActionEnum = typeof AuditLogActionEnum[keyof typeof AuditLogActionEnum];
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Check if a given object implements the AuditLog interface.
|
|
96
|
+
*/
|
|
97
|
+
export function instanceOfAuditLog(value: object): value is AuditLog {
|
|
98
|
+
if (!('createdAt' in value) || value['createdAt'] === undefined) return false;
|
|
99
|
+
if (!('action' in value) || value['action'] === undefined) return false;
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export function AuditLogFromJSON(json: any): AuditLog {
|
|
104
|
+
return AuditLogFromJSONTyped(json, false);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export function AuditLogFromJSONTyped(json: any, ignoreDiscriminator: boolean): AuditLog {
|
|
108
|
+
if (json == null) {
|
|
109
|
+
return json;
|
|
110
|
+
}
|
|
111
|
+
return {
|
|
112
|
+
|
|
113
|
+
'createdAt': (new Date(json['createdAt'])),
|
|
114
|
+
'vault': json['vault'] == null ? undefined : VaultLiteFromJSON(json['vault']),
|
|
115
|
+
'apiKey': json['apiKey'] == null ? undefined : VaultAPIKeyFromJSON(json['apiKey']),
|
|
116
|
+
'action': json['action'],
|
|
117
|
+
'ipAddress': json['ipAddress'] == null ? undefined : json['ipAddress'],
|
|
118
|
+
'userAgent': json['userAgent'] == null ? undefined : json['userAgent'],
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export function AuditLogToJSON(json: any): AuditLog {
|
|
123
|
+
return AuditLogToJSONTyped(json, false);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export function AuditLogToJSONTyped(value?: AuditLog | null, ignoreDiscriminator: boolean = false): any {
|
|
127
|
+
if (value == null) {
|
|
128
|
+
return value;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
return {
|
|
132
|
+
|
|
133
|
+
'createdAt': ((value['createdAt']).toISOString()),
|
|
134
|
+
'vault': VaultLiteToJSON(value['vault']),
|
|
135
|
+
'apiKey': VaultAPIKeyToJSON(value['apiKey']),
|
|
136
|
+
'action': value['action'],
|
|
137
|
+
'ipAddress': value['ipAddress'],
|
|
138
|
+
'userAgent': value['userAgent'],
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Vault Hub Server
|
|
5
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
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
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
import type { AuditLog } from './AuditLog';
|
|
17
|
+
import {
|
|
18
|
+
AuditLogFromJSON,
|
|
19
|
+
AuditLogFromJSONTyped,
|
|
20
|
+
AuditLogToJSON,
|
|
21
|
+
AuditLogToJSONTyped,
|
|
22
|
+
} from './AuditLog';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @export
|
|
27
|
+
* @interface AuditLogsResponse
|
|
28
|
+
*/
|
|
29
|
+
export interface AuditLogsResponse {
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @type {Array<AuditLog>}
|
|
33
|
+
* @memberof AuditLogsResponse
|
|
34
|
+
*/
|
|
35
|
+
auditLogs: Array<AuditLog>;
|
|
36
|
+
/**
|
|
37
|
+
* Total number of logs matching the filter criteria
|
|
38
|
+
* @type {number}
|
|
39
|
+
* @memberof AuditLogsResponse
|
|
40
|
+
*/
|
|
41
|
+
totalCount: number;
|
|
42
|
+
/**
|
|
43
|
+
* Number of logs per page
|
|
44
|
+
* @type {number}
|
|
45
|
+
* @memberof AuditLogsResponse
|
|
46
|
+
*/
|
|
47
|
+
pageSize: number;
|
|
48
|
+
/**
|
|
49
|
+
* Current page index (starting from 0)
|
|
50
|
+
* @type {number}
|
|
51
|
+
* @memberof AuditLogsResponse
|
|
52
|
+
*/
|
|
53
|
+
pageIndex: number;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Check if a given object implements the AuditLogsResponse interface.
|
|
58
|
+
*/
|
|
59
|
+
export function instanceOfAuditLogsResponse(value: object): value is AuditLogsResponse {
|
|
60
|
+
if (!('auditLogs' in value) || value['auditLogs'] === undefined) return false;
|
|
61
|
+
if (!('totalCount' in value) || value['totalCount'] === undefined) return false;
|
|
62
|
+
if (!('pageSize' in value) || value['pageSize'] === undefined) return false;
|
|
63
|
+
if (!('pageIndex' in value) || value['pageIndex'] === undefined) return false;
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function AuditLogsResponseFromJSON(json: any): AuditLogsResponse {
|
|
68
|
+
return AuditLogsResponseFromJSONTyped(json, false);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function AuditLogsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AuditLogsResponse {
|
|
72
|
+
if (json == null) {
|
|
73
|
+
return json;
|
|
74
|
+
}
|
|
75
|
+
return {
|
|
76
|
+
|
|
77
|
+
'auditLogs': ((json['auditLogs'] as Array<any>).map(AuditLogFromJSON)),
|
|
78
|
+
'totalCount': json['totalCount'],
|
|
79
|
+
'pageSize': json['pageSize'],
|
|
80
|
+
'pageIndex': json['pageIndex'],
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export function AuditLogsResponseToJSON(json: any): AuditLogsResponse {
|
|
85
|
+
return AuditLogsResponseToJSONTyped(json, false);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export function AuditLogsResponseToJSONTyped(value?: AuditLogsResponse | null, ignoreDiscriminator: boolean = false): any {
|
|
89
|
+
if (value == null) {
|
|
90
|
+
return value;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return {
|
|
94
|
+
|
|
95
|
+
'auditLogs': ((value['auditLogs'] as Array<any>).map(AuditLogToJSON)),
|
|
96
|
+
'totalCount': value['totalCount'],
|
|
97
|
+
'pageSize': value['pageSize'],
|
|
98
|
+
'pageIndex': value['pageIndex'],
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
|