@workos-inc/widgets 1.7.0 → 1.7.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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.7.1
4
+
5
+ - Add support for CSRF protection in the `Pipes` Widget
6
+
3
7
  ## 1.7.0
4
8
 
5
9
  - Fix alignment of connection status indicator in the `Pipes` Widget
package/README.md CHANGED
@@ -2,69 +2,4 @@
2
2
 
3
3
  A suite of React components providing functionality for enterprise app workflows.
4
4
 
5
- [Read the documentation](https://workos.com/docs/user-management/widgets)
6
-
7
- ## Local Development Setup
8
-
9
- ### Install dependencies
10
-
11
- Run `pnpm install` in the root directory to install the dependencies.
12
-
13
- ### Run an example app
14
-
15
- The following instructions will follow using the [`nextjs`](https://github.com/workos/widgets/tree/main/examples/nextjs) example but the same steps can be applied to other examples.
16
-
17
- 1. Spin up your local WorkOS instance (`rush start`).
18
- 2. Create a `.env` file in the root of the `nextjs` directory using the `.env.example` file as a reference.
19
- 3. Uncomment the values under `# Optional configuration`.
20
-
21
- ```
22
- # Optional configuration
23
- WORKOS_API_HOSTNAME="localhost"
24
- WORKOS_API_HTTPS=false
25
- WORKOS_API_PORT=7000
26
- ```
27
-
28
- 4. On your local WorkOS dashboard, go to the [Get started homepage](http://localhost:3007/get-started) grab the `WORKOS_API_KEY` and `WORKOS_CLIENT_ID` and add them to your `.env` file.
29
-
30
- 5. [Generate a 32 character password](https://1password.com/password-generator/) for `WORKOS_COOKIE_PASSWORD` and add it to your `.env` file.
31
-
32
- After steps 4 and 5, your `.env` file should look like this:
33
-
34
- ```
35
- # https://workos.com/docs/reference/api-keys
36
- WORKOS_API_KEY="sk_dev" # retrieved from the WorkOS dashboard
37
- WORKOS_CLIENT_ID="client_dev" # retrieved from the WorkOS dashboard
38
- WORKOS_COOKIE_PASSWORD="some-password-thats-32-chars-long" # generate a 32 character password
39
- NEXT_PUBLIC_WORKOS_REDIRECT_URI="http://localhost:4040/auth/callback" # configured in the WorkOS dashboard
40
- ```
41
-
42
- 6. On your local WorkOS dashboard, go to the Redirects page and add the following URL to the **Sign-in callback** section:
43
-
44
- ```
45
- http://localhost:4040/auth/callback
46
- ```
47
-
48
- 7. On your local WorkOS dashboard, go to the Roles page and verify that the following exists, otherwise create it:
49
-
50
- **Permissions**
51
-
52
- Name: **Manage users**, Slug: `widgets:users-table:manage`
53
-
54
- **Roles**
55
-
56
- Name: **Admin**, Slug: `admin`, Permissions: `widgets:users-table:manage`
57
-
58
- 8. On your local WorkOS dashboard, go to the Organizations page, add yourself as a user to an organization. Then in the Users table of the organization, open the `...` menu, open the **Edit role**, and set the role to **Admin**.
59
-
60
- 9. On your local WorkOS dashboard, go to the Authentication page and add the following URL to the **Cross-Origin Resource Sharing (CORS)** section:
61
-
62
- ```
63
- http://localhost:4040
64
- ```
65
-
66
- 10. Navigate to the `packages/hosted-authkit` directory and run `rushx start` to start the hosted AuthKit service.
67
-
68
- 11. Run `pnpm dev --filter=nextjs` to start the example app.
69
-
70
- 12. Navigate to http://localhost:4040/ and authenticate using Google to sign into your account.
5
+ [Read the documentation](https://workos.com/docs/widgets)
@@ -328,26 +328,34 @@ const DataIntegrationIntegrationType = {
328
328
  box: "box",
329
329
  confluence: "confluence",
330
330
  dropbox: "dropbox",
331
+ "frame-io": "frame-io",
332
+ front: "front",
331
333
  github: "github",
332
334
  gitlab: "gitlab",
333
335
  gmail: "gmail",
334
336
  google: "google",
335
337
  "google-calendar": "google-calendar",
336
338
  "google-drive": "google-drive",
339
+ helpscout: "helpscout",
337
340
  hubspot: "hubspot",
338
341
  intercom: "intercom",
339
342
  jira: "jira",
340
343
  linear: "linear",
341
344
  microsoft: "microsoft",
342
345
  "microsoft-onedrive": "microsoft-onedrive",
346
+ "microsoft-onenote": "microsoft-onenote",
343
347
  "microsoft-outlook": "microsoft-outlook",
344
348
  "microsoft-outlook-calendar": "microsoft-outlook-calendar",
349
+ "microsoft-sharepoint": "microsoft-sharepoint",
350
+ "microsoft-teams": "microsoft-teams",
351
+ "microsoft-todo": "microsoft-todo",
345
352
  notion: "notion",
346
353
  prefect: "prefect",
347
354
  "pydantic-logfire": "pydantic-logfire",
348
355
  salesforce: "salesforce",
349
356
  sentry: "sentry",
350
357
  slack: "slack",
358
+ snowflake: "snowflake",
351
359
  stripe: "stripe",
352
360
  zendesk: "zendesk"
353
361
  };
@@ -1442,24 +1450,28 @@ function useMyDataIntegrations(options, queryClient) {
1442
1450
  const useGetDataIntegrationAuthorizeUrlHook = () => {
1443
1451
  const getDataIntegrationAuthorizeUrl = (0, import_widgets_api_client.useWidgetsApiClient)();
1444
1452
  return (0, import_react.useCallback)(
1445
- (slug, signal) => {
1453
+ (slug, params, signal) => {
1446
1454
  return getDataIntegrationAuthorizeUrl({
1447
1455
  url: `/_widgets/DataIntegrations/${slug}/authorize`,
1448
1456
  method: "GET",
1457
+ params,
1449
1458
  signal
1450
1459
  });
1451
1460
  },
1452
1461
  [getDataIntegrationAuthorizeUrl]
1453
1462
  );
1454
1463
  };
1455
- const getGetDataIntegrationAuthorizeUrlQueryKey = (slug) => {
1456
- return [`/_widgets/DataIntegrations/${slug}/authorize`];
1464
+ const getGetDataIntegrationAuthorizeUrlQueryKey = (slug, params) => {
1465
+ return [
1466
+ `/_widgets/DataIntegrations/${slug}/authorize`,
1467
+ ...params ? [params] : []
1468
+ ];
1457
1469
  };
1458
- const useGetDataIntegrationAuthorizeUrlQueryOptions = (slug, options) => {
1470
+ const useGetDataIntegrationAuthorizeUrlQueryOptions = (slug, params, options) => {
1459
1471
  const { query: queryOptions } = options ?? {};
1460
- const queryKey = queryOptions?.queryKey ?? getGetDataIntegrationAuthorizeUrlQueryKey(slug);
1472
+ const queryKey = queryOptions?.queryKey ?? getGetDataIntegrationAuthorizeUrlQueryKey(slug, params);
1461
1473
  const getDataIntegrationAuthorizeUrl = useGetDataIntegrationAuthorizeUrlHook();
1462
- const queryFn = ({ signal }) => getDataIntegrationAuthorizeUrl(slug, signal);
1474
+ const queryFn = ({ signal }) => getDataIntegrationAuthorizeUrl(slug, params, signal);
1463
1475
  const customOptions = (0, import_widgets_api_client2.useWidgetsApiQueryOptions)({
1464
1476
  ...queryOptions,
1465
1477
  queryKey,
@@ -1467,9 +1479,10 @@ const useGetDataIntegrationAuthorizeUrlQueryOptions = (slug, options) => {
1467
1479
  });
1468
1480
  return customOptions;
1469
1481
  };
1470
- function useGetDataIntegrationAuthorizeUrl(slug, options, queryClient) {
1482
+ function useGetDataIntegrationAuthorizeUrl(slug, params, options, queryClient) {
1471
1483
  const queryOptions = useGetDataIntegrationAuthorizeUrlQueryOptions(
1472
1484
  slug,
1485
+ params,
1473
1486
  options
1474
1487
  );
1475
1488
  const query = (0, import_react_query.useQuery)(queryOptions, queryClient);