(type: string, account: string, container: string, filepath: string, write: boolean = false, enabled = true)
| 55 | }; |
| 56 | |
| 57 | export const useSasToken = (type: string, account: string, container: string, filepath: string, write: boolean = false, enabled = true) => { |
| 58 | const { dataSourcesQuery, filesQuery } = useUserSettings(); |
| 59 | const { instance } = useMsal(); |
| 60 | const client = DataSourceClientFactory(type, filesQuery.data, dataSourcesQuery.data, instance); |
| 61 | |
| 62 | return useQuery( |
| 63 | ['sas', type, account, container, filepath, write], |
| 64 | () => { |
| 65 | return fetchSasToken(client, account, container, filepath, write); |
| 66 | }, |
| 67 | { |
| 68 | enabled: enabled, |
| 69 | } |
| 70 | ); |
| 71 | }; |
| 72 | |
| 73 | export const useQueryMeta = (type: string, queryString: string, enabled = true) => { |
| 74 | const { dataSourcesQuery, filesQuery } = useUserSettings(); |
no test coverage detected