@mivis/petmart-api 1.1.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/index.js +1 -0
- package/package.json +11 -0
- package/type.d.ts +198 -0
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// is empty
|
package/package.json
ADDED
package/type.d.ts
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
declare namespace Components {
|
|
2
|
+
namespace Schemas {
|
|
3
|
+
export interface ICodeRequestDto {
|
|
4
|
+
tel: string;
|
|
5
|
+
}
|
|
6
|
+
export interface IAuthRequest {
|
|
7
|
+
token: string;
|
|
8
|
+
code: string;
|
|
9
|
+
}
|
|
10
|
+
export interface IAppleAuthRequest {
|
|
11
|
+
email: string;
|
|
12
|
+
tel: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface IAuthResponse {
|
|
16
|
+
message: string;
|
|
17
|
+
token: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type ISecureCheckCodeRequest = IAuthRequest;
|
|
21
|
+
|
|
22
|
+
export type IAppleAuthResponse = IAuthResponse;
|
|
23
|
+
|
|
24
|
+
export type ICodeResponse = IAuthResponse;
|
|
25
|
+
|
|
26
|
+
export type ISecureAuthResponse = IAuthResponse;
|
|
27
|
+
|
|
28
|
+
export interface IUser {
|
|
29
|
+
_id: string;
|
|
30
|
+
tel: number;
|
|
31
|
+
photo: string;
|
|
32
|
+
name: string;
|
|
33
|
+
sex: string;
|
|
34
|
+
birthday: Date;
|
|
35
|
+
desc: string;
|
|
36
|
+
country: string;
|
|
37
|
+
email: string;
|
|
38
|
+
role: 'admin' | 'user';
|
|
39
|
+
password: string;
|
|
40
|
+
createdDate: Date;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface IAddress {
|
|
44
|
+
_id: string;
|
|
45
|
+
owner: string;
|
|
46
|
+
address: string;
|
|
47
|
+
floor: number;
|
|
48
|
+
intercom: number;
|
|
49
|
+
entrance: number;
|
|
50
|
+
index: number;
|
|
51
|
+
flat: number;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface IUpdateUser {
|
|
55
|
+
name: string;
|
|
56
|
+
desc: string;
|
|
57
|
+
tel: string;
|
|
58
|
+
photo: string;
|
|
59
|
+
email: string;
|
|
60
|
+
birthday: string;
|
|
61
|
+
country: string;
|
|
62
|
+
sex: 'Мужской' | 'Женский';
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface ICreateAddress {
|
|
66
|
+
userId: string;
|
|
67
|
+
floor: number;
|
|
68
|
+
intercom: number;
|
|
69
|
+
entrance: number;
|
|
70
|
+
index: number;
|
|
71
|
+
flat: number;
|
|
72
|
+
address: string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface IUpdateAddress {
|
|
76
|
+
id: string;
|
|
77
|
+
floor: number;
|
|
78
|
+
intercom: number;
|
|
79
|
+
entrance: number;
|
|
80
|
+
index: number;
|
|
81
|
+
flat: number;
|
|
82
|
+
address: string;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export interface IProduct {
|
|
86
|
+
_id: string;
|
|
87
|
+
owner: string;
|
|
88
|
+
company: string;
|
|
89
|
+
photo: string[];
|
|
90
|
+
weight: number[];
|
|
91
|
+
name: string;
|
|
92
|
+
rate: number;
|
|
93
|
+
desc: string;
|
|
94
|
+
compound: object[];
|
|
95
|
+
category: string;
|
|
96
|
+
price: number[];
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export interface IProductResponseWithCategory {
|
|
100
|
+
_id: string;
|
|
101
|
+
owner: string;
|
|
102
|
+
company: string;
|
|
103
|
+
photo: string[];
|
|
104
|
+
weight: number[];
|
|
105
|
+
name: string;
|
|
106
|
+
rate: number;
|
|
107
|
+
desc: string;
|
|
108
|
+
compound: object[];
|
|
109
|
+
category: {
|
|
110
|
+
_id: string;
|
|
111
|
+
name: string;
|
|
112
|
+
};
|
|
113
|
+
price: number[];
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export interface ICreateProduct {
|
|
117
|
+
owner: string;
|
|
118
|
+
company: string;
|
|
119
|
+
photo: File;
|
|
120
|
+
weight: number[];
|
|
121
|
+
name: string;
|
|
122
|
+
desc: string;
|
|
123
|
+
compound: object[];
|
|
124
|
+
category: string;
|
|
125
|
+
price: number[];
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export interface IUpdateProduct extends ICreateProduct {
|
|
129
|
+
id: string;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export interface ICreateCart {
|
|
133
|
+
product: IProduct;
|
|
134
|
+
variation: IVariation;
|
|
135
|
+
count: number;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export interface IVariation {
|
|
139
|
+
weight: number;
|
|
140
|
+
price: number;
|
|
141
|
+
}
|
|
142
|
+
export interface ICart {
|
|
143
|
+
_id: string;
|
|
144
|
+
owner: string;
|
|
145
|
+
product: {
|
|
146
|
+
_id: string;
|
|
147
|
+
name: string;
|
|
148
|
+
photo: string[];
|
|
149
|
+
};
|
|
150
|
+
count: number;
|
|
151
|
+
variation: IVariation[];
|
|
152
|
+
status: string;
|
|
153
|
+
date: Date;
|
|
154
|
+
deliveryDate: Date;
|
|
155
|
+
orderNumber: string;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export interface ICategory {
|
|
159
|
+
_id: string;
|
|
160
|
+
name: string;
|
|
161
|
+
photo: string;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export interface ICreateCategory {
|
|
165
|
+
name: string;
|
|
166
|
+
photo: File;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export interface IUpdateCategory extends ICreateCategory {
|
|
170
|
+
id: string;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export type OrderItems = Pick<ICart, 'product' | 'count'>;
|
|
174
|
+
|
|
175
|
+
export type OrderAddress = Omit<IAddress, 'owner'>;
|
|
176
|
+
|
|
177
|
+
export interface ICreateOrder {
|
|
178
|
+
orderItems: OrderItems;
|
|
179
|
+
price: number;
|
|
180
|
+
address: OrderAddress;
|
|
181
|
+
name: string;
|
|
182
|
+
tel: string;
|
|
183
|
+
user?: string;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export interface IOrder {
|
|
187
|
+
user: string;
|
|
188
|
+
orderItems: OrderItems[];
|
|
189
|
+
date: Date;
|
|
190
|
+
price: number;
|
|
191
|
+
owner: string;
|
|
192
|
+
tel: number;
|
|
193
|
+
address: IAddress;
|
|
194
|
+
status: number;
|
|
195
|
+
orderNumber: number;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|