buymeua-api-fe 0.11.0 → 0.13.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/CHANGELOG.md +28 -0
- package/README.md +79 -0
- package/dist/entities/favorite/api/favoriteApi.d.ts +6 -4
- package/dist/entities/favorite/api/favoriteApi.d.ts.map +1 -1
- package/dist/entities/order/api/orderApi.d.ts +721 -0
- package/dist/entities/order/api/orderApi.d.ts.map +1 -0
- package/dist/entities/order/api/orderApi.js +56 -0
- package/dist/entities/order/api/orderApi.js.map +1 -0
- package/dist/entities/order/index.d.ts +3 -0
- package/dist/entities/order/index.d.ts.map +1 -0
- package/dist/entities/order/index.js +3 -0
- package/dist/entities/order/index.js.map +1 -0
- package/dist/entities/order/model/types.d.ts +67 -0
- package/dist/entities/order/model/types.d.ts.map +1 -0
- package/dist/entities/order/model/types.js +1 -0
- package/dist/entities/order/model/types.js.map +1 -0
- package/dist/entities/product/api/productApi.d.ts +568 -198
- package/dist/entities/product/api/productApi.d.ts.map +1 -1
- package/dist/entities/product/api/productApi.js +15 -1
- package/dist/entities/product/api/productApi.js.map +1 -1
- package/dist/entities/product/model/types.d.ts +49 -0
- package/dist/entities/product/model/types.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orderApi.d.ts","sourceRoot":"","sources":["../../../../src/entities/order/api/orderApi.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,qBAAqB,EACrB,sBAAsB,EACtB,kBAAkB,EAClB,mBAAmB,EACnB,yBAAyB,EACzB,0BAA0B,EAC1B,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,gBAAgB,CAAC;AAIxB,eAAO,MAAM,QAAQ;;;;;uLAgEjB,CAAC;AAEL,eAAO,MACL,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GACtB,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAC1B,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GACzB,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EACZ,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { buymeuaApi } from '../../../shared/api';
|
|
2
|
+
// TODO: Add v1, v2, v3, v4 order endpoints
|
|
3
|
+
export const orderApi = buymeuaApi
|
|
4
|
+
.injectEndpoints({
|
|
5
|
+
endpoints: (build) => ({
|
|
6
|
+
checkTelephone: build.query({
|
|
7
|
+
query: (arg) => ({
|
|
8
|
+
url: 'v4/order/check-telephone',
|
|
9
|
+
params: arg,
|
|
10
|
+
}),
|
|
11
|
+
}),
|
|
12
|
+
getDeliveryMethods: build.query({
|
|
13
|
+
query: (arg) => ({
|
|
14
|
+
url: 'v4/order/delivery-methods',
|
|
15
|
+
params: arg,
|
|
16
|
+
}),
|
|
17
|
+
}),
|
|
18
|
+
getPaymentMethods: build.query({
|
|
19
|
+
query: (arg) => ({
|
|
20
|
+
url: 'v4/order/payment-methods',
|
|
21
|
+
params: arg,
|
|
22
|
+
}),
|
|
23
|
+
}),
|
|
24
|
+
createOrder: build.mutation({
|
|
25
|
+
query: (arg) => ({
|
|
26
|
+
url: 'v4/order',
|
|
27
|
+
method: 'POST',
|
|
28
|
+
body: arg,
|
|
29
|
+
}),
|
|
30
|
+
}),
|
|
31
|
+
}),
|
|
32
|
+
overrideExisting: false,
|
|
33
|
+
})
|
|
34
|
+
.enhanceEndpoints({
|
|
35
|
+
addTagTypes: ['PaymentMethod'],
|
|
36
|
+
endpoints: {
|
|
37
|
+
getPaymentMethods: {
|
|
38
|
+
providesTags: (result, _error, _arg, _meta) => {
|
|
39
|
+
return result
|
|
40
|
+
? [
|
|
41
|
+
...result.data.map((paymentMethod) => ({
|
|
42
|
+
type: 'PaymentMethod',
|
|
43
|
+
id: paymentMethod.id,
|
|
44
|
+
})),
|
|
45
|
+
{
|
|
46
|
+
type: 'PaymentMethod',
|
|
47
|
+
id: 'LIST',
|
|
48
|
+
},
|
|
49
|
+
]
|
|
50
|
+
: [{ type: 'PaymentMethod', id: 'LIST' }];
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
export const { useCheckTelephoneQuery, useGetDeliveryMethodsQuery, useGetPaymentMethodsQuery, useCreateOrderMutation, } = orderApi;
|
|
56
|
+
//# sourceMappingURL=orderApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orderApi.js","sourceRoot":"","sources":["../../../../src/entities/order/api/orderApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAYjD,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a,CAAC,EAAE;yBACrB,CAAC,CAAC;wBACH;4BACE,IAAI,EAAE,eAAe;4BACrB,EAAE,EAAE,MAAM;yBACX;qBACF;oBACH,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;YAC9C,CAAC;SACF;KACF;CACF,CAAC,CAAC;AAEL,MAAM,CAAC,MAAM,EACX,sBAAsB,EACtB,0BAA0B,EAC1B,yBAAyB,EACzB,sBAAsB,GACvB,GAAG,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/entities/order/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAE/B,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/entities/order/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAE/B,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export interface CheckTelephoneRequest {
|
|
2
|
+
telephone: string;
|
|
3
|
+
}
|
|
4
|
+
export interface CheckTelephoneResponse {
|
|
5
|
+
black_list: {
|
|
6
|
+
reason: string;
|
|
7
|
+
link: string;
|
|
8
|
+
instagram: string;
|
|
9
|
+
} | null;
|
|
10
|
+
duplicate: {
|
|
11
|
+
message: string;
|
|
12
|
+
count: number;
|
|
13
|
+
} | null;
|
|
14
|
+
}
|
|
15
|
+
export interface DeliveryMethod {
|
|
16
|
+
id: number;
|
|
17
|
+
code: string;
|
|
18
|
+
name: string;
|
|
19
|
+
icon: string;
|
|
20
|
+
}
|
|
21
|
+
export interface GetDeliveryMethodsRequest {
|
|
22
|
+
merchant_id: number;
|
|
23
|
+
}
|
|
24
|
+
export interface GetDeliveryMethodsResponse {
|
|
25
|
+
data: DeliveryMethod[];
|
|
26
|
+
}
|
|
27
|
+
export type PaymentMethod = DeliveryMethod;
|
|
28
|
+
export interface GetPaymentMethodsRequest {
|
|
29
|
+
merchant_id: number;
|
|
30
|
+
custom_ttn?: string;
|
|
31
|
+
delivery_method_code?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface GetPaymentMethodsResponse {
|
|
34
|
+
data: PaymentMethod[];
|
|
35
|
+
}
|
|
36
|
+
export interface CreateOrderRequest {
|
|
37
|
+
merchant_id: number;
|
|
38
|
+
payment_method_code: string;
|
|
39
|
+
delivery_method_code?: string;
|
|
40
|
+
custom_ttn?: string;
|
|
41
|
+
firstname?: string;
|
|
42
|
+
lastname?: string;
|
|
43
|
+
middlename?: string;
|
|
44
|
+
telephone?: string;
|
|
45
|
+
email?: string;
|
|
46
|
+
comment?: string;
|
|
47
|
+
city_ref?: string;
|
|
48
|
+
warehouse_ref?: string;
|
|
49
|
+
shipping_street_id?: number;
|
|
50
|
+
shipping_house?: string;
|
|
51
|
+
shipping_flat?: string;
|
|
52
|
+
country_id?: number;
|
|
53
|
+
city?: string;
|
|
54
|
+
address?: string;
|
|
55
|
+
total_pay?: number;
|
|
56
|
+
custom_customer_id?: number;
|
|
57
|
+
category_order_id?: number;
|
|
58
|
+
ad_platform_page_id?: number;
|
|
59
|
+
ad_new_client?: boolean;
|
|
60
|
+
}
|
|
61
|
+
export interface CreateOrderResponse {
|
|
62
|
+
status: number;
|
|
63
|
+
order_status_id: number;
|
|
64
|
+
payment: number;
|
|
65
|
+
ttn: string;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/entities/order/model/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAC;CACnB;AACD,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE;QACV,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,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,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AACD,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;CACb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/entities/order/model/types.ts"],"names":[],"mappings":""}
|