@swell/apps-sdk 1.0.130 → 1.0.133
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.cjs +201 -176
- package/dist/index.cjs.map +3 -3
- package/dist/index.js +201 -176
- package/dist/index.js.map +3 -3
- package/dist/index.mjs +201 -176
- package/dist/index.mjs.map +3 -3
- package/dist/src/resources/product_helpers.d.ts +8 -7
- package/dist/src/resources/swell_types.d.ts +53 -7
- package/dist/src/resources/variant.d.ts +3 -3
- package/dist/types/shopify.d.ts +1 -1
- package/dist/types/swell.d.ts +4 -2
- package/package.json +1 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { SwellData
|
|
2
|
-
import type {
|
|
3
|
-
export declare function
|
|
4
|
-
export declare function
|
|
5
|
-
export declare function
|
|
6
|
-
export declare function
|
|
7
|
-
export declare function getSelectedVariantOptionValues(product:
|
|
1
|
+
import type { SwellData } from 'types/swell';
|
|
2
|
+
import type { SwellProduct, SwellProductOption, SwellProductOptionValue, SwellProductPurchaseOptions, SwellVariant } from './swell_types';
|
|
3
|
+
export declare function getAvailableVariants(product: SwellProduct): SwellVariant[];
|
|
4
|
+
export declare function isOptionValueAvailable(option: SwellProductOption, value: SwellProductOptionValue, product: SwellProduct, availableVariants?: SwellVariant[]): boolean;
|
|
5
|
+
export declare function isOptionValueSelected(option: SwellProductOption, value: SwellProductOptionValue, product: SwellProduct, queryParams: SwellData, selectedVariant?: SwellVariant): boolean;
|
|
6
|
+
export declare function getSelectedVariant(product: SwellProduct, queryParams: SwellData): SwellVariant | undefined;
|
|
7
|
+
export declare function getSelectedVariantOptionValues(product: SwellProduct, queryParams: SwellData, variant?: SwellVariant): string[];
|
|
8
|
+
export declare function getPurchaseOptions(product: SwellProduct, queryParams: SwellData): SwellProductPurchaseOptions | null;
|
|
@@ -1,25 +1,71 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare enum ScheduleInterval {
|
|
2
|
+
Daily = "daily",
|
|
3
|
+
Weekly = "weekly",
|
|
4
|
+
Monthly = "monthly",
|
|
5
|
+
Yearly = "yearly"
|
|
6
|
+
}
|
|
7
|
+
export interface SwellProductOptionValue {
|
|
2
8
|
id: string;
|
|
9
|
+
name: string;
|
|
3
10
|
price?: number;
|
|
4
11
|
}
|
|
5
|
-
export interface
|
|
12
|
+
export interface SwellProductOption {
|
|
6
13
|
active: boolean;
|
|
7
14
|
variant: boolean;
|
|
15
|
+
name: string;
|
|
8
16
|
input_type: string;
|
|
9
|
-
values?:
|
|
17
|
+
values?: SwellProductOptionValue[];
|
|
10
18
|
}
|
|
11
|
-
export interface
|
|
19
|
+
export interface SwellVariant {
|
|
12
20
|
id: string;
|
|
13
21
|
stock_status?: string;
|
|
14
22
|
option_value_ids: string[];
|
|
15
23
|
selected_option_values: string[];
|
|
16
24
|
price?: number;
|
|
17
25
|
}
|
|
18
|
-
export interface
|
|
26
|
+
export interface SwellBillingSchedule {
|
|
27
|
+
interval: ScheduleInterval;
|
|
28
|
+
interval_count: number;
|
|
29
|
+
limit?: number;
|
|
30
|
+
trial_days?: number;
|
|
31
|
+
}
|
|
32
|
+
export interface SwellOrderSchedule {
|
|
33
|
+
interval: ScheduleInterval;
|
|
34
|
+
interval_count: number;
|
|
35
|
+
limit?: number;
|
|
36
|
+
}
|
|
37
|
+
export interface SwellSubscriptionPlan {
|
|
38
|
+
id: string;
|
|
39
|
+
name: string;
|
|
40
|
+
description: string | null;
|
|
41
|
+
price: number;
|
|
42
|
+
billing_schedule: SwellBillingSchedule;
|
|
43
|
+
has_order_schedule?: boolean;
|
|
44
|
+
order_schedule?: SwellOrderSchedule;
|
|
45
|
+
selected?: boolean;
|
|
46
|
+
}
|
|
47
|
+
export interface SwellProductPurchaseOptionStandard {
|
|
48
|
+
price: number;
|
|
49
|
+
sale: boolean;
|
|
50
|
+
sale_price?: number;
|
|
51
|
+
orig_price?: number;
|
|
52
|
+
selected?: boolean;
|
|
53
|
+
}
|
|
54
|
+
export interface SwellProductPurchaseOptionSubscription {
|
|
55
|
+
plans: SwellSubscriptionPlan[];
|
|
56
|
+
selected?: boolean;
|
|
57
|
+
}
|
|
58
|
+
export interface SwellProductPurchaseOptions {
|
|
59
|
+
standard?: SwellProductPurchaseOptionStandard;
|
|
60
|
+
subscription?: SwellProductPurchaseOptionSubscription;
|
|
61
|
+
}
|
|
62
|
+
export interface SwellProduct {
|
|
63
|
+
id: string;
|
|
19
64
|
price: number;
|
|
20
|
-
options?:
|
|
65
|
+
options?: SwellProductOption[];
|
|
21
66
|
selected_option_values?: string[];
|
|
67
|
+
purchase_options?: SwellProductPurchaseOptions;
|
|
22
68
|
variants: {
|
|
23
|
-
results:
|
|
69
|
+
results: SwellVariant[];
|
|
24
70
|
};
|
|
25
71
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { SwellData } from 'types/swell';
|
|
2
|
-
import type {
|
|
3
|
-
export declare function transformSwellVariant(params: SwellData, product:
|
|
4
|
-
price: number;
|
|
2
|
+
import type { SwellProduct, SwellVariant } from './swell_types';
|
|
3
|
+
export declare function transformSwellVariant(params: SwellData, product: SwellProduct, variant: SwellVariant): {
|
|
5
4
|
selected_option_values: string[];
|
|
6
5
|
id: string;
|
|
7
6
|
stock_status?: string;
|
|
8
7
|
option_value_ids: string[];
|
|
8
|
+
price?: number;
|
|
9
9
|
};
|
package/dist/types/shopify.d.ts
CHANGED
|
@@ -381,7 +381,7 @@ export interface ShopifyProductOption {
|
|
|
381
381
|
name: string;
|
|
382
382
|
position: number;
|
|
383
383
|
selected_value?: string;
|
|
384
|
-
values
|
|
384
|
+
values?: ShopifyProductOptionValue[];
|
|
385
385
|
}
|
|
386
386
|
export interface ShopifyProduct {
|
|
387
387
|
available: boolean;
|
package/dist/types/swell.d.ts
CHANGED
|
@@ -249,17 +249,19 @@ export interface ThemeSectionSettings extends ThemeSettings {
|
|
|
249
249
|
export interface ThemePageSchema {
|
|
250
250
|
layout?: string;
|
|
251
251
|
page?: {
|
|
252
|
-
|
|
252
|
+
title?: string;
|
|
253
253
|
label?: string;
|
|
254
|
+
slug?: string;
|
|
254
255
|
description?: string;
|
|
255
256
|
$locale?: string;
|
|
256
257
|
};
|
|
257
258
|
}
|
|
258
259
|
interface ThemePageAdditionalProps {
|
|
259
|
-
description?: string;
|
|
260
260
|
current: number;
|
|
261
261
|
label: string;
|
|
262
|
+
title: string;
|
|
262
263
|
slug?: string;
|
|
264
|
+
description?: string;
|
|
263
265
|
$locale?: string;
|
|
264
266
|
}
|
|
265
267
|
export interface ThemeCustomPage extends ThemePageAdditionalProps {
|