@workos-inc/widgets 1.14.1 → 1.15.0-next.1782503773127
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 +21 -0
- package/dist/cjs/api/endpoint.cjs +37 -0
- package/dist/cjs/api/endpoint.cjs.map +1 -1
- package/dist/cjs/api/endpoint.d.cts +40 -1
- package/dist/cjs/experimental/api/fetch.cjs +22 -0
- package/dist/cjs/experimental/api/fetch.cjs.map +1 -1
- package/dist/cjs/experimental/api/fetch.d.cts +47 -1
- package/dist/cjs/experimental/api/react-query.cjs +41 -0
- package/dist/cjs/experimental/api/react-query.cjs.map +1 -1
- package/dist/cjs/experimental/api/react-query.d.cts +70 -1
- package/dist/cjs/experimental/api/swr.cjs +47 -0
- package/dist/cjs/experimental/api/swr.cjs.map +1 -1
- package/dist/cjs/experimental/api/swr.d.cts +65 -1
- package/dist/cjs/lib/pipes-admin.cjs +14 -3
- package/dist/cjs/lib/pipes-admin.cjs.map +1 -1
- package/dist/cjs/lib/pipes.cjs +363 -44
- package/dist/cjs/lib/pipes.cjs.map +1 -1
- package/dist/esm/api/endpoint.d.ts +40 -1
- package/dist/esm/api/endpoint.js +34 -0
- package/dist/esm/api/endpoint.js.map +1 -1
- package/dist/esm/experimental/api/fetch.d.ts +47 -1
- package/dist/esm/experimental/api/fetch.js +20 -0
- package/dist/esm/experimental/api/fetch.js.map +1 -1
- package/dist/esm/experimental/api/react-query.d.ts +70 -1
- package/dist/esm/experimental/api/react-query.js +37 -0
- package/dist/esm/experimental/api/react-query.js.map +1 -1
- package/dist/esm/experimental/api/swr.d.ts +65 -1
- package/dist/esm/experimental/api/swr.js +42 -0
- package/dist/esm/experimental/api/swr.js.map +1 -1
- package/dist/esm/lib/pipes-admin.js +14 -3
- package/dist/esm/lib/pipes-admin.js.map +1 -1
- package/dist/esm/lib/pipes.js +367 -45
- package/dist/esm/lib/pipes.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.15.0-next.1782503773127
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#291](https://github.com/workos/widgets/pull/291) [`6356ad9`](https://github.com/workos/widgets/commit/6356ad99d21fe1f7bc218ead24155cb1ac2c1fdb) Thanks [@dandorman](https://github.com/dandorman)! - Add API-key install form for data integrations
|
|
8
|
+
|
|
9
|
+
Integrations whose `authMethods` includes `api_key` now render an API-key entry
|
|
10
|
+
dialog (via `useUpsertDataIntegrationApiKey`). Features:
|
|
11
|
+
- Single-method `api_key` integrations show a direct "Connect" button opening the key dialog.
|
|
12
|
+
- Dual-method (`oauth` + `api_key`) integrations show a dropdown letting the user choose.
|
|
13
|
+
- Connected API-key integrations show a "Rotate API key" option in the actions menu with
|
|
14
|
+
the current key masked as `••••{last4}`.
|
|
15
|
+
- 422 / validation errors are surfaced in a `Callout` without discarding the entered value.
|
|
16
|
+
- OAuth-only integrations are unchanged.
|
|
17
|
+
|
|
18
|
+
- [#293](https://github.com/workos/widgets/pull/293) [`90e6f78`](https://github.com/workos/widgets/commit/90e6f787f1ea535aa1455eb9e86c8e9a4d8ff812) Thanks [@dandorman](https://github.com/dandorman)! - Show only the enabled toggle for API-key integrations in PipesAdmin
|
|
19
|
+
|
|
20
|
+
When an integration's `authMethods` is `['api_key']` (no OAuth), the org
|
|
21
|
+
credentials dialog now renders only the enabled toggle instead of the full
|
|
22
|
+
OAuth credentials wizard and scopes picker.
|
|
23
|
+
|
|
3
24
|
## 1.14.1
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
|
@@ -190,6 +190,9 @@ __export(endpoint_exports, {
|
|
|
190
190
|
useUpdatePassword: () => useUpdatePassword,
|
|
191
191
|
useUpdatePasswordHook: () => useUpdatePasswordHook,
|
|
192
192
|
useUpdatePasswordMutationOptions: () => useUpdatePasswordMutationOptions,
|
|
193
|
+
useUpsertDataIntegrationApiKey: () => useUpsertDataIntegrationApiKey,
|
|
194
|
+
useUpsertDataIntegrationApiKeyHook: () => useUpsertDataIntegrationApiKeyHook,
|
|
195
|
+
useUpsertDataIntegrationApiKeyMutationOptions: () => useUpsertDataIntegrationApiKeyMutationOptions,
|
|
193
196
|
useUpsertDataIntegrationConfiguration: () => useUpsertDataIntegrationConfiguration,
|
|
194
197
|
useUpsertDataIntegrationConfigurationHook: () => useUpsertDataIntegrationConfigurationHook,
|
|
195
198
|
useUpsertDataIntegrationConfigurationMutationOptions: () => useUpsertDataIntegrationConfigurationMutationOptions,
|
|
@@ -596,6 +599,37 @@ function useGetDataInstallationAuthorizationStatus(dataIntegrationId, state, opt
|
|
|
596
599
|
const query = (0, import_react_query.useQuery)(queryOptions, queryClient);
|
|
597
600
|
return { ...query, queryKey: queryOptions.queryKey };
|
|
598
601
|
}
|
|
602
|
+
const useUpsertDataIntegrationApiKeyHook = () => {
|
|
603
|
+
const upsertDataIntegrationApiKey = (0, import_widgets_api_client.useWidgetsApiClient)();
|
|
604
|
+
return (0, import_react.useCallback)(
|
|
605
|
+
(slug, upsertApiKeyBody, signal) => {
|
|
606
|
+
return upsertDataIntegrationApiKey({
|
|
607
|
+
url: `/_widgets/DataIntegrations/${slug}/api-key`,
|
|
608
|
+
method: "PUT",
|
|
609
|
+
headers: { "Content-Type": "application/json" },
|
|
610
|
+
data: upsertApiKeyBody,
|
|
611
|
+
signal
|
|
612
|
+
});
|
|
613
|
+
},
|
|
614
|
+
[upsertDataIntegrationApiKey]
|
|
615
|
+
);
|
|
616
|
+
};
|
|
617
|
+
const useUpsertDataIntegrationApiKeyMutationOptions = (options) => {
|
|
618
|
+
const mutationKey = ["upsertDataIntegrationApiKey"];
|
|
619
|
+
const { mutation: mutationOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey } };
|
|
620
|
+
const upsertDataIntegrationApiKey = useUpsertDataIntegrationApiKeyHook();
|
|
621
|
+
const mutationFn = (props) => {
|
|
622
|
+
const { slug, data } = props ?? {};
|
|
623
|
+
return upsertDataIntegrationApiKey(slug, data);
|
|
624
|
+
};
|
|
625
|
+
return { mutationFn, ...mutationOptions };
|
|
626
|
+
};
|
|
627
|
+
const useUpsertDataIntegrationApiKey = (options, queryClient) => {
|
|
628
|
+
return (0, import_react_query.useMutation)(
|
|
629
|
+
useUpsertDataIntegrationApiKeyMutationOptions(options),
|
|
630
|
+
queryClient
|
|
631
|
+
);
|
|
632
|
+
};
|
|
599
633
|
const useGetDataIntegrationAuthorizeUrlHook = () => {
|
|
600
634
|
const getDataIntegrationAuthorizeUrl = (0, import_widgets_api_client.useWidgetsApiClient)();
|
|
601
635
|
return (0, import_react.useCallback)(
|
|
@@ -2052,6 +2086,9 @@ function useSettings(options, queryClient) {
|
|
|
2052
2086
|
useUpdatePassword,
|
|
2053
2087
|
useUpdatePasswordHook,
|
|
2054
2088
|
useUpdatePasswordMutationOptions,
|
|
2089
|
+
useUpsertDataIntegrationApiKey,
|
|
2090
|
+
useUpsertDataIntegrationApiKeyHook,
|
|
2091
|
+
useUpsertDataIntegrationApiKeyMutationOptions,
|
|
2055
2092
|
useUpsertDataIntegrationConfiguration,
|
|
2056
2093
|
useUpsertDataIntegrationConfigurationHook,
|
|
2057
2094
|
useUpsertDataIntegrationConfigurationMutationOptions,
|