Skip to content

Commit c26f9c2

Browse files
authored
Update prettier dev-dependency to v2.5.1 in Cosmos DB (Azure#19506)
* Upgrade prettier version * Format files * rebuild cosmos, updating cosmos.api.md
1 parent 4faf748 commit c26f9c2

File tree

136 files changed

+1550
-1629
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+1550
-1629
lines changed

common/config/rush/pnpm-lock.yaml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/cosmosdb/cosmos/bundle-types.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const config = NodeCoreLib.JsonFile.loadAndValidate(
1111

1212
// This interface provides additional runtime state that is NOT part of the config file
1313
const options = {
14-
localBuild: process.argv.indexOf("--ship") < 0
14+
localBuild: process.argv.indexOf("--ship") < 0,
1515
};
1616
const extractor = new ApiExtractor.Extractor(config, options);
1717
extractor.processProject();

sdk/cosmosdb/cosmos/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
"execa": "^5.0.0",
129129
"mocha": "^7.1.1",
130130
"mocha-junit-reporter": "^2.0.0",
131-
"prettier": "^1.16.4",
131+
"prettier": "^2.5.1",
132132
"requirejs": "^2.3.5",
133133
"rimraf": "^3.0.0",
134134
"rollup": "^1.16.3",

sdk/cosmosdb/cosmos/review/cosmos.api.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,15 @@ export class ChangeFeedResponse<T> {
8383
export class ClientContext {
8484
constructor(cosmosClientOptions: CosmosClientOptions, globalEndpointManager: GlobalEndpointManager);
8585
// (undocumented)
86-
batch<T>({ body, path, partitionKey, resourceId, options }: {
86+
batch<T>({ body, path, partitionKey, resourceId, options, }: {
8787
body: T;
8888
path: string;
8989
partitionKey: string;
9090
resourceId: string;
9191
options?: RequestOptions;
9292
}): Promise<Response_2<any>>;
9393
// (undocumented)
94-
bulk<T>({ body, path, partitionKeyRangeId, resourceId, bulkOptions, options }: {
94+
bulk<T>({ body, path, partitionKeyRangeId, resourceId, bulkOptions, options, }: {
9595
body: T;
9696
path: string;
9797
partitionKeyRangeId: string;
@@ -102,7 +102,7 @@ export class ClientContext {
102102
// (undocumented)
103103
clearSessionToken(path: string): void;
104104
// (undocumented)
105-
create<T, U = T>({ body, path, resourceType, resourceId, options, partitionKey }: {
105+
create<T, U = T>({ body, path, resourceType, resourceId, options, partitionKey, }: {
106106
body: T;
107107
path: string;
108108
resourceType: ResourceType;
@@ -111,15 +111,15 @@ export class ClientContext {
111111
partitionKey?: PartitionKey;
112112
}): Promise<Response_2<T & U & Resource>>;
113113
// (undocumented)
114-
delete<T>({ path, resourceType, resourceId, options, partitionKey }: {
114+
delete<T>({ path, resourceType, resourceId, options, partitionKey, }: {
115115
path: string;
116116
resourceType: ResourceType;
117117
resourceId: string;
118118
options?: RequestOptions;
119119
partitionKey?: PartitionKey;
120120
}): Promise<Response_2<T & Resource>>;
121121
// (undocumented)
122-
execute<T>({ sprocLink, params, options, partitionKey }: {
122+
execute<T>({ sprocLink, params, options, partitionKey, }: {
123123
sprocLink: string;
124124
params?: any[];
125125
options?: RequestOptions;
@@ -141,7 +141,7 @@ export class ClientContext {
141141
[containerUrl: string]: any;
142142
};
143143
// (undocumented)
144-
patch<T>({ body, path, resourceType, resourceId, options, partitionKey }: {
144+
patch<T>({ body, path, resourceType, resourceId, options, partitionKey, }: {
145145
body: any;
146146
path: string;
147147
resourceType: ResourceType;
@@ -150,7 +150,7 @@ export class ClientContext {
150150
partitionKey?: PartitionKey;
151151
}): Promise<Response_2<T & Resource>>;
152152
// (undocumented)
153-
queryFeed<T>({ path, resourceType, resourceId, resultFn, query, options, partitionKeyRangeId, partitionKey }: {
153+
queryFeed<T>({ path, resourceType, resourceId, resultFn, query, options, partitionKeyRangeId, partitionKey, }: {
154154
path: string;
155155
resourceType: ResourceType;
156156
resourceId: string;
@@ -165,15 +165,15 @@ export class ClientContext {
165165
// (undocumented)
166166
queryPartitionKeyRanges(collectionLink: string, query?: string | SqlQuerySpec, options?: FeedOptions): QueryIterator<PartitionKeyRange>;
167167
// (undocumented)
168-
read<T>({ path, resourceType, resourceId, options, partitionKey }: {
168+
read<T>({ path, resourceType, resourceId, options, partitionKey, }: {
169169
path: string;
170170
resourceType: ResourceType;
171171
resourceId: string;
172172
options?: RequestOptions;
173173
partitionKey?: PartitionKey;
174174
}): Promise<Response_2<T & Resource>>;
175175
// (undocumented)
176-
replace<T>({ body, path, resourceType, resourceId, options, partitionKey }: {
176+
replace<T>({ body, path, resourceType, resourceId, options, partitionKey, }: {
177177
body: any;
178178
path: string;
179179
resourceType: ResourceType;
@@ -182,7 +182,7 @@ export class ClientContext {
182182
partitionKey?: PartitionKey;
183183
}): Promise<Response_2<T & Resource>>;
184184
// (undocumented)
185-
upsert<T, U = T>({ body, path, resourceType, resourceId, options, partitionKey }: {
185+
upsert<T, U = T>({ body, path, resourceType, resourceId, options, partitionKey, }: {
186186
body: T;
187187
path: string;
188188
resourceType: ResourceType;

sdk/cosmosdb/cosmos/samples-dev/AADAuth.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ async function run() {
2929
logStep("Pass credentials to client object with key aadCredentials");
3030
const aadClient = new CosmosClient({
3131
endpoint,
32-
aadCredentials: credentials
32+
aadCredentials: credentials,
3333
});
3434

3535
const genericClient = new CosmosClient({
3636
endpoint,
37-
key: key
37+
key: key,
3838
});
3939

4040
logStep(
@@ -47,15 +47,9 @@ async function run() {
4747
await genericClient.databases.readAll({}).fetchAll();
4848

4949
// succeeds
50-
await aadClient
51-
.database("example")
52-
.container(existingContainerId)
53-
.items.readAll();
50+
await aadClient.database("example").container(existingContainerId).items.readAll();
5451
// succeeds
55-
await genericClient
56-
.database("example")
57-
.container(existingContainerId)
58-
.items.readAll();
52+
await genericClient.database("example").container(existingContainerId).items.readAll();
5953

6054
await finish();
6155
}

sdk/cosmosdb/cosmos/samples-dev/AlterQueryThroughput.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
Resource,
1616
ContainerDefinition,
1717
DatabaseDefinition,
18-
FeedResponse
18+
FeedResponse,
1919
} from "@azure/cosmos";
2020
const key = process.env.COSMOS_KEY || "<cosmos key>";
2121
const endpoint = process.env.COSMOS_ENDPOINT || "<cosmos endpoint>";
@@ -75,9 +75,9 @@ async function updateOfferForCollection(
7575
content: {
7676
offerThroughput: newRups,
7777
offerIsRUPerMinuteThroughputEnabled:
78-
oldOfferDefinition.content.offerIsRUPerMinuteThroughputEnabled
78+
oldOfferDefinition.content.offerIsRUPerMinuteThroughputEnabled,
7979
},
80-
offerVersion: "V2"
80+
offerVersion: "V2",
8181
};
8282

8383
logStep("Read all databases");
@@ -88,10 +88,7 @@ async function updateOfferForCollection(
8888
databases
8989
.filter((database: DatabaseDefinition & Resource) => database.id === dbName)
9090
.map((database: DatabaseDefinition & Resource) => {
91-
return client
92-
.database(database.id)
93-
.containers.readAll()
94-
.fetchAll();
91+
return client.database(database.id).containers.readAll().fetchAll();
9592
})
9693
);
9794

sdk/cosmosdb/cosmos/samples-dev/Bulk.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
CosmosClient,
1515
OperationInput,
1616
PatchOperation,
17-
PatchOperationType
17+
PatchOperationType,
1818
} from "@azure/cosmos";
1919
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
2020
// @ts-ignore
@@ -32,17 +32,17 @@ async function run() {
3232
const containerId = "bulkContainerV2";
3333
const client = new CosmosClient({
3434
key: key,
35-
endpoint: endpoint
35+
endpoint: endpoint,
3636
});
3737
const { database } = await client.databases.create({ id: addEntropy("bulk db") });
3838
logStep(`Create multi-partition container '${containerId}' with partition key /key`);
3939
const { container: v2Container } = await database.containers.create({
4040
id: containerId,
4141
partitionKey: {
4242
paths: ["/key"],
43-
version: 2
43+
version: 2,
4444
},
45-
throughput: 25100
45+
throughput: 25100,
4646
});
4747

4848
const readItemId = addEntropy("item1");
@@ -55,62 +55,62 @@ async function run() {
5555
await v2Container.items.create({
5656
id: readItemId,
5757
key: true,
58-
class: "2010"
58+
class: "2010",
5959
});
6060

6161
await v2Container.items.create({
6262
id: deleteItemId,
6363
key: {},
64-
class: "2011"
64+
class: "2011",
6565
});
6666

6767
await v2Container.items.create({
6868
id: replaceItemId,
6969
key: 5,
70-
class: "2012"
70+
class: "2012",
7171
});
7272

7373
await v2Container.items.create({
7474
id: patchItemId,
7575
key: 5,
76-
class: "2019"
76+
class: "2019",
7777
});
7878

7979
const operations: OperationInput[] = [
8080
{
8181
operationType: BulkOperationType.Create,
8282
partitionKey: "A",
83-
resourceBody: { id: addEntropy("doc1"), name: "sample", key: "A" }
83+
resourceBody: { id: addEntropy("doc1"), name: "sample", key: "A" },
8484
},
8585
{
8686
operationType: BulkOperationType.Upsert,
8787
partitionKey: "U",
88-
resourceBody: { name: "other", key: "U" }
88+
resourceBody: { name: "other", key: "U" },
8989
},
9090
{
9191
operationType: BulkOperationType.Read,
9292
id: readItemId,
93-
partitionKey: true
93+
partitionKey: true,
9494
},
9595
{
9696
operationType: BulkOperationType.Delete,
9797
id: deleteItemId,
98-
partitionKey: {}
98+
partitionKey: {},
9999
},
100100
{
101101
operationType: BulkOperationType.Replace,
102102
partitionKey: 5,
103103
id: replaceItemId,
104-
resourceBody: { id: replaceItemId, name: "nice", key: 5 }
104+
resourceBody: { id: replaceItemId, name: "nice", key: 5 },
105105
},
106106
{
107107
operationType: BulkOperationType.Patch,
108108
partitionKey: 5,
109109
id: patchItemId,
110110
resourceBody: {
111-
operations: [{ op: PatchOperationType.add, path: "/great", value: "goodValue" }]
112-
}
113-
}
111+
operations: [{ op: PatchOperationType.add, path: "/great", value: "goodValue" }],
112+
},
113+
},
114114
];
115115
logStep(
116116
`Execute a simple bulk request with 5 operations: Create, Upsert, Read, Delete, Replace , Patch`

sdk/cosmosdb/cosmos/samples-dev/BulkUpdateWithSproc.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function body(continuation: string): void {
3434
collection.getSelfLink(),
3535
"SELECT * FROM root r",
3636
{ pageSize: 2, continuation }, // Setting this low to show how continuation tokens work
37-
function(err: any, feed: any, options: any) {
37+
function (err: any, feed: any, options: any) {
3838
if (err) throw err;
3939
// Set continuation token on response if we get one
4040
responseBody.continuation = options.continuation;
@@ -51,7 +51,7 @@ function body(continuation: string): void {
5151
// Grab the next document to update
5252
const document = documents.pop();
5353
document.state = "open";
54-
collection.replaceDocument(document._self, document, {}, function(err: any) {
54+
collection.replaceDocument(document._self, document, {}, function (err: any) {
5555
if (err) throw err;
5656
// If we have successfully updated the document, include it in the returned document ids
5757
responseBodyParam.updatedDocumentIds.push(document.id);
@@ -81,7 +81,7 @@ async function run(): Promise<void> {
8181
logStep("Created stored procedure");
8282
const { storedProcedure } = await container.scripts.storedProcedures.create({
8383
id: "queryAndBulkUpdate",
84-
body
84+
body,
8585
});
8686

8787
logStep("Execute stored procedure and follow continuation tokens");

sdk/cosmosdb/cosmos/samples-dev/ChangeFeed.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ async function run(): Promise<void> {
4242
const { database } = await client.databases.createIfNotExists({ id: databaseId });
4343
const { container } = await database.containers.createIfNotExists({
4444
id: containerId,
45-
partitionKey: { paths: ["/pk"] }
45+
partitionKey: { paths: ["/pk"] },
4646
});
4747

4848
try {
@@ -82,7 +82,7 @@ async function run(): Promise<void> {
8282
console.log(` 👉 Inserted id=3`);
8383

8484
const specificContinuationIterator = container.items.changeFeed(pk, {
85-
continuation: lsn.toString()
85+
continuation: lsn.toString(),
8686
});
8787
const specificPointInTimeIterator = container.items.changeFeed(pk, { startTime: now });
8888
const fromBeginningIterator = container.items.changeFeed(pk, { startFromBeginning: true });

0 commit comments

Comments
 (0)