@lwshen/vault-hub-ts-fetch-client 0.20250817.151443 → 0.20250818.95517
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/apis/APIKeyApi.d.ts +31 -1
- package/dist/apis/APIKeyApi.js +150 -0
- package/package.json +1 -1
- package/src/apis/APIKeyApi.ts +118 -0
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## @lwshen/vault-hub-ts-fetch-client@0.
|
|
1
|
+
## @lwshen/vault-hub-ts-fetch-client@0.20250818.095517
|
|
2
2
|
|
|
3
3
|
This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments:
|
|
4
4
|
|
|
@@ -36,7 +36,7 @@ navigate to the folder of your consuming project and run one of the following co
|
|
|
36
36
|
_published:_
|
|
37
37
|
|
|
38
38
|
```
|
|
39
|
-
npm install @lwshen/vault-hub-ts-fetch-client@0.
|
|
39
|
+
npm install @lwshen/vault-hub-ts-fetch-client@0.20250818.095517 --save
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
_unPublished (not recommended):_
|
package/dist/apis/APIKeyApi.d.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime';
|
|
13
|
-
import type { APIKey, APIKeysResponse, CreateAPIKeyRequest, CreateAPIKeyResponse, UpdateAPIKeyRequest } from '../models/index';
|
|
13
|
+
import type { APIKey, APIKeysResponse, CreateAPIKeyRequest, CreateAPIKeyResponse, UpdateAPIKeyRequest, Vault, VaultLite } from '../models/index';
|
|
14
14
|
export interface CreateAPIKeyOperationRequest {
|
|
15
15
|
createAPIKeyRequest: CreateAPIKeyRequest;
|
|
16
16
|
}
|
|
@@ -21,6 +21,12 @@ export interface GetAPIKeysRequest {
|
|
|
21
21
|
pageSize: number;
|
|
22
22
|
pageIndex: number;
|
|
23
23
|
}
|
|
24
|
+
export interface GetVaultByAPIKeyRequest {
|
|
25
|
+
uniqueId: string;
|
|
26
|
+
}
|
|
27
|
+
export interface GetVaultByNameAPIKeyRequest {
|
|
28
|
+
name: string;
|
|
29
|
+
}
|
|
24
30
|
export interface UpdateAPIKeyOperationRequest {
|
|
25
31
|
id: number;
|
|
26
32
|
updateAPIKeyRequest: UpdateAPIKeyRequest;
|
|
@@ -53,6 +59,30 @@ export declare class APIKeyApi extends runtime.BaseAPI {
|
|
|
53
59
|
* Get API keys for the current user with pagination
|
|
54
60
|
*/
|
|
55
61
|
getAPIKeys(pageSize: number, pageIndex: number, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<APIKeysResponse>;
|
|
62
|
+
/**
|
|
63
|
+
* Get a specific vault by Unique ID using API key
|
|
64
|
+
*/
|
|
65
|
+
getVaultByAPIKeyRaw(requestParameters: GetVaultByAPIKeyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Vault>>;
|
|
66
|
+
/**
|
|
67
|
+
* Get a specific vault by Unique ID using API key
|
|
68
|
+
*/
|
|
69
|
+
getVaultByAPIKey(uniqueId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Vault>;
|
|
70
|
+
/**
|
|
71
|
+
* Get a specific vault by name using API key
|
|
72
|
+
*/
|
|
73
|
+
getVaultByNameAPIKeyRaw(requestParameters: GetVaultByNameAPIKeyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Vault>>;
|
|
74
|
+
/**
|
|
75
|
+
* Get a specific vault by name using API key
|
|
76
|
+
*/
|
|
77
|
+
getVaultByNameAPIKey(name: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Vault>;
|
|
78
|
+
/**
|
|
79
|
+
* Get all vaults accessible by API key
|
|
80
|
+
*/
|
|
81
|
+
getVaultsByAPIKeyRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<VaultLite>>>;
|
|
82
|
+
/**
|
|
83
|
+
* Get all vaults accessible by API key
|
|
84
|
+
*/
|
|
85
|
+
getVaultsByAPIKey(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<VaultLite>>;
|
|
56
86
|
/**
|
|
57
87
|
* Update an API key (enable/disable or modify properties)
|
|
58
88
|
*/
|
package/dist/apis/APIKeyApi.js
CHANGED
|
@@ -216,6 +216,156 @@ var APIKeyApi = /** @class */ (function (_super) {
|
|
|
216
216
|
});
|
|
217
217
|
});
|
|
218
218
|
};
|
|
219
|
+
/**
|
|
220
|
+
* Get a specific vault by Unique ID using API key
|
|
221
|
+
*/
|
|
222
|
+
APIKeyApi.prototype.getVaultByAPIKeyRaw = function (requestParameters, initOverrides) {
|
|
223
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
224
|
+
var queryParameters, headerParameters, _a, _b, response;
|
|
225
|
+
return __generator(this, function (_c) {
|
|
226
|
+
switch (_c.label) {
|
|
227
|
+
case 0:
|
|
228
|
+
if (requestParameters['uniqueId'] == null) {
|
|
229
|
+
throw new runtime.RequiredError('uniqueId', 'Required parameter "uniqueId" was null or undefined when calling getVaultByAPIKey().');
|
|
230
|
+
}
|
|
231
|
+
queryParameters = {};
|
|
232
|
+
headerParameters = {};
|
|
233
|
+
if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
|
|
234
|
+
_a = headerParameters;
|
|
235
|
+
_b = "X-API-Key";
|
|
236
|
+
return [4 /*yield*/, this.configuration.apiKey("X-API-Key")];
|
|
237
|
+
case 1:
|
|
238
|
+
_a[_b] = _c.sent(); // ApiKeyAuth authentication
|
|
239
|
+
_c.label = 2;
|
|
240
|
+
case 2: return [4 /*yield*/, this.request({
|
|
241
|
+
path: "/api/cli/vault/{uniqueId}".replace("{".concat("uniqueId", "}"), encodeURIComponent(String(requestParameters['uniqueId']))),
|
|
242
|
+
method: 'GET',
|
|
243
|
+
headers: headerParameters,
|
|
244
|
+
query: queryParameters,
|
|
245
|
+
}, initOverrides)];
|
|
246
|
+
case 3:
|
|
247
|
+
response = _c.sent();
|
|
248
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.VaultFromJSON)(jsonValue); })];
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
});
|
|
252
|
+
};
|
|
253
|
+
/**
|
|
254
|
+
* Get a specific vault by Unique ID using API key
|
|
255
|
+
*/
|
|
256
|
+
APIKeyApi.prototype.getVaultByAPIKey = function (uniqueId, initOverrides) {
|
|
257
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
258
|
+
var response;
|
|
259
|
+
return __generator(this, function (_a) {
|
|
260
|
+
switch (_a.label) {
|
|
261
|
+
case 0: return [4 /*yield*/, this.getVaultByAPIKeyRaw({ uniqueId: uniqueId }, initOverrides)];
|
|
262
|
+
case 1:
|
|
263
|
+
response = _a.sent();
|
|
264
|
+
return [4 /*yield*/, response.value()];
|
|
265
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
});
|
|
269
|
+
};
|
|
270
|
+
/**
|
|
271
|
+
* Get a specific vault by name using API key
|
|
272
|
+
*/
|
|
273
|
+
APIKeyApi.prototype.getVaultByNameAPIKeyRaw = function (requestParameters, initOverrides) {
|
|
274
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
275
|
+
var queryParameters, headerParameters, _a, _b, response;
|
|
276
|
+
return __generator(this, function (_c) {
|
|
277
|
+
switch (_c.label) {
|
|
278
|
+
case 0:
|
|
279
|
+
if (requestParameters['name'] == null) {
|
|
280
|
+
throw new runtime.RequiredError('name', 'Required parameter "name" was null or undefined when calling getVaultByNameAPIKey().');
|
|
281
|
+
}
|
|
282
|
+
queryParameters = {};
|
|
283
|
+
headerParameters = {};
|
|
284
|
+
if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
|
|
285
|
+
_a = headerParameters;
|
|
286
|
+
_b = "X-API-Key";
|
|
287
|
+
return [4 /*yield*/, this.configuration.apiKey("X-API-Key")];
|
|
288
|
+
case 1:
|
|
289
|
+
_a[_b] = _c.sent(); // ApiKeyAuth authentication
|
|
290
|
+
_c.label = 2;
|
|
291
|
+
case 2: return [4 /*yield*/, this.request({
|
|
292
|
+
path: "/api/cli/vault/name/{name}".replace("{".concat("name", "}"), encodeURIComponent(String(requestParameters['name']))),
|
|
293
|
+
method: 'GET',
|
|
294
|
+
headers: headerParameters,
|
|
295
|
+
query: queryParameters,
|
|
296
|
+
}, initOverrides)];
|
|
297
|
+
case 3:
|
|
298
|
+
response = _c.sent();
|
|
299
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.VaultFromJSON)(jsonValue); })];
|
|
300
|
+
}
|
|
301
|
+
});
|
|
302
|
+
});
|
|
303
|
+
};
|
|
304
|
+
/**
|
|
305
|
+
* Get a specific vault by name using API key
|
|
306
|
+
*/
|
|
307
|
+
APIKeyApi.prototype.getVaultByNameAPIKey = function (name, initOverrides) {
|
|
308
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
309
|
+
var response;
|
|
310
|
+
return __generator(this, function (_a) {
|
|
311
|
+
switch (_a.label) {
|
|
312
|
+
case 0: return [4 /*yield*/, this.getVaultByNameAPIKeyRaw({ name: name }, initOverrides)];
|
|
313
|
+
case 1:
|
|
314
|
+
response = _a.sent();
|
|
315
|
+
return [4 /*yield*/, response.value()];
|
|
316
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
});
|
|
320
|
+
};
|
|
321
|
+
/**
|
|
322
|
+
* Get all vaults accessible by API key
|
|
323
|
+
*/
|
|
324
|
+
APIKeyApi.prototype.getVaultsByAPIKeyRaw = function (initOverrides) {
|
|
325
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
326
|
+
var queryParameters, headerParameters, _a, _b, response;
|
|
327
|
+
return __generator(this, function (_c) {
|
|
328
|
+
switch (_c.label) {
|
|
329
|
+
case 0:
|
|
330
|
+
queryParameters = {};
|
|
331
|
+
headerParameters = {};
|
|
332
|
+
if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
|
|
333
|
+
_a = headerParameters;
|
|
334
|
+
_b = "X-API-Key";
|
|
335
|
+
return [4 /*yield*/, this.configuration.apiKey("X-API-Key")];
|
|
336
|
+
case 1:
|
|
337
|
+
_a[_b] = _c.sent(); // ApiKeyAuth authentication
|
|
338
|
+
_c.label = 2;
|
|
339
|
+
case 2: return [4 /*yield*/, this.request({
|
|
340
|
+
path: "/api/cli/vaults",
|
|
341
|
+
method: 'GET',
|
|
342
|
+
headers: headerParameters,
|
|
343
|
+
query: queryParameters,
|
|
344
|
+
}, initOverrides)];
|
|
345
|
+
case 3:
|
|
346
|
+
response = _c.sent();
|
|
347
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return jsonValue.map(index_1.VaultLiteFromJSON); })];
|
|
348
|
+
}
|
|
349
|
+
});
|
|
350
|
+
});
|
|
351
|
+
};
|
|
352
|
+
/**
|
|
353
|
+
* Get all vaults accessible by API key
|
|
354
|
+
*/
|
|
355
|
+
APIKeyApi.prototype.getVaultsByAPIKey = function (initOverrides) {
|
|
356
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
357
|
+
var response;
|
|
358
|
+
return __generator(this, function (_a) {
|
|
359
|
+
switch (_a.label) {
|
|
360
|
+
case 0: return [4 /*yield*/, this.getVaultsByAPIKeyRaw(initOverrides)];
|
|
361
|
+
case 1:
|
|
362
|
+
response = _a.sent();
|
|
363
|
+
return [4 /*yield*/, response.value()];
|
|
364
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
365
|
+
}
|
|
366
|
+
});
|
|
367
|
+
});
|
|
368
|
+
};
|
|
219
369
|
/**
|
|
220
370
|
* Update an API key (enable/disable or modify properties)
|
|
221
371
|
*/
|
package/package.json
CHANGED
package/src/apis/APIKeyApi.ts
CHANGED
|
@@ -20,6 +20,8 @@ import type {
|
|
|
20
20
|
CreateAPIKeyRequest,
|
|
21
21
|
CreateAPIKeyResponse,
|
|
22
22
|
UpdateAPIKeyRequest,
|
|
23
|
+
Vault,
|
|
24
|
+
VaultLite,
|
|
23
25
|
} from '../models/index';
|
|
24
26
|
import {
|
|
25
27
|
APIKeyFromJSON,
|
|
@@ -32,6 +34,10 @@ import {
|
|
|
32
34
|
CreateAPIKeyResponseToJSON,
|
|
33
35
|
UpdateAPIKeyRequestFromJSON,
|
|
34
36
|
UpdateAPIKeyRequestToJSON,
|
|
37
|
+
VaultFromJSON,
|
|
38
|
+
VaultToJSON,
|
|
39
|
+
VaultLiteFromJSON,
|
|
40
|
+
VaultLiteToJSON,
|
|
35
41
|
} from '../models/index';
|
|
36
42
|
|
|
37
43
|
export interface CreateAPIKeyOperationRequest {
|
|
@@ -47,6 +53,14 @@ export interface GetAPIKeysRequest {
|
|
|
47
53
|
pageIndex: number;
|
|
48
54
|
}
|
|
49
55
|
|
|
56
|
+
export interface GetVaultByAPIKeyRequest {
|
|
57
|
+
uniqueId: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface GetVaultByNameAPIKeyRequest {
|
|
61
|
+
name: string;
|
|
62
|
+
}
|
|
63
|
+
|
|
50
64
|
export interface UpdateAPIKeyOperationRequest {
|
|
51
65
|
id: number;
|
|
52
66
|
updateAPIKeyRequest: UpdateAPIKeyRequest;
|
|
@@ -173,6 +187,110 @@ export class APIKeyApi extends runtime.BaseAPI {
|
|
|
173
187
|
return await response.value();
|
|
174
188
|
}
|
|
175
189
|
|
|
190
|
+
/**
|
|
191
|
+
* Get a specific vault by Unique ID using API key
|
|
192
|
+
*/
|
|
193
|
+
async getVaultByAPIKeyRaw(requestParameters: GetVaultByAPIKeyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Vault>> {
|
|
194
|
+
if (requestParameters['uniqueId'] == null) {
|
|
195
|
+
throw new runtime.RequiredError(
|
|
196
|
+
'uniqueId',
|
|
197
|
+
'Required parameter "uniqueId" was null or undefined when calling getVaultByAPIKey().'
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
const queryParameters: any = {};
|
|
202
|
+
|
|
203
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
204
|
+
|
|
205
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
206
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
const response = await this.request({
|
|
210
|
+
path: `/api/cli/vault/{uniqueId}`.replace(`{${"uniqueId"}}`, encodeURIComponent(String(requestParameters['uniqueId']))),
|
|
211
|
+
method: 'GET',
|
|
212
|
+
headers: headerParameters,
|
|
213
|
+
query: queryParameters,
|
|
214
|
+
}, initOverrides);
|
|
215
|
+
|
|
216
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => VaultFromJSON(jsonValue));
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Get a specific vault by Unique ID using API key
|
|
221
|
+
*/
|
|
222
|
+
async getVaultByAPIKey(uniqueId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Vault> {
|
|
223
|
+
const response = await this.getVaultByAPIKeyRaw({ uniqueId: uniqueId }, initOverrides);
|
|
224
|
+
return await response.value();
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Get a specific vault by name using API key
|
|
229
|
+
*/
|
|
230
|
+
async getVaultByNameAPIKeyRaw(requestParameters: GetVaultByNameAPIKeyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Vault>> {
|
|
231
|
+
if (requestParameters['name'] == null) {
|
|
232
|
+
throw new runtime.RequiredError(
|
|
233
|
+
'name',
|
|
234
|
+
'Required parameter "name" was null or undefined when calling getVaultByNameAPIKey().'
|
|
235
|
+
);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
const queryParameters: any = {};
|
|
239
|
+
|
|
240
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
241
|
+
|
|
242
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
243
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
const response = await this.request({
|
|
247
|
+
path: `/api/cli/vault/name/{name}`.replace(`{${"name"}}`, encodeURIComponent(String(requestParameters['name']))),
|
|
248
|
+
method: 'GET',
|
|
249
|
+
headers: headerParameters,
|
|
250
|
+
query: queryParameters,
|
|
251
|
+
}, initOverrides);
|
|
252
|
+
|
|
253
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => VaultFromJSON(jsonValue));
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Get a specific vault by name using API key
|
|
258
|
+
*/
|
|
259
|
+
async getVaultByNameAPIKey(name: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Vault> {
|
|
260
|
+
const response = await this.getVaultByNameAPIKeyRaw({ name: name }, initOverrides);
|
|
261
|
+
return await response.value();
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Get all vaults accessible by API key
|
|
266
|
+
*/
|
|
267
|
+
async getVaultsByAPIKeyRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<VaultLite>>> {
|
|
268
|
+
const queryParameters: any = {};
|
|
269
|
+
|
|
270
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
271
|
+
|
|
272
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
273
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
const response = await this.request({
|
|
277
|
+
path: `/api/cli/vaults`,
|
|
278
|
+
method: 'GET',
|
|
279
|
+
headers: headerParameters,
|
|
280
|
+
query: queryParameters,
|
|
281
|
+
}, initOverrides);
|
|
282
|
+
|
|
283
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(VaultLiteFromJSON));
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* Get all vaults accessible by API key
|
|
288
|
+
*/
|
|
289
|
+
async getVaultsByAPIKey(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<VaultLite>> {
|
|
290
|
+
const response = await this.getVaultsByAPIKeyRaw(initOverrides);
|
|
291
|
+
return await response.value();
|
|
292
|
+
}
|
|
293
|
+
|
|
176
294
|
/**
|
|
177
295
|
* Update an API key (enable/disable or modify properties)
|
|
178
296
|
*/
|