@stripe/connect-js 3.3.28-preview-1 → 3.3.28
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/README.md +3 -3
- package/dist/connect.esm.js +43 -84
- package/dist/connect.js +43 -84
- package/dist/pure.esm.js +35 -76
- package/dist/pure.js +35 -76
- package/dist/src/index.d.ts +1 -1
- package/dist/src/pure.d.ts +1 -1
- package/dist/src/shared.d.ts +3 -2
- package/dist/types/config.d.ts +19 -67
- package/package.json +14 -10
- package/src/index.ts +3 -6
- package/src/pure.test.ts +2 -2
- package/src/pure.ts +3 -6
- package/src/shared.ts +53 -59
- package/types/checks.ts +2 -2
- package/types/config.ts +32 -111
- package/types/index.d.ts +1 -1
- package/types/shared.d.ts +12 -19
package/dist/pure.js
CHANGED
|
@@ -9,13 +9,6 @@ const ConnectElementCommonMethodConfig = {
|
|
|
9
9
|
setOnLoaderStart: _listener => {}
|
|
10
10
|
};
|
|
11
11
|
const ConnectElementCustomMethodConfig = {
|
|
12
|
-
payments: {
|
|
13
|
-
setDefaultFilters: _filters => {}
|
|
14
|
-
},
|
|
15
|
-
"payment-details": {
|
|
16
|
-
setPayment: _payment => {},
|
|
17
|
-
setOnClose: _listener => {}
|
|
18
|
-
},
|
|
19
12
|
"account-onboarding": {
|
|
20
13
|
setFullTermsOfServiceUrl: _termOfServiceUrl => {},
|
|
21
14
|
setRecipientTermsOfServiceUrl: _recipientTermsOfServiceUrl => {},
|
|
@@ -32,6 +25,10 @@ const ConnectElementCustomMethodConfig = {
|
|
|
32
25
|
setCollectionOptions: _collectionOptions => {},
|
|
33
26
|
setOnNotificationsChange: _listener => {}
|
|
34
27
|
},
|
|
28
|
+
"instant-payouts-promotion": {
|
|
29
|
+
setOnInstantPayoutsPromotionLoaded: _listener => {},
|
|
30
|
+
setOnInstantPayoutCreated: _listener => {}
|
|
31
|
+
},
|
|
35
32
|
"issuing-card": {
|
|
36
33
|
setDefaultCard: _defaultCard => {},
|
|
37
34
|
setCardSwitching: _cardSwitching => {},
|
|
@@ -49,46 +46,16 @@ const ConnectElementCustomMethodConfig = {
|
|
|
49
46
|
"financial-account-transactions": {
|
|
50
47
|
setFinancialAccount: _financialAccount => {}
|
|
51
48
|
},
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
},
|
|
55
|
-
"app-install": {
|
|
56
|
-
setApp: _app => {},
|
|
57
|
-
setOnAppInstallStateFetched: _listener => {},
|
|
58
|
-
setOnAppInstallStateChanged: _listener => {}
|
|
59
|
-
},
|
|
60
|
-
"app-viewport": {
|
|
61
|
-
setApp: _app => {},
|
|
62
|
-
setAppData: _appData => {}
|
|
63
|
-
},
|
|
64
|
-
"payment-method-settings": {
|
|
65
|
-
setPaymentMethodConfiguration: _paymentMethodConfiguration => {}
|
|
66
|
-
},
|
|
67
|
-
"capital-financing": {
|
|
68
|
-
setDefaultFinancingOffer: _defaultFinancingOffer => {},
|
|
69
|
-
setShowFinancingSelector: _showFinancingSelector => {},
|
|
70
|
-
setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
|
|
71
|
-
setSupportUrl: _supportUrl => {},
|
|
72
|
-
setOnFinancingsLoaded: _listener => {}
|
|
73
|
-
},
|
|
74
|
-
"capital-financing-application": {
|
|
75
|
-
setOnApplicationSubmitted: _listener => {},
|
|
76
|
-
setPrivacyPolicyUrl: _privacyPolicyUrl => {},
|
|
77
|
-
setHowCapitalWorksUrl: _howCapitalWorksUrl => {}
|
|
49
|
+
payments: {
|
|
50
|
+
setDefaultFilters: _filters => {}
|
|
78
51
|
},
|
|
79
|
-
"
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
setOnEligibleFinancingOfferLoaded: _listener => {},
|
|
83
|
-
setPrivacyPolicyUrl: _privacyPolicyUrl => {},
|
|
84
|
-
setHowCapitalWorksUrl: _howCapitalWorksUrl => {},
|
|
85
|
-
setEligibilityCriteriaUrl: _eligibilityCriteriaUrl => {}
|
|
52
|
+
"payment-details": {
|
|
53
|
+
setPayment: _payment => {},
|
|
54
|
+
setOnClose: _listener => {}
|
|
86
55
|
},
|
|
87
|
-
"
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
setIntervalEnd: _intervalEnd => {},
|
|
91
|
-
setIntervalType: _intervalType => {}
|
|
56
|
+
"payment-disputes": {
|
|
57
|
+
setPayment: _payment => {},
|
|
58
|
+
setOnDisputesLoaded: _listener => {}
|
|
92
59
|
},
|
|
93
60
|
"tax-settings": {
|
|
94
61
|
setHideProductTaxCodeSelector: _hidden => {},
|
|
@@ -99,51 +66,38 @@ const ConnectElementCustomMethodConfig = {
|
|
|
99
66
|
setOnAfterTaxRegistrationAdded: _listener => {},
|
|
100
67
|
setDisplayCountries: _countries => {}
|
|
101
68
|
},
|
|
102
|
-
"
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
"product-tax-code-selector": {
|
|
106
|
-
setOnTaxCodeSelect: _listener => {},
|
|
107
|
-
setHideDescription: _hideDescription => {},
|
|
108
|
-
setDisabled: _disabled => {},
|
|
109
|
-
setInitialTaxCode: _initialTaxCode => {}
|
|
69
|
+
"payout-details": {
|
|
70
|
+
setPayout: _payout => {},
|
|
71
|
+
setOnClose: _listener => {}
|
|
110
72
|
}
|
|
111
73
|
};
|
|
112
74
|
|
|
113
75
|
const componentNameMapping = {
|
|
76
|
+
"account-onboarding": "stripe-connect-account-onboarding",
|
|
77
|
+
"disputes-list": "stripe-connect-disputes-list",
|
|
114
78
|
payments: "stripe-connect-payments",
|
|
115
|
-
payouts: "stripe-connect-payouts",
|
|
116
79
|
"payment-details": "stripe-connect-payment-details",
|
|
117
|
-
"
|
|
118
|
-
|
|
80
|
+
"payment-disputes": "stripe-connect-payment-disputes",
|
|
81
|
+
payouts: "stripe-connect-payouts",
|
|
82
|
+
"payouts-list": "stripe-connect-payouts-list",
|
|
83
|
+
"payout-details": "stripe-connect-payout-details",
|
|
84
|
+
balances: "stripe-connect-balances",
|
|
119
85
|
"account-management": "stripe-connect-account-management",
|
|
120
86
|
"notification-banner": "stripe-connect-notification-banner",
|
|
121
|
-
"instant-payouts": "stripe-connect-instant-payouts",
|
|
87
|
+
"instant-payouts-promotion": "stripe-connect-instant-payouts-promotion",
|
|
122
88
|
"issuing-card": "stripe-connect-issuing-card",
|
|
123
89
|
"issuing-cards-list": "stripe-connect-issuing-cards-list",
|
|
124
90
|
"financial-account": "stripe-connect-financial-account",
|
|
125
|
-
recipients: "stripe-connect-recipients",
|
|
126
91
|
"financial-account-transactions": "stripe-connect-financial-account-transactions",
|
|
127
|
-
"capital-financing": "stripe-connect-capital-financing",
|
|
128
|
-
"capital-financing-application": "stripe-connect-capital-financing-application",
|
|
129
|
-
"capital-financing-promotion": "stripe-connect-capital-financing-promotion",
|
|
130
|
-
"capital-overview": "stripe-connect-capital-overview",
|
|
131
92
|
documents: "stripe-connect-documents",
|
|
132
|
-
"product-tax-code-selector": "stripe-connect-product-tax-code-selector",
|
|
133
93
|
"tax-registrations": "stripe-connect-tax-registrations",
|
|
134
|
-
"tax-settings": "stripe-connect-tax-settings"
|
|
135
|
-
"tax-threshold-monitoring": "stripe-connect-tax-threshold-monitoring",
|
|
136
|
-
balances: "stripe-connect-balances",
|
|
137
|
-
"payouts-list": "stripe-connect-payouts-list",
|
|
138
|
-
"app-install": "stripe-connect-app-install",
|
|
139
|
-
"app-viewport": "stripe-connect-app-viewport",
|
|
140
|
-
"reporting-chart": "stripe-connect-reporting-chart"
|
|
94
|
+
"tax-settings": "stripe-connect-tax-settings"
|
|
141
95
|
};
|
|
142
96
|
const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
|
|
143
97
|
const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
|
|
144
98
|
const V1_URL = "https://connect-js.stripe.com/v1.0/connect.js";
|
|
145
99
|
const findScript = () => {
|
|
146
|
-
return document.querySelectorAll(`script[src="${
|
|
100
|
+
return document.querySelectorAll(`script[src="${V1_URL}"]`)[0] || document.querySelectorAll(`script[src="${V0_URL}"]`)[0] || null;
|
|
147
101
|
};
|
|
148
102
|
const injectScript = () => {
|
|
149
103
|
const script = document.createElement("script");
|
|
@@ -156,6 +110,13 @@ const injectScript = () => {
|
|
|
156
110
|
return script;
|
|
157
111
|
};
|
|
158
112
|
let stripePromise = null;
|
|
113
|
+
const isWindowStripeConnectDefined = stripeConnect => {
|
|
114
|
+
// We only consider `StripeConnect` defined if `init` is a function
|
|
115
|
+
// Why? HTML markup like:
|
|
116
|
+
// <a id="StripeConnect"><a id="StripeConnect" name="init" href="stripe"></a></a> in the <head> of the page
|
|
117
|
+
// can end up "contaminating" the window.StripeConnect object and cause issues in connect.js initialization
|
|
118
|
+
return !!(stripeConnect && typeof stripeConnect === "object" && "init" in stripeConnect && typeof stripeConnect.init === "function");
|
|
119
|
+
};
|
|
159
120
|
const loadScript = () => {
|
|
160
121
|
// Ensure that we only attempt to load Connect.js at most once
|
|
161
122
|
if (stripePromise !== null) {
|
|
@@ -166,10 +127,8 @@ const loadScript = () => {
|
|
|
166
127
|
reject("ConnectJS won't load when rendering code in the server - it can only be loaded on a browser. This error is expected when loading ConnectJS in SSR environments, like NextJS. It will have no impact in the UI, however if you wish to avoid it, you can switch to the `pure` version of the connect.js loader: https://github.com/stripe/connect-js#importing-loadconnect-without-side-effects.");
|
|
167
128
|
return;
|
|
168
129
|
}
|
|
169
|
-
if (window.StripeConnect) {
|
|
130
|
+
if (isWindowStripeConnectDefined(window.StripeConnect)) {
|
|
170
131
|
console.warn(EXISTING_SCRIPT_MESSAGE);
|
|
171
|
-
}
|
|
172
|
-
if (window.StripeConnect) {
|
|
173
132
|
const wrapper = createWrapper(window.StripeConnect);
|
|
174
133
|
resolve(wrapper);
|
|
175
134
|
return;
|
|
@@ -182,7 +141,7 @@ const loadScript = () => {
|
|
|
182
141
|
script = injectScript();
|
|
183
142
|
}
|
|
184
143
|
script.addEventListener("load", () => {
|
|
185
|
-
if (window.StripeConnect) {
|
|
144
|
+
if (isWindowStripeConnectDefined(window.StripeConnect)) {
|
|
186
145
|
const wrapper = createWrapper(window.StripeConnect);
|
|
187
146
|
resolve(wrapper);
|
|
188
147
|
} else {
|
|
@@ -280,7 +239,7 @@ const createWrapper = stripeConnect => {
|
|
|
280
239
|
sdk: true,
|
|
281
240
|
sdkOptions: {
|
|
282
241
|
// This will be replaced by the npm package version when bundling
|
|
283
|
-
sdkVersion: "3.3.28
|
|
242
|
+
sdkVersion: "3.3.28"
|
|
284
243
|
}
|
|
285
244
|
})
|
|
286
245
|
}));
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { LoadConnectAndInitialize } from "./shared";
|
|
1
|
+
import type { LoadConnectAndInitialize } from "./shared";
|
|
2
2
|
export declare const loadConnectAndInitialize: LoadConnectAndInitialize;
|
package/dist/src/pure.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { LoadConnectAndInitialize } from "./shared";
|
|
1
|
+
import type { LoadConnectAndInitialize } from "./shared";
|
|
2
2
|
export declare const loadConnectAndInitialize: LoadConnectAndInitialize;
|
package/dist/src/shared.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IStripeConnectInitParams, StripeConnectInstance, ConnectElementTagName } from "../types";
|
|
1
|
+
import type { IStripeConnectInitParams, StripeConnectInstance, ConnectElementTagName } from "../types";
|
|
2
2
|
export type LoadConnectAndInitialize = (initParams: IStripeConnectInitParams) => StripeConnectInstance;
|
|
3
|
-
|
|
3
|
+
type ConnectElementHTMLName = "stripe-connect-account-onboarding" | "stripe-connect-disputes-list" | "stripe-connect-payments" | "stripe-connect-payment-details" | "stripe-connect-payment-disputes" | "stripe-connect-account-management" | "stripe-connect-notification-banner" | "stripe-connect-instant-payouts-promotion" | "stripe-connect-issuing-card" | "stripe-connect-issuing-cards-list" | "stripe-connect-financial-account" | "stripe-connect-financial-account-transactions" | "stripe-connect-payouts" | "stripe-connect-payouts-list" | "stripe-connect-payout-details" | "stripe-connect-balances" | "stripe-connect-documents" | "stripe-connect-tax-registrations" | "stripe-connect-tax-settings";
|
|
4
4
|
export declare const componentNameMapping: Record<ConnectElementTagName, ConnectElementHTMLName>;
|
|
5
5
|
type StripeConnectInstanceExtended = StripeConnectInstance & {
|
|
6
6
|
debugInstance: () => Promise<StripeConnectInstance>;
|
|
@@ -9,6 +9,7 @@ interface StripeConnectWrapper {
|
|
|
9
9
|
initialize: (params: IStripeConnectInitParams) => StripeConnectInstance;
|
|
10
10
|
}
|
|
11
11
|
export declare const findScript: () => HTMLScriptElement | null;
|
|
12
|
+
export declare const isWindowStripeConnectDefined: (stripeConnect: unknown) => boolean;
|
|
12
13
|
export declare const loadScript: () => Promise<StripeConnectWrapper>;
|
|
13
14
|
export declare const initStripeConnect: (stripePromise: Promise<StripeConnectWrapper>, initParams: IStripeConnectInitParams) => StripeConnectInstanceExtended;
|
|
14
15
|
export {};
|
package/dist/types/config.d.ts
CHANGED
|
@@ -42,10 +42,6 @@ export type NotificationCount = {
|
|
|
42
42
|
total: number;
|
|
43
43
|
actionRequired: number;
|
|
44
44
|
};
|
|
45
|
-
export type InstallState = {
|
|
46
|
-
appId: string;
|
|
47
|
-
state: "INSTALLED" | "UNINSTALLED";
|
|
48
|
-
};
|
|
49
45
|
export type LoaderStart = {
|
|
50
46
|
elementTagName: string;
|
|
51
47
|
};
|
|
@@ -60,14 +56,6 @@ export type EmbeddedError = {
|
|
|
60
56
|
type: EmbeddedErrorType;
|
|
61
57
|
message?: string;
|
|
62
58
|
};
|
|
63
|
-
export type FinancingProductType = {
|
|
64
|
-
productType: "standard" | "refill" | "none";
|
|
65
|
-
activeFinancingCount: number;
|
|
66
|
-
};
|
|
67
|
-
export type FinancingPromotionLayoutType = "full" | "banner";
|
|
68
|
-
export type IntervalType = "day" | "week" | "month" | "quarter" | "year";
|
|
69
|
-
export type ReportName = "gross_volume" | "net_volume";
|
|
70
|
-
export type RecipientDataSource = "customers";
|
|
71
59
|
export type EmbeddedErrorType =
|
|
72
60
|
/**
|
|
73
61
|
* Failure to connect to Stripe's API.
|
|
@@ -98,13 +86,6 @@ export declare const ConnectElementCommonMethodConfig: {
|
|
|
98
86
|
setOnLoaderStart: (_listener: (({ elementTagName }: LoaderStart) => void) | undefined) => void;
|
|
99
87
|
};
|
|
100
88
|
export declare const ConnectElementCustomMethodConfig: {
|
|
101
|
-
payments: {
|
|
102
|
-
setDefaultFilters: (_filters: PaymentsListDefaultFilters | undefined) => void;
|
|
103
|
-
};
|
|
104
|
-
"payment-details": {
|
|
105
|
-
setPayment: (_payment: string | undefined) => void;
|
|
106
|
-
setOnClose: (_listener: (() => void) | undefined) => void;
|
|
107
|
-
};
|
|
108
89
|
"account-onboarding": {
|
|
109
90
|
setFullTermsOfServiceUrl: (_termOfServiceUrl: string | undefined) => void;
|
|
110
91
|
setRecipientTermsOfServiceUrl: (_recipientTermsOfServiceUrl: string | undefined) => void;
|
|
@@ -121,6 +102,14 @@ export declare const ConnectElementCustomMethodConfig: {
|
|
|
121
102
|
setCollectionOptions: (_collectionOptions: CollectionOptions | undefined) => void;
|
|
122
103
|
setOnNotificationsChange: (_listener: (({ total, actionRequired }: NotificationCount) => void) | undefined) => void;
|
|
123
104
|
};
|
|
105
|
+
"instant-payouts-promotion": {
|
|
106
|
+
setOnInstantPayoutsPromotionLoaded: (_listener: (({ promotionShown }: {
|
|
107
|
+
promotionShown: boolean;
|
|
108
|
+
}) => void) | undefined) => void;
|
|
109
|
+
setOnInstantPayoutCreated: (_listener: (({ payoutId }: {
|
|
110
|
+
payoutId: string;
|
|
111
|
+
}) => void) | undefined) => void;
|
|
112
|
+
};
|
|
124
113
|
"issuing-card": {
|
|
125
114
|
setDefaultCard: (_defaultCard: string | undefined) => void;
|
|
126
115
|
setCardSwitching: (_cardSwitching: boolean | undefined) => void;
|
|
@@ -138,49 +127,19 @@ export declare const ConnectElementCustomMethodConfig: {
|
|
|
138
127
|
"financial-account-transactions": {
|
|
139
128
|
setFinancialAccount: (_financialAccount: string) => void;
|
|
140
129
|
};
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
};
|
|
144
|
-
"app-install": {
|
|
145
|
-
setApp: (_app: string | undefined) => void;
|
|
146
|
-
setOnAppInstallStateFetched: (_listener: (({ appId, state }: InstallState) => void) | undefined) => void;
|
|
147
|
-
setOnAppInstallStateChanged: (_listener: (({ appId, state }: InstallState) => void) | undefined) => void;
|
|
148
|
-
};
|
|
149
|
-
"app-viewport": {
|
|
150
|
-
setApp: (_app: string | undefined) => void;
|
|
151
|
-
setAppData: (_appData: Record<string, string> | undefined) => void;
|
|
130
|
+
payments: {
|
|
131
|
+
setDefaultFilters: (_filters: PaymentsListDefaultFilters | undefined) => void;
|
|
152
132
|
};
|
|
153
|
-
"payment-
|
|
154
|
-
|
|
133
|
+
"payment-details": {
|
|
134
|
+
setPayment: (_payment: string | undefined) => void;
|
|
135
|
+
setOnClose: (_listener: (() => void) | undefined) => void;
|
|
155
136
|
};
|
|
156
|
-
"
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
setHowCapitalWorksUrl: (_howCapitalWorksUrl: string | undefined) => void;
|
|
160
|
-
setSupportUrl: (_supportUrl: string | undefined) => void;
|
|
161
|
-
setOnFinancingsLoaded: (_listener: (({ total }: {
|
|
137
|
+
"payment-disputes": {
|
|
138
|
+
setPayment: (_payment: string | undefined) => void;
|
|
139
|
+
setOnDisputesLoaded: (_listener: (({ total }: {
|
|
162
140
|
total: number;
|
|
163
141
|
}) => void) | undefined) => void;
|
|
164
142
|
};
|
|
165
|
-
"capital-financing-application": {
|
|
166
|
-
setOnApplicationSubmitted: (_listener: (() => void) | undefined) => void;
|
|
167
|
-
setPrivacyPolicyUrl: (_privacyPolicyUrl: string | undefined) => void;
|
|
168
|
-
setHowCapitalWorksUrl: (_howCapitalWorksUrl: string | undefined) => void;
|
|
169
|
-
};
|
|
170
|
-
"capital-financing-promotion": {
|
|
171
|
-
setLayout: (_layout: FinancingPromotionLayoutType | undefined) => void;
|
|
172
|
-
setOnApplicationSubmitted: (_listener: (() => void) | undefined) => void;
|
|
173
|
-
setOnEligibleFinancingOfferLoaded: (_listener: (({ productType, activeFinancingCount }: FinancingProductType) => void) | undefined) => void;
|
|
174
|
-
setPrivacyPolicyUrl: (_privacyPolicyUrl: string | undefined) => void;
|
|
175
|
-
setHowCapitalWorksUrl: (_howCapitalWorksUrl: string | undefined) => void;
|
|
176
|
-
setEligibilityCriteriaUrl: (_eligibilityCriteriaUrl: string | undefined) => void;
|
|
177
|
-
};
|
|
178
|
-
"reporting-chart": {
|
|
179
|
-
setReportName: (_reportName: ReportName) => void;
|
|
180
|
-
setIntervalStart: (_intervalStart: Date | undefined) => void;
|
|
181
|
-
setIntervalEnd: (_intervalEnd: Date | undefined) => void;
|
|
182
|
-
setIntervalType: (_intervalType: IntervalType | undefined) => void;
|
|
183
|
-
};
|
|
184
143
|
"tax-settings": {
|
|
185
144
|
setHideProductTaxCodeSelector: (_hidden: boolean | undefined) => void;
|
|
186
145
|
setDisplayHeadOfficeCountries: (_countries: string[] | undefined) => void;
|
|
@@ -194,15 +153,8 @@ export declare const ConnectElementCustomMethodConfig: {
|
|
|
194
153
|
}) => void) | undefined) => void;
|
|
195
154
|
setDisplayCountries: (_countries: string[] | undefined) => void;
|
|
196
155
|
};
|
|
197
|
-
"
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
"product-tax-code-selector": {
|
|
201
|
-
setOnTaxCodeSelect: (_listener: (({ taxCode }: {
|
|
202
|
-
taxCode: string;
|
|
203
|
-
}) => void) | undefined) => void;
|
|
204
|
-
setHideDescription: (_hideDescription: boolean | undefined) => void;
|
|
205
|
-
setDisabled: (_disabled: boolean | undefined) => void;
|
|
206
|
-
setInitialTaxCode: (_initialTaxCode: string | undefined) => void;
|
|
156
|
+
"payout-details": {
|
|
157
|
+
setPayout: (_payout: string | undefined) => void;
|
|
158
|
+
setOnClose: (_listener: (() => void) | undefined) => void;
|
|
207
159
|
};
|
|
208
160
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stripe/connect-js",
|
|
3
|
-
"version": "3.3.28
|
|
3
|
+
"version": "3.3.28",
|
|
4
4
|
"description": "Connect.js loading utility package",
|
|
5
5
|
"main": "dist/connect.js",
|
|
6
6
|
"module": "dist/connect.esm.js",
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"test:unit": "jest",
|
|
12
12
|
"test:types": "zx ./tests/types/scripts/test.mjs",
|
|
13
13
|
"lint": "eslint '{src,types}/**/*.{ts,js}' && yarn prettier-check",
|
|
14
|
+
"lint-fix": "eslint '{src,types}/**/*.{ts,js}' --fix && yarn prettier-check",
|
|
14
15
|
"typecheck": "tsc --noEmit",
|
|
15
16
|
"build": "yarn clean && rollup -c",
|
|
16
17
|
"validate-change": "yarn run test",
|
|
@@ -45,21 +46,24 @@
|
|
|
45
46
|
"@rollup/plugin-json": "^6.0.0",
|
|
46
47
|
"@rollup/plugin-replace": "^2.3.1",
|
|
47
48
|
"@types/jest": "^24.0.25",
|
|
48
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
49
|
-
"@typescript-eslint/parser": "^
|
|
49
|
+
"@typescript-eslint/eslint-plugin": "^7",
|
|
50
|
+
"@typescript-eslint/parser": "^7",
|
|
51
|
+
"@typescript-eslint/rule-tester": "^7",
|
|
52
|
+
"@typescript-eslint/scope-manager": "^7",
|
|
53
|
+
"@typescript-eslint/utils": "^7",
|
|
50
54
|
"babel-eslint": "^10.0.3",
|
|
51
55
|
"babel-jest": "^24.9.0",
|
|
52
56
|
"conditional-type-checks": "^1.0.5",
|
|
53
|
-
"eslint": "
|
|
54
|
-
"eslint-config-prettier": "^
|
|
55
|
-
"eslint-plugin-import": "^2.
|
|
56
|
-
"eslint-plugin-jest": "^
|
|
57
|
-
"eslint-plugin-prettier": "^
|
|
57
|
+
"eslint": "8.56.0",
|
|
58
|
+
"eslint-config-prettier": "^8.3.0",
|
|
59
|
+
"eslint-plugin-import": "^2.20.1",
|
|
60
|
+
"eslint-plugin-jest": "^26.6.0",
|
|
61
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
58
62
|
"jest": "^29.5.0",
|
|
59
63
|
"jest-environment-jsdom": "^29.5.0",
|
|
60
|
-
"prettier": "
|
|
64
|
+
"prettier": "2.8.8",
|
|
61
65
|
"rimraf": "^2.6.2",
|
|
62
|
-
"rollup": "^
|
|
66
|
+
"rollup": "^2.79.2",
|
|
63
67
|
"rollup-plugin-babel": "^4.4.0",
|
|
64
68
|
"rollup-plugin-typescript2": "^0.25.3",
|
|
65
69
|
"ts-jest": "^29.1.0",
|
package/src/index.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { IStripeConnectInitParams, StripeConnectInstance } from "../types";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
initStripeConnect,
|
|
5
|
-
LoadConnectAndInitialize
|
|
6
|
-
} from "./shared";
|
|
1
|
+
import type { IStripeConnectInitParams, StripeConnectInstance } from "../types";
|
|
2
|
+
import type { LoadConnectAndInitialize } from "./shared";
|
|
3
|
+
import { loadScript, initStripeConnect } from "./shared";
|
|
7
4
|
|
|
8
5
|
// Execute our own script injection after a tick to give users time to do their
|
|
9
6
|
// own script injection.
|
package/src/pure.test.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
2
2
|
|
|
3
|
-
import { IStripeConnectInitParams } from "../types";
|
|
3
|
+
import type { IStripeConnectInitParams } from "../types";
|
|
4
4
|
import { SCRIPT_SELECTOR } from "./utils/jestHelpers";
|
|
5
5
|
|
|
6
6
|
describe("pure module", () => {
|
|
@@ -16,7 +16,7 @@ describe("pure module", () => {
|
|
|
16
16
|
publishableKey: "pk_123",
|
|
17
17
|
fetchClientSecret: async () => {
|
|
18
18
|
return "secret_123";
|
|
19
|
-
}
|
|
19
|
+
},
|
|
20
20
|
};
|
|
21
21
|
loadConnectAndInitialize(mockInitParams);
|
|
22
22
|
|
package/src/pure.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { IStripeConnectInitParams, StripeConnectInstance } from "../types";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
initStripeConnect,
|
|
5
|
-
LoadConnectAndInitialize
|
|
6
|
-
} from "./shared";
|
|
1
|
+
import type { IStripeConnectInitParams, StripeConnectInstance } from "../types";
|
|
2
|
+
import type { LoadConnectAndInitialize } from "./shared";
|
|
3
|
+
import { loadScript, initStripeConnect } from "./shared";
|
|
7
4
|
|
|
8
5
|
export const loadConnectAndInitialize: LoadConnectAndInitialize = (
|
|
9
6
|
initParams: IStripeConnectInitParams
|