@stripe/connect-js 3.3.11-beta-1 → 3.3.13-beta-1
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/connect.esm.js +13 -3
- package/dist/connect.js +13 -3
- package/dist/pure.esm.js +13 -3
- package/dist/pure.js +13 -3
- package/dist/src/utils/jestHelpers.d.ts +1 -1
- package/dist/types/config.d.ts +13 -0
- package/package.json +1 -1
- package/src/shared.ts +7 -2
- package/src/utils/jestHelpers.ts +1 -1
- package/types/config.ts +18 -0
package/dist/connect.esm.js
CHANGED
|
@@ -35,6 +35,15 @@ const ConnectElementCustomMethodConfig = {
|
|
|
35
35
|
},
|
|
36
36
|
"financial-account-transactions": {
|
|
37
37
|
setFinancialAccount: _financialAccount => {}
|
|
38
|
+
},
|
|
39
|
+
"app-install": {
|
|
40
|
+
setApp: _app => {},
|
|
41
|
+
setOnAppInstallStateFetched: _listener => {},
|
|
42
|
+
setOnAppInstallStateChanged: _listener => {}
|
|
43
|
+
},
|
|
44
|
+
"app-viewport": {
|
|
45
|
+
setApp: _app => {},
|
|
46
|
+
setAppData: _appData => {}
|
|
38
47
|
}
|
|
39
48
|
};
|
|
40
49
|
|
|
@@ -62,12 +71,13 @@ const componentNameMapping = {
|
|
|
62
71
|
};
|
|
63
72
|
const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
|
|
64
73
|
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
74
|
+
const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
65
75
|
const findScript = () => {
|
|
66
|
-
return document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
|
|
76
|
+
return document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || null;
|
|
67
77
|
};
|
|
68
78
|
const injectScript = () => {
|
|
69
79
|
const script = document.createElement("script");
|
|
70
|
-
script.src =
|
|
80
|
+
script.src = V1_URL;
|
|
71
81
|
const head = document.head;
|
|
72
82
|
if (!head) {
|
|
73
83
|
throw new Error("Expected document.head not to be null. Connect.js requires a <head> element.");
|
|
@@ -201,7 +211,7 @@ const createWrapper = stripeConnect => {
|
|
|
201
211
|
sdk: true,
|
|
202
212
|
sdkOptions: {
|
|
203
213
|
// This will be replaced by the npm package version when bundling
|
|
204
|
-
sdkVersion: "3.3.
|
|
214
|
+
sdkVersion: "3.3.13-beta-1"
|
|
205
215
|
}
|
|
206
216
|
})
|
|
207
217
|
}));
|
package/dist/connect.js
CHANGED
|
@@ -39,6 +39,15 @@ const ConnectElementCustomMethodConfig = {
|
|
|
39
39
|
},
|
|
40
40
|
"financial-account-transactions": {
|
|
41
41
|
setFinancialAccount: _financialAccount => {}
|
|
42
|
+
},
|
|
43
|
+
"app-install": {
|
|
44
|
+
setApp: _app => {},
|
|
45
|
+
setOnAppInstallStateFetched: _listener => {},
|
|
46
|
+
setOnAppInstallStateChanged: _listener => {}
|
|
47
|
+
},
|
|
48
|
+
"app-viewport": {
|
|
49
|
+
setApp: _app => {},
|
|
50
|
+
setAppData: _appData => {}
|
|
42
51
|
}
|
|
43
52
|
};
|
|
44
53
|
|
|
@@ -66,12 +75,13 @@ const componentNameMapping = {
|
|
|
66
75
|
};
|
|
67
76
|
const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
|
|
68
77
|
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
78
|
+
const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
69
79
|
const findScript = () => {
|
|
70
|
-
return document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
|
|
80
|
+
return document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || null;
|
|
71
81
|
};
|
|
72
82
|
const injectScript = () => {
|
|
73
83
|
const script = document.createElement("script");
|
|
74
|
-
script.src =
|
|
84
|
+
script.src = V1_URL;
|
|
75
85
|
const head = document.head;
|
|
76
86
|
if (!head) {
|
|
77
87
|
throw new Error("Expected document.head not to be null. Connect.js requires a <head> element.");
|
|
@@ -205,7 +215,7 @@ const createWrapper = stripeConnect => {
|
|
|
205
215
|
sdk: true,
|
|
206
216
|
sdkOptions: {
|
|
207
217
|
// This will be replaced by the npm package version when bundling
|
|
208
|
-
sdkVersion: "3.3.
|
|
218
|
+
sdkVersion: "3.3.13-beta-1"
|
|
209
219
|
}
|
|
210
220
|
})
|
|
211
221
|
}));
|
package/dist/pure.esm.js
CHANGED
|
@@ -35,6 +35,15 @@ const ConnectElementCustomMethodConfig = {
|
|
|
35
35
|
},
|
|
36
36
|
"financial-account-transactions": {
|
|
37
37
|
setFinancialAccount: _financialAccount => {}
|
|
38
|
+
},
|
|
39
|
+
"app-install": {
|
|
40
|
+
setApp: _app => {},
|
|
41
|
+
setOnAppInstallStateFetched: _listener => {},
|
|
42
|
+
setOnAppInstallStateChanged: _listener => {}
|
|
43
|
+
},
|
|
44
|
+
"app-viewport": {
|
|
45
|
+
setApp: _app => {},
|
|
46
|
+
setAppData: _appData => {}
|
|
38
47
|
}
|
|
39
48
|
};
|
|
40
49
|
|
|
@@ -62,12 +71,13 @@ const componentNameMapping = {
|
|
|
62
71
|
};
|
|
63
72
|
const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
|
|
64
73
|
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
74
|
+
const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
65
75
|
const findScript = () => {
|
|
66
|
-
return document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
|
|
76
|
+
return document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || null;
|
|
67
77
|
};
|
|
68
78
|
const injectScript = () => {
|
|
69
79
|
const script = document.createElement("script");
|
|
70
|
-
script.src =
|
|
80
|
+
script.src = V1_URL;
|
|
71
81
|
const head = document.head;
|
|
72
82
|
if (!head) {
|
|
73
83
|
throw new Error("Expected document.head not to be null. Connect.js requires a <head> element.");
|
|
@@ -201,7 +211,7 @@ const createWrapper = stripeConnect => {
|
|
|
201
211
|
sdk: true,
|
|
202
212
|
sdkOptions: {
|
|
203
213
|
// This will be replaced by the npm package version when bundling
|
|
204
|
-
sdkVersion: "3.3.
|
|
214
|
+
sdkVersion: "3.3.13-beta-1"
|
|
205
215
|
}
|
|
206
216
|
})
|
|
207
217
|
}));
|
package/dist/pure.js
CHANGED
|
@@ -39,6 +39,15 @@ const ConnectElementCustomMethodConfig = {
|
|
|
39
39
|
},
|
|
40
40
|
"financial-account-transactions": {
|
|
41
41
|
setFinancialAccount: _financialAccount => {}
|
|
42
|
+
},
|
|
43
|
+
"app-install": {
|
|
44
|
+
setApp: _app => {},
|
|
45
|
+
setOnAppInstallStateFetched: _listener => {},
|
|
46
|
+
setOnAppInstallStateChanged: _listener => {}
|
|
47
|
+
},
|
|
48
|
+
"app-viewport": {
|
|
49
|
+
setApp: _app => {},
|
|
50
|
+
setAppData: _appData => {}
|
|
42
51
|
}
|
|
43
52
|
};
|
|
44
53
|
|
|
@@ -66,12 +75,13 @@ const componentNameMapping = {
|
|
|
66
75
|
};
|
|
67
76
|
const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
|
|
68
77
|
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
78
|
+
const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
69
79
|
const findScript = () => {
|
|
70
|
-
return document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
|
|
80
|
+
return document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || null;
|
|
71
81
|
};
|
|
72
82
|
const injectScript = () => {
|
|
73
83
|
const script = document.createElement("script");
|
|
74
|
-
script.src =
|
|
84
|
+
script.src = V1_URL;
|
|
75
85
|
const head = document.head;
|
|
76
86
|
if (!head) {
|
|
77
87
|
throw new Error("Expected document.head not to be null. Connect.js requires a <head> element.");
|
|
@@ -205,7 +215,7 @@ const createWrapper = stripeConnect => {
|
|
|
205
215
|
sdk: true,
|
|
206
216
|
sdkOptions: {
|
|
207
217
|
// This will be replaced by the npm package version when bundling
|
|
208
|
-
sdkVersion: "3.3.
|
|
218
|
+
sdkVersion: "3.3.13-beta-1"
|
|
209
219
|
}
|
|
210
220
|
})
|
|
211
221
|
}));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const SCRIPT_SELECTOR = "script[src^=\"https://connect-js.stripe.com/
|
|
1
|
+
export declare const SCRIPT_SELECTOR = "script[src^=\"https://connect-js.stripe.com/v1.0/connect.js\"]";
|
|
2
2
|
export {};
|
package/dist/types/config.d.ts
CHANGED
|
@@ -14,6 +14,10 @@ export type NotificationCount = {
|
|
|
14
14
|
total: number;
|
|
15
15
|
actionRequired: number;
|
|
16
16
|
};
|
|
17
|
+
export type InstallState = {
|
|
18
|
+
appId: string;
|
|
19
|
+
state: "INSTALLED" | "UNINSTALLED";
|
|
20
|
+
};
|
|
17
21
|
export declare const ConnectElementCustomMethodConfig: {
|
|
18
22
|
"payment-details": {
|
|
19
23
|
setPayment: (_payment: string | undefined) => void;
|
|
@@ -50,4 +54,13 @@ export declare const ConnectElementCustomMethodConfig: {
|
|
|
50
54
|
"financial-account-transactions": {
|
|
51
55
|
setFinancialAccount: (_financialAccount: string) => void;
|
|
52
56
|
};
|
|
57
|
+
"app-install": {
|
|
58
|
+
setApp: (_app: string | undefined) => void;
|
|
59
|
+
setOnAppInstallStateFetched: (_listener: (({ appId, state }: InstallState) => void) | undefined) => void;
|
|
60
|
+
setOnAppInstallStateChanged: (_listener: (({ appId, state }: InstallState) => void) | undefined) => void;
|
|
61
|
+
};
|
|
62
|
+
"app-viewport": {
|
|
63
|
+
setApp: (_app: string | undefined) => void;
|
|
64
|
+
setAppData: (_appData: Record<string, string> | undefined) => void;
|
|
65
|
+
};
|
|
53
66
|
};
|
package/package.json
CHANGED
package/src/shared.ts
CHANGED
|
@@ -70,18 +70,23 @@ interface StripeConnectWrapper {
|
|
|
70
70
|
const EXISTING_SCRIPT_MESSAGE =
|
|
71
71
|
"loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
|
|
72
72
|
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
73
|
+
const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
73
74
|
|
|
74
75
|
export const findScript = (): HTMLScriptElement | null => {
|
|
75
76
|
return (
|
|
76
77
|
document.querySelectorAll<HTMLScriptElement>(
|
|
77
78
|
`script[src="${V0_URL}"]`
|
|
78
|
-
)[0] ||
|
|
79
|
+
)[0] ||
|
|
80
|
+
document.querySelectorAll<HTMLScriptElement>(
|
|
81
|
+
`script[src="${V1_URL}"]`
|
|
82
|
+
)[0] ||
|
|
83
|
+
null
|
|
79
84
|
);
|
|
80
85
|
};
|
|
81
86
|
|
|
82
87
|
const injectScript = (): HTMLScriptElement => {
|
|
83
88
|
const script = document.createElement("script");
|
|
84
|
-
script.src =
|
|
89
|
+
script.src = V1_URL;
|
|
85
90
|
|
|
86
91
|
const head = document.head;
|
|
87
92
|
|
package/src/utils/jestHelpers.ts
CHANGED
package/types/config.ts
CHANGED
|
@@ -20,6 +20,11 @@ export type NotificationCount = {
|
|
|
20
20
|
actionRequired: number;
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
+
export type InstallState = {
|
|
24
|
+
appId: string;
|
|
25
|
+
state: "INSTALLED" | "UNINSTALLED";
|
|
26
|
+
};
|
|
27
|
+
|
|
23
28
|
export const ConnectElementCustomMethodConfig = {
|
|
24
29
|
"payment-details": {
|
|
25
30
|
setPayment: (_payment: string | undefined): void => {},
|
|
@@ -75,5 +80,18 @@ export const ConnectElementCustomMethodConfig = {
|
|
|
75
80
|
},
|
|
76
81
|
"financial-account-transactions": {
|
|
77
82
|
setFinancialAccount: (_financialAccount: string): void => {}
|
|
83
|
+
},
|
|
84
|
+
"app-install": {
|
|
85
|
+
setApp: (_app: string | undefined): void => {},
|
|
86
|
+
setOnAppInstallStateFetched: (
|
|
87
|
+
_listener: (({ appId, state }: InstallState) => void) | undefined
|
|
88
|
+
): void => {},
|
|
89
|
+
setOnAppInstallStateChanged: (
|
|
90
|
+
_listener: (({ appId, state }: InstallState) => void) | undefined
|
|
91
|
+
): void => {}
|
|
92
|
+
},
|
|
93
|
+
"app-viewport": {
|
|
94
|
+
setApp: (_app: string | undefined): void => {},
|
|
95
|
+
setAppData: (_appData: Record<string, string> | undefined): void => {}
|
|
78
96
|
}
|
|
79
97
|
};
|