portal-dashboard/app/data/providers.ts

24 lines
695 B
TypeScript
Raw Normal View History

2024-03-21 05:15:12 +00:00
import type {AuthProvider} from "@refinedev/core";
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";
export interface DataProviders {
default: SdkProvider;
auth: AuthProvider;
[key: string]: SdkProvider | AuthProvider;
}
export function getProviders(sdk: Sdk) {
accountProvider.sdk = sdk;
fileProvider.sdk = sdk;
return {
default: accountProvider,
auth: createPortalAuthProvider(sdk),
files: fileProvider,
};
}