@workos-inc/widgets 1.17.2-next.1788288181219 → 1.17.2
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 +2 -2
- package/dist/cjs/api/client-graphql/generated.cjs.map +1 -1
- package/dist/cjs/api/client-graphql/generated.d.cts +97 -1
- package/dist/cjs/api/endpoint.cjs +113 -0
- package/dist/cjs/api/endpoint.cjs.map +1 -1
- package/dist/cjs/api/endpoint.d.cts +161 -11
- package/dist/cjs/experimental/api/fetch.cjs +68 -0
- package/dist/cjs/experimental/api/fetch.cjs.map +1 -1
- package/dist/cjs/experimental/api/fetch.d.cts +169 -11
- package/dist/cjs/experimental/api/react-query.cjs +132 -0
- package/dist/cjs/experimental/api/react-query.cjs.map +1 -1
- package/dist/cjs/experimental/api/react-query.d.cts +237 -11
- package/dist/cjs/experimental/api/swr.cjs +144 -0
- package/dist/cjs/experimental/api/swr.cjs.map +1 -1
- package/dist/cjs/experimental/api/swr.d.cts +221 -11
- package/dist/cjs/lib/change-email-dialog.cjs +3 -3
- package/dist/cjs/lib/change-email-dialog.cjs.map +1 -1
- package/dist/cjs/lib/save-button.cjs +6 -2
- package/dist/cjs/lib/save-button.cjs.map +1 -1
- package/dist/esm/api/client-graphql/generated.d.ts +97 -1
- package/dist/esm/api/client-graphql/generated.js.map +1 -1
- package/dist/esm/api/endpoint.d.ts +161 -11
- package/dist/esm/api/endpoint.js +103 -0
- package/dist/esm/api/endpoint.js.map +1 -1
- package/dist/esm/experimental/api/fetch.d.ts +169 -11
- package/dist/esm/experimental/api/fetch.js +62 -0
- package/dist/esm/experimental/api/fetch.js.map +1 -1
- package/dist/esm/experimental/api/react-query.d.ts +237 -11
- package/dist/esm/experimental/api/react-query.js +119 -0
- package/dist/esm/experimental/api/react-query.js.map +1 -1
- package/dist/esm/experimental/api/swr.d.ts +221 -11
- package/dist/esm/experimental/api/swr.js +130 -0
- package/dist/esm/experimental/api/swr.js.map +1 -1
- package/dist/esm/lib/change-email-dialog.js +3 -3
- package/dist/esm/lib/change-email-dialog.js.map +1 -1
- package/dist/esm/lib/save-button.js +6 -2
- package/dist/esm/lib/save-button.js.map +1 -1
- package/package.json +1 -1
|
@@ -47,6 +47,7 @@ __export(swr_exports, {
|
|
|
47
47
|
createUserApiKey: () => createUserApiKey,
|
|
48
48
|
deleteDataInstallation: () => deleteDataInstallation,
|
|
49
49
|
deleteOrganizationApiKey: () => deleteOrganizationApiKey,
|
|
50
|
+
deleteOrganizationDataInstallation: () => deleteOrganizationDataInstallation,
|
|
50
51
|
deleteOrganizationDomain: () => deleteOrganizationDomain,
|
|
51
52
|
deletePasskey: () => deletePasskey,
|
|
52
53
|
deleteTotpFactors: () => deleteTotpFactors,
|
|
@@ -83,6 +84,9 @@ __export(swr_exports, {
|
|
|
83
84
|
getDeleteOrganizationApiKeyMutationFetcher: () => getDeleteOrganizationApiKeyMutationFetcher,
|
|
84
85
|
getDeleteOrganizationApiKeyMutationKey: () => getDeleteOrganizationApiKeyMutationKey,
|
|
85
86
|
getDeleteOrganizationApiKeyUrl: () => getDeleteOrganizationApiKeyUrl,
|
|
87
|
+
getDeleteOrganizationDataInstallationMutationFetcher: () => getDeleteOrganizationDataInstallationMutationFetcher,
|
|
88
|
+
getDeleteOrganizationDataInstallationMutationKey: () => getDeleteOrganizationDataInstallationMutationKey,
|
|
89
|
+
getDeleteOrganizationDataInstallationUrl: () => getDeleteOrganizationDataInstallationUrl,
|
|
86
90
|
getDeleteOrganizationDomainMutationFetcher: () => getDeleteOrganizationDomainMutationFetcher,
|
|
87
91
|
getDeleteOrganizationDomainMutationKey: () => getDeleteOrganizationDomainMutationKey,
|
|
88
92
|
getDeleteOrganizationDomainUrl: () => getDeleteOrganizationDomainUrl,
|
|
@@ -177,6 +181,8 @@ __export(swr_exports, {
|
|
|
177
181
|
getSessionsUrl: () => getSessionsUrl,
|
|
178
182
|
getSettingsKey: () => getSettingsKey,
|
|
179
183
|
getSettingsUrl: () => getSettingsUrl,
|
|
184
|
+
getSharedDataConnectionsKey: () => getSharedDataConnectionsKey,
|
|
185
|
+
getSharedDataConnectionsUrl: () => getSharedDataConnectionsUrl,
|
|
180
186
|
getUpdateMeMutationFetcher: () => getUpdateMeMutationFetcher,
|
|
181
187
|
getUpdateMeMutationKey: () => getUpdateMeMutationKey,
|
|
182
188
|
getUpdateMeUrl: () => getUpdateMeUrl,
|
|
@@ -195,6 +201,9 @@ __export(swr_exports, {
|
|
|
195
201
|
getUpsertDataIntegrationConfigurationMutationFetcher: () => getUpsertDataIntegrationConfigurationMutationFetcher,
|
|
196
202
|
getUpsertDataIntegrationConfigurationMutationKey: () => getUpsertDataIntegrationConfigurationMutationKey,
|
|
197
203
|
getUpsertDataIntegrationConfigurationUrl: () => getUpsertDataIntegrationConfigurationUrl,
|
|
204
|
+
getUpsertOrganizationDataIntegrationConfigurationMutationFetcher: () => getUpsertOrganizationDataIntegrationConfigurationMutationFetcher,
|
|
205
|
+
getUpsertOrganizationDataIntegrationConfigurationMutationKey: () => getUpsertOrganizationDataIntegrationConfigurationMutationKey,
|
|
206
|
+
getUpsertOrganizationDataIntegrationConfigurationUrl: () => getUpsertOrganizationDataIntegrationConfigurationUrl,
|
|
198
207
|
getVerifyEmailChangeMutationFetcher: () => getVerifyEmailChangeMutationFetcher,
|
|
199
208
|
getVerifyEmailChangeMutationKey: () => getVerifyEmailChangeMutationKey,
|
|
200
209
|
getVerifyEmailChangeUrl: () => getVerifyEmailChangeUrl,
|
|
@@ -234,12 +243,14 @@ __export(swr_exports, {
|
|
|
234
243
|
sendVerification: () => sendVerification,
|
|
235
244
|
sessions: () => sessions,
|
|
236
245
|
settings: () => settings,
|
|
246
|
+
sharedDataConnections: () => sharedDataConnections,
|
|
237
247
|
updateMe: () => updateMe,
|
|
238
248
|
updateMember: () => updateMember,
|
|
239
249
|
updatePassword: () => updatePassword,
|
|
240
250
|
upsertDataIntegrationApiKey: () => upsertDataIntegrationApiKey,
|
|
241
251
|
upsertDataIntegrationClientCredentials: () => upsertDataIntegrationClientCredentials,
|
|
242
252
|
upsertDataIntegrationConfiguration: () => upsertDataIntegrationConfiguration,
|
|
253
|
+
upsertOrganizationDataIntegrationConfiguration: () => upsertOrganizationDataIntegrationConfiguration,
|
|
243
254
|
useAuthenticationInformation: () => useAuthenticationInformation,
|
|
244
255
|
useAuthorizeDataIntegration: () => useAuthorizeDataIntegration,
|
|
245
256
|
useAuthorizeOrganizationDataIntegration: () => useAuthorizeOrganizationDataIntegration,
|
|
@@ -249,6 +260,7 @@ __export(swr_exports, {
|
|
|
249
260
|
useCreateUserApiKey: () => useCreateUserApiKey,
|
|
250
261
|
useDeleteDataInstallation: () => useDeleteDataInstallation,
|
|
251
262
|
useDeleteOrganizationApiKey: () => useDeleteOrganizationApiKey,
|
|
263
|
+
useDeleteOrganizationDataInstallation: () => useDeleteOrganizationDataInstallation,
|
|
252
264
|
useDeleteOrganizationDomain: () => useDeleteOrganizationDomain,
|
|
253
265
|
useDeletePasskey: () => useDeletePasskey,
|
|
254
266
|
useDeleteTotpFactors: () => useDeleteTotpFactors,
|
|
@@ -287,12 +299,14 @@ __export(swr_exports, {
|
|
|
287
299
|
useSendVerification: () => useSendVerification,
|
|
288
300
|
useSessions: () => useSessions,
|
|
289
301
|
useSettings: () => useSettings,
|
|
302
|
+
useSharedDataConnections: () => useSharedDataConnections,
|
|
290
303
|
useUpdateMe: () => useUpdateMe,
|
|
291
304
|
useUpdateMember: () => useUpdateMember,
|
|
292
305
|
useUpdatePassword: () => useUpdatePassword,
|
|
293
306
|
useUpsertDataIntegrationApiKey: () => useUpsertDataIntegrationApiKey,
|
|
294
307
|
useUpsertDataIntegrationClientCredentials: () => useUpsertDataIntegrationClientCredentials,
|
|
295
308
|
useUpsertDataIntegrationConfiguration: () => useUpsertDataIntegrationConfiguration,
|
|
309
|
+
useUpsertOrganizationDataIntegrationConfiguration: () => useUpsertOrganizationDataIntegrationConfiguration,
|
|
296
310
|
useVerify: () => useVerify,
|
|
297
311
|
useVerifyEmailChange: () => useVerifyEmailChange,
|
|
298
312
|
useVerifyPasskey: () => useVerifyPasskey,
|
|
@@ -711,6 +725,80 @@ const useOrganizationDataIntegrations = (options) => {
|
|
|
711
725
|
...query
|
|
712
726
|
};
|
|
713
727
|
};
|
|
728
|
+
const getDeleteOrganizationDataInstallationUrl = (installationId) => {
|
|
729
|
+
return `https://api.workos.com/_widgets/DataIntegrations/organization/installations/${installationId}`;
|
|
730
|
+
};
|
|
731
|
+
const deleteOrganizationDataInstallation = async (installationId, options) => {
|
|
732
|
+
const res = await fetch(
|
|
733
|
+
getDeleteOrganizationDataInstallationUrl(installationId),
|
|
734
|
+
{
|
|
735
|
+
...options,
|
|
736
|
+
method: "DELETE"
|
|
737
|
+
}
|
|
738
|
+
);
|
|
739
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
740
|
+
const data = body ? JSON.parse(body) : {};
|
|
741
|
+
return {
|
|
742
|
+
data,
|
|
743
|
+
status: res.status,
|
|
744
|
+
headers: res.headers
|
|
745
|
+
};
|
|
746
|
+
};
|
|
747
|
+
const getDeleteOrganizationDataInstallationMutationFetcher = (installationId, options) => {
|
|
748
|
+
return (_, __) => {
|
|
749
|
+
return deleteOrganizationDataInstallation(installationId, options);
|
|
750
|
+
};
|
|
751
|
+
};
|
|
752
|
+
const getDeleteOrganizationDataInstallationMutationKey = (installationId) => [
|
|
753
|
+
`https://api.workos.com/_widgets/DataIntegrations/organization/installations/${installationId}`
|
|
754
|
+
];
|
|
755
|
+
const useDeleteOrganizationDataInstallation = (installationId, options) => {
|
|
756
|
+
const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
|
|
757
|
+
const swrKey = swrOptions?.swrKey ?? getDeleteOrganizationDataInstallationMutationKey(installationId);
|
|
758
|
+
const swrFn = getDeleteOrganizationDataInstallationMutationFetcher(
|
|
759
|
+
installationId,
|
|
760
|
+
fetchOptions
|
|
761
|
+
);
|
|
762
|
+
const query = (0, import_mutation.default)(swrKey, swrFn, swrOptions);
|
|
763
|
+
return {
|
|
764
|
+
swrKey,
|
|
765
|
+
...query
|
|
766
|
+
};
|
|
767
|
+
};
|
|
768
|
+
const getSharedDataConnectionsUrl = () => {
|
|
769
|
+
return `https://api.workos.com/_widgets/DataIntegrations/shared-connections`;
|
|
770
|
+
};
|
|
771
|
+
const sharedDataConnections = async (options) => {
|
|
772
|
+
const res = await fetch(getSharedDataConnectionsUrl(), {
|
|
773
|
+
...options,
|
|
774
|
+
method: "GET"
|
|
775
|
+
});
|
|
776
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
777
|
+
const data = body ? JSON.parse(body) : {};
|
|
778
|
+
return {
|
|
779
|
+
data,
|
|
780
|
+
status: res.status,
|
|
781
|
+
headers: res.headers
|
|
782
|
+
};
|
|
783
|
+
};
|
|
784
|
+
const getSharedDataConnectionsKey = () => [
|
|
785
|
+
`https://api.workos.com/_widgets/DataIntegrations/shared-connections`
|
|
786
|
+
];
|
|
787
|
+
const useSharedDataConnections = (options) => {
|
|
788
|
+
const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
|
|
789
|
+
const isEnabled = swrOptions?.enabled !== false;
|
|
790
|
+
const swrKey = swrOptions?.swrKey ?? (() => isEnabled ? getSharedDataConnectionsKey() : null);
|
|
791
|
+
const swrFn = () => sharedDataConnections(fetchOptions);
|
|
792
|
+
const query = (0, import_swr.default)(
|
|
793
|
+
swrKey,
|
|
794
|
+
swrFn,
|
|
795
|
+
swrOptions
|
|
796
|
+
);
|
|
797
|
+
return {
|
|
798
|
+
swrKey,
|
|
799
|
+
...query
|
|
800
|
+
};
|
|
801
|
+
};
|
|
714
802
|
const getGetDataInstallationAuthorizationStatusUrl = (dataIntegrationId, state) => {
|
|
715
803
|
return `https://api.workos.com/_widgets/DataIntegrations/${dataIntegrationId}/authorization-status/${state}`;
|
|
716
804
|
};
|
|
@@ -984,6 +1072,48 @@ const useAuthorizeOrganizationDataIntegration = (slug, options) => {
|
|
|
984
1072
|
...query
|
|
985
1073
|
};
|
|
986
1074
|
};
|
|
1075
|
+
const getUpsertOrganizationDataIntegrationConfigurationUrl = (slug) => {
|
|
1076
|
+
return `https://api.workos.com/_widgets/DataIntegrations/${slug}/organization/configuration`;
|
|
1077
|
+
};
|
|
1078
|
+
const upsertOrganizationDataIntegrationConfiguration = async (slug, upsertOrganizationDataIntegrationConfigurationBody, options) => {
|
|
1079
|
+
const res = await fetch(
|
|
1080
|
+
getUpsertOrganizationDataIntegrationConfigurationUrl(slug),
|
|
1081
|
+
{
|
|
1082
|
+
...options,
|
|
1083
|
+
method: "PUT",
|
|
1084
|
+
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
1085
|
+
body: JSON.stringify(upsertOrganizationDataIntegrationConfigurationBody)
|
|
1086
|
+
}
|
|
1087
|
+
);
|
|
1088
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
1089
|
+
const data = body ? JSON.parse(body) : {};
|
|
1090
|
+
return {
|
|
1091
|
+
data,
|
|
1092
|
+
status: res.status,
|
|
1093
|
+
headers: res.headers
|
|
1094
|
+
};
|
|
1095
|
+
};
|
|
1096
|
+
const getUpsertOrganizationDataIntegrationConfigurationMutationFetcher = (slug, options) => {
|
|
1097
|
+
return (_, { arg }) => {
|
|
1098
|
+
return upsertOrganizationDataIntegrationConfiguration(slug, arg, options);
|
|
1099
|
+
};
|
|
1100
|
+
};
|
|
1101
|
+
const getUpsertOrganizationDataIntegrationConfigurationMutationKey = (slug) => [
|
|
1102
|
+
`https://api.workos.com/_widgets/DataIntegrations/${slug}/organization/configuration`
|
|
1103
|
+
];
|
|
1104
|
+
const useUpsertOrganizationDataIntegrationConfiguration = (slug, options) => {
|
|
1105
|
+
const { swr: swrOptions, fetch: fetchOptions } = options ?? {};
|
|
1106
|
+
const swrKey = swrOptions?.swrKey ?? getUpsertOrganizationDataIntegrationConfigurationMutationKey(slug);
|
|
1107
|
+
const swrFn = getUpsertOrganizationDataIntegrationConfigurationMutationFetcher(
|
|
1108
|
+
slug,
|
|
1109
|
+
fetchOptions
|
|
1110
|
+
);
|
|
1111
|
+
const query = (0, import_mutation.default)(swrKey, swrFn, swrOptions);
|
|
1112
|
+
return {
|
|
1113
|
+
swrKey,
|
|
1114
|
+
...query
|
|
1115
|
+
};
|
|
1116
|
+
};
|
|
987
1117
|
const getCreateUserApiKeyUrl = () => {
|
|
988
1118
|
return `https://api.workos.com/_widgets/UserApiKeys/api-keys`;
|
|
989
1119
|
};
|
|
@@ -2377,6 +2507,7 @@ const useSettings = (options) => {
|
|
|
2377
2507
|
createUserApiKey,
|
|
2378
2508
|
deleteDataInstallation,
|
|
2379
2509
|
deleteOrganizationApiKey,
|
|
2510
|
+
deleteOrganizationDataInstallation,
|
|
2380
2511
|
deleteOrganizationDomain,
|
|
2381
2512
|
deletePasskey,
|
|
2382
2513
|
deleteTotpFactors,
|
|
@@ -2413,6 +2544,9 @@ const useSettings = (options) => {
|
|
|
2413
2544
|
getDeleteOrganizationApiKeyMutationFetcher,
|
|
2414
2545
|
getDeleteOrganizationApiKeyMutationKey,
|
|
2415
2546
|
getDeleteOrganizationApiKeyUrl,
|
|
2547
|
+
getDeleteOrganizationDataInstallationMutationFetcher,
|
|
2548
|
+
getDeleteOrganizationDataInstallationMutationKey,
|
|
2549
|
+
getDeleteOrganizationDataInstallationUrl,
|
|
2416
2550
|
getDeleteOrganizationDomainMutationFetcher,
|
|
2417
2551
|
getDeleteOrganizationDomainMutationKey,
|
|
2418
2552
|
getDeleteOrganizationDomainUrl,
|
|
@@ -2507,6 +2641,8 @@ const useSettings = (options) => {
|
|
|
2507
2641
|
getSessionsUrl,
|
|
2508
2642
|
getSettingsKey,
|
|
2509
2643
|
getSettingsUrl,
|
|
2644
|
+
getSharedDataConnectionsKey,
|
|
2645
|
+
getSharedDataConnectionsUrl,
|
|
2510
2646
|
getUpdateMeMutationFetcher,
|
|
2511
2647
|
getUpdateMeMutationKey,
|
|
2512
2648
|
getUpdateMeUrl,
|
|
@@ -2525,6 +2661,9 @@ const useSettings = (options) => {
|
|
|
2525
2661
|
getUpsertDataIntegrationConfigurationMutationFetcher,
|
|
2526
2662
|
getUpsertDataIntegrationConfigurationMutationKey,
|
|
2527
2663
|
getUpsertDataIntegrationConfigurationUrl,
|
|
2664
|
+
getUpsertOrganizationDataIntegrationConfigurationMutationFetcher,
|
|
2665
|
+
getUpsertOrganizationDataIntegrationConfigurationMutationKey,
|
|
2666
|
+
getUpsertOrganizationDataIntegrationConfigurationUrl,
|
|
2528
2667
|
getVerifyEmailChangeMutationFetcher,
|
|
2529
2668
|
getVerifyEmailChangeMutationKey,
|
|
2530
2669
|
getVerifyEmailChangeUrl,
|
|
@@ -2564,12 +2703,14 @@ const useSettings = (options) => {
|
|
|
2564
2703
|
sendVerification,
|
|
2565
2704
|
sessions,
|
|
2566
2705
|
settings,
|
|
2706
|
+
sharedDataConnections,
|
|
2567
2707
|
updateMe,
|
|
2568
2708
|
updateMember,
|
|
2569
2709
|
updatePassword,
|
|
2570
2710
|
upsertDataIntegrationApiKey,
|
|
2571
2711
|
upsertDataIntegrationClientCredentials,
|
|
2572
2712
|
upsertDataIntegrationConfiguration,
|
|
2713
|
+
upsertOrganizationDataIntegrationConfiguration,
|
|
2573
2714
|
useAuthenticationInformation,
|
|
2574
2715
|
useAuthorizeDataIntegration,
|
|
2575
2716
|
useAuthorizeOrganizationDataIntegration,
|
|
@@ -2579,6 +2720,7 @@ const useSettings = (options) => {
|
|
|
2579
2720
|
useCreateUserApiKey,
|
|
2580
2721
|
useDeleteDataInstallation,
|
|
2581
2722
|
useDeleteOrganizationApiKey,
|
|
2723
|
+
useDeleteOrganizationDataInstallation,
|
|
2582
2724
|
useDeleteOrganizationDomain,
|
|
2583
2725
|
useDeletePasskey,
|
|
2584
2726
|
useDeleteTotpFactors,
|
|
@@ -2617,12 +2759,14 @@ const useSettings = (options) => {
|
|
|
2617
2759
|
useSendVerification,
|
|
2618
2760
|
useSessions,
|
|
2619
2761
|
useSettings,
|
|
2762
|
+
useSharedDataConnections,
|
|
2620
2763
|
useUpdateMe,
|
|
2621
2764
|
useUpdateMember,
|
|
2622
2765
|
useUpdatePassword,
|
|
2623
2766
|
useUpsertDataIntegrationApiKey,
|
|
2624
2767
|
useUpsertDataIntegrationClientCredentials,
|
|
2625
2768
|
useUpsertDataIntegrationConfiguration,
|
|
2769
|
+
useUpsertOrganizationDataIntegrationConfiguration,
|
|
2626
2770
|
useVerify,
|
|
2627
2771
|
useVerifyEmailChange,
|
|
2628
2772
|
useVerifyPasskey,
|