@axcode/axcloud-sdk 0.1.1 → 0.1.3
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.mts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -900,12 +900,16 @@ declare function useMySection(options?: {
|
|
|
900
900
|
* const { sections } = useSections()
|
|
901
901
|
* ```
|
|
902
902
|
*/
|
|
903
|
+
interface SectionsResponse {
|
|
904
|
+
sections: Section[];
|
|
905
|
+
total: number;
|
|
906
|
+
}
|
|
903
907
|
declare function useSections(): {
|
|
904
908
|
sections: Section[];
|
|
905
909
|
isLoading: boolean;
|
|
906
910
|
isError: boolean;
|
|
907
911
|
error: Error | null;
|
|
908
|
-
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<
|
|
912
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<SectionsResponse, Error>>;
|
|
909
913
|
};
|
|
910
914
|
|
|
911
915
|
interface UseFormsOptions {
|
package/dist/index.d.ts
CHANGED
|
@@ -900,12 +900,16 @@ declare function useMySection(options?: {
|
|
|
900
900
|
* const { sections } = useSections()
|
|
901
901
|
* ```
|
|
902
902
|
*/
|
|
903
|
+
interface SectionsResponse {
|
|
904
|
+
sections: Section[];
|
|
905
|
+
total: number;
|
|
906
|
+
}
|
|
903
907
|
declare function useSections(): {
|
|
904
908
|
sections: Section[];
|
|
905
909
|
isLoading: boolean;
|
|
906
910
|
isError: boolean;
|
|
907
911
|
error: Error | null;
|
|
908
|
-
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<
|
|
912
|
+
refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<SectionsResponse, Error>>;
|
|
909
913
|
};
|
|
910
914
|
|
|
911
915
|
interface UseFormsOptions {
|
package/dist/index.js
CHANGED
|
@@ -613,7 +613,7 @@ function useOrg() {
|
|
|
613
613
|
if (usePublicEndpoint) {
|
|
614
614
|
return client.get(`/content/public/${orgId}/org`);
|
|
615
615
|
} else {
|
|
616
|
-
return client.get(
|
|
616
|
+
return client.get(`/orgs/api/organizations/${orgId}`);
|
|
617
617
|
}
|
|
618
618
|
},
|
|
619
619
|
staleTime: 1e3 * 60 * 10
|
|
@@ -797,7 +797,7 @@ function useMySection(options = {}) {
|
|
|
797
797
|
throw new Error("User is not assigned to a section");
|
|
798
798
|
}
|
|
799
799
|
const section = await client.get(
|
|
800
|
-
|
|
800
|
+
`/orgs/api/organizations/${orgId}/sections/${sectionId}`,
|
|
801
801
|
{ includeMembers: includeMembers ? "true" : void 0 }
|
|
802
802
|
);
|
|
803
803
|
return section;
|
|
@@ -826,13 +826,13 @@ function useSections() {
|
|
|
826
826
|
const query = reactQuery.useQuery({
|
|
827
827
|
queryKey: ["axcloud", "sections", orgId, stage],
|
|
828
828
|
queryFn: async () => {
|
|
829
|
-
return client.get(
|
|
829
|
+
return client.get(`/orgs/api/organizations/${orgId}/sections`);
|
|
830
830
|
},
|
|
831
831
|
staleTime: 1e3 * 60 * 10
|
|
832
832
|
// 10 minutes
|
|
833
833
|
});
|
|
834
834
|
return {
|
|
835
|
-
sections: query.data ?? [],
|
|
835
|
+
sections: query.data?.sections ?? [],
|
|
836
836
|
isLoading: query.isLoading,
|
|
837
837
|
isError: query.isError,
|
|
838
838
|
error: query.error,
|
|
@@ -910,7 +910,7 @@ function useLinkedAccounts() {
|
|
|
910
910
|
const query = reactQuery.useQuery({
|
|
911
911
|
queryKey: [...LINKED_ACCOUNTS_QUERY_KEY, stage],
|
|
912
912
|
queryFn: async () => {
|
|
913
|
-
return client.get(
|
|
913
|
+
return client.get(`/identities/api/users/me/identities`);
|
|
914
914
|
},
|
|
915
915
|
enabled: isAuthenticated,
|
|
916
916
|
staleTime: 1e3 * 60 * 5
|
|
@@ -919,7 +919,7 @@ function useLinkedAccounts() {
|
|
|
919
919
|
const linkMutation = reactQuery.useMutation({
|
|
920
920
|
mutationFn: async (provider) => {
|
|
921
921
|
const response = await client.post(
|
|
922
|
-
|
|
922
|
+
`/identities/api/users/me/identities/${provider}/link`,
|
|
923
923
|
{}
|
|
924
924
|
);
|
|
925
925
|
if (response.authorization_url) {
|
|
@@ -934,7 +934,7 @@ function useLinkedAccounts() {
|
|
|
934
934
|
const unlinkMutation = reactQuery.useMutation({
|
|
935
935
|
mutationFn: async (provider) => {
|
|
936
936
|
return client.delete(
|
|
937
|
-
|
|
937
|
+
`/identities/api/users/me/identities/${provider}`
|
|
938
938
|
);
|
|
939
939
|
},
|
|
940
940
|
onSuccess: () => {
|