mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-06-01 15:39:00 +00:00
- 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.
19 lines
653 B
TypeScript
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;
|
|
}
|