123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- export enum CodeEnum {
- success = 'Success',
- error = 'Error',
- }
- export type CodeStatus = {
- error_code: CodeEnum;
- reason?: string;
- };
- // error msgs
- export const ERR_NO_COLLECTION = 'collection name is invalid';
- export const ERR_NO_ADDRESS = 'no address';
- export const ERR_NO_PARAM = 'no valid param';
- export const ERR_NO_ALIAS = 'no valid alias';
- // mock data
- export const mockAddress = '127.0.0.1';
- export const mockCollectionNames = [{ name: 'c1' }, { name: 'c2' }];
- export const mockCollections = [
- {
- name: 'c1',
- collectionID: 1,
- schema: {
- fields: [
- {
- name: 'vector_field',
- data_type: 'data_type',
- type_params: [
- {
- key: 'dim',
- value: '4',
- },
- ],
- },
- {
- is_primary_key: true,
- autoID: true,
- name: 'age',
- data_type: 'data_type',
- type_params: [] as any[],
- },
- ],
- description: 'mock schema description 1',
- },
- created_utc_timestamp: '123456',
- },
- {
- name: 'c2',
- collectionID: 2,
- schema: {
- fields: [
- {
- name: 'vector_field',
- data_type: 'data_type',
- type_params: [
- {
- key: 'dim',
- value: '4',
- },
- ],
- },
- {
- name: 'age',
- data_type: 'data_type',
- type_params: [] as any[],
- },
- ],
- description: 'mock schema description 2',
- },
- created_utc_timestamp: '1234567',
- },
- ];
- export const mockLoadedCollections = [
- {
- id: 1,
- name: 'c1',
- loadedPercentage: '100',
- },
- ];
- // index state is finished
- export const mockIndexState = [
- { collection_name: 'c1', state: 3 },
- { collection_name: 'c2', state: 2 },
- ];
- // mock results
- export const mockGetAllCollectionsData = [
- {
- collection_name: 'c2',
- schema: {
- fields: [
- {
- name: 'vector_field',
- data_type: 'data_type',
- type_params: [
- {
- key: 'dim',
- value: '4',
- },
- ],
- },
- {
- name: 'age',
- data_type: 'data_type',
- type_params: [] as any[],
- },
- ],
- description: 'mock schema description 2',
- },
- description: 'mock schema description 2',
- autoID: undefined as boolean,
- rowCount: 7,
- id: 2,
- loadedPercentage: '-1',
- createdTime: 1234567,
- index_status: 2,
- },
- {
- collection_name: 'c1',
- schema: {
- fields: [
- {
- name: 'vector_field',
- data_type: 'data_type',
- type_params: [
- {
- key: 'dim',
- value: '4',
- },
- ],
- },
- {
- is_primary_key: true,
- autoID: true,
- name: 'age',
- data_type: 'data_type',
- type_params: [] as any[],
- },
- ],
- description: 'mock schema description 1',
- },
- description: 'mock schema description 1',
- autoID: true,
- rowCount: 7,
- id: 1,
- loadedPercentage: '100',
- createdTime: 123456,
- index_status: 3,
- },
- ];
- export const mockLoadedCollectionsData = [
- {
- collection_name: 'c1',
- id: 1,
- rowCount: 7,
- },
- ];
|