shopoflex-types 1.0.39 → 1.0.41
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/index.d.ts +9 -1
- package/dist/index.js +15 -1
- package/dist/types/api.d.ts +57 -0
- package/dist/types/api.js +4 -0
- package/dist/types/cart.d.ts +58 -0
- package/dist/types/cart.js +4 -0
- package/dist/types/common.d.ts +0 -557
- package/dist/types/common.js +2 -0
- package/dist/types/discount.d.ts +28 -0
- package/dist/types/discount.js +4 -0
- package/dist/types/enums.d.ts +16 -0
- package/dist/types/enums.js +23 -0
- package/dist/types/notification.d.ts +15 -0
- package/dist/types/notification.js +4 -0
- package/dist/types/order.d.ts +55 -0
- package/dist/types/order.js +4 -0
- package/dist/types/prods.d.ts +294 -0
- package/dist/types/prods.js +4 -0
- package/dist/types/product.d.ts +100 -0
- package/dist/types/product.js +4 -0
- package/dist/types/state.d.ts +23 -0
- package/dist/types/state.js +4 -0
- package/dist/types/user.d.ts +61 -0
- package/dist/types/user.js +4 -0
- package/dist/types/vendor.d.ts +159 -0
- package/dist/types/vendor.js +4 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1 +1,9 @@
|
|
|
1
|
-
export * from './types/
|
|
1
|
+
export * from './types/enums';
|
|
2
|
+
export * from './types/prods';
|
|
3
|
+
export * from './types/discount';
|
|
4
|
+
export * from './types/order';
|
|
5
|
+
export * from './types/user';
|
|
6
|
+
export * from './types/vendor';
|
|
7
|
+
export * from './types/notification';
|
|
8
|
+
export * from './types/state';
|
|
9
|
+
export * from './types/api';
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
// types/index.ts
|
|
3
|
+
// Main export file for all types
|
|
2
4
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
5
|
if (k2 === undefined) k2 = k;
|
|
4
6
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -14,4 +16,16 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
16
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
17
|
};
|
|
16
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
19
|
+
// Common types
|
|
20
|
+
__exportStar(require("./types/enums"), exports);
|
|
21
|
+
// Domain-specific types
|
|
22
|
+
__exportStar(require("./types/prods"), exports);
|
|
23
|
+
__exportStar(require("./types/discount"), exports);
|
|
24
|
+
__exportStar(require("./types/order"), exports);
|
|
25
|
+
__exportStar(require("./types/user"), exports);
|
|
26
|
+
__exportStar(require("./types/vendor"), exports);
|
|
27
|
+
__exportStar(require("./types/notification"), exports);
|
|
28
|
+
// Application state types
|
|
29
|
+
__exportStar(require("./types/state"), exports);
|
|
30
|
+
// API and utility types
|
|
31
|
+
__exportStar(require("./types/api"), exports);
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export interface PaginationQuery {
|
|
2
|
+
page?: string;
|
|
3
|
+
limit?: string;
|
|
4
|
+
sortBy?: string;
|
|
5
|
+
sortOrder?: 'asc' | 'desc';
|
|
6
|
+
search?: string;
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
}
|
|
9
|
+
export interface PaginationOptions {
|
|
10
|
+
page: number;
|
|
11
|
+
limit: number;
|
|
12
|
+
skip: number;
|
|
13
|
+
sortBy: string;
|
|
14
|
+
sortOrder: 'asc' | 'desc';
|
|
15
|
+
filters: Record<string, any>;
|
|
16
|
+
search?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface PaginatedResponse<T> {
|
|
19
|
+
data: T[];
|
|
20
|
+
pagination: {
|
|
21
|
+
currentPage: number;
|
|
22
|
+
totalPages: number;
|
|
23
|
+
totalItems: number;
|
|
24
|
+
hasNextPage: boolean;
|
|
25
|
+
hasPrevPage: boolean;
|
|
26
|
+
limit: number;
|
|
27
|
+
};
|
|
28
|
+
filters?: Record<string, any>;
|
|
29
|
+
sort?: {
|
|
30
|
+
sortBy: string;
|
|
31
|
+
sortOrder: 'asc' | 'desc';
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export interface FilterConfig {
|
|
35
|
+
[key: string]: {
|
|
36
|
+
type: 'string' | 'number' | 'boolean' | 'date' | 'array' | 'objectId';
|
|
37
|
+
operator?: 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'nin' | 'regex' | 'exists';
|
|
38
|
+
transform?: (value: any) => any;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export interface SortConfig {
|
|
42
|
+
allowedFields: string[];
|
|
43
|
+
defaultField: string;
|
|
44
|
+
defaultOrder: 'asc' | 'desc';
|
|
45
|
+
}
|
|
46
|
+
export interface SearchConfig {
|
|
47
|
+
fields: string[];
|
|
48
|
+
caseSensitive?: boolean;
|
|
49
|
+
}
|
|
50
|
+
export interface successResponse {
|
|
51
|
+
data: any[];
|
|
52
|
+
totalPages: number;
|
|
53
|
+
currentPage: number;
|
|
54
|
+
count: number;
|
|
55
|
+
hasNextPage: boolean;
|
|
56
|
+
hasPrevPage: boolean;
|
|
57
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { FileType } from './common';
|
|
2
|
+
import { Customer } from './user';
|
|
3
|
+
import { Discount } from './discount';
|
|
4
|
+
export interface sModifier {
|
|
5
|
+
listName: string;
|
|
6
|
+
options: {
|
|
7
|
+
addonId: string;
|
|
8
|
+
optionName: string;
|
|
9
|
+
price: number;
|
|
10
|
+
quantity: number;
|
|
11
|
+
}[];
|
|
12
|
+
total: number;
|
|
13
|
+
}
|
|
14
|
+
export interface CartItem {
|
|
15
|
+
_id?: string;
|
|
16
|
+
categoriesIds: string[];
|
|
17
|
+
price: number;
|
|
18
|
+
quantity: number;
|
|
19
|
+
name?: {
|
|
20
|
+
en?: string;
|
|
21
|
+
ar?: string;
|
|
22
|
+
};
|
|
23
|
+
selectedModifiers?: {
|
|
24
|
+
lists?: sModifier[];
|
|
25
|
+
overallTotal?: number;
|
|
26
|
+
};
|
|
27
|
+
finalPrice?: number;
|
|
28
|
+
files?: FileType[];
|
|
29
|
+
}
|
|
30
|
+
export interface Cart {
|
|
31
|
+
_id?: string;
|
|
32
|
+
items: CartItem[];
|
|
33
|
+
subtotal: number;
|
|
34
|
+
totalQuantity: number;
|
|
35
|
+
discount: number;
|
|
36
|
+
delivery: number;
|
|
37
|
+
total: number;
|
|
38
|
+
}
|
|
39
|
+
export interface CartState {
|
|
40
|
+
items: CartItem[];
|
|
41
|
+
subtotal: number;
|
|
42
|
+
totalQuantity: number;
|
|
43
|
+
discount: number;
|
|
44
|
+
delivery: number;
|
|
45
|
+
total: number;
|
|
46
|
+
promoCode?: Discount;
|
|
47
|
+
}
|
|
48
|
+
export interface CartModelType extends Cart {
|
|
49
|
+
customer: Customer | any;
|
|
50
|
+
vendorId: String | any;
|
|
51
|
+
_id?: string;
|
|
52
|
+
items: CartItem[];
|
|
53
|
+
subtotal: number;
|
|
54
|
+
totalQuantity: number;
|
|
55
|
+
discount: number;
|
|
56
|
+
delivery: number;
|
|
57
|
+
total: number;
|
|
58
|
+
}
|