@lwshen/vault-hub-ts-fetch-client 0.20250728.154349 → 0.20250729.153154
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 +6 -0
- package/README.md +2 -2
- package/dist/apis/APIKeyApi.d.ts +64 -0
- package/dist/apis/APIKeyApi.js +270 -0
- package/dist/apis/AuditApi.js +3 -3
- package/dist/apis/VaultApi.js +3 -3
- package/dist/apis/index.d.ts +1 -0
- package/dist/apis/index.js +1 -0
- package/dist/models/APIKey.d.ts +75 -0
- package/dist/models/APIKey.js +72 -0
- package/dist/models/APIKeysResponse.d.ts +51 -0
- package/dist/models/APIKeysResponse.js +64 -0
- package/dist/models/AuditLog.d.ts +10 -0
- package/dist/models/AuditLog.js +13 -7
- package/dist/models/AuditLogsResponse.js +4 -4
- 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/UpdateAPIKeyRequest.d.ts +50 -0
- package/dist/models/UpdateAPIKeyRequest.js +55 -0
- package/dist/models/Vault.js +8 -8
- package/dist/models/VaultLite.js +4 -4
- package/dist/models/index.d.ts +5 -0
- package/dist/models/index.js +5 -0
- package/package.json +1 -1
- package/src/apis/APIKeyApi.ts +219 -0
- package/src/apis/AuditApi.ts +3 -3
- package/src/apis/VaultApi.ts +3 -3
- package/src/apis/index.ts +1 -0
- package/src/models/APIKey.ts +133 -0
- package/src/models/APIKeysResponse.ts +101 -0
- package/src/models/AuditLog.ts +25 -7
- package/src/models/AuditLogsResponse.ts +4 -4
- package/src/models/CreateAPIKeyRequest.ts +82 -0
- package/src/models/CreateAPIKeyResponse.ts +83 -0
- package/src/models/UpdateAPIKeyRequest.ts +89 -0
- package/src/models/Vault.ts +8 -8
- package/src/models/VaultLite.ts +4 -4
- package/src/models/index.ts +5 -0
|
@@ -0,0 +1,219 @@
|
|
|
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
|
+
APIKey,
|
|
19
|
+
APIKeysResponse,
|
|
20
|
+
CreateAPIKeyRequest,
|
|
21
|
+
CreateAPIKeyResponse,
|
|
22
|
+
UpdateAPIKeyRequest,
|
|
23
|
+
} from '../models/index';
|
|
24
|
+
import {
|
|
25
|
+
APIKeyFromJSON,
|
|
26
|
+
APIKeyToJSON,
|
|
27
|
+
APIKeysResponseFromJSON,
|
|
28
|
+
APIKeysResponseToJSON,
|
|
29
|
+
CreateAPIKeyRequestFromJSON,
|
|
30
|
+
CreateAPIKeyRequestToJSON,
|
|
31
|
+
CreateAPIKeyResponseFromJSON,
|
|
32
|
+
CreateAPIKeyResponseToJSON,
|
|
33
|
+
UpdateAPIKeyRequestFromJSON,
|
|
34
|
+
UpdateAPIKeyRequestToJSON,
|
|
35
|
+
} from '../models/index';
|
|
36
|
+
|
|
37
|
+
export interface CreateAPIKeyOperationRequest {
|
|
38
|
+
createAPIKeyRequest: CreateAPIKeyRequest;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface DeleteAPIKeyRequest {
|
|
42
|
+
id: number;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface GetAPIKeysRequest {
|
|
46
|
+
pageSize: number;
|
|
47
|
+
pageIndex: number;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface UpdateAPIKeyOperationRequest {
|
|
51
|
+
id: number;
|
|
52
|
+
updateAPIKeyRequest: UpdateAPIKeyRequest;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
*
|
|
57
|
+
*/
|
|
58
|
+
export class APIKeyApi extends runtime.BaseAPI {
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Create a new API key
|
|
62
|
+
*/
|
|
63
|
+
async createAPIKeyRaw(requestParameters: CreateAPIKeyOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CreateAPIKeyResponse>> {
|
|
64
|
+
if (requestParameters['createAPIKeyRequest'] == null) {
|
|
65
|
+
throw new runtime.RequiredError(
|
|
66
|
+
'createAPIKeyRequest',
|
|
67
|
+
'Required parameter "createAPIKeyRequest" was null or undefined when calling createAPIKey().'
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const queryParameters: any = {};
|
|
72
|
+
|
|
73
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
74
|
+
|
|
75
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
76
|
+
|
|
77
|
+
const response = await this.request({
|
|
78
|
+
path: `/api/api-keys`,
|
|
79
|
+
method: 'POST',
|
|
80
|
+
headers: headerParameters,
|
|
81
|
+
query: queryParameters,
|
|
82
|
+
body: CreateAPIKeyRequestToJSON(requestParameters['createAPIKeyRequest']),
|
|
83
|
+
}, initOverrides);
|
|
84
|
+
|
|
85
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => CreateAPIKeyResponseFromJSON(jsonValue));
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Create a new API key
|
|
90
|
+
*/
|
|
91
|
+
async createAPIKey(createAPIKeyRequest: CreateAPIKeyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CreateAPIKeyResponse> {
|
|
92
|
+
const response = await this.createAPIKeyRaw({ createAPIKeyRequest: createAPIKeyRequest }, initOverrides);
|
|
93
|
+
return await response.value();
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Delete an API key
|
|
98
|
+
*/
|
|
99
|
+
async deleteAPIKeyRaw(requestParameters: DeleteAPIKeyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
100
|
+
if (requestParameters['id'] == null) {
|
|
101
|
+
throw new runtime.RequiredError(
|
|
102
|
+
'id',
|
|
103
|
+
'Required parameter "id" was null or undefined when calling deleteAPIKey().'
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const queryParameters: any = {};
|
|
108
|
+
|
|
109
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
110
|
+
|
|
111
|
+
const response = await this.request({
|
|
112
|
+
path: `/api/api-keys/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
|
113
|
+
method: 'DELETE',
|
|
114
|
+
headers: headerParameters,
|
|
115
|
+
query: queryParameters,
|
|
116
|
+
}, initOverrides);
|
|
117
|
+
|
|
118
|
+
return new runtime.VoidApiResponse(response);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Delete an API key
|
|
123
|
+
*/
|
|
124
|
+
async deleteAPIKey(id: number, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
125
|
+
await this.deleteAPIKeyRaw({ id: id }, initOverrides);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Get API keys for the current user with pagination
|
|
130
|
+
*/
|
|
131
|
+
async getAPIKeysRaw(requestParameters: GetAPIKeysRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<APIKeysResponse>> {
|
|
132
|
+
if (requestParameters['pageSize'] == null) {
|
|
133
|
+
throw new runtime.RequiredError(
|
|
134
|
+
'pageSize',
|
|
135
|
+
'Required parameter "pageSize" was null or undefined when calling getAPIKeys().'
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
if (requestParameters['pageIndex'] == null) {
|
|
140
|
+
throw new runtime.RequiredError(
|
|
141
|
+
'pageIndex',
|
|
142
|
+
'Required parameter "pageIndex" was null or undefined when calling getAPIKeys().'
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const queryParameters: any = {};
|
|
147
|
+
|
|
148
|
+
if (requestParameters['pageSize'] != null) {
|
|
149
|
+
queryParameters['pageSize'] = requestParameters['pageSize'];
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
if (requestParameters['pageIndex'] != null) {
|
|
153
|
+
queryParameters['pageIndex'] = requestParameters['pageIndex'];
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
157
|
+
|
|
158
|
+
const response = await this.request({
|
|
159
|
+
path: `/api/api-keys`,
|
|
160
|
+
method: 'GET',
|
|
161
|
+
headers: headerParameters,
|
|
162
|
+
query: queryParameters,
|
|
163
|
+
}, initOverrides);
|
|
164
|
+
|
|
165
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => APIKeysResponseFromJSON(jsonValue));
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Get API keys for the current user with pagination
|
|
170
|
+
*/
|
|
171
|
+
async getAPIKeys(pageSize: number, pageIndex: number, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<APIKeysResponse> {
|
|
172
|
+
const response = await this.getAPIKeysRaw({ pageSize: pageSize, pageIndex: pageIndex }, initOverrides);
|
|
173
|
+
return await response.value();
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Update an API key (enable/disable or modify properties)
|
|
178
|
+
*/
|
|
179
|
+
async updateAPIKeyRaw(requestParameters: UpdateAPIKeyOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<APIKey>> {
|
|
180
|
+
if (requestParameters['id'] == null) {
|
|
181
|
+
throw new runtime.RequiredError(
|
|
182
|
+
'id',
|
|
183
|
+
'Required parameter "id" was null or undefined when calling updateAPIKey().'
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
if (requestParameters['updateAPIKeyRequest'] == null) {
|
|
188
|
+
throw new runtime.RequiredError(
|
|
189
|
+
'updateAPIKeyRequest',
|
|
190
|
+
'Required parameter "updateAPIKeyRequest" was null or undefined when calling updateAPIKey().'
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
const queryParameters: any = {};
|
|
195
|
+
|
|
196
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
197
|
+
|
|
198
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
199
|
+
|
|
200
|
+
const response = await this.request({
|
|
201
|
+
path: `/api/api-keys/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
|
202
|
+
method: 'PATCH',
|
|
203
|
+
headers: headerParameters,
|
|
204
|
+
query: queryParameters,
|
|
205
|
+
body: UpdateAPIKeyRequestToJSON(requestParameters['updateAPIKeyRequest']),
|
|
206
|
+
}, initOverrides);
|
|
207
|
+
|
|
208
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => APIKeyFromJSON(jsonValue));
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Update an API key (enable/disable or modify properties)
|
|
213
|
+
*/
|
|
214
|
+
async updateAPIKey(id: number, updateAPIKeyRequest: UpdateAPIKeyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<APIKey> {
|
|
215
|
+
const response = await this.updateAPIKeyRaw({ id: id, updateAPIKeyRequest: updateAPIKeyRequest }, initOverrides);
|
|
216
|
+
return await response.value();
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
}
|
package/src/apis/AuditApi.ts
CHANGED
|
@@ -56,15 +56,15 @@ export class AuditApi extends runtime.BaseAPI {
|
|
|
56
56
|
const queryParameters: any = {};
|
|
57
57
|
|
|
58
58
|
if (requestParameters['startDate'] != null) {
|
|
59
|
-
queryParameters['
|
|
59
|
+
queryParameters['startDate'] = (requestParameters['startDate'] as any).toISOString();
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
if (requestParameters['endDate'] != null) {
|
|
63
|
-
queryParameters['
|
|
63
|
+
queryParameters['endDate'] = (requestParameters['endDate'] as any).toISOString();
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
if (requestParameters['vaultUniqueId'] != null) {
|
|
67
|
-
queryParameters['
|
|
67
|
+
queryParameters['vaultUniqueId'] = requestParameters['vaultUniqueId'];
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
if (requestParameters['pageSize'] != null) {
|
package/src/apis/VaultApi.ts
CHANGED
|
@@ -105,7 +105,7 @@ export class VaultApi extends runtime.BaseAPI {
|
|
|
105
105
|
const headerParameters: runtime.HTTPHeaders = {};
|
|
106
106
|
|
|
107
107
|
const response = await this.request({
|
|
108
|
-
path: `/api/vaults/{
|
|
108
|
+
path: `/api/vaults/{uniqueId}`.replace(`{${"uniqueId"}}`, encodeURIComponent(String(requestParameters['uniqueId']))),
|
|
109
109
|
method: 'DELETE',
|
|
110
110
|
headers: headerParameters,
|
|
111
111
|
query: queryParameters,
|
|
@@ -137,7 +137,7 @@ export class VaultApi extends runtime.BaseAPI {
|
|
|
137
137
|
const headerParameters: runtime.HTTPHeaders = {};
|
|
138
138
|
|
|
139
139
|
const response = await this.request({
|
|
140
|
-
path: `/api/vaults/{
|
|
140
|
+
path: `/api/vaults/{uniqueId}`.replace(`{${"uniqueId"}}`, encodeURIComponent(String(requestParameters['uniqueId']))),
|
|
141
141
|
method: 'GET',
|
|
142
142
|
headers: headerParameters,
|
|
143
143
|
query: queryParameters,
|
|
@@ -205,7 +205,7 @@ export class VaultApi extends runtime.BaseAPI {
|
|
|
205
205
|
headerParameters['Content-Type'] = 'application/json';
|
|
206
206
|
|
|
207
207
|
const response = await this.request({
|
|
208
|
-
path: `/api/vaults/{
|
|
208
|
+
path: `/api/vaults/{uniqueId}`.replace(`{${"uniqueId"}}`, encodeURIComponent(String(requestParameters['uniqueId']))),
|
|
209
209
|
method: 'PUT',
|
|
210
210
|
headers: headerParameters,
|
|
211
211
|
query: queryParameters,
|
package/src/apis/index.ts
CHANGED
|
@@ -0,0 +1,133 @@
|
|
|
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 { VaultLite } from './VaultLite';
|
|
17
|
+
import {
|
|
18
|
+
VaultLiteFromJSON,
|
|
19
|
+
VaultLiteFromJSONTyped,
|
|
20
|
+
VaultLiteToJSON,
|
|
21
|
+
VaultLiteToJSONTyped,
|
|
22
|
+
} from './VaultLite';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @export
|
|
27
|
+
* @interface APIKey
|
|
28
|
+
*/
|
|
29
|
+
export interface APIKey {
|
|
30
|
+
/**
|
|
31
|
+
* Unique API key ID
|
|
32
|
+
* @type {number}
|
|
33
|
+
* @memberof APIKey
|
|
34
|
+
*/
|
|
35
|
+
id: number;
|
|
36
|
+
/**
|
|
37
|
+
* Human-readable name for the API key
|
|
38
|
+
* @type {string}
|
|
39
|
+
* @memberof APIKey
|
|
40
|
+
*/
|
|
41
|
+
name: string;
|
|
42
|
+
/**
|
|
43
|
+
* Array of vaults this key can access (null/empty = all user's vaults)
|
|
44
|
+
* @type {Array<VaultLite>}
|
|
45
|
+
* @memberof APIKey
|
|
46
|
+
*/
|
|
47
|
+
vaults?: Array<VaultLite>;
|
|
48
|
+
/**
|
|
49
|
+
* Optional expiration date
|
|
50
|
+
* @type {Date}
|
|
51
|
+
* @memberof APIKey
|
|
52
|
+
*/
|
|
53
|
+
expiresAt?: Date;
|
|
54
|
+
/**
|
|
55
|
+
* When the key was last used
|
|
56
|
+
* @type {Date}
|
|
57
|
+
* @memberof APIKey
|
|
58
|
+
*/
|
|
59
|
+
lastUsedAt?: Date;
|
|
60
|
+
/**
|
|
61
|
+
* Whether the key is currently active
|
|
62
|
+
* @type {boolean}
|
|
63
|
+
* @memberof APIKey
|
|
64
|
+
*/
|
|
65
|
+
isActive: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* When the key was created
|
|
68
|
+
* @type {Date}
|
|
69
|
+
* @memberof APIKey
|
|
70
|
+
*/
|
|
71
|
+
createdAt: Date;
|
|
72
|
+
/**
|
|
73
|
+
* When the key was last updated
|
|
74
|
+
* @type {Date}
|
|
75
|
+
* @memberof APIKey
|
|
76
|
+
*/
|
|
77
|
+
updatedAt?: Date;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Check if a given object implements the APIKey interface.
|
|
82
|
+
*/
|
|
83
|
+
export function instanceOfAPIKey(value: object): value is APIKey {
|
|
84
|
+
if (!('id' in value) || value['id'] === undefined) return false;
|
|
85
|
+
if (!('name' in value) || value['name'] === undefined) return false;
|
|
86
|
+
if (!('isActive' in value) || value['isActive'] === undefined) return false;
|
|
87
|
+
if (!('createdAt' in value) || value['createdAt'] === undefined) return false;
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export function APIKeyFromJSON(json: any): APIKey {
|
|
92
|
+
return APIKeyFromJSONTyped(json, false);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function APIKeyFromJSONTyped(json: any, ignoreDiscriminator: boolean): APIKey {
|
|
96
|
+
if (json == null) {
|
|
97
|
+
return json;
|
|
98
|
+
}
|
|
99
|
+
return {
|
|
100
|
+
|
|
101
|
+
'id': json['id'],
|
|
102
|
+
'name': json['name'],
|
|
103
|
+
'vaults': json['vaults'] == null ? undefined : ((json['vaults'] as Array<any>).map(VaultLiteFromJSON)),
|
|
104
|
+
'expiresAt': json['expiresAt'] == null ? undefined : (new Date(json['expiresAt'])),
|
|
105
|
+
'lastUsedAt': json['lastUsedAt'] == null ? undefined : (new Date(json['lastUsedAt'])),
|
|
106
|
+
'isActive': json['isActive'],
|
|
107
|
+
'createdAt': (new Date(json['createdAt'])),
|
|
108
|
+
'updatedAt': json['updatedAt'] == null ? undefined : (new Date(json['updatedAt'])),
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export function APIKeyToJSON(json: any): APIKey {
|
|
113
|
+
return APIKeyToJSONTyped(json, false);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export function APIKeyToJSONTyped(value?: APIKey | null, ignoreDiscriminator: boolean = false): any {
|
|
117
|
+
if (value == null) {
|
|
118
|
+
return value;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
return {
|
|
122
|
+
|
|
123
|
+
'id': value['id'],
|
|
124
|
+
'name': value['name'],
|
|
125
|
+
'vaults': value['vaults'] == null ? undefined : ((value['vaults'] as Array<any>).map(VaultLiteToJSON)),
|
|
126
|
+
'expiresAt': value['expiresAt'] == null ? undefined : ((value['expiresAt']).toISOString()),
|
|
127
|
+
'lastUsedAt': value['lastUsedAt'] == null ? undefined : ((value['lastUsedAt']).toISOString()),
|
|
128
|
+
'isActive': value['isActive'],
|
|
129
|
+
'createdAt': ((value['createdAt']).toISOString()),
|
|
130
|
+
'updatedAt': value['updatedAt'] == null ? undefined : ((value['updatedAt']).toISOString()),
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
|
|
@@ -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 { APIKey } from './APIKey';
|
|
17
|
+
import {
|
|
18
|
+
APIKeyFromJSON,
|
|
19
|
+
APIKeyFromJSONTyped,
|
|
20
|
+
APIKeyToJSON,
|
|
21
|
+
APIKeyToJSONTyped,
|
|
22
|
+
} from './APIKey';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @export
|
|
27
|
+
* @interface APIKeysResponse
|
|
28
|
+
*/
|
|
29
|
+
export interface APIKeysResponse {
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @type {Array<APIKey>}
|
|
33
|
+
* @memberof APIKeysResponse
|
|
34
|
+
*/
|
|
35
|
+
apiKeys: Array<APIKey>;
|
|
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(APIKeyFromJSON)),
|
|
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(APIKeyToJSON)),
|
|
96
|
+
'totalCount': value['totalCount'],
|
|
97
|
+
'pageSize': value['pageSize'],
|
|
98
|
+
'pageIndex': value['pageIndex'],
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
|
package/src/models/AuditLog.ts
CHANGED
|
@@ -13,6 +13,13 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import { mapValues } from '../runtime';
|
|
16
|
+
import type { APIKey } from './APIKey';
|
|
17
|
+
import {
|
|
18
|
+
APIKeyFromJSON,
|
|
19
|
+
APIKeyFromJSONTyped,
|
|
20
|
+
APIKeyToJSON,
|
|
21
|
+
APIKeyToJSONTyped,
|
|
22
|
+
} from './APIKey';
|
|
16
23
|
import type { VaultLite } from './VaultLite';
|
|
17
24
|
import {
|
|
18
25
|
VaultLiteFromJSON,
|
|
@@ -39,6 +46,12 @@ export interface AuditLog {
|
|
|
39
46
|
* @memberof AuditLog
|
|
40
47
|
*/
|
|
41
48
|
vault?: VaultLite;
|
|
49
|
+
/**
|
|
50
|
+
*
|
|
51
|
+
* @type {APIKey}
|
|
52
|
+
* @memberof AuditLog
|
|
53
|
+
*/
|
|
54
|
+
apiKey?: APIKey;
|
|
42
55
|
/**
|
|
43
56
|
* Type of action performed
|
|
44
57
|
* @type {string}
|
|
@@ -70,7 +83,10 @@ export const AuditLogActionEnum = {
|
|
|
70
83
|
CreateVault: 'create_vault',
|
|
71
84
|
LoginUser: 'login_user',
|
|
72
85
|
RegisterUser: 'register_user',
|
|
73
|
-
LogoutUser: 'logout_user'
|
|
86
|
+
LogoutUser: 'logout_user',
|
|
87
|
+
CreateApiKey: 'create_api_key',
|
|
88
|
+
UpdateApiKey: 'update_api_key',
|
|
89
|
+
DeleteApiKey: 'delete_api_key'
|
|
74
90
|
} as const;
|
|
75
91
|
export type AuditLogActionEnum = typeof AuditLogActionEnum[keyof typeof AuditLogActionEnum];
|
|
76
92
|
|
|
@@ -94,11 +110,12 @@ export function AuditLogFromJSONTyped(json: any, ignoreDiscriminator: boolean):
|
|
|
94
110
|
}
|
|
95
111
|
return {
|
|
96
112
|
|
|
97
|
-
'createdAt': (new Date(json['
|
|
113
|
+
'createdAt': (new Date(json['createdAt'])),
|
|
98
114
|
'vault': json['vault'] == null ? undefined : VaultLiteFromJSON(json['vault']),
|
|
115
|
+
'apiKey': json['apiKey'] == null ? undefined : APIKeyFromJSON(json['apiKey']),
|
|
99
116
|
'action': json['action'],
|
|
100
|
-
'ipAddress': json['
|
|
101
|
-
'userAgent': json['
|
|
117
|
+
'ipAddress': json['ipAddress'] == null ? undefined : json['ipAddress'],
|
|
118
|
+
'userAgent': json['userAgent'] == null ? undefined : json['userAgent'],
|
|
102
119
|
};
|
|
103
120
|
}
|
|
104
121
|
|
|
@@ -113,11 +130,12 @@ export function AuditLogToJSONTyped(value?: AuditLog | null, ignoreDiscriminator
|
|
|
113
130
|
|
|
114
131
|
return {
|
|
115
132
|
|
|
116
|
-
'
|
|
133
|
+
'createdAt': ((value['createdAt']).toISOString()),
|
|
117
134
|
'vault': VaultLiteToJSON(value['vault']),
|
|
135
|
+
'apiKey': APIKeyToJSON(value['apiKey']),
|
|
118
136
|
'action': value['action'],
|
|
119
|
-
'
|
|
120
|
-
'
|
|
137
|
+
'ipAddress': value['ipAddress'],
|
|
138
|
+
'userAgent': value['userAgent'],
|
|
121
139
|
};
|
|
122
140
|
}
|
|
123
141
|
|
|
@@ -74,8 +74,8 @@ export function AuditLogsResponseFromJSONTyped(json: any, ignoreDiscriminator: b
|
|
|
74
74
|
}
|
|
75
75
|
return {
|
|
76
76
|
|
|
77
|
-
'auditLogs': ((json['
|
|
78
|
-
'totalCount': json['
|
|
77
|
+
'auditLogs': ((json['auditLogs'] as Array<any>).map(AuditLogFromJSON)),
|
|
78
|
+
'totalCount': json['totalCount'],
|
|
79
79
|
'pageSize': json['pageSize'],
|
|
80
80
|
'pageIndex': json['pageIndex'],
|
|
81
81
|
};
|
|
@@ -92,8 +92,8 @@ export function AuditLogsResponseToJSONTyped(value?: AuditLogsResponse | null, i
|
|
|
92
92
|
|
|
93
93
|
return {
|
|
94
94
|
|
|
95
|
-
'
|
|
96
|
-
'
|
|
95
|
+
'auditLogs': ((value['auditLogs'] as Array<any>).map(AuditLogToJSON)),
|
|
96
|
+
'totalCount': value['totalCount'],
|
|
97
97
|
'pageSize': value['pageSize'],
|
|
98
98
|
'pageIndex': value['pageIndex'],
|
|
99
99
|
};
|
|
@@ -0,0 +1,82 @@
|
|
|
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
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @export
|
|
19
|
+
* @interface CreateAPIKeyRequest
|
|
20
|
+
*/
|
|
21
|
+
export interface CreateAPIKeyRequest {
|
|
22
|
+
/**
|
|
23
|
+
* Human-readable name for the API key
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof CreateAPIKeyRequest
|
|
26
|
+
*/
|
|
27
|
+
name: string;
|
|
28
|
+
/**
|
|
29
|
+
* Array of vault unique IDs this key can access (empty = all user's vaults)
|
|
30
|
+
* @type {Array<string>}
|
|
31
|
+
* @memberof CreateAPIKeyRequest
|
|
32
|
+
*/
|
|
33
|
+
vaultUniqueIds?: Array<string>;
|
|
34
|
+
/**
|
|
35
|
+
* Optional expiration date
|
|
36
|
+
* @type {Date}
|
|
37
|
+
* @memberof CreateAPIKeyRequest
|
|
38
|
+
*/
|
|
39
|
+
expiresAt?: Date;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Check if a given object implements the CreateAPIKeyRequest interface.
|
|
44
|
+
*/
|
|
45
|
+
export function instanceOfCreateAPIKeyRequest(value: object): value is CreateAPIKeyRequest {
|
|
46
|
+
if (!('name' in value) || value['name'] === undefined) return false;
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function CreateAPIKeyRequestFromJSON(json: any): CreateAPIKeyRequest {
|
|
51
|
+
return CreateAPIKeyRequestFromJSONTyped(json, false);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function CreateAPIKeyRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateAPIKeyRequest {
|
|
55
|
+
if (json == null) {
|
|
56
|
+
return json;
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
|
|
60
|
+
'name': json['name'],
|
|
61
|
+
'vaultUniqueIds': json['vaultUniqueIds'] == null ? undefined : json['vaultUniqueIds'],
|
|
62
|
+
'expiresAt': json['expiresAt'] == null ? undefined : (new Date(json['expiresAt'])),
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function CreateAPIKeyRequestToJSON(json: any): CreateAPIKeyRequest {
|
|
67
|
+
return CreateAPIKeyRequestToJSONTyped(json, false);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function CreateAPIKeyRequestToJSONTyped(value?: CreateAPIKeyRequest | null, ignoreDiscriminator: boolean = false): any {
|
|
71
|
+
if (value == null) {
|
|
72
|
+
return value;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return {
|
|
76
|
+
|
|
77
|
+
'name': value['name'],
|
|
78
|
+
'vaultUniqueIds': value['vaultUniqueIds'],
|
|
79
|
+
'expiresAt': value['expiresAt'] == null ? undefined : ((value['expiresAt']).toISOString()),
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
|