2024-03-21 05:15:12 +00:00
|
|
|
import type {AuthProvider} from "@refinedev/core";
|
2024-03-19 11:20:11 +00:00
|
|
|
import {fileProvider} from "~/data/file-provider.js";
|
|
|
|
import {Sdk} from "@lumeweb/portal-sdk";
|
|
|
|
import {accountProvider} from "~/data/account-provider.js";
|
|
|
|
import type {SdkProvider} from "~/data/sdk-provider.js";
|
|
|
|
import {createPortalAuthProvider} from "~/data/auth-provider.js";
|
|
|
|
|
2024-03-26 16:58:16 +00:00
|
|
|
export interface DataProviders {
|
2024-03-19 11:20:11 +00:00
|
|
|
default: SdkProvider;
|
|
|
|
auth: AuthProvider;
|
|
|
|
[key: string]: SdkProvider | AuthProvider;
|
|
|
|
}
|
|
|
|
|
|
|
|
export function getProviders(sdk: Sdk) {
|
|
|
|
accountProvider.sdk = sdk;
|
|
|
|
fileProvider.sdk = sdk;
|
2024-03-26 16:58:16 +00:00
|
|
|
|
|
|
|
return {
|
2024-03-19 11:20:11 +00:00
|
|
|
default: accountProvider,
|
|
|
|
auth: createPortalAuthProvider(sdk),
|
|
|
|
files: fileProvider,
|
|
|
|
};
|
|
|
|
}
|