@cfworker/cosmos 1.13.0 → 1.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client.js CHANGED
@@ -7,14 +7,14 @@ export class CosmosClient {
7
7
  constructor(config) {
8
8
  this.requestCharges = 0;
9
9
  this.retries = { count: 0, delayMs: 0 };
10
- let { endpoint, accountKey } = 'connectionString' in config
10
+ let { endpoint, masterKey } = 'connectionString' in config
11
11
  ? parseConnectionString(config.connectionString)
12
12
  : config;
13
13
  if (endpoint.endsWith('/')) {
14
14
  endpoint = endpoint.slice(0, -1);
15
15
  }
16
16
  this.endpoint = endpoint;
17
- this.signer = getSigner(accountKey);
17
+ this.signer = getSigner(masterKey);
18
18
  this.retryPolicy = config.retryPolicy ?? defaultRetryPolicy;
19
19
  this.consistencyLevel = config.consistencyLevel ?? 'Session';
20
20
  this.dbId = config.dbId;
package/dist/signer.d.ts CHANGED
@@ -9,4 +9,4 @@ export declare class Signer {
9
9
  resourceId: string;
10
10
  };
11
11
  }
12
- export declare function getSigner(accountKey: string): Signer;
12
+ export declare function getSigner(masterKey: string): Signer;
package/dist/signer.js CHANGED
@@ -35,9 +35,9 @@ export class Signer {
35
35
  }
36
36
  }
37
37
  const signers = {};
38
- export function getSigner(accountKey) {
39
- if (!signers[accountKey]) {
40
- signers[accountKey] = new Signer(accountKey);
38
+ export function getSigner(masterKey) {
39
+ if (!signers[masterKey]) {
40
+ signers[masterKey] = new Signer(masterKey);
41
41
  }
42
- return signers[accountKey];
42
+ return signers[masterKey];
43
43
  }
package/dist/types.d.ts CHANGED
@@ -58,5 +58,5 @@ export interface Collection extends PersistedResource {
58
58
  }
59
59
  export interface ConnectionInfo {
60
60
  endpoint: string;
61
- accountKey: string;
61
+ masterKey: string;
62
62
  }
package/dist/util.js CHANGED
@@ -31,6 +31,6 @@ export function parseConnectionString(connString) {
31
31
  }
32
32
  return {
33
33
  endpoint: props.AccountEndpoint,
34
- accountKey: props.AccountKey
34
+ masterKey: props.AccountKey
35
35
  };
36
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cfworker/cosmos",
3
- "version": "1.13.0",
3
+ "version": "1.13.1",
4
4
  "description": "Azure Cosmos DB client for Cloudflare Workers and service workers",
5
5
  "keywords": [
6
6
  "azure",
package/src/client.ts CHANGED
@@ -27,7 +27,7 @@ export type CosmosClientConfig =
27
27
  /**
28
28
  * Cosmos DB connection string.
29
29
  * @example
30
- * "AccountEndpoint=https://xxxxxxxxxx.documents.azure.com:443/;accountKey=xxxxxxxxxx;"
30
+ * "AccountEndpoint=https://xxxxxxxxxx.documents.azure.com:443/;AccountKey=xxxxxxxxxx;"
31
31
  */
32
32
  connectionString: string;
33
33
  } & CosmosClientConfigBase);
@@ -84,7 +84,7 @@ export class CosmosClient {
84
84
  public retries = { count: 0, delayMs: 0 };
85
85
 
86
86
  constructor(config: CosmosClientConfig) {
87
- let { endpoint, accountKey } =
87
+ let { endpoint, masterKey } =
88
88
  'connectionString' in config
89
89
  ? parseConnectionString(config.connectionString)
90
90
  : config;
@@ -92,7 +92,7 @@ export class CosmosClient {
92
92
  endpoint = endpoint.slice(0, -1);
93
93
  }
94
94
  this.endpoint = endpoint;
95
- this.signer = getSigner(accountKey);
95
+ this.signer = getSigner(masterKey);
96
96
  this.retryPolicy = config.retryPolicy ?? defaultRetryPolicy;
97
97
  this.consistencyLevel = config.consistencyLevel ?? 'Session';
98
98
  this.dbId = config.dbId;
package/src/signer.ts CHANGED
@@ -55,9 +55,9 @@ export class Signer {
55
55
 
56
56
  const signers: Record<string, Signer> = {};
57
57
 
58
- export function getSigner(accountKey: string) {
59
- if (!signers[accountKey]) {
60
- signers[accountKey] = new Signer(accountKey);
58
+ export function getSigner(masterKey: string) {
59
+ if (!signers[masterKey]) {
60
+ signers[masterKey] = new Signer(masterKey);
61
61
  }
62
- return signers[accountKey];
62
+ return signers[masterKey];
63
63
  }
package/src/types.ts CHANGED
@@ -78,5 +78,5 @@ export interface ConnectionInfo {
78
78
  /**
79
79
  * Cosmos DB key.
80
80
  */
81
- accountKey: string;
81
+ masterKey: string;
82
82
  }
package/src/util.ts CHANGED
@@ -54,6 +54,6 @@ export function parseConnectionString(connString: string): ConnectionInfo {
54
54
  }
55
55
  return {
56
56
  endpoint: props.AccountEndpoint,
57
- accountKey: props.AccountKey
57
+ masterKey: props.AccountKey
58
58
  };
59
59
  }