@stacksjs/commerce 0.70.22 → 0.70.25

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/store.d.ts DELETED
@@ -1,4 +0,0 @@
1
- import type { TaxRateRequestType } from '@stacksjs/orm';
2
-
3
- export declare function store(request: TaxRateRequestType): Promise<TaxRateJsonResponse | undefined>;
4
- export declare function bulkStore(requests: TaxRateRequestType[]): Promise<number>;
@@ -1,78 +0,0 @@
1
- declare const requestData: {
2
- name: 'Standard VAT';
3
- rate: 20;
4
- type: 'VAT';
5
- country: 'United Kingdom';
6
- region: 'Europe';
7
- status: 'active';
8
- is_default: true
9
- };
10
- declare const request: unknown;
11
- declare const taxRateId: undefined if (taxRateId);
12
- declare const minimalRequestData: {
13
- name: 'Basic Tax';
14
- rate: 10;
15
- type: 'Sales Tax';
16
- country: 'United States';
17
- region: 'North America'
18
- };
19
- declare const request: unknown;
20
- declare const requests: Array<unknown | unknown | unknown>;
21
- declare const count: unknown;
22
- declare const allTaxRates: unknown;
23
- declare const count: unknown;
24
- declare const requestData: {
25
- name: 'Standard VAT';
26
- rate: 20;
27
- type: 'VAT';
28
- country: 'United Kingdom';
29
- region: 'Europe';
30
- status: 'active';
31
- is_default: true
32
- };
33
- declare const createRequest: undefined;
34
- declare const updateData: {
35
- name: 'Reduced VAT';
36
- rate: 5;
37
- type: 'VAT';
38
- country: 'United Kingdom';
39
- region: 'Europe';
40
- status: 'active';
41
- is_default: false
42
- };
43
- declare const updateRequest: unknown;
44
- declare const requestData: {
45
- name: 'Standard VAT';
46
- rate: 20;
47
- type: 'VAT';
48
- country: 'United Kingdom';
49
- region: 'Europe';
50
- status: 'active';
51
- is_default: true
52
- };
53
- declare const request: undefined;
54
- declare const updatedTaxRate: unknown;
55
- declare const reactivatedTaxRate: unknown;
56
- declare const requestData: {
57
- name: 'Standard VAT';
58
- rate: 20;
59
- type: 'VAT';
60
- country: 'United Kingdom';
61
- region: 'Europe';
62
- status: 'active';
63
- is_default: true
64
- };
65
- declare const request: undefined;
66
- declare const updatedTaxRate: unknown;
67
- declare const requestData: {
68
- name: 'Standard VAT';
69
- rate: 20;
70
- type: 'VAT';
71
- country: 'United Kingdom';
72
- region: 'Europe';
73
- status: 'active';
74
- is_default: true
75
- };
76
- declare const request: undefined;
77
- declare const result: unknown;
78
- declare let taxRateIds: Array<((...args: any[]) => unknown)>;
package/dist/types.d.ts DELETED
@@ -1,246 +0,0 @@
1
- import type { CouponJsonResponse, CustomerJsonResponse, GiftCardJsonResponse, ManufacturerJsonResponse, OrderItemJsonResponse, OrderJsonResponse, ReviewJsonResponse } from '@stacksjs/orm';
2
-
3
- export declare interface CreateCustomerInput {
4
- name: string
5
- email: string
6
- phone: string
7
- orders?: number
8
- total_spent?: number
9
- last_order?: string
10
- status?: string
11
- avatar?: string
12
- user_id?: number
13
- }
14
- export declare interface UpdateCustomerInput {
15
- name?: string
16
- email?: string
17
- phone?: string
18
- orders?: number
19
- total_spent?: number
20
- last_order?: string
21
- status?: string
22
- avatar?: string
23
- user_id?: number
24
- }
25
- export declare interface OrderItem {
26
- product_id: string
27
- quantity: number
28
- price: number
29
- special_instructions?: string
30
- }
31
- export declare interface StatusCount {
32
- status: string
33
- count: number | string
34
- }
35
- export declare interface OrderTypeCount {
36
- order_type: string
37
- count: number | string
38
- }
39
- export declare interface OrderStats {
40
- total: number
41
- by_status: StatusCount[]
42
- by_type: OrderTypeCount[]
43
- recent: OrderJsonResponse[]
44
- revenue: number
45
- }
46
- export declare interface OrderItemForCalculation {
47
- price: number
48
- quantity: number
49
- }
50
- export declare interface OrderTotals {
51
- subtotal: number
52
- tax_amount: number
53
- total_amount: number
54
- }
55
- export declare interface DiscountTypeCount {
56
- discount_type: string | undefined
57
- count: string | number | bigint
58
- }
59
- export declare interface CouponStats {
60
- total: number
61
-
62
- active: number
63
-
64
- by_type: DiscountTypeCount[]
65
-
66
- most_used: {
67
- id: number | undefined
68
- code: string | undefined
69
- discount_type: string | undefined
70
- discount_value: number | undefined
71
- usage_count: number | undefined
72
- }[]
73
-
74
- upcoming: {
75
- id: number | undefined
76
- code: string | undefined
77
- discount_type: string | undefined
78
- discount_value: number | undefined
79
- start_date: Date | string
80
- end_date: Date | string
81
- }[]
82
- }
83
- export declare interface OrderWithTotals {
84
- order_items: OrderItemJsonResponse[] | []
85
- id: number
86
- customer_id: number
87
- customer: CustomerJsonResponse | undefined
88
- coupon_id: number
89
- coupon: CouponJsonResponse | undefined
90
- status: string
91
- total_amount: number
92
- tax_amount: number | undefined
93
- discount_amount: number | undefined
94
- delivery_fee: number | undefined
95
- tip_amount: number | undefined
96
- order_type: string
97
- delivery_address: string | undefined
98
- special_instructions: string | undefined
99
- estimated_delivery_time: string | undefined
100
- applied_coupon_id: string | undefined
101
- uuid: string | undefined
102
- created_at: Date | undefined
103
- updated_at: Date | undefined
104
- customer_name: string | null
105
- customer_email: string | null
106
- totalItems: number
107
- totalPrice: number
108
- }
109
- export declare interface FetchGiftCardsOptions {
110
- page?: number
111
- limit?: number
112
- search?: string
113
- status?: string
114
- is_active?: boolean
115
- is_digital?: boolean
116
- is_reloadable?: boolean
117
- sortBy?: string
118
- sortOrder?: 'asc' | 'desc'
119
- purchaser_id?: string
120
- from_date?: string
121
- to_date?: string
122
- min_balance?: number
123
- max_balance?: number
124
- }
125
- declare interface BaseResponse {
126
- paging: {
127
- total_records: number
128
- page: number
129
- total_pages: number
130
- }
131
- next_cursor: number | null
132
- }
133
- export declare interface GiftCardResponse extends BaseResponse {
134
- data: GiftCardJsonResponse[]
135
- }
136
- export declare interface GiftCardStats {
137
- total: number
138
- active: number
139
- by_status: Array<{ status: string, count: number }>
140
- by_balance: {
141
- low: number
142
- medium: number
143
- high: number
144
- }
145
- expiring_soon: GiftCardJsonResponse[]
146
- recently_used: GiftCardJsonResponse[]
147
- }
148
- export declare interface FetchReviewsOptions {
149
- page?: number
150
- limit?: number
151
- }
152
- export declare interface ReviewResponse extends BaseResponse {
153
- data: ReviewJsonResponse[]
154
- }
155
- export declare interface ProductManufacturerResponse extends BaseResponse {
156
- data: ManufacturerJsonResponse[]
157
- }
158
- export declare interface ReviewStats {
159
- total: number
160
- average_rating: number
161
- rating_distribution: {
162
- one_star: number
163
- two_star: number
164
- three_star: number
165
- four_star: number
166
- five_star: number
167
- }
168
- recent_reviews: ReviewJsonResponse[]
169
- }
170
- export declare interface CategoryStats {
171
- total: number
172
-
173
- active: number
174
-
175
- root_categories: number
176
-
177
- child_categories: number
178
-
179
- with_images: number
180
-
181
- recently_added: Array<any>
182
-
183
- top_parent_categories: Array<{
184
- id: string
185
- name: string
186
- child_count: number
187
- }>
188
- }
189
- export declare interface FetchProductManufacturersOptions {
190
- page?: number
191
-
192
- limit?: number
193
-
194
- sortBy?: 'manufacturer' | 'country' | 'created_at' | 'updated_at'
195
-
196
- sortDirection?: 'asc' | 'desc'
197
-
198
- country?: string
199
-
200
- featured?: boolean
201
-
202
- search?: string
203
- }
204
- export declare interface FetchCouponsOptions {
205
- page?: number
206
- limit?: number
207
- search?: string
208
- is_active?: boolean
209
- discount_type?: string
210
- sortBy?: string
211
- sortOrder?: 'asc' | 'desc'
212
- product_id?: string
213
- category_id?: string
214
- from_date?: string
215
- to_date?: string
216
- }
217
- export declare interface CouponCountStats {
218
- total: number
219
- active: number
220
- inactive: number
221
- }
222
- export declare interface CouponTimeStats {
223
- week: CouponCountStats
224
- month: CouponCountStats
225
- year: CouponCountStats
226
- all_time: CouponCountStats
227
- }
228
- export declare interface CouponRedemptionStats {
229
- total: number
230
- week: number
231
- month: number
232
- year: number
233
- by_type: Record<string, number>
234
- }
235
- export declare interface FetchOrdersOptions {
236
- page?: number
237
- limit?: number
238
- search?: string
239
- status?: string
240
- order_type?: string
241
- customer_id?: number
242
- sortBy?: string
243
- sortOrder?: 'asc' | 'desc'
244
- from_date?: string
245
- to_date?: string
246
- }
@@ -1,131 +0,0 @@
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 DELETED
@@ -1,5 +0,0 @@
1
- import type { TaxRateRequestType } from '@stacksjs/orm';
2
-
3
- export declare function update(id: number, request: TaxRateRequestType): Promise<TaxRateJsonResponse | undefined>;
4
- export declare function updateStatus(id: number, status: 'active' | 'inactive'): Promise<TaxRateJsonResponse | undefined>;
5
- export declare function updateRate(id: number, rate?: number): Promise<TaxRateJsonResponse | undefined>;
@@ -1,131 +0,0 @@
1
- declare function fetchVariantById(id: number): void;
2
- declare const requestData: {
3
- product_id: 1;
4
- variant: 'Color';
5
- type: 'dropdown';
6
- description: 'Available colors';
7
- options: unknown
8
- };
9
- declare const request: unknown;
10
- declare const variantId: undefined if (variantId);
11
- declare const requestData: {
12
- product_id: 1;
13
- variant: 'Size';
14
- type: 'radio';
15
- description: 'Available sizes';
16
- options: unknown
17
- };
18
- declare const request: unknown;
19
- declare const requestData: {
20
- product_id: 1;
21
- variant: 'Size';
22
- type: 'radio';
23
- description: 'Available sizes';
24
- options: unknown;
25
- status: 'active'
26
- };
27
- declare const request: unknown;
28
- declare const requestsData: Array<{
29
- product_id: 1;
30
- variant: 'Color';
31
- type: 'dropdown';
32
- description: 'Available colors';
33
- options: unknown
34
- } | {
35
- product_id: 1;
36
- variant: 'Size';
37
- type: 'radio';
38
- description: 'Available sizes';
39
- options: unknown
40
- }>;
41
- declare const requests: (...args: any[]) => unknown;
42
- declare const createdCount: unknown;
43
- declare const initialData: {
44
- product_id: 1;
45
- variant: 'Color';
46
- type: 'dropdown';
47
- description: 'Available colors';
48
- options: unknown
49
- };
50
- declare const createRequest: undefined;
51
- declare const updateData: {
52
- description: 'Updated color options';
53
- options: unknown;
54
- status: 'active'
55
- };
56
- declare const updateRequest: unknown;
57
- declare const variantData1: {
58
- product_id: 1;
59
- variant: 'Color';
60
- type: 'dropdown';
61
- description: 'Available colors';
62
- options: unknown
63
- };
64
- declare const variantData2: {
65
- product_id: 1;
66
- variant: 'Size';
67
- type: 'radio';
68
- description: 'Available sizes';
69
- options: unknown
70
- };
71
- declare const request1: unknown;
72
- declare const variant1: unknown;
73
- declare const variant1Id: undefined const variant2Id;
74
- declare const updateData1: unknown;
75
- declare const updateData2: unknown;
76
- declare const updateCount: unknown;
77
- declare const updatedVariant1: unknown;
78
- declare const updateCount: unknown;
79
- declare const variantData: {
80
- product_id: 1;
81
- variant: 'Material';
82
- type: 'dropdown';
83
- description: 'Available materials';
84
- options: unknown;
85
- status: 'draft'
86
- };
87
- declare const request: undefined;
88
- declare const result: unknown;
89
- declare const updatedVariant: unknown;
90
- declare const variantData: {
91
- product_id: 1;
92
- variant: 'Color';
93
- type: 'dropdown';
94
- description: 'Available colors';
95
- options: unknown
96
- };
97
- declare const request: undefined;
98
- declare const result: unknown;
99
- declare const variants: Array<]
100
- const variantIds = [>;
101
- declare const variantData: {
102
- product_id: 1;
103
- variant: `Variant-${i}`;
104
- type: 'dropdown';
105
- description: `Test variant ${i}`;
106
- options: unknown
107
- };
108
- declare const request: unknown;
109
- declare const variantId: undefined expect(variantId).toBeDefined();
110
- declare const deletedCount: unknown;
111
- declare const fetchedVariant: unknown;
112
- declare const deletedCount: unknown;
113
- declare const rawOptions: Array<'Red' | 'Blue' | unknown>;
114
- declare const rawOptions: Array<' Red ' | 'Blue ' | unknown>;
115
- declare const rawOptions: Array<'Red' | '' | 'Blue' | ' ' | unknown>;
116
- declare const optionSets: {
117
- size: Array<'S' | 'M' | 'L'>;
118
- color: Array<'Red' | 'Blue'>
119
- };
120
- declare const combinations: unknown;
121
- declare const optionSets: {
122
- size: Array<'S' | 'M'>;
123
- color: Array<'Red' | 'Blue'>;
124
- material: Array<'Cotton' | 'Polyester'>
125
- };
126
- declare const combinations: unknown;
127
- declare const combinations: unknown;
128
- declare const optionSets: {
129
- size: Array<'S' | 'M' | 'L'>
130
- };
131
- declare const combinations: unknown;