@stacksjs/commerce 0.69.2 → 0.70.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/dist/coupons.test.d.ts +86 -0
- package/dist/customers.test.d.ts +61 -0
- package/dist/destroy.d.ts +2 -0
- package/dist/export.d.ts +16 -0
- package/dist/fetch.d.ts +10 -0
- package/dist/gift-cards.test.d.ts +70 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3891 -1
- package/dist/manufacturers.test.d.ts +77 -0
- package/dist/orders.test.d.ts +27 -0
- package/dist/payments.test.d.ts +73 -0
- package/dist/reviews.test.d.ts +102 -0
- package/dist/store.d.ts +6 -0
- package/dist/types.d.ts +261 -0
- package/dist/units.test.d.ts +131 -0
- package/dist/update.d.ts +5 -0
- package/dist/variants.test.d.ts +131 -0
- package/package.json +5 -2
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
declare const manufacturerName: unknown;
|
|
2
|
+
declare const request: unknown;
|
|
3
|
+
declare const manufacturerId: undefined if (manufacturerId);
|
|
4
|
+
declare const manufacturerName: unknown;
|
|
5
|
+
declare const firstRequest: unknown;
|
|
6
|
+
declare const secondManufacturerData: {
|
|
7
|
+
manufacturer: unknown;
|
|
8
|
+
'
|
|
9
|
+
description': 'Second test description';
|
|
10
|
+
country: 'Canada'
|
|
11
|
+
};
|
|
12
|
+
declare const secondRequest: unknown;
|
|
13
|
+
declare const errorMessage: unknown;
|
|
14
|
+
declare const manufacturerName: unknown;
|
|
15
|
+
declare const request: unknown;
|
|
16
|
+
declare const baseTime: unknown;
|
|
17
|
+
declare const createdCount: unknown;
|
|
18
|
+
declare const manufacturers: (...args: any[]) => unknown;
|
|
19
|
+
declare const createdCount: unknown;
|
|
20
|
+
declare const manufacturerName: unknown;
|
|
21
|
+
declare const request: undefined;
|
|
22
|
+
declare const fetchedManufacturer: unknown;
|
|
23
|
+
declare const baseTime: unknown;
|
|
24
|
+
declare const request: unknown;
|
|
25
|
+
declare const nonFeaturedRequest: unknown;
|
|
26
|
+
declare const featuredManufacturers: (...args: any[]) => unknown;
|
|
27
|
+
declare const baseTime: unknown;
|
|
28
|
+
declare const request: unknown;
|
|
29
|
+
declare const otherRequest: unknown;
|
|
30
|
+
declare const result: unknown;
|
|
31
|
+
declare const page2: unknown;
|
|
32
|
+
declare const baseTime: unknown;
|
|
33
|
+
declare const requestData2: {
|
|
34
|
+
manufacturer: `ProductCount Manufacturer 2 ${baseTime}`;
|
|
35
|
+
description: 'Not featured';
|
|
36
|
+
country: 'Canada';
|
|
37
|
+
featured: false
|
|
38
|
+
};
|
|
39
|
+
declare const featuredResults: unknown;
|
|
40
|
+
declare const manufacturerName: unknown;
|
|
41
|
+
declare const createRequest: undefined;
|
|
42
|
+
declare const updateData: {
|
|
43
|
+
description: 'Updated description';
|
|
44
|
+
country: 'Australia';
|
|
45
|
+
featured: true
|
|
46
|
+
};
|
|
47
|
+
declare const updateRequest: unknown;
|
|
48
|
+
declare const name1: `Update Conflict 1 ${Date.now()}` const name2 = `Update Conflict 2 ${Date.now()}`;
|
|
49
|
+
declare const firstManufacturerData: {
|
|
50
|
+
manufacturer: unknown;
|
|
51
|
+
description: 'First test description';
|
|
52
|
+
country: 'UK'
|
|
53
|
+
};
|
|
54
|
+
declare const firstRequest: undefined expect(firstManufacturerId).toBeDefined();
|
|
55
|
+
declare const secondManufacturerData: {
|
|
56
|
+
manufacturer: unknown;
|
|
57
|
+
description: 'Second test description';
|
|
58
|
+
country: 'UK'
|
|
59
|
+
};
|
|
60
|
+
declare const secondRequest: undefined expect(secondManufacturerId).toBeDefined();
|
|
61
|
+
declare const updateData: {
|
|
62
|
+
manufacturer: unknown
|
|
63
|
+
};
|
|
64
|
+
declare const updateRequest: unknown;
|
|
65
|
+
declare const errorMessage: unknown;
|
|
66
|
+
declare const nonExistentId: unknown;
|
|
67
|
+
declare const updateRequest: unknown;
|
|
68
|
+
declare const manufacturerName: unknown;
|
|
69
|
+
declare const request: undefined;
|
|
70
|
+
declare const updatedManufacturer: unknown;
|
|
71
|
+
declare const toggledManufacturer: unknown;
|
|
72
|
+
declare const manufacturerName: unknown;
|
|
73
|
+
declare const request: undefined;
|
|
74
|
+
declare const result: unknown;
|
|
75
|
+
declare const manufacturers: Array<]
|
|
76
|
+
const manufacturerIds = [>;
|
|
77
|
+
declare let baseTime: (...args: any[]) => unknown;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
declare function createTestOrder(orderData): void;
|
|
2
|
+
declare const uniqueAddress: unknown;
|
|
3
|
+
declare const orderId: unknown;
|
|
4
|
+
declare const fetchedOrder: unknown;
|
|
5
|
+
declare const orders: unknown;
|
|
6
|
+
declare const pendingOrder: unknown;
|
|
7
|
+
declare const deliveryOrder: unknown;
|
|
8
|
+
declare const stats: unknown;
|
|
9
|
+
declare const comparison: unknown;
|
|
10
|
+
declare const order: unknown;
|
|
11
|
+
declare const order: unknown;
|
|
12
|
+
declare const result: unknown;
|
|
13
|
+
declare const order: unknown;
|
|
14
|
+
declare const result: unknown;
|
|
15
|
+
declare const order1: unknown;
|
|
16
|
+
declare const orderIds: Array<unknown | unknown | unknown>;
|
|
17
|
+
declare const deletedCount: unknown;
|
|
18
|
+
declare const fetchedOrder: unknown;
|
|
19
|
+
declare const deletedCount: unknown;
|
|
20
|
+
declare const order1: unknown;
|
|
21
|
+
declare const orderIds: Array<unknown | unknown | unknown>;
|
|
22
|
+
declare const updatedCount: unknown;
|
|
23
|
+
declare const fetchedOrder: unknown;
|
|
24
|
+
declare const updatedCount: unknown;
|
|
25
|
+
declare const order: unknown;
|
|
26
|
+
declare const result: unknown;
|
|
27
|
+
declare const fetchedOrder: unknown;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
declare function fetchById(id: number): void;
|
|
2
|
+
declare function fetchByTransactionId(transactionId: string): void;
|
|
3
|
+
declare const uniqueTransactionId: unknown;
|
|
4
|
+
declare const request: unknown;
|
|
5
|
+
declare const paymentId: undefined if (paymentId);
|
|
6
|
+
declare const uniqueTransactionId: unknown;
|
|
7
|
+
declare const request: unknown;
|
|
8
|
+
declare const duplicateTransactionId: unknown;
|
|
9
|
+
declare const firstRequest: unknown;
|
|
10
|
+
declare const secondPaymentData: {
|
|
11
|
+
order_id: 4;
|
|
12
|
+
user_id: 4;
|
|
13
|
+
amount: 50;
|
|
14
|
+
method: 'credit_card';
|
|
15
|
+
transaction_id: unknown
|
|
16
|
+
};
|
|
17
|
+
declare const secondRequest: unknown;
|
|
18
|
+
declare const errorMessage: unknown;
|
|
19
|
+
declare const uniqueTransactionId: unknown;
|
|
20
|
+
declare const request: undefined;
|
|
21
|
+
declare const fetchedPayment: unknown;
|
|
22
|
+
declare const uniqueTransactionId: unknown;
|
|
23
|
+
declare const request: unknown;
|
|
24
|
+
declare const fetchedPayment: unknown;
|
|
25
|
+
declare const uniqueTransactionId: unknown;
|
|
26
|
+
declare const request: undefined;
|
|
27
|
+
declare const result: unknown;
|
|
28
|
+
declare const payments: Array<]
|
|
29
|
+
const paymentIds = [>;
|
|
30
|
+
declare const uniqueTransactionId: unknown;
|
|
31
|
+
declare const request: unknown;
|
|
32
|
+
declare const paymentId: undefined expect(paymentId).toBeDefined();
|
|
33
|
+
declare const deletedCount: unknown;
|
|
34
|
+
declare const fetchedPayment: unknown;
|
|
35
|
+
declare const deletedCount: unknown;
|
|
36
|
+
declare const today: unknown;
|
|
37
|
+
declare const recentRequest: unknown;
|
|
38
|
+
declare const stats: unknown;
|
|
39
|
+
declare const today: unknown;
|
|
40
|
+
declare const ppPaymentData: {
|
|
41
|
+
order_id: 31;
|
|
42
|
+
user_id: 31;
|
|
43
|
+
amount: 150;
|
|
44
|
+
method: 'paypal';
|
|
45
|
+
status: 'completed';
|
|
46
|
+
transaction_id: `TXN-METHOD-PP-${Date.now()}`;
|
|
47
|
+
created_at: unknown
|
|
48
|
+
};
|
|
49
|
+
declare const ccRequest: unknown;
|
|
50
|
+
declare const methodStats: unknown;
|
|
51
|
+
declare const methods: unknown;
|
|
52
|
+
declare const today: unknown;
|
|
53
|
+
declare const currentMonthPayment: {
|
|
54
|
+
order_id: 40;
|
|
55
|
+
user_id: 40;
|
|
56
|
+
amount: 100;
|
|
57
|
+
method: 'credit_card';
|
|
58
|
+
status: 'completed';
|
|
59
|
+
transaction_id: `TXN-MONTHLY-1-${Date.now()}`;
|
|
60
|
+
created_at: unknown
|
|
61
|
+
};
|
|
62
|
+
declare const previousMonthPayment: {
|
|
63
|
+
order_id: 41;
|
|
64
|
+
user_id: 41;
|
|
65
|
+
amount: 200;
|
|
66
|
+
method: 'credit_card';
|
|
67
|
+
status: 'completed';
|
|
68
|
+
transaction_id: `TXN-MONTHLY-2-${Date.now()}`;
|
|
69
|
+
created_at: unknown
|
|
70
|
+
};
|
|
71
|
+
declare const currentRequest: unknown;
|
|
72
|
+
declare const monthlyTrends: unknown;
|
|
73
|
+
declare const firstMonth: unknown;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
declare const requestData: {
|
|
2
|
+
product_id: 1;
|
|
3
|
+
customer_id: 1;
|
|
4
|
+
rating: 5;
|
|
5
|
+
title: 'Great product';
|
|
6
|
+
content: 'This is an excellent product, highly recommend!';
|
|
7
|
+
is_verified_purchase: true;
|
|
8
|
+
is_approved: true;
|
|
9
|
+
helpful_votes: 0;
|
|
10
|
+
unhelpful_votes: 0;
|
|
11
|
+
purchase_date: unknown;
|
|
12
|
+
images: unknown
|
|
13
|
+
};
|
|
14
|
+
declare const request: unknown;
|
|
15
|
+
declare const reviewId: undefined if (reviewId);
|
|
16
|
+
declare const minimalRequestData: {
|
|
17
|
+
product_id: 1;
|
|
18
|
+
customer_id: 2;
|
|
19
|
+
rating: 4;
|
|
20
|
+
title: 'Good product';
|
|
21
|
+
content: 'I like it'
|
|
22
|
+
};
|
|
23
|
+
declare const request: unknown;
|
|
24
|
+
declare const requestData: {
|
|
25
|
+
product_id: 1;
|
|
26
|
+
customer_id: 1;
|
|
27
|
+
rating: 5;
|
|
28
|
+
title: 'Great product';
|
|
29
|
+
content: 'This is an excellent product!';
|
|
30
|
+
is_verified_purchase: true;
|
|
31
|
+
is_approved: true
|
|
32
|
+
};
|
|
33
|
+
declare const request: undefined;
|
|
34
|
+
declare const fetchedReview: unknown;
|
|
35
|
+
declare const productId: unknown;
|
|
36
|
+
declare const request2: unknown;
|
|
37
|
+
declare const result: unknown;
|
|
38
|
+
declare const customerId: unknown;
|
|
39
|
+
declare const request2: unknown;
|
|
40
|
+
declare const result: unknown;
|
|
41
|
+
declare const productId: unknown;
|
|
42
|
+
declare const request2: unknown;
|
|
43
|
+
declare const result: unknown;
|
|
44
|
+
declare const productId: unknown;
|
|
45
|
+
declare const request2: unknown;
|
|
46
|
+
declare const request3: unknown;
|
|
47
|
+
declare const stats: unknown;
|
|
48
|
+
declare const productId: unknown;
|
|
49
|
+
declare const request2: unknown;
|
|
50
|
+
declare const helpfulReviews: unknown;
|
|
51
|
+
declare const requestData: {
|
|
52
|
+
product_id: 1;
|
|
53
|
+
customer_id: 1;
|
|
54
|
+
rating: 3;
|
|
55
|
+
title: 'Initial review';
|
|
56
|
+
content: 'Initial content';
|
|
57
|
+
is_approved: false
|
|
58
|
+
};
|
|
59
|
+
declare const createRequest: undefined;
|
|
60
|
+
declare const updateData: {
|
|
61
|
+
rating: 4;
|
|
62
|
+
title: 'Updated title';
|
|
63
|
+
content: 'Updated content';
|
|
64
|
+
is_approved: true
|
|
65
|
+
};
|
|
66
|
+
declare const updateRequest: unknown;
|
|
67
|
+
declare const requestData: {
|
|
68
|
+
product_id: 1;
|
|
69
|
+
customer_id: 1;
|
|
70
|
+
rating: 5;
|
|
71
|
+
title: 'Review with votes';
|
|
72
|
+
content: 'This is a review that will receive votes';
|
|
73
|
+
is_approved: true;
|
|
74
|
+
helpful_votes: 3;
|
|
75
|
+
unhelpful_votes: 1
|
|
76
|
+
};
|
|
77
|
+
declare const request: undefined;
|
|
78
|
+
declare const reviewWithMoreHelpfulVotes: unknown;
|
|
79
|
+
declare const reviewWithMoreUnhelpfulVotes: unknown;
|
|
80
|
+
declare const reviewWithLessHelpfulVotes: unknown;
|
|
81
|
+
declare const requestData: {
|
|
82
|
+
product_id: 1;
|
|
83
|
+
customer_id: 1;
|
|
84
|
+
rating: 4;
|
|
85
|
+
title: 'Zero votes review';
|
|
86
|
+
content: 'This is a review with zero votes';
|
|
87
|
+
is_approved: true;
|
|
88
|
+
helpful_votes: 0;
|
|
89
|
+
unhelpful_votes: 0
|
|
90
|
+
};
|
|
91
|
+
declare const request: undefined;
|
|
92
|
+
declare const reviewAfterDecrement: unknown;
|
|
93
|
+
declare const requestData: {
|
|
94
|
+
product_id: 1;
|
|
95
|
+
customer_id: 1;
|
|
96
|
+
rating: 3;
|
|
97
|
+
title: 'Review to delete';
|
|
98
|
+
content: 'This review will be deleted'
|
|
99
|
+
};
|
|
100
|
+
declare const request: undefined;
|
|
101
|
+
declare const result: unknown;
|
|
102
|
+
declare let reviewIds: Array<((...args: any[]) => unknown)>;
|
package/dist/store.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ProductUnitRequestType } from '@stacksjs/orm';
|
|
2
|
+
|
|
3
|
+
export declare function store(request: ProductUnitRequestType): Promise<ProductUnitJsonResponse | undefined>;
|
|
4
|
+
export declare function bulkStore(requests: ProductUnitRequestType[]): Promise<number>;
|
|
5
|
+
export declare function formatUnitOptions(type?: string): Promise<{ id: string, name: string, abbreviation: string, is_default: boolean | undefined }[] | []>;
|
|
6
|
+
export declare function getDefaultUnit(type: string): Promise<ProductUnitJsonResponse | undefined>;
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import type { CouponModel } from '../../../orm/src/models/Coupon';
|
|
2
|
+
import type { GiftCardJsonResponse } from '../../../orm/src/models/GiftCard';
|
|
3
|
+
import type { ManufacturerJsonResponse } from '../../../orm/src/models/Manufacturer';
|
|
4
|
+
import type { OrderItemModel } from '../../../orm/src/models/OrderItem';
|
|
5
|
+
import type { OrderJsonResponse } from '../../../orm/src/models/Order';
|
|
6
|
+
import type { ReviewJsonResponse } from '../../../orm/src/models/Review';
|
|
7
|
+
|
|
8
|
+
export type {
|
|
9
|
+
export declare interface CustomerResponse {
|
|
10
|
+
data: CustomerJsonResponse[]
|
|
11
|
+
paging: {
|
|
12
|
+
total_records: number
|
|
13
|
+
page: number
|
|
14
|
+
total_pages: number
|
|
15
|
+
}
|
|
16
|
+
next_cursor: number | null
|
|
17
|
+
}
|
|
18
|
+
export declare interface CreateCustomerInput {
|
|
19
|
+
name: string
|
|
20
|
+
email: string
|
|
21
|
+
phone: string
|
|
22
|
+
orders?: number
|
|
23
|
+
total_spent?: number
|
|
24
|
+
last_order?: string
|
|
25
|
+
status?: string
|
|
26
|
+
avatar?: string
|
|
27
|
+
user_id?: number
|
|
28
|
+
}
|
|
29
|
+
export declare interface UpdateCustomerInput {
|
|
30
|
+
name?: string
|
|
31
|
+
email?: string
|
|
32
|
+
phone?: string
|
|
33
|
+
orders?: number
|
|
34
|
+
total_spent?: number
|
|
35
|
+
last_order?: string
|
|
36
|
+
status?: string
|
|
37
|
+
avatar?: string
|
|
38
|
+
user_id?: number
|
|
39
|
+
}
|
|
40
|
+
export declare interface OrderItem {
|
|
41
|
+
product_id: string
|
|
42
|
+
quantity: number
|
|
43
|
+
price: number
|
|
44
|
+
special_instructions?: string
|
|
45
|
+
}
|
|
46
|
+
export declare interface StatusCount {
|
|
47
|
+
status: string
|
|
48
|
+
count: number | string
|
|
49
|
+
}
|
|
50
|
+
export declare interface OrderTypeCount {
|
|
51
|
+
order_type: string
|
|
52
|
+
count: number | string
|
|
53
|
+
}
|
|
54
|
+
export declare interface OrderStats {
|
|
55
|
+
total: number
|
|
56
|
+
by_status: StatusCount[]
|
|
57
|
+
by_type: OrderTypeCount[]
|
|
58
|
+
recent: OrderJsonResponse[]
|
|
59
|
+
revenue: number
|
|
60
|
+
}
|
|
61
|
+
export declare interface OrderItemForCalculation {
|
|
62
|
+
price: number
|
|
63
|
+
quantity: number
|
|
64
|
+
}
|
|
65
|
+
export declare interface OrderTotals {
|
|
66
|
+
subtotal: number
|
|
67
|
+
tax_amount: number
|
|
68
|
+
total_amount: number
|
|
69
|
+
}
|
|
70
|
+
export declare interface DiscountTypeCount {
|
|
71
|
+
discount_type: string | undefined
|
|
72
|
+
count: string | number | bigint
|
|
73
|
+
}
|
|
74
|
+
export declare interface CouponStats {
|
|
75
|
+
total: number
|
|
76
|
+
|
|
77
|
+
active: number
|
|
78
|
+
|
|
79
|
+
by_type: DiscountTypeCount[]
|
|
80
|
+
|
|
81
|
+
most_used: {
|
|
82
|
+
id: number | undefined
|
|
83
|
+
code: string | undefined
|
|
84
|
+
discount_type: string | undefined
|
|
85
|
+
discount_value: number | undefined
|
|
86
|
+
usage_count: number | undefined
|
|
87
|
+
}[]
|
|
88
|
+
|
|
89
|
+
upcoming: {
|
|
90
|
+
id: number | undefined
|
|
91
|
+
code: string | undefined
|
|
92
|
+
discount_type: string | undefined
|
|
93
|
+
discount_value: number | undefined
|
|
94
|
+
start_date: Date | string
|
|
95
|
+
end_date: Date | string
|
|
96
|
+
}[]
|
|
97
|
+
}
|
|
98
|
+
export declare interface OrderWithTotals {
|
|
99
|
+
order_items: OrderItemModel[] | []
|
|
100
|
+
id: number
|
|
101
|
+
customer_id: number
|
|
102
|
+
customer: CustomerModel | undefined
|
|
103
|
+
coupon_id: number
|
|
104
|
+
coupon: CouponModel | undefined
|
|
105
|
+
status: string
|
|
106
|
+
total_amount: number
|
|
107
|
+
tax_amount: number | undefined
|
|
108
|
+
discount_amount: number | undefined
|
|
109
|
+
delivery_fee: number | undefined
|
|
110
|
+
tip_amount: number | undefined
|
|
111
|
+
order_type: string
|
|
112
|
+
delivery_address: string | undefined
|
|
113
|
+
special_instructions: string | undefined
|
|
114
|
+
estimated_delivery_time: string | undefined
|
|
115
|
+
applied_coupon_id: string | undefined
|
|
116
|
+
uuid: string | undefined
|
|
117
|
+
created_at: Date | undefined
|
|
118
|
+
updated_at: Date | undefined
|
|
119
|
+
customer_name: string | null
|
|
120
|
+
customer_email: string | null
|
|
121
|
+
totalItems: number
|
|
122
|
+
totalPrice: number
|
|
123
|
+
}
|
|
124
|
+
export declare interface FetchGiftCardsOptions {
|
|
125
|
+
page?: number
|
|
126
|
+
limit?: number
|
|
127
|
+
search?: string
|
|
128
|
+
status?: string
|
|
129
|
+
is_active?: boolean
|
|
130
|
+
is_digital?: boolean
|
|
131
|
+
is_reloadable?: boolean
|
|
132
|
+
sortBy?: string
|
|
133
|
+
sortOrder?: 'asc' | 'desc'
|
|
134
|
+
purchaser_id?: string
|
|
135
|
+
from_date?: string
|
|
136
|
+
to_date?: string
|
|
137
|
+
min_balance?: number
|
|
138
|
+
max_balance?: number
|
|
139
|
+
}
|
|
140
|
+
declare interface BaseResponse {
|
|
141
|
+
paging: {
|
|
142
|
+
total_records: number
|
|
143
|
+
page: number
|
|
144
|
+
total_pages: number
|
|
145
|
+
}
|
|
146
|
+
next_cursor: number | null
|
|
147
|
+
}
|
|
148
|
+
export declare interface GiftCardResponse extends BaseResponse {
|
|
149
|
+
data: GiftCardJsonResponse[]
|
|
150
|
+
}
|
|
151
|
+
export declare interface GiftCardStats {
|
|
152
|
+
total: number
|
|
153
|
+
active: number
|
|
154
|
+
by_status: Array<{ status: string, count: number }>
|
|
155
|
+
by_balance: {
|
|
156
|
+
low: number
|
|
157
|
+
medium: number
|
|
158
|
+
high: number
|
|
159
|
+
}
|
|
160
|
+
expiring_soon: GiftCardJsonResponse[]
|
|
161
|
+
recently_used: GiftCardJsonResponse[]
|
|
162
|
+
}
|
|
163
|
+
export declare interface FetchReviewsOptions {
|
|
164
|
+
page?: number
|
|
165
|
+
limit?: number
|
|
166
|
+
}
|
|
167
|
+
export declare interface ReviewResponse extends BaseResponse {
|
|
168
|
+
data: ReviewJsonResponse[]
|
|
169
|
+
}
|
|
170
|
+
export declare interface ProductManufacturerResponse extends BaseResponse {
|
|
171
|
+
data: ManufacturerJsonResponse[]
|
|
172
|
+
}
|
|
173
|
+
export declare interface ReviewStats {
|
|
174
|
+
total: number
|
|
175
|
+
average_rating: number
|
|
176
|
+
rating_distribution: {
|
|
177
|
+
one_star: number
|
|
178
|
+
two_star: number
|
|
179
|
+
three_star: number
|
|
180
|
+
four_star: number
|
|
181
|
+
five_star: number
|
|
182
|
+
}
|
|
183
|
+
recent_reviews: ReviewJsonResponse[]
|
|
184
|
+
}
|
|
185
|
+
export declare interface CategoryStats {
|
|
186
|
+
total: number
|
|
187
|
+
|
|
188
|
+
active: number
|
|
189
|
+
|
|
190
|
+
root_categories: number
|
|
191
|
+
|
|
192
|
+
child_categories: number
|
|
193
|
+
|
|
194
|
+
with_images: number
|
|
195
|
+
|
|
196
|
+
recently_added: Array<any>
|
|
197
|
+
|
|
198
|
+
top_parent_categories: Array<{
|
|
199
|
+
id: string
|
|
200
|
+
name: string
|
|
201
|
+
child_count: number
|
|
202
|
+
}>
|
|
203
|
+
}
|
|
204
|
+
export declare interface FetchProductManufacturersOptions {
|
|
205
|
+
page?: number
|
|
206
|
+
|
|
207
|
+
limit?: number
|
|
208
|
+
|
|
209
|
+
sortBy?: 'manufacturer' | 'country' | 'created_at' | 'updated_at'
|
|
210
|
+
|
|
211
|
+
sortDirection?: 'asc' | 'desc'
|
|
212
|
+
|
|
213
|
+
country?: string
|
|
214
|
+
|
|
215
|
+
featured?: boolean
|
|
216
|
+
|
|
217
|
+
search?: string
|
|
218
|
+
}
|
|
219
|
+
export declare interface FetchCouponsOptions {
|
|
220
|
+
page?: number
|
|
221
|
+
limit?: number
|
|
222
|
+
search?: string
|
|
223
|
+
is_active?: boolean
|
|
224
|
+
discount_type?: string
|
|
225
|
+
sortBy?: string
|
|
226
|
+
sortOrder?: 'asc' | 'desc'
|
|
227
|
+
product_id?: string
|
|
228
|
+
category_id?: string
|
|
229
|
+
from_date?: string
|
|
230
|
+
to_date?: string
|
|
231
|
+
}
|
|
232
|
+
export declare interface CouponCountStats {
|
|
233
|
+
total: number
|
|
234
|
+
active: number
|
|
235
|
+
inactive: number
|
|
236
|
+
}
|
|
237
|
+
export declare interface CouponTimeStats {
|
|
238
|
+
week: CouponCountStats
|
|
239
|
+
month: CouponCountStats
|
|
240
|
+
year: CouponCountStats
|
|
241
|
+
all_time: CouponCountStats
|
|
242
|
+
}
|
|
243
|
+
export declare interface CouponRedemptionStats {
|
|
244
|
+
total: number
|
|
245
|
+
week: number
|
|
246
|
+
month: number
|
|
247
|
+
year: number
|
|
248
|
+
by_type: Record<string, number>
|
|
249
|
+
}
|
|
250
|
+
export declare interface FetchOrdersOptions {
|
|
251
|
+
page?: number
|
|
252
|
+
limit?: number
|
|
253
|
+
search?: string
|
|
254
|
+
status?: string
|
|
255
|
+
order_type?: string
|
|
256
|
+
customer_id?: number
|
|
257
|
+
sortBy?: string
|
|
258
|
+
sortOrder?: 'asc' | 'desc'
|
|
259
|
+
from_date?: string
|
|
260
|
+
to_date?: string
|
|
261
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
declare const requestData: {
|
|
2
|
+
name: 'Kilogram';
|
|
3
|
+
product_id: 1;
|
|
4
|
+
abbreviation: 'kg';
|
|
5
|
+
type: 'weight';
|
|
6
|
+
description: 'Standard weight unit';
|
|
7
|
+
is_default: true
|
|
8
|
+
};
|
|
9
|
+
declare const request: unknown;
|
|
10
|
+
declare const unitId: undefined expect(unitId).toBeDefined() if (!unitId);
|
|
11
|
+
declare const defaultUnit: unknown;
|
|
12
|
+
declare const firstUnitData: {
|
|
13
|
+
name: 'Kilogram';
|
|
14
|
+
product_id: 1;
|
|
15
|
+
abbreviation: 'kg';
|
|
16
|
+
type: 'weight';
|
|
17
|
+
description: 'Standard weight unit';
|
|
18
|
+
is_default: true
|
|
19
|
+
};
|
|
20
|
+
declare const firstRequest: unknown;
|
|
21
|
+
declare const secondUnitData: {
|
|
22
|
+
name: 'Gram';
|
|
23
|
+
product_id: 1;
|
|
24
|
+
abbreviation: 'g';
|
|
25
|
+
type: 'weight';
|
|
26
|
+
description: 'Smaller weight unit';
|
|
27
|
+
is_default: true
|
|
28
|
+
};
|
|
29
|
+
declare const secondRequest: unknown;
|
|
30
|
+
declare const firstUnitId: undefined const secondUnitId;
|
|
31
|
+
declare const updatedFirstUnit: unknown;
|
|
32
|
+
declare const defaultUnit: unknown;
|
|
33
|
+
declare const minimalRequestData: {
|
|
34
|
+
name: 'Piece';
|
|
35
|
+
product_id: 1;
|
|
36
|
+
abbreviation: 'pc';
|
|
37
|
+
type: 'quantity'
|
|
38
|
+
};
|
|
39
|
+
declare const request: unknown;
|
|
40
|
+
declare const unitRequests: Array<unknown | unknown | unknown>;
|
|
41
|
+
declare const createdCount: unknown;
|
|
42
|
+
declare const weightDefault: unknown;
|
|
43
|
+
declare const createdCount: unknown;
|
|
44
|
+
declare const unitRequests: Array<unknown | unknown>;
|
|
45
|
+
declare const createdCount: unknown;
|
|
46
|
+
declare const weightUnits: unknown;
|
|
47
|
+
declare const defaultUnits: (...args: any[]) => unknown;
|
|
48
|
+
declare const unitRequests: Array<unknown | unknown | unknown>;
|
|
49
|
+
declare const weightUnits: unknown;
|
|
50
|
+
declare const allUnits: unknown;
|
|
51
|
+
declare const unitRequests: Array<unknown | unknown>;
|
|
52
|
+
declare const defaultWeightUnit: unknown;
|
|
53
|
+
declare const defaultNonExistentUnit: unknown;
|
|
54
|
+
declare const initialData: {
|
|
55
|
+
name: 'Kilogram';
|
|
56
|
+
product_id: 1;
|
|
57
|
+
abbreviation: 'kg';
|
|
58
|
+
type: 'weight';
|
|
59
|
+
description: 'Standard weight unit';
|
|
60
|
+
is_default: false
|
|
61
|
+
};
|
|
62
|
+
declare const createRequest: undefined;
|
|
63
|
+
declare const updateData: {
|
|
64
|
+
name: 'Metric Kilogram';
|
|
65
|
+
abbreviation: 'kg';
|
|
66
|
+
description: 'Updated description';
|
|
67
|
+
is_default: true
|
|
68
|
+
};
|
|
69
|
+
declare const updateRequest: unknown;
|
|
70
|
+
declare const unitRequests: Array<unknown | unknown>;
|
|
71
|
+
declare const weightUnits: unknown;
|
|
72
|
+
declare const nonDefaultUnit: (...args: any[]) => unknown;
|
|
73
|
+
declare const updateData: {
|
|
74
|
+
is_default: true
|
|
75
|
+
};
|
|
76
|
+
declare const updateRequest: unknown;
|
|
77
|
+
declare const updatedWeightUnits: (...args: any[]) => unknown;
|
|
78
|
+
declare const unitRequests: Array<unknown | unknown>;
|
|
79
|
+
declare const createdUnits: unknown;
|
|
80
|
+
declare const updates: Array<{
|
|
81
|
+
id: unknown;
|
|
82
|
+
data: unknown
|
|
83
|
+
} | {
|
|
84
|
+
id: unknown;
|
|
85
|
+
data: unknown
|
|
86
|
+
}>;
|
|
87
|
+
declare const updatedCount: unknown;
|
|
88
|
+
declare const updatedUnits: unknown;
|
|
89
|
+
declare const updatedCount: unknown;
|
|
90
|
+
declare const unitRequests: Array<unknown | unknown | unknown>;
|
|
91
|
+
declare const createdUnits: unknown;
|
|
92
|
+
declare const updates: Array<{
|
|
93
|
+
id: unknown;
|
|
94
|
+
'
|
|
95
|
+
data': unknown
|
|
96
|
+
} | {
|
|
97
|
+
id: unknown;
|
|
98
|
+
'
|
|
99
|
+
data': unknown
|
|
100
|
+
}>;
|
|
101
|
+
declare const updatedUnits: (...args: any[]) => unknown;
|
|
102
|
+
declare const unitData: {
|
|
103
|
+
name: 'Kilogram';
|
|
104
|
+
product_id: 1;
|
|
105
|
+
abbreviation: 'kg';
|
|
106
|
+
type: 'weight';
|
|
107
|
+
is_default: false
|
|
108
|
+
};
|
|
109
|
+
declare const request: undefined;
|
|
110
|
+
declare const result: unknown;
|
|
111
|
+
declare const defaultUnit: unknown;
|
|
112
|
+
declare const nonExistentId: unknown;
|
|
113
|
+
declare const unitRequests: Array<unknown | unknown>;
|
|
114
|
+
declare const weightUnits: unknown;
|
|
115
|
+
declare const nonDefaultUnit: (...args: any[]) => unknown;
|
|
116
|
+
declare const result: unknown;
|
|
117
|
+
declare const updatedWeightUnits: (...args: any[]) => unknown;
|
|
118
|
+
declare const unitData: {
|
|
119
|
+
name: 'Kilogram';
|
|
120
|
+
product_id: 1;
|
|
121
|
+
abbreviation: 'kg';
|
|
122
|
+
type: 'weight'
|
|
123
|
+
};
|
|
124
|
+
declare const request: undefined;
|
|
125
|
+
declare let fetchedUnit: unknown;
|
|
126
|
+
declare const result: unknown;
|
|
127
|
+
declare const unitRequests: Array<unknown | unknown | unknown>;
|
|
128
|
+
declare const createdUnits: unknown;
|
|
129
|
+
declare const unitIds: (...args: any[]) => unknown;
|
|
130
|
+
declare const remainingUnits: unknown;
|
|
131
|
+
declare const deletedCount: unknown;
|
package/dist/update.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ProductUnitRequestType } from '@stacksjs/orm';
|
|
2
|
+
|
|
3
|
+
export declare function update(id: number, request: ProductUnitRequestType): Promise<ProductUnitJsonResponse | undefined>;
|
|
4
|
+
export declare function bulkUpdate(updates: Array<{ id: number data: ProductUnitRequestType }>): Promise<number>;
|
|
5
|
+
export declare function updateDefaultStatus(id: number, isDefault: boolean): Promise<boolean>;
|