hey-pharmacist-ecommerce 1.1.25 → 1.1.26

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 (62) hide show
  1. package/dist/index.d.mts +1 -206
  2. package/dist/index.d.ts +1 -206
  3. package/dist/index.js +47 -233
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +47 -233
  6. package/dist/index.mjs.map +1 -1
  7. package/package.json +1 -1
  8. package/src/components/CartItem.tsx +0 -10
  9. package/src/components/ProductCard.tsx +4 -5
  10. package/src/lib/Apis/api.ts +0 -8
  11. package/src/lib/Apis/apis/product-variants-api.ts +0 -96
  12. package/src/lib/Apis/apis/products-api.ts +7 -15
  13. package/src/lib/Apis/apis/shipping-api.ts +12 -214
  14. package/src/lib/Apis/models/category-filters.ts +0 -6
  15. package/src/lib/Apis/models/create-variant-dto.ts +0 -6
  16. package/src/lib/Apis/models/discounts-insights-dto.ts +0 -6
  17. package/src/lib/Apis/models/index.ts +0 -29
  18. package/src/lib/Apis/models/orders-insights-dto.ts +0 -6
  19. package/src/lib/Apis/models/payment.ts +0 -7
  20. package/src/lib/Apis/models/product-variant.ts +0 -6
  21. package/src/lib/Apis/models/products-insights-dto.ts +0 -6
  22. package/src/lib/Apis/models/rate-dto.ts +0 -6
  23. package/src/lib/Apis/models/update-product-variant-dto.ts +0 -6
  24. package/src/providers/WishlistProvider.tsx +2 -3
  25. package/src/screens/CheckoutScreen.tsx +25 -73
  26. package/src/lib/Apis/apis/chats-api.ts +0 -1101
  27. package/src/lib/Apis/apis/drafts-api.ts +0 -448
  28. package/src/lib/Apis/apis/open-aiapi.ts +0 -513
  29. package/src/lib/Apis/apis/payment-methods-api.ts +0 -411
  30. package/src/lib/Apis/apis/product-attributes-api.ts +0 -538
  31. package/src/lib/Apis/apis/product-favorite-list-api.ts +0 -321
  32. package/src/lib/Apis/apis/roles-api.ts +0 -614
  33. package/src/lib/Apis/apis/statistics-api.ts +0 -234
  34. package/src/lib/Apis/models/add-message-dto.ts +0 -56
  35. package/src/lib/Apis/models/chat.ts +0 -33
  36. package/src/lib/Apis/models/create-chat-dto.ts +0 -39
  37. package/src/lib/Apis/models/create-draft-dto.ts +0 -67
  38. package/src/lib/Apis/models/create-product-attribute-dto.ts +0 -33
  39. package/src/lib/Apis/models/create-role-dto.ts +0 -57
  40. package/src/lib/Apis/models/create-zone-dto.ts +0 -82
  41. package/src/lib/Apis/models/default-payment-method-request-dto.ts +0 -27
  42. package/src/lib/Apis/models/draft.ts +0 -79
  43. package/src/lib/Apis/models/google-analytics-request-dto.ts +0 -55
  44. package/src/lib/Apis/models/google-analytics-response-dto.ts +0 -39
  45. package/src/lib/Apis/models/my-favorite-list-dto.ts +0 -52
  46. package/src/lib/Apis/models/open-api.ts +0 -33
  47. package/src/lib/Apis/models/payment-method-data.ts +0 -34
  48. package/src/lib/Apis/models/payment-method.ts +0 -51
  49. package/src/lib/Apis/models/populated-chat-dto.ts +0 -95
  50. package/src/lib/Apis/models/product-attribute.ts +0 -57
  51. package/src/lib/Apis/models/product.ts +0 -142
  52. package/src/lib/Apis/models/role.ts +0 -69
  53. package/src/lib/Apis/models/single-message-populated.ts +0 -59
  54. package/src/lib/Apis/models/single-suggest-attribute.ts +0 -33
  55. package/src/lib/Apis/models/statistic-dto.ts +0 -171
  56. package/src/lib/Apis/models/suggest-attributes.ts +0 -28
  57. package/src/lib/Apis/models/update-product-attribute-dto.ts +0 -33
  58. package/src/lib/Apis/models/update-role-dto.ts +0 -57
  59. package/src/lib/Apis/models/update-zone-dto.ts +0 -82
  60. package/src/lib/Apis/models/user.ts +0 -232
  61. package/src/lib/Apis/models/zone-single-size.ts +0 -51
  62. package/src/lib/Apis/models/zone.ts +0 -106
@@ -1,614 +0,0 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- /**
4
- * Hey Pharamcist API
5
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
6
- *
7
- * OpenAPI spec version: 1.0
8
- *
9
- *
10
- * NOTE: This class is auto generated by the swagger code generator program.
11
- * https://github.com/swagger-api/swagger-codegen.git
12
- * Do not edit the class manually.
13
- */
14
- import globalAxios, { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios';
15
- import { Configuration } from '../configuration';
16
- // Some imports not used depending on template conditions
17
- // @ts-ignore
18
- import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
19
- import { CreateRoleDto } from '../models';
20
- import { Role } from '../models';
21
- import { UpdateRoleDto } from '../models';
22
- /**
23
- * RolesApi - axios parameter creator
24
- * @export
25
- */
26
- export const RolesApiAxiosParamCreator = function (configuration?: Configuration) {
27
- return {
28
- /**
29
- *
30
- * @summary Create a new role
31
- * @param {CreateRoleDto} body
32
- * @param {*} [options] Override http request option.
33
- * @throws {RequiredError}
34
- */
35
- createRole: async (body: CreateRoleDto, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
36
- // verify required parameter 'body' is not null or undefined
37
- if (body === null || body === undefined) {
38
- throw new RequiredError('body','Required parameter body was null or undefined when calling createRole.');
39
- }
40
- const localVarPath = `/roles`;
41
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
42
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
43
- let baseOptions;
44
- if (configuration) {
45
- baseOptions = configuration.baseOptions;
46
- }
47
- const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
48
- const localVarHeaderParameter = {} as any;
49
- const localVarQueryParameter = {} as any;
50
-
51
- // authentication bearer required
52
- // http bearer authentication required
53
- if (configuration && configuration.accessToken) {
54
- const accessToken = typeof configuration.accessToken === 'function'
55
- ? await configuration.accessToken()
56
- : await configuration.accessToken;
57
- localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
58
- }
59
-
60
- // authentication x-store-key required
61
- if (configuration && configuration.apiKey) {
62
- const localVarApiKeyValue = typeof configuration.apiKey === 'function'
63
- ? await configuration.apiKey("x-store-key")
64
- : await configuration.apiKey;
65
- localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
66
- }
67
-
68
- localVarHeaderParameter['Content-Type'] = 'application/json';
69
-
70
- const query = new URLSearchParams(localVarUrlObj.search);
71
- for (const key in localVarQueryParameter) {
72
- query.set(key, localVarQueryParameter[key]);
73
- }
74
- for (const key in options.params) {
75
- query.set(key, options.params[key]);
76
- }
77
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
78
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
79
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
80
- const needsSerialization = (typeof body !== "string") || (localVarRequestOptions.headers ||= {})['Content-Type'] === 'application/json';
81
- localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
82
-
83
- return {
84
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
85
- options: localVarRequestOptions,
86
- };
87
- },
88
- /**
89
- *
90
- * @summary Get all roles
91
- * @param {*} [options] Override http request option.
92
- * @throws {RequiredError}
93
- */
94
- getAllRoles: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
95
- const localVarPath = `/roles`;
96
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
97
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
98
- let baseOptions;
99
- if (configuration) {
100
- baseOptions = configuration.baseOptions;
101
- }
102
- const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
103
- const localVarHeaderParameter = {} as any;
104
- const localVarQueryParameter = {} as any;
105
-
106
- // authentication bearer required
107
- // http bearer authentication required
108
- if (configuration && configuration.accessToken) {
109
- const accessToken = typeof configuration.accessToken === 'function'
110
- ? await configuration.accessToken()
111
- : await configuration.accessToken;
112
- localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
113
- }
114
-
115
- // authentication x-store-key required
116
- if (configuration && configuration.apiKey) {
117
- const localVarApiKeyValue = typeof configuration.apiKey === 'function'
118
- ? await configuration.apiKey("x-store-key")
119
- : await configuration.apiKey;
120
- localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
121
- }
122
-
123
- const query = new URLSearchParams(localVarUrlObj.search);
124
- for (const key in localVarQueryParameter) {
125
- query.set(key, localVarQueryParameter[key]);
126
- }
127
- for (const key in options.params) {
128
- query.set(key, options.params[key]);
129
- }
130
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
131
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
132
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
133
-
134
- return {
135
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
136
- options: localVarRequestOptions,
137
- };
138
- },
139
- /**
140
- *
141
- * @summary Get role by id
142
- * @param {string} roleId
143
- * @param {*} [options] Override http request option.
144
- * @throws {RequiredError}
145
- */
146
- getRoleById: async (roleId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
147
- // verify required parameter 'roleId' is not null or undefined
148
- if (roleId === null || roleId === undefined) {
149
- throw new RequiredError('roleId','Required parameter roleId was null or undefined when calling getRoleById.');
150
- }
151
- const localVarPath = `/roles/{roleId}`
152
- .replace(`{${"roleId"}}`, encodeURIComponent(String(roleId)));
153
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
154
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
155
- let baseOptions;
156
- if (configuration) {
157
- baseOptions = configuration.baseOptions;
158
- }
159
- const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
160
- const localVarHeaderParameter = {} as any;
161
- const localVarQueryParameter = {} as any;
162
-
163
- // authentication bearer required
164
- // http bearer authentication required
165
- if (configuration && configuration.accessToken) {
166
- const accessToken = typeof configuration.accessToken === 'function'
167
- ? await configuration.accessToken()
168
- : await configuration.accessToken;
169
- localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
170
- }
171
-
172
- // authentication x-store-key required
173
- if (configuration && configuration.apiKey) {
174
- const localVarApiKeyValue = typeof configuration.apiKey === 'function'
175
- ? await configuration.apiKey("x-store-key")
176
- : await configuration.apiKey;
177
- localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
178
- }
179
-
180
- const query = new URLSearchParams(localVarUrlObj.search);
181
- for (const key in localVarQueryParameter) {
182
- query.set(key, localVarQueryParameter[key]);
183
- }
184
- for (const key in options.params) {
185
- query.set(key, options.params[key]);
186
- }
187
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
188
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
189
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
190
-
191
- return {
192
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
193
- options: localVarRequestOptions,
194
- };
195
- },
196
- /**
197
- *
198
- * @summary Get role by name
199
- * @param {string} name
200
- * @param {*} [options] Override http request option.
201
- * @throws {RequiredError}
202
- */
203
- getRoleByName: async (name: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
204
- // verify required parameter 'name' is not null or undefined
205
- if (name === null || name === undefined) {
206
- throw new RequiredError('name','Required parameter name was null or undefined when calling getRoleByName.');
207
- }
208
- const localVarPath = `/roles/name/{name}`
209
- .replace(`{${"name"}}`, encodeURIComponent(String(name)));
210
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
211
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
212
- let baseOptions;
213
- if (configuration) {
214
- baseOptions = configuration.baseOptions;
215
- }
216
- const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
217
- const localVarHeaderParameter = {} as any;
218
- const localVarQueryParameter = {} as any;
219
-
220
- // authentication bearer required
221
- // http bearer authentication required
222
- if (configuration && configuration.accessToken) {
223
- const accessToken = typeof configuration.accessToken === 'function'
224
- ? await configuration.accessToken()
225
- : await configuration.accessToken;
226
- localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
227
- }
228
-
229
- // authentication x-store-key required
230
- if (configuration && configuration.apiKey) {
231
- const localVarApiKeyValue = typeof configuration.apiKey === 'function'
232
- ? await configuration.apiKey("x-store-key")
233
- : await configuration.apiKey;
234
- localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
235
- }
236
-
237
- const query = new URLSearchParams(localVarUrlObj.search);
238
- for (const key in localVarQueryParameter) {
239
- query.set(key, localVarQueryParameter[key]);
240
- }
241
- for (const key in options.params) {
242
- query.set(key, options.params[key]);
243
- }
244
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
245
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
246
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
247
-
248
- return {
249
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
250
- options: localVarRequestOptions,
251
- };
252
- },
253
- /**
254
- *
255
- * @summary Delete a role
256
- * @param {string} roleId
257
- * @param {*} [options] Override http request option.
258
- * @throws {RequiredError}
259
- */
260
- remove: async (roleId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
261
- // verify required parameter 'roleId' is not null or undefined
262
- if (roleId === null || roleId === undefined) {
263
- throw new RequiredError('roleId','Required parameter roleId was null or undefined when calling remove.');
264
- }
265
- const localVarPath = `/roles/{roleId}`
266
- .replace(`{${"roleId"}}`, encodeURIComponent(String(roleId)));
267
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
268
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
269
- let baseOptions;
270
- if (configuration) {
271
- baseOptions = configuration.baseOptions;
272
- }
273
- const localVarRequestOptions :AxiosRequestConfig = { method: 'DELETE', ...baseOptions, ...options};
274
- const localVarHeaderParameter = {} as any;
275
- const localVarQueryParameter = {} as any;
276
-
277
- // authentication bearer required
278
- // http bearer authentication required
279
- if (configuration && configuration.accessToken) {
280
- const accessToken = typeof configuration.accessToken === 'function'
281
- ? await configuration.accessToken()
282
- : await configuration.accessToken;
283
- localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
284
- }
285
-
286
- // authentication x-store-key required
287
- if (configuration && configuration.apiKey) {
288
- const localVarApiKeyValue = typeof configuration.apiKey === 'function'
289
- ? await configuration.apiKey("x-store-key")
290
- : await configuration.apiKey;
291
- localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
292
- }
293
-
294
- const query = new URLSearchParams(localVarUrlObj.search);
295
- for (const key in localVarQueryParameter) {
296
- query.set(key, localVarQueryParameter[key]);
297
- }
298
- for (const key in options.params) {
299
- query.set(key, options.params[key]);
300
- }
301
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
302
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
303
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
304
-
305
- return {
306
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
307
- options: localVarRequestOptions,
308
- };
309
- },
310
- /**
311
- *
312
- * @summary Update a role
313
- * @param {UpdateRoleDto} body
314
- * @param {string} roleId
315
- * @param {*} [options] Override http request option.
316
- * @throws {RequiredError}
317
- */
318
- update: async (body: UpdateRoleDto, roleId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
319
- // verify required parameter 'body' is not null or undefined
320
- if (body === null || body === undefined) {
321
- throw new RequiredError('body','Required parameter body was null or undefined when calling update.');
322
- }
323
- // verify required parameter 'roleId' is not null or undefined
324
- if (roleId === null || roleId === undefined) {
325
- throw new RequiredError('roleId','Required parameter roleId was null or undefined when calling update.');
326
- }
327
- const localVarPath = `/roles/{roleId}`
328
- .replace(`{${"roleId"}}`, encodeURIComponent(String(roleId)));
329
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
330
- const localVarUrlObj = new URL(localVarPath, 'https://example.com');
331
- let baseOptions;
332
- if (configuration) {
333
- baseOptions = configuration.baseOptions;
334
- }
335
- const localVarRequestOptions :AxiosRequestConfig = { method: 'PATCH', ...baseOptions, ...options};
336
- const localVarHeaderParameter = {} as any;
337
- const localVarQueryParameter = {} as any;
338
-
339
- // authentication bearer required
340
- // http bearer authentication required
341
- if (configuration && configuration.accessToken) {
342
- const accessToken = typeof configuration.accessToken === 'function'
343
- ? await configuration.accessToken()
344
- : await configuration.accessToken;
345
- localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
346
- }
347
-
348
- // authentication x-store-key required
349
- if (configuration && configuration.apiKey) {
350
- const localVarApiKeyValue = typeof configuration.apiKey === 'function'
351
- ? await configuration.apiKey("x-store-key")
352
- : await configuration.apiKey;
353
- localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
354
- }
355
-
356
- localVarHeaderParameter['Content-Type'] = 'application/json';
357
-
358
- const query = new URLSearchParams(localVarUrlObj.search);
359
- for (const key in localVarQueryParameter) {
360
- query.set(key, localVarQueryParameter[key]);
361
- }
362
- for (const key in options.params) {
363
- query.set(key, options.params[key]);
364
- }
365
- localVarUrlObj.search = (new URLSearchParams(query)).toString();
366
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
367
- localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
368
- const needsSerialization = (typeof body !== "string") || (localVarRequestOptions.headers ||= {})['Content-Type'] === 'application/json';
369
- localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
370
-
371
- return {
372
- url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
373
- options: localVarRequestOptions,
374
- };
375
- },
376
- }
377
- };
378
-
379
- /**
380
- * RolesApi - functional programming interface
381
- * @export
382
- */
383
- export const RolesApiFp = function(configuration?: Configuration) {
384
- return {
385
- /**
386
- *
387
- * @summary Create a new role
388
- * @param {CreateRoleDto} body
389
- * @param {*} [options] Override http request option.
390
- * @throws {RequiredError}
391
- */
392
- async createRole(body: CreateRoleDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Role>>> {
393
- const localVarAxiosArgs = await RolesApiAxiosParamCreator(configuration).createRole(body, options);
394
- return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
395
- const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
396
- return axios.request(axiosRequestArgs);
397
- };
398
- },
399
- /**
400
- *
401
- * @summary Get all roles
402
- * @param {*} [options] Override http request option.
403
- * @throws {RequiredError}
404
- */
405
- async getAllRoles(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Array<Role>>>> {
406
- const localVarAxiosArgs = await RolesApiAxiosParamCreator(configuration).getAllRoles(options);
407
- return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
408
- const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
409
- return axios.request(axiosRequestArgs);
410
- };
411
- },
412
- /**
413
- *
414
- * @summary Get role by id
415
- * @param {string} roleId
416
- * @param {*} [options] Override http request option.
417
- * @throws {RequiredError}
418
- */
419
- async getRoleById(roleId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Role>>> {
420
- const localVarAxiosArgs = await RolesApiAxiosParamCreator(configuration).getRoleById(roleId, options);
421
- return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
422
- const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
423
- return axios.request(axiosRequestArgs);
424
- };
425
- },
426
- /**
427
- *
428
- * @summary Get role by name
429
- * @param {string} name
430
- * @param {*} [options] Override http request option.
431
- * @throws {RequiredError}
432
- */
433
- async getRoleByName(name: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Role>>> {
434
- const localVarAxiosArgs = await RolesApiAxiosParamCreator(configuration).getRoleByName(name, options);
435
- return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
436
- const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
437
- return axios.request(axiosRequestArgs);
438
- };
439
- },
440
- /**
441
- *
442
- * @summary Delete a role
443
- * @param {string} roleId
444
- * @param {*} [options] Override http request option.
445
- * @throws {RequiredError}
446
- */
447
- async remove(roleId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
448
- const localVarAxiosArgs = await RolesApiAxiosParamCreator(configuration).remove(roleId, options);
449
- return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
450
- const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
451
- return axios.request(axiosRequestArgs);
452
- };
453
- },
454
- /**
455
- *
456
- * @summary Update a role
457
- * @param {UpdateRoleDto} body
458
- * @param {string} roleId
459
- * @param {*} [options] Override http request option.
460
- * @throws {RequiredError}
461
- */
462
- async update(body: UpdateRoleDto, roleId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Role>>> {
463
- const localVarAxiosArgs = await RolesApiAxiosParamCreator(configuration).update(body, roleId, options);
464
- return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
465
- const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
466
- return axios.request(axiosRequestArgs);
467
- };
468
- },
469
- }
470
- };
471
-
472
- /**
473
- * RolesApi - factory interface
474
- * @export
475
- */
476
- export const RolesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
477
- return {
478
- /**
479
- *
480
- * @summary Create a new role
481
- * @param {CreateRoleDto} body
482
- * @param {*} [options] Override http request option.
483
- * @throws {RequiredError}
484
- */
485
- async createRole(body: CreateRoleDto, options?: AxiosRequestConfig): Promise<AxiosResponse<Role>> {
486
- return RolesApiFp(configuration).createRole(body, options).then((request) => request(axios, basePath));
487
- },
488
- /**
489
- *
490
- * @summary Get all roles
491
- * @param {*} [options] Override http request option.
492
- * @throws {RequiredError}
493
- */
494
- async getAllRoles(options?: AxiosRequestConfig): Promise<AxiosResponse<Array<Role>>> {
495
- return RolesApiFp(configuration).getAllRoles(options).then((request) => request(axios, basePath));
496
- },
497
- /**
498
- *
499
- * @summary Get role by id
500
- * @param {string} roleId
501
- * @param {*} [options] Override http request option.
502
- * @throws {RequiredError}
503
- */
504
- async getRoleById(roleId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<Role>> {
505
- return RolesApiFp(configuration).getRoleById(roleId, options).then((request) => request(axios, basePath));
506
- },
507
- /**
508
- *
509
- * @summary Get role by name
510
- * @param {string} name
511
- * @param {*} [options] Override http request option.
512
- * @throws {RequiredError}
513
- */
514
- async getRoleByName(name: string, options?: AxiosRequestConfig): Promise<AxiosResponse<Role>> {
515
- return RolesApiFp(configuration).getRoleByName(name, options).then((request) => request(axios, basePath));
516
- },
517
- /**
518
- *
519
- * @summary Delete a role
520
- * @param {string} roleId
521
- * @param {*} [options] Override http request option.
522
- * @throws {RequiredError}
523
- */
524
- async remove(roleId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
525
- return RolesApiFp(configuration).remove(roleId, options).then((request) => request(axios, basePath));
526
- },
527
- /**
528
- *
529
- * @summary Update a role
530
- * @param {UpdateRoleDto} body
531
- * @param {string} roleId
532
- * @param {*} [options] Override http request option.
533
- * @throws {RequiredError}
534
- */
535
- async update(body: UpdateRoleDto, roleId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<Role>> {
536
- return RolesApiFp(configuration).update(body, roleId, options).then((request) => request(axios, basePath));
537
- },
538
- };
539
- };
540
-
541
- /**
542
- * RolesApi - object-oriented interface
543
- * @export
544
- * @class RolesApi
545
- * @extends {BaseAPI}
546
- */
547
- export class RolesApi extends BaseAPI {
548
- /**
549
- *
550
- * @summary Create a new role
551
- * @param {CreateRoleDto} body
552
- * @param {*} [options] Override http request option.
553
- * @throws {RequiredError}
554
- * @memberof RolesApi
555
- */
556
- public async createRole(body: CreateRoleDto, options?: AxiosRequestConfig) : Promise<AxiosResponse<Role>> {
557
- return RolesApiFp(this.configuration).createRole(body, options).then((request) => request(this.axios, this.basePath));
558
- }
559
- /**
560
- *
561
- * @summary Get all roles
562
- * @param {*} [options] Override http request option.
563
- * @throws {RequiredError}
564
- * @memberof RolesApi
565
- */
566
- public async getAllRoles(options?: AxiosRequestConfig) : Promise<AxiosResponse<Array<Role>>> {
567
- return RolesApiFp(this.configuration).getAllRoles(options).then((request) => request(this.axios, this.basePath));
568
- }
569
- /**
570
- *
571
- * @summary Get role by id
572
- * @param {string} roleId
573
- * @param {*} [options] Override http request option.
574
- * @throws {RequiredError}
575
- * @memberof RolesApi
576
- */
577
- public async getRoleById(roleId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<Role>> {
578
- return RolesApiFp(this.configuration).getRoleById(roleId, options).then((request) => request(this.axios, this.basePath));
579
- }
580
- /**
581
- *
582
- * @summary Get role by name
583
- * @param {string} name
584
- * @param {*} [options] Override http request option.
585
- * @throws {RequiredError}
586
- * @memberof RolesApi
587
- */
588
- public async getRoleByName(name: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<Role>> {
589
- return RolesApiFp(this.configuration).getRoleByName(name, options).then((request) => request(this.axios, this.basePath));
590
- }
591
- /**
592
- *
593
- * @summary Delete a role
594
- * @param {string} roleId
595
- * @param {*} [options] Override http request option.
596
- * @throws {RequiredError}
597
- * @memberof RolesApi
598
- */
599
- public async remove(roleId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
600
- return RolesApiFp(this.configuration).remove(roleId, options).then((request) => request(this.axios, this.basePath));
601
- }
602
- /**
603
- *
604
- * @summary Update a role
605
- * @param {UpdateRoleDto} body
606
- * @param {string} roleId
607
- * @param {*} [options] Override http request option.
608
- * @throws {RequiredError}
609
- * @memberof RolesApi
610
- */
611
- public async update(body: UpdateRoleDto, roleId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<Role>> {
612
- return RolesApiFp(this.configuration).update(body, roleId, options).then((request) => request(this.axios, this.basePath));
613
- }
614
- }