Skip to content

Commit

Permalink
Mark query options as optional. Fixes Azure#6277
Browse files Browse the repository at this point in the history
  • Loading branch information
southpolesteve committed Nov 21, 2019
1 parent f9806c8 commit 1697412
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 16 deletions.
4 changes: 4 additions & 0 deletions sdk/cosmosdb/cosmos/changelog.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
30 changes: 15 additions & 15 deletions sdk/cosmosdb/cosmos/review/cosmos.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -261,7 +261,7 @@ export class Container {
// @deprecated
getPartitionKeyDefinition(): Promise<ResourceResponse<PartitionKeyDefinition>>;
// Warning: (ae-forgotten-export) The symbol "PartitionedQueryExecutionInfo" needs to be exported by the entry point index.d.ts
//
//
// (undocumented)
getQueryPlan(query: string | SqlQuerySpec): Promise<Response<PartitionedQueryExecutionInfo>>;
// (undocumented)
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand All @@ -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?: {
Expand Down Expand Up @@ -569,18 +569,18 @@ export class Items {
readonly container: Container;
create<T extends ItemDefinition = any>(body: T, options?: RequestOptions): Promise<ItemResponse<T>>;
query(query: string | SqlQuerySpec, options?: FeedOptions): QueryIterator<any>;
query<T>(query: string | SqlQuerySpec, options: FeedOptions): QueryIterator<T>;
query<T>(query: string | SqlQuerySpec, options?: FeedOptions): QueryIterator<T>;
readAll(options?: FeedOptions): QueryIterator<ItemDefinition>;
readAll<T extends ItemDefinition>(options?: FeedOptions): QueryIterator<T>;
// 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<any>;
readChangeFeed(partitionKey: string | number | boolean, changeFeedOptions?: ChangeFeedOptions): ChangeFeedIterator<any>;
// @deprecated
readChangeFeed(changeFeedOptions?: ChangeFeedOptions): ChangeFeedIterator<any>;
// @deprecated
readChangeFeed<T>(partitionKey: string | number | boolean, changeFeedOptions: ChangeFeedOptions): ChangeFeedIterator<T>;
readChangeFeed<T>(partitionKey: string | number | boolean, changeFeedOptions?: ChangeFeedOptions): ChangeFeedIterator<T>;
// @deprecated
readChangeFeed<T>(changeFeedOptions?: ChangeFeedOptions): ChangeFeedIterator<T>;
upsert(body: any, options?: RequestOptions): Promise<ItemResponse<ItemDefinition>>;
Expand Down Expand Up @@ -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<PermissionDefinition & PermissionBody & Resource> {
constructor(resource: PermissionDefinition & PermissionBody & Resource, headers: CosmosHeaders, statusCode: number, permission: Permission);
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -975,11 +975,11 @@ export class ResourceResponse<TResource> {
// (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;
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/cosmosdb/cosmos/src/client/Item/Items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export class Items {
* const {result: items} = await items.query<{firstName: string}>(querySpec).fetchAll();
* ```
*/
public query<T>(query: string | SqlQuerySpec, options: FeedOptions): QueryIterator<T>;
public query<T>(query: string | SqlQuerySpec, options?: FeedOptions): QueryIterator<T>;
public query<T>(query: string | SqlQuerySpec, options: FeedOptions = {}): QueryIterator<T> {
const path = getPathFromLink(this.container.url, ResourceType.item);
const id = getIdFromLink(this.container.url);
Expand Down

0 comments on commit 1697412

Please sign in to comment.