autumn-js 0.0.52 → 0.0.53
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/libraries/react/{chunk-CZDMG3HO.mjs → chunk-WCVQJZIX.mjs} +7 -2
- package/dist/libraries/react/client/types/clientGenTypes.d.mts +1 -0
- package/dist/libraries/react/client/types/clientGenTypes.d.ts +1 -0
- package/dist/libraries/react/hooks/useAutumn.js +7 -2
- package/dist/libraries/react/hooks/useAutumn.mjs +1 -1
- package/dist/libraries/react/index.js +7 -2
- package/dist/libraries/react/index.mjs +1 -1
- package/dist/next/client/hooks/types.d.mts +1 -0
- package/dist/next/client/hooks/types.d.ts +1 -0
- package/dist/next/client/hooks/useAutumn.d.mts +1 -1
- package/dist/next/client/hooks/useAutumn.d.ts +1 -1
- package/dist/next/client/hooks/useAutumn.js +13 -5
- package/dist/next/client/hooks/useAutumn.mjs +13 -5
- package/dist/next/index.d.mts +2 -1
- package/dist/next/index.d.ts +2 -1
- package/package.json +1 -1
|
@@ -59,7 +59,8 @@ var useAutumn = () => {
|
|
|
59
59
|
metadata,
|
|
60
60
|
dialog,
|
|
61
61
|
callback,
|
|
62
|
-
entityData
|
|
62
|
+
entityData,
|
|
63
|
+
openInNewTab
|
|
63
64
|
} = params;
|
|
64
65
|
if (dialog) {
|
|
65
66
|
setProdChangeComponent(dialog);
|
|
@@ -81,7 +82,11 @@ var useAutumn = () => {
|
|
|
81
82
|
}
|
|
82
83
|
let data = result.data;
|
|
83
84
|
if (data?.checkout_url && typeof window !== "undefined") {
|
|
84
|
-
|
|
85
|
+
if (openInNewTab) {
|
|
86
|
+
window.open(data.checkout_url, "_blank");
|
|
87
|
+
} else {
|
|
88
|
+
window.location.href = data.checkout_url;
|
|
89
|
+
}
|
|
85
90
|
}
|
|
86
91
|
try {
|
|
87
92
|
await callback?.();
|
|
@@ -725,7 +725,8 @@ var useAutumn = () => {
|
|
|
725
725
|
metadata,
|
|
726
726
|
dialog,
|
|
727
727
|
callback,
|
|
728
|
-
entityData
|
|
728
|
+
entityData,
|
|
729
|
+
openInNewTab
|
|
729
730
|
} = params;
|
|
730
731
|
if (dialog) {
|
|
731
732
|
setProdChangeComponent(dialog);
|
|
@@ -747,7 +748,11 @@ var useAutumn = () => {
|
|
|
747
748
|
}
|
|
748
749
|
let data = result.data;
|
|
749
750
|
if (data?.checkout_url && typeof window !== "undefined") {
|
|
750
|
-
|
|
751
|
+
if (openInNewTab) {
|
|
752
|
+
window.open(data.checkout_url, "_blank");
|
|
753
|
+
} else {
|
|
754
|
+
window.location.href = data.checkout_url;
|
|
755
|
+
}
|
|
751
756
|
}
|
|
752
757
|
try {
|
|
753
758
|
await callback?.();
|
|
@@ -1028,7 +1028,8 @@ var useAutumn = () => {
|
|
|
1028
1028
|
metadata,
|
|
1029
1029
|
dialog,
|
|
1030
1030
|
callback,
|
|
1031
|
-
entityData
|
|
1031
|
+
entityData,
|
|
1032
|
+
openInNewTab
|
|
1032
1033
|
} = params;
|
|
1033
1034
|
if (dialog) {
|
|
1034
1035
|
setProdChangeComponent(dialog);
|
|
@@ -1050,7 +1051,11 @@ var useAutumn = () => {
|
|
|
1050
1051
|
}
|
|
1051
1052
|
let data = result.data;
|
|
1052
1053
|
if (data?.checkout_url && typeof window !== "undefined") {
|
|
1053
|
-
|
|
1054
|
+
if (openInNewTab) {
|
|
1055
|
+
window.open(data.checkout_url, "_blank");
|
|
1056
|
+
} else {
|
|
1057
|
+
window.location.href = data.checkout_url;
|
|
1058
|
+
}
|
|
1054
1059
|
}
|
|
1055
1060
|
try {
|
|
1056
1061
|
await callback?.();
|
|
@@ -12,7 +12,7 @@ interface TrackParams {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
declare const useAutumn: () => {
|
|
15
|
-
attach: ({ productId, entityId, options, successUrl, forceCheckout, metadata, dialog, callback, entityData, }: AttachParams) => Promise<any>;
|
|
15
|
+
attach: ({ productId, entityId, options, successUrl, forceCheckout, metadata, dialog, callback, entityData, openInNewTab, }: AttachParams) => Promise<any>;
|
|
16
16
|
check: ({ featureId, productId, entityId, requiredQuantity, sendEvent, withPreview, dialog, entityData, }: {
|
|
17
17
|
featureId?: string;
|
|
18
18
|
productId?: string;
|
|
@@ -12,7 +12,7 @@ interface TrackParams {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
declare const useAutumn: () => {
|
|
15
|
-
attach: ({ productId, entityId, options, successUrl, forceCheckout, metadata, dialog, callback, entityData, }: AttachParams) => Promise<any>;
|
|
15
|
+
attach: ({ productId, entityId, options, successUrl, forceCheckout, metadata, dialog, callback, entityData, openInNewTab, }: AttachParams) => Promise<any>;
|
|
16
16
|
check: ({ featureId, productId, entityId, requiredQuantity, sendEvent, withPreview, dialog, entityData, }: {
|
|
17
17
|
featureId?: string;
|
|
18
18
|
productId?: string;
|
|
@@ -34,7 +34,8 @@ const useAutumn = () => {
|
|
|
34
34
|
forceCheckout,
|
|
35
35
|
metadata,
|
|
36
36
|
callback,
|
|
37
|
-
entityData
|
|
37
|
+
entityData,
|
|
38
|
+
openInNewTab
|
|
38
39
|
}) => {
|
|
39
40
|
const attachWithoutDialog = async (options) => {
|
|
40
41
|
try {
|
|
@@ -45,7 +46,8 @@ const useAutumn = () => {
|
|
|
45
46
|
successUrl,
|
|
46
47
|
forceCheckout,
|
|
47
48
|
metadata,
|
|
48
|
-
entityData
|
|
49
|
+
entityData,
|
|
50
|
+
openInNewTab
|
|
49
51
|
});
|
|
50
52
|
} catch (error2) {
|
|
51
53
|
return toClientErrorResponse(error2);
|
|
@@ -82,7 +84,8 @@ const useAutumn = () => {
|
|
|
82
84
|
metadata,
|
|
83
85
|
dialog,
|
|
84
86
|
callback,
|
|
85
|
-
entityData
|
|
87
|
+
entityData,
|
|
88
|
+
openInNewTab
|
|
86
89
|
}) => {
|
|
87
90
|
if (dialog) {
|
|
88
91
|
setProdChangeComponent(dialog);
|
|
@@ -93,7 +96,8 @@ const useAutumn = () => {
|
|
|
93
96
|
forceCheckout,
|
|
94
97
|
metadata,
|
|
95
98
|
callback,
|
|
96
|
-
entityData
|
|
99
|
+
entityData,
|
|
100
|
+
openInNewTab
|
|
97
101
|
});
|
|
98
102
|
}
|
|
99
103
|
let snakeOptions = options?.map((option) => ({
|
|
@@ -115,7 +119,11 @@ const useAutumn = () => {
|
|
|
115
119
|
}
|
|
116
120
|
let data = result.data;
|
|
117
121
|
if (data?.checkout_url && typeof window !== "undefined") {
|
|
118
|
-
|
|
122
|
+
if (openInNewTab) {
|
|
123
|
+
window.open(data.checkout_url, "_blank");
|
|
124
|
+
} else {
|
|
125
|
+
window.open(data.checkout_url, "_self");
|
|
126
|
+
}
|
|
119
127
|
}
|
|
120
128
|
try {
|
|
121
129
|
await callback?.();
|
|
@@ -34,7 +34,8 @@ const useAutumn = () => {
|
|
|
34
34
|
forceCheckout,
|
|
35
35
|
metadata,
|
|
36
36
|
callback,
|
|
37
|
-
entityData
|
|
37
|
+
entityData,
|
|
38
|
+
openInNewTab
|
|
38
39
|
}) => {
|
|
39
40
|
const attachWithoutDialog = async (options) => {
|
|
40
41
|
try {
|
|
@@ -45,7 +46,8 @@ const useAutumn = () => {
|
|
|
45
46
|
successUrl,
|
|
46
47
|
forceCheckout,
|
|
47
48
|
metadata,
|
|
48
|
-
entityData
|
|
49
|
+
entityData,
|
|
50
|
+
openInNewTab
|
|
49
51
|
});
|
|
50
52
|
} catch (error2) {
|
|
51
53
|
return toClientErrorResponse(error2);
|
|
@@ -82,7 +84,8 @@ const useAutumn = () => {
|
|
|
82
84
|
metadata,
|
|
83
85
|
dialog,
|
|
84
86
|
callback,
|
|
85
|
-
entityData
|
|
87
|
+
entityData,
|
|
88
|
+
openInNewTab
|
|
86
89
|
}) => {
|
|
87
90
|
if (dialog) {
|
|
88
91
|
setProdChangeComponent(dialog);
|
|
@@ -93,7 +96,8 @@ const useAutumn = () => {
|
|
|
93
96
|
forceCheckout,
|
|
94
97
|
metadata,
|
|
95
98
|
callback,
|
|
96
|
-
entityData
|
|
99
|
+
entityData,
|
|
100
|
+
openInNewTab
|
|
97
101
|
});
|
|
98
102
|
}
|
|
99
103
|
let snakeOptions = options?.map((option) => ({
|
|
@@ -115,7 +119,11 @@ const useAutumn = () => {
|
|
|
115
119
|
}
|
|
116
120
|
let data = result.data;
|
|
117
121
|
if (data?.checkout_url && typeof window !== "undefined") {
|
|
118
|
-
|
|
122
|
+
if (openInNewTab) {
|
|
123
|
+
window.open(data.checkout_url, "_blank");
|
|
124
|
+
} else {
|
|
125
|
+
window.open(data.checkout_url, "_self");
|
|
126
|
+
}
|
|
119
127
|
}
|
|
120
128
|
try {
|
|
121
129
|
await callback?.();
|
package/dist/next/index.d.mts
CHANGED
|
@@ -23,6 +23,7 @@ interface AttachParams {
|
|
|
23
23
|
callback?: () => Promise<void>;
|
|
24
24
|
withPreview?: "formatted" | "raw";
|
|
25
25
|
entityData?: EntityDataParams;
|
|
26
|
+
openInNewTab?: boolean;
|
|
26
27
|
}
|
|
27
28
|
interface CreateEntityParams {
|
|
28
29
|
id: string;
|
|
@@ -40,7 +41,7 @@ interface TrackParams {
|
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
declare const useAutumn: () => {
|
|
43
|
-
attach: ({ productId, entityId, options, successUrl, forceCheckout, metadata, dialog, callback, entityData, }: AttachParams) => Promise<any>;
|
|
44
|
+
attach: ({ productId, entityId, options, successUrl, forceCheckout, metadata, dialog, callback, entityData, openInNewTab, }: AttachParams) => Promise<any>;
|
|
44
45
|
check: ({ featureId, productId, entityId, requiredQuantity, sendEvent, withPreview, dialog, entityData, }: {
|
|
45
46
|
featureId?: string;
|
|
46
47
|
productId?: string;
|
package/dist/next/index.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ interface AttachParams {
|
|
|
23
23
|
callback?: () => Promise<void>;
|
|
24
24
|
withPreview?: "formatted" | "raw";
|
|
25
25
|
entityData?: EntityDataParams;
|
|
26
|
+
openInNewTab?: boolean;
|
|
26
27
|
}
|
|
27
28
|
interface CreateEntityParams {
|
|
28
29
|
id: string;
|
|
@@ -40,7 +41,7 @@ interface TrackParams {
|
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
declare const useAutumn: () => {
|
|
43
|
-
attach: ({ productId, entityId, options, successUrl, forceCheckout, metadata, dialog, callback, entityData, }: AttachParams) => Promise<any>;
|
|
44
|
+
attach: ({ productId, entityId, options, successUrl, forceCheckout, metadata, dialog, callback, entityData, openInNewTab, }: AttachParams) => Promise<any>;
|
|
44
45
|
check: ({ featureId, productId, entityId, requiredQuantity, sendEvent, withPreview, dialog, entityData, }: {
|
|
45
46
|
featureId?: string;
|
|
46
47
|
productId?: string;
|