@lwshen/vault-hub-ts-fetch-client 0.20250726.133725 → 0.20250729.150120

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.
@@ -9,6 +9,7 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
+ import type { APIKey } from './APIKey';
12
13
  import type { VaultLite } from './VaultLite';
13
14
  /**
14
15
  *
@@ -28,6 +29,12 @@ export interface AuditLog {
28
29
  * @memberof AuditLog
29
30
  */
30
31
  vault?: VaultLite;
32
+ /**
33
+ *
34
+ * @type {APIKey}
35
+ * @memberof AuditLog
36
+ */
37
+ apiKey?: APIKey;
31
38
  /**
32
39
  * Type of action performed
33
40
  * @type {string}
@@ -58,6 +65,9 @@ export declare const AuditLogActionEnum: {
58
65
  readonly LoginUser: "login_user";
59
66
  readonly RegisterUser: "register_user";
60
67
  readonly LogoutUser: "logout_user";
68
+ readonly CreateApiKey: "create_api_key";
69
+ readonly UpdateApiKey: "update_api_key";
70
+ readonly DeleteApiKey: "delete_api_key";
61
71
  };
62
72
  export type AuditLogActionEnum = typeof AuditLogActionEnum[keyof typeof AuditLogActionEnum];
63
73
  /**
@@ -19,6 +19,7 @@ exports.AuditLogFromJSON = AuditLogFromJSON;
19
19
  exports.AuditLogFromJSONTyped = AuditLogFromJSONTyped;
20
20
  exports.AuditLogToJSON = AuditLogToJSON;
21
21
  exports.AuditLogToJSONTyped = AuditLogToJSONTyped;
22
+ var APIKey_1 = require("./APIKey");
22
23
  var VaultLite_1 = require("./VaultLite");
23
24
  /**
24
25
  * @export
@@ -30,7 +31,10 @@ exports.AuditLogActionEnum = {
30
31
  CreateVault: 'create_vault',
31
32
  LoginUser: 'login_user',
32
33
  RegisterUser: 'register_user',
33
- LogoutUser: 'logout_user'
34
+ LogoutUser: 'logout_user',
35
+ CreateApiKey: 'create_api_key',
36
+ UpdateApiKey: 'update_api_key',
37
+ DeleteApiKey: 'delete_api_key'
34
38
  };
35
39
  /**
36
40
  * Check if a given object implements the AuditLog interface.
@@ -52,6 +56,7 @@ function AuditLogFromJSONTyped(json, ignoreDiscriminator) {
52
56
  return {
53
57
  'createdAt': (new Date(json['created_at'])),
54
58
  'vault': json['vault'] == null ? undefined : (0, VaultLite_1.VaultLiteFromJSON)(json['vault']),
59
+ 'apiKey': json['api_key'] == null ? undefined : (0, APIKey_1.APIKeyFromJSON)(json['api_key']),
55
60
  'action': json['action'],
56
61
  'ipAddress': json['ip_address'] == null ? undefined : json['ip_address'],
57
62
  'userAgent': json['user_agent'] == null ? undefined : json['user_agent'],
@@ -68,6 +73,7 @@ function AuditLogToJSONTyped(value, ignoreDiscriminator) {
68
73
  return {
69
74
  'created_at': ((value['createdAt']).toISOString()),
70
75
  'vault': (0, VaultLite_1.VaultLiteToJSON)(value['vault']),
76
+ 'api_key': (0, APIKey_1.APIKeyToJSON)(value['apiKey']),
71
77
  'action': value['action'],
72
78
  'ip_address': value['ipAddress'],
73
79
  'user_agent': value['userAgent'],
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Vault Hub Server
3
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ *
14
+ * @export
15
+ * @interface CreateAPIKeyRequest
16
+ */
17
+ export interface CreateAPIKeyRequest {
18
+ /**
19
+ * Human-readable name for the API key
20
+ * @type {string}
21
+ * @memberof CreateAPIKeyRequest
22
+ */
23
+ name: string;
24
+ /**
25
+ * Array of vault unique IDs this key can access (empty = all user's vaults)
26
+ * @type {Array<string>}
27
+ * @memberof CreateAPIKeyRequest
28
+ */
29
+ vaultUniqueIds?: Array<string>;
30
+ /**
31
+ * Optional expiration date
32
+ * @type {Date}
33
+ * @memberof CreateAPIKeyRequest
34
+ */
35
+ expiresAt?: Date;
36
+ }
37
+ /**
38
+ * Check if a given object implements the CreateAPIKeyRequest interface.
39
+ */
40
+ export declare function instanceOfCreateAPIKeyRequest(value: object): value is CreateAPIKeyRequest;
41
+ export declare function CreateAPIKeyRequestFromJSON(json: any): CreateAPIKeyRequest;
42
+ export declare function CreateAPIKeyRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateAPIKeyRequest;
43
+ export declare function CreateAPIKeyRequestToJSON(json: any): CreateAPIKeyRequest;
44
+ export declare function CreateAPIKeyRequestToJSONTyped(value?: CreateAPIKeyRequest | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Vault Hub Server
6
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.instanceOfCreateAPIKeyRequest = instanceOfCreateAPIKeyRequest;
17
+ exports.CreateAPIKeyRequestFromJSON = CreateAPIKeyRequestFromJSON;
18
+ exports.CreateAPIKeyRequestFromJSONTyped = CreateAPIKeyRequestFromJSONTyped;
19
+ exports.CreateAPIKeyRequestToJSON = CreateAPIKeyRequestToJSON;
20
+ exports.CreateAPIKeyRequestToJSONTyped = CreateAPIKeyRequestToJSONTyped;
21
+ /**
22
+ * Check if a given object implements the CreateAPIKeyRequest interface.
23
+ */
24
+ function instanceOfCreateAPIKeyRequest(value) {
25
+ if (!('name' in value) || value['name'] === undefined)
26
+ return false;
27
+ return true;
28
+ }
29
+ function CreateAPIKeyRequestFromJSON(json) {
30
+ return CreateAPIKeyRequestFromJSONTyped(json, false);
31
+ }
32
+ function CreateAPIKeyRequestFromJSONTyped(json, ignoreDiscriminator) {
33
+ if (json == null) {
34
+ return json;
35
+ }
36
+ return {
37
+ 'name': json['name'],
38
+ 'vaultUniqueIds': json['vault_unique_ids'] == null ? undefined : json['vault_unique_ids'],
39
+ 'expiresAt': json['expires_at'] == null ? undefined : (new Date(json['expires_at'])),
40
+ };
41
+ }
42
+ function CreateAPIKeyRequestToJSON(json) {
43
+ return CreateAPIKeyRequestToJSONTyped(json, false);
44
+ }
45
+ function CreateAPIKeyRequestToJSONTyped(value, ignoreDiscriminator) {
46
+ if (ignoreDiscriminator === void 0) { ignoreDiscriminator = false; }
47
+ if (value == null) {
48
+ return value;
49
+ }
50
+ return {
51
+ 'name': value['name'],
52
+ 'vault_unique_ids': value['vaultUniqueIds'],
53
+ 'expires_at': value['expiresAt'] == null ? undefined : ((value['expiresAt']).toISOString()),
54
+ };
55
+ }
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Vault Hub Server
3
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import type { APIKey } from './APIKey';
13
+ /**
14
+ *
15
+ * @export
16
+ * @interface CreateAPIKeyResponse
17
+ */
18
+ export interface CreateAPIKeyResponse {
19
+ /**
20
+ *
21
+ * @type {APIKey}
22
+ * @memberof CreateAPIKeyResponse
23
+ */
24
+ apiKey: APIKey;
25
+ /**
26
+ * The generated API key (only shown once)
27
+ * @type {string}
28
+ * @memberof CreateAPIKeyResponse
29
+ */
30
+ key: string;
31
+ }
32
+ /**
33
+ * Check if a given object implements the CreateAPIKeyResponse interface.
34
+ */
35
+ export declare function instanceOfCreateAPIKeyResponse(value: object): value is CreateAPIKeyResponse;
36
+ export declare function CreateAPIKeyResponseFromJSON(json: any): CreateAPIKeyResponse;
37
+ export declare function CreateAPIKeyResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateAPIKeyResponse;
38
+ export declare function CreateAPIKeyResponseToJSON(json: any): CreateAPIKeyResponse;
39
+ export declare function CreateAPIKeyResponseToJSONTyped(value?: CreateAPIKeyResponse | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Vault Hub Server
6
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.instanceOfCreateAPIKeyResponse = instanceOfCreateAPIKeyResponse;
17
+ exports.CreateAPIKeyResponseFromJSON = CreateAPIKeyResponseFromJSON;
18
+ exports.CreateAPIKeyResponseFromJSONTyped = CreateAPIKeyResponseFromJSONTyped;
19
+ exports.CreateAPIKeyResponseToJSON = CreateAPIKeyResponseToJSON;
20
+ exports.CreateAPIKeyResponseToJSONTyped = CreateAPIKeyResponseToJSONTyped;
21
+ var APIKey_1 = require("./APIKey");
22
+ /**
23
+ * Check if a given object implements the CreateAPIKeyResponse interface.
24
+ */
25
+ function instanceOfCreateAPIKeyResponse(value) {
26
+ if (!('apiKey' in value) || value['apiKey'] === undefined)
27
+ return false;
28
+ if (!('key' in value) || value['key'] === undefined)
29
+ return false;
30
+ return true;
31
+ }
32
+ function CreateAPIKeyResponseFromJSON(json) {
33
+ return CreateAPIKeyResponseFromJSONTyped(json, false);
34
+ }
35
+ function CreateAPIKeyResponseFromJSONTyped(json, ignoreDiscriminator) {
36
+ if (json == null) {
37
+ return json;
38
+ }
39
+ return {
40
+ 'apiKey': (0, APIKey_1.APIKeyFromJSON)(json['api_key']),
41
+ 'key': json['key'],
42
+ };
43
+ }
44
+ function CreateAPIKeyResponseToJSON(json) {
45
+ return CreateAPIKeyResponseToJSONTyped(json, false);
46
+ }
47
+ function CreateAPIKeyResponseToJSONTyped(value, ignoreDiscriminator) {
48
+ if (ignoreDiscriminator === void 0) { ignoreDiscriminator = false; }
49
+ if (value == null) {
50
+ return value;
51
+ }
52
+ return {
53
+ 'api_key': (0, APIKey_1.APIKeyToJSON)(value['apiKey']),
54
+ 'key': value['key'],
55
+ };
56
+ }
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Vault Hub Server
3
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ *
14
+ * @export
15
+ * @interface UpdateAPIKeyRequest
16
+ */
17
+ export interface UpdateAPIKeyRequest {
18
+ /**
19
+ * Human-readable name for the API key
20
+ * @type {string}
21
+ * @memberof UpdateAPIKeyRequest
22
+ */
23
+ name?: string;
24
+ /**
25
+ * Array of vault unique IDs this key can access (empty = all user's vaults)
26
+ * @type {Array<string>}
27
+ * @memberof UpdateAPIKeyRequest
28
+ */
29
+ vaultUniqueIds?: Array<string>;
30
+ /**
31
+ * Optional expiration date
32
+ * @type {Date}
33
+ * @memberof UpdateAPIKeyRequest
34
+ */
35
+ expiresAt?: Date;
36
+ /**
37
+ * Enable or disable the API key
38
+ * @type {boolean}
39
+ * @memberof UpdateAPIKeyRequest
40
+ */
41
+ isActive?: boolean;
42
+ }
43
+ /**
44
+ * Check if a given object implements the UpdateAPIKeyRequest interface.
45
+ */
46
+ export declare function instanceOfUpdateAPIKeyRequest(value: object): value is UpdateAPIKeyRequest;
47
+ export declare function UpdateAPIKeyRequestFromJSON(json: any): UpdateAPIKeyRequest;
48
+ export declare function UpdateAPIKeyRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateAPIKeyRequest;
49
+ export declare function UpdateAPIKeyRequestToJSON(json: any): UpdateAPIKeyRequest;
50
+ export declare function UpdateAPIKeyRequestToJSONTyped(value?: UpdateAPIKeyRequest | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Vault Hub Server
6
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.instanceOfUpdateAPIKeyRequest = instanceOfUpdateAPIKeyRequest;
17
+ exports.UpdateAPIKeyRequestFromJSON = UpdateAPIKeyRequestFromJSON;
18
+ exports.UpdateAPIKeyRequestFromJSONTyped = UpdateAPIKeyRequestFromJSONTyped;
19
+ exports.UpdateAPIKeyRequestToJSON = UpdateAPIKeyRequestToJSON;
20
+ exports.UpdateAPIKeyRequestToJSONTyped = UpdateAPIKeyRequestToJSONTyped;
21
+ /**
22
+ * Check if a given object implements the UpdateAPIKeyRequest interface.
23
+ */
24
+ function instanceOfUpdateAPIKeyRequest(value) {
25
+ return true;
26
+ }
27
+ function UpdateAPIKeyRequestFromJSON(json) {
28
+ return UpdateAPIKeyRequestFromJSONTyped(json, false);
29
+ }
30
+ function UpdateAPIKeyRequestFromJSONTyped(json, ignoreDiscriminator) {
31
+ if (json == null) {
32
+ return json;
33
+ }
34
+ return {
35
+ 'name': json['name'] == null ? undefined : json['name'],
36
+ 'vaultUniqueIds': json['vault_unique_ids'] == null ? undefined : json['vault_unique_ids'],
37
+ 'expiresAt': json['expires_at'] == null ? undefined : (new Date(json['expires_at'])),
38
+ 'isActive': json['is_active'] == null ? undefined : json['is_active'],
39
+ };
40
+ }
41
+ function UpdateAPIKeyRequestToJSON(json) {
42
+ return UpdateAPIKeyRequestToJSONTyped(json, false);
43
+ }
44
+ function UpdateAPIKeyRequestToJSONTyped(value, ignoreDiscriminator) {
45
+ if (ignoreDiscriminator === void 0) { ignoreDiscriminator = false; }
46
+ if (value == null) {
47
+ return value;
48
+ }
49
+ return {
50
+ 'name': value['name'],
51
+ 'vault_unique_ids': value['vaultUniqueIds'],
52
+ 'expires_at': value['expiresAt'] == null ? undefined : ((value['expiresAt']).toISOString()),
53
+ 'is_active': value['isActive'],
54
+ };
55
+ }
@@ -1,5 +1,9 @@
1
+ export * from './APIKey';
2
+ export * from './APIKeysResponse';
1
3
  export * from './AuditLog';
2
4
  export * from './AuditLogsResponse';
5
+ export * from './CreateAPIKeyRequest';
6
+ export * from './CreateAPIKeyResponse';
3
7
  export * from './CreateVaultRequest';
4
8
  export * from './GetUserResponse';
5
9
  export * from './HealthCheckResponse';
@@ -7,6 +11,7 @@ export * from './LoginRequest';
7
11
  export * from './LoginResponse';
8
12
  export * from './SignupRequest';
9
13
  export * from './SignupResponse';
14
+ export * from './UpdateAPIKeyRequest';
10
15
  export * from './UpdateVaultRequest';
11
16
  export * from './Vault';
12
17
  export * from './VaultLite';
@@ -16,8 +16,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  /* tslint:disable */
18
18
  /* eslint-disable */
19
+ __exportStar(require("./APIKey"), exports);
20
+ __exportStar(require("./APIKeysResponse"), exports);
19
21
  __exportStar(require("./AuditLog"), exports);
20
22
  __exportStar(require("./AuditLogsResponse"), exports);
23
+ __exportStar(require("./CreateAPIKeyRequest"), exports);
24
+ __exportStar(require("./CreateAPIKeyResponse"), exports);
21
25
  __exportStar(require("./CreateVaultRequest"), exports);
22
26
  __exportStar(require("./GetUserResponse"), exports);
23
27
  __exportStar(require("./HealthCheckResponse"), exports);
@@ -25,6 +29,7 @@ __exportStar(require("./LoginRequest"), exports);
25
29
  __exportStar(require("./LoginResponse"), exports);
26
30
  __exportStar(require("./SignupRequest"), exports);
27
31
  __exportStar(require("./SignupResponse"), exports);
32
+ __exportStar(require("./UpdateAPIKeyRequest"), exports);
28
33
  __exportStar(require("./UpdateVaultRequest"), exports);
29
34
  __exportStar(require("./Vault"), exports);
30
35
  __exportStar(require("./VaultLite"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lwshen/vault-hub-ts-fetch-client",
3
- "version": "0.20250726.133725",
3
+ "version": "0.20250729.150120",
4
4
  "description": "OpenAPI client for @lwshen/vault-hub-ts-fetch-client",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {
@@ -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/index.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
+ export * from './APIKeyApi';
3
4
  export * from './AuditApi';
4
5
  export * from './AuthApi';
5
6
  export * from './DefaultApi';