1 | import { AbortError } from '@azure/abort-controller';
|
2 | import type { HttpClient } from '@azure/core-rest-pipeline';
|
3 | import type { Pipeline } from '@azure/core-rest-pipeline';
|
4 | import { RestError } from '@azure/core-rest-pipeline';
|
5 | import type { TokenCredential } from '@azure/core-auth';
|
6 |
|
7 | export { AbortError }
|
8 |
|
9 | export declare interface Agent {
|
10 | maxFreeSockets: number;
|
11 | maxSockets: number;
|
12 | sockets: any;
|
13 | requests: any;
|
14 | destroy(): void;
|
15 | }
|
16 |
|
17 | export declare type AggregateType = "Average" | "Count" | "Max" | "Min" | "Sum" | "MakeSet" | "MakeList";
|
18 |
|
19 | export declare type BulkOperationResponse = OperationResponse[] & {
|
20 | diagnostics: CosmosDiagnostics;
|
21 | };
|
22 |
|
23 | export declare const BulkOperationType: {
|
24 | readonly Create: "Create";
|
25 | readonly Upsert: "Upsert";
|
26 | readonly Read: "Read";
|
27 | readonly Delete: "Delete";
|
28 | readonly Replace: "Replace";
|
29 | readonly Patch: "Patch";
|
30 | };
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 | export declare interface BulkOptions {
|
37 | continueOnError?: boolean;
|
38 | }
|
39 |
|
40 | export declare type BulkPatchOperation = OperationBase & {
|
41 | operationType: typeof BulkOperationType.Patch;
|
42 | id: string;
|
43 | };
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 | export declare class ChangeFeedIterator<T> {
|
51 | private clientContext;
|
52 | private resourceId;
|
53 | private resourceLink;
|
54 | private partitionKey;
|
55 | private changeFeedOptions;
|
56 | private static readonly IfNoneMatchAllHeaderValue;
|
57 | private nextIfNoneMatch;
|
58 | private ifModifiedSince;
|
59 | private lastStatusCode;
|
60 | private isPartitionSpecified;
|
61 | |
62 |
|
63 |
|
64 |
|
65 |
|
66 |
|
67 |
|
68 | get hasMoreResults(): boolean;
|
69 | |
70 |
|
71 |
|
72 | getAsyncIterator(): AsyncIterable<ChangeFeedResponse<Array<T & Resource>>>;
|
73 | |
74 |
|
75 |
|
76 | fetchNext(): Promise<ChangeFeedResponse<Array<T & Resource>>>;
|
77 | private getFeedResponse;
|
78 | }
|
79 |
|
80 |
|
81 |
|
82 |
|
83 |
|
84 |
|
85 | export declare interface ChangeFeedIteratorOptions {
|
86 | |
87 |
|
88 |
|
89 | maxItemCount?: number;
|
90 | |
91 |
|
92 |
|
93 | sessionToken?: string;
|
94 | |
95 |
|
96 |
|
97 | changeFeedStartFrom?: ChangeFeedStartFrom;
|
98 | |
99 |
|
100 |
|
101 | changeFeedMode?: ChangeFeedMode;
|
102 | }
|
103 |
|
104 |
|
105 |
|
106 |
|
107 | export declare class ChangeFeedIteratorResponse<T> {
|
108 | |
109 |
|
110 |
|
111 | readonly result: T;
|
112 | |
113 |
|
114 |
|
115 | readonly count: number;
|
116 | |
117 |
|
118 |
|
119 | readonly statusCode: number;
|
120 | |
121 |
|
122 |
|
123 | readonly diagnostics: CosmosDiagnostics;
|
124 | |
125 |
|
126 |
|
127 | readonly subStatusCode?: number;
|
128 | |
129 |
|
130 |
|
131 | get requestCharge(): number;
|
132 | |
133 |
|
134 |
|
135 | get activityId(): string;
|
136 | |
137 |
|
138 |
|
139 | get continuationToken(): string;
|
140 | |
141 |
|
142 |
|
143 | get sessionToken(): string;
|
144 | |
145 |
|
146 |
|
147 | headers: CosmosHeaders;
|
148 | }
|
149 |
|
150 | export declare enum ChangeFeedMode {
|
151 | LatestVersion = "Incremental Feed",
|
152 | AllVersionsAndDeletes = "Full-Fidelity Feed"
|
153 | }
|
154 |
|
155 |
|
156 |
|
157 |
|
158 |
|
159 |
|
160 |
|
161 |
|
162 |
|
163 |
|
164 |
|
165 | export declare interface ChangeFeedOptions {
|
166 | |
167 |
|
168 |
|
169 | maxItemCount?: number;
|
170 | |
171 |
|
172 |
|
173 |
|
174 |
|
175 | continuation?: string;
|
176 | |
177 |
|
178 |
|
179 | sessionToken?: string;
|
180 | |
181 |
|
182 |
|
183 | startFromBeginning?: boolean;
|
184 | |
185 |
|
186 |
|
187 | startTime?: Date;
|
188 | }
|
189 |
|
190 |
|
191 |
|
192 |
|
193 | export declare class ChangeFeedPolicy {
|
194 | retentionDuration: number;
|
195 | constructor(retentionDuration: ChangeFeedRetentionTimeSpan);
|
196 | }
|
197 |
|
198 | /**
|
199 | * Use `Items.getChangeFeedIterator()` to return an iterator that can iterate over all the changes for a partition key, feed range or an entire container.
|
200 | */
|
201 | export declare interface ChangeFeedPullModelIterator<T> {
|
202 | |
203 |
|
204 |
|
205 | readonly hasMoreResults: boolean;
|
206 | |
207 |
|
208 |
|
209 | readNext(): Promise<ChangeFeedIteratorResponse<Array<T & Resource>>>;
|
210 | |
211 |
|
212 |
|
213 |
|
214 |
|
215 |
|
216 |
|
217 |
|
218 |
|
219 |
|
220 | getAsyncIterator(): AsyncIterable<ChangeFeedIteratorResponse<Array<T & Resource>>>;
|
221 | }
|
222 |
|
223 |
|
224 |
|
225 |
|
226 | export declare class ChangeFeedResponse<T> {
|
227 | |
228 |
|
229 |
|
230 | readonly result: T;
|
231 | |
232 |
|
233 |
|
234 | readonly count: number;
|
235 | |
236 |
|
237 |
|
238 | readonly statusCode: number;
|
239 | readonly diagnostics: CosmosDiagnostics;
|
240 | |
241 |
|
242 |
|
243 | get requestCharge(): number;
|
244 | |
245 |
|
246 |
|
247 | get activityId(): string;
|
248 | |
249 |
|
250 |
|
251 |
|
252 |
|
253 | get continuation(): string;
|
254 | |
255 |
|
256 |
|
257 | get sessionToken(): string;
|
258 | |
259 |
|
260 |
|
261 |
|
262 |
|
263 |
|
264 |
|
265 |
|
266 |
|
267 | get etag(): string;
|
268 | |
269 |
|
270 |
|
271 | headers: CosmosHeaders;
|
272 | }
|
273 |
|
274 | export declare class ChangeFeedRetentionTimeSpan {
|
275 | private retentionInMinutes;
|
276 | |
277 |
|
278 |
|
279 | static fromMinutes(minutes: number): ChangeFeedRetentionTimeSpan;
|
280 | }
|
281 |
|
282 |
|
283 |
|
284 |
|
285 | export declare abstract class ChangeFeedStartFrom {
|
286 | |
287 |
|
288 |
|
289 |
|
290 | static Beginning(cfResource?: PartitionKey | FeedRange): ChangeFeedStartFromBeginning;
|
291 | |
292 |
|
293 |
|
294 |
|
295 | static Now(cfResource?: PartitionKey | FeedRange): ChangeFeedStartFromNow;
|
296 | |
297 |
|
298 |
|
299 |
|
300 |
|
301 | static Time(startTime: Date, cfResource?: PartitionKey | FeedRange): ChangeFeedStartFromTime;
|
302 | |
303 |
|
304 |
|
305 |
|
306 | static Continuation(continuationToken: string): ChangeFeedStartFromContinuation;
|
307 | }
|
308 |
|
309 |
|
310 |
|
311 |
|
312 |
|
313 | declare class ChangeFeedStartFromBeginning {
|
314 | private cfResource?;
|
315 | constructor(cfResource?: PartitionKey | FeedRange);
|
316 | getCfResource(): PartitionKey | FeedRange | undefined;
|
317 | }
|
318 |
|
319 | /**
|
320 | * @hidden
|
321 | * Class which specifies the ChangeFeedIterator to start reading changes from a saved point.
|
322 | */
|
323 | declare class ChangeFeedStartFromContinuation {
|
324 | private continuationToken;
|
325 | constructor(continuation: string);
|
326 | getCfResource(): string;
|
327 | getCfResourceJson(): any;
|
328 | getResourceType(): any;
|
329 | }
|
330 |
|
331 | /**
|
332 | * @hidden
|
333 | * Class which specifies the ChangeFeedIterator to start reading changes from this moment in time.
|
334 | */
|
335 | declare class ChangeFeedStartFromNow {
|
336 | cfResource?: PartitionKey | FeedRange;
|
337 | constructor(cfResource?: PartitionKey | FeedRange);
|
338 | getCfResource(): PartitionKey | FeedRange | undefined;
|
339 | }
|
340 |
|
341 | /**
|
342 | * @hidden
|
343 | * Class which specifies the ChangeFeedIterator to start reading changes from a particular point of time.
|
344 | */
|
345 | declare class ChangeFeedStartFromTime {
|
346 | private cfResource?;
|
347 | private startTime;
|
348 | constructor(startTime: Date, cfResource?: PartitionKey | FeedRange);
|
349 | getCfResource(): PartitionKey | FeedRange | undefined;
|
350 | getStartTime(): Date;
|
351 | }
|
352 |
|
353 | /**
|
354 | * This type holds information related to initialization of `CosmosClient`
|
355 | */
|
356 | export declare type ClientConfigDiagnostic = {
|
357 | |
358 |
|
359 |
|
360 | endpoint: string;
|
361 | |
362 |
|
363 |
|
364 | resourceTokensConfigured: boolean;
|
365 | |
366 |
|
367 |
|
368 | tokenProviderConfigured: boolean;
|
369 | |
370 |
|
371 |
|
372 | aadCredentialsConfigured: boolean;
|
373 | |
374 |
|
375 |
|
376 | connectionPolicyConfigured: boolean;
|
377 | |
378 |
|
379 |
|
380 | consistencyLevel?: keyof typeof ConsistencyLevel;
|
381 | |
382 |
|
383 |
|
384 | defaultHeaders?: {
|
385 | [key: string]: any;
|
386 | };
|
387 | |
388 |
|
389 |
|
390 | agentConfigured: boolean;
|
391 | |
392 |
|
393 |
|
394 | userAgentSuffix: string;
|
395 | |
396 |
|
397 |
|
398 | diagnosticLevel?: CosmosDbDiagnosticLevel;
|
399 | |
400 |
|
401 |
|
402 | pluginsConfigured: boolean;
|
403 | |
404 |
|
405 |
|
406 | sDKVersion: string;
|
407 | };
|
408 |
|
409 |
|
410 |
|
411 |
|
412 |
|
413 | export declare class ClientContext {
|
414 | private cosmosClientOptions;
|
415 | private globalEndpointManager;
|
416 | private clientConfig;
|
417 | diagnosticLevel: CosmosDbDiagnosticLevel;
|
418 | private readonly sessionContainer;
|
419 | private connectionPolicy;
|
420 | private pipeline;
|
421 | private diagnosticWriter;
|
422 | private diagnosticFormatter;
|
423 | partitionKeyDefinitionCache: {
|
424 | [containerUrl: string]: any;
|
425 | };
|
426 | constructor(cosmosClientOptions: CosmosClientOptions, globalEndpointManager: GlobalEndpointManager, clientConfig: ClientConfigDiagnostic, diagnosticLevel: CosmosDbDiagnosticLevel);
|
427 | /** @hidden */
|
428 | read<T>({ path, resourceType, resourceId, options, partitionKey, diagnosticNode, }: {
|
429 | path: string;
|
430 | resourceType: ResourceType;
|
431 | resourceId: string;
|
432 | options?: RequestOptions;
|
433 | partitionKey?: PartitionKey;
|
434 | diagnosticNode: DiagnosticNodeInternal;
|
435 | }): Promise<Response_2<T & Resource>>;
|
436 | queryFeed<T>({ path, resourceType, resourceId, resultFn, query, options, diagnosticNode, partitionKeyRangeId, partitionKey, startEpk, endEpk, correlatedActivityId, }: {
|
437 | path: string;
|
438 | resourceType: ResourceType;
|
439 | resourceId: string;
|
440 | resultFn: (result: {
|
441 | [key: string]: any;
|
442 | }) => any[];
|
443 | query: SqlQuerySpec | string;
|
444 | options: FeedOptions;
|
445 | diagnosticNode: DiagnosticNodeInternal;
|
446 | partitionKeyRangeId?: string;
|
447 | partitionKey?: PartitionKey;
|
448 | startEpk?: string | undefined;
|
449 | endEpk?: string | undefined;
|
450 | correlatedActivityId?: string;
|
451 | }): Promise<Response_2<T & Resource>>;
|
452 | getQueryPlan(path: string, resourceType: ResourceType, resourceId: string, query: SqlQuerySpec | string, options: FeedOptions, diagnosticNode: DiagnosticNodeInternal, correlatedActivityId?: string): Promise<Response_2<PartitionedQueryExecutionInfo>>;
|
453 | queryPartitionKeyRanges(collectionLink: string, query?: string | SqlQuerySpec, options?: FeedOptions): QueryIterator<PartitionKeyRange>;
|
454 | delete<T>({ path, resourceType, resourceId, options, partitionKey, method, diagnosticNode, }: {
|
455 | path: string;
|
456 | resourceType: ResourceType;
|
457 | resourceId: string;
|
458 | options?: RequestOptions;
|
459 | partitionKey?: PartitionKey;
|
460 | method?: HTTPMethod;
|
461 | diagnosticNode: DiagnosticNodeInternal;
|
462 | }): Promise<Response_2<T & Resource>>;
|
463 | patch<T>({ body, path, resourceType, resourceId, options, partitionKey, diagnosticNode, }: {
|
464 | body: any;
|
465 | path: string;
|
466 | resourceType: ResourceType;
|
467 | resourceId: string;
|
468 | options?: RequestOptions;
|
469 | partitionKey?: PartitionKey;
|
470 | diagnosticNode: DiagnosticNodeInternal;
|
471 | }): Promise<Response_2<T & Resource>>;
|
472 | create<T, U = T>({ body, path, resourceType, resourceId, diagnosticNode, options, partitionKey, }: {
|
473 | body: T;
|
474 | path: string;
|
475 | resourceType: ResourceType;
|
476 | resourceId: string;
|
477 | diagnosticNode: DiagnosticNodeInternal;
|
478 | options?: RequestOptions;
|
479 | partitionKey?: PartitionKey;
|
480 | }): Promise<Response_2<T & U & Resource>>;
|
481 | private processQueryFeedResponse;
|
482 | private applySessionToken;
|
483 | replace<T>({ body, path, resourceType, resourceId, options, partitionKey, diagnosticNode, }: {
|
484 | body: any;
|
485 | path: string;
|
486 | resourceType: ResourceType;
|
487 | resourceId: string;
|
488 | options?: RequestOptions;
|
489 | partitionKey?: PartitionKey;
|
490 | diagnosticNode: DiagnosticNodeInternal;
|
491 | }): Promise<Response_2<T & Resource>>;
|
492 | upsert<T, U = T>({ body, path, resourceType, resourceId, options, partitionKey, diagnosticNode, }: {
|
493 | body: T;
|
494 | path: string;
|
495 | resourceType: ResourceType;
|
496 | resourceId: string;
|
497 | options?: RequestOptions;
|
498 | partitionKey?: PartitionKey;
|
499 | diagnosticNode: DiagnosticNodeInternal;
|
500 | }): Promise<Response_2<T & U & Resource>>;
|
501 | execute<T>({ sprocLink, params, options, partitionKey, diagnosticNode, }: {
|
502 | sprocLink: string;
|
503 | params?: any[];
|
504 | options?: RequestOptions;
|
505 | partitionKey?: PartitionKey;
|
506 | diagnosticNode: DiagnosticNodeInternal;
|
507 | }): Promise<Response_2<T>>;
|
508 | /**
|
509 | * Gets the Database account information.
|
510 | * @param options - `urlConnection` in the options is the endpoint url whose database account needs to be retrieved.
|
511 | * If not present, current client's url will be used.
|
512 | */
|
513 | getDatabaseAccount(diagnosticNode: DiagnosticNodeInternal, options?: RequestOptions): Promise<Response_2<DatabaseAccount>>;
|
514 | getWriteEndpoint(diagnosticNode: DiagnosticNodeInternal): Promise<string>;
|
515 | getReadEndpoint(diagnosticNode: DiagnosticNodeInternal): Promise<string>;
|
516 | getWriteEndpoints(): Promise<readonly string[]>;
|
517 | getReadEndpoints(): Promise<readonly string[]>;
|
518 | batch<T>({ body, path, partitionKey, resourceId, options, diagnosticNode, }: {
|
519 | body: T;
|
520 | path: string;
|
521 | partitionKey: PartitionKey;
|
522 | resourceId: string;
|
523 | options?: RequestOptions;
|
524 | diagnosticNode: DiagnosticNodeInternal;
|
525 | }): Promise<Response_2<any>>;
|
526 | bulk<T>({ body, path, partitionKeyRangeId, resourceId, bulkOptions, options, diagnosticNode, }: {
|
527 | body: T;
|
528 | path: string;
|
529 | partitionKeyRangeId: string;
|
530 | resourceId: string;
|
531 | bulkOptions?: BulkOptions;
|
532 | options?: RequestOptions;
|
533 | diagnosticNode: DiagnosticNodeInternal;
|
534 | }): Promise<Response_2<any>>;
|
535 | private captureSessionToken;
|
536 | clearSessionToken(path: string): void;
|
537 | recordDiagnostics(diagnostic: CosmosDiagnostics): void;
|
538 | initializeDiagnosticSettings(diagnosticLevel: CosmosDbDiagnosticLevel): void;
|
539 | private getSessionParams;
|
540 | private isMasterResource;
|
541 | private buildHeaders;
|
542 | /**
|
543 | * Returns collection of properties which are derived from the context for Request Creation.
|
544 | * These properties have client wide scope, as opposed to request specific scope.
|
545 | * @returns
|
546 | */
|
547 | private getContextDerivedPropsForRequestCreation;
|
548 | getClientConfig(): ClientConfigDiagnostic;
|
549 | }
|
550 |
|
551 | export declare class ClientSideMetrics {
|
552 | readonly requestCharge: number;
|
553 | constructor(requestCharge: number);
|
554 | /**
|
555 | * Adds one or more ClientSideMetrics to a copy of this instance and returns the result.
|
556 | */
|
557 | add(...clientSideMetricsArray: ClientSideMetrics[]): ClientSideMetrics;
|
558 | static readonly zero: ClientSideMetrics;
|
559 | static createFromArray(...clientSideMetricsArray: ClientSideMetrics[]): ClientSideMetrics;
|
560 | }
|
561 |
|
562 | /**
|
563 | * This is a collection type for all client side diagnostic information.
|
564 | */
|
565 | export declare type ClientSideRequestStatistics = {
|
566 | |
567 |
|
568 |
|
569 | requestStartTimeUTCInMs: number;
|
570 | |
571 |
|
572 |
|
573 | requestDurationInMs: number;
|
574 | |
575 |
|
576 |
|
577 | locationEndpointsContacted: string[];
|
578 | |
579 |
|
580 |
|
581 | retryDiagnostics: RetryDiagnostics;
|
582 | |
583 |
|
584 |
|
585 | metadataDiagnostics: MetadataLookUpDiagnostics;
|
586 | |
587 |
|
588 |
|
589 | gatewayStatistics: GatewayStatistics[];
|
590 | |
591 |
|
592 |
|
593 | totalRequestPayloadLengthInBytes: number;
|
594 | |
595 |
|
596 |
|
597 | totalResponsePayloadLengthInBytes: number;
|
598 | };
|
599 |
|
600 |
|
601 |
|
602 |
|
603 | export declare interface CompositePath {
|
604 |
|
605 | path: string;
|
606 |
|
607 | order: "ascending" | "descending";
|
608 | }
|
609 |
|
610 | export declare interface ComputedProperty {
|
611 | |
612 |
|
613 |
|
614 |
|
615 |
|
616 | name: string;
|
617 | query: string;
|
618 | [key: string]: any;
|
619 | }
|
620 |
|
621 |
|
622 |
|
623 |
|
624 |
|
625 |
|
626 | export declare class Conflict {
|
627 | readonly container: Container;
|
628 | readonly id: string;
|
629 | private readonly clientContext;
|
630 | private partitionKey?;
|
631 | |
632 |
|
633 |
|
634 | get url(): string;
|
635 | |
636 |
|
637 |
|
638 |
|
639 |
|
640 | constructor(container: Container, id: string, clientContext: ClientContext, partitionKey?: PartitionKey);
|
641 | /**
|
642 | * Read the {@link ConflictDefinition} for the given {@link Conflict}.
|
643 | */
|
644 | read(options?: RequestOptions): Promise<ConflictResponse>;
|
645 | |
646 |
|
647 |
|
648 | delete(options?: RequestOptions): Promise<ConflictResponse>;
|
649 | }
|
650 |
|
651 | export declare interface ConflictDefinition {
|
652 |
|
653 | id?: string;
|
654 |
|
655 | resourceId?: string;
|
656 | resourceType?: ResourceType;
|
657 | operationType?: OperationType;
|
658 | content?: string;
|
659 | }
|
660 |
|
661 | export declare enum ConflictResolutionMode {
|
662 | Custom = "Custom",
|
663 | LastWriterWins = "LastWriterWins"
|
664 | }
|
665 |
|
666 |
|
667 |
|
668 |
|
669 |
|
670 | export declare interface ConflictResolutionPolicy {
|
671 | |
672 |
|
673 |
|
674 | mode?: keyof typeof ConflictResolutionMode;
|
675 | |
676 |
|
677 |
|
678 |
|
679 |
|
680 |
|
681 |
|
682 |
|
683 |
|
684 |
|
685 |
|
686 |
|
687 |
|
688 | conflictResolutionPath?: string;
|
689 | |
690 |
|
691 |
|
692 |
|
693 |
|
694 |
|
695 |
|
696 |
|
697 |
|
698 |
|
699 |
|
700 | conflictResolutionProcedure?: string;
|
701 | }
|
702 |
|
703 | export declare class ConflictResponse extends ResourceResponse<ConflictDefinition & Resource> {
|
704 | constructor(resource: ConflictDefinition & Resource, headers: CosmosHeaders, statusCode: number, conflict: Conflict, diagnostics: CosmosDiagnostics);
|
705 | /** A reference to the {@link Conflict} corresponding to the returned {@link ConflictDefinition}. */
|
706 | readonly conflict: Conflict;
|
707 | }
|
708 |
|
709 |
|
710 |
|
711 |
|
712 |
|
713 |
|
714 | export declare class Conflicts {
|
715 | readonly container: Container;
|
716 | private readonly clientContext;
|
717 | constructor(container: Container, clientContext: ClientContext);
|
718 | /**
|
719 | * Queries all conflicts.
|
720 | * @param query - Query configuration for the operation. See {@link SqlQuerySpec} for more info on how to configure a query.
|
721 | * @param options - Use to set options like response page size, continuation tokens, etc.
|
722 | * @returns {@link QueryIterator} Allows you to return results in an array or iterate over them one at a time.
|
723 | */
|
724 | query(query: string | SqlQuerySpec, options?: FeedOptions): QueryIterator<any>;
|
725 | |
726 |
|
727 |
|
728 |
|
729 |
|
730 |
|
731 | query<T>(query: string | SqlQuerySpec, options?: FeedOptions): QueryIterator<T>;
|
732 | |
733 |
|
734 |
|
735 |
|
736 | readAll(options?: FeedOptions): QueryIterator<ConflictDefinition & Resource>;
|
737 | }
|
738 |
|
739 |
|
740 | export declare enum ConnectionMode {
|
741 |
|
742 | Gateway = 0
|
743 | }
|
744 |
|
745 | |
746 |
|
747 |
|
748 | export declare interface ConnectionPolicy {
|
749 |
|
750 | connectionMode?: ConnectionMode;
|
751 |
|
752 | requestTimeout?: number;
|
753 | |
754 |
|
755 |
|
756 |
|
757 | enableEndpointDiscovery?: boolean;
|
758 |
|
759 | preferredLocations?: string[];
|
760 |
|
761 | retryOptions?: RetryOptions;
|
762 | |
763 |
|
764 |
|
765 |
|
766 | useMultipleWriteLocations?: boolean;
|
767 |
|
768 | endpointRefreshRateInMs?: number;
|
769 | |
770 |
|
771 | enableBackgroundEndpointRefreshing?: boolean;
|
772 | }
|
773 |
|
774 | |
775 |
|
776 |
|
777 |
|
778 |
|
779 |
|
780 |
|
781 |
|
782 |
|
783 | export declare enum ConsistencyLevel {
|
784 | |
785 |
|
786 |
|
787 | Strong = "Strong",
|
788 | |
789 |
|
790 |
|
791 |
|
792 | BoundedStaleness = "BoundedStaleness",
|
793 | |
794 |
|
795 |
|
796 |
|
797 |
|
798 | Session = "Session",
|
799 | |
800 |
|
801 |
|
802 |
|
803 | Eventual = "Eventual",
|
804 | |
805 |
|
806 |
|
807 |
|
808 | ConsistentPrefix = "ConsistentPrefix"
|
809 | }
|
810 |
|
811 | |
812 |
|
813 |
|
814 | export declare const Constants: {
|
815 | HttpHeaders: {
|
816 | Authorization: string;
|
817 | ETag: string;
|
818 | MethodOverride: string;
|
819 | Slug: string;
|
820 | ContentType: string;
|
821 | LastModified: string;
|
822 | ContentEncoding: string;
|
823 | CharacterSet: string;
|
824 | UserAgent: string;
|
825 | IfModifiedSince: string;
|
826 | IfMatch: string;
|
827 | IfNoneMatch: string;
|
828 | ContentLength: string;
|
829 | AcceptEncoding: string;
|
830 | KeepAlive: string;
|
831 | CacheControl: string;
|
832 | TransferEncoding: string;
|
833 | ContentLanguage: string;
|
834 | ContentLocation: string;
|
835 | ContentMd5: string;
|
836 | ContentRange: string;
|
837 | Accept: string;
|
838 | AcceptCharset: string;
|
839 | AcceptLanguage: string;
|
840 | IfRange: string;
|
841 | IfUnmodifiedSince: string;
|
842 | MaxForwards: string;
|
843 | ProxyAuthorization: string;
|
844 | AcceptRanges: string;
|
845 | ProxyAuthenticate: string;
|
846 | RetryAfter: string;
|
847 | SetCookie: string;
|
848 | WwwAuthenticate: string;
|
849 | Origin: string;
|
850 | Host: string;
|
851 | AccessControlAllowOrigin: string;
|
852 | AccessControlAllowHeaders: string;
|
853 | KeyValueEncodingFormat: string;
|
854 | WrapAssertionFormat: string;
|
855 | WrapAssertion: string;
|
856 | WrapScope: string;
|
857 | SimpleToken: string;
|
858 | HttpDate: string;
|
859 | Prefer: string;
|
860 | Location: string;
|
861 | Referer: string;
|
862 | A_IM: string;
|
863 | Query: string;
|
864 | IsQuery: string;
|
865 | IsQueryPlan: string;
|
866 | SupportedQueryFeatures: string;
|
867 | QueryVersion: string;
|
868 | Continuation: string;
|
869 | ContinuationToken: string;
|
870 | PageSize: string;
|
871 | ItemCount: string;
|
872 | ChangeFeedWireFormatVersion: string;
|
873 | ActivityId: string;
|
874 | CorrelatedActivityId: string;
|
875 | PreTriggerInclude: string;
|
876 | PreTriggerExclude: string;
|
877 | PostTriggerInclude: string;
|
878 | PostTriggerExclude: string;
|
879 | IndexingDirective: string;
|
880 | SessionToken: string;
|
881 | ConsistencyLevel: string;
|
882 | XDate: string;
|
883 | CollectionPartitionInfo: string;
|
884 | CollectionServiceInfo: string;
|
885 | RetryAfterInMilliseconds: string;
|
886 | RetryAfterInMs: string;
|
887 | IsFeedUnfiltered: string;
|
888 | ResourceTokenExpiry: string;
|
889 | EnableScanInQuery: string;
|
890 | EmitVerboseTracesInQuery: string;
|
891 | EnableCrossPartitionQuery: string;
|
892 | ParallelizeCrossPartitionQuery: string;
|
893 | ResponseContinuationTokenLimitInKB: string;
|
894 | PopulateQueryMetrics: string;
|
895 | QueryMetrics: string;
|
896 | PopulateIndexMetrics: string;
|
897 | IndexUtilization: string;
|
898 | Version: string;
|
899 | OwnerFullName: string;
|
900 | OwnerId: string;
|
901 | PartitionKey: string;
|
902 | PartitionKeyRangeID: string;
|
903 | StartEpk: string;
|
904 | EndEpk: string;
|
905 | ReadFeedKeyType: string;
|
906 | MaxEntityCount: string;
|
907 | CurrentEntityCount: string;
|
908 | CollectionQuotaInMb: string;
|
909 | CollectionCurrentUsageInMb: string;
|
910 | MaxMediaStorageUsageInMB: string;
|
911 | CurrentMediaStorageUsageInMB: string;
|
912 | RequestCharge: string;
|
913 | PopulateQuotaInfo: string;
|
914 | MaxResourceQuota: string;
|
915 | OfferType: string;
|
916 | OfferThroughput: string;
|
917 | AutoscaleSettings: string;
|
918 | DisableRUPerMinuteUsage: string;
|
919 | IsRUPerMinuteUsed: string;
|
920 | OfferIsRUPerMinuteThroughputEnabled: string;
|
921 | IndexTransformationProgress: string;
|
922 | LazyIndexingProgress: string;
|
923 | IsUpsert: string;
|
924 | SubStatus: string;
|
925 | EnableScriptLogging: string;
|
926 | ScriptLogResults: string;
|
927 | ALLOW_MULTIPLE_WRITES: string;
|
928 | IsBatchRequest: string;
|
929 | IsBatchAtomic: string;
|
930 | BatchContinueOnError: string;
|
931 | DedicatedGatewayPerRequestCacheStaleness: string;
|
932 | DedicatedGatewayPerRequestBypassCache: string;
|
933 | ForceRefresh: string;
|
934 | PriorityLevel: string;
|
935 | };
|
936 | WritableLocations: string;
|
937 | ReadableLocations: string;
|
938 | LocationUnavailableExpirationTimeInMs: number;
|
939 | ENABLE_MULTIPLE_WRITABLE_LOCATIONS: string;
|
940 | DefaultUnavailableLocationExpirationTimeMS: number;
|
941 | ThrottleRetryCount: string;
|
942 | ThrottleRetryWaitTimeInMs: string;
|
943 | CurrentVersion: string;
|
944 | AzureNamespace: string;
|
945 | AzurePackageName: string;
|
946 | SDKName: string;
|
947 | SDKVersion: string;
|
948 | CosmosDbDiagnosticLevelEnvVarName: string;
|
949 | DefaultMaxBulkRequestBodySizeInBytes: number;
|
950 | Quota: {
|
951 | CollectionSize: string;
|
952 | };
|
953 | Path: {
|
954 | Root: string;
|
955 | DatabasesPathSegment: string;
|
956 | CollectionsPathSegment: string;
|
957 | UsersPathSegment: string;
|
958 | DocumentsPathSegment: string;
|
959 | PermissionsPathSegment: string;
|
960 | StoredProceduresPathSegment: string;
|
961 | TriggersPathSegment: string;
|
962 | UserDefinedFunctionsPathSegment: string;
|
963 | ConflictsPathSegment: string;
|
964 | AttachmentsPathSegment: string;
|
965 | PartitionKeyRangesPathSegment: string;
|
966 | SchemasPathSegment: string;
|
967 | OffersPathSegment: string;
|
968 | TopologyPathSegment: string;
|
969 | DatabaseAccountPathSegment: string;
|
970 | };
|
971 | PartitionKeyRange: PartitionKeyRangePropertiesNames;
|
972 | QueryRangeConstants: {
|
973 | MinInclusive: string;
|
974 | MaxExclusive: string;
|
975 | min: string;
|
976 | };
|
977 | |
978 |
|
979 |
|
980 | EffectiveParitionKeyConstants: {
|
981 | MinimumInclusiveEffectivePartitionKey: string;
|
982 | MaximumExclusiveEffectivePartitionKey: string;
|
983 | };
|
984 | EffectivePartitionKeyConstants: {
|
985 | MinimumInclusiveEffectivePartitionKey: string;
|
986 | MaximumExclusiveEffectivePartitionKey: string;
|
987 | };
|
988 | AllVersionsAndDeletesChangeFeedWireFormatVersion: string;
|
989 | ChangeFeedIfNoneMatchStartFromNowHeader: string;
|
990 | };
|
991 |
|
992 | |
993 |
|
994 |
|
995 |
|
996 |
|
997 |
|
998 |
|
999 |
|
1000 |
|
1001 |
|
1002 | export declare class Container {
|
1003 | readonly database: Database;
|
1004 | readonly id: string;
|
1005 | private readonly clientContext;
|
1006 | private $items;
|
1007 | |
1008 |
|
1009 |
|
1010 |
|
1011 |
|
1012 |
|
1013 |
|
1014 |
|
1015 |
|
1016 |
|
1017 | get items(): Items;
|
1018 | private $scripts;
|
1019 | |
1020 |
|
1021 |
|
1022 | get scripts(): Scripts;
|
1023 | private $conflicts;
|
1024 | |
1025 |
|
1026 |
|
1027 |
|
1028 |
|
1029 | get conflicts(): Conflicts;
|
1030 | |
1031 |
|
1032 |
|
1033 | get url(): string;
|
1034 | |
1035 |
|
1036 |
|
1037 |
|
1038 |
|
1039 |
|
1040 | constructor(database: Database, id: string, clientContext: ClientContext);
|
1041 | /**
|
1042 | * Used to read, replace, or delete a specific, existing {@link Item} by id.
|
1043 | *
|
1044 | * Use `.items` for creating new items, or querying/reading all items.
|
1045 | *
|
1046 | * @param id - The id of the {@link Item}.
|
1047 | * @param partitionKeyValue - The value of the {@link Item} partition key
|
1048 | * @example Replace an item
|
1049 | * `const {body: replacedItem} = await container.item("<item id>", "<partition key value>").replace({id: "<item id>", title: "Updated post", authorID: 5});`
|
1050 | */
|
1051 | item(id: string, partitionKeyValue?: PartitionKey): Item;
|
1052 | |
1053 |
|
1054 |
|
1055 |
|
1056 |
|
1057 |
|
1058 | conflict(id: string, partitionKey?: PartitionKey): Conflict;
|
1059 |
|
1060 | read(options?: RequestOptions): Promise<ContainerResponse>;
|
1061 | |
1062 |
|
1063 |
|
1064 | readInternal(diagnosticNode: DiagnosticNodeInternal, options?: RequestOptions): Promise<ContainerResponse>;
|
1065 |
|
1066 | replace(body: ContainerDefinition, options?: RequestOptions): Promise<ContainerResponse>;
|
1067 |
|
1068 | delete(options?: RequestOptions): Promise<ContainerResponse>;
|
1069 | |
1070 |
|
1071 |
|
1072 |
|
1073 | getPartitionKeyDefinition(): Promise<ResourceResponse<PartitionKeyDefinition>>;
|
1074 | |
1075 |
|
1076 |
|
1077 |
|
1078 | readPartitionKeyDefinition(diagnosticNode: DiagnosticNodeInternal): Promise<ResourceResponse<PartitionKeyDefinition>>;
|
1079 | |
1080 |
|
1081 |
|
1082 | readOffer(options?: RequestOptions): Promise<OfferResponse>;
|
1083 | getQueryPlan(query: string | SqlQuerySpec): Promise<Response_2<PartitionedQueryExecutionInfo>>;
|
1084 | readPartitionKeyRanges(feedOptions?: FeedOptions): QueryIterator<PartitionKeyRange>;
|
1085 | |
1086 |
|
1087 |
|
1088 |
|
1089 | getFeedRanges(): Promise<ReadonlyArray<FeedRange>>;
|
1090 | |
1091 |
|
1092 |
|
1093 |
|
1094 | deleteAllItemsForPartitionKey(partitionKey: PartitionKey, options?: RequestOptions): Promise<ContainerResponse>;
|
1095 | }
|
1096 |
|
1097 | export declare interface ContainerDefinition {
|
1098 |
|
1099 | id?: string;
|
1100 |
|
1101 | partitionKey?: PartitionKeyDefinition;
|
1102 |
|
1103 | indexingPolicy?: IndexingPolicy;
|
1104 |
|
1105 | defaultTtl?: number;
|
1106 |
|
1107 | conflictResolutionPolicy?: ConflictResolutionPolicy;
|
1108 |
|
1109 | uniqueKeyPolicy?: UniqueKeyPolicy;
|
1110 |
|
1111 | geospatialConfig?: {
|
1112 | type: GeospatialType;
|
1113 | };
|
1114 |
|
1115 | changeFeedPolicy?: ChangeFeedPolicy;
|
1116 |
|
1117 | computedProperties?: ComputedProperty[];
|
1118 |
|
1119 | vectorEmbeddingPolicy?: VectorEmbeddingPolicy;
|
1120 |
|
1121 | fullTextPolicy?: FullTextPolicy;
|
1122 | }
|
1123 |
|
1124 | export declare interface ContainerRequest extends VerboseOmit<ContainerDefinition, "partitionKey"> {
|
1125 | throughput?: number;
|
1126 | maxThroughput?: number;
|
1127 | autoUpgradePolicy?: {
|
1128 | throughputPolicy: {
|
1129 | incrementPercent: number;
|
1130 | };
|
1131 | };
|
1132 | partitionKey?: string | PartitionKeyDefinition;
|
1133 | }
|
1134 |
|
1135 |
|
1136 | export declare class ContainerResponse extends ResourceResponse<ContainerDefinition & Resource> {
|
1137 | constructor(resource: ContainerDefinition & Resource, headers: CosmosHeaders, statusCode: number, container: Container, diagnostics: CosmosDiagnostics);
|
1138 | /** A reference to the {@link Container} that the returned {@link ContainerDefinition} corresponds to. */
|
1139 | readonly container: Container;
|
1140 | }
|
1141 |
|
1142 | |
1143 |
|
1144 |
|
1145 |
|
1146 |
|
1147 |
|
1148 |
|
1149 |
|
1150 |
|
1151 |
|
1152 | export declare class Containers {
|
1153 | readonly database: Database;
|
1154 | private readonly clientContext;
|
1155 | constructor(database: Database, clientContext: ClientContext);
|
1156 | /**
|
1157 | * Queries all containers.
|
1158 | * @param query - Query configuration for the operation. See {@link SqlQuerySpec} for more info on how to configure a query.
|
1159 | * @param options - Use to set options like response page size, continuation tokens, etc.
|
1160 | * @returns {@link QueryIterator} Allows you to return specific containers in an array or iterate over them one at a time.
|
1161 | * @example Read all containers to array.
|
1162 | * ```typescript
|
1163 | * const querySpec: SqlQuerySpec = {
|
1164 | * query: "SELECT * FROM root r WHERE r.id = @container",
|
1165 | * parameters: [
|
1166 | * {name: "@container", value: "Todo"}
|
1167 | * ]
|
1168 | * };
|
1169 | * const {body: containerList} = await client.database("<db id>").containers.query(querySpec).fetchAll();
|
1170 | * ```
|
1171 | */
|
1172 | query(query: SqlQuerySpec, options?: FeedOptions): QueryIterator<any>;
|
1173 | |
1174 |
|
1175 |
|
1176 |
|
1177 |
|
1178 |
|
1179 |
|
1180 |
|
1181 |
|
1182 |
|
1183 |
|
1184 |
|
1185 |
|
1186 |
|
1187 |
|
1188 |
|
1189 | query<T>(query: SqlQuerySpec, options?: FeedOptions): QueryIterator<T>;
|
1190 | |
1191 |
|
1192 |
|
1193 |
|
1194 |
|
1195 |
|
1196 |
|
1197 |
|
1198 |
|
1199 |
|
1200 |
|
1201 |
|
1202 |
|
1203 |
|
1204 |
|
1205 |
|
1206 |
|
1207 | create(body: ContainerRequest, options?: RequestOptions): Promise<ContainerResponse>;
|
1208 | |
1209 |
|
1210 |
|
1211 | createInternal(diagnosticNode: DiagnosticNodeInternal, body: ContainerRequest, options?: RequestOptions): Promise<ContainerResponse>;
|
1212 | |
1213 |
|
1214 |
|
1215 |
|
1216 |
|
1217 |
|
1218 |
|
1219 |
|
1220 |
|
1221 |
|
1222 |
|
1223 |
|
1224 |
|
1225 |
|
1226 |
|
1227 |
|
1228 |
|
1229 |
|
1230 |
|
1231 | createIfNotExists(body: ContainerRequest, options?: RequestOptions): Promise<ContainerResponse>;
|
1232 | |
1233 |
|
1234 |
|
1235 |
|
1236 |
|
1237 |
|
1238 |
|
1239 |
|
1240 |
|
1241 | readAll(options?: FeedOptions): QueryIterator<ContainerDefinition & Resource>;
|
1242 | }
|
1243 |
|
1244 | |
1245 |
|
1246 |
|
1247 |
|
1248 |
|
1249 |
|
1250 |
|
1251 |
|
1252 |
|
1253 |
|
1254 |
|
1255 |
|
1256 |
|
1257 |
|
1258 |
|
1259 |
|
1260 |
|
1261 |
|
1262 |
|
1263 | export declare class CosmosClient {
|
1264 | |
1265 |
|
1266 |
|
1267 |
|
1268 |
|
1269 |
|
1270 |
|
1271 |
|
1272 |
|
1273 |
|
1274 | readonly databases: Databases;
|
1275 | |
1276 |
|
1277 |
|
1278 |
|
1279 |
|
1280 | readonly offers: Offers;
|
1281 | private clientContext;
|
1282 | private endpointRefresher;
|
1283 | |
1284 |
|
1285 |
|
1286 | constructor(connectionString: string);
|
1287 | /**
|
1288 | * Creates a new {@link CosmosClient} object. See {@link CosmosClientOptions} for more details on what options you can use.
|
1289 | * @param options - bag of options; require at least endpoint and auth to be configured
|
1290 | */
|
1291 | constructor(options: CosmosClientOptions);
|
1292 | private initializeClientConfigDiagnostic;
|
1293 | /**
|
1294 | * Get information about the current {@link DatabaseAccount} (including which regions are supported, etc.)
|
1295 | */
|
1296 | getDatabaseAccount(options?: RequestOptions): Promise<ResourceResponse<DatabaseAccount>>;
|
1297 | |
1298 |
|
1299 |
|
1300 | getDatabaseAccountInternal(diagnosticNode: DiagnosticNodeInternal, options?: RequestOptions): Promise<ResourceResponse<DatabaseAccount>>;
|
1301 | |
1302 |
|
1303 |
|
1304 |
|
1305 |
|
1306 | getWriteEndpoint(): Promise<string>;
|
1307 | |
1308 |
|
1309 |
|
1310 |
|
1311 |
|
1312 | getReadEndpoint(): Promise<string>;
|
1313 | |
1314 |
|
1315 |
|
1316 |
|
1317 |
|
1318 | getWriteEndpoints(): Promise<readonly string[]>;
|
1319 | |
1320 |
|
1321 |
|
1322 |
|
1323 |
|
1324 | getReadEndpoints(): Promise<readonly string[]>;
|
1325 | |
1326 |
|
1327 |
|
1328 |
|
1329 |
|
1330 |
|
1331 |
|
1332 |
|
1333 |
|
1334 |
|
1335 |
|
1336 |
|
1337 |
|
1338 |
|
1339 |
|
1340 |
|
1341 | database(id: string): Database;
|
1342 | |
1343 |
|
1344 |
|
1345 |
|
1346 | offer(id: string): Offer;
|
1347 | |
1348 |
|
1349 |
|
1350 | dispose(): void;
|
1351 | private backgroundRefreshEndpointList;
|
1352 | }
|
1353 |
|
1354 | export declare interface CosmosClientOptions {
|
1355 |
|
1356 | endpoint: string;
|
1357 |
|
1358 | key?: string;
|
1359 | |
1360 |
|
1361 |
|
1362 | resourceTokens?: {
|
1363 | [resourcePath: string]: string;
|
1364 | };
|
1365 | |
1366 |
|
1367 |
|
1368 | tokenProvider?: TokenProvider;
|
1369 | |
1370 |
|
1371 |
|
1372 |
|
1373 |
|
1374 | aadCredentials?: TokenCredential;
|
1375 |
|
1376 | permissionFeed?: PermissionDefinition[];
|
1377 | |
1378 |
|
1379 |
|
1380 | connectionPolicy?: ConnectionPolicy;
|
1381 | |
1382 |
|
1383 |
|
1384 | consistencyLevel?: keyof typeof ConsistencyLevel;
|
1385 | defaultHeaders?: CosmosHeaders_2;
|
1386 | |
1387 |
|
1388 |
|
1389 | agent?: Agent;
|
1390 | |
1391 |
|
1392 | httpClient?: HttpClient;
|
1393 |
|
1394 | userAgentSuffix?: string;
|
1395 | diagnosticLevel?: CosmosDbDiagnosticLevel;
|
1396 | }
|
1397 |
|
1398 | |
1399 |
|
1400 |
|
1401 | declare enum CosmosContainerChildResourceKind {
|
1402 | Item = "ITEM",
|
1403 | StoredProcedure = "STORED_PROCEDURE",
|
1404 | UserDefinedFunction = "USER_DEFINED_FUNCTION",
|
1405 | Trigger = "TRIGGER"
|
1406 | }
|
1407 |
|
1408 | |
1409 |
|
1410 |
|
1411 | export declare enum CosmosDbDiagnosticLevel {
|
1412 | info = "info",
|
1413 | debug = "debug",
|
1414 | debugUnsafe = "debug-unsafe"
|
1415 | }
|
1416 |
|
1417 | |
1418 |
|
1419 |
|
1420 |
|
1421 |
|
1422 |
|
1423 |
|
1424 |
|
1425 |
|
1426 |
|
1427 |
|
1428 |
|
1429 |
|
1430 |
|
1431 |
|
1432 |
|
1433 |
|
1434 |
|
1435 |
|
1436 |
|
1437 |
|
1438 | export declare class CosmosDiagnostics {
|
1439 | readonly clientSideRequestStatistics: ClientSideRequestStatistics;
|
1440 | readonly diagnosticNode: DiagnosticNode;
|
1441 | readonly clientConfig?: ClientConfigDiagnostic;
|
1442 | }
|
1443 |
|
1444 | export declare interface CosmosHeaders {
|
1445 | [key: string]: any;
|
1446 | }
|
1447 |
|
1448 | declare interface CosmosHeaders_2 {
|
1449 | [key: string]: string | boolean | number;
|
1450 | }
|
1451 |
|
1452 | |
1453 |
|
1454 |
|
1455 | declare enum CosmosKeyType {
|
1456 | PrimaryMaster = "PRIMARY_MASTER",
|
1457 | SecondaryMaster = "SECONDARY_MASTER",
|
1458 | PrimaryReadOnly = "PRIMARY_READONLY",
|
1459 | SecondaryReadOnly = "SECONDARY_READONLY"
|
1460 | }
|
1461 |
|
1462 | |
1463 |
|
1464 |
|
1465 |
|
1466 | export declare function createAuthorizationSasToken(masterKey: string, sasTokenProperties: SasTokenProperties): Promise<string>;
|
1467 |
|
1468 | export declare type CreateOperation = OperationWithItem & {
|
1469 | operationType: typeof BulkOperationType.Create;
|
1470 | };
|
1471 |
|
1472 | export declare interface CreateOperationInput {
|
1473 | partitionKey?: PartitionKey;
|
1474 | ifMatch?: string;
|
1475 | ifNoneMatch?: string;
|
1476 | operationType: typeof BulkOperationType.Create;
|
1477 | resourceBody: JSONObject;
|
1478 | }
|
1479 |
|
1480 | |
1481 |
|
1482 |
|
1483 |
|
1484 |
|
1485 |
|
1486 |
|
1487 |
|
1488 |
|
1489 |
|
1490 | export declare class Database {
|
1491 | readonly client: CosmosClient;
|
1492 | readonly id: string;
|
1493 | private clientContext;
|
1494 | |
1495 |
|
1496 |
|
1497 |
|
1498 |
|
1499 |
|
1500 |
|
1501 |
|
1502 |
|
1503 |
|
1504 | readonly containers: Containers;
|
1505 | |
1506 |
|
1507 |
|
1508 |
|
1509 |
|
1510 | readonly users: Users;
|
1511 | |
1512 |
|
1513 |
|
1514 | get url(): string;
|
1515 | |
1516 |
|
1517 |
|
1518 |
|
1519 | constructor(client: CosmosClient, id: string, clientContext: ClientContext);
|
1520 | /**
|
1521 | * Used to read, replace, or delete a specific, existing {@link Database} by id.
|
1522 | *
|
1523 | * Use `.containers` creating new containers, or querying/reading all containers.
|
1524 | *
|
1525 | * @example Delete a container
|
1526 | * ```typescript
|
1527 | * await client.database("<db id>").container("<container id>").delete();
|
1528 | * ```
|
1529 | */
|
1530 | container(id: string): Container;
|
1531 | |
1532 |
|
1533 |
|
1534 |
|
1535 |
|
1536 | user(id: string): User;
|
1537 |
|
1538 | read(options?: RequestOptions): Promise<DatabaseResponse>;
|
1539 | |
1540 |
|
1541 |
|
1542 | readInternal(diagnosticNode: DiagnosticNodeInternal, options?: RequestOptions): Promise<DatabaseResponse>;
|
1543 |
|
1544 | delete(options?: RequestOptions): Promise<DatabaseResponse>;
|
1545 | |
1546 |
|
1547 |
|
1548 | readOffer(options?: RequestOptions): Promise<OfferResponse>;
|
1549 | }
|
1550 |
|
1551 | |
1552 |
|
1553 |
|
1554 | export declare class DatabaseAccount {
|
1555 |
|
1556 | readonly writableLocations: Location[];
|
1557 |
|
1558 | readonly readableLocations: Location[];
|
1559 | |
1560 |
|
1561 |
|
1562 |
|
1563 | get DatabasesLink(): string;
|
1564 |
|
1565 | readonly databasesLink: string;
|
1566 | |
1567 |
|
1568 |
|
1569 |
|
1570 | get MediaLink(): string;
|
1571 |
|
1572 | readonly mediaLink: string;
|
1573 | |
1574 |
|
1575 |
|
1576 |
|
1577 | get MaxMediaStorageUsageInMB(): number;
|
1578 |
|
1579 | readonly maxMediaStorageUsageInMB: number;
|
1580 | |
1581 |
|
1582 |
|
1583 |
|
1584 |
|
1585 |
|
1586 |
|
1587 |
|
1588 | get CurrentMediaStorageUsageInMB(): number;
|
1589 | |
1590 |
|
1591 |
|
1592 |
|
1593 |
|
1594 |
|
1595 | readonly currentMediaStorageUsageInMB: number;
|
1596 | |
1597 |
|
1598 |
|
1599 |
|
1600 | get ConsistencyPolicy(): ConsistencyLevel;
|
1601 |
|
1602 | readonly consistencyPolicy: ConsistencyLevel;
|
1603 | readonly enableMultipleWritableLocations: boolean;
|
1604 | constructor(body: {
|
1605 | [key: string]: any;
|
1606 | }, headers: CosmosHeaders);
|
1607 | }
|
1608 |
|
1609 | export declare interface DatabaseDefinition {
|
1610 |
|
1611 | id?: string;
|
1612 | }
|
1613 |
|
1614 | export declare interface DatabaseRequest extends DatabaseDefinition {
|
1615 |
|
1616 | throughput?: number;
|
1617 | maxThroughput?: number;
|
1618 | autoUpgradePolicy?: {
|
1619 | throughputPolicy: {
|
1620 | incrementPercent: number;
|
1621 | };
|
1622 | };
|
1623 | }
|
1624 |
|
1625 |
|
1626 | export declare class DatabaseResponse extends ResourceResponse<DatabaseDefinition & Resource> {
|
1627 | constructor(resource: DatabaseDefinition & Resource, headers: CosmosHeaders, statusCode: number, database: Database, diagnostics: CosmosDiagnostics);
|
1628 | /** A reference to the {@link Database} that the returned {@link DatabaseDefinition} corresponds to. */
|
1629 | readonly database: Database;
|
1630 | }
|
1631 |
|
1632 | |
1633 |
|
1634 |
|
1635 |
|
1636 |
|
1637 |
|
1638 |
|
1639 |
|
1640 |
|
1641 |
|
1642 | export declare class Databases {
|
1643 | readonly client: CosmosClient;
|
1644 | private readonly clientContext;
|
1645 | |
1646 |
|
1647 |
|
1648 |
|
1649 | constructor(client: CosmosClient, clientContext: ClientContext);
|
1650 | /**
|
1651 | * Queries all databases.
|
1652 | * @param query - Query configuration for the operation. See {@link SqlQuerySpec} for more info on how to configure a query.
|
1653 | * @param options - Use to set options like response page size, continuation tokens, etc.
|
1654 | * @returns {@link QueryIterator} Allows you to return all databases in an array or iterate over them one at a time.
|
1655 | * @example Read all databases to array.
|
1656 | * ```typescript
|
1657 | * const querySpec: SqlQuerySpec = {
|
1658 | * query: "SELECT * FROM root r WHERE r.id = @db",
|
1659 | * parameters: [
|
1660 | * {name: "@db", value: "Todo"}
|
1661 | * ]
|
1662 | * };
|
1663 | * const {body: databaseList} = await client.databases.query(querySpec).fetchAll();
|
1664 | * ```
|
1665 | */
|
1666 | query(query: string | SqlQuerySpec, options?: FeedOptions): QueryIterator<any>;
|
1667 | |
1668 |
|
1669 |
|
1670 |
|
1671 |
|
1672 |
|
1673 |
|
1674 |
|
1675 |
|
1676 |
|
1677 |
|
1678 |
|
1679 |
|
1680 |
|
1681 |
|
1682 |
|
1683 | query<T>(query: string | SqlQuerySpec, options?: FeedOptions): QueryIterator<T>;
|
1684 | |
1685 |
|
1686 |
|
1687 |
|
1688 |
|
1689 |
|
1690 |
|
1691 |
|
1692 |
|
1693 |
|
1694 |
|
1695 |
|
1696 |
|
1697 |
|
1698 | create(body: DatabaseRequest, options?: RequestOptions): Promise<DatabaseResponse>;
|
1699 | |
1700 |
|
1701 |
|
1702 | createInternal(diagnosticNode: DiagnosticNodeInternal, body: DatabaseRequest, options?: RequestOptions): Promise<DatabaseResponse>;
|
1703 | |
1704 |
|
1705 |
|
1706 |
|
1707 |
|
1708 |
|
1709 |
|
1710 |
|
1711 |
|
1712 |
|
1713 |
|
1714 |
|
1715 |
|
1716 |
|
1717 |
|
1718 | createIfNotExists(body: DatabaseRequest, options?: RequestOptions): Promise<DatabaseResponse>;
|
1719 | |
1720 |
|
1721 |
|
1722 |
|
1723 |
|
1724 |
|
1725 |
|
1726 |
|
1727 |
|
1728 | readAll(options?: FeedOptions): QueryIterator<DatabaseDefinition & Resource>;
|
1729 | }
|
1730 |
|
1731 |
|
1732 | export declare enum DataType {
|
1733 |
|
1734 | Number = "Number",
|
1735 |
|
1736 | String = "String",
|
1737 |
|
1738 | Point = "Point",
|
1739 |
|
1740 | LineString = "LineString",
|
1741 |
|
1742 | Polygon = "Polygon",
|
1743 |
|
1744 | MultiPolygon = "MultiPolygon"
|
1745 | }
|
1746 |
|
1747 | export declare const DEFAULT_PARTITION_KEY_PATH: "/_partitionKey";
|
1748 |
|
1749 | export declare type DeleteOperation = OperationBase & {
|
1750 | operationType: typeof BulkOperationType.Delete;
|
1751 | id: string;
|
1752 | };
|
1753 |
|
1754 | export declare interface DeleteOperationInput {
|
1755 | partitionKey?: PartitionKey;
|
1756 | operationType: typeof BulkOperationType.Delete;
|
1757 | id: string;
|
1758 | }
|
1759 |
|
1760 | |
1761 |
|
1762 |
|
1763 | export declare type DiagnosticDataValue = {
|
1764 | selectedLocation: string;
|
1765 | activityId: string;
|
1766 | requestAttempNumber: number;
|
1767 | requestPayloadLengthInBytes: number;
|
1768 | responsePayloadLengthInBytes: number;
|
1769 | responseStatus: number;
|
1770 | readFromCache: boolean;
|
1771 | operationType: OperationType;
|
1772 | metadatOperationType: MetadataLookUpType;
|
1773 | resourceType: ResourceType;
|
1774 | failedAttempty: boolean;
|
1775 | successfulRetryPolicy: string;
|
1776 | partitionKeyRangeId: string;
|
1777 | stateful: boolean;
|
1778 | queryRecordsRead: number;
|
1779 | queryMethodIdentifier: string;
|
1780 | log: string[];
|
1781 | failure: boolean;
|
1782 | startTimeUTCInMs: number;
|
1783 | durationInMs: number;
|
1784 | requestData: Partial<{
|
1785 | requestPayloadLengthInBytes: number;
|
1786 | responsePayloadLengthInBytes: number;
|
1787 | operationType: OperationType;
|
1788 | resourceType: ResourceType;
|
1789 | headers: CosmosHeaders_2;
|
1790 | requestBody: any;
|
1791 | responseBody: any;
|
1792 | url: string;
|
1793 | }>;
|
1794 | };
|
1795 |
|
1796 | |
1797 |
|
1798 |
|
1799 | export declare interface DiagnosticNode {
|
1800 | id: string;
|
1801 | nodeType: string;
|
1802 | children: DiagnosticNode[];
|
1803 | data: {
|
1804 | [key: string]: any;
|
1805 | };
|
1806 | startTimeUTCInMs: number;
|
1807 | durationInMs: number;
|
1808 | }
|
1809 |
|
1810 | |
1811 |
|
1812 |
|
1813 |
|
1814 |
|
1815 |
|
1816 | export declare class DiagnosticNodeInternal implements DiagnosticNode {
|
1817 | id: string;
|
1818 | nodeType: DiagnosticNodeType;
|
1819 | parent: DiagnosticNodeInternal;
|
1820 | children: DiagnosticNodeInternal[];
|
1821 | data: Partial<DiagnosticDataValue>;
|
1822 | startTimeUTCInMs: number;
|
1823 | durationInMs: number;
|
1824 | diagnosticLevel: CosmosDbDiagnosticLevel;
|
1825 | private diagnosticCtx;
|
1826 | }
|
1827 |
|
1828 | |
1829 |
|
1830 |
|
1831 | export declare enum DiagnosticNodeType {
|
1832 | CLIENT_REQUEST_NODE = "CLIENT_REQUEST_NODE",
|
1833 | METADATA_REQUEST_NODE = "METADATA_REQUEST_NODE",
|
1834 | HTTP_REQUEST = "HTTP_REQUEST",
|
1835 | BATCH_REQUEST = "BATCH_REQUEST",
|
1836 | PARALLEL_QUERY_NODE = "PARALLEL_QUERY_NODE",
|
1837 | DEFAULT_QUERY_NODE = "DEFAULT_QUERY_NODE",
|
1838 | QUERY_REPAIR_NODE = "QUERY_REPAIR_NODE",
|
1839 | BACKGROUND_REFRESH_THREAD = "BACKGROUND_REFRESH_THREAD",
|
1840 | REQUEST_ATTEMPTS = "REQUEST_ATTEMPTS"
|
1841 | }
|
1842 |
|
1843 | export declare interface ErrorBody {
|
1844 | code: string;
|
1845 | message: string;
|
1846 | |
1847 |
|
1848 |
|
1849 | additionalErrorInfo?: PartitionedQueryExecutionInfo;
|
1850 | }
|
1851 |
|
1852 | export declare class ErrorResponse extends Error {
|
1853 | code?: number | string;
|
1854 | substatus?: number;
|
1855 | body?: ErrorBody;
|
1856 | headers?: CosmosHeaders;
|
1857 | activityId?: string;
|
1858 | retryAfterInMs?: number;
|
1859 | retryAfterInMilliseconds?: number;
|
1860 | [key: string]: any;
|
1861 | diagnostics?: CosmosDiagnostics;
|
1862 | }
|
1863 |
|
1864 | export declare type ExistingKeyOperation = {
|
1865 | op: keyof typeof PatchOperationType;
|
1866 | value: any;
|
1867 | path: string;
|
1868 | };
|
1869 |
|
1870 | |
1871 |
|
1872 |
|
1873 | export declare interface FailedRequestAttemptDiagnostic {
|
1874 | attemptNumber: number;
|
1875 | activityId: string;
|
1876 | startTimeUTCInMs: number;
|
1877 | durationInMs: number;
|
1878 | operationType?: OperationType;
|
1879 | resourceType?: ResourceType;
|
1880 | statusCode: number;
|
1881 | substatusCode?: number;
|
1882 | requestPayloadLengthInBytes: number;
|
1883 | responsePayloadLengthInBytes: number;
|
1884 | }
|
1885 |
|
1886 | |
1887 |
|
1888 |
|
1889 | export declare interface FeedOptions extends SharedOptions {
|
1890 | |
1891 |
|
1892 |
|
1893 | continuation?: string;
|
1894 |
|
1895 | continuationToken?: string;
|
1896 | |
1897 |
|
1898 |
|
1899 |
|
1900 |
|
1901 |
|
1902 |
|
1903 | continuationTokenLimitInKB?: number;
|
1904 | |
1905 |
|
1906 |
|
1907 |
|
1908 |
|
1909 | enableScanInQuery?: boolean;
|
1910 | |
1911 |
|
1912 |
|
1913 |
|
1914 |
|
1915 | maxDegreeOfParallelism?: number;
|
1916 | |
1917 |
|
1918 |
|
1919 |
|
1920 |
|
1921 |
|
1922 |
|
1923 |
|
1924 |
|
1925 | maxItemCount?: number;
|
1926 | |
1927 |
|
1928 |
|
1929 |
|
1930 |
|
1931 | useIncrementalFeed?: boolean;
|
1932 |
|
1933 | accessCondition?: {
|
1934 |
|
1935 | type: string;
|
1936 |
|
1937 | condition: string;
|
1938 | };
|
1939 | |
1940 |
|
1941 |
|
1942 |
|
1943 |
|
1944 |
|
1945 | populateQueryMetrics?: boolean;
|
1946 | |
1947 |
|
1948 |
|
1949 |
|
1950 |
|
1951 |
|
1952 |
|
1953 |
|
1954 |
|
1955 | bufferItems?: boolean;
|
1956 | |
1957 |
|
1958 |
|
1959 |
|
1960 |
|
1961 |
|
1962 |
|
1963 |
|
1964 |
|
1965 |
|
1966 |
|
1967 |
|
1968 | forceQueryPlan?: boolean;
|
1969 | |
1970 |
|
1971 |
|
1972 |
|
1973 |
|
1974 |
|
1975 |
|
1976 |
|
1977 |
|
1978 |
|
1979 | partitionKey?: PartitionKey;
|
1980 | |
1981 |
|
1982 |
|
1983 | populateIndexMetrics?: boolean;
|
1984 | |
1985 |
|
1986 |
|
1987 |
|
1988 | vectorSearchBufferSize?: number;
|
1989 | |
1990 |
|
1991 |
|
1992 |
|
1993 | disableNonStreamingOrderByQuery?: boolean;
|
1994 | |
1995 |
|
1996 |
|
1997 |
|
1998 | allowUnboundedNonStreamingQueries?: boolean;
|
1999 | }
|
2000 |
|
2001 | |
2002 |
|
2003 |
|
2004 | export declare abstract class FeedRange {
|
2005 | |
2006 |
|
2007 |
|
2008 | readonly minInclusive: string;
|
2009 | |
2010 |
|
2011 |
|
2012 | readonly maxExclusive: string;
|
2013 | }
|
2014 |
|
2015 | export declare class FeedResponse<TResource> {
|
2016 | readonly resources: TResource[];
|
2017 | private readonly headers;
|
2018 | readonly hasMoreResults: boolean;
|
2019 | readonly diagnostics: CosmosDiagnostics;
|
2020 | constructor(resources: TResource[], headers: CosmosHeaders, hasMoreResults: boolean, diagnostics: CosmosDiagnostics);
|
2021 | get continuation(): string;
|
2022 | get continuationToken(): string;
|
2023 | get queryMetrics(): string;
|
2024 | get requestCharge(): number;
|
2025 | get activityId(): string;
|
2026 | get correlatedActivityId(): string;
|
2027 | get indexMetrics(): string;
|
2028 | }
|
2029 |
|
2030 | /** @hidden */
|
2031 | declare type FetchFunctionCallback = (diagnosticNode: DiagnosticNodeInternal, options: FeedOptions, correlatedActivityId: string) => Promise<Response_2<any>>;
|
2032 |
|
2033 | /**
|
2034 | * Represents a full text index in the indexing policy.
|
2035 | */
|
2036 | export declare interface FullTextIndex {
|
2037 |
|
2038 | path: string;
|
2039 | }
|
2040 |
|
2041 | |
2042 |
|
2043 |
|
2044 | export declare interface FullTextPath {
|
2045 | |
2046 |
|
2047 |
|
2048 | path: string;
|
2049 | |
2050 |
|
2051 |
|
2052 | language: string;
|
2053 | }
|
2054 |
|
2055 | |
2056 |
|
2057 |
|
2058 | export declare interface FullTextPolicy {
|
2059 | |
2060 |
|
2061 |
|
2062 | defaultLanguage: string;
|
2063 | |
2064 |
|
2065 |
|
2066 | fullTextPaths: FullTextPath[];
|
2067 | }
|
2068 |
|
2069 | export declare type GatewayStatistics = {
|
2070 | |
2071 |
|
2072 |
|
2073 | activityId?: string;
|
2074 | correlatedActivityId?: string;
|
2075 | startTimeUTCInMs: number;
|
2076 | durationInMs: number;
|
2077 | operationType?: OperationType;
|
2078 | resourceType?: ResourceType;
|
2079 | statusCode?: number;
|
2080 | subStatusCode?: number;
|
2081 | requestCharge?: number;
|
2082 | requestPayloadLengthInBytes: number;
|
2083 | responsePayloadLengthInBytes: number;
|
2084 | };
|
2085 |
|
2086 | export declare enum GeospatialType {
|
2087 |
|
2088 | Geography = "Geography",
|
2089 |
|
2090 | Geometry = "Geometry"
|
2091 | }
|
2092 |
|
2093 | |
2094 |
|
2095 |
|
2096 |
|
2097 | export declare class GlobalEndpointManager {
|
2098 | private readDatabaseAccount;
|
2099 | |
2100 |
|
2101 |
|
2102 | private defaultEndpoint;
|
2103 | |
2104 |
|
2105 |
|
2106 | enableEndpointDiscovery: boolean;
|
2107 | private isRefreshing;
|
2108 | private options;
|
2109 | |
2110 |
|
2111 |
|
2112 | private preferredLocations;
|
2113 | private writeableLocations;
|
2114 | private readableLocations;
|
2115 | private unavailableReadableLocations;
|
2116 | private unavailableWriteableLocations;
|
2117 | preferredLocationsCount: number;
|
2118 | |
2119 |
|
2120 |
|
2121 | getReadEndpoint(diagnosticNode: DiagnosticNodeInternal): Promise<string>;
|
2122 | |
2123 |
|
2124 |
|
2125 | getWriteEndpoint(diagnosticNode: DiagnosticNodeInternal): Promise<string>;
|
2126 | getReadEndpoints(): Promise<ReadonlyArray<string>>;
|
2127 | getWriteEndpoints(): Promise<ReadonlyArray<string>>;
|
2128 | markCurrentLocationUnavailableForRead(diagnosticNode: DiagnosticNodeInternal, endpoint: string): Promise<void>;
|
2129 | markCurrentLocationUnavailableForWrite(diagnosticNode: DiagnosticNodeInternal, endpoint: string): Promise<void>;
|
2130 | canUseMultipleWriteLocations(resourceType?: ResourceType, operationType?: OperationType): boolean;
|
2131 | resolveServiceEndpoint(diagnosticNode: DiagnosticNodeInternal, resourceType: ResourceType, operationType: OperationType, startServiceEndpointIndex?: number): Promise<string>;
|
2132 | |
2133 |
|
2134 |
|
2135 |
|
2136 |
|
2137 |
|
2138 | refreshEndpointList(diagnosticNode: DiagnosticNodeInternal): Promise<void>;
|
2139 | private refreshEndpoints;
|
2140 | private refreshStaleUnavailableLocations;
|
2141 | |
2142 |
|
2143 |
|
2144 |
|
2145 |
|
2146 |
|
2147 | private updateLocation;
|
2148 | private cleanUnavailableLocationList;
|
2149 | |
2150 |
|
2151 |
|
2152 |
|
2153 |
|
2154 | private getDatabaseAccountFromAnyEndpoint;
|
2155 | |
2156 |
|
2157 |
|
2158 |
|
2159 |
|
2160 |
|
2161 | private static getLocationalEndpoint;
|
2162 | }
|
2163 |
|
2164 | export declare interface GroupByAliasToAggregateType {
|
2165 | [key: string]: AggregateType;
|
2166 | }
|
2167 |
|
2168 | export declare type GroupByExpressions = string[];
|
2169 |
|
2170 | |
2171 |
|
2172 |
|
2173 | export declare enum HTTPMethod {
|
2174 | get = "GET",
|
2175 | patch = "PATCH",
|
2176 | post = "POST",
|
2177 | put = "PUT",
|
2178 | delete = "DELETE"
|
2179 | }
|
2180 |
|
2181 | |
2182 |
|
2183 |
|
2184 |
|
2185 | export declare interface HybridSearchQueryInfo {
|
2186 | |
2187 |
|
2188 |
|
2189 | globalStatisticsQuery: string;
|
2190 | |
2191 |
|
2192 |
|
2193 | componentQueryInfos: QueryInfo[];
|
2194 | |
2195 |
|
2196 |
|
2197 | take: number;
|
2198 | |
2199 |
|
2200 |
|
2201 | skip: number;
|
2202 | |
2203 |
|
2204 |
|
2205 | requiresGlobalStatistics: boolean;
|
2206 | }
|
2207 |
|
2208 | export declare interface Index {
|
2209 | kind: keyof typeof IndexKind;
|
2210 | dataType: keyof typeof DataType;
|
2211 | precision?: number;
|
2212 | }
|
2213 |
|
2214 | export declare interface IndexedPath {
|
2215 | path: string;
|
2216 | indexes?: Index[];
|
2217 | }
|
2218 |
|
2219 | |
2220 |
|
2221 |
|
2222 | export declare enum IndexingMode {
|
2223 | |
2224 |
|
2225 |
|
2226 |
|
2227 |
|
2228 |
|
2229 | consistent = "consistent",
|
2230 | |
2231 |
|
2232 |
|
2233 |
|
2234 |
|
2235 | lazy = "lazy",
|
2236 |
|
2237 | none = "none"
|
2238 | }
|
2239 |
|
2240 | export declare interface IndexingPolicy {
|
2241 |
|
2242 | indexingMode?: keyof typeof IndexingMode;
|
2243 | automatic?: boolean;
|
2244 |
|
2245 | includedPaths?: IndexedPath[];
|
2246 |
|
2247 | excludedPaths?: IndexedPath[];
|
2248 | spatialIndexes?: SpatialIndex[];
|
2249 |
|
2250 | vectorIndexes?: VectorIndex[];
|
2251 |
|
2252 | compositeIndexes?: CompositePath[][];
|
2253 |
|
2254 | fullTextIndexes?: FullTextIndex[];
|
2255 | }
|
2256 |
|
2257 | |
2258 |
|
2259 |
|
2260 | export declare enum IndexKind {
|
2261 | |
2262 |
|
2263 |
|
2264 | Range = "Range",
|
2265 | |
2266 |
|
2267 |
|
2268 | Spatial = "Spatial"
|
2269 | }
|
2270 |
|
2271 | |
2272 |
|
2273 |
|
2274 |
|
2275 |
|
2276 | export declare class Item {
|
2277 | readonly container: Container;
|
2278 | readonly id: string;
|
2279 | private readonly clientContext;
|
2280 | private partitionKey;
|
2281 | |
2282 |
|
2283 |
|
2284 | get url(): string;
|
2285 | |
2286 |
|
2287 |
|
2288 |
|
2289 |
|
2290 |
|
2291 | constructor(container: Container, id: string, clientContext: ClientContext, partitionKey?: PartitionKey);
|
2292 | /**
|
2293 | * Read the item's definition.
|
2294 | *
|
2295 | * Any provided type, T, is not necessarily enforced by the SDK.
|
2296 | * You may get more or less properties and it's up to your logic to enforce it.
|
2297 | * If the type, T, is a class, it won't pass `typeof` comparisons, because it won't have a match prototype.
|
2298 | * It's recommended to only use interfaces.
|
2299 | *
|
2300 | * There is no set schema for JSON items. They may contain any number of custom properties.
|
2301 | *
|
2302 | * @param options - Additional options for the request
|
2303 | *
|
2304 | * @example Using custom type for response
|
2305 | * ```typescript
|
2306 | * interface TodoItem {
|
2307 | * title: string;
|
2308 | * done: bool;
|
2309 | * id: string;
|
2310 | * }
|
2311 | *
|
2312 | * let item: TodoItem;
|
2313 | * ({body: item} = await item.read<TodoItem>());
|
2314 | * ```
|
2315 | */
|
2316 | read<T extends ItemDefinition = any>(options?: RequestOptions): Promise<ItemResponse<T>>;
|
2317 | /**
|
2318 | * Replace the item's definition.
|
2319 | *
|
2320 | * There is no set schema for JSON items. They may contain any number of custom properties.
|
2321 | *
|
2322 | * @param body - The definition to replace the existing {@link Item}'s definition with.
|
2323 | * @param options - Additional options for the request
|
2324 | */
|
2325 | replace(body: ItemDefinition, options?: RequestOptions): Promise<ItemResponse<ItemDefinition>>;
|
2326 | /**
|
2327 | * Replace the item's definition.
|
2328 | *
|
2329 | * Any provided type, T, is not necessarily enforced by the SDK.
|
2330 | * You may get more or less properties and it's up to your logic to enforce it.
|
2331 | *
|
2332 | * There is no set schema for JSON items. They may contain any number of custom properties.
|
2333 | *
|
2334 | * @param body - The definition to replace the existing {@link Item}'s definition with.
|
2335 | * @param options - Additional options for the request
|
2336 | */
|
2337 | replace<T extends ItemDefinition>(body: T, options?: RequestOptions): Promise<ItemResponse<T>>;
|
2338 | /**
|
2339 | * Delete the item.
|
2340 | *
|
2341 | * Any provided type, T, is not necessarily enforced by the SDK.
|
2342 | * You may get more or less properties and it's up to your logic to enforce it.
|
2343 | *
|
2344 | * @param options - Additional options for the request
|
2345 | */
|
2346 | delete<T extends ItemDefinition = any>(options?: RequestOptions): Promise<ItemResponse<T>>;
|
2347 | /**
|
2348 | * Perform a JSONPatch on the item.
|
2349 | *
|
2350 | * Any provided type, T, is not necessarily enforced by the SDK.
|
2351 | * You may get more or less properties and it's up to your logic to enforce it.
|
2352 | *
|
2353 | * @param options - Additional options for the request
|
2354 | */
|
2355 | patch<T extends ItemDefinition = any>(body: PatchRequestBody, options?: RequestOptions): Promise<ItemResponse<T>>;
|
2356 | }
|
2357 |
|
2358 | /**
|
2359 | * Items in Cosmos DB are simply JSON objects.
|
2360 | * Most of the Item operations allow for your to provide your own type
|
2361 | * that extends the very simple ItemDefinition.
|
2362 | *
|
2363 | * You cannot use any reserved keys. You can see the reserved key list
|
2364 | * in {@link ItemBody}
|
2365 | */
|
2366 | export declare interface ItemDefinition {
|
2367 | /** The id of the item. User settable property. Uniquely identifies the item along with the partition key */
|
2368 | id?: string;
|
2369 | /** Time to live in seconds for collections with TTL enabled */
|
2370 | ttl?: number;
|
2371 | [key: string]: any;
|
2372 | }
|
2373 |
|
2374 | export declare class ItemResponse<T extends ItemDefinition> extends ResourceResponse<T & Resource> {
|
2375 | constructor(resource: T & Resource, headers: CosmosHeaders, statusCode: number, subsstatusCode: number, item: Item, diagnostics: CosmosDiagnostics);
|
2376 | /** Reference to the {@link Item} the response corresponds to. */
|
2377 | readonly item: Item;
|
2378 | }
|
2379 |
|
2380 | /**
|
2381 | * Operations for creating new items, and reading/querying all items
|
2382 | *
|
2383 | * @see {@link Item} for reading, replacing, or deleting an existing container; use `.item(id)`.
|
2384 | */
|
2385 | export declare class Items {
|
2386 | readonly container: Container;
|
2387 | private readonly clientContext;
|
2388 | private partitionKeyRangeCache;
|
2389 | /**
|
2390 | * Create an instance of {@link Items} linked to the parent {@link Container}.
|
2391 | * @param container - The parent container.
|
2392 | * @hidden
|
2393 | */
|
2394 | constructor(container: Container, clientContext: ClientContext);
|
2395 | /**
|
2396 | * Queries all items.
|
2397 | * @param query - Query configuration for the operation. See {@link SqlQuerySpec} for more info on how to configure a query.
|
2398 | * @param options - Used for modifying the request (for instance, specifying the partition key).
|
2399 | * @example Read all items to array.
|
2400 | * ```typescript
|
2401 | * const querySpec: SqlQuerySpec = {
|
2402 | * query: "SELECT * FROM Families f WHERE f.lastName = @lastName",
|
2403 | * parameters: [
|
2404 | * {name: "@lastName", value: "Hendricks"}
|
2405 | * ]
|
2406 | * };
|
2407 | * const {result: items} = await items.query(querySpec).fetchAll();
|
2408 | * ```
|
2409 | */
|
2410 | query(query: string | SqlQuerySpec, options?: FeedOptions): QueryIterator<any>;
|
2411 | /**
|
2412 | * Queries all items.
|
2413 | * @param query - Query configuration for the operation. See {@link SqlQuerySpec} for more info on how to configure a query.
|
2414 | * @param options - Used for modifying the request (for instance, specifying the partition key).
|
2415 | * @example Read all items to array.
|
2416 | * ```typescript
|
2417 | * const querySpec: SqlQuerySpec = {
|
2418 | * query: "SELECT firstname FROM Families f WHERE f.lastName = @lastName",
|
2419 | * parameters: [
|
2420 | * {name: "@lastName", value: "Hendricks"}
|
2421 | * ]
|
2422 | * };
|
2423 | * const {result: items} = await items.query<{firstName: string}>(querySpec).fetchAll();
|
2424 | * ```
|
2425 | */
|
2426 | query<T>(query: string | SqlQuerySpec, options?: FeedOptions): QueryIterator<T>;
|
2427 | /**
|
2428 | * Create a `ChangeFeedIterator` to iterate over pages of changes
|
2429 | *
|
2430 | * @deprecated Use `changeFeed` instead.
|
2431 | *
|
2432 | * @example Read from the beginning of the change feed.
|
2433 | * ```javascript
|
2434 | * const iterator = items.readChangeFeed({ startFromBeginning: true });
|
2435 | * const firstPage = await iterator.fetchNext();
|
2436 | * const firstPageResults = firstPage.result
|
2437 | * const secondPage = await iterator.fetchNext();
|
2438 | * ```
|
2439 | */
|
2440 | readChangeFeed(partitionKey: PartitionKey, changeFeedOptions?: ChangeFeedOptions): ChangeFeedIterator<any>;
|
2441 | /**
|
2442 | * Create a `ChangeFeedIterator` to iterate over pages of changes
|
2443 | * @deprecated Use `changeFeed` instead.
|
2444 | *
|
2445 | */
|
2446 | readChangeFeed(changeFeedOptions?: ChangeFeedOptions): ChangeFeedIterator<any>;
|
2447 | /**
|
2448 | * Create a `ChangeFeedIterator` to iterate over pages of changes
|
2449 | * @deprecated Use `changeFeed` instead.
|
2450 | */
|
2451 | readChangeFeed<T>(partitionKey: PartitionKey, changeFeedOptions?: ChangeFeedOptions): ChangeFeedIterator<T>;
|
2452 | /**
|
2453 | * Create a `ChangeFeedIterator` to iterate over pages of changes
|
2454 | * @deprecated Use `changeFeed` instead.
|
2455 | */
|
2456 | readChangeFeed<T>(changeFeedOptions?: ChangeFeedOptions): ChangeFeedIterator<T>;
|
2457 | /**
|
2458 | * Create a `ChangeFeedIterator` to iterate over pages of changes
|
2459 | *
|
2460 | * @example Read from the beginning of the change feed.
|
2461 | * ```javascript
|
2462 | * const iterator = items.readChangeFeed({ startFromBeginning: true });
|
2463 | * const firstPage = await iterator.fetchNext();
|
2464 | * const firstPageResults = firstPage.result
|
2465 | * const secondPage = await iterator.fetchNext();
|
2466 | * ```
|
2467 | */
|
2468 | changeFeed(partitionKey: PartitionKey, changeFeedOptions?: ChangeFeedOptions): ChangeFeedIterator<any>;
|
2469 | /**
|
2470 | * Create a `ChangeFeedIterator` to iterate over pages of changes
|
2471 | */
|
2472 | changeFeed(changeFeedOptions?: ChangeFeedOptions): ChangeFeedIterator<any>;
|
2473 | /**
|
2474 | * Create a `ChangeFeedIterator` to iterate over pages of changes
|
2475 | */
|
2476 | changeFeed<T>(partitionKey: PartitionKey, changeFeedOptions?: ChangeFeedOptions): ChangeFeedIterator<T>;
|
2477 | /**
|
2478 | * Create a `ChangeFeedIterator` to iterate over pages of changes
|
2479 | */
|
2480 | changeFeed<T>(changeFeedOptions?: ChangeFeedOptions): ChangeFeedIterator<T>;
|
2481 | /**
|
2482 | * Returns an iterator to iterate over pages of changes. The iterator returned can be used to fetch changes for a single partition key, feed range or an entire container.
|
2483 | */
|
2484 | getChangeFeedIterator<T>(changeFeedIteratorOptions?: ChangeFeedIteratorOptions): ChangeFeedPullModelIterator<T>;
|
2485 | /**
|
2486 | * Read all items.
|
2487 | *
|
2488 | * There is no set schema for JSON items. They may contain any number of custom properties.
|
2489 | *
|
2490 | * @param options - Used for modifying the request (for instance, specifying the partition key).
|
2491 | * @example Read all items to array.
|
2492 | * ```typescript
|
2493 | * const {body: containerList} = await items.readAll().fetchAll();
|
2494 | * ```
|
2495 | */
|
2496 | readAll(options?: FeedOptions): QueryIterator<ItemDefinition>;
|
2497 | /**
|
2498 | * Read all items.
|
2499 | *
|
2500 | * Any provided type, T, is not necessarily enforced by the SDK.
|
2501 | * You may get more or less properties and it's up to your logic to enforce it.
|
2502 | *
|
2503 | * There is no set schema for JSON items. They may contain any number of custom properties.
|
2504 | *
|
2505 | * @param options - Used for modifying the request (for instance, specifying the partition key).
|
2506 | * @example Read all items to array.
|
2507 | * ```typescript
|
2508 | * const {body: containerList} = await items.readAll().fetchAll();
|
2509 | * ```
|
2510 | */
|
2511 | readAll<T extends ItemDefinition>(options?: FeedOptions): QueryIterator<T>;
|
2512 | /**
|
2513 | * Create an item.
|
2514 | *
|
2515 | * Any provided type, T, is not necessarily enforced by the SDK.
|
2516 | * You may get more or less properties and it's up to your logic to enforce it.
|
2517 | *
|
2518 | * There is no set schema for JSON items. They may contain any number of custom properties.
|
2519 | *
|
2520 | * @param body - Represents the body of the item. Can contain any number of user defined properties.
|
2521 | * @param options - Used for modifying the request (for instance, specifying the partition key).
|
2522 | */
|
2523 | create<T extends ItemDefinition = any>(body: T, options?: RequestOptions): Promise<ItemResponse<T>>;
|
2524 | /**
|
2525 | * Upsert an item.
|
2526 | *
|
2527 | * There is no set schema for JSON items. They may contain any number of custom properties.
|
2528 | *
|
2529 | * @param body - Represents the body of the item. Can contain any number of user defined properties.
|
2530 | * @param options - Used for modifying the request (for instance, specifying the partition key).
|
2531 | */
|
2532 | upsert(body: unknown, options?: RequestOptions): Promise<ItemResponse<ItemDefinition>>;
|
2533 | /**
|
2534 | * Upsert an item.
|
2535 | *
|
2536 | * Any provided type, T, is not necessarily enforced by the SDK.
|
2537 | * You may get more or less properties and it's up to your logic to enforce it.
|
2538 | *
|
2539 | * There is no set schema for JSON items. They may contain any number of custom properties.
|
2540 | *
|
2541 | * @param body - Represents the body of the item. Can contain any number of user defined properties.
|
2542 | * @param options - Used for modifying the request (for instance, specifying the partition key).
|
2543 | */
|
2544 | upsert<T extends ItemDefinition>(body: T, options?: RequestOptions): Promise<ItemResponse<T>>;
|
2545 | /**
|
2546 | * Execute bulk operations on items.
|
2547 | *
|
2548 | * Bulk takes an array of Operations which are typed based on what the operation does.
|
2549 | * The choices are: Create, Upsert, Read, Replace, and Delete
|
2550 | *
|
2551 | * Usage example:
|
2552 | * ```typescript
|
2553 | *
|
2554 | * const operations: OperationInput[] = [
|
2555 | * {
|
2556 | * operationType: "Create",
|
2557 | * resourceBody: { id: "doc1", name: "sample", key: "A" }
|
2558 | * },
|
2559 | * {
|
2560 | * operationType: "Upsert",
|
2561 | * partitionKey: 'A',
|
2562 | * resourceBody: { id: "doc2", name: "other", key: "A" }
|
2563 | * }
|
2564 | * ]
|
2565 | *
|
2566 | * await database.container.items.bulk(operations)
|
2567 | * ```
|
2568 | *
|
2569 | * @param operations - List of operations. Limit 100
|
2570 | * @param bulkOptions - Optional options object to modify bulk behavior. Pass \{ continueOnError: false \} to stop executing operations when one fails. (Defaults to true)
|
2571 | * @param options - Used for modifying the request.
|
2572 | */
|
2573 | bulk(operations: OperationInput[], bulkOptions?: BulkOptions, options?: RequestOptions): Promise<BulkOperationResponse>;
|
2574 | private executeBatchOperations;
|
2575 | /**
|
2576 | * Function to create new batches based of partition key Ranges.
|
2577 | *
|
2578 | * @param overlappingRanges - Overlapping partition key ranges.
|
2579 | * @param batch - Batch to be split.
|
2580 | * @param partitionKeyDefinition - PartitionKey definition of container.
|
2581 | * @returns Array of new batches.
|
2582 | */
|
2583 | private createNewBatches;
|
2584 | /**
|
2585 | * Function to create batches based of partition key Ranges.
|
2586 | * @param operations - operations to group
|
2587 | * @param partitionDefinition - PartitionKey definition of container.
|
2588 | * @param options - Request options for bulk request.
|
2589 | * @param batches - Groups to be filled with operations.
|
2590 | */
|
2591 | private groupOperationsBasedOnPartitionKey;
|
2592 | /**
|
2593 | * Execute transactional batch operations on items.
|
2594 | *
|
2595 | * Batch takes an array of Operations which are typed based on what the operation does. Batch is transactional and will rollback all operations if one fails.
|
2596 | * The choices are: Create, Upsert, Read, Replace, and Delete
|
2597 | *
|
2598 | * Usage example:
|
2599 | * ```typescript
|
2600 | *
|
2601 | * const operations: OperationInput[] = [
|
2602 | * {
|
2603 | * operationType: "Create",
|
2604 | * resourceBody: { id: "doc1", name: "sample", key: "A" }
|
2605 | * },
|
2606 | * {
|
2607 | * operationType: "Upsert",
|
2608 | * resourceBody: { id: "doc2", name: "other", key: "A" }
|
2609 | * }
|
2610 | * ]
|
2611 | *
|
2612 | * await database.container.items.batch(operations, "A")
|
2613 | * ```
|
2614 | *
|
2615 | * @param operations - List of operations. Limit 100
|
2616 | * @param options - Used for modifying the request
|
2617 | */
|
2618 | batch(operations: OperationInput[], partitionKey?: PartitionKey, options?: RequestOptions): Promise<Response_2<OperationResponse[]>>;
|
2619 | }
|
2620 |
|
2621 | export declare interface JSONArray extends ArrayLike<JSONValue> {
|
2622 | }
|
2623 |
|
2624 | export declare interface JSONObject {
|
2625 | [key: string]: JSONValue;
|
2626 | }
|
2627 |
|
2628 | export declare type JSONValue = boolean | number | string | null | JSONArray | JSONObject;
|
2629 |
|
2630 | /**
|
2631 | * Used to specify the locations that are available, read is index 1 and write is index 0.
|
2632 | */
|
2633 | export declare interface Location {
|
2634 | name: string;
|
2635 | databaseAccountEndpoint: string;
|
2636 | unavailable?: boolean;
|
2637 | lastUnavailabilityTimestampInMs?: number;
|
2638 | }
|
2639 |
|
2640 | /**
|
2641 | * This type contains diagnostic information regarding a single metadata request to server.
|
2642 | */
|
2643 | export declare interface MetadataLookUpDiagnostic {
|
2644 | activityId: string;
|
2645 | startTimeUTCInMs: number;
|
2646 | durationInMs: number;
|
2647 | operationType?: OperationType;
|
2648 | resourceType?: ResourceType;
|
2649 | metaDataType: MetadataLookUpType;
|
2650 | requestPayloadLengthInBytes: number;
|
2651 | responsePayloadLengthInBytes: number;
|
2652 | }
|
2653 |
|
2654 | /**
|
2655 | * This type contains diagnostic information regarding all metadata request to server during an CosmosDB client operation.
|
2656 | */
|
2657 | export declare type MetadataLookUpDiagnostics = {
|
2658 | metadataLookups: MetadataLookUpDiagnostic[];
|
2659 | };
|
2660 |
|
2661 | /**
|
2662 | * This is enum for Type of Metadata lookups possible.
|
2663 | */
|
2664 | export declare enum MetadataLookUpType {
|
2665 | PartitionKeyRangeLookUp = "PARTITION_KEY_RANGE_LOOK_UP",
|
2666 | DatabaseAccountLookUp = "DATABASE_ACCOUNT_LOOK_UP",
|
2667 | QueryPlanLookUp = "QUERY_PLAN_LOOK_UP",
|
2668 | DatabaseLookUp = "DATABASE_LOOK_UP",
|
2669 | ContainerLookUp = "CONTAINER_LOOK_UP"
|
2670 | }
|
2671 |
|
2672 | /**
|
2673 | * Next is a function which takes in requestContext returns a promise. You must await/then that promise which will contain the response from further plugins,
|
2674 | * allowing you to log those results or handle errors.
|
2675 | * @hidden
|
2676 | */
|
2677 | export declare type Next<T> = (context: RequestContext) => Promise<Response_2<T>>;
|
2678 |
|
2679 | /**
|
2680 | * The returned object represents a partition key value that allows creating and accessing items
|
2681 | * without a value for partition key
|
2682 | */
|
2683 | export declare type NonePartitionKeyType = {
|
2684 | [K in any]: never;
|
2685 | };
|
2686 |
|
2687 | /**
|
2688 | * The returned object represents a partition key value that allows creating and accessing items
|
2689 | * with a null value for the partition key.
|
2690 | */
|
2691 | export declare type NullPartitionKeyType = null;
|
2692 |
|
2693 | /**
|
2694 | * Use to read or replace an existing {@link Offer} by id.
|
2695 | *
|
2696 | * @see {@link Offers} to query or read all offers.
|
2697 | */
|
2698 | export declare class Offer {
|
2699 | readonly client: CosmosClient;
|
2700 | readonly id: string;
|
2701 | private readonly clientContext;
|
2702 | /**
|
2703 | * Returns a reference URL to the resource. Used for linking in Permissions.
|
2704 | */
|
2705 | get url(): string;
|
2706 | /**
|
2707 | * @hidden
|
2708 | * @param client - The parent {@link CosmosClient} for the Database Account.
|
2709 | * @param id - The id of the given {@link Offer}.
|
2710 | */
|
2711 | constructor(client: CosmosClient, id: string, clientContext: ClientContext);
|
2712 | /**
|
2713 | * Read the {@link OfferDefinition} for the given {@link Offer}.
|
2714 | */
|
2715 | read(options?: RequestOptions): Promise<OfferResponse>;
|
2716 | /**
|
2717 | * Replace the given {@link Offer} with the specified {@link OfferDefinition}.
|
2718 | * @param body - The specified {@link OfferDefinition}
|
2719 | */
|
2720 | replace(body: OfferDefinition, options?: RequestOptions): Promise<OfferResponse>;
|
2721 | }
|
2722 |
|
2723 | export declare interface OfferDefinition {
|
2724 | id?: string;
|
2725 | offerType?: string;
|
2726 | offerVersion?: string;
|
2727 | resource?: string;
|
2728 | offerResourceId?: string;
|
2729 | content?: {
|
2730 | offerThroughput: number;
|
2731 | offerIsRUPerMinuteThroughputEnabled: boolean;
|
2732 | offerMinimumThroughputParameters?: {
|
2733 | maxThroughputEverProvisioned: number;
|
2734 | maxConsumedStorageEverInKB: number;
|
2735 | };
|
2736 | offerAutopilotSettings?: {
|
2737 | tier: number;
|
2738 | maximumTierThroughput: number;
|
2739 | autoUpgrade: boolean;
|
2740 | maxThroughput: number;
|
2741 | };
|
2742 | };
|
2743 | }
|
2744 |
|
2745 | export declare class OfferResponse extends ResourceResponse<OfferDefinition & Resource> {
|
2746 | constructor(resource: OfferDefinition & Resource, headers: CosmosHeaders, statusCode: number, diagnostics: CosmosDiagnostics, offer?: Offer);
|
2747 | /** A reference to the {@link Offer} corresponding to the returned {@link OfferDefinition}. */
|
2748 | readonly offer: Offer;
|
2749 | }
|
2750 |
|
2751 | /**
|
2752 | * Use to query or read all Offers.
|
2753 | *
|
2754 | * @see {@link Offer} to read or replace an existing {@link Offer} by id.
|
2755 | */
|
2756 | export declare class Offers {
|
2757 | readonly client: CosmosClient;
|
2758 | private readonly clientContext;
|
2759 | /**
|
2760 | * @hidden
|
2761 | * @param client - The parent {@link CosmosClient} for the offers.
|
2762 | */
|
2763 | constructor(client: CosmosClient, clientContext: ClientContext);
|
2764 | /**
|
2765 | * Query all offers.
|
2766 | * @param query - Query configuration for the operation. See {@link SqlQuerySpec} for more info on how to configure a query.
|
2767 | */
|
2768 | query(query: SqlQuerySpec, options?: FeedOptions): QueryIterator<any>;
|
2769 | /**
|
2770 | * Query all offers.
|
2771 | * @param query - Query configuration for the operation. See {@link SqlQuerySpec} for more info on how to configure a query.
|
2772 | */
|
2773 | query<T>(query: SqlQuerySpec, options?: FeedOptions): QueryIterator<T>;
|
2774 | /**
|
2775 | * Read all offers.
|
2776 | * @example Read all offers to array.
|
2777 | * ```typescript
|
2778 | * const {body: offerList} = await client.offers.readAll().fetchAll();
|
2779 | * ```
|
2780 | */
|
2781 | readAll(options?: FeedOptions): QueryIterator<OfferDefinition & Resource>;
|
2782 | }
|
2783 |
|
2784 | export declare type Operation = CreateOperation | UpsertOperation | ReadOperation | DeleteOperation | ReplaceOperation | BulkPatchOperation;
|
2785 |
|
2786 | export declare interface OperationBase {
|
2787 | partitionKey?: string;
|
2788 | ifMatch?: string;
|
2789 | ifNoneMatch?: string;
|
2790 | }
|
2791 |
|
2792 | export declare type OperationInput = CreateOperationInput | UpsertOperationInput | ReadOperationInput | DeleteOperationInput | ReplaceOperationInput | PatchOperationInput;
|
2793 |
|
2794 | export declare interface OperationResponse {
|
2795 | statusCode: number;
|
2796 | requestCharge: number;
|
2797 | eTag?: string;
|
2798 | resourceBody?: JSONObject;
|
2799 | }
|
2800 |
|
2801 | /**
|
2802 | * @hidden
|
2803 | */
|
2804 | export declare enum OperationType {
|
2805 | Create = "create",
|
2806 | Replace = "replace",
|
2807 | Upsert = "upsert",
|
2808 | Delete = "delete",
|
2809 | Read = "read",
|
2810 | Query = "query",
|
2811 | Execute = "execute",
|
2812 | Batch = "batch",
|
2813 | Patch = "patch"
|
2814 | }
|
2815 |
|
2816 | export declare type OperationWithItem = OperationBase & {
|
2817 | resourceBody: JSONObject;
|
2818 | };
|
2819 |
|
2820 | /**
|
2821 | * @hidden
|
2822 | */
|
2823 | export declare interface PartitionedQueryExecutionInfo {
|
2824 | partitionedQueryExecutionInfoVersion: number;
|
2825 | queryInfo?: QueryInfo;
|
2826 | /**
|
2827 | * Represents hybrid query information.
|
2828 | */
|
2829 | hybridSearchQueryInfo?: HybridSearchQueryInfo;
|
2830 | queryRanges: QueryRange[];
|
2831 | }
|
2832 |
|
2833 | /**
|
2834 | * PartitionKey of a container.
|
2835 | * @remarks
|
2836 | * - PartitionKeyDefinition is no longer part of PartitionKey. So please use PartitionKeyDefinition
|
2837 | * type directly where appropriate.
|
2838 | */
|
2839 | export declare type PartitionKey = PrimitivePartitionKeyValue | PrimitivePartitionKeyValue[];
|
2840 |
|
2841 | /**
|
2842 | * Builder class for building PartitionKey.
|
2843 | */
|
2844 | export declare class PartitionKeyBuilder {
|
2845 | readonly values: PrimitivePartitionKeyValue[];
|
2846 | addValue(value: string | boolean | number): PartitionKeyBuilder;
|
2847 | addNullValue(): PartitionKeyBuilder;
|
2848 | addNoneValue(): PartitionKeyBuilder;
|
2849 | build(): PartitionKey;
|
2850 | }
|
2851 |
|
2852 | export declare interface PartitionKeyDefinition {
|
2853 | /**
|
2854 | * An array of paths for which data within the collection can be partitioned. Paths must not contain a wildcard or
|
2855 | * a trailing slash. For example, the JSON property “AccountNumber” is specified as “/AccountNumber”. The array must
|
2856 | * contain only a single value.
|
2857 | */
|
2858 | paths: string[];
|
2859 | /**
|
2860 | * An optional field, if not specified the default value is 1. To use the large partition key set the version to 2.
|
2861 | * To learn about large partition keys, see [how to create containers with large partition key](https://docs.microsoft.com/en-us/azure/cosmos-db/large-partition-keys) article.
|
2862 | */
|
2863 | version?: PartitionKeyDefinitionVersion;
|
2864 | systemKey?: boolean;
|
2865 | /**
|
2866 | * What kind of partition key is being defined (default: "Hash")
|
2867 | */
|
2868 | kind?: PartitionKeyKind;
|
2869 | }
|
2870 |
|
2871 | /**
|
2872 | * PartitionKey Definition Version
|
2873 | */
|
2874 | export declare enum PartitionKeyDefinitionVersion {
|
2875 | V1 = 1,
|
2876 | V2 = 2
|
2877 | }
|
2878 |
|
2879 | /**
|
2880 | * Type of PartitionKey i.e. Hash, MultiHash
|
2881 | */
|
2882 | export declare enum PartitionKeyKind {
|
2883 | Hash = "Hash",
|
2884 | MultiHash = "MultiHash"
|
2885 | }
|
2886 |
|
2887 | /**
|
2888 | * @hidden
|
2889 | */
|
2890 | export declare interface PartitionKeyRange {
|
2891 | id: string;
|
2892 | minInclusive: string;
|
2893 | maxExclusive: string;
|
2894 | ridPrefix: number;
|
2895 | throughputFraction: number;
|
2896 | status: string;
|
2897 | parents: string[];
|
2898 | }
|
2899 |
|
2900 | export declare interface PartitionKeyRangePropertiesNames {
|
2901 | MinInclusive: "minInclusive";
|
2902 | MaxExclusive: "maxExclusive";
|
2903 | Id: "id";
|
2904 | }
|
2905 |
|
2906 | export declare type PatchOperation = ExistingKeyOperation | RemoveOperation;
|
2907 |
|
2908 | export declare interface PatchOperationInput {
|
2909 | partitionKey?: PartitionKey;
|
2910 | ifMatch?: string;
|
2911 | ifNoneMatch?: string;
|
2912 | operationType: typeof BulkOperationType.Patch;
|
2913 | resourceBody: PatchRequestBody;
|
2914 | id: string;
|
2915 | }
|
2916 |
|
2917 | export declare const PatchOperationType: {
|
2918 | readonly add: "add";
|
2919 | readonly replace: "replace";
|
2920 | readonly remove: "remove";
|
2921 | readonly set: "set";
|
2922 | readonly incr: "incr";
|
2923 | };
|
2924 |
|
2925 | export declare type PatchRequestBody = {
|
2926 | operations: PatchOperation[];
|
2927 | condition?: string;
|
2928 | } | PatchOperation[];
|
2929 |
|
2930 | /**
|
2931 | * Use to read, replace, or delete a given {@link Permission} by id.
|
2932 | *
|
2933 | * @see {@link Permissions} to create, upsert, query, or read all Permissions.
|
2934 | */
|
2935 | export declare class Permission {
|
2936 | readonly user: User;
|
2937 | readonly id: string;
|
2938 | private readonly clientContext;
|
2939 | /**
|
2940 | * Returns a reference URL to the resource. Used for linking in Permissions.
|
2941 | */
|
2942 | get url(): string;
|
2943 | /**
|
2944 | * @hidden
|
2945 | * @param user - The parent {@link User}.
|
2946 | * @param id - The id of the given {@link Permission}.
|
2947 | */
|
2948 | constructor(user: User, id: string, clientContext: ClientContext);
|
2949 | /**
|
2950 | * Read the {@link PermissionDefinition} of the given {@link Permission}.
|
2951 | */
|
2952 | read(options?: RequestOptions): Promise<PermissionResponse>;
|
2953 | /**
|
2954 | * Replace the given {@link Permission} with the specified {@link PermissionDefinition}.
|
2955 | * @param body - The specified {@link PermissionDefinition}.
|
2956 | */
|
2957 | replace(body: PermissionDefinition, options?: RequestOptions): Promise<PermissionResponse>;
|
2958 | /**
|
2959 | * Delete the given {@link Permission}.
|
2960 | */
|
2961 | delete(options?: RequestOptions): Promise<PermissionResponse>;
|
2962 | }
|
2963 |
|
2964 | export declare interface PermissionBody {
|
2965 | /** System generated resource token for the particular resource and user */
|
2966 | _token: string;
|
2967 | }
|
2968 |
|
2969 | export declare interface PermissionDefinition {
|
2970 | /** The id of the permission */
|
2971 | id: string;
|
2972 | /** The mode of the permission, must be a value of {@link PermissionMode} */
|
2973 | permissionMode: PermissionMode;
|
2974 | /** The link of the resource that the permission will be applied to. */
|
2975 | resource: string;
|
2976 | resourcePartitionKey?: string | any[];
|
2977 | }
|
2978 |
|
2979 | /**
|
2980 | * Enum for permission mode values.
|
2981 | */
|
2982 | export declare enum PermissionMode {
|
2983 | /** Permission not valid. */
|
2984 | None = "none",
|
2985 | /** Permission applicable for read operations only. */
|
2986 | Read = "read",
|
2987 | /** Permission applicable for all operations. */
|
2988 | All = "all"
|
2989 | }
|
2990 |
|
2991 | export declare class PermissionResponse extends ResourceResponse<PermissionDefinition & PermissionBody & Resource> {
|
2992 | constructor(resource: PermissionDefinition & PermissionBody & Resource, headers: CosmosHeaders, statusCode: number, permission: Permission, diagnostics: CosmosDiagnostics);
|
2993 | /** A reference to the {@link Permission} corresponding to the returned {@link PermissionDefinition}. */
|
2994 | readonly permission: Permission;
|
2995 | }
|
2996 |
|
2997 | /**
|
2998 | * Use to create, replace, query, and read all Permissions.
|
2999 | *
|
3000 | * @see {@link Permission} to read, replace, or delete a specific permission by id.
|
3001 | */
|
3002 | export declare class Permissions {
|
3003 | readonly user: User;
|
3004 | private readonly clientContext;
|
3005 | /**
|
3006 | * @hidden
|
3007 | * @param user - The parent {@link User}.
|
3008 | */
|
3009 | constructor(user: User, clientContext: ClientContext);
|
3010 | /**
|
3011 | * Query all permissions.
|
3012 | * @param query - Query configuration for the operation. See {@link SqlQuerySpec} for more info on how to configure a query.
|
3013 | */
|
3014 | query(query: SqlQuerySpec, options?: FeedOptions): QueryIterator<any>;
|
3015 | /**
|
3016 | * Query all permissions.
|
3017 | * @param query - Query configuration for the operation. See {@link SqlQuerySpec} for more info on how to configure a query.
|
3018 | */
|
3019 | query<T>(query: SqlQuerySpec, options?: FeedOptions): QueryIterator<T>;
|
3020 | /**
|
3021 | * Read all permissions.
|
3022 | * @example Read all permissions to array.
|
3023 | * ```typescript
|
3024 | * const {body: permissionList} = await user.permissions.readAll().fetchAll();
|
3025 | * ```
|
3026 | */
|
3027 | readAll(options?: FeedOptions): QueryIterator<PermissionDefinition & Resource>;
|
3028 | /**
|
3029 | * Create a permission.
|
3030 | *
|
3031 | * A permission represents a per-User Permission to access a specific resource
|
3032 | * e.g. Item or Container.
|
3033 | * @param body - Represents the body of the permission.
|
3034 | */
|
3035 | create(body: PermissionDefinition, options?: RequestOptions): Promise<PermissionResponse>;
|
3036 | /**
|
3037 | * Upsert a permission.
|
3038 | *
|
3039 | * A permission represents a per-User Permission to access a
|
3040 | * specific resource e.g. Item or Container.
|
3041 | */
|
3042 | upsert(body: PermissionDefinition, options?: RequestOptions): Promise<PermissionResponse>;
|
3043 | }
|
3044 |
|
3045 | /**
|
3046 | * Plugins allow you to customize the behavior of the SDk with additional logging, retry, or additional functionality.
|
3047 | *
|
3048 | * A plugin is a function which returns a `Promise<Response<T>>`, and is passed a RequestContext and Next object.
|
3049 | *
|
3050 | * Next is a function which takes in requestContext returns a promise. You must await/then that promise which will contain the response from further plugins,
|
3051 | * allowing you to log those results or handle errors.
|
3052 | *
|
3053 | * RequestContext is an object which controls what operation is happening, against which endpoint, and more. Modifying this and passing it along via next is how
|
3054 | * you modify future SDK behavior.
|
3055 | *
|
3056 | * @hidden
|
3057 | */
|
3058 | export declare type Plugin<T> = (context: RequestContext, diagnosticNode: DiagnosticNodeInternal, next: Next<T>) => Promise<Response_2<T>>;
|
3059 |
|
3060 | /**
|
3061 | * Specifies which event to run for the specified plugin
|
3062 | *
|
3063 | * @hidden
|
3064 | */
|
3065 | export declare interface PluginConfig {
|
3066 | /**
|
3067 | * The event to run the plugin on
|
3068 | */
|
3069 | on: keyof typeof PluginOn;
|
3070 | /**
|
3071 | * The plugin to run
|
3072 | */
|
3073 | plugin: Plugin<any>;
|
3074 | }
|
3075 |
|
3076 | /**
|
3077 | * Used to specify which type of events to execute this plug in on.
|
3078 | *
|
3079 | * @hidden
|
3080 | */
|
3081 | export declare enum PluginOn {
|
3082 | /**
|
3083 | * Will be executed per network request
|
3084 | */
|
3085 | request = "request",
|
3086 | /**
|
3087 | * Will be executed per API operation
|
3088 | */
|
3089 | operation = "operation"
|
3090 | }
|
3091 |
|
3092 | /**
|
3093 | * A primitive Partition Key value.
|
3094 | */
|
3095 | export declare type PrimitivePartitionKeyValue = string | number | boolean | NullPartitionKeyType | NonePartitionKeyType;
|
3096 |
|
3097 | /**
|
3098 | * Represents Priority Level associated with each Azure Cosmos DB client requests.<br>
|
3099 | * The Low priority requests are always throttled before any High priority requests.
|
3100 | *
|
3101 | * By default all requests are considered as High priority requests.
|
3102 | *
|
3103 | * See https://aka.ms/CosmosDB/PriorityBasedExecution for more detailed documentation on Priority based throttling.
|
3104 | */
|
3105 | export declare enum PriorityLevel {
|
3106 | /**
|
3107 | * High Priority requests are throttled after Low priority requests.
|
3108 | */
|
3109 | High = "High",
|
3110 | /**
|
3111 | * Low Priority requests are throttled before High priority requests.
|
3112 | */
|
3113 | Low = "Low"
|
3114 | }
|
3115 |
|
3116 | /**
|
3117 | * @hidden
|
3118 | */
|
3119 | export declare interface QueryInfo {
|
3120 | top?: any;
|
3121 | orderBy?: any[];
|
3122 | orderByExpressions?: any[];
|
3123 | offset?: number;
|
3124 | limit?: number;
|
3125 | aggregates?: AggregateType[];
|
3126 | groupByExpressions?: GroupByExpressions;
|
3127 | groupByAliasToAggregateType: GroupByAliasToAggregateType;
|
3128 | rewrittenQuery?: any;
|
3129 | distinctType: string;
|
3130 | hasSelectValue: boolean;
|
3131 | /**
|
3132 | * determines whether the query is of non streaming orderby type.
|
3133 | */
|
3134 | hasNonStreamingOrderBy: boolean;
|
3135 | }
|
3136 |
|
3137 | /**
|
3138 | * Represents a QueryIterator Object, an implementation of feed or query response that enables
|
3139 | * traversal and iterating over the response
|
3140 | * in the Azure Cosmos DB database service.
|
3141 | */
|
3142 | export declare class QueryIterator<T> {
|
3143 | private clientContext;
|
3144 | private query;
|
3145 | private options;
|
3146 | private fetchFunctions;
|
3147 | private resourceLink?;
|
3148 | private resourceType?;
|
3149 | private fetchAllTempResources;
|
3150 | private fetchAllLastResHeaders;
|
3151 | private queryExecutionContext;
|
3152 | private queryPlanPromise;
|
3153 | private isInitialized;
|
3154 | private correlatedActivityId;
|
3155 | private nonStreamingOrderBy;
|
3156 | private partitionKeyRangeCache;
|
3157 | /**
|
3158 | * @hidden
|
3159 | */
|
3160 | constructor(clientContext: ClientContext, query: SqlQuerySpec | string, options: FeedOptions, fetchFunctions: FetchFunctionCallback | FetchFunctionCallback[], resourceLink?: string, resourceType?: ResourceType);
|
3161 | /**
|
3162 | * Gets an async iterator that will yield results until completion.
|
3163 | *
|
3164 | * NOTE: AsyncIterators are a very new feature and you might need to
|
3165 | * use polyfils/etc. in order to use them in your code.
|
3166 | *
|
3167 | * If you're using TypeScript, you can use the following polyfill as long
|
3168 | * as you target ES6 or higher and are running on Node 6 or higher.
|
3169 | *
|
3170 | * ```typescript
|
3171 | * if (!Symbol || !Symbol.asyncIterator) {
|
3172 | * (Symbol as any).asyncIterator = Symbol.for("Symbol.asyncIterator");
|
3173 | * }
|
3174 | * ```
|
3175 | *
|
3176 | * @example Iterate over all databases
|
3177 | * ```typescript
|
3178 | * for await(const { resources: db } of client.databases.readAll().getAsyncIterator()) {
|
3179 | * console.log(`Got ${db} from AsyncIterator`);
|
3180 | * }
|
3181 | * ```
|
3182 | */
|
3183 | getAsyncIterator(): AsyncIterable<FeedResponse<T>>;
|
3184 | /**
|
3185 | * Determine if there are still remaining resources to process based on the value of the continuation token or the
|
3186 | * elements remaining on the current batch in the QueryIterator.
|
3187 | * @returns true if there is other elements to process in the QueryIterator.
|
3188 | */
|
3189 | hasMoreResults(): boolean;
|
3190 | /**
|
3191 | * Fetch all pages for the query and return a single FeedResponse.
|
3192 | */
|
3193 | fetchAll(): Promise<FeedResponse<T>>;
|
3194 | /**
|
3195 | * @hidden
|
3196 | */
|
3197 | fetchAllInternal(diagnosticNode: DiagnosticNodeInternal): Promise<FeedResponse<T>>;
|
3198 | /**
|
3199 | * Retrieve the next batch from the feed.
|
3200 | *
|
3201 | * This may or may not fetch more pages from the backend depending on your settings
|
3202 | * and the type of query. Aggregate queries will generally fetch all backend pages
|
3203 | * before returning the first batch of responses.
|
3204 | */
|
3205 | fetchNext(): Promise<FeedResponse<T>>;
|
3206 | /**
|
3207 | * Reset the QueryIterator to the beginning and clear all the resources inside it
|
3208 | */
|
3209 | reset(): void;
|
3210 | private toArrayImplementation;
|
3211 | private createExecutionContext;
|
3212 | private createHybridQueryExecutionContext;
|
3213 | private createPipelinedExecutionContext;
|
3214 | private fetchQueryPlan;
|
3215 | private needsQueryPlan;
|
3216 | private initPromise;
|
3217 | private init;
|
3218 | private _init;
|
3219 | private handleSplitError;
|
3220 | }
|
3221 |
|
3222 | export declare class QueryMetrics {
|
3223 | readonly retrievedDocumentCount: number;
|
3224 | readonly retrievedDocumentSize: number;
|
3225 | readonly outputDocumentCount: number;
|
3226 | readonly outputDocumentSize: number;
|
3227 | readonly indexHitDocumentCount: number;
|
3228 | readonly totalQueryExecutionTime: TimeSpan;
|
3229 | readonly queryPreparationTimes: QueryPreparationTimes;
|
3230 | readonly indexLookupTime: TimeSpan;
|
3231 | readonly documentLoadTime: TimeSpan;
|
3232 | readonly vmExecutionTime: TimeSpan;
|
3233 | readonly runtimeExecutionTimes: RuntimeExecutionTimes;
|
3234 | readonly documentWriteTime: TimeSpan;
|
3235 | readonly clientSideMetrics: ClientSideMetrics;
|
3236 | constructor(retrievedDocumentCount: number, retrievedDocumentSize: number, outputDocumentCount: number, outputDocumentSize: number, indexHitDocumentCount: number, totalQueryExecutionTime: TimeSpan, queryPreparationTimes: QueryPreparationTimes, indexLookupTime: TimeSpan, documentLoadTime: TimeSpan, vmExecutionTime: TimeSpan, runtimeExecutionTimes: RuntimeExecutionTimes, documentWriteTime: TimeSpan, clientSideMetrics: ClientSideMetrics);
|
3237 | /**
|
3238 | * Gets the IndexHitRatio
|
3239 | * @hidden
|
3240 | */
|
3241 | get indexHitRatio(): number;
|
3242 | /**
|
3243 | * returns a new QueryMetrics instance that is the addition of this and the arguments.
|
3244 | */
|
3245 | add(queryMetricsArray: QueryMetrics[]): QueryMetrics;
|
3246 | /**
|
3247 | * Output the QueryMetrics as a delimited string.
|
3248 | * @hidden
|
3249 | */
|
3250 | toDelimitedString(): string;
|
3251 | static readonly zero: QueryMetrics;
|
3252 | /**
|
3253 | * Returns a new instance of the QueryMetrics class that is the aggregation of an array of query metrics.
|
3254 | */
|
3255 | static createFromArray(queryMetricsArray: QueryMetrics[]): QueryMetrics;
|
3256 | /**
|
3257 | * Returns a new instance of the QueryMetrics class this is deserialized from a delimited string.
|
3258 | */
|
3259 | static createFromDelimitedString(delimitedString: string, clientSideMetrics?: ClientSideMetrics): QueryMetrics;
|
3260 | }
|
3261 |
|
3262 | export declare const QueryMetricsConstants: {
|
3263 | RetrievedDocumentCount: string;
|
3264 | RetrievedDocumentSize: string;
|
3265 | OutputDocumentCount: string;
|
3266 | OutputDocumentSize: string;
|
3267 | IndexHitRatio: string;
|
3268 | IndexHitDocumentCount: string;
|
3269 | TotalQueryExecutionTimeInMs: string;
|
3270 | QueryCompileTimeInMs: string;
|
3271 | LogicalPlanBuildTimeInMs: string;
|
3272 | PhysicalPlanBuildTimeInMs: string;
|
3273 | QueryOptimizationTimeInMs: string;
|
3274 | IndexLookupTimeInMs: string;
|
3275 | DocumentLoadTimeInMs: string;
|
3276 | VMExecutionTimeInMs: string;
|
3277 | DocumentWriteTimeInMs: string;
|
3278 | QueryEngineTimes: string;
|
3279 | SystemFunctionExecuteTimeInMs: string;
|
3280 | UserDefinedFunctionExecutionTimeInMs: string;
|
3281 | RetrievedDocumentCountText: string;
|
3282 | RetrievedDocumentSizeText: string;
|
3283 | OutputDocumentCountText: string;
|
3284 | OutputDocumentSizeText: string;
|
3285 | IndexUtilizationText: string;
|
3286 | TotalQueryExecutionTimeText: string;
|
3287 | QueryPreparationTimesText: string;
|
3288 | QueryCompileTimeText: string;
|
3289 | LogicalPlanBuildTimeText: string;
|
3290 | PhysicalPlanBuildTimeText: string;
|
3291 | QueryOptimizationTimeText: string;
|
3292 | QueryEngineTimesText: string;
|
3293 | IndexLookupTimeText: string;
|
3294 | DocumentLoadTimeText: string;
|
3295 | WriteOutputTimeText: string;
|
3296 | RuntimeExecutionTimesText: string;
|
3297 | TotalExecutionTimeText: string;
|
3298 | SystemFunctionExecuteTimeText: string;
|
3299 | UserDefinedFunctionExecutionTimeText: string;
|
3300 | ClientSideQueryMetricsText: string;
|
3301 | RetriesText: string;
|
3302 | RequestChargeText: string;
|
3303 | FetchExecutionRangesText: string;
|
3304 | SchedulingMetricsText: string;
|
3305 | };
|
3306 |
|
3307 | export declare class QueryPreparationTimes {
|
3308 | readonly queryCompilationTime: TimeSpan;
|
3309 | readonly logicalPlanBuildTime: TimeSpan;
|
3310 | readonly physicalPlanBuildTime: TimeSpan;
|
3311 | readonly queryOptimizationTime: TimeSpan;
|
3312 | constructor(queryCompilationTime: TimeSpan, logicalPlanBuildTime: TimeSpan, physicalPlanBuildTime: TimeSpan, queryOptimizationTime: TimeSpan);
|
3313 | /**
|
3314 | * returns a new QueryPreparationTimes instance that is the addition of this and the arguments.
|
3315 | */
|
3316 | add(...queryPreparationTimesArray: QueryPreparationTimes[]): QueryPreparationTimes;
|
3317 | /**
|
3318 | * Output the QueryPreparationTimes as a delimited string.
|
3319 | */
|
3320 | toDelimitedString(): string;
|
3321 | static readonly zero: QueryPreparationTimes;
|
3322 | /**
|
3323 | * Returns a new instance of the QueryPreparationTimes class that is the
|
3324 | * aggregation of an array of QueryPreparationTimes.
|
3325 | */
|
3326 | static createFromArray(queryPreparationTimesArray: QueryPreparationTimes[]): QueryPreparationTimes;
|
3327 | /**
|
3328 | * Returns a new instance of the QueryPreparationTimes class this is deserialized from a delimited string.
|
3329 | */
|
3330 | static createFromDelimitedString(delimitedString: string): QueryPreparationTimes;
|
3331 | }
|
3332 |
|
3333 | /**
|
3334 | * @hidden
|
3335 | */
|
3336 | export declare interface QueryRange {
|
3337 | min: string;
|
3338 | max: string;
|
3339 | isMinInclusive: boolean;
|
3340 | isMaxInclusive: boolean;
|
3341 | }
|
3342 |
|
3343 | export declare type ReadOperation = OperationBase & {
|
3344 | operationType: typeof BulkOperationType.Read;
|
3345 | id: string;
|
3346 | };
|
3347 |
|
3348 | export declare interface ReadOperationInput {
|
3349 | partitionKey?: PartitionKey;
|
3350 | operationType: typeof BulkOperationType.Read;
|
3351 | id: string;
|
3352 | }
|
3353 |
|
3354 | export declare type RemoveOperation = {
|
3355 | op: "remove";
|
3356 | path: string;
|
3357 | };
|
3358 |
|
3359 | export declare type ReplaceOperation = OperationWithItem & {
|
3360 | operationType: typeof BulkOperationType.Replace;
|
3361 | id: string;
|
3362 | };
|
3363 |
|
3364 | export declare interface ReplaceOperationInput {
|
3365 | partitionKey?: PartitionKey;
|
3366 | ifMatch?: string;
|
3367 | ifNoneMatch?: string;
|
3368 | operationType: typeof BulkOperationType.Replace;
|
3369 | resourceBody: JSONObject;
|
3370 | id: string;
|
3371 | }
|
3372 |
|
3373 | /**
|
3374 | * @hidden
|
3375 | */
|
3376 | export declare interface RequestContext {
|
3377 | path?: string;
|
3378 | operationType?: OperationType;
|
3379 | client?: ClientContext;
|
3380 | retryCount?: number;
|
3381 | resourceType?: ResourceType;
|
3382 | resourceId?: string;
|
3383 | globalEndpointManager: GlobalEndpointManager;
|
3384 | connectionPolicy: ConnectionPolicy;
|
3385 | requestAgent: Agent;
|
3386 | body?: any;
|
3387 | headers?: CosmosHeaders_2;
|
3388 | endpoint?: string;
|
3389 | method: HTTPMethod;
|
3390 | partitionKeyRangeId?: string;
|
3391 | options: FeedOptions | RequestOptions;
|
3392 | plugins: PluginConfig[];
|
3393 | partitionKey?: PartitionKey;
|
3394 | pipeline?: Pipeline;
|
3395 | httpClient?: HttpClient;
|
3396 | }
|
3397 |
|
3398 | /** @hidden */
|
3399 | export declare interface RequestInfo {
|
3400 | verb: HTTPMethod;
|
3401 | path: string;
|
3402 | resourceId: string;
|
3403 | resourceType: ResourceType;
|
3404 | headers: CosmosHeaders;
|
3405 | }
|
3406 |
|
3407 | /**
|
3408 | * Options that can be specified for a requested issued to the Azure Cosmos DB servers.=
|
3409 | */
|
3410 | export declare interface RequestOptions extends SharedOptions {
|
3411 | /** Conditions Associated with the request. */
|
3412 | accessCondition?: {
|
3413 | /** Conditional HTTP method header type (IfMatch or IfNoneMatch). */
|
3414 | type: string;
|
3415 | /** Conditional HTTP method header value (the _etag field from the last version you read). */
|
3416 | condition: string;
|
3417 | };
|
3418 | /** Consistency level required by the client. */
|
3419 | consistencyLevel?: string;
|
3420 | /**
|
3421 | * DisableRUPerMinuteUsage is used to enable/disable Request Units(RUs)/minute capacity
|
3422 | * to serve the request if regular provisioned RUs/second is exhausted.
|
3423 | */
|
3424 | disableRUPerMinuteUsage?: boolean;
|
3425 | /** Enables or disables logging in JavaScript stored procedures. */
|
3426 | enableScriptLogging?: boolean;
|
3427 | /** Specifies indexing directives (index, do not index .. etc). */
|
3428 | indexingDirective?: string;
|
3429 | /** The offer throughput provisioned for a container in measurement of Requests-per-Unit. */
|
3430 | offerThroughput?: number;
|
3431 | /**
|
3432 | * Offer type when creating document containers.
|
3433 | *
|
3434 | * This option is only valid when creating a document container.
|
3435 | */
|
3436 | offerType?: string;
|
3437 | /** Enables/disables getting document container quota related stats for document container read requests. */
|
3438 | populateQuotaInfo?: boolean;
|
3439 | /** Indicates what is the post trigger to be invoked after the operation. */
|
3440 | postTriggerInclude?: string | string[];
|
3441 | /** Indicates what is the pre trigger to be invoked before the operation. */
|
3442 | preTriggerInclude?: string | string[];
|
3443 | /** Expiry time (in seconds) for resource token associated with permission (applicable only for requests on permissions). */
|
3444 | resourceTokenExpirySeconds?: number;
|
3445 | /** (Advanced use case) The url to connect to. */
|
3446 | urlConnection?: string;
|
3447 | /** Disable automatic id generation (will cause creates to fail if id isn't on the definition) */
|
3448 | disableAutomaticIdGeneration?: boolean;
|
3449 | }
|
3450 |
|
3451 | export declare interface Resource {
|
3452 | /** Required. User settable property. Unique name that identifies the item, that is, no two items share the same ID within a database. The id must not exceed 255 characters. */
|
3453 | id: string;
|
3454 | /** System generated property. The resource ID (_rid) is a unique identifier that is also hierarchical per the resource stack on the resource model. It is used internally for placement and navigation of the item resource. */
|
3455 | _rid: string;
|
3456 | /** System generated property. Specifies the last updated timestamp of the resource. The value is a timestamp. */
|
3457 | _ts: number;
|
3458 | /** System generated property. The unique addressable URI for the resource. */
|
3459 | _self: string;
|
3460 | /** System generated property. Represents the resource etag required for optimistic concurrency control. */
|
3461 | _etag: string;
|
3462 | }
|
3463 |
|
3464 | export declare class ResourceResponse<TResource> {
|
3465 | readonly resource: TResource | undefined;
|
3466 | readonly headers: CosmosHeaders_2;
|
3467 | readonly statusCode: StatusCode;
|
3468 | readonly diagnostics: CosmosDiagnostics;
|
3469 | readonly substatus?: SubStatusCode;
|
3470 | constructor(resource: TResource | undefined, headers: CosmosHeaders_2, statusCode: StatusCode, diagnostics: CosmosDiagnostics, substatus?: SubStatusCode);
|
3471 | get requestCharge(): number;
|
3472 | get activityId(): string;
|
3473 | get etag(): string;
|
3474 | }
|
3475 |
|
3476 | /**
|
3477 | * @hidden
|
3478 | */
|
3479 | export declare enum ResourceType {
|
3480 | none = "",
|
3481 | database = "dbs",
|
3482 | offer = "offers",
|
3483 | user = "users",
|
3484 | permission = "permissions",
|
3485 | container = "colls",
|
3486 | conflicts = "conflicts",
|
3487 | sproc = "sprocs",
|
3488 | udf = "udfs",
|
3489 | trigger = "triggers",
|
3490 | item = "docs",
|
3491 | pkranges = "pkranges",
|
3492 | partitionkey = "partitionKey"
|
3493 | }
|
3494 |
|
3495 | /**
|
3496 | * @hidden
|
3497 | */
|
3498 | declare interface Response_2<T> {
|
3499 | headers: CosmosHeaders;
|
3500 | result?: T;
|
3501 | code?: number;
|
3502 | substatus?: number;
|
3503 | diagnostics?: CosmosDiagnostics;
|
3504 | }
|
3505 | export { Response_2 as Response }
|
3506 |
|
3507 | export { RestError }
|
3508 |
|
3509 | /**
|
3510 | * This type captures diagnostic information regarding retries attempt during an CosmosDB client operation.
|
3511 | */
|
3512 | export declare type RetryDiagnostics = {
|
3513 | failedAttempts: FailedRequestAttemptDiagnostic[];
|
3514 | };
|
3515 |
|
3516 | /**
|
3517 | * Represents the Retry policy assocated with throttled requests in the Azure Cosmos DB database service.
|
3518 | */
|
3519 | export declare interface RetryOptions {
|
3520 | /** Max number of retries to be performed for a request. Default value 9. */
|
3521 | maxRetryAttemptCount: number;
|
3522 | /** Fixed retry interval in milliseconds to wait between each retry ignoring the retryAfter returned as part of the response. */
|
3523 | fixedRetryIntervalInMilliseconds: number;
|
3524 | /** Max wait time in seconds to wait for a request while the retries are happening. Default value 30 seconds. */
|
3525 | maxWaitTimeInSeconds: number;
|
3526 | }
|
3527 |
|
3528 | export declare class RuntimeExecutionTimes {
|
3529 | readonly queryEngineExecutionTime: TimeSpan;
|
3530 | readonly systemFunctionExecutionTime: TimeSpan;
|
3531 | readonly userDefinedFunctionExecutionTime: TimeSpan;
|
3532 | constructor(queryEngineExecutionTime: TimeSpan, systemFunctionExecutionTime: TimeSpan, userDefinedFunctionExecutionTime: TimeSpan);
|
3533 | /**
|
3534 | * returns a new RuntimeExecutionTimes instance that is the addition of this and the arguments.
|
3535 | */
|
3536 | add(...runtimeExecutionTimesArray: RuntimeExecutionTimes[]): RuntimeExecutionTimes;
|
3537 | /**
|
3538 | * Output the RuntimeExecutionTimes as a delimited string.
|
3539 | */
|
3540 | toDelimitedString(): string;
|
3541 | static readonly zero: RuntimeExecutionTimes;
|
3542 | /**
|
3543 | * Returns a new instance of the RuntimeExecutionTimes class that is
|
3544 | * the aggregation of an array of RuntimeExecutionTimes.
|
3545 | */
|
3546 | static createFromArray(runtimeExecutionTimesArray: RuntimeExecutionTimes[]): RuntimeExecutionTimes;
|
3547 | /**
|
3548 | * Returns a new instance of the RuntimeExecutionTimes class this is deserialized from a delimited string.
|
3549 | */
|
3550 | static createFromDelimitedString(delimitedString: string): RuntimeExecutionTimes;
|
3551 | }
|
3552 |
|
3553 | /**
|
3554 | * @hidden
|
3555 | */
|
3556 | export declare enum SasTokenPermissionKind {
|
3557 | ContainerCreateItems = 1,
|
3558 | ContainerReplaceItems = 2,
|
3559 | ContainerUpsertItems = 4,
|
3560 | ContainerDeleteItems = 128,
|
3561 | ContainerExecuteQueries = 1,
|
3562 | ContainerReadFeeds = 2,
|
3563 | ContainerCreateStoreProcedure = 16,
|
3564 | ContainerReadStoreProcedure = 4,
|
3565 | ContainerReplaceStoreProcedure = 32,
|
3566 | ContainerDeleteStoreProcedure = 64,
|
3567 | ContainerCreateTriggers = 256,
|
3568 | ContainerReadTriggers = 16,
|
3569 | ContainerReplaceTriggers = 512,
|
3570 | ContainerDeleteTriggers = 1024,
|
3571 | ContainerCreateUserDefinedFunctions = 2048,
|
3572 | ContainerReadUserDefinedFunctions = 8,
|
3573 | ContainerReplaceUserDefinedFunctions = 4096,
|
3574 | ContainerDeleteUserDefinedFunctions = 8192,
|
3575 | ContainerExecuteStoredProcedure = 128,
|
3576 | ContainerReadConflicts = 32,
|
3577 | ContainerDeleteConflicts = 16384,
|
3578 | ContainerReadAny = 64,
|
3579 | ContainerFullAccess = 4294967295,
|
3580 | ItemReadAny = 65536,
|
3581 | ItemFullAccess = 65,
|
3582 | ItemRead = 64,
|
3583 | ItemReplace = 65536,
|
3584 | ItemUpsert = 131072,
|
3585 | ItemDelete = 262144,
|
3586 | StoreProcedureRead = 128,
|
3587 | StoreProcedureReplace = 1048576,
|
3588 | StoreProcedureDelete = 2097152,
|
3589 | StoreProcedureExecute = 4194304,
|
3590 | UserDefinedFuntionRead = 256,
|
3591 | UserDefinedFuntionReplace = 8388608,
|
3592 | UserDefinedFuntionDelete = 16777216,
|
3593 | TriggerRead = 512,
|
3594 | TriggerReplace = 33554432,
|
3595 | TriggerDelete = 67108864
|
3596 | }
|
3597 |
|
3598 | export declare class SasTokenProperties {
|
3599 | user: string;
|
3600 | userTag: string;
|
3601 | databaseName: string;
|
3602 | containerName: string;
|
3603 | resourceName: string;
|
3604 | resourcePath: string;
|
3605 | resourceKind: CosmosContainerChildResourceKind;
|
3606 | partitionKeyValueRanges: string[];
|
3607 | startTime: Date;
|
3608 | expiryTime: Date;
|
3609 | keyType: CosmosKeyType | number;
|
3610 | controlPlaneReaderScope: number;
|
3611 | controlPlaneWriterScope: number;
|
3612 | dataPlaneReaderScope: number;
|
3613 | dataPlaneWriterScope: number;
|
3614 | cosmosContainerChildResourceKind: CosmosContainerChildResourceKind;
|
3615 | cosmosKeyType: CosmosKeyType;
|
3616 | }
|
3617 |
|
3618 | export declare class Scripts {
|
3619 | readonly container: Container;
|
3620 | private readonly clientContext;
|
3621 | /**
|
3622 | * @param container - The parent {@link Container}.
|
3623 | * @hidden
|
3624 | */
|
3625 | constructor(container: Container, clientContext: ClientContext);
|
3626 | /**
|
3627 | * Used to read, replace, or delete a specific, existing {@link StoredProcedure} by id.
|
3628 | *
|
3629 | * Use `.storedProcedures` for creating new stored procedures, or querying/reading all stored procedures.
|
3630 | * @param id - The id of the {@link StoredProcedure}.
|
3631 | */
|
3632 | storedProcedure(id: string): StoredProcedure;
|
3633 | /**
|
3634 | * Used to read, replace, or delete a specific, existing {@link Trigger} by id.
|
3635 | *
|
3636 | * Use `.triggers` for creating new triggers, or querying/reading all triggers.
|
3637 | * @param id - The id of the {@link Trigger}.
|
3638 | */
|
3639 | trigger(id: string): Trigger;
|
3640 | /**
|
3641 | * Used to read, replace, or delete a specific, existing {@link UserDefinedFunction} by id.
|
3642 | *
|
3643 | * Use `.userDefinedFunctions` for creating new user defined functions, or querying/reading all user defined functions.
|
3644 | * @param id - The id of the {@link UserDefinedFunction}.
|
3645 | */
|
3646 | userDefinedFunction(id: string): UserDefinedFunction;
|
3647 | private $sprocs;
|
3648 | /**
|
3649 | * Operations for creating new stored procedures, and reading/querying all stored procedures.
|
3650 | *
|
3651 | * For reading, replacing, or deleting an existing stored procedure, use `.storedProcedure(id)`.
|
3652 | */
|
3653 | get storedProcedures(): StoredProcedures;
|
3654 | private $triggers;
|
3655 | /**
|
3656 | * Operations for creating new triggers, and reading/querying all triggers.
|
3657 | *
|
3658 | * For reading, replacing, or deleting an existing trigger, use `.trigger(id)`.
|
3659 | */
|
3660 | get triggers(): Triggers;
|
3661 | private $udfs;
|
3662 | /**
|
3663 | * Operations for creating new user defined functions, and reading/querying all user defined functions.
|
3664 | *
|
3665 | * For reading, replacing, or deleting an existing user defined function, use `.userDefinedFunction(id)`.
|
3666 | */
|
3667 | get userDefinedFunctions(): UserDefinedFunctions;
|
3668 | }
|
3669 |
|
3670 | /**
|
3671 | * The default function for setting header token using the masterKey
|
3672 | * @hidden
|
3673 | */
|
3674 | export declare function setAuthorizationTokenHeaderUsingMasterKey(verb: HTTPMethod, resourceId: string, resourceType: ResourceType, headers: CosmosHeaders, masterKey: string): Promise<void>;
|
3675 |
|
3676 | /**
|
3677 | * Options that can be specified for a requested issued to the Azure Cosmos DB servers.=
|
3678 | */
|
3679 | export declare interface SharedOptions {
|
3680 | /** Enables/disables getting document container quota related stats for document container read requests. */
|
3681 | sessionToken?: string;
|
3682 | /** (Advanced use case) Initial headers to start with when sending requests to Cosmos */
|
3683 | initialHeaders?: CosmosHeaders;
|
3684 | /**
|
3685 | * abortSignal to pass to all underlying network requests created by this method call. See https://developer.mozilla.org/en-US/docs/Web/API/AbortController
|
3686 | * @example Cancel a read request
|
3687 | * ```typescript
|
3688 | * const controller = new AbortController()
|
3689 | * const {result: item} = await items.query('SELECT * from c', { abortSignal: controller.signal});
|
3690 | * controller.abort()
|
3691 | * ```
|
3692 | */
|
3693 | abortSignal?: AbortSignal;
|
3694 | /**
|
3695 | * Sets the staleness value associated with the request in the Azure CosmosDB service. For requests where the {@link
|
3696 | * com.azure.cosmos.ConsistencyLevel} is {@link com.azure.cosmos.ConsistencyLevel#EVENTUAL} or {@link com.azure.cosmos.ConsistencyLevel#SESSION}, responses from the
|
3697 | * integrated cache are guaranteed to be no staler than value indicated by this maxIntegratedCacheStaleness. When the
|
3698 | * consistency level is not set, this property is ignored.
|
3699 | *
|
3700 | * <p>Default value is null</p>
|
3701 | *
|
3702 | * <p>Cache Staleness is supported in milliseconds granularity. Anything smaller than milliseconds will be ignored.</p>
|
3703 | */
|
3704 | maxIntegratedCacheStalenessInMs?: number;
|
3705 | /**
|
3706 | * Sets if integrated cache should be bypassed or enabled for the request in Azure CosmosDB service.
|
3707 | *
|
3708 | * <p>Default value is false. By default integrated cache is enabled</p>
|
3709 | */
|
3710 | bypassIntegratedCache?: boolean;
|
3711 | /**
|
3712 | * Priority Level (Low/High) for each request.
|
3713 | * Low priority requests are always throttled before any high priority requests.
|
3714 | *
|
3715 | * <p>Default value is null. By default all requests are of High priority</p>
|
3716 | */
|
3717 | priorityLevel?: PriorityLevel;
|
3718 | }
|
3719 |
|
3720 | export declare interface SpatialIndex {
|
3721 | path: string;
|
3722 | types: SpatialType[];
|
3723 | boundingBox: {
|
3724 | xmin: number;
|
3725 | ymin: number;
|
3726 | xmax: number;
|
3727 | ymax: number;
|
3728 | };
|
3729 | }
|
3730 |
|
3731 | export declare enum SpatialType {
|
3732 | LineString = "LineString",
|
3733 | MultiPolygon = "MultiPolygon",
|
3734 | Point = "Point",
|
3735 | Polygon = "Polygon"
|
3736 | }
|
3737 |
|
3738 | /**
|
3739 | * Represents a parameter in a Parameterized SQL query, specified in {@link SqlQuerySpec}
|
3740 | */
|
3741 | export declare interface SqlParameter {
|
3742 | /** Name of the parameter. (i.e. `@lastName`) */
|
3743 | name: string;
|
3744 | /** Value of the parameter (this is safe to come from users, assuming they are authorized) */
|
3745 | value: JSONValue;
|
3746 | }
|
3747 |
|
3748 | /**
|
3749 | * Represents a SQL query in the Azure Cosmos DB service.
|
3750 | *
|
3751 | * Queries with inputs should be parameterized to protect against SQL injection.
|
3752 | *
|
3753 | * @example Parameterized SQL Query
|
3754 | * ```typescript
|
3755 | * const query: SqlQuerySpec = {
|
3756 | * query: "SELECT * FROM Families f where f.lastName = @lastName",
|
3757 | * parameters: [
|
3758 | * {name: "@lastName", value: "Wakefield"}
|
3759 | * ]
|
3760 | * };
|
3761 | * ```
|
3762 | */
|
3763 | export declare interface SqlQuerySpec {
|
3764 | /** The text of the SQL query */
|
3765 | query: string;
|
3766 | /** The parameters you provide in the query */
|
3767 | parameters?: SqlParameter[];
|
3768 | }
|
3769 |
|
3770 | /**
|
3771 | * @hidden
|
3772 | */
|
3773 | export declare type StatusCode = number;
|
3774 |
|
3775 | /**
|
3776 | * @hidden
|
3777 | */
|
3778 | export declare const StatusCodes: StatusCodesType;
|
3779 |
|
3780 | /**
|
3781 | * @hidden
|
3782 | */
|
3783 | export declare interface StatusCodesType {
|
3784 | Ok: 200;
|
3785 | Created: 201;
|
3786 | Accepted: 202;
|
3787 | NoContent: 204;
|
3788 | NotModified: 304;
|
3789 | BadRequest: 400;
|
3790 | Unauthorized: 401;
|
3791 | Forbidden: 403;
|
3792 | NotFound: 404;
|
3793 | MethodNotAllowed: 405;
|
3794 | RequestTimeout: 408;
|
3795 | Conflict: 409;
|
3796 | Gone: 410;
|
3797 | PreconditionFailed: 412;
|
3798 | RequestEntityTooLarge: 413;
|
3799 | TooManyRequests: 429;
|
3800 | RetryWith: 449;
|
3801 | InternalServerError: 500;
|
3802 | ServiceUnavailable: 503;
|
3803 | ENOTFOUND: "ENOTFOUND";
|
3804 | OperationPaused: 1200;
|
3805 | OperationCancelled: 1201;
|
3806 | }
|
3807 |
|
3808 | /**
|
3809 | * Operations for reading, replacing, deleting, or executing a specific, existing stored procedure by id.
|
3810 | *
|
3811 | * For operations to create, read all, or query Stored Procedures,
|
3812 | */
|
3813 | export declare class StoredProcedure {
|
3814 | readonly container: Container;
|
3815 | readonly id: string;
|
3816 | private readonly clientContext;
|
3817 | /**
|
3818 | * Returns a reference URL to the resource. Used for linking in Permissions.
|
3819 | */
|
3820 | get url(): string;
|
3821 | /**
|
3822 | * Creates a new instance of {@link StoredProcedure} linked to the parent {@link Container}.
|
3823 | * @param container - The parent {@link Container}.
|
3824 | * @param id - The id of the given {@link StoredProcedure}.
|
3825 | * @hidden
|
3826 | */
|
3827 | constructor(container: Container, id: string, clientContext: ClientContext);
|
3828 | /**
|
3829 | * Read the {@link StoredProcedureDefinition} for the given {@link StoredProcedure}.
|
3830 | */
|
3831 | read(options?: RequestOptions): Promise<StoredProcedureResponse>;
|
3832 | /**
|
3833 | * Replace the given {@link StoredProcedure} with the specified {@link StoredProcedureDefinition}.
|
3834 | * @param body - The specified {@link StoredProcedureDefinition} to replace the existing definition.
|
3835 | */
|
3836 | replace(body: StoredProcedureDefinition, options?: RequestOptions): Promise<StoredProcedureResponse>;
|
3837 | /**
|
3838 | * Delete the given {@link StoredProcedure}.
|
3839 | */
|
3840 | delete(options?: RequestOptions): Promise<StoredProcedureResponse>;
|
3841 | /**
|
3842 | * Execute the given {@link StoredProcedure}.
|
3843 | *
|
3844 | * The specified type, T, is not enforced by the client.
|
3845 | * Be sure to validate the response from the stored procedure matches the type, T, you provide.
|
3846 | *
|
3847 | * @param partitionKey - The partition key to use when executing the stored procedure
|
3848 | * @param params - Array of parameters to pass as arguments to the given {@link StoredProcedure}.
|
3849 | * @param options - Additional options, such as the partition key to invoke the {@link StoredProcedure} on.
|
3850 | */
|
3851 | execute<T = any>(partitionKey: PartitionKey, params?: any[], options?: RequestOptions): Promise<ResourceResponse<T>>;
|
3852 | }
|
3853 |
|
3854 | export declare interface StoredProcedureDefinition {
|
3855 | /**
|
3856 | * The id of the {@link StoredProcedure}.
|
3857 | */
|
3858 | id?: string;
|
3859 | /**
|
3860 | * The body of the {@link StoredProcedure}. This is a JavaScript function.
|
3861 | */
|
3862 | body?: string | ((...inputs: any[]) => void);
|
3863 | }
|
3864 |
|
3865 | export declare class StoredProcedureResponse extends ResourceResponse<StoredProcedureDefinition & Resource> {
|
3866 | constructor(resource: StoredProcedureDefinition & Resource, headers: CosmosHeaders, statusCode: number, storedProcedure: StoredProcedure, diagnostics: CosmosDiagnostics);
|
3867 | /**
|
3868 | * A reference to the {@link StoredProcedure} which the {@link StoredProcedureDefinition} corresponds to.
|
3869 | */
|
3870 | readonly storedProcedure: StoredProcedure;
|
3871 | /**
|
3872 | * Alias for storedProcedure.
|
3873 | *
|
3874 | * A reference to the {@link StoredProcedure} which the {@link StoredProcedureDefinition} corresponds to.
|
3875 | */
|
3876 | get sproc(): StoredProcedure;
|
3877 | }
|
3878 |
|
3879 | /**
|
3880 | * Operations for creating, upserting, or reading/querying all Stored Procedures.
|
3881 | *
|
3882 | * For operations to read, replace, delete, or execute a specific, existing stored procedure by id, see `container.storedProcedure()`.
|
3883 | */
|
3884 | export declare class StoredProcedures {
|
3885 | readonly container: Container;
|
3886 | private readonly clientContext;
|
3887 | /**
|
3888 | * @param container - The parent {@link Container}.
|
3889 | * @hidden
|
3890 | */
|
3891 | constructor(container: Container, clientContext: ClientContext);
|
3892 | /**
|
3893 | * Query all Stored Procedures.
|
3894 | * @param query - Query configuration for the operation. See {@link SqlQuerySpec} for more info on how to configure a query.
|
3895 | * @example Read all stored procedures to array.
|
3896 | * ```typescript
|
3897 | * const querySpec: SqlQuerySpec = {
|
3898 | * query: "SELECT * FROM root r WHERE r.id = @sproc",
|
3899 | * parameters: [
|
3900 | * {name: "@sproc", value: "Todo"}
|
3901 | * ]
|
3902 | * };
|
3903 | * const {body: sprocList} = await containers.storedProcedures.query(querySpec).fetchAll();
|
3904 | * ```
|
3905 | */
|
3906 | query(query: SqlQuerySpec, options?: FeedOptions): QueryIterator<any>;
|
3907 | /**
|
3908 | * Query all Stored Procedures.
|
3909 | * @param query - Query configuration for the operation. See {@link SqlQuerySpec} for more info on how to configure a query.
|
3910 | * @example Read all stored procedures to array.
|
3911 | * ```typescript
|
3912 | * const querySpec: SqlQuerySpec = {
|
3913 | * query: "SELECT * FROM root r WHERE r.id = @sproc",
|
3914 | * parameters: [
|
3915 | * {name: "@sproc", value: "Todo"}
|
3916 | * ]
|
3917 | * };
|
3918 | * const {body: sprocList} = await containers.storedProcedures.query(querySpec).fetchAll();
|
3919 | * ```
|
3920 | */
|
3921 | query<T>(query: SqlQuerySpec, options?: FeedOptions): QueryIterator<T>;
|
3922 | /**
|
3923 | * Read all stored procedures.
|
3924 | * @example Read all stored procedures to array.
|
3925 | * ```typescript
|
3926 | * const {body: sprocList} = await containers.storedProcedures.readAll().fetchAll();
|
3927 | * ```
|
3928 | */
|
3929 | readAll(options?: FeedOptions): QueryIterator<StoredProcedureDefinition & Resource>;
|
3930 | /**
|
3931 | * Create a StoredProcedure.
|
3932 | *
|
3933 | * Azure Cosmos DB allows stored procedures to be executed in the storage tier,
|
3934 | * directly against an item container. The script
|
3935 | * gets executed under ACID transactions on the primary storage partition of the
|
3936 | * specified container. For additional details,
|
3937 | * refer to the server-side JavaScript API documentation.
|
3938 | */
|
3939 | create(body: StoredProcedureDefinition, options?: RequestOptions): Promise<StoredProcedureResponse>;
|
3940 | }
|
3941 |
|
3942 | /**
|
3943 | * @hidden
|
3944 | */
|
3945 | export declare type SubStatusCode = number;
|
3946 |
|
3947 | export declare class TimeoutError extends Error {
|
3948 | readonly code: string;
|
3949 | constructor(message?: string);
|
3950 | }
|
3951 |
|
3952 | /**
|
3953 | * Represents a time interval.
|
3954 | *
|
3955 | * @param days - Number of days.
|
3956 | * @param hours - Number of hours.
|
3957 | * @param minutes - Number of minutes.
|
3958 | * @param seconds - Number of seconds.
|
3959 | * @param milliseconds - Number of milliseconds.
|
3960 | * @hidden
|
3961 | */
|
3962 | export declare class TimeSpan {
|
3963 | protected _ticks: number;
|
3964 | constructor(days: number, hours: number, minutes: number, seconds: number, milliseconds: number);
|
3965 | /**
|
3966 | * Returns a new TimeSpan object whose value is the sum of the specified TimeSpan object and this instance.
|
3967 | * @param ts - The time interval to add.
|
3968 | */
|
3969 | add(ts: TimeSpan): TimeSpan;
|
3970 | /**
|
3971 | * Returns a new TimeSpan object whose value is the difference of the specified TimeSpan object and this instance.
|
3972 | * @param ts - The time interval to subtract.
|
3973 | */
|
3974 | subtract(ts: TimeSpan): TimeSpan;
|
3975 | /**
|
3976 | * Compares this instance to a specified object and returns an integer that indicates whether this
|
3977 | * instance is shorter than, equal to, or longer than the specified object.
|
3978 | * @param value - The time interval to add.
|
3979 | */
|
3980 | compareTo(value: TimeSpan): 1 | -1 | 0;
|
3981 | /**
|
3982 | * Returns a new TimeSpan object whose value is the absolute value of the current TimeSpan object.
|
3983 | */
|
3984 | duration(): TimeSpan;
|
3985 | /**
|
3986 | * Returns a value indicating whether this instance is equal to a specified object.
|
3987 | * @param value - The time interval to check for equality.
|
3988 | */
|
3989 | equals(value: TimeSpan): boolean;
|
3990 | /**
|
3991 | * Returns a new TimeSpan object whose value is the negated value of this instance.
|
3992 | * @param value - The time interval to check for equality.
|
3993 | */
|
3994 | negate(): TimeSpan;
|
3995 | days(): number;
|
3996 | hours(): number;
|
3997 | milliseconds(): number;
|
3998 | seconds(): number;
|
3999 | ticks(): number;
|
4000 | totalDays(): number;
|
4001 | totalHours(): number;
|
4002 | totalMilliseconds(): number;
|
4003 | totalMinutes(): number;
|
4004 | totalSeconds(): number;
|
4005 | static fromTicks(value: number): TimeSpan;
|
4006 | static readonly zero: TimeSpan;
|
4007 | static readonly maxValue: TimeSpan;
|
4008 | static readonly minValue: TimeSpan;
|
4009 | static isTimeSpan(timespan: TimeSpan): number;
|
4010 | static additionDoesOverflow(a: number, b: number): boolean;
|
4011 | static subtractionDoesUnderflow(a: number, b: number): boolean;
|
4012 | static compare(t1: TimeSpan, t2: TimeSpan): 1 | 0 | -1;
|
4013 | static interval(value: number, scale: number): TimeSpan;
|
4014 | static fromMilliseconds(value: number): TimeSpan;
|
4015 | static fromSeconds(value: number): TimeSpan;
|
4016 | static fromMinutes(value: number): TimeSpan;
|
4017 | static fromHours(value: number): TimeSpan;
|
4018 | static fromDays(value: number): TimeSpan;
|
4019 | }
|
4020 |
|
4021 | export declare type TokenProvider = (requestInfo: RequestInfo) => Promise<string>;
|
4022 |
|
4023 | /**
|
4024 | * Operations to read, replace, or delete a {@link Trigger}.
|
4025 | *
|
4026 | * Use `container.triggers` to create, upsert, query, or read all.
|
4027 | */
|
4028 | export declare class Trigger {
|
4029 | readonly container: Container;
|
4030 | readonly id: string;
|
4031 | private readonly clientContext;
|
4032 | /**
|
4033 | * Returns a reference URL to the resource. Used for linking in Permissions.
|
4034 | */
|
4035 | get url(): string;
|
4036 | /**
|
4037 | * @hidden
|
4038 | * @param container - The parent {@link Container}.
|
4039 | * @param id - The id of the given {@link Trigger}.
|
4040 | */
|
4041 | constructor(container: Container, id: string, clientContext: ClientContext);
|
4042 | /**
|
4043 | * Read the {@link TriggerDefinition} for the given {@link Trigger}.
|
4044 | */
|
4045 | read(options?: RequestOptions): Promise<TriggerResponse>;
|
4046 | /**
|
4047 | * Replace the given {@link Trigger} with the specified {@link TriggerDefinition}.
|
4048 | * @param body - The specified {@link TriggerDefinition} to replace the existing definition with.
|
4049 | */
|
4050 | replace(body: TriggerDefinition, options?: RequestOptions): Promise<TriggerResponse>;
|
4051 | /**
|
4052 | * Delete the given {@link Trigger}.
|
4053 | */
|
4054 | delete(options?: RequestOptions): Promise<TriggerResponse>;
|
4055 | }
|
4056 |
|
4057 | export declare interface TriggerDefinition {
|
4058 | /** The id of the trigger. */
|
4059 | id?: string;
|
4060 | /** The body of the trigger, it can also be passed as a stringifed function */
|
4061 | body: (() => void) | string;
|
4062 | /** The type of the trigger, should be one of the values of {@link TriggerType}. */
|
4063 | triggerType: TriggerType;
|
4064 | /** The trigger operation, should be one of the values of {@link TriggerOperation}. */
|
4065 | triggerOperation: TriggerOperation;
|
4066 | }
|
4067 |
|
4068 | /**
|
4069 | * Enum for trigger operation values.
|
4070 | * specifies the operations on which a trigger should be executed.
|
4071 | */
|
4072 | export declare enum TriggerOperation {
|
4073 | /** All operations. */
|
4074 | All = "all",
|
4075 | /** Create operations only. */
|
4076 | Create = "create",
|
4077 | /** Update operations only. */
|
4078 | Update = "update",
|
4079 | /** Delete operations only. */
|
4080 | Delete = "delete",
|
4081 | /** Replace operations only. */
|
4082 | Replace = "replace"
|
4083 | }
|
4084 |
|
4085 | export declare class TriggerResponse extends ResourceResponse<TriggerDefinition & Resource> {
|
4086 | constructor(resource: TriggerDefinition & Resource, headers: CosmosHeaders, statusCode: number, trigger: Trigger, diagnostics: CosmosDiagnostics);
|
4087 | /** A reference to the {@link Trigger} corresponding to the returned {@link TriggerDefinition}. */
|
4088 | readonly trigger: Trigger;
|
4089 | }
|
4090 |
|
4091 | /**
|
4092 | * Operations to create, upsert, query, and read all triggers.
|
4093 | *
|
4094 | * Use `container.triggers` to read, replace, or delete a {@link Trigger}.
|
4095 | */
|
4096 | export declare class Triggers {
|
4097 | readonly container: Container;
|
4098 | private readonly clientContext;
|
4099 | /**
|
4100 | * @hidden
|
4101 | * @param container - The parent {@link Container}.
|
4102 | */
|
4103 | constructor(container: Container, clientContext: ClientContext);
|
4104 | /**
|
4105 | * Query all Triggers.
|
4106 | * @param query - Query configuration for the operation. See {@link SqlQuerySpec} for more info on how to configure a query.
|
4107 | */
|
4108 | query(query: SqlQuerySpec, options?: FeedOptions): QueryIterator<any>;
|
4109 | /**
|
4110 | * Query all Triggers.
|
4111 | * @param query - Query configuration for the operation. See {@link SqlQuerySpec} for more info on how to configure a query.
|
4112 | */
|
4113 | query<T>(query: SqlQuerySpec, options?: FeedOptions): QueryIterator<T>;
|
4114 | /**
|
4115 | * Read all Triggers.
|
4116 | * @example Read all trigger to array.
|
4117 | * ```typescript
|
4118 | * const {body: triggerList} = await container.triggers.readAll().fetchAll();
|
4119 | * ```
|
4120 | */
|
4121 | readAll(options?: FeedOptions): QueryIterator<TriggerDefinition & Resource>;
|
4122 | /**
|
4123 | * Create a trigger.
|
4124 | *
|
4125 | * Azure Cosmos DB supports pre and post triggers defined in JavaScript to be executed
|
4126 | * on creates, updates and deletes.
|
4127 | *
|
4128 | * For additional details, refer to the server-side JavaScript API documentation.
|
4129 | */
|
4130 | create(body: TriggerDefinition, options?: RequestOptions): Promise<TriggerResponse>;
|
4131 | }
|
4132 |
|
4133 | /**
|
4134 | * Enum for trigger type values.
|
4135 | * Specifies the type of the trigger.
|
4136 | */
|
4137 | export declare enum TriggerType {
|
4138 | /** Trigger should be executed before the associated operation(s). */
|
4139 | Pre = "pre",
|
4140 | /** Trigger should be executed after the associated operation(s). */
|
4141 | Post = "post"
|
4142 | }
|
4143 |
|
4144 | /** Interface for a single unique key passed as part of UniqueKeyPolicy */
|
4145 | export declare interface UniqueKey {
|
4146 | paths: string[];
|
4147 | }
|
4148 |
|
4149 | /** Interface for setting unique keys on container creation */
|
4150 | export declare interface UniqueKeyPolicy {
|
4151 | uniqueKeys: UniqueKey[];
|
4152 | }
|
4153 |
|
4154 | export declare type UpsertOperation = OperationWithItem & {
|
4155 | operationType: typeof BulkOperationType.Upsert;
|
4156 | };
|
4157 |
|
4158 | export declare interface UpsertOperationInput {
|
4159 | partitionKey?: PartitionKey;
|
4160 | ifMatch?: string;
|
4161 | ifNoneMatch?: string;
|
4162 | operationType: typeof BulkOperationType.Upsert;
|
4163 | resourceBody: JSONObject;
|
4164 | }
|
4165 |
|
4166 | /**
|
4167 | * Used to read, replace, and delete Users.
|
4168 | *
|
4169 | * Additionally, you can access the permissions for a given user via `user.permission` and `user.permissions`.
|
4170 | *
|
4171 | * @see {@link Users} to create, upsert, query, or read all.
|
4172 | */
|
4173 | export declare class User {
|
4174 | readonly database: Database;
|
4175 | readonly id: string;
|
4176 | private readonly clientContext;
|
4177 | /**
|
4178 | * Operations for creating, upserting, querying, or reading all operations.
|
4179 | *
|
4180 | * See `client.permission(id)` to read, replace, or delete a specific Permission by id.
|
4181 | */
|
4182 | readonly permissions: Permissions;
|
4183 | /**
|
4184 | * Returns a reference URL to the resource. Used for linking in Permissions.
|
4185 | */
|
4186 | get url(): string;
|
4187 | /**
|
4188 | * @hidden
|
4189 | * @param database - The parent {@link Database}.
|
4190 | */
|
4191 | constructor(database: Database, id: string, clientContext: ClientContext);
|
4192 | /**
|
4193 | * Operations to read, replace, or delete a specific Permission by id.
|
4194 | *
|
4195 | * See `client.permissions` for creating, upserting, querying, or reading all operations.
|
4196 | */
|
4197 | permission(id: string): Permission;
|
4198 | /**
|
4199 | * Read the {@link UserDefinition} for the given {@link User}.
|
4200 | */
|
4201 | read(options?: RequestOptions): Promise<UserResponse>;
|
4202 | /**
|
4203 | * Replace the given {@link User}'s definition with the specified {@link UserDefinition}.
|
4204 | * @param body - The specified {@link UserDefinition} to replace the definition.
|
4205 | */
|
4206 | replace(body: UserDefinition, options?: RequestOptions): Promise<UserResponse>;
|
4207 | /**
|
4208 | * Delete the given {@link User}.
|
4209 | */
|
4210 | delete(options?: RequestOptions): Promise<UserResponse>;
|
4211 | }
|
4212 |
|
4213 | /**
|
4214 | * Used to read, replace, or delete a specified User Definied Function by id.
|
4215 | *
|
4216 | * @see {@link UserDefinedFunction} to create, upsert, query, read all User Defined Functions.
|
4217 | */
|
4218 | export declare class UserDefinedFunction {
|
4219 | readonly container: Container;
|
4220 | readonly id: string;
|
4221 | private readonly clientContext;
|
4222 | /**
|
4223 | * Returns a reference URL to the resource. Used for linking in Permissions.
|
4224 | */
|
4225 | get url(): string;
|
4226 | /**
|
4227 | * @hidden
|
4228 | * @param container - The parent {@link Container}.
|
4229 | * @param id - The id of the given {@link UserDefinedFunction}.
|
4230 | */
|
4231 | constructor(container: Container, id: string, clientContext: ClientContext);
|
4232 | /**
|
4233 | * Read the {@link UserDefinedFunctionDefinition} for the given {@link UserDefinedFunction}.
|
4234 | */
|
4235 | read(options?: RequestOptions): Promise<UserDefinedFunctionResponse>;
|
4236 | /**
|
4237 | * Replace the given {@link UserDefinedFunction} with the specified {@link UserDefinedFunctionDefinition}.
|
4238 | * @param options -
|
4239 | */
|
4240 | replace(body: UserDefinedFunctionDefinition, options?: RequestOptions): Promise<UserDefinedFunctionResponse>;
|
4241 | /**
|
4242 | * Delete the given {@link UserDefined}.
|
4243 | */
|
4244 | delete(options?: RequestOptions): Promise<UserDefinedFunctionResponse>;
|
4245 | }
|
4246 |
|
4247 | export declare interface UserDefinedFunctionDefinition {
|
4248 | /** The id of the {@link UserDefinedFunction} */
|
4249 | id?: string;
|
4250 | /** The body of the user defined function, it can also be passed as a stringifed function */
|
4251 | body?: string | (() => void);
|
4252 | }
|
4253 |
|
4254 | export declare class UserDefinedFunctionResponse extends ResourceResponse<UserDefinedFunctionDefinition & Resource> {
|
4255 | constructor(resource: UserDefinedFunctionDefinition & Resource, headers: CosmosHeaders, statusCode: number, udf: UserDefinedFunction, diagnostics: CosmosDiagnostics);
|
4256 | /** A reference to the {@link UserDefinedFunction} corresponding to the returned {@link UserDefinedFunctionDefinition}. */
|
4257 | readonly userDefinedFunction: UserDefinedFunction;
|
4258 | /**
|
4259 | * Alias for `userDefinedFunction(id)`.
|
4260 | *
|
4261 | * A reference to the {@link UserDefinedFunction} corresponding to the returned {@link UserDefinedFunctionDefinition}.
|
4262 | */
|
4263 | get udf(): UserDefinedFunction;
|
4264 | }
|
4265 |
|
4266 | /**
|
4267 | * Used to create, upsert, query, or read all User Defined Functions.
|
4268 | *
|
4269 | * @see {@link UserDefinedFunction} to read, replace, or delete a given User Defined Function by id.
|
4270 | */
|
4271 | export declare class UserDefinedFunctions {
|
4272 | readonly container: Container;
|
4273 | private readonly clientContext;
|
4274 | /**
|
4275 | * @hidden
|
4276 | * @param container - The parent {@link Container}.
|
4277 | */
|
4278 | constructor(container: Container, clientContext: ClientContext);
|
4279 | /**
|
4280 | * Query all User Defined Functions.
|
4281 | * @param query - Query configuration for the operation. See {@link SqlQuerySpec} for more info on how to configure a query.
|
4282 | */
|
4283 | query(query: SqlQuerySpec, options?: FeedOptions): QueryIterator<any>;
|
4284 | /**
|
4285 | * Query all User Defined Functions.
|
4286 | * @param query - Query configuration for the operation. See {@link SqlQuerySpec} for more info on how to configure a query.
|
4287 | */
|
4288 | query<T>(query: SqlQuerySpec, options?: FeedOptions): QueryIterator<T>;
|
4289 | /**
|
4290 | * Read all User Defined Functions.
|
4291 | * @example Read all User Defined Functions to array.
|
4292 | * ```typescript
|
4293 | * const {body: udfList} = await container.userDefinedFunctions.readAll().fetchAll();
|
4294 | * ```
|
4295 | */
|
4296 | readAll(options?: FeedOptions): QueryIterator<UserDefinedFunctionDefinition & Resource>;
|
4297 | /**
|
4298 | * Create a UserDefinedFunction.
|
4299 | *
|
4300 | * Azure Cosmos DB supports JavaScript UDFs which can be used inside queries, stored procedures and triggers.
|
4301 | *
|
4302 | * For additional details, refer to the server-side JavaScript API documentation.
|
4303 | *
|
4304 | */
|
4305 | create(body: UserDefinedFunctionDefinition, options?: RequestOptions): Promise<UserDefinedFunctionResponse>;
|
4306 | }
|
4307 |
|
4308 | /**
|
4309 | * Enum for udf type values.
|
4310 | * Specifies the types of user defined functions.
|
4311 | */
|
4312 | export declare enum UserDefinedFunctionType {
|
4313 | /** The User Defined Function is written in JavaScript. This is currently the only option. */
|
4314 | Javascript = "Javascript"
|
4315 | }
|
4316 |
|
4317 | export declare interface UserDefinition {
|
4318 | /** The id of the user. */
|
4319 | id?: string;
|
4320 | }
|
4321 |
|
4322 | export declare class UserResponse extends ResourceResponse<UserDefinition & Resource> {
|
4323 | constructor(resource: UserDefinition & Resource, headers: CosmosHeaders, statusCode: number, user: User, diagnostics: CosmosDiagnostics);
|
4324 | /** A reference to the {@link User} corresponding to the returned {@link UserDefinition}. */
|
4325 | readonly user: User;
|
4326 | }
|
4327 |
|
4328 | /**
|
4329 | * Used to create, upsert, query, and read all users.
|
4330 | *
|
4331 | * @see {@link User} to read, replace, or delete a specific User by id.
|
4332 | */
|
4333 | export declare class Users {
|
4334 | readonly database: Database;
|
4335 | private readonly clientContext;
|
4336 | /**
|
4337 | * @hidden
|
4338 | * @param database - The parent {@link Database}.
|
4339 | */
|
4340 | constructor(database: Database, clientContext: ClientContext);
|
4341 | /**
|
4342 | * Query all users.
|
4343 | * @param query - Query configuration for the operation. See {@link SqlQuerySpec} for more info on how to configure a query.
|
4344 | */
|
4345 | query(query: SqlQuerySpec, options?: FeedOptions): QueryIterator<any>;
|
4346 | /**
|
4347 | * Query all users.
|
4348 | * @param query - Query configuration for the operation. See {@link SqlQuerySpec} for more info on how to configure a query.
|
4349 | */
|
4350 | query<T>(query: SqlQuerySpec, options?: FeedOptions): QueryIterator<T>;
|
4351 | /**
|
4352 | * Read all users.-
|
4353 | * @example Read all users to array.
|
4354 | * ```typescript
|
4355 | * const {body: usersList} = await database.users.readAll().fetchAll();
|
4356 | * ```
|
4357 | */
|
4358 | readAll(options?: FeedOptions): QueryIterator<UserDefinition & Resource>;
|
4359 | /**
|
4360 | * Create a database user with the specified {@link UserDefinition}.
|
4361 | * @param body - The specified {@link UserDefinition}.
|
4362 | */
|
4363 | create(body: UserDefinition, options?: RequestOptions): Promise<UserResponse>;
|
4364 | /**
|
4365 | * Upsert a database user with a specified {@link UserDefinition}.
|
4366 | * @param body - The specified {@link UserDefinition}.
|
4367 | */
|
4368 | upsert(body: UserDefinition, options?: RequestOptions): Promise<UserResponse>;
|
4369 | }
|
4370 |
|
4371 | /**
|
4372 | * Represents a vector embedding.
|
4373 | * A vector embedding is used to define a vector field in the documents.
|
4374 | */
|
4375 | export declare interface VectorEmbedding {
|
4376 | /**
|
4377 | * The path to the vector field in the document.
|
4378 | */
|
4379 | path: string;
|
4380 | /**
|
4381 | * The number of dimensions in the vector.
|
4382 | */
|
4383 | dimensions: number;
|
4384 | /**
|
4385 | * The data type of the vector.
|
4386 | */
|
4387 | dataType: VectorEmbeddingDataType;
|
4388 | /**
|
4389 | * The distance function to use for distance calculation in between vectors.
|
4390 | */
|
4391 | distanceFunction: VectorEmbeddingDistanceFunction;
|
4392 | }
|
4393 |
|
4394 | /**
|
4395 | * Represents the data type of the vector.
|
4396 | */
|
4397 | export declare enum VectorEmbeddingDataType {
|
4398 | /**
|
4399 | * 32-bit floating point number.
|
4400 | */
|
4401 | Float32 = "float32",
|
4402 | /**
|
4403 | * 8-bit unsigned integer.
|
4404 | */
|
4405 | UInt8 = "uint8",
|
4406 | /**
|
4407 | * 8-bit signed integer.
|
4408 | */
|
4409 | Int8 = "int8"
|
4410 | }
|
4411 |
|
4412 | /**
|
4413 | * Represents the distance function to use for distance calculation in between vectors.
|
4414 | */
|
4415 | export declare enum VectorEmbeddingDistanceFunction {
|
4416 | /**
|
4417 | * Represents euclidean distance function.
|
4418 | */
|
4419 | Euclidean = "euclidean",
|
4420 | /**
|
4421 | * Represents cosine distance function.
|
4422 | */
|
4423 | Cosine = "cosine",
|
4424 | /**
|
4425 | * Represents dot product distance function.
|
4426 | */
|
4427 | DotProduct = "dotproduct"
|
4428 | }
|
4429 |
|
4430 | /**
|
4431 | * Represents the policy configuration for vector embeddings in the Azure Cosmos DB service.
|
4432 | */
|
4433 | export declare interface VectorEmbeddingPolicy {
|
4434 | /**
|
4435 | * The vector embeddings to be configured.
|
4436 | */
|
4437 | vectorEmbeddings: VectorEmbedding[];
|
4438 | }
|
4439 |
|
4440 | /**
|
4441 | * Represents a vector index in the Azure Cosmos DB service.
|
4442 | * A vector index is used to index vector fields in the documents.
|
4443 | */
|
4444 | export declare interface VectorIndex {
|
4445 | /**
|
4446 | * The path to the vector field in the document.
|
4447 | * for example, path: "/path/to/vector".
|
4448 | */
|
4449 | path: string;
|
4450 | /**
|
4451 | * The index type of the vector.
|
4452 | * Currently, flat, diskANN, and quantizedFlat are supported.
|
4453 | */
|
4454 | type: VectorIndexType;
|
4455 | /**
|
4456 | * The number of bytes used in product quantization of the vectors.
|
4457 | * This is an optional parameter and applies to index types DiskANN and quantizedFlat.
|
4458 | * The allowed range for this parameter is between 1 and min(Dimensions, 512).
|
4459 | */
|
4460 | quantizationByteSize?: number;
|
4461 | /**
|
4462 | * The list of string containing the shard keys used for partitioning the vector indexes.
|
4463 | * This is an optional parameter and applies to index types DiskANN and quantizedFlat.
|
4464 | */
|
4465 | vectorIndexShardKey?: string[];
|
4466 | /**
|
4467 | * The size of the candidate list of approximate neighbors stored while building
|
4468 | * the diskANN index as part of the optimization processes.
|
4469 | * This is an optional parameter and applies to index type DiskANN only.
|
4470 | * The allowed range is between 25 and 500.
|
4471 | */
|
4472 | indexingSearchListSize?: number;
|
4473 | }
|
4474 |
|
4475 | /**
|
4476 | * Represents the index type of the vector.
|
4477 | */
|
4478 | export declare enum VectorIndexType {
|
4479 | /**
|
4480 | * Represents flat index type.
|
4481 | */
|
4482 | Flat = "flat",
|
4483 | /**
|
4484 | * Represents diskANN index type.
|
4485 | */
|
4486 | DiskANN = "diskANN",
|
4487 | /**
|
4488 | * Represents quantizedFlat index type.
|
4489 | */
|
4490 | QuantizedFlat = "quantizedFlat"
|
4491 | }
|
4492 |
|
4493 | declare type VerboseOmit<T, K extends keyof any> = Pick<T, Exclude<keyof T, K>>;
|
4494 |
|
4495 | export { }
|
4496 |
|
\ | No newline at end of file |