@avallon-labs/sdk 54.3.0 → 54.4.0-staging.1249
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/dist/index.d.ts +477 -481
- package/dist/index.js +36 -36
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -867,6 +867,42 @@ var useRefreshToken = (options) => {
|
|
|
867
867
|
...query
|
|
868
868
|
};
|
|
869
869
|
};
|
|
870
|
+
var getRefreshSessionUrl = () => {
|
|
871
|
+
return `/v1/auth/session/refresh`;
|
|
872
|
+
};
|
|
873
|
+
var refreshSession = async (refreshSessionBody, options) => {
|
|
874
|
+
const getHeaders = (h) => {
|
|
875
|
+
if (!h) return {};
|
|
876
|
+
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
877
|
+
if (Array.isArray(h)) return Object.fromEntries(h);
|
|
878
|
+
return h;
|
|
879
|
+
};
|
|
880
|
+
return customFetchNoAuth(getRefreshSessionUrl(), {
|
|
881
|
+
...options,
|
|
882
|
+
method: "POST",
|
|
883
|
+
headers: {
|
|
884
|
+
"Content-Type": "application/json",
|
|
885
|
+
...getHeaders(options?.headers)
|
|
886
|
+
},
|
|
887
|
+
body: JSON.stringify(refreshSessionBody)
|
|
888
|
+
});
|
|
889
|
+
};
|
|
890
|
+
var getRefreshSessionMutationFetcher = (options) => {
|
|
891
|
+
return (_, { arg }) => {
|
|
892
|
+
return refreshSession(arg, options);
|
|
893
|
+
};
|
|
894
|
+
};
|
|
895
|
+
var getRefreshSessionMutationKey = () => [`/v1/auth/session/refresh`];
|
|
896
|
+
var useRefreshSession = (options) => {
|
|
897
|
+
const { swr: swrOptions, request: requestOptions } = options ?? {};
|
|
898
|
+
const swrKey = swrOptions?.swrKey ?? getRefreshSessionMutationKey();
|
|
899
|
+
const swrFn = getRefreshSessionMutationFetcher(requestOptions);
|
|
900
|
+
const query = useSWRMutation4(swrKey, swrFn, swrOptions);
|
|
901
|
+
return {
|
|
902
|
+
swrKey,
|
|
903
|
+
...query
|
|
904
|
+
};
|
|
905
|
+
};
|
|
870
906
|
var getGetOAuthUrlUrl = (params) => {
|
|
871
907
|
const normalizedParams = new URLSearchParams();
|
|
872
908
|
Object.entries(params || {}).forEach(([key, value]) => {
|
|
@@ -3702,42 +3738,6 @@ var useDeleteSecret = (secretId, options) => {
|
|
|
3702
3738
|
...query
|
|
3703
3739
|
};
|
|
3704
3740
|
};
|
|
3705
|
-
var getRefreshSessionUrl = () => {
|
|
3706
|
-
return `/v1/auth/session/refresh`;
|
|
3707
|
-
};
|
|
3708
|
-
var refreshSession = async (refreshSessionBody, options) => {
|
|
3709
|
-
const getHeaders = (h) => {
|
|
3710
|
-
if (!h) return {};
|
|
3711
|
-
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
3712
|
-
if (Array.isArray(h)) return Object.fromEntries(h);
|
|
3713
|
-
return h;
|
|
3714
|
-
};
|
|
3715
|
-
return customFetch(getRefreshSessionUrl(), {
|
|
3716
|
-
...options,
|
|
3717
|
-
method: "POST",
|
|
3718
|
-
headers: {
|
|
3719
|
-
"Content-Type": "application/json",
|
|
3720
|
-
...getHeaders(options?.headers)
|
|
3721
|
-
},
|
|
3722
|
-
body: JSON.stringify(refreshSessionBody)
|
|
3723
|
-
});
|
|
3724
|
-
};
|
|
3725
|
-
var getRefreshSessionMutationFetcher = (options) => {
|
|
3726
|
-
return (_, { arg }) => {
|
|
3727
|
-
return refreshSession(arg, options);
|
|
3728
|
-
};
|
|
3729
|
-
};
|
|
3730
|
-
var getRefreshSessionMutationKey = () => [`/v1/auth/session/refresh`];
|
|
3731
|
-
var useRefreshSession = (options) => {
|
|
3732
|
-
const { swr: swrOptions, request: requestOptions } = options ?? {};
|
|
3733
|
-
const swrKey = swrOptions?.swrKey ?? getRefreshSessionMutationKey();
|
|
3734
|
-
const swrFn = getRefreshSessionMutationFetcher(requestOptions);
|
|
3735
|
-
const query = useSWRMutation4(swrKey, swrFn, swrOptions);
|
|
3736
|
-
return {
|
|
3737
|
-
swrKey,
|
|
3738
|
-
...query
|
|
3739
|
-
};
|
|
3740
|
-
};
|
|
3741
3741
|
var getListTeamMembersUrl = () => {
|
|
3742
3742
|
return `/v1/team/members`;
|
|
3743
3743
|
};
|