buymeua-api-fe 0.2.0 → 0.4.0
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/README.md +162 -142
- package/dist/entities/auth/api/authApi.d.ts +161 -0
- package/dist/entities/auth/api/authApi.d.ts.map +1 -1
- package/dist/entities/auth/api/authApi.js +7 -1
- package/dist/entities/auth/api/authApi.js.map +1 -1
- package/dist/entities/auth/model/types.d.ts +2 -0
- package/dist/entities/auth/model/types.d.ts.map +1 -1
- package/dist/entities/country/api/countryApi.d.ts +841 -0
- package/dist/entities/country/api/countryApi.d.ts.map +1 -0
- package/dist/entities/country/api/countryApi.js +22 -0
- package/dist/entities/country/api/countryApi.js.map +1 -0
- package/dist/entities/country/index.d.ts +3 -0
- package/dist/entities/country/index.d.ts.map +1 -0
- package/dist/entities/country/index.js +3 -0
- package/dist/entities/country/index.js.map +1 -0
- package/dist/entities/country/model/types.d.ts +19 -0
- package/dist/entities/country/model/types.d.ts.map +1 -0
- package/dist/entities/country/model/types.js +1 -0
- package/dist/entities/country/model/types.js.map +1 -0
- package/dist/entities/store/api/storeApi.d.ts +190 -0
- package/dist/entities/store/api/storeApi.d.ts.map +1 -0
- package/dist/entities/store/api/storeApi.js +13 -0
- package/dist/entities/store/api/storeApi.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
# Buymeua API Frontend
|
|
2
2
|
|
|
3
|
+
TypeScript/JavaScript client for BuyMeUA API with RTK Query integration.
|
|
4
|
+
|
|
5
|
+
[](https://badge.fury.io/js/buymeua-api-fe)
|
|
6
|
+
[](https://opensource.org/licenses/ISC)
|
|
7
|
+
|
|
3
8
|
## 🚀 Installation
|
|
4
9
|
|
|
5
10
|
```bash
|
|
6
11
|
npm install buymeua-api-fe @reduxjs/toolkit react-redux
|
|
12
|
+
# or
|
|
13
|
+
yarn add buymeua-api-fe @reduxjs/toolkit react-redux
|
|
14
|
+
# or
|
|
15
|
+
pnpm add buymeua-api-fe @reduxjs/toolkit react-redux
|
|
7
16
|
```
|
|
8
17
|
|
|
9
18
|
## 📖 Quick Start
|
|
@@ -12,7 +21,7 @@ npm install buymeua-api-fe @reduxjs/toolkit react-redux
|
|
|
12
21
|
|
|
13
22
|
```typescript
|
|
14
23
|
import { configureStore } from '@reduxjs/toolkit';
|
|
15
|
-
import { configureBuymeuaApi,
|
|
24
|
+
import { configureBuymeuaApi, Session } from 'buymeua-api-fe';
|
|
16
25
|
|
|
17
26
|
// Configure API before store setup
|
|
18
27
|
const buymeuaApi = configureBuymeuaApi({
|
|
@@ -49,13 +58,12 @@ export const store = configureStore({
|
|
|
49
58
|
|
|
50
59
|
```typescript
|
|
51
60
|
import React from 'react';
|
|
52
|
-
import {
|
|
61
|
+
import { useGetProductsInfiniteQuery } from 'buymeua-api-fe';
|
|
53
62
|
|
|
54
63
|
function ProductList() {
|
|
55
|
-
const { data
|
|
56
|
-
page: 1,
|
|
64
|
+
const { data, isLoading, error, fetchNextPage, hasNextPage } = useGetProductsInfiniteQuery({
|
|
57
65
|
per_page: 20,
|
|
58
|
-
|
|
66
|
+
core_filter: 'phone'
|
|
59
67
|
});
|
|
60
68
|
|
|
61
69
|
if (isLoading) return <div>Loading...</div>;
|
|
@@ -63,9 +71,16 @@ function ProductList() {
|
|
|
63
71
|
|
|
64
72
|
return (
|
|
65
73
|
<div>
|
|
66
|
-
{
|
|
67
|
-
<div key={
|
|
74
|
+
{data?.pages.map((page, pageIndex) => (
|
|
75
|
+
<div key={pageIndex}>
|
|
76
|
+
{page.data.map((product) => (
|
|
77
|
+
<div key={product.id}>{product.name}</div>
|
|
78
|
+
))}
|
|
79
|
+
</div>
|
|
68
80
|
))}
|
|
81
|
+
{hasNextPage && (
|
|
82
|
+
<button onClick={() => fetchNextPage()}>Load More</button>
|
|
83
|
+
)}
|
|
69
84
|
</div>
|
|
70
85
|
);
|
|
71
86
|
}
|
|
@@ -82,46 +97,40 @@ Configures the global API client.
|
|
|
82
97
|
**Parameters:**
|
|
83
98
|
|
|
84
99
|
- `config.baseUrl` - Base API URL
|
|
85
|
-
- `config.prepareHeaders` - Function to prepare headers
|
|
86
|
-
- `config.onUnauthorized` -
|
|
87
|
-
|
|
88
|
-
#### `getBuymeuaApi()`
|
|
100
|
+
- `config.prepareHeaders` - Function to prepare headers (receives Headers object and API context)
|
|
101
|
+
- `config.onUnauthorized` - Optional callback for handling 401 errors
|
|
89
102
|
|
|
90
|
-
Returns
|
|
103
|
+
**Returns:** Configured API instance ready for Redux store setup
|
|
91
104
|
|
|
92
105
|
### Products
|
|
93
106
|
|
|
94
107
|
```typescript
|
|
95
108
|
// Get products list with infinite scroll
|
|
96
109
|
const { data, fetchNextPage, hasNextPage } = useGetProductsInfiniteQuery({
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
price_type?: string;
|
|
114
|
-
}
|
|
110
|
+
per_page?: number;
|
|
111
|
+
core_filter?: string;
|
|
112
|
+
filter_has_special?: boolean | null;
|
|
113
|
+
order_by?: string;
|
|
114
|
+
category_filter?: number[];
|
|
115
|
+
option_value_filter?: {
|
|
116
|
+
option_value_ids: number[];
|
|
117
|
+
warehouse_ids: number[];
|
|
118
|
+
};
|
|
119
|
+
filter_customer_id?: number;
|
|
120
|
+
filter_has_customer_id?: boolean;
|
|
121
|
+
filter_advertised?: boolean;
|
|
122
|
+
price_from?: number;
|
|
123
|
+
price_to?: number;
|
|
124
|
+
only_in_root_category?: boolean;
|
|
125
|
+
price_type?: string;
|
|
115
126
|
});
|
|
116
127
|
|
|
117
128
|
// Get products by QR code
|
|
118
129
|
const { data, fetchNextPage, hasNextPage } = useGetProductsByQrInfiniteQuery({
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
per_page?: number;
|
|
124
|
-
}
|
|
130
|
+
'filter[barcode]'?: string;
|
|
131
|
+
'filter[product_id]'?: number;
|
|
132
|
+
core_filter?: string;
|
|
133
|
+
per_page?: number;
|
|
125
134
|
});
|
|
126
135
|
|
|
127
136
|
// Get single product by ID
|
|
@@ -153,17 +162,13 @@ const { data } = useGetCartCountQuery();
|
|
|
153
162
|
|
|
154
163
|
// Get cart merchants
|
|
155
164
|
const { data, fetchNextPage, hasNextPage } = useGetCartMerchantsInfiniteQuery({
|
|
156
|
-
|
|
157
|
-
per_page?: number;
|
|
158
|
-
}
|
|
165
|
+
per_page?: number;
|
|
159
166
|
});
|
|
160
167
|
|
|
161
168
|
// Get cart merchant items
|
|
162
169
|
const { data, fetchNextPage, hasNextPage } = useGetCartMerchantItemsInfiniteQuery({
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
per_page?: number;
|
|
166
|
-
}
|
|
170
|
+
merchant_id: number;
|
|
171
|
+
per_page?: number;
|
|
167
172
|
});
|
|
168
173
|
|
|
169
174
|
// Add item to cart
|
|
@@ -237,31 +242,25 @@ await signUp({
|
|
|
237
242
|
```typescript
|
|
238
243
|
// Get categories
|
|
239
244
|
const { data, fetchNextPage, hasNextPage } = useGetCategoriesInfiniteQuery({
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
per_page?: number;
|
|
245
|
-
}
|
|
245
|
+
search: string;
|
|
246
|
+
filter_parent_id?: number;
|
|
247
|
+
filter_with_products?: boolean;
|
|
248
|
+
per_page?: number;
|
|
246
249
|
});
|
|
247
250
|
|
|
248
251
|
// Get supplier categories
|
|
249
252
|
const { data, fetchNextPage, hasNextPage } = useGetSupplierCategoriesInfiniteQuery({
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
per_page?: number;
|
|
254
|
-
}
|
|
253
|
+
customer: number;
|
|
254
|
+
parent_id?: number;
|
|
255
|
+
per_page?: number;
|
|
255
256
|
});
|
|
256
257
|
|
|
257
258
|
// Get Buyme categories
|
|
258
259
|
const { data, fetchNextPage, hasNextPage } = useGetBuymeCategoriesInfiniteQuery({
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
per_page?: number;
|
|
264
|
-
}
|
|
260
|
+
search?: string;
|
|
261
|
+
parent_id?: number;
|
|
262
|
+
customer_id?: number;
|
|
263
|
+
per_page?: number;
|
|
265
264
|
});
|
|
266
265
|
```
|
|
267
266
|
|
|
@@ -273,16 +272,12 @@ const { data } = useGetFavoriteCountQuery();
|
|
|
273
272
|
|
|
274
273
|
// Get favorite merchants
|
|
275
274
|
const { data, fetchNextPage, hasNextPage } = useGetFavoriteMerchantsInfiniteQuery({
|
|
276
|
-
|
|
277
|
-
per_page?: number;
|
|
278
|
-
}
|
|
275
|
+
per_page?: number;
|
|
279
276
|
});
|
|
280
277
|
|
|
281
278
|
// Get favorite merchant items
|
|
282
279
|
const { data, fetchNextPage, hasNextPage } = useGetFavoriteMerchantItemsInfiniteQuery({
|
|
283
|
-
|
|
284
|
-
merchant_id: number;
|
|
285
|
-
}
|
|
280
|
+
merchant_id: number;
|
|
286
281
|
});
|
|
287
282
|
|
|
288
283
|
// Add to favorites
|
|
@@ -305,9 +300,7 @@ await removeFromFavorite({
|
|
|
305
300
|
```typescript
|
|
306
301
|
// Get chat list
|
|
307
302
|
const { data, fetchNextPage, hasNextPage } = useGetChatsInfiniteQuery({
|
|
308
|
-
|
|
309
|
-
per_page?: number;
|
|
310
|
-
}
|
|
303
|
+
per_page?: number;
|
|
311
304
|
});
|
|
312
305
|
|
|
313
306
|
// Get chat info
|
|
@@ -317,10 +310,8 @@ const { data } = useGetChatInfoQuery({
|
|
|
317
310
|
|
|
318
311
|
// Get chat messages
|
|
319
312
|
const { data, fetchNextPage, hasNextPage } = useGetChatInfiniteQuery({
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
per_page?: number;
|
|
323
|
-
}
|
|
313
|
+
customerChatThreadId: number;
|
|
314
|
+
per_page?: number;
|
|
324
315
|
});
|
|
325
316
|
|
|
326
317
|
// Get single chat message
|
|
@@ -390,13 +381,11 @@ await resendMessage({
|
|
|
390
381
|
```typescript
|
|
391
382
|
// Get notifications
|
|
392
383
|
const { data, fetchNextPage, hasNextPage } = useGetNotificationsInfiniteQuery({
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
'filter[date_to]'?: string;
|
|
399
|
-
}
|
|
384
|
+
per_page?: number;
|
|
385
|
+
'filter[type]'?: string;
|
|
386
|
+
'filter[event]'?: string;
|
|
387
|
+
'filter[date_from]'?: string;
|
|
388
|
+
'filter[date_to]'?: string;
|
|
400
389
|
});
|
|
401
390
|
|
|
402
391
|
// Get single notification
|
|
@@ -432,11 +421,9 @@ await deleteNotification({ notification: number });
|
|
|
432
421
|
```typescript
|
|
433
422
|
// Get stories
|
|
434
423
|
const { data, fetchNextPage, hasNextPage } = useGetStoriesInfiniteQuery({
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
per_page?: number;
|
|
439
|
-
}
|
|
424
|
+
sort_type?: 'created_at' | 'views_count' | 'sort_order' | 'viewed_order';
|
|
425
|
+
sort_direction?: 'asc' | 'desc';
|
|
426
|
+
per_page?: number;
|
|
440
427
|
});
|
|
441
428
|
|
|
442
429
|
// Increase story views
|
|
@@ -449,11 +436,9 @@ await increaseViews({ story: number });
|
|
|
449
436
|
```typescript
|
|
450
437
|
// Get suppliers list
|
|
451
438
|
const { data, fetchNextPage, hasNextPage } = useGetSuppliersInfiniteQuery({
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
filter_buyme_category_ids?: number[];
|
|
456
|
-
}
|
|
439
|
+
per_page?: number;
|
|
440
|
+
search?: string;
|
|
441
|
+
filter_buyme_category_ids?: number[];
|
|
457
442
|
});
|
|
458
443
|
|
|
459
444
|
// Get supplier info
|
|
@@ -463,29 +448,25 @@ const { data } = useGetSupplierInfoQuery({
|
|
|
463
448
|
|
|
464
449
|
// Get supplier articles
|
|
465
450
|
const { data, fetchNextPage, hasNextPage } = useGetSupplierArticlesInfiniteQuery({
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
'filter[date_to]'?: string;
|
|
474
|
-
}
|
|
451
|
+
customer: number;
|
|
452
|
+
per_page?: number;
|
|
453
|
+
'filter[id]'?: number;
|
|
454
|
+
'filter[translations.title]'?: string;
|
|
455
|
+
'filter[translations.content]'?: string;
|
|
456
|
+
'filter[date_from]'?: string;
|
|
457
|
+
'filter[date_to]'?: string;
|
|
475
458
|
});
|
|
476
459
|
|
|
477
460
|
// Get supplier reviews
|
|
478
461
|
const { data, fetchNextPage, hasNextPage } = useGetSupplierReviewsInfiniteQuery({
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
sort_direction?: 'asc' | 'desc';
|
|
488
|
-
}
|
|
462
|
+
supplier_id: number;
|
|
463
|
+
per_page?: number;
|
|
464
|
+
rating?: number;
|
|
465
|
+
has_reply?: boolean;
|
|
466
|
+
date_from?: string;
|
|
467
|
+
date_to?: string;
|
|
468
|
+
sort_by?: 'rating' | 'created_at';
|
|
469
|
+
sort_direction?: 'asc' | 'desc';
|
|
489
470
|
});
|
|
490
471
|
|
|
491
472
|
// Get supplier rating
|
|
@@ -518,33 +499,27 @@ await markAsOld({ supplier: number });
|
|
|
518
499
|
```typescript
|
|
519
500
|
// Get Nova Poshta cities
|
|
520
501
|
const { data, fetchNextPage, hasNextPage } = useGetNovaposhtaCitiesInfiniteQuery({
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
per_page?: number;
|
|
527
|
-
}
|
|
502
|
+
search?: string;
|
|
503
|
+
area?: string;
|
|
504
|
+
settlement_type?: string;
|
|
505
|
+
is_branch?: boolean;
|
|
506
|
+
per_page?: number;
|
|
528
507
|
});
|
|
529
508
|
|
|
530
509
|
// Get Nova Poshta streets
|
|
531
510
|
const { data, fetchNextPage, hasNextPage } = useGetNovaposhtaStreetsInfiniteQuery({
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
per_page?: number;
|
|
537
|
-
}
|
|
511
|
+
search?: string;
|
|
512
|
+
city_ref: string;
|
|
513
|
+
streets_type?: string;
|
|
514
|
+
per_page?: number;
|
|
538
515
|
});
|
|
539
516
|
|
|
540
517
|
// Get Nova Poshta warehouses
|
|
541
518
|
const { data, fetchNextPage, hasNextPage } = useGetNovaposhtaWarehousesInfiniteQuery({
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
per_page?: number;
|
|
547
|
-
}
|
|
519
|
+
search?: string;
|
|
520
|
+
city_ref: string;
|
|
521
|
+
type?: string;
|
|
522
|
+
per_page?: number;
|
|
548
523
|
});
|
|
549
524
|
```
|
|
550
525
|
|
|
@@ -553,21 +528,17 @@ const { data, fetchNextPage, hasNextPage } = useGetNovaposhtaWarehousesInfiniteQ
|
|
|
553
528
|
```typescript
|
|
554
529
|
// Get referral statistics
|
|
555
530
|
const { data, fetchNextPage, hasNextPage } = useGetReferralStatisticsInfiniteQuery({
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
per_page?: number;
|
|
560
|
-
}
|
|
531
|
+
date_from?: string;
|
|
532
|
+
date_to?: string;
|
|
533
|
+
per_page?: number;
|
|
561
534
|
});
|
|
562
535
|
|
|
563
536
|
// Get referral transactions
|
|
564
537
|
const { data, fetchNextPage, hasNextPage } = useGetReferralTransactionsInfiniteQuery({
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
per_page?: number;
|
|
570
|
-
}
|
|
538
|
+
referral_id: number;
|
|
539
|
+
date_from?: string;
|
|
540
|
+
date_to?: string;
|
|
541
|
+
per_page?: number;
|
|
571
542
|
});
|
|
572
543
|
|
|
573
544
|
// Track referral visit
|
|
@@ -587,8 +558,57 @@ const { data } = useGetAdPagesQuery({
|
|
|
587
558
|
|
|
588
559
|
// Get ad platforms
|
|
589
560
|
const { data, fetchNextPage, hasNextPage } = useGetAdPlatformsInfiniteQuery({
|
|
590
|
-
|
|
591
|
-
per_page?: number;
|
|
592
|
-
}
|
|
561
|
+
per_page?: number;
|
|
593
562
|
});
|
|
594
563
|
```
|
|
564
|
+
|
|
565
|
+
## 📋 TypeScript Types
|
|
566
|
+
|
|
567
|
+
The library is fully typed with TypeScript. Main types:
|
|
568
|
+
|
|
569
|
+
```typescript
|
|
570
|
+
interface ApiConfig {
|
|
571
|
+
baseUrl: string;
|
|
572
|
+
prepareHeaders?: (
|
|
573
|
+
headers: Headers,
|
|
574
|
+
api: {
|
|
575
|
+
getState: () => unknown;
|
|
576
|
+
extra: unknown;
|
|
577
|
+
endpoint: string;
|
|
578
|
+
type: 'query' | 'mutation';
|
|
579
|
+
forced?: boolean;
|
|
580
|
+
} & {
|
|
581
|
+
arg: unknown;
|
|
582
|
+
extraOptions: unknown;
|
|
583
|
+
},
|
|
584
|
+
) => Headers | void | Promise<void>;
|
|
585
|
+
onUnauthorized?: () => void;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
enum Session {
|
|
589
|
+
Customer = 'customer',
|
|
590
|
+
Dropshipper = 'dropshipper',
|
|
591
|
+
Supplier = 'supplier',
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
interface PaginatedResponse {
|
|
595
|
+
meta: {
|
|
596
|
+
current_page: number;
|
|
597
|
+
last_page: number;
|
|
598
|
+
per_page: number;
|
|
599
|
+
total: number;
|
|
600
|
+
from: number;
|
|
601
|
+
to: number;
|
|
602
|
+
};
|
|
603
|
+
links: {
|
|
604
|
+
first: string;
|
|
605
|
+
last: string;
|
|
606
|
+
prev: string | null;
|
|
607
|
+
next: string | null;
|
|
608
|
+
};
|
|
609
|
+
}
|
|
610
|
+
```
|
|
611
|
+
|
|
612
|
+
## 📄 License
|
|
613
|
+
|
|
614
|
+
ISC License - see the [LICENSE](LICENSE) file for details.
|
|
@@ -3,6 +3,7 @@ export declare const authApi: import("@reduxjs/toolkit/query").Api<import("@redu
|
|
|
3
3
|
signIn: import("@reduxjs/toolkit/query").MutationDefinition<SignInRequest, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError>, never, SignInResponse, "buymeuaApi", unknown>;
|
|
4
4
|
confirmCode: import("@reduxjs/toolkit/query").MutationDefinition<ConfirmCodeRequest, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError>, never, ConfirmCodeResponse, "buymeuaApi", unknown>;
|
|
5
5
|
signUp: import("@reduxjs/toolkit/query").MutationDefinition<SignUpRequest, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError>, never, SignInResponse, "buymeuaApi", unknown>;
|
|
6
|
+
logout: import("@reduxjs/toolkit/query").MutationDefinition<undefined, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError>, never, undefined, "buymeuaApi", unknown>;
|
|
6
7
|
}, "buymeuaApi", never, typeof import("@reduxjs/toolkit/query").coreModuleName | typeof import("@reduxjs/toolkit/query/react").reactHooksModuleName>;
|
|
7
8
|
export declare const useSignInMutation: <R extends Record<string, any> = ({
|
|
8
9
|
requestId?: undefined;
|
|
@@ -484,5 +485,165 @@ export declare const useSignInMutation: <R extends Record<string, any> = ({
|
|
|
484
485
|
} | undefined) => readonly [(arg: SignUpRequest) => import("@reduxjs/toolkit/query").MutationActionCreatorResult<import("@reduxjs/toolkit/query").MutationDefinition<SignUpRequest, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError>, never, SignInResponse, "buymeuaApi", unknown>>, import("@reduxjs/toolkit/query").TSHelpersNoInfer<R> & {
|
|
485
486
|
originalArgs?: SignUpRequest;
|
|
486
487
|
reset: () => void;
|
|
488
|
+
}], useLogoutMutation: <R extends Record<string, any> = ({
|
|
489
|
+
requestId?: undefined;
|
|
490
|
+
status: import("@reduxjs/toolkit/query").QueryStatus.uninitialized;
|
|
491
|
+
data?: undefined;
|
|
492
|
+
error?: undefined;
|
|
493
|
+
endpointName?: string;
|
|
494
|
+
startedTimeStamp?: undefined;
|
|
495
|
+
fulfilledTimeStamp?: undefined;
|
|
496
|
+
} & {
|
|
497
|
+
status: import("@reduxjs/toolkit/query").QueryStatus.uninitialized;
|
|
498
|
+
isUninitialized: true;
|
|
499
|
+
isLoading: false;
|
|
500
|
+
isSuccess: false;
|
|
501
|
+
isError: false;
|
|
502
|
+
}) | ({
|
|
503
|
+
status: import("@reduxjs/toolkit/query").QueryStatus.fulfilled;
|
|
504
|
+
} & Omit<{
|
|
505
|
+
requestId: string;
|
|
506
|
+
data?: undefined;
|
|
507
|
+
error?: import("@reduxjs/toolkit/query").FetchBaseQueryError | import("@reduxjs/toolkit").SerializedError;
|
|
508
|
+
endpointName: string;
|
|
509
|
+
startedTimeStamp: number;
|
|
510
|
+
fulfilledTimeStamp?: number;
|
|
511
|
+
}, "data" | "fulfilledTimeStamp"> & Required<Pick<{
|
|
512
|
+
requestId: string;
|
|
513
|
+
data?: undefined;
|
|
514
|
+
error?: import("@reduxjs/toolkit/query").FetchBaseQueryError | import("@reduxjs/toolkit").SerializedError;
|
|
515
|
+
endpointName: string;
|
|
516
|
+
startedTimeStamp: number;
|
|
517
|
+
fulfilledTimeStamp?: number;
|
|
518
|
+
}, "data" | "fulfilledTimeStamp">> & {
|
|
519
|
+
error: undefined;
|
|
520
|
+
} & {
|
|
521
|
+
status: import("@reduxjs/toolkit/query").QueryStatus.fulfilled;
|
|
522
|
+
isUninitialized: false;
|
|
523
|
+
isLoading: false;
|
|
524
|
+
isSuccess: true;
|
|
525
|
+
isError: false;
|
|
526
|
+
}) | ({
|
|
527
|
+
status: import("@reduxjs/toolkit/query").QueryStatus.pending;
|
|
528
|
+
} & {
|
|
529
|
+
requestId: string;
|
|
530
|
+
data?: undefined;
|
|
531
|
+
error?: import("@reduxjs/toolkit/query").FetchBaseQueryError | import("@reduxjs/toolkit").SerializedError;
|
|
532
|
+
endpointName: string;
|
|
533
|
+
startedTimeStamp: number;
|
|
534
|
+
fulfilledTimeStamp?: number;
|
|
535
|
+
} & {
|
|
536
|
+
data?: undefined;
|
|
537
|
+
} & {
|
|
538
|
+
status: import("@reduxjs/toolkit/query").QueryStatus.pending;
|
|
539
|
+
isUninitialized: false;
|
|
540
|
+
isLoading: true;
|
|
541
|
+
isSuccess: false;
|
|
542
|
+
isError: false;
|
|
543
|
+
}) | ({
|
|
544
|
+
status: import("@reduxjs/toolkit/query").QueryStatus.rejected;
|
|
545
|
+
} & Omit<{
|
|
546
|
+
requestId: string;
|
|
547
|
+
data?: undefined;
|
|
548
|
+
error?: import("@reduxjs/toolkit/query").FetchBaseQueryError | import("@reduxjs/toolkit").SerializedError;
|
|
549
|
+
endpointName: string;
|
|
550
|
+
startedTimeStamp: number;
|
|
551
|
+
fulfilledTimeStamp?: number;
|
|
552
|
+
}, "error"> & Required<Pick<{
|
|
553
|
+
requestId: string;
|
|
554
|
+
data?: undefined;
|
|
555
|
+
error?: import("@reduxjs/toolkit/query").FetchBaseQueryError | import("@reduxjs/toolkit").SerializedError;
|
|
556
|
+
endpointName: string;
|
|
557
|
+
startedTimeStamp: number;
|
|
558
|
+
fulfilledTimeStamp?: number;
|
|
559
|
+
}, "error">> & {
|
|
560
|
+
status: import("@reduxjs/toolkit/query").QueryStatus.rejected;
|
|
561
|
+
isUninitialized: false;
|
|
562
|
+
isLoading: false;
|
|
563
|
+
isSuccess: false;
|
|
564
|
+
isError: true;
|
|
565
|
+
})>(options?: {
|
|
566
|
+
selectFromResult?: (state: ({
|
|
567
|
+
requestId?: undefined;
|
|
568
|
+
status: import("@reduxjs/toolkit/query").QueryStatus.uninitialized;
|
|
569
|
+
data?: undefined;
|
|
570
|
+
error?: undefined;
|
|
571
|
+
endpointName?: string;
|
|
572
|
+
startedTimeStamp?: undefined;
|
|
573
|
+
fulfilledTimeStamp?: undefined;
|
|
574
|
+
} & {
|
|
575
|
+
status: import("@reduxjs/toolkit/query").QueryStatus.uninitialized;
|
|
576
|
+
isUninitialized: true;
|
|
577
|
+
isLoading: false;
|
|
578
|
+
isSuccess: false;
|
|
579
|
+
isError: false;
|
|
580
|
+
}) | ({
|
|
581
|
+
status: import("@reduxjs/toolkit/query").QueryStatus.fulfilled;
|
|
582
|
+
} & Omit<{
|
|
583
|
+
requestId: string;
|
|
584
|
+
data?: undefined;
|
|
585
|
+
error?: import("@reduxjs/toolkit/query").FetchBaseQueryError | import("@reduxjs/toolkit").SerializedError;
|
|
586
|
+
endpointName: string;
|
|
587
|
+
startedTimeStamp: number;
|
|
588
|
+
fulfilledTimeStamp?: number;
|
|
589
|
+
}, "data" | "fulfilledTimeStamp"> & Required<Pick<{
|
|
590
|
+
requestId: string;
|
|
591
|
+
data?: undefined;
|
|
592
|
+
error?: import("@reduxjs/toolkit/query").FetchBaseQueryError | import("@reduxjs/toolkit").SerializedError;
|
|
593
|
+
endpointName: string;
|
|
594
|
+
startedTimeStamp: number;
|
|
595
|
+
fulfilledTimeStamp?: number;
|
|
596
|
+
}, "data" | "fulfilledTimeStamp">> & {
|
|
597
|
+
error: undefined;
|
|
598
|
+
} & {
|
|
599
|
+
status: import("@reduxjs/toolkit/query").QueryStatus.fulfilled;
|
|
600
|
+
isUninitialized: false;
|
|
601
|
+
isLoading: false;
|
|
602
|
+
isSuccess: true;
|
|
603
|
+
isError: false;
|
|
604
|
+
}) | ({
|
|
605
|
+
status: import("@reduxjs/toolkit/query").QueryStatus.pending;
|
|
606
|
+
} & {
|
|
607
|
+
requestId: string;
|
|
608
|
+
data?: undefined;
|
|
609
|
+
error?: import("@reduxjs/toolkit/query").FetchBaseQueryError | import("@reduxjs/toolkit").SerializedError;
|
|
610
|
+
endpointName: string;
|
|
611
|
+
startedTimeStamp: number;
|
|
612
|
+
fulfilledTimeStamp?: number;
|
|
613
|
+
} & {
|
|
614
|
+
data?: undefined;
|
|
615
|
+
} & {
|
|
616
|
+
status: import("@reduxjs/toolkit/query").QueryStatus.pending;
|
|
617
|
+
isUninitialized: false;
|
|
618
|
+
isLoading: true;
|
|
619
|
+
isSuccess: false;
|
|
620
|
+
isError: false;
|
|
621
|
+
}) | ({
|
|
622
|
+
status: import("@reduxjs/toolkit/query").QueryStatus.rejected;
|
|
623
|
+
} & Omit<{
|
|
624
|
+
requestId: string;
|
|
625
|
+
data?: undefined;
|
|
626
|
+
error?: import("@reduxjs/toolkit/query").FetchBaseQueryError | import("@reduxjs/toolkit").SerializedError;
|
|
627
|
+
endpointName: string;
|
|
628
|
+
startedTimeStamp: number;
|
|
629
|
+
fulfilledTimeStamp?: number;
|
|
630
|
+
}, "error"> & Required<Pick<{
|
|
631
|
+
requestId: string;
|
|
632
|
+
data?: undefined;
|
|
633
|
+
error?: import("@reduxjs/toolkit/query").FetchBaseQueryError | import("@reduxjs/toolkit").SerializedError;
|
|
634
|
+
endpointName: string;
|
|
635
|
+
startedTimeStamp: number;
|
|
636
|
+
fulfilledTimeStamp?: number;
|
|
637
|
+
}, "error">> & {
|
|
638
|
+
status: import("@reduxjs/toolkit/query").QueryStatus.rejected;
|
|
639
|
+
isUninitialized: false;
|
|
640
|
+
isLoading: false;
|
|
641
|
+
isSuccess: false;
|
|
642
|
+
isError: true;
|
|
643
|
+
})) => R;
|
|
644
|
+
fixedCacheKey?: string;
|
|
645
|
+
} | undefined) => readonly [(arg: undefined) => import("@reduxjs/toolkit/query").MutationActionCreatorResult<import("@reduxjs/toolkit/query").MutationDefinition<undefined, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError>, never, undefined, "buymeuaApi", unknown>>, import("@reduxjs/toolkit/query").TSHelpersNoInfer<R> & {
|
|
646
|
+
originalArgs?: undefined;
|
|
647
|
+
reset: () => void;
|
|
487
648
|
}];
|
|
488
649
|
//# sourceMappingURL=authApi.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authApi.d.ts","sourceRoot":"","sources":["../../../../src/entities/auth/api/authApi.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"authApi.d.ts","sourceRoot":"","sources":["../../../../src/entities/auth/api/authApi.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EAGnB,aAAa,EACb,cAAc,EACd,aAAa,EAEd,MAAM,gBAAgB,CAAC;AAKxB,eAAO,MAAM,OAAO;;;;;oJAuClB,CAAC;AAEH,eAAO,MACL,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IACjB,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IACtB,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IACjB,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EACR,CAAC"}
|
|
@@ -27,7 +27,13 @@ export const authApi = buymeuaApi.injectEndpoints({
|
|
|
27
27
|
body: { ...arg },
|
|
28
28
|
}),
|
|
29
29
|
}),
|
|
30
|
+
logout: build.mutation({
|
|
31
|
+
query: (_arg) => ({
|
|
32
|
+
url: 'v1/auth/logout',
|
|
33
|
+
method: 'POST',
|
|
34
|
+
}),
|
|
35
|
+
}),
|
|
30
36
|
}),
|
|
31
37
|
});
|
|
32
|
-
export const { useSignInMutation, useConfirmCodeMutation, useSignUpMutation } = authApi;
|
|
38
|
+
export const { useSignInMutation, useConfirmCodeMutation, useSignUpMutation, useLogoutMutation, } = authApi;
|
|
33
39
|
//# sourceMappingURL=authApi.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authApi.js","sourceRoot":"","sources":["../../../../src/entities/auth/api/authApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"authApi.js","sourceRoot":"","sources":["../../../../src/entities/auth/api/authApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAYjD,iBAAiB;AACjB,0BAA0B;AAE1B,MAAM,CAAC,MAAM,OAAO,GAAG,UAAU,CAAC,eAAe,CAAC;IAChD,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACrB,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAgC;YACpD,KAAK,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;gBACf,GAAG,EAAE,eAAe;gBACpB,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,EAAE,GAAG,GAAG,EAAE;aACjB,CAAC;SACH,CAAC;QAEF,WAAW,EAAE,KAAK,CAAC,QAAQ,CAA0C;YACnE,KAAK,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;gBACf,GAAG,EAAE,sBAAsB;gBAC3B,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,EAAE,GAAG,GAAG,EAAE;aACjB,CAAC;YAEF,iBAAiB,EAAE,CAAC,oBAEnB,EAAE,EAAE;gBACH,OAAO,oBAAoB,CAAC,IAAI,CAAC;YACnC,CAAC;SACF,CAAC;QAEF,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAgC;YACpD,KAAK,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;gBACf,GAAG,EAAE,kBAAkB;gBACvB,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,EAAE,GAAG,GAAG,EAAE;aACjB,CAAC;SACH,CAAC;QAEF,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAgC;YACpD,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;gBAChB,GAAG,EAAE,gBAAgB;gBACrB,MAAM,EAAE,MAAM;aACf,CAAC;SACH,CAAC;KACH,CAAC;CACH,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,EACX,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,GAClB,GAAG,OAAO,CAAC"}
|