@lwshen/vault-hub-ts-fetch-client 0.20250620.144136

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.
Files changed (39) hide show
  1. package/.openapi-generator/FILES +17 -0
  2. package/.openapi-generator/VERSION +1 -0
  3. package/.openapi-generator-ignore +23 -0
  4. package/README.md +46 -0
  5. package/dist/apis/AuthApi.d.ts +48 -0
  6. package/dist/apis/AuthApi.js +211 -0
  7. package/dist/apis/DefaultApi.d.ts +26 -0
  8. package/dist/apis/DefaultApi.js +121 -0
  9. package/dist/apis/index.d.ts +2 -0
  10. package/dist/apis/index.js +20 -0
  11. package/dist/index.d.ts +3 -0
  12. package/dist/index.js +21 -0
  13. package/dist/models/HealthCheckResponse.d.ts +38 -0
  14. package/dist/models/HealthCheckResponse.js +51 -0
  15. package/dist/models/LoginRequest.d.ts +38 -0
  16. package/dist/models/LoginRequest.js +55 -0
  17. package/dist/models/LoginResponse.d.ts +32 -0
  18. package/dist/models/LoginResponse.js +51 -0
  19. package/dist/models/SignupRequest.d.ts +44 -0
  20. package/dist/models/SignupRequest.js +59 -0
  21. package/dist/models/SignupResponse.d.ts +32 -0
  22. package/dist/models/SignupResponse.js +51 -0
  23. package/dist/models/index.d.ts +5 -0
  24. package/dist/models/index.js +23 -0
  25. package/dist/runtime.d.ts +184 -0
  26. package/dist/runtime.js +564 -0
  27. package/package.json +19 -0
  28. package/src/apis/AuthApi.ts +144 -0
  29. package/src/apis/DefaultApi.ts +56 -0
  30. package/src/apis/index.ts +4 -0
  31. package/src/index.ts +5 -0
  32. package/src/models/HealthCheckResponse.ts +73 -0
  33. package/src/models/LoginRequest.ts +75 -0
  34. package/src/models/LoginResponse.ts +66 -0
  35. package/src/models/SignupRequest.ts +84 -0
  36. package/src/models/SignupResponse.ts +66 -0
  37. package/src/models/index.ts +7 -0
  38. package/src/runtime.ts +432 -0
  39. package/tsconfig.json +20 -0
@@ -0,0 +1,144 @@
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
+ LoginRequest,
19
+ LoginResponse,
20
+ SignupRequest,
21
+ SignupResponse,
22
+ } from '../models/index';
23
+ import {
24
+ LoginRequestFromJSON,
25
+ LoginRequestToJSON,
26
+ LoginResponseFromJSON,
27
+ LoginResponseToJSON,
28
+ SignupRequestFromJSON,
29
+ SignupRequestToJSON,
30
+ SignupResponseFromJSON,
31
+ SignupResponseToJSON,
32
+ } from '../models/index';
33
+
34
+ export interface LoginOperationRequest {
35
+ loginRequest: LoginRequest;
36
+ }
37
+
38
+ export interface SignupOperationRequest {
39
+ signupRequest: SignupRequest;
40
+ }
41
+
42
+ /**
43
+ *
44
+ */
45
+ export class AuthApi extends runtime.BaseAPI {
46
+
47
+ /**
48
+ * Login with email and password
49
+ */
50
+ async loginRaw(requestParameters: LoginOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<LoginResponse>> {
51
+ if (requestParameters['loginRequest'] == null) {
52
+ throw new runtime.RequiredError(
53
+ 'loginRequest',
54
+ 'Required parameter "loginRequest" was null or undefined when calling login().'
55
+ );
56
+ }
57
+
58
+ const queryParameters: any = {};
59
+
60
+ const headerParameters: runtime.HTTPHeaders = {};
61
+
62
+ headerParameters['Content-Type'] = 'application/json';
63
+
64
+ const response = await this.request({
65
+ path: `/api/auth/login`,
66
+ method: 'POST',
67
+ headers: headerParameters,
68
+ query: queryParameters,
69
+ body: LoginRequestToJSON(requestParameters['loginRequest']),
70
+ }, initOverrides);
71
+
72
+ return new runtime.JSONApiResponse(response, (jsonValue) => LoginResponseFromJSON(jsonValue));
73
+ }
74
+
75
+ /**
76
+ * Login with email and password
77
+ */
78
+ async login(requestParameters: LoginOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<LoginResponse> {
79
+ const response = await this.loginRaw(requestParameters, initOverrides);
80
+ return await response.value();
81
+ }
82
+
83
+ /**
84
+ * Logout
85
+ */
86
+ async logoutRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
87
+ const queryParameters: any = {};
88
+
89
+ const headerParameters: runtime.HTTPHeaders = {};
90
+
91
+ const response = await this.request({
92
+ path: `/api/auth/logout`,
93
+ method: 'GET',
94
+ headers: headerParameters,
95
+ query: queryParameters,
96
+ }, initOverrides);
97
+
98
+ return new runtime.VoidApiResponse(response);
99
+ }
100
+
101
+ /**
102
+ * Logout
103
+ */
104
+ async logout(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
105
+ await this.logoutRaw(initOverrides);
106
+ }
107
+
108
+ /**
109
+ * Sign up a new user
110
+ */
111
+ async signupRaw(requestParameters: SignupOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SignupResponse>> {
112
+ if (requestParameters['signupRequest'] == null) {
113
+ throw new runtime.RequiredError(
114
+ 'signupRequest',
115
+ 'Required parameter "signupRequest" was null or undefined when calling signup().'
116
+ );
117
+ }
118
+
119
+ const queryParameters: any = {};
120
+
121
+ const headerParameters: runtime.HTTPHeaders = {};
122
+
123
+ headerParameters['Content-Type'] = 'application/json';
124
+
125
+ const response = await this.request({
126
+ path: `/api/auth/signup`,
127
+ method: 'POST',
128
+ headers: headerParameters,
129
+ query: queryParameters,
130
+ body: SignupRequestToJSON(requestParameters['signupRequest']),
131
+ }, initOverrides);
132
+
133
+ return new runtime.JSONApiResponse(response, (jsonValue) => SignupResponseFromJSON(jsonValue));
134
+ }
135
+
136
+ /**
137
+ * Sign up a new user
138
+ */
139
+ async signup(requestParameters: SignupOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SignupResponse> {
140
+ const response = await this.signupRaw(requestParameters, initOverrides);
141
+ return await response.value();
142
+ }
143
+
144
+ }
@@ -0,0 +1,56 @@
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
+ HealthCheckResponse,
19
+ } from '../models/index';
20
+ import {
21
+ HealthCheckResponseFromJSON,
22
+ HealthCheckResponseToJSON,
23
+ } from '../models/index';
24
+
25
+ /**
26
+ *
27
+ */
28
+ export class DefaultApi extends runtime.BaseAPI {
29
+
30
+ /**
31
+ * Check the health status of backend
32
+ */
33
+ async healthRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<HealthCheckResponse>> {
34
+ const queryParameters: any = {};
35
+
36
+ const headerParameters: runtime.HTTPHeaders = {};
37
+
38
+ const response = await this.request({
39
+ path: `/api/health`,
40
+ method: 'GET',
41
+ headers: headerParameters,
42
+ query: queryParameters,
43
+ }, initOverrides);
44
+
45
+ return new runtime.JSONApiResponse(response, (jsonValue) => HealthCheckResponseFromJSON(jsonValue));
46
+ }
47
+
48
+ /**
49
+ * Check the health status of backend
50
+ */
51
+ async health(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<HealthCheckResponse> {
52
+ const response = await this.healthRaw(initOverrides);
53
+ return await response.value();
54
+ }
55
+
56
+ }
@@ -0,0 +1,4 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ export * from './AuthApi';
4
+ export * from './DefaultApi';
package/src/index.ts ADDED
@@ -0,0 +1,5 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ export * from './runtime';
4
+ export * from './apis/index';
5
+ export * from './models/index';
@@ -0,0 +1,73 @@
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 HealthCheckResponse
20
+ */
21
+ export interface HealthCheckResponse {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof HealthCheckResponse
26
+ */
27
+ status?: string;
28
+ /**
29
+ *
30
+ * @type {Date}
31
+ * @memberof HealthCheckResponse
32
+ */
33
+ timestamp?: Date;
34
+ }
35
+
36
+ /**
37
+ * Check if a given object implements the HealthCheckResponse interface.
38
+ */
39
+ export function instanceOfHealthCheckResponse(value: object): value is HealthCheckResponse {
40
+ return true;
41
+ }
42
+
43
+ export function HealthCheckResponseFromJSON(json: any): HealthCheckResponse {
44
+ return HealthCheckResponseFromJSONTyped(json, false);
45
+ }
46
+
47
+ export function HealthCheckResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): HealthCheckResponse {
48
+ if (json == null) {
49
+ return json;
50
+ }
51
+ return {
52
+
53
+ 'status': json['status'] == null ? undefined : json['status'],
54
+ 'timestamp': json['timestamp'] == null ? undefined : (new Date(json['timestamp'])),
55
+ };
56
+ }
57
+
58
+ export function HealthCheckResponseToJSON(json: any): HealthCheckResponse {
59
+ return HealthCheckResponseToJSONTyped(json, false);
60
+ }
61
+
62
+ export function HealthCheckResponseToJSONTyped(value?: HealthCheckResponse | null, ignoreDiscriminator: boolean = false): any {
63
+ if (value == null) {
64
+ return value;
65
+ }
66
+
67
+ return {
68
+
69
+ 'status': value['status'],
70
+ 'timestamp': value['timestamp'] == null ? undefined : ((value['timestamp']).toISOString()),
71
+ };
72
+ }
73
+
@@ -0,0 +1,75 @@
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 LoginRequest
20
+ */
21
+ export interface LoginRequest {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof LoginRequest
26
+ */
27
+ email: string;
28
+ /**
29
+ *
30
+ * @type {string}
31
+ * @memberof LoginRequest
32
+ */
33
+ password: string;
34
+ }
35
+
36
+ /**
37
+ * Check if a given object implements the LoginRequest interface.
38
+ */
39
+ export function instanceOfLoginRequest(value: object): value is LoginRequest {
40
+ if (!('email' in value) || value['email'] === undefined) return false;
41
+ if (!('password' in value) || value['password'] === undefined) return false;
42
+ return true;
43
+ }
44
+
45
+ export function LoginRequestFromJSON(json: any): LoginRequest {
46
+ return LoginRequestFromJSONTyped(json, false);
47
+ }
48
+
49
+ export function LoginRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): LoginRequest {
50
+ if (json == null) {
51
+ return json;
52
+ }
53
+ return {
54
+
55
+ 'email': json['email'],
56
+ 'password': json['password'],
57
+ };
58
+ }
59
+
60
+ export function LoginRequestToJSON(json: any): LoginRequest {
61
+ return LoginRequestToJSONTyped(json, false);
62
+ }
63
+
64
+ export function LoginRequestToJSONTyped(value?: LoginRequest | null, ignoreDiscriminator: boolean = false): any {
65
+ if (value == null) {
66
+ return value;
67
+ }
68
+
69
+ return {
70
+
71
+ 'email': value['email'],
72
+ 'password': value['password'],
73
+ };
74
+ }
75
+
@@ -0,0 +1,66 @@
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 LoginResponse
20
+ */
21
+ export interface LoginResponse {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof LoginResponse
26
+ */
27
+ token: string;
28
+ }
29
+
30
+ /**
31
+ * Check if a given object implements the LoginResponse interface.
32
+ */
33
+ export function instanceOfLoginResponse(value: object): value is LoginResponse {
34
+ if (!('token' in value) || value['token'] === undefined) return false;
35
+ return true;
36
+ }
37
+
38
+ export function LoginResponseFromJSON(json: any): LoginResponse {
39
+ return LoginResponseFromJSONTyped(json, false);
40
+ }
41
+
42
+ export function LoginResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): LoginResponse {
43
+ if (json == null) {
44
+ return json;
45
+ }
46
+ return {
47
+
48
+ 'token': json['token'],
49
+ };
50
+ }
51
+
52
+ export function LoginResponseToJSON(json: any): LoginResponse {
53
+ return LoginResponseToJSONTyped(json, false);
54
+ }
55
+
56
+ export function LoginResponseToJSONTyped(value?: LoginResponse | null, ignoreDiscriminator: boolean = false): any {
57
+ if (value == null) {
58
+ return value;
59
+ }
60
+
61
+ return {
62
+
63
+ 'token': value['token'],
64
+ };
65
+ }
66
+
@@ -0,0 +1,84 @@
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 SignupRequest
20
+ */
21
+ export interface SignupRequest {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof SignupRequest
26
+ */
27
+ email: string;
28
+ /**
29
+ *
30
+ * @type {string}
31
+ * @memberof SignupRequest
32
+ */
33
+ password: string;
34
+ /**
35
+ *
36
+ * @type {string}
37
+ * @memberof SignupRequest
38
+ */
39
+ name: string;
40
+ }
41
+
42
+ /**
43
+ * Check if a given object implements the SignupRequest interface.
44
+ */
45
+ export function instanceOfSignupRequest(value: object): value is SignupRequest {
46
+ if (!('email' in value) || value['email'] === undefined) return false;
47
+ if (!('password' in value) || value['password'] === undefined) return false;
48
+ if (!('name' in value) || value['name'] === undefined) return false;
49
+ return true;
50
+ }
51
+
52
+ export function SignupRequestFromJSON(json: any): SignupRequest {
53
+ return SignupRequestFromJSONTyped(json, false);
54
+ }
55
+
56
+ export function SignupRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): SignupRequest {
57
+ if (json == null) {
58
+ return json;
59
+ }
60
+ return {
61
+
62
+ 'email': json['email'],
63
+ 'password': json['password'],
64
+ 'name': json['name'],
65
+ };
66
+ }
67
+
68
+ export function SignupRequestToJSON(json: any): SignupRequest {
69
+ return SignupRequestToJSONTyped(json, false);
70
+ }
71
+
72
+ export function SignupRequestToJSONTyped(value?: SignupRequest | null, ignoreDiscriminator: boolean = false): any {
73
+ if (value == null) {
74
+ return value;
75
+ }
76
+
77
+ return {
78
+
79
+ 'email': value['email'],
80
+ 'password': value['password'],
81
+ 'name': value['name'],
82
+ };
83
+ }
84
+
@@ -0,0 +1,66 @@
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 SignupResponse
20
+ */
21
+ export interface SignupResponse {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof SignupResponse
26
+ */
27
+ token: string;
28
+ }
29
+
30
+ /**
31
+ * Check if a given object implements the SignupResponse interface.
32
+ */
33
+ export function instanceOfSignupResponse(value: object): value is SignupResponse {
34
+ if (!('token' in value) || value['token'] === undefined) return false;
35
+ return true;
36
+ }
37
+
38
+ export function SignupResponseFromJSON(json: any): SignupResponse {
39
+ return SignupResponseFromJSONTyped(json, false);
40
+ }
41
+
42
+ export function SignupResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): SignupResponse {
43
+ if (json == null) {
44
+ return json;
45
+ }
46
+ return {
47
+
48
+ 'token': json['token'],
49
+ };
50
+ }
51
+
52
+ export function SignupResponseToJSON(json: any): SignupResponse {
53
+ return SignupResponseToJSONTyped(json, false);
54
+ }
55
+
56
+ export function SignupResponseToJSONTyped(value?: SignupResponse | null, ignoreDiscriminator: boolean = false): any {
57
+ if (value == null) {
58
+ return value;
59
+ }
60
+
61
+ return {
62
+
63
+ 'token': value['token'],
64
+ };
65
+ }
66
+
@@ -0,0 +1,7 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ export * from './HealthCheckResponse';
4
+ export * from './LoginRequest';
5
+ export * from './LoginResponse';
6
+ export * from './SignupRequest';
7
+ export * from './SignupResponse';