diff --git a/sdk/cosmosdb/cosmos/changelog.md b/sdk/cosmosdb/cosmos/changelog.md index eb194d9d86b3..f4fefb356281 100644 --- a/sdk/cosmosdb/cosmos/changelog.md +++ b/sdk/cosmosdb/cosmos/changelog.md @@ -1,3 +1,7 @@ +## 3.4.3 + +- Makes changeFeed options optional. Fixes #6232 (#6273) + ## 3.4.2 - Fixes bug where the query may throw a 410 error during a split operation. Instead, throw 503 (#6074) diff --git a/sdk/cosmosdb/cosmos/review/cosmos.api.md b/sdk/cosmosdb/cosmos/review/cosmos.api.md index 87e6e26e2190..3db752ccb9c5 100644 --- a/sdk/cosmosdb/cosmos/review/cosmos.api.md +++ b/sdk/cosmosdb/cosmos/review/cosmos.api.md @@ -38,7 +38,7 @@ export interface ConflictDefinition { operationType?: OperationType; resourceId?: string; // Warning: (ae-forgotten-export) The symbol "ResourceType" needs to be exported by the entry point index.d.ts - // + // // (undocumented) resourceType?: ResourceType; } @@ -261,7 +261,7 @@ export class Container { // @deprecated getPartitionKeyDefinition(): Promise>; // Warning: (ae-forgotten-export) The symbol "PartitionedQueryExecutionInfo" needs to be exported by the entry point index.d.ts - // + // // (undocumented) getQueryPlan(query: string | SqlQuerySpec): Promise>; // (undocumented) @@ -327,7 +327,7 @@ export interface CosmosClientOptions { connectionPolicy?: ConnectionPolicy; consistencyLevel?: keyof typeof ConsistencyLevel; // Warning: (ae-forgotten-export) The symbol "CosmosHeaders" needs to be exported by the entry point index.d.ts - // + // // (undocumented) defaultHeaders?: CosmosHeaders_2; endpoint: string; @@ -432,7 +432,7 @@ export interface ErrorResponse extends Error { // (undocumented) activityId?: string; // Warning: (ae-forgotten-export) The symbol "ErrorBody" needs to be exported by the entry point index.d.ts - // + // // (undocumented) body?: ErrorBody; // (undocumented) @@ -451,7 +451,7 @@ export interface ErrorResponse extends Error { export function extractPartitionKey(document: any, partitionKeyDefinition: PartitionKeyDefinition): PartitionKey[]; // Warning: (ae-forgotten-export) The symbol "SharedOptions" needs to be exported by the entry point index.d.ts -// +// // @public export interface FeedOptions extends SharedOptions { accessCondition?: { @@ -569,18 +569,18 @@ export class Items { readonly container: Container; create(body: T, options?: RequestOptions): Promise>; query(query: string | SqlQuerySpec, options?: FeedOptions): QueryIterator; - query(query: string | SqlQuerySpec, options: FeedOptions): QueryIterator; + query(query: string | SqlQuerySpec, options?: FeedOptions): QueryIterator; readAll(options?: FeedOptions): QueryIterator; readAll(options?: FeedOptions): QueryIterator; // Warning: (ae-forgotten-export) The symbol "ChangeFeedOptions" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "ChangeFeedIterator" needs to be exported by the entry point index.d.ts - // + // // @deprecated - readChangeFeed(partitionKey: string | number | boolean, changeFeedOptions: ChangeFeedOptions): ChangeFeedIterator; + readChangeFeed(partitionKey: string | number | boolean, changeFeedOptions?: ChangeFeedOptions): ChangeFeedIterator; // @deprecated readChangeFeed(changeFeedOptions?: ChangeFeedOptions): ChangeFeedIterator; // @deprecated - readChangeFeed(partitionKey: string | number | boolean, changeFeedOptions: ChangeFeedOptions): ChangeFeedIterator; + readChangeFeed(partitionKey: string | number | boolean, changeFeedOptions?: ChangeFeedOptions): ChangeFeedIterator; // @deprecated readChangeFeed(changeFeedOptions?: ChangeFeedOptions): ChangeFeedIterator; upsert(body: any, options?: RequestOptions): Promise>; @@ -724,7 +724,7 @@ export enum PermissionMode { } // Warning: (ae-forgotten-export) The symbol "PermissionBody" needs to be exported by the entry point index.d.ts -// +// // @public (undocumented) export class PermissionResponse extends ResourceResponse { constructor(resource: PermissionDefinition & PermissionBody & Resource, headers: CosmosHeaders, statusCode: number, permission: Permission); @@ -883,17 +883,17 @@ export interface RequestContext { // (undocumented) endpoint?: string; // Warning: (ae-forgotten-export) The symbol "GlobalEndpointManager" needs to be exported by the entry point index.d.ts - // + // // (undocumented) globalEndpointManager: GlobalEndpointManager; // (undocumented) headers?: CosmosHeaders_2; // Warning: (ae-forgotten-export) The symbol "LocationRouting" needs to be exported by the entry point index.d.ts - // + // // (undocumented) locationRouting?: LocationRouting; // Warning: (ae-forgotten-export) The symbol "HTTPMethod" needs to be exported by the entry point index.d.ts - // + // // (undocumented) method: HTTPMethod; // (undocumented) @@ -975,11 +975,11 @@ export class ResourceResponse { // (undocumented) readonly resource: TResource; // Warning: (ae-forgotten-export) The symbol "StatusCode" needs to be exported by the entry point index.d.ts - // + // // (undocumented) readonly statusCode: StatusCode; // Warning: (ae-forgotten-export) The symbol "SubStatusCode" needs to be exported by the entry point index.d.ts - // + // // (undocumented) readonly substatus?: SubStatusCode; } diff --git a/sdk/cosmosdb/cosmos/src/client/Item/Items.ts b/sdk/cosmosdb/cosmos/src/client/Item/Items.ts index fa41c2edaf69..b1ad79769b97 100644 --- a/sdk/cosmosdb/cosmos/src/client/Item/Items.ts +++ b/sdk/cosmosdb/cosmos/src/client/Item/Items.ts @@ -72,7 +72,7 @@ export class Items { * const {result: items} = await items.query<{firstName: string}>(querySpec).fetchAll(); * ``` */ - public query(query: string | SqlQuerySpec, options: FeedOptions): QueryIterator; + public query(query: string | SqlQuerySpec, options?: FeedOptions): QueryIterator; public query(query: string | SqlQuerySpec, options: FeedOptions = {}): QueryIterator { const path = getPathFromLink(this.container.url, ResourceType.item); const id = getIdFromLink(this.container.url);