1 | import { AnalyticsIndexManager } from './analyticsindexmanager';
|
2 | import { AnalyticsMetaData, AnalyticsQueryOptions, AnalyticsResult } from './analyticstypes';
|
3 | import { Authenticator } from './authenticators';
|
4 | import { CppConnection } from './binding';
|
5 | import { Bucket } from './bucket';
|
6 | import { BucketManager } from './bucketmanager';
|
7 | import { DiagnosticsOptions, DiagnosticsResult, PingOptions, PingResult } from './diagnosticstypes';
|
8 | import { EventingFunctionManager } from './eventingfunctionmanager';
|
9 | import { QueryIndexManager } from './queryindexmanager';
|
10 | import { QueryMetaData, QueryOptions, QueryResult } from './querytypes';
|
11 | import { SearchIndexManager } from './searchindexmanager';
|
12 | import { SearchQuery } from './searchquery';
|
13 | import { SearchMetaData, SearchQueryOptions, SearchRequest, SearchResult, SearchRow } from './searchtypes';
|
14 | import { StreamableRowPromise } from './streamablepromises';
|
15 | import { Transactions, TransactionsConfig } from './transactions';
|
16 | import { Transcoder } from './transcoders';
|
17 | import { UserManager } from './usermanager';
|
18 | import { NodeCallback } from './utilities';
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 | export interface TimeoutConfig {
|
25 | |
26 |
|
27 |
|
28 | kvTimeout?: number;
|
29 | |
30 |
|
31 |
|
32 | kvDurableTimeout?: number;
|
33 | |
34 |
|
35 |
|
36 | viewTimeout?: number;
|
37 | |
38 |
|
39 |
|
40 | queryTimeout?: number;
|
41 | |
42 |
|
43 |
|
44 | analyticsTimeout?: number;
|
45 | |
46 |
|
47 |
|
48 | searchTimeout?: number;
|
49 | |
50 |
|
51 |
|
52 | managementTimeout?: number;
|
53 | |
54 |
|
55 |
|
56 | bootstrapTimeout?: number;
|
57 | |
58 |
|
59 |
|
60 | connectTimeout?: number;
|
61 | |
62 |
|
63 |
|
64 | resolveTimeout?: number;
|
65 | }
|
66 |
|
67 |
|
68 |
|
69 |
|
70 |
|
71 | export interface SecurityConfig {
|
72 | |
73 |
|
74 |
|
75 |
|
76 | trustStorePath?: string;
|
77 | }
|
78 |
|
79 |
|
80 |
|
81 |
|
82 |
|
83 |
|
84 |
|
85 | export interface DnsConfig {
|
86 | |
87 |
|
88 |
|
89 | nameserver?: string;
|
90 | |
91 |
|
92 |
|
93 | port?: number;
|
94 | |
95 |
|
96 |
|
97 | dnsSrvTimeout?: number;
|
98 | }
|
99 |
|
100 |
|
101 |
|
102 |
|
103 |
|
104 |
|
105 | export interface ConnectOptions {
|
106 | |
107 |
|
108 |
|
109 |
|
110 | username?: string;
|
111 | |
112 |
|
113 |
|
114 |
|
115 |
|
116 | password?: string;
|
117 | |
118 |
|
119 |
|
120 | authenticator?: Authenticator;
|
121 | |
122 |
|
123 |
|
124 | security?: SecurityConfig;
|
125 | |
126 |
|
127 |
|
128 | timeouts?: TimeoutConfig;
|
129 | |
130 |
|
131 |
|
132 | transcoder?: Transcoder;
|
133 | |
134 |
|
135 |
|
136 | transactions?: TransactionsConfig;
|
137 | |
138 |
|
139 |
|
140 |
|
141 |
|
142 |
|
143 | dnsConfig?: DnsConfig;
|
144 | |
145 |
|
146 |
|
147 |
|
148 |
|
149 |
|
150 | configProfile?: string;
|
151 | }
|
152 |
|
153 |
|
154 |
|
155 |
|
156 |
|
157 |
|
158 |
|
159 | export declare class Cluster {
|
160 | private _connStr;
|
161 | private _trustStorePath;
|
162 | private _kvTimeout;
|
163 | private _kvDurableTimeout;
|
164 | private _viewTimeout;
|
165 | private _queryTimeout;
|
166 | private _analyticsTimeout;
|
167 | private _searchTimeout;
|
168 | private _managementTimeout;
|
169 | private _connectTimeout;
|
170 | private _bootstrapTimeout;
|
171 | private _resolveTimeout;
|
172 | private _auth;
|
173 | private _conn;
|
174 | private _transcoder;
|
175 | private _txnConfig;
|
176 | private _transactions?;
|
177 | private _openBuckets;
|
178 | private _dnsConfig;
|
179 | |
180 |
|
181 |
|
182 | get conn(): CppConnection;
|
183 | |
184 |
|
185 |
|
186 | get transcoder(): Transcoder;
|
187 | |
188 |
|
189 |
|
190 | get kvTimeout(): number;
|
191 | |
192 |
|
193 |
|
194 | get kvDurableTimeout(): number;
|
195 | |
196 |
|
197 |
|
198 | get viewTimeout(): number;
|
199 | |
200 |
|
201 |
|
202 | get queryTimeout(): number;
|
203 | |
204 |
|
205 |
|
206 | get analyticsTimeout(): number;
|
207 | |
208 |
|
209 |
|
210 | get searchTimeout(): number;
|
211 | |
212 |
|
213 |
|
214 | get managementTimeout(): number;
|
215 | |
216 |
|
217 |
|
218 | get bootstrapTimeout(): number | undefined;
|
219 | |
220 |
|
221 |
|
222 | get connectTimeout(): number | undefined;
|
223 | |
224 |
|
225 |
|
226 | get resolveTimeout(): number | undefined;
|
227 | |
228 |
|
229 |
|
230 |
|
231 | constructor(connStr: string, options?: ConnectOptions);
|
232 | /**
|
233 | @internal
|
234 | */
|
235 | static connect(connStr: string, options?: ConnectOptions, callback?: NodeCallback<Cluster>): Promise<Cluster>;
|
236 | /**
|
237 | * Creates a Bucket object reference to a specific bucket.
|
238 | *
|
239 | * @param bucketName The name of the bucket to reference.
|
240 | */
|
241 | bucket(bucketName: string): Bucket;
|
242 | /**
|
243 | * Returns a UserManager which can be used to manage the users
|
244 | * of this cluster.
|
245 | */
|
246 | users(): UserManager;
|
247 | /**
|
248 | * Returns a BucketManager which can be used to manage the buckets
|
249 | * of this cluster.
|
250 | */
|
251 | buckets(): BucketManager;
|
252 | /**
|
253 | * Returns a QueryIndexManager which can be used to manage the query indexes
|
254 | * of this cluster.
|
255 | */
|
256 | queryIndexes(): QueryIndexManager;
|
257 | /**
|
258 | * Returns a AnalyticsIndexManager which can be used to manage the analytics
|
259 | * indexes of this cluster.
|
260 | */
|
261 | analyticsIndexes(): AnalyticsIndexManager;
|
262 | /**
|
263 | * Returns a SearchIndexManager which can be used to manage the search
|
264 | * indexes of this cluster.
|
265 | */
|
266 | searchIndexes(): SearchIndexManager;
|
267 | /**
|
268 | * Returns a EventingFunctionManager which can be used to manage the eventing
|
269 | * functions of this cluster.
|
270 | * Uncommitted: This API is subject to change in the future.
|
271 | */
|
272 | eventingFunctions(): EventingFunctionManager;
|
273 | /**
|
274 | * Returns a Transactions object which can be used to perform transactions
|
275 | * on this cluster.
|
276 | */
|
277 | transactions(): Transactions;
|
278 | /**
|
279 | * Executes a N1QL query against the cluster.
|
280 | *
|
281 | * @param statement The N1QL statement to execute.
|
282 | * @param options Optional parameters for this operation.
|
283 | * @param callback A node-style callback to be invoked after execution.
|
284 | */
|
285 | query<TRow = any>(statement: string, options?: QueryOptions, callback?: NodeCallback<QueryResult<TRow>>): StreamableRowPromise<QueryResult<TRow>, TRow, QueryMetaData>;
|
286 | /**
|
287 | * Executes an analytics query against the cluster.
|
288 | *
|
289 | * @param statement The analytics statement to execute.
|
290 | * @param options Optional parameters for this operation.
|
291 | * @param callback A node-style callback to be invoked after execution.
|
292 | */
|
293 | analyticsQuery<TRow = any>(statement: string, options?: AnalyticsQueryOptions, callback?: NodeCallback<AnalyticsResult<TRow>>): StreamableRowPromise<AnalyticsResult<TRow>, TRow, AnalyticsMetaData>;
|
294 | /**
|
295 | * Executes a search query against the cluster.
|
296 | *
|
297 | * @param indexName The name of the index to query.
|
298 | * @param query The SearchQuery describing the query to execute.
|
299 | * @param options Optional parameters for this operation.
|
300 | * @param callback A node-style callback to be invoked after execution.
|
301 | */
|
302 | searchQuery(indexName: string, query: SearchQuery, options?: SearchQueryOptions, callback?: NodeCallback<SearchResult>): StreamableRowPromise<SearchResult, SearchRow, SearchMetaData>;
|
303 | /**
|
304 | * Executes a search query against the cluster.
|
305 | *
|
306 | * @param indexName The name of the index to query.
|
307 | * @param request The SearchRequest describing the search to execute.
|
308 | * @param options Optional parameters for this operation.
|
309 | * @param callback A node-style callback to be invoked after execution.
|
310 | */
|
311 | search(indexName: string, request: SearchRequest, options?: SearchQueryOptions, callback?: NodeCallback<SearchResult>): StreamableRowPromise<SearchResult, SearchRow, SearchMetaData>;
|
312 | /**
|
313 | * Returns a diagnostics report about the currently active connections with the
|
314 | * cluster. Includes information about remote and local addresses, last activity,
|
315 | * and other diagnostics information.
|
316 | *
|
317 | * @param options Optional parameters for this operation.
|
318 | * @param callback A node-style callback to be invoked after execution.
|
319 | */
|
320 | diagnostics(options?: DiagnosticsOptions, callback?: NodeCallback<DiagnosticsResult>): Promise<DiagnosticsResult>;
|
321 | /**
|
322 | * Performs a ping operation against the cluster. Pinging the services which
|
323 | * are specified (or all services if none are specified). Returns a report
|
324 | * which describes the outcome of the ping operations which were performed.
|
325 | *
|
326 | * @param options Optional parameters for this operation.
|
327 | * @param callback A node-style callback to be invoked after execution.
|
328 | */
|
329 | ping(options?: PingOptions, callback?: NodeCallback<PingResult>): Promise<PingResult>;
|
330 | /**
|
331 | * Shuts down this cluster object. Cleaning up all resources associated with it.
|
332 | *
|
333 | * @param callback A node-style callback to be invoked after execution.
|
334 | */
|
335 | close(callback?: NodeCallback<void>): Promise<void>;
|
336 | private _connect;
|
337 | }
|