@stripe/connect-js 1.0.6 → 1.0.8

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 CHANGED
@@ -3,6 +3,8 @@
3
3
  The [Connect.js library](https://stripe.com/docs/connect/get-started-connect-embedded-components) and its supporting API allows you to add connected account dashboard functionality to your website.
4
4
  This NPM package contains initialization logic for Connect embedded components along with related types.
5
5
 
6
+ Calling `loadConnect` always loads the latest version of Connect.js, regardless of which version of `@stripe/connect-js` you use. Updates for this package only impact tooling around the `loadConnect` helper itself and the TypeScript type definitions provided for Connect.js. Updates do not affect runtime availability of features of Connect.js.
7
+
6
8
  Note: Connect embedded components is currently still in beta. Please [contact us](https://stripe.com/docs/connect/get-started-connect-embedded-components#access) to request beta access.
7
9
 
8
10
  ## Installation
@@ -22,6 +22,8 @@ function __awaiter(thisArg, _arguments, P, generator) {
22
22
  });
23
23
  }
24
24
 
25
+ var version = "1.0.8";
26
+
25
27
  const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
26
28
  const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
27
29
  const findScript = () => {
@@ -89,7 +91,10 @@ const createWrapper = stripeConnect => {
89
91
  const metaOptions = (_a = params.metaOptions) !== null && _a !== void 0 ? _a : {};
90
92
  return stripeConnect.init(Object.assign(Object.assign({}, params), {
91
93
  metaOptions: Object.assign(Object.assign({}, metaOptions), {
92
- sdk: true
94
+ sdk: true,
95
+ sdkOptions: {
96
+ sdkVersion: version
97
+ }
93
98
  })
94
99
  }));
95
100
  },
package/dist/connect.js CHANGED
@@ -26,6 +26,8 @@ function __awaiter(thisArg, _arguments, P, generator) {
26
26
  });
27
27
  }
28
28
 
29
+ var version = "1.0.8";
30
+
29
31
  const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
30
32
  const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
31
33
  const findScript = () => {
@@ -93,7 +95,10 @@ const createWrapper = stripeConnect => {
93
95
  const metaOptions = (_a = params.metaOptions) !== null && _a !== void 0 ? _a : {};
94
96
  return stripeConnect.init(Object.assign(Object.assign({}, params), {
95
97
  metaOptions: Object.assign(Object.assign({}, metaOptions), {
96
- sdk: true
98
+ sdk: true,
99
+ sdkOptions: {
100
+ sdkVersion: version
101
+ }
97
102
  })
98
103
  }));
99
104
  },
package/dist/pure.esm.js CHANGED
@@ -22,6 +22,8 @@ function __awaiter(thisArg, _arguments, P, generator) {
22
22
  });
23
23
  }
24
24
 
25
+ var version = "1.0.8";
26
+
25
27
  const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
26
28
  const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
27
29
  const findScript = () => {
@@ -89,7 +91,10 @@ const createWrapper = stripeConnect => {
89
91
  const metaOptions = (_a = params.metaOptions) !== null && _a !== void 0 ? _a : {};
90
92
  return stripeConnect.init(Object.assign(Object.assign({}, params), {
91
93
  metaOptions: Object.assign(Object.assign({}, metaOptions), {
92
- sdk: true
94
+ sdk: true,
95
+ sdkOptions: {
96
+ sdkVersion: version
97
+ }
93
98
  })
94
99
  }));
95
100
  },
package/dist/pure.js CHANGED
@@ -26,6 +26,8 @@ function __awaiter(thisArg, _arguments, P, generator) {
26
26
  });
27
27
  }
28
28
 
29
+ var version = "1.0.8";
30
+
29
31
  const EXISTING_SCRIPT_MESSAGE = "loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used";
30
32
  const V0_URL = "https://connect-js.stripe.com/v0.1/connect.js";
31
33
  const findScript = () => {
@@ -93,7 +95,10 @@ const createWrapper = stripeConnect => {
93
95
  const metaOptions = (_a = params.metaOptions) !== null && _a !== void 0 ? _a : {};
94
96
  return stripeConnect.init(Object.assign(Object.assign({}, params), {
95
97
  metaOptions: Object.assign(Object.assign({}, metaOptions), {
96
- sdk: true
98
+ sdk: true,
99
+ sdkOptions: {
100
+ sdkVersion: version
101
+ }
97
102
  })
98
103
  }));
99
104
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stripe/connect-js",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "Connect.js loading utility package",
5
5
  "main": "dist/connect.js",
6
6
  "module": "dist/connect.esm.js",
@@ -65,5 +65,8 @@
65
65
  "typescript": "^4.1.2",
66
66
  "yalc": "^1.0.0-pre.53",
67
67
  "zx": "^4.2.0"
68
+ },
69
+ "dependencies": {
70
+ "@rollup/plugin-json": "^6.0.0"
68
71
  }
69
72
  }
package/src/shared.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { version } from ".././package.json";
1
2
  import { StripeConnectWrapper, IStripeConnectInitParams } from "../types";
2
3
 
3
4
  export type LoadConnect = () => Promise<StripeConnectWrapper>;
@@ -95,7 +96,10 @@ const createWrapper = (stripeConnect: any) => {
95
96
  ...params,
96
97
  metaOptions: {
97
98
  ...metaOptions,
98
- sdk: true
99
+ sdk: true,
100
+ sdkOptions: {
101
+ sdkVersion: version
102
+ }
99
103
  }
100
104
  });
101
105
  },
package/types/shared.d.ts CHANGED
@@ -116,20 +116,42 @@ export interface IStripeConnectInitParams {
116
116
  }
117
117
 
118
118
  export interface StripeConnectWrapper {
119
+ /**
120
+ * Initializes a Connect JS instance that can be used to create and update Connect components.
121
+ * @param params Initialization parameters for Connect JS. See https://stripe.com/docs/connect/get-started-connect-embedded-components#configuring-connect-js for more details.
122
+ * @returns A Connect JS instance.
123
+ */
119
124
  initialize: (params: IStripeConnectInitParams) => StripeConnectInstance;
125
+
126
+ /**
127
+ * Logs the user out of Connect JS sessions
128
+ * @returns A promise that resolves when the user is logged out.
129
+ */
120
130
  logout: () => Promise<void>;
121
131
  }
122
132
 
123
133
  export interface StripeConnectInstance {
134
+ /**
135
+ * Creates a Connect element.
136
+ * @tagName Name of the Connect component to create.
137
+ * @returns An HTML component corresponding to that connect component
138
+ */
124
139
  create: (tagName: ConnectElementTagName) => HTMLElement | null;
140
+
141
+ /**
142
+ * Updates the Connect instance with new parameters.
143
+ * @options New parameters to update the Connect instance with.
144
+ */
125
145
  update: (options: IStripeConnectUpdateParams) => void;
126
146
  }
127
147
 
128
- export type ConnectElementTagName =
148
+ export type ConnectElementHTMLName =
129
149
  | "stripe-connect-payments"
130
150
  | "stripe-connect-payouts"
131
151
  | "stripe-connect-payment-details";
132
152
 
153
+ export type ConnectElementTagName = "payments" | "payouts" | "payment-details";
154
+
133
155
  export declare const findScript: () => HTMLScriptElement | null;
134
156
 
135
157
  export declare const loadScript: () => Promise<any | null>;
File without changes
File without changes
File without changes
File without changes
File without changes