@zilliz/milvus2-sdk-node 2.3.2 → 2.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/README.md +2 -2
  2. package/dist/milvus/HttpClient.d.ts +83 -0
  3. package/dist/milvus/HttpClient.js +148 -0
  4. package/dist/milvus/HttpClient.js.map +1 -0
  5. package/dist/milvus/MilvusClient.js +2 -2
  6. package/dist/milvus/MilvusClient.js.map +1 -1
  7. package/dist/milvus/const/defaults.d.ts +6 -1
  8. package/dist/milvus/const/defaults.js +7 -2
  9. package/dist/milvus/const/defaults.js.map +1 -1
  10. package/dist/milvus/const/{ErrorReason.d.ts → error.d.ts} +9 -0
  11. package/dist/milvus/const/{ErrorReason.js → error.js} +12 -2
  12. package/dist/milvus/const/error.js.map +1 -0
  13. package/dist/milvus/const/index.d.ts +2 -2
  14. package/dist/milvus/const/index.js +2 -3
  15. package/dist/milvus/const/index.js.map +1 -1
  16. package/dist/milvus/const/{Milvus.d.ts → milvus.d.ts} +16 -4
  17. package/dist/milvus/const/{Milvus.js → milvus.js} +45 -65
  18. package/dist/milvus/const/milvus.js.map +1 -0
  19. package/dist/milvus/grpc/BaseClient.d.ts +1 -0
  20. package/dist/milvus/grpc/BaseClient.js +7 -0
  21. package/dist/milvus/grpc/BaseClient.js.map +1 -1
  22. package/dist/milvus/grpc/Collection.d.ts +50 -1
  23. package/dist/milvus/grpc/Collection.js +75 -0
  24. package/dist/milvus/grpc/Collection.js.map +1 -1
  25. package/dist/milvus/grpc/Data.d.ts +3 -2
  26. package/dist/milvus/grpc/Data.js +84 -54
  27. package/dist/milvus/grpc/Data.js.map +1 -1
  28. package/dist/milvus/grpc/GrpcClient.js +1 -0
  29. package/dist/milvus/grpc/GrpcClient.js.map +1 -1
  30. package/dist/milvus/http/Collection.d.ts +36 -0
  31. package/dist/milvus/http/Collection.js +63 -0
  32. package/dist/milvus/http/Collection.js.map +1 -0
  33. package/dist/milvus/http/Vector.d.ts +39 -0
  34. package/dist/milvus/http/Vector.js +74 -0
  35. package/dist/milvus/http/Vector.js.map +1 -0
  36. package/dist/milvus/http/index.d.ts +2 -0
  37. package/dist/milvus/http/index.js +19 -0
  38. package/dist/milvus/http/index.js.map +1 -0
  39. package/dist/milvus/index.d.ts +1 -0
  40. package/dist/milvus/index.js +1 -0
  41. package/dist/milvus/index.js.map +1 -1
  42. package/dist/milvus/orm/Collection.d.ts +2 -2
  43. package/dist/milvus/types/Client.d.ts +1 -0
  44. package/dist/milvus/types/Collection.d.ts +28 -46
  45. package/dist/milvus/types/Collection.js +0 -6
  46. package/dist/milvus/types/Collection.js.map +1 -1
  47. package/dist/milvus/types/Common.d.ts +9 -11
  48. package/dist/milvus/types/Common.js +0 -14
  49. package/dist/milvus/types/Common.js.map +1 -1
  50. package/dist/milvus/types/Data.d.ts +59 -62
  51. package/dist/milvus/types/Database.d.ts +7 -6
  52. package/dist/milvus/types/HighLevel.d.ts +2 -3
  53. package/dist/milvus/types/Http.d.ts +100 -0
  54. package/dist/milvus/types/Http.js +3 -0
  55. package/dist/milvus/types/Http.js.map +1 -0
  56. package/dist/milvus/types/MilvusIndex.d.ts +10 -25
  57. package/dist/milvus/types/Partition.d.ts +5 -9
  58. package/dist/milvus/types/Resource.d.ts +5 -9
  59. package/dist/milvus/types/Response.d.ts +0 -7
  60. package/dist/milvus/types/Response.js +0 -31
  61. package/dist/milvus/types/Response.js.map +1 -1
  62. package/dist/milvus/types/User.d.ts +25 -36
  63. package/dist/milvus/types/index.d.ts +1 -0
  64. package/dist/milvus/types/index.js +1 -0
  65. package/dist/milvus/types/index.js.map +1 -1
  66. package/dist/milvus/types.d.ts +1 -0
  67. package/dist/milvus/types.js +1 -0
  68. package/dist/milvus/types.js.map +1 -1
  69. package/dist/milvus/utils/Blob.d.ts +3 -2
  70. package/dist/milvus/utils/Blob.js.map +1 -1
  71. package/dist/milvus/utils/Format.d.ts +18 -10
  72. package/dist/milvus/utils/Format.js +55 -18
  73. package/dist/milvus/utils/Format.js.map +1 -1
  74. package/dist/milvus/utils/Function.js +6 -0
  75. package/dist/milvus/utils/Function.js.map +1 -1
  76. package/dist/milvus/utils/Grpc.d.ts +2 -1
  77. package/dist/milvus/utils/Grpc.js +7 -7
  78. package/dist/milvus/utils/Grpc.js.map +1 -1
  79. package/dist/proto/proto/common.proto +11 -3
  80. package/dist/proto/proto/google/protobuf/descriptor.proto +50 -31
  81. package/dist/proto/proto/milvus.proto +32 -9
  82. package/dist/proto/proto/schema.proto +2 -1
  83. package/dist/sdk.json +1 -1
  84. package/package.json +7 -5
  85. package/dist/milvus/const/ErrorReason.js.map +0 -1
  86. package/dist/milvus/const/Milvus.js.map +0 -1
@@ -24,4 +24,5 @@ __exportStar(require("./types"), exports);
24
24
  __exportStar(require("./grpc/GrpcClient"), exports);
25
25
  __exportStar(require("./MilvusClient"), exports);
26
26
  __exportStar(require("./OrmClient"), exports);
27
+ __exportStar(require("./HttpClient"), exports);
27
28
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../milvus/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,SAAS;AACT,0CAAwB;AACxB,QAAQ;AACR,0CAAwB;AACxB,QAAQ;AACR,0CAAwB;AACxB,UAAU;AACV,oDAAkC;AAClC,iDAA+B;AAC/B,8CAA4B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../milvus/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,SAAS;AACT,0CAAwB;AACxB,QAAQ;AACR,0CAAwB;AACxB,QAAQ;AACR,0CAAwB;AACxB,UAAU;AACV,oDAAkC;AAClC,iDAA+B;AAC/B,8CAA4B;AAC5B,+CAA6B"}
@@ -15,8 +15,8 @@ export declare class Collection {
15
15
  init(): Promise<void>;
16
16
  count(): Promise<number>;
17
17
  info(): Promise<{
18
- status: import("..").ResStatus;
19
18
  index_descriptions: import("..").IndexDescription[];
19
+ status: import("..").ResStatus;
20
20
  schema: import("..").CollectionSchema;
21
21
  collectionID: string;
22
22
  consistency_level: string;
@@ -24,7 +24,7 @@ export declare class Collection {
24
24
  virtual_channel_names: string[];
25
25
  physical_channel_names: string[];
26
26
  start_positions: string[];
27
- properties: string[];
27
+ properties: import("..").KeyValuePair[];
28
28
  created_timestamp: string;
29
29
  created_utc_timestamp: string;
30
30
  shards_num: number;
@@ -3,6 +3,7 @@ import { ChannelOptions } from '@grpc/grpc-js';
3
3
  * Configuration options for the Milvus client.
4
4
  */
5
5
  export interface ClientConfig {
6
+ id?: string;
6
7
  protoFilePath?: {
7
8
  milvus?: string;
8
9
  schema?: string;
@@ -1,9 +1,10 @@
1
- import { ResStatus, KeyValuePair, GrpcTimeOut, TimeStamp, TimeStampArray } from './Common';
2
- import { CompactionState, DataType, LoadState, DataTypeMap } from '../';
1
+ import { ResStatus, KeyValuePair, GrpcTimeOut, TimeStamp, TimeStampArray, resStatusResponse, collectionNameReq } from './Common';
2
+ import { CompactionState, DataType, LoadState, DataTypeMap, ShowCollectionsType } from '../';
3
3
  export interface FieldSchema {
4
4
  name: string;
5
5
  description: string;
6
6
  data_type: keyof typeof DataType;
7
+ element_type?: keyof typeof DataType;
7
8
  dataType?: DataType;
8
9
  is_primary_key?: boolean;
9
10
  is_partition_key?: boolean;
@@ -33,11 +34,12 @@ export interface ReplicaInfo {
33
34
  node_ids: string[];
34
35
  }
35
36
  export type TypeParam = string | number;
36
- export type TypeParamKey = 'dim' | 'max_length';
37
+ export type TypeParamKey = 'dim' | 'max_length' | 'max_capacity';
37
38
  export interface FieldType {
38
39
  name: string;
39
40
  description?: string;
40
41
  data_type: DataType | keyof typeof DataTypeMap;
42
+ element_type?: DataType | keyof typeof DataTypeMap;
41
43
  is_primary_key?: boolean;
42
44
  is_partition_key?: boolean;
43
45
  type_params?: {
@@ -45,13 +47,10 @@ export interface FieldType {
45
47
  };
46
48
  autoID?: boolean;
47
49
  dim?: TypeParam;
50
+ max_capacity?: TypeParam;
48
51
  max_length?: TypeParam;
49
52
  default_value?: number | string;
50
53
  }
51
- export declare enum ShowCollectionsType {
52
- All = 0,
53
- Loaded = 1
54
- }
55
54
  export interface ShowCollectionsReq extends GrpcTimeOut {
56
55
  type?: ShowCollectionsType;
57
56
  collection_names?: string[];
@@ -67,39 +66,31 @@ export interface CreateCollectionReq extends GrpcTimeOut {
67
66
  enable_dynamic_field?: boolean;
68
67
  enableDynamicField?: boolean;
69
68
  }
70
- export interface CollectionNameReq extends GrpcTimeOut {
71
- /**
72
- * @param collection_name collection name string
73
- */
74
- collection_name: string;
75
- }
76
- export interface HasCollectionReq extends CollectionNameReq {
69
+ export interface HasCollectionReq extends collectionNameReq {
77
70
  }
78
- export interface DescribeCollectionReq extends CollectionNameReq {
71
+ export interface DescribeCollectionReq extends collectionNameReq {
79
72
  cache?: boolean;
80
73
  }
81
- export interface GetCollectionStatisticsReq extends CollectionNameReq {
74
+ export interface GetCollectionStatisticsReq extends collectionNameReq {
82
75
  }
83
- export interface LoadCollectionReq extends CollectionNameReq {
76
+ export interface LoadCollectionReq extends collectionNameReq {
84
77
  replica_number?: number;
85
78
  resource_groups?: string[];
86
79
  refresh?: boolean;
87
80
  }
88
- export interface ReleaseLoadCollectionReq extends CollectionNameReq {
81
+ export interface ReleaseLoadCollectionReq extends collectionNameReq {
89
82
  }
90
- export interface DropCollectionReq extends CollectionNameReq {
83
+ export interface DropCollectionReq extends collectionNameReq {
91
84
  }
92
- export interface CreateAliasReq extends CollectionNameReq {
85
+ export interface CreateAliasReq extends collectionNameReq {
93
86
  alias: string;
94
87
  }
95
88
  export interface DropAliasReq extends GrpcTimeOut {
96
89
  alias: string;
97
90
  }
98
- export interface AlterAliasReq extends CollectionNameReq {
99
- alias: string;
91
+ export interface AlterAliasReq extends CreateAliasReq {
100
92
  }
101
- export interface CompactReq extends GrpcTimeOut {
102
- collection_name: string;
93
+ export interface CompactReq extends collectionNameReq {
103
94
  timetravel?: number | string;
104
95
  }
105
96
  export interface GetCompactionStateReq extends GrpcTimeOut {
@@ -109,22 +100,16 @@ export interface GetCompactionPlansReq extends GrpcTimeOut {
109
100
  compactionID: number | string;
110
101
  }
111
102
  export interface GetReplicaReq extends GrpcTimeOut {
112
- /**
113
- * @param collectionID collection ID
114
- */
115
103
  collectionID: number | string;
116
104
  with_shard_nodes?: boolean;
117
105
  }
118
- export interface RenameCollectionReq extends GrpcTimeOut {
119
- collection_name: string;
106
+ export interface RenameCollectionReq extends collectionNameReq {
120
107
  new_collection_name: string;
121
108
  }
122
- export interface BoolResponse {
123
- status: ResStatus;
109
+ export interface BoolResponse extends resStatusResponse {
124
110
  value: Boolean;
125
111
  }
126
- export interface CompactionResponse {
127
- status: ResStatus;
112
+ export interface CompactionResponse extends resStatusResponse {
128
113
  compactionID: string;
129
114
  }
130
115
  export interface CollectionSchema {
@@ -142,23 +127,21 @@ export interface DescribeCollectionResponse extends TimeStamp {
142
127
  virtual_channel_names: string[];
143
128
  physical_channel_names: string[];
144
129
  start_positions: string[];
145
- properties: string[];
130
+ properties: KeyValuePair[];
146
131
  created_timestamp: string;
147
132
  created_utc_timestamp: string;
148
133
  shards_num: number;
149
134
  num_partitions?: string;
150
135
  db_name: string;
151
136
  }
152
- export interface GetCompactionPlansResponse {
153
- status: ResStatus;
137
+ export interface GetCompactionPlansResponse extends resStatusResponse {
154
138
  state: CompactionState;
155
139
  mergeInfos: {
156
140
  sources: string[];
157
141
  target: string;
158
142
  }[];
159
143
  }
160
- export interface GetCompactionStateResponse {
161
- status: ResStatus;
144
+ export interface GetCompactionStateResponse extends resStatusResponse {
162
145
  state: CompactionState;
163
146
  executingPlanNo: string;
164
147
  timeoutPlanNo: string;
@@ -168,28 +151,27 @@ export interface ShowCollectionsResponse extends TimeStampArray {
168
151
  status: ResStatus;
169
152
  data: CollectionData[];
170
153
  }
171
- export interface StatisticsResponse {
172
- status: ResStatus;
154
+ export interface StatisticsResponse extends resStatusResponse {
173
155
  stats: KeyValuePair[];
174
156
  data: {
175
157
  [x: string]: any;
176
158
  };
177
159
  }
178
- export interface ReplicasResponse {
179
- status: ResStatus;
160
+ export interface ReplicasResponse extends resStatusResponse {
180
161
  replicas: ReplicaInfo[];
181
162
  }
182
163
  export interface GetLoadingProgressReq extends GrpcTimeOut {
183
164
  collection_name: string;
184
165
  partition_names?: string[];
185
166
  }
186
- export interface GetLoadingProgressResponse {
187
- status: ResStatus;
167
+ export interface GetLoadingProgressResponse extends resStatusResponse {
188
168
  progress: string;
189
169
  }
190
170
  export interface GetLoadStateReq extends GetLoadingProgressReq {
191
171
  }
192
- export interface GetLoadStateResponse {
193
- status: ResStatus;
172
+ export interface GetLoadStateResponse extends resStatusResponse {
194
173
  state: LoadState;
195
174
  }
175
+ export interface AlterCollectionReq extends collectionNameReq {
176
+ properties: Record<string, string | number>;
177
+ }
@@ -1,9 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ShowCollectionsType = void 0;
4
- var ShowCollectionsType;
5
- (function (ShowCollectionsType) {
6
- ShowCollectionsType[ShowCollectionsType["All"] = 0] = "All";
7
- ShowCollectionsType[ShowCollectionsType["Loaded"] = 1] = "Loaded";
8
- })(ShowCollectionsType = exports.ShowCollectionsType || (exports.ShowCollectionsType = {}));
9
3
  //# sourceMappingURL=Collection.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Collection.js","sourceRoot":"","sources":["../../../milvus/types/Collection.ts"],"names":[],"mappings":";;;AAgEA,IAAY,mBAGX;AAHD,WAAY,mBAAmB;IAC7B,2DAAG,CAAA;IACH,iEAAM,CAAA;AACR,CAAC,EAHW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAG9B"}
1
+ {"version":3,"file":"Collection.js","sourceRoot":"","sources":["../../../milvus/types/Collection.ts"],"names":[],"mappings":""}
@@ -8,17 +8,6 @@ export interface KeyValuePair {
8
8
  key: string;
9
9
  value: string | number;
10
10
  }
11
- export declare enum IndexState {
12
- IndexStateNone = 0,
13
- Unissued = 1,
14
- InProgress = 2,
15
- Finished = 3,
16
- Failed = 4
17
- }
18
- export declare enum DslType {
19
- Dsl = 0,
20
- BoolExprV1 = 1
21
- }
22
11
  interface NumberArray {
23
12
  data: Number[];
24
13
  }
@@ -40,6 +29,9 @@ export interface ResStatus {
40
29
  reason: string;
41
30
  code?: number;
42
31
  }
32
+ export interface resStatusResponse {
33
+ status: ResStatus;
34
+ }
43
35
  export interface TimeStamp {
44
36
  created_timestamp: string;
45
37
  created_utc_timestamp: string;
@@ -51,4 +43,10 @@ export interface TimeStampArray {
51
43
  export interface keyValueObj {
52
44
  [key: string]: string | number;
53
45
  }
46
+ export interface collectionNameReq extends GrpcTimeOut {
47
+ collection_name: string;
48
+ }
49
+ export interface partitionNameReq extends collectionNameReq {
50
+ partition_name?: string;
51
+ }
54
52
  export {};
@@ -1,17 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DslType = exports.IndexState = void 0;
4
- var IndexState;
5
- (function (IndexState) {
6
- IndexState[IndexState["IndexStateNone"] = 0] = "IndexStateNone";
7
- IndexState[IndexState["Unissued"] = 1] = "Unissued";
8
- IndexState[IndexState["InProgress"] = 2] = "InProgress";
9
- IndexState[IndexState["Finished"] = 3] = "Finished";
10
- IndexState[IndexState["Failed"] = 4] = "Failed";
11
- })(IndexState = exports.IndexState || (exports.IndexState = {}));
12
- var DslType;
13
- (function (DslType) {
14
- DslType[DslType["Dsl"] = 0] = "Dsl";
15
- DslType[DslType["BoolExprV1"] = 1] = "BoolExprV1";
16
- })(DslType = exports.DslType || (exports.DslType = {}));
17
3
  //# sourceMappingURL=Common.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Common.js","sourceRoot":"","sources":["../../../milvus/types/Common.ts"],"names":[],"mappings":";;;AAkBA,IAAY,UAMX;AAND,WAAY,UAAU;IACpB,+DAAkB,CAAA;IAClB,mDAAY,CAAA;IACZ,uDAAc,CAAA;IACd,mDAAY,CAAA;IACZ,+CAAU,CAAA;AACZ,CAAC,EANW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAMrB;AAED,IAAY,OAGX;AAHD,WAAY,OAAO;IACjB,mCAAO,CAAA;IACP,iDAAc,CAAA;AAChB,CAAC,EAHW,OAAO,GAAP,eAAO,KAAP,eAAO,QAGlB"}
1
+ {"version":3,"file":"Common.js","sourceRoot":"","sources":["../../../milvus/types/Common.ts"],"names":[],"mappings":""}
@@ -1,33 +1,48 @@
1
1
  /// <reference types="node" />
2
- import { GrpcTimeOut, KeyValuePair, ResStatus, NumberArrayId, StringArrayId, keyValueObj, DataType, SegmentState, ImportState, ConsistencyLevelEnum, CollectionNameReq } from '../';
2
+ import { GrpcTimeOut, KeyValuePair, NumberArrayId, StringArrayId, keyValueObj, DataType, SegmentState, ImportState, ConsistencyLevelEnum, collectionNameReq, resStatusResponse } from '../';
3
+ export type FloatVectors = number[];
4
+ export type BinaryVectors = number[];
5
+ export type Vectors = FloatVectors | BinaryVectors;
6
+ export type Bool = boolean;
7
+ export type Int8 = number;
8
+ export type Int16 = number;
9
+ export type Int32 = number;
10
+ export type Int64 = number;
11
+ export type Float = number;
12
+ export type Double = number;
13
+ export type VarChar = string;
14
+ export type JSON = {
15
+ [key: string]: any;
16
+ };
17
+ export type Array = Int8[] | Int16[] | Int32[] | Int64[] | Float[] | Double[] | VarChar[];
18
+ export type FieldData = Bool | Int8 | Int16 | Int32 | Int64 | Float | Double | VarChar | JSON | Array | Vectors | FloatVectors | BinaryVectors;
19
+ export interface RowData {
20
+ [x: string]: FieldData;
21
+ }
22
+ export interface Field {
23
+ name: string;
24
+ type: keyof typeof DataType;
25
+ elementType?: keyof typeof DataType;
26
+ data: FieldData[];
27
+ dim?: number;
28
+ }
3
29
  export interface FlushReq extends GrpcTimeOut {
4
30
  collection_names: string[];
5
31
  }
6
- export interface FieldData {
7
- type: DataType;
8
- field_name: string;
9
- dim?: number;
10
- data: Number[];
32
+ export interface CountReq extends collectionNameReq {
11
33
  }
12
- export interface InsertReq extends GrpcTimeOut {
13
- collection_name: string;
34
+ export interface InsertReq extends collectionNameReq {
14
35
  partition_name?: string;
15
- fields_data?: {
16
- [x: string]: any;
17
- }[];
18
- data?: {
19
- [x: string]: any;
20
- }[];
36
+ fields_data?: RowData[];
37
+ data?: RowData[];
21
38
  hash_keys?: Number[];
22
39
  }
23
- export interface DeleteEntitiesReq extends GrpcTimeOut {
24
- collection_name: string;
40
+ export interface DeleteEntitiesReq extends collectionNameReq {
25
41
  expr?: string;
26
42
  filter?: string;
27
43
  partition_name?: string;
28
44
  }
29
- export interface DeleteReq extends GrpcTimeOut {
30
- collection_name: string;
45
+ export interface DeleteReq extends collectionNameReq {
31
46
  ids: string[] | number[];
32
47
  partition_name?: string;
33
48
  }
@@ -53,26 +68,22 @@ export interface GetQuerySegmentInfoReq extends GrpcTimeOut {
53
68
  export interface GePersistentSegmentInfoReq extends GrpcTimeOut {
54
69
  collectionName: string;
55
70
  }
56
- export interface ImportReq extends GrpcTimeOut {
57
- collection_name: string;
71
+ export interface ImportReq extends collectionNameReq {
58
72
  partition_name?: string;
59
73
  channel_names?: string[];
60
74
  files: string[];
61
75
  options?: KeyValuePair[];
62
76
  }
63
- export interface ListImportTasksReq extends GrpcTimeOut {
64
- collection_name: string;
77
+ export interface ListImportTasksReq extends collectionNameReq {
65
78
  limit?: number;
66
79
  }
67
80
  export interface GetImportStateReq extends GrpcTimeOut {
68
81
  task: number;
69
82
  }
70
- export interface GetFlushStateResponse {
71
- status: ResStatus;
83
+ export interface GetFlushStateResponse extends resStatusResponse {
72
84
  flushed: boolean;
73
85
  }
74
- export interface GetMetricsResponse {
75
- status: ResStatus;
86
+ export interface GetMetricsResponse extends resStatusResponse {
76
87
  response: any;
77
88
  component_name: string;
78
89
  }
@@ -94,18 +105,15 @@ export interface PersistentSegmentInfo {
94
105
  num_rows: number;
95
106
  state: SegmentState;
96
107
  }
97
- export interface GetQuerySegmentInfoResponse {
98
- status: ResStatus;
108
+ export interface GetQuerySegmentInfoResponse extends resStatusResponse {
99
109
  infos: QuerySegmentInfo[];
100
110
  }
101
- export interface GePersistentSegmentInfoResponse {
102
- status: ResStatus;
111
+ export interface GePersistentSegmentInfoResponse extends resStatusResponse {
103
112
  infos: PersistentSegmentInfo[];
104
113
  }
105
- export interface MutationResult {
114
+ export interface MutationResult extends resStatusResponse {
106
115
  succ_index: Number[];
107
116
  err_index: Number[];
108
- status: ResStatus;
109
117
  acknowledged: boolean;
110
118
  insert_cnt: string;
111
119
  delete_cnt: string;
@@ -113,27 +121,26 @@ export interface MutationResult {
113
121
  timestamp: string;
114
122
  IDs: StringArrayId | NumberArrayId;
115
123
  }
116
- export interface QueryResults {
117
- status: ResStatus;
124
+ export interface QueryResults extends resStatusResponse {
118
125
  data: {
119
126
  [x: string]: any;
120
127
  }[];
121
128
  }
129
+ export interface CountResult extends resStatusResponse {
130
+ data: number;
131
+ }
122
132
  export interface SearchResultData {
123
133
  [x: string]: any;
124
134
  score: number;
125
135
  id: string;
126
136
  }
127
- export interface SearchResults {
128
- status: ResStatus;
137
+ export interface SearchResults extends resStatusResponse {
129
138
  results: SearchResultData[];
130
139
  }
131
- export interface ImportResponse {
132
- status: ResStatus;
140
+ export interface ImportResponse extends resStatusResponse {
133
141
  tasks: number[];
134
142
  }
135
- export interface GetImportStateResponse {
136
- status: ResStatus;
143
+ export interface GetImportStateResponse extends resStatusResponse {
137
144
  state: ImportState;
138
145
  row_count: number;
139
146
  id_list: number[];
@@ -143,8 +150,7 @@ export interface GetImportStateResponse {
143
150
  segment_ids: number[];
144
151
  create_ts: number;
145
152
  }
146
- export interface ListImportTasksResponse {
147
- status: ResStatus;
153
+ export interface ListImportTasksResponse extends resStatusResponse {
148
154
  tasks: GetImportStateResponse[];
149
155
  }
150
156
  export interface GetMetricsRequest extends GrpcTimeOut {
@@ -160,8 +166,7 @@ export interface SearchParam {
160
166
  round_decimal?: number;
161
167
  ignore_growing?: boolean;
162
168
  }
163
- export interface SearchSimpleReq extends GrpcTimeOut {
164
- collection_name: string;
169
+ export interface SearchSimpleReq extends collectionNameReq {
165
170
  vector?: number[];
166
171
  vectors?: number[][];
167
172
  data?: number[][] | number[];
@@ -177,8 +182,7 @@ export interface SearchSimpleReq extends GrpcTimeOut {
177
182
  consistency_level?: ConsistencyLevelEnum;
178
183
  ignore_growing?: boolean;
179
184
  }
180
- export interface SearchReq extends GrpcTimeOut {
181
- collection_name: string;
185
+ export interface SearchReq extends collectionNameReq {
182
186
  partition_names?: string[];
183
187
  expr?: string;
184
188
  search_params: SearchParam;
@@ -189,8 +193,7 @@ export interface SearchReq extends GrpcTimeOut {
189
193
  nq?: number;
190
194
  consistency_level?: ConsistencyLevelEnum;
191
195
  }
192
- export interface SearchRes {
193
- status: ResStatus;
196
+ export interface SearchRes extends resStatusResponse {
194
197
  results: {
195
198
  top_k: number;
196
199
  fields_data: {
@@ -226,8 +229,7 @@ export interface SearchRes {
226
229
  output_fields: string[];
227
230
  };
228
231
  }
229
- export interface QueryReq extends GrpcTimeOut {
230
- collection_name: string;
232
+ export interface QueryReq extends collectionNameReq {
231
233
  output_fields?: string[];
232
234
  partition_names?: string[];
233
235
  expr?: string;
@@ -236,8 +238,7 @@ export interface QueryReq extends GrpcTimeOut {
236
238
  limit?: number;
237
239
  consistency_level?: ConsistencyLevelEnum;
238
240
  }
239
- export interface GetReq extends GrpcTimeOut {
240
- collection_name: string;
241
+ export interface GetReq extends collectionNameReq {
241
242
  ids: string[] | number[];
242
243
  output_fields?: string[];
243
244
  partition_names?: string[];
@@ -245,8 +246,7 @@ export interface GetReq extends GrpcTimeOut {
245
246
  limit?: number;
246
247
  consistency_level?: ConsistencyLevelEnum;
247
248
  }
248
- export interface QueryRes {
249
- status: ResStatus;
249
+ export interface QueryRes extends resStatusResponse {
250
250
  fields_data: {
251
251
  type: DataType;
252
252
  field_name: string;
@@ -268,23 +268,20 @@ export interface QueryRes {
268
268
  output_fields: string[];
269
269
  collection_name: string;
270
270
  }
271
- export interface FlushResult {
272
- status: ResStatus;
271
+ export interface FlushResult extends resStatusResponse {
273
272
  coll_segIDs: any;
274
273
  }
275
- export interface ListIndexedSegmentReq extends CollectionNameReq {
274
+ export interface ListIndexedSegmentReq extends collectionNameReq {
276
275
  index_name: string;
277
276
  }
278
- export interface ListIndexedSegmentResponse {
279
- status: ResStatus;
277
+ export interface ListIndexedSegmentResponse extends resStatusResponse {
280
278
  segmentIDs: number[];
281
279
  }
282
- export interface DescribeSegmentIndexDataReq extends CollectionNameReq {
280
+ export interface DescribeSegmentIndexDataReq extends collectionNameReq {
283
281
  index_name: string;
284
282
  segmentsIDs: number[];
285
283
  }
286
- export interface DescribeSegmentIndexDataResponse {
287
- status: ResStatus;
284
+ export interface DescribeSegmentIndexDataResponse extends resStatusResponse {
288
285
  index_params: any;
289
286
  index_data: any;
290
287
  }
@@ -1,12 +1,13 @@
1
- import { GrpcTimeOut, ResStatus } from './Common';
2
- export interface CreateDatabaseRequest extends GrpcTimeOut {
1
+ import { GrpcTimeOut, resStatusResponse } from './Common';
2
+ export interface databaseReq extends GrpcTimeOut {
3
3
  db_name: string;
4
4
  }
5
- export interface ListDatabasesRequest extends GrpcTimeOut {
5
+ export interface CreateDatabaseRequest extends databaseReq {
6
+ }
7
+ export interface DropDatabasesRequest extends databaseReq {
6
8
  }
7
- export interface DropDatabasesRequest extends CreateDatabaseRequest {
9
+ export interface ListDatabasesRequest extends GrpcTimeOut {
8
10
  }
9
- export interface ListDatabasesResponse {
11
+ export interface ListDatabasesResponse extends resStatusResponse {
10
12
  db_names: string[];
11
- status: ResStatus;
12
13
  }
@@ -1,6 +1,5 @@
1
- import { DataType, MetricType, CreateIndexParam } from '../';
2
- export interface CreateColReq {
3
- collection_name: string;
1
+ import { DataType, MetricType, CreateIndexParam, collectionNameReq } from '../';
2
+ export interface CreateColReq extends collectionNameReq {
4
3
  dimension: number;
5
4
  primary_field_name?: string;
6
5
  id_type?: DataType.Int64 | DataType.VarChar;
@@ -0,0 +1,100 @@
1
+ import { FloatVectors } from '..';
2
+ type Fetch = (input: any, init?: any) => Promise<any>;
3
+ export type Constructor<T = {}> = new (...args: any[]) => T;
4
+ export type FetchOptions = {
5
+ abortController: AbortController;
6
+ timeout: number;
7
+ };
8
+ type HttpClientConfigBase = {
9
+ database?: string;
10
+ version?: string;
11
+ token?: string;
12
+ username?: string;
13
+ password?: string;
14
+ timeout?: number;
15
+ fetch?: Fetch;
16
+ };
17
+ type HttpClientConfigAddress = HttpClientConfigBase & {
18
+ endpoint: string;
19
+ baseURL?: string;
20
+ };
21
+ type HttpClientConfigBaseURL = HttpClientConfigBase & {
22
+ endpoint?: string;
23
+ baseURL: string;
24
+ };
25
+ export type HttpClientConfig = HttpClientConfigAddress | HttpClientConfigBaseURL;
26
+ export interface HttpBaseReq {
27
+ dbName?: string;
28
+ collectionName: string;
29
+ }
30
+ export interface HttpBaseResponse<T = {}> {
31
+ code: number;
32
+ data: T;
33
+ message?: string;
34
+ }
35
+ export interface HttpCollectionCreateReq extends HttpBaseReq {
36
+ dimension: number;
37
+ metricType?: string;
38
+ primaryField?: string;
39
+ vectorField?: string;
40
+ description?: string;
41
+ }
42
+ export interface HttpCollectionListReq extends Omit<HttpBaseReq, 'collectionName'> {
43
+ }
44
+ type Field = {
45
+ autoId?: boolean;
46
+ description: string;
47
+ primaryKey?: boolean;
48
+ type: string;
49
+ };
50
+ type Index = {
51
+ fieldName: string;
52
+ indexName: string;
53
+ metricType: string;
54
+ };
55
+ export interface HttpCollectionDescribeResponse extends HttpBaseResponse<{
56
+ collectionName: string;
57
+ description: string;
58
+ fields: Field[];
59
+ indexes: Index[];
60
+ load: string;
61
+ shardsNum: number;
62
+ enableDynamic: boolean;
63
+ }> {
64
+ }
65
+ export interface HttpCollectionListResponse extends HttpBaseResponse<string[]> {
66
+ }
67
+ export interface HttpVectorInsertReq extends HttpBaseReq {
68
+ data: Record<string, any>[];
69
+ }
70
+ export interface HttpVectorInsertResponse extends HttpBaseResponse<{
71
+ insertCount: number;
72
+ insertIds: number | string[];
73
+ }> {
74
+ }
75
+ export interface HttpVectorGetReq extends HttpBaseReq {
76
+ id: number | number[] | string | string[];
77
+ outputFields: string[];
78
+ }
79
+ export interface HttpVectorDeleteReq extends Omit<HttpVectorGetReq, 'outputFields'> {
80
+ }
81
+ export interface HttpVectorQueryReq extends HttpBaseReq {
82
+ outputFields: string[];
83
+ filter?: string;
84
+ limit?: number;
85
+ offset?: number;
86
+ params?: Record<string, string | number>;
87
+ }
88
+ type QueryResult = Record<string, any>[];
89
+ export interface HttpVectorQueryResponse extends HttpBaseResponse<QueryResult> {
90
+ }
91
+ export interface HttpVectorSearchReq extends Omit<HttpVectorQueryReq, 'filter'> {
92
+ vector: FloatVectors;
93
+ filter?: string;
94
+ }
95
+ export interface HttpVectorSearchResponse extends HttpVectorQueryResponse {
96
+ data: QueryResult & {
97
+ distance: number | string;
98
+ };
99
+ }
100
+ export {};
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=Http.js.map