@lwshen/vault-hub-ts-fetch-client 0.20250724.153930 → 0.20250724.162008
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 +3 -0
- package/README.md +2 -2
- package/dist/apis/AuditApi.d.ts +33 -0
- package/dist/apis/AuditApi.js +142 -0
- package/dist/apis/index.d.ts +1 -0
- package/dist/apis/index.js +1 -0
- package/dist/models/AuditLog.d.ts +69 -0
- package/dist/models/AuditLog.js +74 -0
- package/dist/models/AuditLogsResponse.d.ts +51 -0
- package/dist/models/AuditLogsResponse.js +64 -0
- package/dist/models/index.d.ts +2 -0
- package/dist/models/index.js +2 -0
- package/package.json +1 -1
- package/src/apis/AuditApi.ts +98 -0
- package/src/apis/index.ts +1 -0
- package/src/models/AuditLog.ts +115 -0
- package/src/models/AuditLogsResponse.ts +101 -0
- package/src/models/index.ts +2 -0
package/.openapi-generator/FILES
CHANGED
|
@@ -3,12 +3,15 @@
|
|
|
3
3
|
.openapi-generator-ignore
|
|
4
4
|
README.md
|
|
5
5
|
package.json
|
|
6
|
+
src/apis/AuditApi.ts
|
|
6
7
|
src/apis/AuthApi.ts
|
|
7
8
|
src/apis/DefaultApi.ts
|
|
8
9
|
src/apis/UserApi.ts
|
|
9
10
|
src/apis/VaultApi.ts
|
|
10
11
|
src/apis/index.ts
|
|
11
12
|
src/index.ts
|
|
13
|
+
src/models/AuditLog.ts
|
|
14
|
+
src/models/AuditLogsResponse.ts
|
|
12
15
|
src/models/CreateVaultRequest.ts
|
|
13
16
|
src/models/GetUserResponse.ts
|
|
14
17
|
src/models/HealthCheckResponse.ts
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## @lwshen/vault-hub-ts-fetch-client@0.20250724.
|
|
1
|
+
## @lwshen/vault-hub-ts-fetch-client@0.20250724.162008
|
|
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.20250724.
|
|
39
|
+
npm install @lwshen/vault-hub-ts-fetch-client@0.20250724.162008 --save
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
_unPublished (not recommended):_
|
|
@@ -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
|
+
vaultId?: number;
|
|
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, vaultId?: number, 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['start_date'] = requestParameters['startDate'].toISOString();
|
|
96
|
+
}
|
|
97
|
+
if (requestParameters['endDate'] != null) {
|
|
98
|
+
queryParameters['end_date'] = requestParameters['endDate'].toISOString();
|
|
99
|
+
}
|
|
100
|
+
if (requestParameters['vaultId'] != null) {
|
|
101
|
+
queryParameters['vault_id'] = requestParameters['vaultId'];
|
|
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, vaultId, 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, vaultId: vaultId }, 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;
|
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("./AuditApi"), exports);
|
|
19
20
|
__exportStar(require("./AuthApi"), exports);
|
|
20
21
|
__exportStar(require("./DefaultApi"), exports);
|
|
21
22
|
__exportStar(require("./UserApi"), exports);
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vault Hub Server
|
|
3
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @export
|
|
15
|
+
* @interface AuditLog
|
|
16
|
+
*/
|
|
17
|
+
export interface AuditLog {
|
|
18
|
+
/**
|
|
19
|
+
* When the action occurred
|
|
20
|
+
* @type {Date}
|
|
21
|
+
* @memberof AuditLog
|
|
22
|
+
*/
|
|
23
|
+
createdAt: Date;
|
|
24
|
+
/**
|
|
25
|
+
* ID of the vault (null for user actions)
|
|
26
|
+
* @type {number}
|
|
27
|
+
* @memberof AuditLog
|
|
28
|
+
*/
|
|
29
|
+
vaultId?: number | null;
|
|
30
|
+
/**
|
|
31
|
+
* Type of action performed
|
|
32
|
+
* @type {string}
|
|
33
|
+
* @memberof AuditLog
|
|
34
|
+
*/
|
|
35
|
+
action: AuditLogActionEnum;
|
|
36
|
+
/**
|
|
37
|
+
* IP address from which the action was performed
|
|
38
|
+
* @type {string}
|
|
39
|
+
* @memberof AuditLog
|
|
40
|
+
*/
|
|
41
|
+
ipAddress?: string;
|
|
42
|
+
/**
|
|
43
|
+
* User agent string from the client
|
|
44
|
+
* @type {string}
|
|
45
|
+
* @memberof AuditLog
|
|
46
|
+
*/
|
|
47
|
+
userAgent?: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* @export
|
|
51
|
+
*/
|
|
52
|
+
export declare const AuditLogActionEnum: {
|
|
53
|
+
readonly ReadVault: "read_vault";
|
|
54
|
+
readonly UpdateVault: "update_vault";
|
|
55
|
+
readonly DeleteVault: "delete_vault";
|
|
56
|
+
readonly CreateVault: "create_vault";
|
|
57
|
+
readonly LoginUser: "login_user";
|
|
58
|
+
readonly RegisterUser: "register_user";
|
|
59
|
+
readonly LogoutUser: "logout_user";
|
|
60
|
+
};
|
|
61
|
+
export type AuditLogActionEnum = typeof AuditLogActionEnum[keyof typeof AuditLogActionEnum];
|
|
62
|
+
/**
|
|
63
|
+
* Check if a given object implements the AuditLog interface.
|
|
64
|
+
*/
|
|
65
|
+
export declare function instanceOfAuditLog(value: object): value is AuditLog;
|
|
66
|
+
export declare function AuditLogFromJSON(json: any): AuditLog;
|
|
67
|
+
export declare function AuditLogFromJSONTyped(json: any, ignoreDiscriminator: boolean): AuditLog;
|
|
68
|
+
export declare function AuditLogToJSON(json: any): AuditLog;
|
|
69
|
+
export declare function AuditLogToJSONTyped(value?: AuditLog | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,74 @@
|
|
|
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.AuditLogActionEnum = void 0;
|
|
17
|
+
exports.instanceOfAuditLog = instanceOfAuditLog;
|
|
18
|
+
exports.AuditLogFromJSON = AuditLogFromJSON;
|
|
19
|
+
exports.AuditLogFromJSONTyped = AuditLogFromJSONTyped;
|
|
20
|
+
exports.AuditLogToJSON = AuditLogToJSON;
|
|
21
|
+
exports.AuditLogToJSONTyped = AuditLogToJSONTyped;
|
|
22
|
+
/**
|
|
23
|
+
* @export
|
|
24
|
+
*/
|
|
25
|
+
exports.AuditLogActionEnum = {
|
|
26
|
+
ReadVault: 'read_vault',
|
|
27
|
+
UpdateVault: 'update_vault',
|
|
28
|
+
DeleteVault: 'delete_vault',
|
|
29
|
+
CreateVault: 'create_vault',
|
|
30
|
+
LoginUser: 'login_user',
|
|
31
|
+
RegisterUser: 'register_user',
|
|
32
|
+
LogoutUser: 'logout_user'
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Check if a given object implements the AuditLog interface.
|
|
36
|
+
*/
|
|
37
|
+
function instanceOfAuditLog(value) {
|
|
38
|
+
if (!('createdAt' in value) || value['createdAt'] === undefined)
|
|
39
|
+
return false;
|
|
40
|
+
if (!('action' in value) || value['action'] === undefined)
|
|
41
|
+
return false;
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
function AuditLogFromJSON(json) {
|
|
45
|
+
return AuditLogFromJSONTyped(json, false);
|
|
46
|
+
}
|
|
47
|
+
function AuditLogFromJSONTyped(json, ignoreDiscriminator) {
|
|
48
|
+
if (json == null) {
|
|
49
|
+
return json;
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
'createdAt': (new Date(json['created_at'])),
|
|
53
|
+
'vaultId': json['vault_id'] == null ? undefined : json['vault_id'],
|
|
54
|
+
'action': json['action'],
|
|
55
|
+
'ipAddress': json['ip_address'] == null ? undefined : json['ip_address'],
|
|
56
|
+
'userAgent': json['user_agent'] == null ? undefined : json['user_agent'],
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function AuditLogToJSON(json) {
|
|
60
|
+
return AuditLogToJSONTyped(json, false);
|
|
61
|
+
}
|
|
62
|
+
function AuditLogToJSONTyped(value, ignoreDiscriminator) {
|
|
63
|
+
if (ignoreDiscriminator === void 0) { ignoreDiscriminator = false; }
|
|
64
|
+
if (value == null) {
|
|
65
|
+
return value;
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
'created_at': ((value['createdAt']).toISOString()),
|
|
69
|
+
'vault_id': value['vaultId'],
|
|
70
|
+
'action': value['action'],
|
|
71
|
+
'ip_address': value['ipAddress'],
|
|
72
|
+
'user_agent': value['userAgent'],
|
|
73
|
+
};
|
|
74
|
+
}
|
|
@@ -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 { AuditLog } from './AuditLog';
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @export
|
|
16
|
+
* @interface AuditLogsResponse
|
|
17
|
+
*/
|
|
18
|
+
export interface AuditLogsResponse {
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @type {Array<AuditLog>}
|
|
22
|
+
* @memberof AuditLogsResponse
|
|
23
|
+
*/
|
|
24
|
+
auditLogs: Array<AuditLog>;
|
|
25
|
+
/**
|
|
26
|
+
* Total number of logs matching the filter criteria
|
|
27
|
+
* @type {number}
|
|
28
|
+
* @memberof AuditLogsResponse
|
|
29
|
+
*/
|
|
30
|
+
totalCount: number;
|
|
31
|
+
/**
|
|
32
|
+
* Number of logs per page
|
|
33
|
+
* @type {number}
|
|
34
|
+
* @memberof AuditLogsResponse
|
|
35
|
+
*/
|
|
36
|
+
pageSize: number;
|
|
37
|
+
/**
|
|
38
|
+
* Current page index (starting from 0)
|
|
39
|
+
* @type {number}
|
|
40
|
+
* @memberof AuditLogsResponse
|
|
41
|
+
*/
|
|
42
|
+
pageIndex: number;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Check if a given object implements the AuditLogsResponse interface.
|
|
46
|
+
*/
|
|
47
|
+
export declare function instanceOfAuditLogsResponse(value: object): value is AuditLogsResponse;
|
|
48
|
+
export declare function AuditLogsResponseFromJSON(json: any): AuditLogsResponse;
|
|
49
|
+
export declare function AuditLogsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AuditLogsResponse;
|
|
50
|
+
export declare function AuditLogsResponseToJSON(json: any): AuditLogsResponse;
|
|
51
|
+
export declare function AuditLogsResponseToJSONTyped(value?: AuditLogsResponse | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,64 @@
|
|
|
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.instanceOfAuditLogsResponse = instanceOfAuditLogsResponse;
|
|
17
|
+
exports.AuditLogsResponseFromJSON = AuditLogsResponseFromJSON;
|
|
18
|
+
exports.AuditLogsResponseFromJSONTyped = AuditLogsResponseFromJSONTyped;
|
|
19
|
+
exports.AuditLogsResponseToJSON = AuditLogsResponseToJSON;
|
|
20
|
+
exports.AuditLogsResponseToJSONTyped = AuditLogsResponseToJSONTyped;
|
|
21
|
+
var AuditLog_1 = require("./AuditLog");
|
|
22
|
+
/**
|
|
23
|
+
* Check if a given object implements the AuditLogsResponse interface.
|
|
24
|
+
*/
|
|
25
|
+
function instanceOfAuditLogsResponse(value) {
|
|
26
|
+
if (!('auditLogs' in value) || value['auditLogs'] === undefined)
|
|
27
|
+
return false;
|
|
28
|
+
if (!('totalCount' in value) || value['totalCount'] === undefined)
|
|
29
|
+
return false;
|
|
30
|
+
if (!('pageSize' in value) || value['pageSize'] === undefined)
|
|
31
|
+
return false;
|
|
32
|
+
if (!('pageIndex' in value) || value['pageIndex'] === undefined)
|
|
33
|
+
return false;
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
function AuditLogsResponseFromJSON(json) {
|
|
37
|
+
return AuditLogsResponseFromJSONTyped(json, false);
|
|
38
|
+
}
|
|
39
|
+
function AuditLogsResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
40
|
+
if (json == null) {
|
|
41
|
+
return json;
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
'auditLogs': (json['audit_logs'].map(AuditLog_1.AuditLogFromJSON)),
|
|
45
|
+
'totalCount': json['total_count'],
|
|
46
|
+
'pageSize': json['pageSize'],
|
|
47
|
+
'pageIndex': json['pageIndex'],
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function AuditLogsResponseToJSON(json) {
|
|
51
|
+
return AuditLogsResponseToJSONTyped(json, false);
|
|
52
|
+
}
|
|
53
|
+
function AuditLogsResponseToJSONTyped(value, ignoreDiscriminator) {
|
|
54
|
+
if (ignoreDiscriminator === void 0) { ignoreDiscriminator = false; }
|
|
55
|
+
if (value == null) {
|
|
56
|
+
return value;
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
'audit_logs': (value['auditLogs'].map(AuditLog_1.AuditLogToJSON)),
|
|
60
|
+
'total_count': value['totalCount'],
|
|
61
|
+
'pageSize': value['pageSize'],
|
|
62
|
+
'pageIndex': value['pageIndex'],
|
|
63
|
+
};
|
|
64
|
+
}
|
package/dist/models/index.d.ts
CHANGED
package/dist/models/index.js
CHANGED
|
@@ -16,6 +16,8 @@ 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("./AuditLog"), exports);
|
|
20
|
+
__exportStar(require("./AuditLogsResponse"), exports);
|
|
19
21
|
__exportStar(require("./CreateVaultRequest"), exports);
|
|
20
22
|
__exportStar(require("./GetUserResponse"), exports);
|
|
21
23
|
__exportStar(require("./HealthCheckResponse"), exports);
|
package/package.json
CHANGED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Vault Hub Server
|
|
5
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
import * as runtime from '../runtime';
|
|
17
|
+
import type {
|
|
18
|
+
AuditLogsResponse,
|
|
19
|
+
} from '../models/index';
|
|
20
|
+
import {
|
|
21
|
+
AuditLogsResponseFromJSON,
|
|
22
|
+
AuditLogsResponseToJSON,
|
|
23
|
+
} from '../models/index';
|
|
24
|
+
|
|
25
|
+
export interface GetAuditLogsRequest {
|
|
26
|
+
pageSize: number;
|
|
27
|
+
pageIndex: number;
|
|
28
|
+
startDate?: Date;
|
|
29
|
+
endDate?: Date;
|
|
30
|
+
vaultId?: number;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
*/
|
|
36
|
+
export class AuditApi extends runtime.BaseAPI {
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Get audit logs with optional filtering and pagination
|
|
40
|
+
*/
|
|
41
|
+
async getAuditLogsRaw(requestParameters: GetAuditLogsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AuditLogsResponse>> {
|
|
42
|
+
if (requestParameters['pageSize'] == null) {
|
|
43
|
+
throw new runtime.RequiredError(
|
|
44
|
+
'pageSize',
|
|
45
|
+
'Required parameter "pageSize" was null or undefined when calling getAuditLogs().'
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (requestParameters['pageIndex'] == null) {
|
|
50
|
+
throw new runtime.RequiredError(
|
|
51
|
+
'pageIndex',
|
|
52
|
+
'Required parameter "pageIndex" was null or undefined when calling getAuditLogs().'
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const queryParameters: any = {};
|
|
57
|
+
|
|
58
|
+
if (requestParameters['startDate'] != null) {
|
|
59
|
+
queryParameters['start_date'] = (requestParameters['startDate'] as any).toISOString();
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (requestParameters['endDate'] != null) {
|
|
63
|
+
queryParameters['end_date'] = (requestParameters['endDate'] as any).toISOString();
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (requestParameters['vaultId'] != null) {
|
|
67
|
+
queryParameters['vault_id'] = requestParameters['vaultId'];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (requestParameters['pageSize'] != null) {
|
|
71
|
+
queryParameters['pageSize'] = requestParameters['pageSize'];
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (requestParameters['pageIndex'] != null) {
|
|
75
|
+
queryParameters['pageIndex'] = requestParameters['pageIndex'];
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
79
|
+
|
|
80
|
+
const response = await this.request({
|
|
81
|
+
path: `/api/audit-logs`,
|
|
82
|
+
method: 'GET',
|
|
83
|
+
headers: headerParameters,
|
|
84
|
+
query: queryParameters,
|
|
85
|
+
}, initOverrides);
|
|
86
|
+
|
|
87
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => AuditLogsResponseFromJSON(jsonValue));
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Get audit logs with optional filtering and pagination
|
|
92
|
+
*/
|
|
93
|
+
async getAuditLogs(pageSize: number, pageIndex: number, startDate?: Date, endDate?: Date, vaultId?: number, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AuditLogsResponse> {
|
|
94
|
+
const response = await this.getAuditLogsRaw({ pageSize: pageSize, pageIndex: pageIndex, startDate: startDate, endDate: endDate, vaultId: vaultId }, initOverrides);
|
|
95
|
+
return await response.value();
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
}
|
package/src/apis/index.ts
CHANGED
|
@@ -0,0 +1,115 @@
|
|
|
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 AuditLog
|
|
20
|
+
*/
|
|
21
|
+
export interface AuditLog {
|
|
22
|
+
/**
|
|
23
|
+
* When the action occurred
|
|
24
|
+
* @type {Date}
|
|
25
|
+
* @memberof AuditLog
|
|
26
|
+
*/
|
|
27
|
+
createdAt: Date;
|
|
28
|
+
/**
|
|
29
|
+
* ID of the vault (null for user actions)
|
|
30
|
+
* @type {number}
|
|
31
|
+
* @memberof AuditLog
|
|
32
|
+
*/
|
|
33
|
+
vaultId?: number | null;
|
|
34
|
+
/**
|
|
35
|
+
* Type of action performed
|
|
36
|
+
* @type {string}
|
|
37
|
+
* @memberof AuditLog
|
|
38
|
+
*/
|
|
39
|
+
action: AuditLogActionEnum;
|
|
40
|
+
/**
|
|
41
|
+
* IP address from which the action was performed
|
|
42
|
+
* @type {string}
|
|
43
|
+
* @memberof AuditLog
|
|
44
|
+
*/
|
|
45
|
+
ipAddress?: string;
|
|
46
|
+
/**
|
|
47
|
+
* User agent string from the client
|
|
48
|
+
* @type {string}
|
|
49
|
+
* @memberof AuditLog
|
|
50
|
+
*/
|
|
51
|
+
userAgent?: string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* @export
|
|
57
|
+
*/
|
|
58
|
+
export const AuditLogActionEnum = {
|
|
59
|
+
ReadVault: 'read_vault',
|
|
60
|
+
UpdateVault: 'update_vault',
|
|
61
|
+
DeleteVault: 'delete_vault',
|
|
62
|
+
CreateVault: 'create_vault',
|
|
63
|
+
LoginUser: 'login_user',
|
|
64
|
+
RegisterUser: 'register_user',
|
|
65
|
+
LogoutUser: 'logout_user'
|
|
66
|
+
} as const;
|
|
67
|
+
export type AuditLogActionEnum = typeof AuditLogActionEnum[keyof typeof AuditLogActionEnum];
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Check if a given object implements the AuditLog interface.
|
|
72
|
+
*/
|
|
73
|
+
export function instanceOfAuditLog(value: object): value is AuditLog {
|
|
74
|
+
if (!('createdAt' in value) || value['createdAt'] === undefined) return false;
|
|
75
|
+
if (!('action' in value) || value['action'] === undefined) return false;
|
|
76
|
+
return true;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function AuditLogFromJSON(json: any): AuditLog {
|
|
80
|
+
return AuditLogFromJSONTyped(json, false);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export function AuditLogFromJSONTyped(json: any, ignoreDiscriminator: boolean): AuditLog {
|
|
84
|
+
if (json == null) {
|
|
85
|
+
return json;
|
|
86
|
+
}
|
|
87
|
+
return {
|
|
88
|
+
|
|
89
|
+
'createdAt': (new Date(json['created_at'])),
|
|
90
|
+
'vaultId': json['vault_id'] == null ? undefined : json['vault_id'],
|
|
91
|
+
'action': json['action'],
|
|
92
|
+
'ipAddress': json['ip_address'] == null ? undefined : json['ip_address'],
|
|
93
|
+
'userAgent': json['user_agent'] == null ? undefined : json['user_agent'],
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export function AuditLogToJSON(json: any): AuditLog {
|
|
98
|
+
return AuditLogToJSONTyped(json, false);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export function AuditLogToJSONTyped(value?: AuditLog | null, ignoreDiscriminator: boolean = false): any {
|
|
102
|
+
if (value == null) {
|
|
103
|
+
return value;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return {
|
|
107
|
+
|
|
108
|
+
'created_at': ((value['createdAt']).toISOString()),
|
|
109
|
+
'vault_id': value['vaultId'],
|
|
110
|
+
'action': value['action'],
|
|
111
|
+
'ip_address': value['ipAddress'],
|
|
112
|
+
'user_agent': value['userAgent'],
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
|
|
@@ -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 { AuditLog } from './AuditLog';
|
|
17
|
+
import {
|
|
18
|
+
AuditLogFromJSON,
|
|
19
|
+
AuditLogFromJSONTyped,
|
|
20
|
+
AuditLogToJSON,
|
|
21
|
+
AuditLogToJSONTyped,
|
|
22
|
+
} from './AuditLog';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @export
|
|
27
|
+
* @interface AuditLogsResponse
|
|
28
|
+
*/
|
|
29
|
+
export interface AuditLogsResponse {
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @type {Array<AuditLog>}
|
|
33
|
+
* @memberof AuditLogsResponse
|
|
34
|
+
*/
|
|
35
|
+
auditLogs: Array<AuditLog>;
|
|
36
|
+
/**
|
|
37
|
+
* Total number of logs matching the filter criteria
|
|
38
|
+
* @type {number}
|
|
39
|
+
* @memberof AuditLogsResponse
|
|
40
|
+
*/
|
|
41
|
+
totalCount: number;
|
|
42
|
+
/**
|
|
43
|
+
* Number of logs per page
|
|
44
|
+
* @type {number}
|
|
45
|
+
* @memberof AuditLogsResponse
|
|
46
|
+
*/
|
|
47
|
+
pageSize: number;
|
|
48
|
+
/**
|
|
49
|
+
* Current page index (starting from 0)
|
|
50
|
+
* @type {number}
|
|
51
|
+
* @memberof AuditLogsResponse
|
|
52
|
+
*/
|
|
53
|
+
pageIndex: number;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Check if a given object implements the AuditLogsResponse interface.
|
|
58
|
+
*/
|
|
59
|
+
export function instanceOfAuditLogsResponse(value: object): value is AuditLogsResponse {
|
|
60
|
+
if (!('auditLogs' in value) || value['auditLogs'] === 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 AuditLogsResponseFromJSON(json: any): AuditLogsResponse {
|
|
68
|
+
return AuditLogsResponseFromJSONTyped(json, false);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function AuditLogsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AuditLogsResponse {
|
|
72
|
+
if (json == null) {
|
|
73
|
+
return json;
|
|
74
|
+
}
|
|
75
|
+
return {
|
|
76
|
+
|
|
77
|
+
'auditLogs': ((json['audit_logs'] as Array<any>).map(AuditLogFromJSON)),
|
|
78
|
+
'totalCount': json['total_count'],
|
|
79
|
+
'pageSize': json['pageSize'],
|
|
80
|
+
'pageIndex': json['pageIndex'],
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export function AuditLogsResponseToJSON(json: any): AuditLogsResponse {
|
|
85
|
+
return AuditLogsResponseToJSONTyped(json, false);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export function AuditLogsResponseToJSONTyped(value?: AuditLogsResponse | null, ignoreDiscriminator: boolean = false): any {
|
|
89
|
+
if (value == null) {
|
|
90
|
+
return value;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return {
|
|
94
|
+
|
|
95
|
+
'audit_logs': ((value['auditLogs'] as Array<any>).map(AuditLogToJSON)),
|
|
96
|
+
'total_count': value['totalCount'],
|
|
97
|
+
'pageSize': value['pageSize'],
|
|
98
|
+
'pageIndex': value['pageIndex'],
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
|