@lwshen/vault-hub-ts-fetch-client 0.0.1-beta.2
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 +35 -0
- package/.openapi-generator/VERSION +1 -0
- package/.openapi-generator-ignore +23 -0
- package/README.md +46 -0
- package/dist/apis/APIKeyApi.d.ts +64 -0
- package/dist/apis/APIKeyApi.js +270 -0
- package/dist/apis/AuditApi.d.ts +33 -0
- package/dist/apis/AuditApi.js +142 -0
- package/dist/apis/AuthApi.d.ts +48 -0
- package/dist/apis/AuthApi.js +211 -0
- package/dist/apis/CliApi.d.ts +48 -0
- package/dist/apis/CliApi.js +209 -0
- package/dist/apis/DefaultApi.d.ts +26 -0
- package/dist/apis/DefaultApi.js +121 -0
- package/dist/apis/UserApi.d.ts +26 -0
- package/dist/apis/UserApi.js +121 -0
- package/dist/apis/VaultApi.d.ts +71 -0
- package/dist/apis/VaultApi.js +302 -0
- package/dist/apis/index.d.ts +7 -0
- package/dist/apis/index.js +25 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +21 -0
- package/dist/models/APIKeysResponse.d.ts +51 -0
- package/dist/models/APIKeysResponse.js +64 -0
- package/dist/models/AuditLog.d.ts +80 -0
- package/dist/models/AuditLog.js +81 -0
- package/dist/models/AuditLogsResponse.d.ts +51 -0
- package/dist/models/AuditLogsResponse.js +64 -0
- 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/CreateVaultRequest.d.ts +50 -0
- package/dist/models/CreateVaultRequest.js +59 -0
- package/dist/models/EnableClientEncryption.d.ts +25 -0
- package/dist/models/EnableClientEncryption.js +51 -0
- package/dist/models/GetUserResponse.d.ts +44 -0
- package/dist/models/GetUserResponse.js +55 -0
- package/dist/models/HealthCheckResponse.d.ts +38 -0
- package/dist/models/HealthCheckResponse.js +51 -0
- package/dist/models/LoginRequest.d.ts +38 -0
- package/dist/models/LoginRequest.js +55 -0
- package/dist/models/LoginResponse.d.ts +32 -0
- package/dist/models/LoginResponse.js +51 -0
- package/dist/models/SignupRequest.d.ts +44 -0
- package/dist/models/SignupRequest.js +59 -0
- package/dist/models/SignupResponse.d.ts +32 -0
- package/dist/models/SignupResponse.js +51 -0
- package/dist/models/UpdateAPIKeyRequest.d.ts +50 -0
- package/dist/models/UpdateAPIKeyRequest.js +55 -0
- package/dist/models/UpdateVaultRequest.d.ts +50 -0
- package/dist/models/UpdateVaultRequest.js +55 -0
- package/dist/models/Vault.d.ts +74 -0
- package/dist/models/Vault.js +69 -0
- package/dist/models/VaultAPIKey.d.ts +75 -0
- package/dist/models/VaultAPIKey.js +72 -0
- package/dist/models/VaultLite.d.ts +56 -0
- package/dist/models/VaultLite.js +61 -0
- package/dist/models/index.d.ts +18 -0
- package/dist/models/index.js +36 -0
- package/dist/runtime.d.ts +184 -0
- package/dist/runtime.js +564 -0
- package/package.json +19 -0
- package/src/apis/APIKeyApi.ts +219 -0
- package/src/apis/AuditApi.ts +98 -0
- package/src/apis/AuthApi.ts +144 -0
- package/src/apis/CliApi.ts +133 -0
- package/src/apis/DefaultApi.ts +56 -0
- package/src/apis/UserApi.ts +56 -0
- package/src/apis/VaultApi.ts +226 -0
- package/src/apis/index.ts +9 -0
- package/src/index.ts +5 -0
- package/src/models/APIKeysResponse.ts +101 -0
- package/src/models/AuditLog.ts +141 -0
- package/src/models/AuditLogsResponse.ts +101 -0
- package/src/models/CreateAPIKeyRequest.ts +82 -0
- package/src/models/CreateAPIKeyResponse.ts +83 -0
- package/src/models/CreateVaultRequest.ts +91 -0
- package/src/models/EnableClientEncryption.ts +53 -0
- package/src/models/GetUserResponse.ts +82 -0
- package/src/models/HealthCheckResponse.ts +73 -0
- package/src/models/LoginRequest.ts +75 -0
- package/src/models/LoginResponse.ts +66 -0
- package/src/models/SignupRequest.ts +84 -0
- package/src/models/SignupResponse.ts +66 -0
- package/src/models/UpdateAPIKeyRequest.ts +89 -0
- package/src/models/UpdateVaultRequest.ts +89 -0
- package/src/models/Vault.ts +124 -0
- package/src/models/VaultAPIKey.ts +133 -0
- package/src/models/VaultLite.ts +99 -0
- package/src/models/index.ts +20 -0
- package/src/runtime.ts +432 -0
- package/tsconfig.json +20 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
.gitignore
|
|
2
|
+
.npmignore
|
|
3
|
+
.openapi-generator-ignore
|
|
4
|
+
README.md
|
|
5
|
+
package.json
|
|
6
|
+
src/apis/APIKeyApi.ts
|
|
7
|
+
src/apis/AuditApi.ts
|
|
8
|
+
src/apis/AuthApi.ts
|
|
9
|
+
src/apis/CliApi.ts
|
|
10
|
+
src/apis/DefaultApi.ts
|
|
11
|
+
src/apis/UserApi.ts
|
|
12
|
+
src/apis/VaultApi.ts
|
|
13
|
+
src/apis/index.ts
|
|
14
|
+
src/index.ts
|
|
15
|
+
src/models/APIKeysResponse.ts
|
|
16
|
+
src/models/AuditLog.ts
|
|
17
|
+
src/models/AuditLogsResponse.ts
|
|
18
|
+
src/models/CreateAPIKeyRequest.ts
|
|
19
|
+
src/models/CreateAPIKeyResponse.ts
|
|
20
|
+
src/models/CreateVaultRequest.ts
|
|
21
|
+
src/models/EnableClientEncryption.ts
|
|
22
|
+
src/models/GetUserResponse.ts
|
|
23
|
+
src/models/HealthCheckResponse.ts
|
|
24
|
+
src/models/LoginRequest.ts
|
|
25
|
+
src/models/LoginResponse.ts
|
|
26
|
+
src/models/SignupRequest.ts
|
|
27
|
+
src/models/SignupResponse.ts
|
|
28
|
+
src/models/UpdateAPIKeyRequest.ts
|
|
29
|
+
src/models/UpdateVaultRequest.ts
|
|
30
|
+
src/models/Vault.ts
|
|
31
|
+
src/models/VaultAPIKey.ts
|
|
32
|
+
src/models/VaultLite.ts
|
|
33
|
+
src/models/index.ts
|
|
34
|
+
src/runtime.ts
|
|
35
|
+
tsconfig.json
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
7.13.0
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# OpenAPI Generator Ignore
|
|
2
|
+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
|
|
3
|
+
|
|
4
|
+
# Use this file to prevent files from being overwritten by the generator.
|
|
5
|
+
# The patterns follow closely to .gitignore or .dockerignore.
|
|
6
|
+
|
|
7
|
+
# As an example, the C# client generator defines ApiClient.cs.
|
|
8
|
+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
|
|
9
|
+
#ApiClient.cs
|
|
10
|
+
|
|
11
|
+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
|
12
|
+
#foo/*/qux
|
|
13
|
+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
|
|
14
|
+
|
|
15
|
+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
|
16
|
+
#foo/**/qux
|
|
17
|
+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
|
18
|
+
|
|
19
|
+
# You can also negate patterns with an exclamation (!).
|
|
20
|
+
# For example, you can ignore all files in a docs folder with the file extension .md:
|
|
21
|
+
#docs/*.md
|
|
22
|
+
# Then explicitly reverse the ignore rule for a single file:
|
|
23
|
+
#!docs/README.md
|
package/README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
## @lwshen/vault-hub-ts-fetch-client@v0.0.1-beta.2
|
|
2
|
+
|
|
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
|
+
|
|
5
|
+
Environment
|
|
6
|
+
* Node.js
|
|
7
|
+
* Webpack
|
|
8
|
+
* Browserify
|
|
9
|
+
|
|
10
|
+
Language level
|
|
11
|
+
* ES5 - you must have a Promises/A+ library installed
|
|
12
|
+
* ES6
|
|
13
|
+
|
|
14
|
+
Module system
|
|
15
|
+
* CommonJS
|
|
16
|
+
* ES6 module system
|
|
17
|
+
|
|
18
|
+
It can be used in both TypeScript and JavaScript. In TypeScript, the definition will be automatically resolved via `package.json`. ([Reference](https://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html))
|
|
19
|
+
|
|
20
|
+
### Building
|
|
21
|
+
|
|
22
|
+
To build and compile the typescript sources to javascript use:
|
|
23
|
+
```
|
|
24
|
+
npm install
|
|
25
|
+
npm run build
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Publishing
|
|
29
|
+
|
|
30
|
+
First build the package then run `npm publish`
|
|
31
|
+
|
|
32
|
+
### Consuming
|
|
33
|
+
|
|
34
|
+
navigate to the folder of your consuming project and run one of the following commands.
|
|
35
|
+
|
|
36
|
+
_published:_
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
npm install @lwshen/vault-hub-ts-fetch-client@v0.0.1-beta.2 --save
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
_unPublished (not recommended):_
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
npm install PATH_TO_GENERATED_PACKAGE --save
|
|
46
|
+
```
|
|
@@ -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 { APIKeysResponse, CreateAPIKeyRequest, CreateAPIKeyResponse, UpdateAPIKeyRequest, VaultAPIKey } 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<VaultAPIKey>>;
|
|
60
|
+
/**
|
|
61
|
+
* Update an API key (enable/disable or modify properties)
|
|
62
|
+
*/
|
|
63
|
+
updateAPIKey(id: number, updateAPIKeyRequest: UpdateAPIKeyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<VaultAPIKey>;
|
|
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.VaultAPIKeyFromJSON)(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;
|
|
@@ -0,0 +1,33 @@
|
|
|
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 { AuditLogsResponse } from '../models/index';
|
|
14
|
+
export interface GetAuditLogsRequest {
|
|
15
|
+
pageSize: number;
|
|
16
|
+
pageIndex: number;
|
|
17
|
+
startDate?: Date;
|
|
18
|
+
endDate?: Date;
|
|
19
|
+
vaultUniqueId?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
*
|
|
23
|
+
*/
|
|
24
|
+
export declare class AuditApi extends runtime.BaseAPI {
|
|
25
|
+
/**
|
|
26
|
+
* Get audit logs with optional filtering and pagination
|
|
27
|
+
*/
|
|
28
|
+
getAuditLogsRaw(requestParameters: GetAuditLogsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AuditLogsResponse>>;
|
|
29
|
+
/**
|
|
30
|
+
* Get audit logs with optional filtering and pagination
|
|
31
|
+
*/
|
|
32
|
+
getAuditLogs(pageSize: number, pageIndex: number, startDate?: Date, endDate?: Date, vaultUniqueId?: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AuditLogsResponse>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
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.AuditApi = void 0;
|
|
68
|
+
var runtime = require("../runtime");
|
|
69
|
+
var index_1 = require("../models/index");
|
|
70
|
+
/**
|
|
71
|
+
*
|
|
72
|
+
*/
|
|
73
|
+
var AuditApi = /** @class */ (function (_super) {
|
|
74
|
+
__extends(AuditApi, _super);
|
|
75
|
+
function AuditApi() {
|
|
76
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Get audit logs with optional filtering and pagination
|
|
80
|
+
*/
|
|
81
|
+
AuditApi.prototype.getAuditLogsRaw = 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['pageSize'] == null) {
|
|
88
|
+
throw new runtime.RequiredError('pageSize', 'Required parameter "pageSize" was null or undefined when calling getAuditLogs().');
|
|
89
|
+
}
|
|
90
|
+
if (requestParameters['pageIndex'] == null) {
|
|
91
|
+
throw new runtime.RequiredError('pageIndex', 'Required parameter "pageIndex" was null or undefined when calling getAuditLogs().');
|
|
92
|
+
}
|
|
93
|
+
queryParameters = {};
|
|
94
|
+
if (requestParameters['startDate'] != null) {
|
|
95
|
+
queryParameters['startDate'] = requestParameters['startDate'].toISOString();
|
|
96
|
+
}
|
|
97
|
+
if (requestParameters['endDate'] != null) {
|
|
98
|
+
queryParameters['endDate'] = requestParameters['endDate'].toISOString();
|
|
99
|
+
}
|
|
100
|
+
if (requestParameters['vaultUniqueId'] != null) {
|
|
101
|
+
queryParameters['vaultUniqueId'] = requestParameters['vaultUniqueId'];
|
|
102
|
+
}
|
|
103
|
+
if (requestParameters['pageSize'] != null) {
|
|
104
|
+
queryParameters['pageSize'] = requestParameters['pageSize'];
|
|
105
|
+
}
|
|
106
|
+
if (requestParameters['pageIndex'] != null) {
|
|
107
|
+
queryParameters['pageIndex'] = requestParameters['pageIndex'];
|
|
108
|
+
}
|
|
109
|
+
headerParameters = {};
|
|
110
|
+
return [4 /*yield*/, this.request({
|
|
111
|
+
path: "/api/audit-logs",
|
|
112
|
+
method: 'GET',
|
|
113
|
+
headers: headerParameters,
|
|
114
|
+
query: queryParameters,
|
|
115
|
+
}, initOverrides)];
|
|
116
|
+
case 1:
|
|
117
|
+
response = _a.sent();
|
|
118
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.AuditLogsResponseFromJSON)(jsonValue); })];
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* Get audit logs with optional filtering and pagination
|
|
125
|
+
*/
|
|
126
|
+
AuditApi.prototype.getAuditLogs = function (pageSize, pageIndex, startDate, endDate, vaultUniqueId, initOverrides) {
|
|
127
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
128
|
+
var response;
|
|
129
|
+
return __generator(this, function (_a) {
|
|
130
|
+
switch (_a.label) {
|
|
131
|
+
case 0: return [4 /*yield*/, this.getAuditLogsRaw({ pageSize: pageSize, pageIndex: pageIndex, startDate: startDate, endDate: endDate, vaultUniqueId: vaultUniqueId }, initOverrides)];
|
|
132
|
+
case 1:
|
|
133
|
+
response = _a.sent();
|
|
134
|
+
return [4 /*yield*/, response.value()];
|
|
135
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
};
|
|
140
|
+
return AuditApi;
|
|
141
|
+
}(runtime.BaseAPI));
|
|
142
|
+
exports.AuditApi = AuditApi;
|
|
@@ -0,0 +1,48 @@
|
|
|
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 { LoginRequest, LoginResponse, SignupRequest, SignupResponse } from '../models/index';
|
|
14
|
+
export interface LoginOperationRequest {
|
|
15
|
+
loginRequest: LoginRequest;
|
|
16
|
+
}
|
|
17
|
+
export interface SignupOperationRequest {
|
|
18
|
+
signupRequest: SignupRequest;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
export declare class AuthApi extends runtime.BaseAPI {
|
|
24
|
+
/**
|
|
25
|
+
* Login with email and password
|
|
26
|
+
*/
|
|
27
|
+
loginRaw(requestParameters: LoginOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<LoginResponse>>;
|
|
28
|
+
/**
|
|
29
|
+
* Login with email and password
|
|
30
|
+
*/
|
|
31
|
+
login(loginRequest: LoginRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<LoginResponse>;
|
|
32
|
+
/**
|
|
33
|
+
* Logout
|
|
34
|
+
*/
|
|
35
|
+
logoutRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
36
|
+
/**
|
|
37
|
+
* Logout
|
|
38
|
+
*/
|
|
39
|
+
logout(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
40
|
+
/**
|
|
41
|
+
* Sign up a new user
|
|
42
|
+
*/
|
|
43
|
+
signupRaw(requestParameters: SignupOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SignupResponse>>;
|
|
44
|
+
/**
|
|
45
|
+
* Sign up a new user
|
|
46
|
+
*/
|
|
47
|
+
signup(signupRequest: SignupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SignupResponse>;
|
|
48
|
+
}
|