Files
bigcapital/shared/sdk-ts/src/generic-resource.ts
Ahmed Bouhuolia ac8dcfed67 feat(sdk): enhance authentication and account management API endpoints
- Added new authentication routes for user sign-in, sign-up, and password reset functionalities.
- Updated account management routes to include bulk delete and validation for accounts.
- Refactored type definitions to utilize utility functions for better type safety and clarity.
- Introduced new methods for handling user authentication and account operations in the SDK.
2026-03-05 01:07:14 +02:00

19 lines
653 B
TypeScript

import type { ApiFetcher } from './fetch-utils';
import { paths } from './schema';
import { OpForPath, OpResponseBody } from './utils';
export const GENERIC_RESOURCE_ROUTES = {
META: '/api/resources/{resourceModel}/meta',
} as const satisfies Record<string, keyof paths>;
export type ResourceMetaResponse = OpResponseBody<OpForPath<typeof GENERIC_RESOURCE_ROUTES.META, 'get'>>;
export async function fetchResourceMeta(
fetcher: ApiFetcher,
resourceModel: string
): Promise<ResourceMetaResponse> {
const get = fetcher.path(GENERIC_RESOURCE_ROUTES.META).method('get').create();
const { data } = await get({ resourceModel });
return data;
}