@lwshen/vault-hub-ts-fetch-client 0.20250728.154349 → 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.
@@ -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['expires_at'] == null ? undefined : (new Date(json['expires_at'])),
105
+ 'lastUsedAt': json['last_used_at'] == null ? undefined : (new Date(json['last_used_at'])),
106
+ 'isActive': json['is_active'],
107
+ 'createdAt': (new Date(json['created_at'])),
108
+ 'updatedAt': json['updated_at'] == null ? undefined : (new Date(json['updated_at'])),
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
+ 'expires_at': value['expiresAt'] == null ? undefined : ((value['expiresAt']).toISOString()),
127
+ 'last_used_at': value['lastUsedAt'] == null ? undefined : ((value['lastUsedAt']).toISOString()),
128
+ 'is_active': value['isActive'],
129
+ 'created_at': ((value['createdAt']).toISOString()),
130
+ 'updated_at': 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['api_keys'] as Array<any>).map(APIKeyFromJSON)),
78
+ 'totalCount': json['total_count'],
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
+ 'api_keys': ((value['apiKeys'] as Array<any>).map(APIKeyToJSON)),
96
+ 'total_count': value['totalCount'],
97
+ 'pageSize': value['pageSize'],
98
+ 'pageIndex': value['pageIndex'],
99
+ };
100
+ }
101
+
@@ -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
 
@@ -96,6 +112,7 @@ export function AuditLogFromJSONTyped(json: any, ignoreDiscriminator: boolean):
96
112
 
97
113
  'createdAt': (new Date(json['created_at'])),
98
114
  'vault': json['vault'] == null ? undefined : VaultLiteFromJSON(json['vault']),
115
+ 'apiKey': json['api_key'] == null ? undefined : APIKeyFromJSON(json['api_key']),
99
116
  'action': json['action'],
100
117
  'ipAddress': json['ip_address'] == null ? undefined : json['ip_address'],
101
118
  'userAgent': json['user_agent'] == null ? undefined : json['user_agent'],
@@ -115,6 +132,7 @@ export function AuditLogToJSONTyped(value?: AuditLog | null, ignoreDiscriminator
115
132
 
116
133
  'created_at': ((value['createdAt']).toISOString()),
117
134
  'vault': VaultLiteToJSON(value['vault']),
135
+ 'api_key': APIKeyToJSON(value['apiKey']),
118
136
  'action': value['action'],
119
137
  'ip_address': value['ipAddress'],
120
138
  'user_agent': value['userAgent'],
@@ -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['vault_unique_ids'] == null ? undefined : json['vault_unique_ids'],
62
+ 'expiresAt': json['expires_at'] == null ? undefined : (new Date(json['expires_at'])),
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
+ 'vault_unique_ids': value['vaultUniqueIds'],
79
+ 'expires_at': value['expiresAt'] == null ? undefined : ((value['expiresAt']).toISOString()),
80
+ };
81
+ }
82
+
@@ -0,0 +1,83 @@
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 CreateAPIKeyResponse
28
+ */
29
+ export interface CreateAPIKeyResponse {
30
+ /**
31
+ *
32
+ * @type {APIKey}
33
+ * @memberof CreateAPIKeyResponse
34
+ */
35
+ apiKey: APIKey;
36
+ /**
37
+ * The generated API key (only shown once)
38
+ * @type {string}
39
+ * @memberof CreateAPIKeyResponse
40
+ */
41
+ key: string;
42
+ }
43
+
44
+ /**
45
+ * Check if a given object implements the CreateAPIKeyResponse interface.
46
+ */
47
+ export function instanceOfCreateAPIKeyResponse(value: object): value is CreateAPIKeyResponse {
48
+ if (!('apiKey' in value) || value['apiKey'] === undefined) return false;
49
+ if (!('key' in value) || value['key'] === undefined) return false;
50
+ return true;
51
+ }
52
+
53
+ export function CreateAPIKeyResponseFromJSON(json: any): CreateAPIKeyResponse {
54
+ return CreateAPIKeyResponseFromJSONTyped(json, false);
55
+ }
56
+
57
+ export function CreateAPIKeyResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateAPIKeyResponse {
58
+ if (json == null) {
59
+ return json;
60
+ }
61
+ return {
62
+
63
+ 'apiKey': APIKeyFromJSON(json['api_key']),
64
+ 'key': json['key'],
65
+ };
66
+ }
67
+
68
+ export function CreateAPIKeyResponseToJSON(json: any): CreateAPIKeyResponse {
69
+ return CreateAPIKeyResponseToJSONTyped(json, false);
70
+ }
71
+
72
+ export function CreateAPIKeyResponseToJSONTyped(value?: CreateAPIKeyResponse | null, ignoreDiscriminator: boolean = false): any {
73
+ if (value == null) {
74
+ return value;
75
+ }
76
+
77
+ return {
78
+
79
+ 'api_key': APIKeyToJSON(value['apiKey']),
80
+ 'key': value['key'],
81
+ };
82
+ }
83
+
@@ -0,0 +1,89 @@
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 UpdateAPIKeyRequest
20
+ */
21
+ export interface UpdateAPIKeyRequest {
22
+ /**
23
+ * Human-readable name for the API key
24
+ * @type {string}
25
+ * @memberof UpdateAPIKeyRequest
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 UpdateAPIKeyRequest
32
+ */
33
+ vaultUniqueIds?: Array<string>;
34
+ /**
35
+ * Optional expiration date
36
+ * @type {Date}
37
+ * @memberof UpdateAPIKeyRequest
38
+ */
39
+ expiresAt?: Date;
40
+ /**
41
+ * Enable or disable the API key
42
+ * @type {boolean}
43
+ * @memberof UpdateAPIKeyRequest
44
+ */
45
+ isActive?: boolean;
46
+ }
47
+
48
+ /**
49
+ * Check if a given object implements the UpdateAPIKeyRequest interface.
50
+ */
51
+ export function instanceOfUpdateAPIKeyRequest(value: object): value is UpdateAPIKeyRequest {
52
+ return true;
53
+ }
54
+
55
+ export function UpdateAPIKeyRequestFromJSON(json: any): UpdateAPIKeyRequest {
56
+ return UpdateAPIKeyRequestFromJSONTyped(json, false);
57
+ }
58
+
59
+ export function UpdateAPIKeyRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateAPIKeyRequest {
60
+ if (json == null) {
61
+ return json;
62
+ }
63
+ return {
64
+
65
+ 'name': json['name'] == null ? undefined : json['name'],
66
+ 'vaultUniqueIds': json['vault_unique_ids'] == null ? undefined : json['vault_unique_ids'],
67
+ 'expiresAt': json['expires_at'] == null ? undefined : (new Date(json['expires_at'])),
68
+ 'isActive': json['is_active'] == null ? undefined : json['is_active'],
69
+ };
70
+ }
71
+
72
+ export function UpdateAPIKeyRequestToJSON(json: any): UpdateAPIKeyRequest {
73
+ return UpdateAPIKeyRequestToJSONTyped(json, false);
74
+ }
75
+
76
+ export function UpdateAPIKeyRequestToJSONTyped(value?: UpdateAPIKeyRequest | null, ignoreDiscriminator: boolean = false): any {
77
+ if (value == null) {
78
+ return value;
79
+ }
80
+
81
+ return {
82
+
83
+ 'name': value['name'],
84
+ 'vault_unique_ids': value['vaultUniqueIds'],
85
+ 'expires_at': value['expiresAt'] == null ? undefined : ((value['expiresAt']).toISOString()),
86
+ 'is_active': value['isActive'],
87
+ };
88
+ }
89
+
@@ -1,7 +1,11 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
+ export * from './APIKey';
4
+ export * from './APIKeysResponse';
3
5
  export * from './AuditLog';
4
6
  export * from './AuditLogsResponse';
7
+ export * from './CreateAPIKeyRequest';
8
+ export * from './CreateAPIKeyResponse';
5
9
  export * from './CreateVaultRequest';
6
10
  export * from './GetUserResponse';
7
11
  export * from './HealthCheckResponse';
@@ -9,6 +13,7 @@ export * from './LoginRequest';
9
13
  export * from './LoginResponse';
10
14
  export * from './SignupRequest';
11
15
  export * from './SignupResponse';
16
+ export * from './UpdateAPIKeyRequest';
12
17
  export * from './UpdateVaultRequest';
13
18
  export * from './Vault';
14
19
  export * from './VaultLite';