mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* add prefix to API resources * fix pw tests * refactor config * remove unnecessary prefixes in resource names * fixes * update screenshots
24 lines
754 B
TypeScript
24 lines
754 B
TypeScript
import type { ApiResource } from '../types';
|
|
import type { AddressMetadataInfo, PublicTagTypesResponse } from 'types/api/addressMetadata';
|
|
|
|
export const METADATA_API_RESOURCES = {
|
|
info: {
|
|
path: '/api/v1/metadata',
|
|
},
|
|
tags_search: {
|
|
path: '/api/v1/tags:search',
|
|
},
|
|
public_tag_types: {
|
|
path: '/api/v1/public-tag-types',
|
|
},
|
|
} satisfies Record<string, ApiResource>;
|
|
|
|
export type MetadataApiResourceName = `metadata:${ keyof typeof METADATA_API_RESOURCES }`;
|
|
|
|
/* eslint-disable @stylistic/indent */
|
|
export type MetadataApiResourcePayload<R extends MetadataApiResourceName> =
|
|
R extends 'metadata:info' ? AddressMetadataInfo :
|
|
R extends 'metadata:public_tag_types' ? PublicTagTypesResponse :
|
|
never;
|
|
/* eslint-enable @stylistic/indent */
|