@nextblock-cms/ecom 0.9.98 → 0.10.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/lib/cart-store.d.ts +3 -3
- package/lib/currency-sync.d.ts +3 -3
- package/lib/currency.d.ts +7 -7
- package/lib/pages/cms/orders/export-actions.d.ts +1 -1
- package/lib/pages/cms/products/actions.d.ts +205 -6
- package/lib/pages/cms/products/server-actions.d.ts +11 -11
- package/lib/pages/cms/shipping/server-actions.d.ts +6 -6
- package/lib/product-actions.d.ts +255 -4
- package/lib/product-schema.d.ts +1 -1
- package/lib/shipping-rate-currency.d.ts +5 -5
- package/lib/stripe/order-sync.d.ts +6 -6
- package/package.json +4 -4
package/lib/cart-store.d.ts
CHANGED
|
@@ -39,9 +39,9 @@ export declare function getCartItemActivePrice(item: CartItem, params: {
|
|
|
39
39
|
currencyCode: string;
|
|
40
40
|
currencies: ReturnType<typeof useCurrency>['currencies'];
|
|
41
41
|
}): {
|
|
42
|
-
currencyCode:
|
|
43
|
-
price:
|
|
44
|
-
sale_price:
|
|
42
|
+
currencyCode: string;
|
|
43
|
+
price: number;
|
|
44
|
+
sale_price: number | null;
|
|
45
45
|
};
|
|
46
46
|
export declare const useCartSubtotal: () => number;
|
|
47
47
|
export {};
|
package/lib/currency-sync.d.ts
CHANGED
|
@@ -3,11 +3,11 @@ export declare function rebaseStoreCurrencyExchangeRates(params: {
|
|
|
3
3
|
previousBaseRate: number;
|
|
4
4
|
}): Promise<{
|
|
5
5
|
rebasedAt: string;
|
|
6
|
-
newDefaultCurrencyCode:
|
|
6
|
+
newDefaultCurrencyCode: string;
|
|
7
7
|
updatedCurrencies: string[];
|
|
8
8
|
}>;
|
|
9
9
|
export declare function syncStoreCurrencyRates(): Promise<{
|
|
10
|
-
baseCurrencyCode:
|
|
10
|
+
baseCurrencyCode: string;
|
|
11
11
|
fetchedAt: string;
|
|
12
12
|
provider: string;
|
|
13
13
|
providerUrl: string;
|
|
@@ -15,5 +15,5 @@ export declare function syncStoreCurrencyRates(): Promise<{
|
|
|
15
15
|
updatedCurrencies: string[];
|
|
16
16
|
}>;
|
|
17
17
|
export declare function clearAutoSyncedCurrencyPriceOverrides(currencyCode: string): Promise<{
|
|
18
|
-
currencyCode:
|
|
18
|
+
currencyCode: string;
|
|
19
19
|
}>;
|
package/lib/currency.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export declare function convertMinorUnitAmount(params: {
|
|
|
29
29
|
toCurrencyCode?: string | null;
|
|
30
30
|
currencies: CurrencyRecord[];
|
|
31
31
|
applyRounding?: boolean;
|
|
32
|
-
}):
|
|
32
|
+
}): number;
|
|
33
33
|
export declare function applyCurrencyRounding(params: {
|
|
34
34
|
amount: number;
|
|
35
35
|
currencyCode?: string | null;
|
|
@@ -44,9 +44,9 @@ export declare function resolvePriceForCurrency(params: {
|
|
|
44
44
|
currencyCode?: string | null;
|
|
45
45
|
currencies: CurrencyRecord[];
|
|
46
46
|
}): {
|
|
47
|
-
currencyCode:
|
|
48
|
-
price:
|
|
49
|
-
sale_price:
|
|
47
|
+
currencyCode: string;
|
|
48
|
+
price: number;
|
|
49
|
+
sale_price: number | null;
|
|
50
50
|
};
|
|
51
51
|
/**
|
|
52
52
|
* Returns whether a scheduled sale window is active at `now` (defaults to the
|
|
@@ -89,9 +89,9 @@ export declare function resolveEffectivePriceForCurrency(params: {
|
|
|
89
89
|
currencies: CurrencyRecord[];
|
|
90
90
|
now?: Date;
|
|
91
91
|
}): {
|
|
92
|
-
currencyCode:
|
|
93
|
-
price:
|
|
94
|
-
sale_price:
|
|
92
|
+
currencyCode: string;
|
|
93
|
+
price: number;
|
|
94
|
+
sale_price: number | null;
|
|
95
95
|
};
|
|
96
96
|
export declare function resolvePriceRangeForCurrency(params: {
|
|
97
97
|
entries: Array<{
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export type ReportType = 'general_ledger' | 'tax_liability' | 'currency_summary';
|
|
2
|
-
export declare function fetchOrderReportData(startDate: string, endDate: string): Promise<any>;
|
|
2
|
+
export declare function fetchOrderReportData(startDate: string, endDate: string): Promise<any[]>;
|
|
@@ -4,10 +4,195 @@ export declare function getProducts(options?: {
|
|
|
4
4
|
search?: string;
|
|
5
5
|
languageId?: number;
|
|
6
6
|
}): Promise<{
|
|
7
|
-
data: never[] |
|
|
7
|
+
data: never[] | {
|
|
8
|
+
id: string;
|
|
9
|
+
title: string;
|
|
10
|
+
sku: string;
|
|
11
|
+
upc: string | null;
|
|
12
|
+
price: number;
|
|
13
|
+
prices: import('../../../../../../db/src/index.ts').Json;
|
|
14
|
+
sale_price: number | null;
|
|
15
|
+
sale_prices: import('../../../../../../db/src/index.ts').Json;
|
|
16
|
+
sale_start_at: string | null;
|
|
17
|
+
sale_end_at: string | null;
|
|
18
|
+
scheduled_price: number | null;
|
|
19
|
+
scheduled_prices: import('../../../../../../db/src/index.ts').Json;
|
|
20
|
+
scheduled_price_at: string | null;
|
|
21
|
+
is_taxable: boolean;
|
|
22
|
+
product_type: string;
|
|
23
|
+
payment_provider: string;
|
|
24
|
+
short_description: string | null;
|
|
25
|
+
stock: number | null;
|
|
26
|
+
status: string;
|
|
27
|
+
slug: string;
|
|
28
|
+
language_id: number;
|
|
29
|
+
translation_group_id: string;
|
|
30
|
+
freemius_product_id: string | null;
|
|
31
|
+
freemius_plan_id: string | null;
|
|
32
|
+
trial_period_days: number;
|
|
33
|
+
trial_requires_payment_method: boolean;
|
|
34
|
+
product_media: {
|
|
35
|
+
media: {
|
|
36
|
+
file_path: string | null;
|
|
37
|
+
object_key: string;
|
|
38
|
+
};
|
|
39
|
+
}[];
|
|
40
|
+
product_variants: {
|
|
41
|
+
id: string;
|
|
42
|
+
price: number;
|
|
43
|
+
prices: import('../../../../../../db/src/index.ts').Json;
|
|
44
|
+
sale_price: number | null;
|
|
45
|
+
sale_prices: import('../../../../../../db/src/index.ts').Json;
|
|
46
|
+
sale_start_at: string | null;
|
|
47
|
+
sale_end_at: string | null;
|
|
48
|
+
scheduled_price: number | null;
|
|
49
|
+
scheduled_prices: import('../../../../../../db/src/index.ts').Json;
|
|
50
|
+
scheduled_price_at: string | null;
|
|
51
|
+
}[];
|
|
52
|
+
freemius_plans: {
|
|
53
|
+
id: string;
|
|
54
|
+
name: string;
|
|
55
|
+
title: string | null;
|
|
56
|
+
freemius_pricing: {
|
|
57
|
+
id: string;
|
|
58
|
+
license_quota: number | null;
|
|
59
|
+
api_monthly_price: number | null;
|
|
60
|
+
api_annual_price: number | null;
|
|
61
|
+
api_lifetime_price: number | null;
|
|
62
|
+
override_monthly_price: number | null;
|
|
63
|
+
override_annual_price: number | null;
|
|
64
|
+
override_lifetime_price: number | null;
|
|
65
|
+
is_active: boolean;
|
|
66
|
+
}[];
|
|
67
|
+
}[];
|
|
68
|
+
product_categories: {
|
|
69
|
+
category: {
|
|
70
|
+
id: string;
|
|
71
|
+
name: string;
|
|
72
|
+
slug: string;
|
|
73
|
+
description: string | null;
|
|
74
|
+
name_translations: import('../../../../../../db/src/index.ts').Json;
|
|
75
|
+
description_translations: import('../../../../../../db/src/index.ts').Json;
|
|
76
|
+
};
|
|
77
|
+
}[];
|
|
78
|
+
}[];
|
|
8
79
|
count: number | null;
|
|
9
80
|
}>;
|
|
10
|
-
export declare function getProduct(id: string): Promise<
|
|
81
|
+
export declare function getProduct(id: string): Promise<{
|
|
82
|
+
created_at: string | null;
|
|
83
|
+
description_json: import('../../../../../../db/src/index.ts').Json | null;
|
|
84
|
+
freemius_plan_id: string | null;
|
|
85
|
+
freemius_product_id: string | null;
|
|
86
|
+
id: string;
|
|
87
|
+
is_taxable: boolean;
|
|
88
|
+
language_id: number;
|
|
89
|
+
meta_description: string | null;
|
|
90
|
+
meta_title: string | null;
|
|
91
|
+
metadata: import('../../../../../../db/src/index.ts').Json | null;
|
|
92
|
+
payment_provider: string;
|
|
93
|
+
price: number;
|
|
94
|
+
prices: import('../../../../../../db/src/index.ts').Json;
|
|
95
|
+
product_type: string;
|
|
96
|
+
sale_end_at: string | null;
|
|
97
|
+
sale_price: number | null;
|
|
98
|
+
sale_prices: import('../../../../../../db/src/index.ts').Json | null;
|
|
99
|
+
sale_start_at: string | null;
|
|
100
|
+
scheduled_price: number | null;
|
|
101
|
+
scheduled_price_at: string | null;
|
|
102
|
+
scheduled_prices: import('../../../../../../db/src/index.ts').Json | null;
|
|
103
|
+
short_description: string | null;
|
|
104
|
+
sku: string;
|
|
105
|
+
slug: string;
|
|
106
|
+
status: string;
|
|
107
|
+
stock: number | null;
|
|
108
|
+
title: string;
|
|
109
|
+
translation_group_id: string;
|
|
110
|
+
trial_period_days: number;
|
|
111
|
+
trial_requires_payment_method: boolean;
|
|
112
|
+
upc: string | null;
|
|
113
|
+
updated_at: string | null;
|
|
114
|
+
languages: {
|
|
115
|
+
code: string;
|
|
116
|
+
};
|
|
117
|
+
product_media: {
|
|
118
|
+
media_id: string;
|
|
119
|
+
sort_order: number | null;
|
|
120
|
+
media: {
|
|
121
|
+
id: string;
|
|
122
|
+
file_path: string | null;
|
|
123
|
+
object_key: string;
|
|
124
|
+
file_name: string;
|
|
125
|
+
blur_data_url: string | null;
|
|
126
|
+
width: number | null;
|
|
127
|
+
height: number | null;
|
|
128
|
+
};
|
|
129
|
+
}[];
|
|
130
|
+
product_variants: {
|
|
131
|
+
id: string;
|
|
132
|
+
sku: string;
|
|
133
|
+
upc: string | null;
|
|
134
|
+
main_media_id: string | null;
|
|
135
|
+
price: number;
|
|
136
|
+
prices: import('../../../../../../db/src/index.ts').Json;
|
|
137
|
+
sale_price: number | null;
|
|
138
|
+
sale_prices: import('../../../../../../db/src/index.ts').Json;
|
|
139
|
+
sale_start_at: string | null;
|
|
140
|
+
sale_end_at: string | null;
|
|
141
|
+
scheduled_price: number | null;
|
|
142
|
+
scheduled_prices: import('../../../../../../db/src/index.ts').Json;
|
|
143
|
+
scheduled_price_at: string | null;
|
|
144
|
+
stock_quantity: number;
|
|
145
|
+
media: {
|
|
146
|
+
id: string;
|
|
147
|
+
file_path: string | null;
|
|
148
|
+
object_key: string;
|
|
149
|
+
description: string | null;
|
|
150
|
+
} | null;
|
|
151
|
+
variant_attribute_mapping: {
|
|
152
|
+
attribute_term_id: string;
|
|
153
|
+
product_attribute_terms: {
|
|
154
|
+
id: string;
|
|
155
|
+
attribute_id: string;
|
|
156
|
+
value: string;
|
|
157
|
+
slug: string;
|
|
158
|
+
sort_order: number;
|
|
159
|
+
value_translations: import('../../../../../../db/src/index.ts').Json;
|
|
160
|
+
product_attributes: {
|
|
161
|
+
id: string;
|
|
162
|
+
name: string;
|
|
163
|
+
slug: string;
|
|
164
|
+
name_translations: import('../../../../../../db/src/index.ts').Json;
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
}[];
|
|
168
|
+
}[];
|
|
169
|
+
freemius_plans: {
|
|
170
|
+
id: string;
|
|
171
|
+
name: string;
|
|
172
|
+
title: string | null;
|
|
173
|
+
freemius_pricing: {
|
|
174
|
+
id: string;
|
|
175
|
+
license_quota: number | null;
|
|
176
|
+
api_monthly_price: number | null;
|
|
177
|
+
api_annual_price: number | null;
|
|
178
|
+
api_lifetime_price: number | null;
|
|
179
|
+
override_monthly_price: number | null;
|
|
180
|
+
override_annual_price: number | null;
|
|
181
|
+
override_lifetime_price: number | null;
|
|
182
|
+
is_active: boolean;
|
|
183
|
+
}[];
|
|
184
|
+
}[];
|
|
185
|
+
product_categories: {
|
|
186
|
+
category: {
|
|
187
|
+
id: string;
|
|
188
|
+
name: string;
|
|
189
|
+
slug: string;
|
|
190
|
+
description: string | null;
|
|
191
|
+
name_translations: import('../../../../../../db/src/index.ts').Json;
|
|
192
|
+
description_translations: import('../../../../../../db/src/index.ts').Json;
|
|
193
|
+
};
|
|
194
|
+
}[];
|
|
195
|
+
}>;
|
|
11
196
|
export declare function triggerFreemiusSync(): Promise<{
|
|
12
197
|
success: boolean;
|
|
13
198
|
data: {
|
|
@@ -39,8 +224,13 @@ export declare function copyProductFromLanguageAction(targetId: string, sourceId
|
|
|
39
224
|
success: boolean;
|
|
40
225
|
error: any;
|
|
41
226
|
}>;
|
|
42
|
-
export declare function getProductTranslations(translationGroupId: string): Promise<
|
|
43
|
-
|
|
227
|
+
export declare function getProductTranslations(translationGroupId: string): Promise<{
|
|
228
|
+
id: any;
|
|
229
|
+
title: any;
|
|
230
|
+
language_id: any;
|
|
231
|
+
slug: any;
|
|
232
|
+
}[]>;
|
|
233
|
+
export declare function getGlobalProductAttributes(): Promise<any[]>;
|
|
44
234
|
export declare function getFreemiusPricingByProductId(productId: string): Promise<any>;
|
|
45
235
|
export declare function updateFreemiusOverride(pricingId: string, overrides: {
|
|
46
236
|
override_monthly_price?: number | null;
|
|
@@ -54,6 +244,15 @@ export declare function updateFreemiusOverride(pricingId: string, overrides: {
|
|
|
54
244
|
error?: undefined;
|
|
55
245
|
}>;
|
|
56
246
|
export declare function getPublicFreemiusPricing(productId: string): Promise<any>;
|
|
57
|
-
export declare function getCategoriesWithCount(): Promise<
|
|
247
|
+
export declare function getCategoriesWithCount(): Promise<{
|
|
248
|
+
id: any;
|
|
249
|
+
name: any;
|
|
250
|
+
slug: any;
|
|
251
|
+
description: any;
|
|
252
|
+
created_at: any;
|
|
253
|
+
productCount: number;
|
|
254
|
+
name_translations: any;
|
|
255
|
+
description_translations: any;
|
|
256
|
+
}[]>;
|
|
58
257
|
export declare function getCategoryBySlug(slug: string): Promise<any>;
|
|
59
|
-
export declare function getProductCategories(productId: string): Promise<any>;
|
|
258
|
+
export declare function getProductCategories(productId: string): Promise<any[]>;
|
|
@@ -6,7 +6,7 @@ export declare function updateProductAction(id: string, data: ProductFormValues)
|
|
|
6
6
|
export declare function deleteProductAction(id: string): Promise<void>;
|
|
7
7
|
export declare function bulkDeleteProductsAction(productIds: string[]): Promise<{
|
|
8
8
|
success: boolean;
|
|
9
|
-
error:
|
|
9
|
+
error: string;
|
|
10
10
|
count?: undefined;
|
|
11
11
|
} | {
|
|
12
12
|
success: boolean;
|
|
@@ -15,7 +15,7 @@ export declare function bulkDeleteProductsAction(productIds: string[]): Promise<
|
|
|
15
15
|
}>;
|
|
16
16
|
export declare function bulkDraftProductsAction(productIds: string[]): Promise<{
|
|
17
17
|
success: boolean;
|
|
18
|
-
error:
|
|
18
|
+
error: string;
|
|
19
19
|
count?: undefined;
|
|
20
20
|
} | {
|
|
21
21
|
success: boolean;
|
|
@@ -27,14 +27,14 @@ export declare function createProductAttributeAction(input: {
|
|
|
27
27
|
slug?: string;
|
|
28
28
|
}): Promise<{
|
|
29
29
|
success: boolean;
|
|
30
|
-
error:
|
|
30
|
+
error: string;
|
|
31
31
|
} | {
|
|
32
32
|
success: boolean;
|
|
33
33
|
error?: undefined;
|
|
34
34
|
}>;
|
|
35
35
|
export declare function deleteProductAttributeAction(attributeId: string): Promise<{
|
|
36
36
|
success: boolean;
|
|
37
|
-
error:
|
|
37
|
+
error: string;
|
|
38
38
|
} | {
|
|
39
39
|
success: boolean;
|
|
40
40
|
error?: undefined;
|
|
@@ -45,7 +45,7 @@ export declare function createProductAttributeTermAction(input: {
|
|
|
45
45
|
slug?: string;
|
|
46
46
|
}): Promise<{
|
|
47
47
|
success: boolean;
|
|
48
|
-
error:
|
|
48
|
+
error: string;
|
|
49
49
|
} | {
|
|
50
50
|
success: boolean;
|
|
51
51
|
error?: undefined;
|
|
@@ -55,7 +55,7 @@ export declare function reorderProductAttributeTermsAction(input: {
|
|
|
55
55
|
orderedTermIds: string[];
|
|
56
56
|
}): Promise<{
|
|
57
57
|
success: boolean;
|
|
58
|
-
error:
|
|
58
|
+
error: string;
|
|
59
59
|
} | {
|
|
60
60
|
success: boolean;
|
|
61
61
|
error?: undefined;
|
|
@@ -69,14 +69,14 @@ export declare function updateProductAttributeTranslationsAction(input: {
|
|
|
69
69
|
}>;
|
|
70
70
|
}): Promise<{
|
|
71
71
|
success: boolean;
|
|
72
|
-
error:
|
|
72
|
+
error: string;
|
|
73
73
|
} | {
|
|
74
74
|
success: boolean;
|
|
75
75
|
error?: undefined;
|
|
76
76
|
}>;
|
|
77
77
|
export declare function deleteProductAttributeTermAction(termId: string): Promise<{
|
|
78
78
|
success: boolean;
|
|
79
|
-
error:
|
|
79
|
+
error: string;
|
|
80
80
|
} | {
|
|
81
81
|
success: boolean;
|
|
82
82
|
error?: undefined;
|
|
@@ -89,7 +89,7 @@ export declare function createCategoryAction(input: {
|
|
|
89
89
|
descriptionTranslations?: Record<string, string>;
|
|
90
90
|
}): Promise<{
|
|
91
91
|
success: boolean;
|
|
92
|
-
error:
|
|
92
|
+
error: string;
|
|
93
93
|
category?: undefined;
|
|
94
94
|
} | {
|
|
95
95
|
success: boolean;
|
|
@@ -104,14 +104,14 @@ export declare function updateCategoryAction(id: string, input: {
|
|
|
104
104
|
descriptionTranslations?: Record<string, string>;
|
|
105
105
|
}): Promise<{
|
|
106
106
|
success: boolean;
|
|
107
|
-
error:
|
|
107
|
+
error: string;
|
|
108
108
|
} | {
|
|
109
109
|
success: boolean;
|
|
110
110
|
error?: undefined;
|
|
111
111
|
}>;
|
|
112
112
|
export declare function deleteCategoryAction(id: string): Promise<{
|
|
113
113
|
success: boolean;
|
|
114
|
-
error:
|
|
114
|
+
error: string;
|
|
115
115
|
} | {
|
|
116
116
|
success: boolean;
|
|
117
117
|
error?: undefined;
|
|
@@ -8,7 +8,7 @@ export declare function updateInventoryTrackingAction(formData: FormData): Promi
|
|
|
8
8
|
* Creates a new shipping zone with associated countries/states.
|
|
9
9
|
*/
|
|
10
10
|
export declare function createShippingZone(name: string, priority: number, locations: ShippingZoneLocationInput[]): Promise<{
|
|
11
|
-
error:
|
|
11
|
+
error: string;
|
|
12
12
|
success?: undefined;
|
|
13
13
|
} | {
|
|
14
14
|
success: boolean;
|
|
@@ -18,14 +18,14 @@ export declare function createShippingZone(name: string, priority: number, locat
|
|
|
18
18
|
* Updates an existing shipping zone and its country/state associations.
|
|
19
19
|
*/
|
|
20
20
|
export declare function updateShippingZone(id: string, name: string, priority: number, locations: ShippingZoneLocationInput[]): Promise<{
|
|
21
|
-
error:
|
|
21
|
+
error: string;
|
|
22
22
|
success?: undefined;
|
|
23
23
|
} | {
|
|
24
24
|
success: boolean;
|
|
25
25
|
error?: undefined;
|
|
26
26
|
}>;
|
|
27
27
|
export declare function deleteShippingZone(id: string): Promise<{
|
|
28
|
-
error:
|
|
28
|
+
error: string;
|
|
29
29
|
success?: undefined;
|
|
30
30
|
} | {
|
|
31
31
|
success: boolean;
|
|
@@ -45,7 +45,7 @@ export declare function createShippingRate(zoneId: string, data: {
|
|
|
45
45
|
costAmounts?: Record<string, number>;
|
|
46
46
|
minOrderAmounts?: Record<string, number>;
|
|
47
47
|
}): Promise<{
|
|
48
|
-
error:
|
|
48
|
+
error: string | undefined;
|
|
49
49
|
success?: undefined;
|
|
50
50
|
} | {
|
|
51
51
|
success: boolean;
|
|
@@ -65,14 +65,14 @@ export declare function updateShippingRate(id: string, data: {
|
|
|
65
65
|
costAmounts?: Record<string, number>;
|
|
66
66
|
minOrderAmounts?: Record<string, number>;
|
|
67
67
|
}): Promise<{
|
|
68
|
-
error:
|
|
68
|
+
error: string | undefined;
|
|
69
69
|
success?: undefined;
|
|
70
70
|
} | {
|
|
71
71
|
success: boolean;
|
|
72
72
|
error?: undefined;
|
|
73
73
|
}>;
|
|
74
74
|
export declare function deleteShippingRate(id: string): Promise<{
|
|
75
|
-
error:
|
|
75
|
+
error: string;
|
|
76
76
|
success?: undefined;
|
|
77
77
|
} | {
|
|
78
78
|
success: boolean;
|
package/lib/product-actions.d.ts
CHANGED
|
@@ -7,7 +7,78 @@ export declare function getProducts(supabase: SupabaseClient<Database>, { page,
|
|
|
7
7
|
search?: string;
|
|
8
8
|
languageId?: number;
|
|
9
9
|
categoryId?: string;
|
|
10
|
-
}): Promise<import('@supabase/postgrest-js').PostgrestResponseFailure | import('@supabase/postgrest-js').PostgrestResponseSuccess<
|
|
10
|
+
}): Promise<import('@supabase/postgrest-js').PostgrestResponseFailure | import('@supabase/postgrest-js').PostgrestResponseSuccess<{
|
|
11
|
+
id: string;
|
|
12
|
+
title: string;
|
|
13
|
+
sku: string;
|
|
14
|
+
upc: string | null;
|
|
15
|
+
price: number;
|
|
16
|
+
prices: import('../../../db/src/index.ts').Json;
|
|
17
|
+
sale_price: number | null;
|
|
18
|
+
sale_prices: import('../../../db/src/index.ts').Json;
|
|
19
|
+
sale_start_at: string | null;
|
|
20
|
+
sale_end_at: string | null;
|
|
21
|
+
scheduled_price: number | null;
|
|
22
|
+
scheduled_prices: import('../../../db/src/index.ts').Json;
|
|
23
|
+
scheduled_price_at: string | null;
|
|
24
|
+
is_taxable: boolean;
|
|
25
|
+
product_type: string;
|
|
26
|
+
payment_provider: string;
|
|
27
|
+
short_description: string | null;
|
|
28
|
+
stock: number | null;
|
|
29
|
+
status: string;
|
|
30
|
+
slug: string;
|
|
31
|
+
language_id: number;
|
|
32
|
+
translation_group_id: string;
|
|
33
|
+
freemius_product_id: string | null;
|
|
34
|
+
freemius_plan_id: string | null;
|
|
35
|
+
trial_period_days: number;
|
|
36
|
+
trial_requires_payment_method: boolean;
|
|
37
|
+
product_media: {
|
|
38
|
+
media: {
|
|
39
|
+
file_path: string | null;
|
|
40
|
+
object_key: string;
|
|
41
|
+
};
|
|
42
|
+
}[];
|
|
43
|
+
product_variants: {
|
|
44
|
+
id: string;
|
|
45
|
+
price: number;
|
|
46
|
+
prices: import('../../../db/src/index.ts').Json;
|
|
47
|
+
sale_price: number | null;
|
|
48
|
+
sale_prices: import('../../../db/src/index.ts').Json;
|
|
49
|
+
sale_start_at: string | null;
|
|
50
|
+
sale_end_at: string | null;
|
|
51
|
+
scheduled_price: number | null;
|
|
52
|
+
scheduled_prices: import('../../../db/src/index.ts').Json;
|
|
53
|
+
scheduled_price_at: string | null;
|
|
54
|
+
}[];
|
|
55
|
+
freemius_plans: {
|
|
56
|
+
id: string;
|
|
57
|
+
name: string;
|
|
58
|
+
title: string | null;
|
|
59
|
+
freemius_pricing: {
|
|
60
|
+
id: string;
|
|
61
|
+
license_quota: number | null;
|
|
62
|
+
api_monthly_price: number | null;
|
|
63
|
+
api_annual_price: number | null;
|
|
64
|
+
api_lifetime_price: number | null;
|
|
65
|
+
override_monthly_price: number | null;
|
|
66
|
+
override_annual_price: number | null;
|
|
67
|
+
override_lifetime_price: number | null;
|
|
68
|
+
is_active: boolean;
|
|
69
|
+
}[];
|
|
70
|
+
}[];
|
|
71
|
+
product_categories: {
|
|
72
|
+
category: {
|
|
73
|
+
id: string;
|
|
74
|
+
name: string;
|
|
75
|
+
slug: string;
|
|
76
|
+
description: string | null;
|
|
77
|
+
name_translations: import('../../../db/src/index.ts').Json;
|
|
78
|
+
description_translations: import('../../../db/src/index.ts').Json;
|
|
79
|
+
};
|
|
80
|
+
}[];
|
|
81
|
+
}[]> | {
|
|
11
82
|
data: never[];
|
|
12
83
|
error: import('@supabase/postgrest-js').PostgrestError;
|
|
13
84
|
count: number;
|
|
@@ -16,7 +87,121 @@ export declare function getProducts(supabase: SupabaseClient<Database>, { page,
|
|
|
16
87
|
error: null;
|
|
17
88
|
count: number;
|
|
18
89
|
}>;
|
|
19
|
-
export declare function getProduct(supabase: SupabaseClient<Database>, id: string): Promise<import('@supabase/postgrest-js').PostgrestSingleResponse<
|
|
90
|
+
export declare function getProduct(supabase: SupabaseClient<Database>, id: string): Promise<import('@supabase/postgrest-js').PostgrestSingleResponse<{
|
|
91
|
+
created_at: string | null;
|
|
92
|
+
description_json: import('../../../db/src/index.ts').Json | null;
|
|
93
|
+
freemius_plan_id: string | null;
|
|
94
|
+
freemius_product_id: string | null;
|
|
95
|
+
id: string;
|
|
96
|
+
is_taxable: boolean;
|
|
97
|
+
language_id: number;
|
|
98
|
+
meta_description: string | null;
|
|
99
|
+
meta_title: string | null;
|
|
100
|
+
metadata: import('../../../db/src/index.ts').Json | null;
|
|
101
|
+
payment_provider: string;
|
|
102
|
+
price: number;
|
|
103
|
+
prices: import('../../../db/src/index.ts').Json;
|
|
104
|
+
product_type: string;
|
|
105
|
+
sale_end_at: string | null;
|
|
106
|
+
sale_price: number | null;
|
|
107
|
+
sale_prices: import('../../../db/src/index.ts').Json | null;
|
|
108
|
+
sale_start_at: string | null;
|
|
109
|
+
scheduled_price: number | null;
|
|
110
|
+
scheduled_price_at: string | null;
|
|
111
|
+
scheduled_prices: import('../../../db/src/index.ts').Json | null;
|
|
112
|
+
short_description: string | null;
|
|
113
|
+
sku: string;
|
|
114
|
+
slug: string;
|
|
115
|
+
status: string;
|
|
116
|
+
stock: number | null;
|
|
117
|
+
title: string;
|
|
118
|
+
translation_group_id: string;
|
|
119
|
+
trial_period_days: number;
|
|
120
|
+
trial_requires_payment_method: boolean;
|
|
121
|
+
upc: string | null;
|
|
122
|
+
updated_at: string | null;
|
|
123
|
+
languages: {
|
|
124
|
+
code: string;
|
|
125
|
+
};
|
|
126
|
+
product_media: {
|
|
127
|
+
media_id: string;
|
|
128
|
+
sort_order: number | null;
|
|
129
|
+
media: {
|
|
130
|
+
id: string;
|
|
131
|
+
file_path: string | null;
|
|
132
|
+
object_key: string;
|
|
133
|
+
file_name: string;
|
|
134
|
+
blur_data_url: string | null;
|
|
135
|
+
width: number | null;
|
|
136
|
+
height: number | null;
|
|
137
|
+
};
|
|
138
|
+
}[];
|
|
139
|
+
product_variants: {
|
|
140
|
+
id: string;
|
|
141
|
+
sku: string;
|
|
142
|
+
upc: string | null;
|
|
143
|
+
main_media_id: string | null;
|
|
144
|
+
price: number;
|
|
145
|
+
prices: import('../../../db/src/index.ts').Json;
|
|
146
|
+
sale_price: number | null;
|
|
147
|
+
sale_prices: import('../../../db/src/index.ts').Json;
|
|
148
|
+
sale_start_at: string | null;
|
|
149
|
+
sale_end_at: string | null;
|
|
150
|
+
scheduled_price: number | null;
|
|
151
|
+
scheduled_prices: import('../../../db/src/index.ts').Json;
|
|
152
|
+
scheduled_price_at: string | null;
|
|
153
|
+
stock_quantity: number;
|
|
154
|
+
media: {
|
|
155
|
+
id: string;
|
|
156
|
+
file_path: string | null;
|
|
157
|
+
object_key: string;
|
|
158
|
+
description: string | null;
|
|
159
|
+
} | null;
|
|
160
|
+
variant_attribute_mapping: {
|
|
161
|
+
attribute_term_id: string;
|
|
162
|
+
product_attribute_terms: {
|
|
163
|
+
id: string;
|
|
164
|
+
attribute_id: string;
|
|
165
|
+
value: string;
|
|
166
|
+
slug: string;
|
|
167
|
+
sort_order: number;
|
|
168
|
+
value_translations: import('../../../db/src/index.ts').Json;
|
|
169
|
+
product_attributes: {
|
|
170
|
+
id: string;
|
|
171
|
+
name: string;
|
|
172
|
+
slug: string;
|
|
173
|
+
name_translations: import('../../../db/src/index.ts').Json;
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
}[];
|
|
177
|
+
}[];
|
|
178
|
+
freemius_plans: {
|
|
179
|
+
id: string;
|
|
180
|
+
name: string;
|
|
181
|
+
title: string | null;
|
|
182
|
+
freemius_pricing: {
|
|
183
|
+
id: string;
|
|
184
|
+
license_quota: number | null;
|
|
185
|
+
api_monthly_price: number | null;
|
|
186
|
+
api_annual_price: number | null;
|
|
187
|
+
api_lifetime_price: number | null;
|
|
188
|
+
override_monthly_price: number | null;
|
|
189
|
+
override_annual_price: number | null;
|
|
190
|
+
override_lifetime_price: number | null;
|
|
191
|
+
is_active: boolean;
|
|
192
|
+
}[];
|
|
193
|
+
}[];
|
|
194
|
+
product_categories: {
|
|
195
|
+
category: {
|
|
196
|
+
id: string;
|
|
197
|
+
name: string;
|
|
198
|
+
slug: string;
|
|
199
|
+
description: string | null;
|
|
200
|
+
name_translations: import('../../../db/src/index.ts').Json;
|
|
201
|
+
description_translations: import('../../../db/src/index.ts').Json;
|
|
202
|
+
};
|
|
203
|
+
}[];
|
|
204
|
+
}>>;
|
|
20
205
|
export declare function getProductBySlug(supabase: SupabaseClient<Database>, slug: string, preferredLanguageCode?: string): Promise<{
|
|
21
206
|
data: null;
|
|
22
207
|
error: any;
|
|
@@ -24,8 +209,74 @@ export declare function getProductBySlug(supabase: SupabaseClient<Database>, slu
|
|
|
24
209
|
data: any;
|
|
25
210
|
error: null;
|
|
26
211
|
}>;
|
|
27
|
-
export declare function createProduct(supabase: SupabaseClient<Database>, data: ProductFormValues): Promise<
|
|
28
|
-
|
|
212
|
+
export declare function createProduct(supabase: SupabaseClient<Database>, data: ProductFormValues): Promise<{
|
|
213
|
+
created_at: string | null;
|
|
214
|
+
description_json: import('../../../db/src/index.ts').Json | null;
|
|
215
|
+
freemius_plan_id: string | null;
|
|
216
|
+
freemius_product_id: string | null;
|
|
217
|
+
id: string;
|
|
218
|
+
is_taxable: boolean;
|
|
219
|
+
language_id: number;
|
|
220
|
+
meta_description: string | null;
|
|
221
|
+
meta_title: string | null;
|
|
222
|
+
metadata: import('../../../db/src/index.ts').Json | null;
|
|
223
|
+
payment_provider: string;
|
|
224
|
+
price: number;
|
|
225
|
+
prices: import('../../../db/src/index.ts').Json;
|
|
226
|
+
product_type: string;
|
|
227
|
+
sale_end_at: string | null;
|
|
228
|
+
sale_price: number | null;
|
|
229
|
+
sale_prices: import('../../../db/src/index.ts').Json | null;
|
|
230
|
+
sale_start_at: string | null;
|
|
231
|
+
scheduled_price: number | null;
|
|
232
|
+
scheduled_price_at: string | null;
|
|
233
|
+
scheduled_prices: import('../../../db/src/index.ts').Json | null;
|
|
234
|
+
short_description: string | null;
|
|
235
|
+
sku: string;
|
|
236
|
+
slug: string;
|
|
237
|
+
status: string;
|
|
238
|
+
stock: number | null;
|
|
239
|
+
title: string;
|
|
240
|
+
translation_group_id: string;
|
|
241
|
+
trial_period_days: number;
|
|
242
|
+
trial_requires_payment_method: boolean;
|
|
243
|
+
upc: string | null;
|
|
244
|
+
updated_at: string | null;
|
|
245
|
+
} | null>;
|
|
246
|
+
export declare function updateProduct(supabase: SupabaseClient<Database>, id: string, data: ProductFormValues): Promise<{
|
|
247
|
+
created_at: string | null;
|
|
248
|
+
description_json: import('../../../db/src/index.ts').Json | null;
|
|
249
|
+
freemius_plan_id: string | null;
|
|
250
|
+
freemius_product_id: string | null;
|
|
251
|
+
id: string;
|
|
252
|
+
is_taxable: boolean;
|
|
253
|
+
language_id: number;
|
|
254
|
+
meta_description: string | null;
|
|
255
|
+
meta_title: string | null;
|
|
256
|
+
metadata: import('../../../db/src/index.ts').Json | null;
|
|
257
|
+
payment_provider: string;
|
|
258
|
+
price: number;
|
|
259
|
+
prices: import('../../../db/src/index.ts').Json;
|
|
260
|
+
product_type: string;
|
|
261
|
+
sale_end_at: string | null;
|
|
262
|
+
sale_price: number | null;
|
|
263
|
+
sale_prices: import('../../../db/src/index.ts').Json | null;
|
|
264
|
+
sale_start_at: string | null;
|
|
265
|
+
scheduled_price: number | null;
|
|
266
|
+
scheduled_price_at: string | null;
|
|
267
|
+
scheduled_prices: import('../../../db/src/index.ts').Json | null;
|
|
268
|
+
short_description: string | null;
|
|
269
|
+
sku: string;
|
|
270
|
+
slug: string;
|
|
271
|
+
status: string;
|
|
272
|
+
stock: number | null;
|
|
273
|
+
title: string;
|
|
274
|
+
translation_group_id: string;
|
|
275
|
+
trial_period_days: number;
|
|
276
|
+
trial_requires_payment_method: boolean;
|
|
277
|
+
upc: string | null;
|
|
278
|
+
updated_at: string | null;
|
|
279
|
+
} | null>;
|
|
29
280
|
export declare function deleteProduct(supabase: SupabaseClient<Database>, id: string): Promise<boolean>;
|
|
30
281
|
export declare function copyProductFromLanguage(supabase: SupabaseClient<Database>, targetProductId: string, sourceProductId: string): Promise<{
|
|
31
282
|
success: boolean;
|
package/lib/product-schema.d.ts
CHANGED
|
@@ -35,8 +35,8 @@ export declare const productSchema: z.ZodObject<{
|
|
|
35
35
|
is_taxable: z.ZodBoolean;
|
|
36
36
|
status: z.ZodEnum<{
|
|
37
37
|
draft: "draft";
|
|
38
|
-
active: "active";
|
|
39
38
|
archived: "archived";
|
|
39
|
+
active: "active";
|
|
40
40
|
}>;
|
|
41
41
|
language_id: z.ZodCoercedNumber<unknown>;
|
|
42
42
|
translation_group_id: z.ZodPipe<z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>, z.ZodTransform<string | undefined, string | undefined>>;
|
|
@@ -12,16 +12,16 @@ export declare function sanitizeShippingRateAmountMaps(params: {
|
|
|
12
12
|
fallbackMinOrderAmount?: number | null;
|
|
13
13
|
}): {
|
|
14
14
|
mode: "auto";
|
|
15
|
-
sourceCurrencyCode:
|
|
15
|
+
sourceCurrencyCode: string;
|
|
16
16
|
costAmounts: {
|
|
17
|
-
[x:
|
|
17
|
+
[x: string]: number;
|
|
18
18
|
};
|
|
19
19
|
minOrderAmounts: {
|
|
20
|
-
[x:
|
|
20
|
+
[x: string]: number;
|
|
21
21
|
};
|
|
22
22
|
} | {
|
|
23
23
|
mode: "manual";
|
|
24
|
-
sourceCurrencyCode:
|
|
24
|
+
sourceCurrencyCode: string;
|
|
25
25
|
costAmounts: {
|
|
26
26
|
[x: string]: number;
|
|
27
27
|
};
|
|
@@ -36,4 +36,4 @@ export declare function resolveShippingRateAmountForCurrency(params: {
|
|
|
36
36
|
fallbackAmount?: number | null;
|
|
37
37
|
sourceCurrencyCode?: string | null;
|
|
38
38
|
currencyCode?: string | null;
|
|
39
|
-
}):
|
|
39
|
+
}): number;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { default as Stripe } from 'stripe';
|
|
2
2
|
import { OrderCustomerDetails } from '../customer';
|
|
3
3
|
export declare function syncStripeOrderFromSession(session: Stripe.Checkout.Session): Promise<{
|
|
4
|
-
orderId:
|
|
4
|
+
orderId: string;
|
|
5
5
|
alreadyPaid: boolean;
|
|
6
6
|
customerDetails: OrderCustomerDetails;
|
|
7
7
|
order: {
|
|
8
|
-
id:
|
|
8
|
+
id: string;
|
|
9
9
|
invoice_number: any;
|
|
10
10
|
paid_at: any;
|
|
11
|
-
total:
|
|
12
|
-
currency:
|
|
13
|
-
subtotal:
|
|
14
|
-
shipping_total:
|
|
11
|
+
total: number;
|
|
12
|
+
currency: string;
|
|
13
|
+
subtotal: number;
|
|
14
|
+
shipping_total: number;
|
|
15
15
|
tax_total: number;
|
|
16
16
|
tax_details: import('../order-tax-details').OrderTaxDetails;
|
|
17
17
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nextblock-cms/ecom",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
},
|
|
11
11
|
"type": "module",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@nextblock-cms/db": "^0.
|
|
14
|
-
"@nextblock-cms/ui": "^0.
|
|
15
|
-
"@nextblock-cms/utils": "^0.
|
|
13
|
+
"@nextblock-cms/db": "^0.10.0",
|
|
14
|
+
"@nextblock-cms/ui": "^0.10.0",
|
|
15
|
+
"@nextblock-cms/utils": "^0.10.0",
|
|
16
16
|
"@freemius/checkout": "^1.4.1",
|
|
17
17
|
"@freemius/sdk": "^0.3.0",
|
|
18
18
|
"@hookform/resolvers": "^5.2.2",
|