@dazl/api-client 1.0.3 → 1.0.4
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/dist/internal/index.d.ts +1 -1
- package/dist/internal/index.d.ts.map +1 -1
- package/dist/internal/sdk.gen.d.ts +10 -2
- package/dist/internal/sdk.gen.d.ts.map +1 -1
- package/dist/internal/sdk.gen.js +22 -3
- package/dist/internal/sdk.gen.js.map +1 -1
- package/dist/internal/types.gen.d.ts +158 -56
- package/dist/internal/types.gen.d.ts.map +1 -1
- package/dist/public/index.d.ts +2 -2
- package/dist/public/index.d.ts.map +1 -1
- package/dist/public/index.js +1 -1
- package/dist/public/index.js.map +1 -1
- package/dist/public/sdk.gen.d.ts +9 -1
- package/dist/public/sdk.gen.d.ts.map +1 -1
- package/dist/public/sdk.gen.js +31 -0
- package/dist/public/sdk.gen.js.map +1 -1
- package/dist/public/types.gen.d.ts +227 -0
- package/dist/public/types.gen.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/internal/index.ts +1 -1
- package/src/internal/sdk.gen.ts +26 -5
- package/src/internal/types.gen.ts +174 -62
- package/src/public/index.ts +2 -2
- package/src/public/sdk.gen.ts +36 -1
- package/src/public/types.gen.ts +249 -0
package/src/public/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
2
|
|
|
3
|
-
export { type Options, Ping } from './sdk.gen.ts';
|
|
4
|
-
export type { ClientOptions, ErrorResponse, GetPingData, GetPingError, GetPingErrors, GetPingResponse, GetPingResponses } from './types.gen.ts';
|
|
3
|
+
export { EnvConfig, type Options, Ping, User } from './sdk.gen.ts';
|
|
4
|
+
export type { ClientOptions, EnsureMyUserData, EnsureMyUserError, EnsureMyUserErrors, EnsureMyUserResponse, EnsureMyUserResponses, ErrorResponse, FeatureToggle, GetFeatureTogglesData, GetFeatureTogglesError, GetFeatureTogglesErrors, GetFeatureTogglesResponse, GetFeatureTogglesResponses, GetMyUserData, GetMyUserError, GetMyUserErrors, GetMyUserResponse, GetMyUserResponses, GetPingData, GetPingError, GetPingErrors, GetPingResponse, GetPingResponses, UpdateMyUserData, UpdateMyUserError, UpdateMyUserErrors, UpdateMyUserResponse, UpdateMyUserResponses, UserRaw } from './types.gen.ts';
|
package/src/public/sdk.gen.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
2
|
|
|
3
3
|
import type { Client, ClientMeta, Options as Options2, RequestResult, TDataShape } from './client/index.ts';
|
|
4
|
-
import type { GetPingData, GetPingErrors, GetPingResponses } from './types.gen.ts';
|
|
4
|
+
import type { EnsureMyUserData, EnsureMyUserErrors, EnsureMyUserResponses, GetFeatureTogglesData, GetFeatureTogglesErrors, GetFeatureTogglesResponses, GetMyUserData, GetMyUserErrors, GetMyUserResponses, GetPingData, GetPingErrors, GetPingResponses, UpdateMyUserData, UpdateMyUserErrors, UpdateMyUserResponses } from './types.gen.ts';
|
|
5
5
|
|
|
6
6
|
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
|
|
7
7
|
/**
|
|
@@ -17,6 +17,41 @@ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends
|
|
|
17
17
|
meta?: keyof ClientMeta extends never ? Record<string, unknown> : ClientMeta;
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
+
export class User {
|
|
21
|
+
public static ensureMyUser<ThrowOnError extends boolean = false>(options: Options<EnsureMyUserData, ThrowOnError>): RequestResult<EnsureMyUserResponses, EnsureMyUserErrors, ThrowOnError> {
|
|
22
|
+
return options.client.post<EnsureMyUserResponses, EnsureMyUserErrors, ThrowOnError>({
|
|
23
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
24
|
+
url: '/user-auth/ensure-user',
|
|
25
|
+
...options,
|
|
26
|
+
headers: {
|
|
27
|
+
'Content-Type': 'application/json',
|
|
28
|
+
...options.headers
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
public static getMyUser<ThrowOnError extends boolean = false>(options: Options<GetMyUserData, ThrowOnError>): RequestResult<GetMyUserResponses, GetMyUserErrors, ThrowOnError> {
|
|
34
|
+
return options.client.get<GetMyUserResponses, GetMyUserErrors, ThrowOnError>({ url: '/user/me', ...options });
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public static updateMyUser<ThrowOnError extends boolean = false>(options: Options<UpdateMyUserData, ThrowOnError>): RequestResult<UpdateMyUserResponses, UpdateMyUserErrors, ThrowOnError> {
|
|
38
|
+
return options.client.patch<UpdateMyUserResponses, UpdateMyUserErrors, ThrowOnError>({
|
|
39
|
+
url: '/user/me',
|
|
40
|
+
...options,
|
|
41
|
+
headers: {
|
|
42
|
+
'Content-Type': 'application/json',
|
|
43
|
+
...options.headers
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export class EnvConfig {
|
|
50
|
+
public static getFeatureToggles<ThrowOnError extends boolean = false>(options: Options<GetFeatureTogglesData, ThrowOnError>): RequestResult<GetFeatureTogglesResponses, GetFeatureTogglesErrors, ThrowOnError> {
|
|
51
|
+
return options.client.get<GetFeatureTogglesResponses, GetFeatureTogglesErrors, ThrowOnError>({ url: '/env-config', ...options });
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
20
55
|
export class Ping {
|
|
21
56
|
/**
|
|
22
57
|
* Ping endpoint for test
|
package/src/public/types.gen.ts
CHANGED
|
@@ -4,10 +4,259 @@ export type ClientOptions = {
|
|
|
4
4
|
baseUrl: `${string}://${string}` | (string & {});
|
|
5
5
|
};
|
|
6
6
|
|
|
7
|
+
export type UserRaw = {
|
|
8
|
+
id: number;
|
|
9
|
+
createdAt: string;
|
|
10
|
+
picture: string | null;
|
|
11
|
+
jobRole: string | null;
|
|
12
|
+
updatedAt: string;
|
|
13
|
+
} & {
|
|
14
|
+
dazlId: string;
|
|
15
|
+
name: string;
|
|
16
|
+
email: string;
|
|
17
|
+
authSub: string;
|
|
18
|
+
stripeCustomerId: string;
|
|
19
|
+
picture?: string | null;
|
|
20
|
+
jobRole?: string | null;
|
|
21
|
+
};
|
|
22
|
+
|
|
7
23
|
export type ErrorResponse = {
|
|
8
24
|
message: string;
|
|
9
25
|
};
|
|
10
26
|
|
|
27
|
+
export type FeatureToggle = {
|
|
28
|
+
name: string;
|
|
29
|
+
scope: 'RemoteAndEditor' | 'SiteAndEditor';
|
|
30
|
+
updatedAt: string;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export type EnsureMyUserData = {
|
|
34
|
+
body?: {
|
|
35
|
+
name?: string;
|
|
36
|
+
picture?: string | null;
|
|
37
|
+
jobRole?: string | null;
|
|
38
|
+
};
|
|
39
|
+
path?: never;
|
|
40
|
+
query?: never;
|
|
41
|
+
url: '/user-auth/ensure-user';
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export type EnsureMyUserErrors = {
|
|
45
|
+
/**
|
|
46
|
+
* Bad request - Invalid parameters or malformed JSON
|
|
47
|
+
*/
|
|
48
|
+
400: {
|
|
49
|
+
message: string;
|
|
50
|
+
issues?: string;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Unauthorized
|
|
54
|
+
*/
|
|
55
|
+
401: ErrorResponse;
|
|
56
|
+
/**
|
|
57
|
+
* Forbidden
|
|
58
|
+
*/
|
|
59
|
+
403: ErrorResponse;
|
|
60
|
+
/**
|
|
61
|
+
* Not Found
|
|
62
|
+
*/
|
|
63
|
+
404: ErrorResponse;
|
|
64
|
+
/**
|
|
65
|
+
* Conflict
|
|
66
|
+
*/
|
|
67
|
+
409: ErrorResponse;
|
|
68
|
+
/**
|
|
69
|
+
* Internal server error
|
|
70
|
+
*/
|
|
71
|
+
500: ErrorResponse;
|
|
72
|
+
/**
|
|
73
|
+
* Service Unavailable
|
|
74
|
+
*/
|
|
75
|
+
503: ErrorResponse;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export type EnsureMyUserError = EnsureMyUserErrors[keyof EnsureMyUserErrors];
|
|
79
|
+
|
|
80
|
+
export type EnsureMyUserResponses = {
|
|
81
|
+
/**
|
|
82
|
+
* Returns the requested user
|
|
83
|
+
*/
|
|
84
|
+
200: {
|
|
85
|
+
user: UserRaw;
|
|
86
|
+
created: boolean;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export type EnsureMyUserResponse = EnsureMyUserResponses[keyof EnsureMyUserResponses];
|
|
91
|
+
|
|
92
|
+
export type GetMyUserData = {
|
|
93
|
+
body?: never;
|
|
94
|
+
path?: never;
|
|
95
|
+
query?: never;
|
|
96
|
+
url: '/user/me';
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
export type GetMyUserErrors = {
|
|
100
|
+
/**
|
|
101
|
+
* Bad request - Invalid parameters or malformed JSON
|
|
102
|
+
*/
|
|
103
|
+
400: {
|
|
104
|
+
message: string;
|
|
105
|
+
issues?: string;
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* Unauthorized
|
|
109
|
+
*/
|
|
110
|
+
401: ErrorResponse;
|
|
111
|
+
/**
|
|
112
|
+
* Forbidden
|
|
113
|
+
*/
|
|
114
|
+
403: ErrorResponse;
|
|
115
|
+
/**
|
|
116
|
+
* Not Found
|
|
117
|
+
*/
|
|
118
|
+
404: ErrorResponse;
|
|
119
|
+
/**
|
|
120
|
+
* Conflict
|
|
121
|
+
*/
|
|
122
|
+
409: ErrorResponse;
|
|
123
|
+
/**
|
|
124
|
+
* Internal server error
|
|
125
|
+
*/
|
|
126
|
+
500: ErrorResponse;
|
|
127
|
+
/**
|
|
128
|
+
* Service Unavailable
|
|
129
|
+
*/
|
|
130
|
+
503: ErrorResponse;
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export type GetMyUserError = GetMyUserErrors[keyof GetMyUserErrors];
|
|
134
|
+
|
|
135
|
+
export type GetMyUserResponses = {
|
|
136
|
+
/**
|
|
137
|
+
* Returns the requested user
|
|
138
|
+
*/
|
|
139
|
+
200: {
|
|
140
|
+
user: UserRaw;
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
export type GetMyUserResponse = GetMyUserResponses[keyof GetMyUserResponses];
|
|
145
|
+
|
|
146
|
+
export type UpdateMyUserData = {
|
|
147
|
+
body: {
|
|
148
|
+
picture?: string | null;
|
|
149
|
+
name?: string;
|
|
150
|
+
jobRole?: string | null;
|
|
151
|
+
};
|
|
152
|
+
path?: never;
|
|
153
|
+
query?: never;
|
|
154
|
+
url: '/user/me';
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
export type UpdateMyUserErrors = {
|
|
158
|
+
/**
|
|
159
|
+
* Bad request - Invalid parameters or malformed JSON
|
|
160
|
+
*/
|
|
161
|
+
400: {
|
|
162
|
+
message: string;
|
|
163
|
+
issues?: string;
|
|
164
|
+
};
|
|
165
|
+
/**
|
|
166
|
+
* Unauthorized
|
|
167
|
+
*/
|
|
168
|
+
401: ErrorResponse;
|
|
169
|
+
/**
|
|
170
|
+
* Forbidden
|
|
171
|
+
*/
|
|
172
|
+
403: ErrorResponse;
|
|
173
|
+
/**
|
|
174
|
+
* Not Found
|
|
175
|
+
*/
|
|
176
|
+
404: ErrorResponse;
|
|
177
|
+
/**
|
|
178
|
+
* Conflict
|
|
179
|
+
*/
|
|
180
|
+
409: ErrorResponse;
|
|
181
|
+
/**
|
|
182
|
+
* Internal server error
|
|
183
|
+
*/
|
|
184
|
+
500: ErrorResponse;
|
|
185
|
+
/**
|
|
186
|
+
* Service Unavailable
|
|
187
|
+
*/
|
|
188
|
+
503: ErrorResponse;
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
export type UpdateMyUserError = UpdateMyUserErrors[keyof UpdateMyUserErrors];
|
|
192
|
+
|
|
193
|
+
export type UpdateMyUserResponses = {
|
|
194
|
+
/**
|
|
195
|
+
* Updates user information
|
|
196
|
+
*/
|
|
197
|
+
200: {
|
|
198
|
+
user: UserRaw;
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
export type UpdateMyUserResponse = UpdateMyUserResponses[keyof UpdateMyUserResponses];
|
|
203
|
+
|
|
204
|
+
export type GetFeatureTogglesData = {
|
|
205
|
+
body?: never;
|
|
206
|
+
path?: never;
|
|
207
|
+
query?: {
|
|
208
|
+
scope?: 'RemoteAndEditor' | 'SiteAndEditor';
|
|
209
|
+
};
|
|
210
|
+
url: '/env-config';
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
export type GetFeatureTogglesErrors = {
|
|
214
|
+
/**
|
|
215
|
+
* Bad request - Invalid parameters or malformed JSON
|
|
216
|
+
*/
|
|
217
|
+
400: {
|
|
218
|
+
message: string;
|
|
219
|
+
issues?: string;
|
|
220
|
+
};
|
|
221
|
+
/**
|
|
222
|
+
* Unauthorized
|
|
223
|
+
*/
|
|
224
|
+
401: ErrorResponse;
|
|
225
|
+
/**
|
|
226
|
+
* Forbidden
|
|
227
|
+
*/
|
|
228
|
+
403: ErrorResponse;
|
|
229
|
+
/**
|
|
230
|
+
* Not Found
|
|
231
|
+
*/
|
|
232
|
+
404: ErrorResponse;
|
|
233
|
+
/**
|
|
234
|
+
* Conflict
|
|
235
|
+
*/
|
|
236
|
+
409: ErrorResponse;
|
|
237
|
+
/**
|
|
238
|
+
* Internal server error
|
|
239
|
+
*/
|
|
240
|
+
500: ErrorResponse;
|
|
241
|
+
/**
|
|
242
|
+
* Service Unavailable
|
|
243
|
+
*/
|
|
244
|
+
503: ErrorResponse;
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
export type GetFeatureTogglesError = GetFeatureTogglesErrors[keyof GetFeatureTogglesErrors];
|
|
248
|
+
|
|
249
|
+
export type GetFeatureTogglesResponses = {
|
|
250
|
+
/**
|
|
251
|
+
* Returns feature toggles, optionally filtered by scope
|
|
252
|
+
*/
|
|
253
|
+
200: {
|
|
254
|
+
toggles: Array<FeatureToggle>;
|
|
255
|
+
};
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
export type GetFeatureTogglesResponse = GetFeatureTogglesResponses[keyof GetFeatureTogglesResponses];
|
|
259
|
+
|
|
11
260
|
export type GetPingData = {
|
|
12
261
|
body?: never;
|
|
13
262
|
path?: never;
|