@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
package/.openapi-generator/FILES
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
.openapi-generator-ignore
|
|
4
4
|
README.md
|
|
5
5
|
package.json
|
|
6
|
+
src/apis/APIKeyApi.ts
|
|
6
7
|
src/apis/AuditApi.ts
|
|
7
8
|
src/apis/AuthApi.ts
|
|
8
9
|
src/apis/DefaultApi.ts
|
|
@@ -10,8 +11,12 @@ src/apis/UserApi.ts
|
|
|
10
11
|
src/apis/VaultApi.ts
|
|
11
12
|
src/apis/index.ts
|
|
12
13
|
src/index.ts
|
|
14
|
+
src/models/APIKey.ts
|
|
15
|
+
src/models/APIKeysResponse.ts
|
|
13
16
|
src/models/AuditLog.ts
|
|
14
17
|
src/models/AuditLogsResponse.ts
|
|
18
|
+
src/models/CreateAPIKeyRequest.ts
|
|
19
|
+
src/models/CreateAPIKeyResponse.ts
|
|
15
20
|
src/models/CreateVaultRequest.ts
|
|
16
21
|
src/models/GetUserResponse.ts
|
|
17
22
|
src/models/HealthCheckResponse.ts
|
|
@@ -19,6 +24,7 @@ src/models/LoginRequest.ts
|
|
|
19
24
|
src/models/LoginResponse.ts
|
|
20
25
|
src/models/SignupRequest.ts
|
|
21
26
|
src/models/SignupResponse.ts
|
|
27
|
+
src/models/UpdateAPIKeyRequest.ts
|
|
22
28
|
src/models/UpdateVaultRequest.ts
|
|
23
29
|
src/models/Vault.ts
|
|
24
30
|
src/models/VaultLite.ts
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## @lwshen/vault-hub-ts-fetch-client@0.
|
|
1
|
+
## @lwshen/vault-hub-ts-fetch-client@0.20250729.153154
|
|
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.20250729.153154 --save
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
_unPublished (not recommended):_
|
|
@@ -0,0 +1,64 @@
|
|
|
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 * as runtime from '../runtime';
|
|
13
|
+
import type { APIKey, APIKeysResponse, CreateAPIKeyRequest, CreateAPIKeyResponse, UpdateAPIKeyRequest } from '../models/index';
|
|
14
|
+
export interface CreateAPIKeyOperationRequest {
|
|
15
|
+
createAPIKeyRequest: CreateAPIKeyRequest;
|
|
16
|
+
}
|
|
17
|
+
export interface DeleteAPIKeyRequest {
|
|
18
|
+
id: number;
|
|
19
|
+
}
|
|
20
|
+
export interface GetAPIKeysRequest {
|
|
21
|
+
pageSize: number;
|
|
22
|
+
pageIndex: number;
|
|
23
|
+
}
|
|
24
|
+
export interface UpdateAPIKeyOperationRequest {
|
|
25
|
+
id: number;
|
|
26
|
+
updateAPIKeyRequest: UpdateAPIKeyRequest;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
31
|
+
export declare class APIKeyApi extends runtime.BaseAPI {
|
|
32
|
+
/**
|
|
33
|
+
* Create a new API key
|
|
34
|
+
*/
|
|
35
|
+
createAPIKeyRaw(requestParameters: CreateAPIKeyOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CreateAPIKeyResponse>>;
|
|
36
|
+
/**
|
|
37
|
+
* Create a new API key
|
|
38
|
+
*/
|
|
39
|
+
createAPIKey(createAPIKeyRequest: CreateAPIKeyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CreateAPIKeyResponse>;
|
|
40
|
+
/**
|
|
41
|
+
* Delete an API key
|
|
42
|
+
*/
|
|
43
|
+
deleteAPIKeyRaw(requestParameters: DeleteAPIKeyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
44
|
+
/**
|
|
45
|
+
* Delete an API key
|
|
46
|
+
*/
|
|
47
|
+
deleteAPIKey(id: number, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* Get API keys for the current user with pagination
|
|
50
|
+
*/
|
|
51
|
+
getAPIKeysRaw(requestParameters: GetAPIKeysRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<APIKeysResponse>>;
|
|
52
|
+
/**
|
|
53
|
+
* Get API keys for the current user with pagination
|
|
54
|
+
*/
|
|
55
|
+
getAPIKeys(pageSize: number, pageIndex: number, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<APIKeysResponse>;
|
|
56
|
+
/**
|
|
57
|
+
* Update an API key (enable/disable or modify properties)
|
|
58
|
+
*/
|
|
59
|
+
updateAPIKeyRaw(requestParameters: UpdateAPIKeyOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<APIKey>>;
|
|
60
|
+
/**
|
|
61
|
+
* Update an API key (enable/disable or modify properties)
|
|
62
|
+
*/
|
|
63
|
+
updateAPIKey(id: number, updateAPIKeyRequest: UpdateAPIKeyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<APIKey>;
|
|
64
|
+
}
|
|
@@ -0,0 +1,270 @@
|
|
|
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
|
+
var __extends = (this && this.__extends) || (function () {
|
|
16
|
+
var extendStatics = function (d, b) {
|
|
17
|
+
extendStatics = Object.setPrototypeOf ||
|
|
18
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
19
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
20
|
+
return extendStatics(d, b);
|
|
21
|
+
};
|
|
22
|
+
return function (d, b) {
|
|
23
|
+
if (typeof b !== "function" && b !== null)
|
|
24
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
25
|
+
extendStatics(d, b);
|
|
26
|
+
function __() { this.constructor = d; }
|
|
27
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
28
|
+
};
|
|
29
|
+
})();
|
|
30
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
31
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
32
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
33
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
34
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
35
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
36
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
40
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
41
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
42
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
43
|
+
function step(op) {
|
|
44
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
45
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
46
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
47
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
48
|
+
switch (op[0]) {
|
|
49
|
+
case 0: case 1: t = op; break;
|
|
50
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
51
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
52
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
53
|
+
default:
|
|
54
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
55
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
56
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
57
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
58
|
+
if (t[2]) _.ops.pop();
|
|
59
|
+
_.trys.pop(); continue;
|
|
60
|
+
}
|
|
61
|
+
op = body.call(thisArg, _);
|
|
62
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
63
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
67
|
+
exports.APIKeyApi = void 0;
|
|
68
|
+
var runtime = require("../runtime");
|
|
69
|
+
var index_1 = require("../models/index");
|
|
70
|
+
/**
|
|
71
|
+
*
|
|
72
|
+
*/
|
|
73
|
+
var APIKeyApi = /** @class */ (function (_super) {
|
|
74
|
+
__extends(APIKeyApi, _super);
|
|
75
|
+
function APIKeyApi() {
|
|
76
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Create a new API key
|
|
80
|
+
*/
|
|
81
|
+
APIKeyApi.prototype.createAPIKeyRaw = function (requestParameters, initOverrides) {
|
|
82
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
83
|
+
var queryParameters, headerParameters, response;
|
|
84
|
+
return __generator(this, function (_a) {
|
|
85
|
+
switch (_a.label) {
|
|
86
|
+
case 0:
|
|
87
|
+
if (requestParameters['createAPIKeyRequest'] == null) {
|
|
88
|
+
throw new runtime.RequiredError('createAPIKeyRequest', 'Required parameter "createAPIKeyRequest" was null or undefined when calling createAPIKey().');
|
|
89
|
+
}
|
|
90
|
+
queryParameters = {};
|
|
91
|
+
headerParameters = {};
|
|
92
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
93
|
+
return [4 /*yield*/, this.request({
|
|
94
|
+
path: "/api/api-keys",
|
|
95
|
+
method: 'POST',
|
|
96
|
+
headers: headerParameters,
|
|
97
|
+
query: queryParameters,
|
|
98
|
+
body: (0, index_1.CreateAPIKeyRequestToJSON)(requestParameters['createAPIKeyRequest']),
|
|
99
|
+
}, initOverrides)];
|
|
100
|
+
case 1:
|
|
101
|
+
response = _a.sent();
|
|
102
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.CreateAPIKeyResponseFromJSON)(jsonValue); })];
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* Create a new API key
|
|
109
|
+
*/
|
|
110
|
+
APIKeyApi.prototype.createAPIKey = function (createAPIKeyRequest, initOverrides) {
|
|
111
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
112
|
+
var response;
|
|
113
|
+
return __generator(this, function (_a) {
|
|
114
|
+
switch (_a.label) {
|
|
115
|
+
case 0: return [4 /*yield*/, this.createAPIKeyRaw({ createAPIKeyRequest: createAPIKeyRequest }, initOverrides)];
|
|
116
|
+
case 1:
|
|
117
|
+
response = _a.sent();
|
|
118
|
+
return [4 /*yield*/, response.value()];
|
|
119
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* Delete an API key
|
|
126
|
+
*/
|
|
127
|
+
APIKeyApi.prototype.deleteAPIKeyRaw = function (requestParameters, initOverrides) {
|
|
128
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
129
|
+
var queryParameters, headerParameters, response;
|
|
130
|
+
return __generator(this, function (_a) {
|
|
131
|
+
switch (_a.label) {
|
|
132
|
+
case 0:
|
|
133
|
+
if (requestParameters['id'] == null) {
|
|
134
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling deleteAPIKey().');
|
|
135
|
+
}
|
|
136
|
+
queryParameters = {};
|
|
137
|
+
headerParameters = {};
|
|
138
|
+
return [4 /*yield*/, this.request({
|
|
139
|
+
path: "/api/api-keys/{id}".replace("{".concat("id", "}"), encodeURIComponent(String(requestParameters['id']))),
|
|
140
|
+
method: 'DELETE',
|
|
141
|
+
headers: headerParameters,
|
|
142
|
+
query: queryParameters,
|
|
143
|
+
}, initOverrides)];
|
|
144
|
+
case 1:
|
|
145
|
+
response = _a.sent();
|
|
146
|
+
return [2 /*return*/, new runtime.VoidApiResponse(response)];
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* Delete an API key
|
|
153
|
+
*/
|
|
154
|
+
APIKeyApi.prototype.deleteAPIKey = function (id, initOverrides) {
|
|
155
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
156
|
+
return __generator(this, function (_a) {
|
|
157
|
+
switch (_a.label) {
|
|
158
|
+
case 0: return [4 /*yield*/, this.deleteAPIKeyRaw({ id: id }, initOverrides)];
|
|
159
|
+
case 1:
|
|
160
|
+
_a.sent();
|
|
161
|
+
return [2 /*return*/];
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
};
|
|
166
|
+
/**
|
|
167
|
+
* Get API keys for the current user with pagination
|
|
168
|
+
*/
|
|
169
|
+
APIKeyApi.prototype.getAPIKeysRaw = function (requestParameters, initOverrides) {
|
|
170
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
171
|
+
var queryParameters, headerParameters, response;
|
|
172
|
+
return __generator(this, function (_a) {
|
|
173
|
+
switch (_a.label) {
|
|
174
|
+
case 0:
|
|
175
|
+
if (requestParameters['pageSize'] == null) {
|
|
176
|
+
throw new runtime.RequiredError('pageSize', 'Required parameter "pageSize" was null or undefined when calling getAPIKeys().');
|
|
177
|
+
}
|
|
178
|
+
if (requestParameters['pageIndex'] == null) {
|
|
179
|
+
throw new runtime.RequiredError('pageIndex', 'Required parameter "pageIndex" was null or undefined when calling getAPIKeys().');
|
|
180
|
+
}
|
|
181
|
+
queryParameters = {};
|
|
182
|
+
if (requestParameters['pageSize'] != null) {
|
|
183
|
+
queryParameters['pageSize'] = requestParameters['pageSize'];
|
|
184
|
+
}
|
|
185
|
+
if (requestParameters['pageIndex'] != null) {
|
|
186
|
+
queryParameters['pageIndex'] = requestParameters['pageIndex'];
|
|
187
|
+
}
|
|
188
|
+
headerParameters = {};
|
|
189
|
+
return [4 /*yield*/, this.request({
|
|
190
|
+
path: "/api/api-keys",
|
|
191
|
+
method: 'GET',
|
|
192
|
+
headers: headerParameters,
|
|
193
|
+
query: queryParameters,
|
|
194
|
+
}, initOverrides)];
|
|
195
|
+
case 1:
|
|
196
|
+
response = _a.sent();
|
|
197
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.APIKeysResponseFromJSON)(jsonValue); })];
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
});
|
|
201
|
+
};
|
|
202
|
+
/**
|
|
203
|
+
* Get API keys for the current user with pagination
|
|
204
|
+
*/
|
|
205
|
+
APIKeyApi.prototype.getAPIKeys = function (pageSize, pageIndex, initOverrides) {
|
|
206
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
207
|
+
var response;
|
|
208
|
+
return __generator(this, function (_a) {
|
|
209
|
+
switch (_a.label) {
|
|
210
|
+
case 0: return [4 /*yield*/, this.getAPIKeysRaw({ pageSize: pageSize, pageIndex: pageIndex }, initOverrides)];
|
|
211
|
+
case 1:
|
|
212
|
+
response = _a.sent();
|
|
213
|
+
return [4 /*yield*/, response.value()];
|
|
214
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
});
|
|
218
|
+
};
|
|
219
|
+
/**
|
|
220
|
+
* Update an API key (enable/disable or modify properties)
|
|
221
|
+
*/
|
|
222
|
+
APIKeyApi.prototype.updateAPIKeyRaw = function (requestParameters, initOverrides) {
|
|
223
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
224
|
+
var queryParameters, headerParameters, response;
|
|
225
|
+
return __generator(this, function (_a) {
|
|
226
|
+
switch (_a.label) {
|
|
227
|
+
case 0:
|
|
228
|
+
if (requestParameters['id'] == null) {
|
|
229
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling updateAPIKey().');
|
|
230
|
+
}
|
|
231
|
+
if (requestParameters['updateAPIKeyRequest'] == null) {
|
|
232
|
+
throw new runtime.RequiredError('updateAPIKeyRequest', 'Required parameter "updateAPIKeyRequest" was null or undefined when calling updateAPIKey().');
|
|
233
|
+
}
|
|
234
|
+
queryParameters = {};
|
|
235
|
+
headerParameters = {};
|
|
236
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
237
|
+
return [4 /*yield*/, this.request({
|
|
238
|
+
path: "/api/api-keys/{id}".replace("{".concat("id", "}"), encodeURIComponent(String(requestParameters['id']))),
|
|
239
|
+
method: 'PATCH',
|
|
240
|
+
headers: headerParameters,
|
|
241
|
+
query: queryParameters,
|
|
242
|
+
body: (0, index_1.UpdateAPIKeyRequestToJSON)(requestParameters['updateAPIKeyRequest']),
|
|
243
|
+
}, initOverrides)];
|
|
244
|
+
case 1:
|
|
245
|
+
response = _a.sent();
|
|
246
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.APIKeyFromJSON)(jsonValue); })];
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
});
|
|
250
|
+
};
|
|
251
|
+
/**
|
|
252
|
+
* Update an API key (enable/disable or modify properties)
|
|
253
|
+
*/
|
|
254
|
+
APIKeyApi.prototype.updateAPIKey = function (id, updateAPIKeyRequest, initOverrides) {
|
|
255
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
256
|
+
var response;
|
|
257
|
+
return __generator(this, function (_a) {
|
|
258
|
+
switch (_a.label) {
|
|
259
|
+
case 0: return [4 /*yield*/, this.updateAPIKeyRaw({ id: id, updateAPIKeyRequest: updateAPIKeyRequest }, initOverrides)];
|
|
260
|
+
case 1:
|
|
261
|
+
response = _a.sent();
|
|
262
|
+
return [4 /*yield*/, response.value()];
|
|
263
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
});
|
|
267
|
+
};
|
|
268
|
+
return APIKeyApi;
|
|
269
|
+
}(runtime.BaseAPI));
|
|
270
|
+
exports.APIKeyApi = APIKeyApi;
|
package/dist/apis/AuditApi.js
CHANGED
|
@@ -92,13 +92,13 @@ var AuditApi = /** @class */ (function (_super) {
|
|
|
92
92
|
}
|
|
93
93
|
queryParameters = {};
|
|
94
94
|
if (requestParameters['startDate'] != null) {
|
|
95
|
-
queryParameters['
|
|
95
|
+
queryParameters['startDate'] = requestParameters['startDate'].toISOString();
|
|
96
96
|
}
|
|
97
97
|
if (requestParameters['endDate'] != null) {
|
|
98
|
-
queryParameters['
|
|
98
|
+
queryParameters['endDate'] = requestParameters['endDate'].toISOString();
|
|
99
99
|
}
|
|
100
100
|
if (requestParameters['vaultUniqueId'] != null) {
|
|
101
|
-
queryParameters['
|
|
101
|
+
queryParameters['vaultUniqueId'] = requestParameters['vaultUniqueId'];
|
|
102
102
|
}
|
|
103
103
|
if (requestParameters['pageSize'] != null) {
|
|
104
104
|
queryParameters['pageSize'] = requestParameters['pageSize'];
|
package/dist/apis/VaultApi.js
CHANGED
|
@@ -136,7 +136,7 @@ var VaultApi = /** @class */ (function (_super) {
|
|
|
136
136
|
queryParameters = {};
|
|
137
137
|
headerParameters = {};
|
|
138
138
|
return [4 /*yield*/, this.request({
|
|
139
|
-
path: "/api/vaults/{
|
|
139
|
+
path: "/api/vaults/{uniqueId}".replace("{".concat("uniqueId", "}"), encodeURIComponent(String(requestParameters['uniqueId']))),
|
|
140
140
|
method: 'DELETE',
|
|
141
141
|
headers: headerParameters,
|
|
142
142
|
query: queryParameters,
|
|
@@ -178,7 +178,7 @@ var VaultApi = /** @class */ (function (_super) {
|
|
|
178
178
|
queryParameters = {};
|
|
179
179
|
headerParameters = {};
|
|
180
180
|
return [4 /*yield*/, this.request({
|
|
181
|
-
path: "/api/vaults/{
|
|
181
|
+
path: "/api/vaults/{uniqueId}".replace("{".concat("uniqueId", "}"), encodeURIComponent(String(requestParameters['uniqueId']))),
|
|
182
182
|
method: 'GET',
|
|
183
183
|
headers: headerParameters,
|
|
184
184
|
query: queryParameters,
|
|
@@ -267,7 +267,7 @@ var VaultApi = /** @class */ (function (_super) {
|
|
|
267
267
|
headerParameters = {};
|
|
268
268
|
headerParameters['Content-Type'] = 'application/json';
|
|
269
269
|
return [4 /*yield*/, this.request({
|
|
270
|
-
path: "/api/vaults/{
|
|
270
|
+
path: "/api/vaults/{uniqueId}".replace("{".concat("uniqueId", "}"), encodeURIComponent(String(requestParameters['uniqueId']))),
|
|
271
271
|
method: 'PUT',
|
|
272
272
|
headers: headerParameters,
|
|
273
273
|
query: queryParameters,
|
package/dist/apis/index.d.ts
CHANGED
package/dist/apis/index.js
CHANGED
|
@@ -16,6 +16,7 @@ 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("./APIKeyApi"), exports);
|
|
19
20
|
__exportStar(require("./AuditApi"), exports);
|
|
20
21
|
__exportStar(require("./AuthApi"), exports);
|
|
21
22
|
__exportStar(require("./DefaultApi"), exports);
|
|
@@ -0,0 +1,75 @@
|
|
|
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 { VaultLite } from './VaultLite';
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @export
|
|
16
|
+
* @interface APIKey
|
|
17
|
+
*/
|
|
18
|
+
export interface APIKey {
|
|
19
|
+
/**
|
|
20
|
+
* Unique API key ID
|
|
21
|
+
* @type {number}
|
|
22
|
+
* @memberof APIKey
|
|
23
|
+
*/
|
|
24
|
+
id: number;
|
|
25
|
+
/**
|
|
26
|
+
* Human-readable name for the API key
|
|
27
|
+
* @type {string}
|
|
28
|
+
* @memberof APIKey
|
|
29
|
+
*/
|
|
30
|
+
name: string;
|
|
31
|
+
/**
|
|
32
|
+
* Array of vaults this key can access (null/empty = all user's vaults)
|
|
33
|
+
* @type {Array<VaultLite>}
|
|
34
|
+
* @memberof APIKey
|
|
35
|
+
*/
|
|
36
|
+
vaults?: Array<VaultLite>;
|
|
37
|
+
/**
|
|
38
|
+
* Optional expiration date
|
|
39
|
+
* @type {Date}
|
|
40
|
+
* @memberof APIKey
|
|
41
|
+
*/
|
|
42
|
+
expiresAt?: Date;
|
|
43
|
+
/**
|
|
44
|
+
* When the key was last used
|
|
45
|
+
* @type {Date}
|
|
46
|
+
* @memberof APIKey
|
|
47
|
+
*/
|
|
48
|
+
lastUsedAt?: Date;
|
|
49
|
+
/**
|
|
50
|
+
* Whether the key is currently active
|
|
51
|
+
* @type {boolean}
|
|
52
|
+
* @memberof APIKey
|
|
53
|
+
*/
|
|
54
|
+
isActive: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* When the key was created
|
|
57
|
+
* @type {Date}
|
|
58
|
+
* @memberof APIKey
|
|
59
|
+
*/
|
|
60
|
+
createdAt: Date;
|
|
61
|
+
/**
|
|
62
|
+
* When the key was last updated
|
|
63
|
+
* @type {Date}
|
|
64
|
+
* @memberof APIKey
|
|
65
|
+
*/
|
|
66
|
+
updatedAt?: Date;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Check if a given object implements the APIKey interface.
|
|
70
|
+
*/
|
|
71
|
+
export declare function instanceOfAPIKey(value: object): value is APIKey;
|
|
72
|
+
export declare function APIKeyFromJSON(json: any): APIKey;
|
|
73
|
+
export declare function APIKeyFromJSONTyped(json: any, ignoreDiscriminator: boolean): APIKey;
|
|
74
|
+
export declare function APIKeyToJSON(json: any): APIKey;
|
|
75
|
+
export declare function APIKeyToJSONTyped(value?: APIKey | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,72 @@
|
|
|
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.instanceOfAPIKey = instanceOfAPIKey;
|
|
17
|
+
exports.APIKeyFromJSON = APIKeyFromJSON;
|
|
18
|
+
exports.APIKeyFromJSONTyped = APIKeyFromJSONTyped;
|
|
19
|
+
exports.APIKeyToJSON = APIKeyToJSON;
|
|
20
|
+
exports.APIKeyToJSONTyped = APIKeyToJSONTyped;
|
|
21
|
+
var VaultLite_1 = require("./VaultLite");
|
|
22
|
+
/**
|
|
23
|
+
* Check if a given object implements the APIKey interface.
|
|
24
|
+
*/
|
|
25
|
+
function instanceOfAPIKey(value) {
|
|
26
|
+
if (!('id' in value) || value['id'] === undefined)
|
|
27
|
+
return false;
|
|
28
|
+
if (!('name' in value) || value['name'] === undefined)
|
|
29
|
+
return false;
|
|
30
|
+
if (!('isActive' in value) || value['isActive'] === undefined)
|
|
31
|
+
return false;
|
|
32
|
+
if (!('createdAt' in value) || value['createdAt'] === undefined)
|
|
33
|
+
return false;
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
function APIKeyFromJSON(json) {
|
|
37
|
+
return APIKeyFromJSONTyped(json, false);
|
|
38
|
+
}
|
|
39
|
+
function APIKeyFromJSONTyped(json, ignoreDiscriminator) {
|
|
40
|
+
if (json == null) {
|
|
41
|
+
return json;
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
'id': json['id'],
|
|
45
|
+
'name': json['name'],
|
|
46
|
+
'vaults': json['vaults'] == null ? undefined : (json['vaults'].map(VaultLite_1.VaultLiteFromJSON)),
|
|
47
|
+
'expiresAt': json['expiresAt'] == null ? undefined : (new Date(json['expiresAt'])),
|
|
48
|
+
'lastUsedAt': json['lastUsedAt'] == null ? undefined : (new Date(json['lastUsedAt'])),
|
|
49
|
+
'isActive': json['isActive'],
|
|
50
|
+
'createdAt': (new Date(json['createdAt'])),
|
|
51
|
+
'updatedAt': json['updatedAt'] == null ? undefined : (new Date(json['updatedAt'])),
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function APIKeyToJSON(json) {
|
|
55
|
+
return APIKeyToJSONTyped(json, false);
|
|
56
|
+
}
|
|
57
|
+
function APIKeyToJSONTyped(value, ignoreDiscriminator) {
|
|
58
|
+
if (ignoreDiscriminator === void 0) { ignoreDiscriminator = false; }
|
|
59
|
+
if (value == null) {
|
|
60
|
+
return value;
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
'id': value['id'],
|
|
64
|
+
'name': value['name'],
|
|
65
|
+
'vaults': value['vaults'] == null ? undefined : (value['vaults'].map(VaultLite_1.VaultLiteToJSON)),
|
|
66
|
+
'expiresAt': value['expiresAt'] == null ? undefined : ((value['expiresAt']).toISOString()),
|
|
67
|
+
'lastUsedAt': value['lastUsedAt'] == null ? undefined : ((value['lastUsedAt']).toISOString()),
|
|
68
|
+
'isActive': value['isActive'],
|
|
69
|
+
'createdAt': ((value['createdAt']).toISOString()),
|
|
70
|
+
'updatedAt': value['updatedAt'] == null ? undefined : ((value['updatedAt']).toISOString()),
|
|
71
|
+
};
|
|
72
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
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 APIKeysResponse
|
|
17
|
+
*/
|
|
18
|
+
export interface APIKeysResponse {
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @type {Array<APIKey>}
|
|
22
|
+
* @memberof APIKeysResponse
|
|
23
|
+
*/
|
|
24
|
+
apiKeys: Array<APIKey>;
|
|
25
|
+
/**
|
|
26
|
+
* Total number of API keys
|
|
27
|
+
* @type {number}
|
|
28
|
+
* @memberof APIKeysResponse
|
|
29
|
+
*/
|
|
30
|
+
totalCount: number;
|
|
31
|
+
/**
|
|
32
|
+
* Number of API keys per page
|
|
33
|
+
* @type {number}
|
|
34
|
+
* @memberof APIKeysResponse
|
|
35
|
+
*/
|
|
36
|
+
pageSize: number;
|
|
37
|
+
/**
|
|
38
|
+
* Current page index (starting from 1)
|
|
39
|
+
* @type {number}
|
|
40
|
+
* @memberof APIKeysResponse
|
|
41
|
+
*/
|
|
42
|
+
pageIndex: number;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Check if a given object implements the APIKeysResponse interface.
|
|
46
|
+
*/
|
|
47
|
+
export declare function instanceOfAPIKeysResponse(value: object): value is APIKeysResponse;
|
|
48
|
+
export declare function APIKeysResponseFromJSON(json: any): APIKeysResponse;
|
|
49
|
+
export declare function APIKeysResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): APIKeysResponse;
|
|
50
|
+
export declare function APIKeysResponseToJSON(json: any): APIKeysResponse;
|
|
51
|
+
export declare function APIKeysResponseToJSONTyped(value?: APIKeysResponse | null, ignoreDiscriminator?: boolean): any;
|