@boostercloud/framework-provider-azure 3.2.1 → 3.3.0

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.
@@ -23,6 +23,9 @@ export declare const environmentVarNames: {
23
23
  readonly restAPIURL: "BOOSTER_REST_API_URL";
24
24
  readonly websocketAPIURL: "BOOSTER_WEBSOCKET_API_URL";
25
25
  readonly cosmosDbConnectionString: "COSMOSDB_CONNECTION_STRING";
26
+ readonly cosmosDbMaxRetries: "COSMOSDB_MAX_RETRIES";
27
+ readonly cosmosDbRetryInterval: "COSMOSDB_RETRY_INTERVAL";
28
+ readonly cosmosDbMaxWaitTime: "COSMOSDB_MAX_WAIT_TIME";
26
29
  readonly eventHubConnectionString: "EVENTHUB_CONNECTION_STRING";
27
30
  readonly eventHubName: "EVENTHUB_NAME";
28
31
  readonly eventHubMaxRetries: "EVENTHUB_MAX_RETRIES";
package/dist/constants.js CHANGED
@@ -25,6 +25,9 @@ exports.environmentVarNames = {
25
25
  restAPIURL: 'BOOSTER_REST_API_URL',
26
26
  websocketAPIURL: 'BOOSTER_WEBSOCKET_API_URL',
27
27
  cosmosDbConnectionString: 'COSMOSDB_CONNECTION_STRING',
28
+ cosmosDbMaxRetries: 'COSMOSDB_MAX_RETRIES',
29
+ cosmosDbRetryInterval: 'COSMOSDB_RETRY_INTERVAL',
30
+ cosmosDbMaxWaitTime: 'COSMOSDB_MAX_WAIT_TIME',
28
31
  eventHubConnectionString: 'EVENTHUB_CONNECTION_STRING',
29
32
  eventHubName: 'EVENTHUB_NAME',
30
33
  eventHubMaxRetries: 'EVENTHUB_MAX_RETRIES',
package/dist/index.js CHANGED
@@ -27,7 +27,28 @@ if (typeof process.env[constants_1.environmentVarNames.cosmosDbConnectionString]
27
27
  cosmosClient = {};
28
28
  }
29
29
  else {
30
- cosmosClient = new cosmos_1.CosmosClient(process.env[constants_1.environmentVarNames.cosmosDbConnectionString]);
30
+ const cosmosClientOptions = {
31
+ connectionString: process.env[constants_1.environmentVarNames.cosmosDbConnectionString],
32
+ // Overrides default retry options if any of the environment variables are set
33
+ ...((process.env[constants_1.environmentVarNames.cosmosDbMaxRetries] ||
34
+ process.env[constants_1.environmentVarNames.cosmosDbRetryInterval] ||
35
+ process.env[constants_1.environmentVarNames.cosmosDbMaxWaitTime]) && {
36
+ connectionPolicy: {
37
+ retryOptions: {
38
+ ...(process.env[constants_1.environmentVarNames.cosmosDbMaxRetries] && {
39
+ maxRetryAttemptCount: Number(process.env[constants_1.environmentVarNames.cosmosDbMaxRetries]),
40
+ }),
41
+ ...(process.env[constants_1.environmentVarNames.cosmosDbRetryInterval] && {
42
+ fixedRetryIntervalInMilliseconds: Number(process.env[constants_1.environmentVarNames.cosmosDbRetryInterval]),
43
+ }),
44
+ ...(process.env[constants_1.environmentVarNames.cosmosDbMaxWaitTime] && {
45
+ maxWaitTimeInSeconds: Number(process.env[constants_1.environmentVarNames.cosmosDbMaxWaitTime]),
46
+ }),
47
+ },
48
+ },
49
+ }),
50
+ };
51
+ cosmosClient = new cosmos_1.CosmosClient(cosmosClientOptions);
31
52
  }
32
53
  let producer;
33
54
  const eventHubConnectionString = process.env[constants_1.environmentVarNames.eventHubConnectionString];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boostercloud/framework-provider-azure",
3
- "version": "3.2.1",
3
+ "version": "3.3.0",
4
4
  "description": "Handle Booster's integration with Azure",
5
5
  "keywords": [
6
6
  "framework-provider-azure"
@@ -23,18 +23,18 @@
23
23
  "node": ">=20.0.0 <21.0.0"
24
24
  },
25
25
  "dependencies": {
26
- "@azure/cosmos": "^4.0.0",
26
+ "@azure/cosmos": "^4.3.0",
27
27
  "@azure/functions": "^1.2.2",
28
28
  "@azure/identity": "~4.7.0",
29
29
  "@azure/event-hubs": "5.11.1",
30
- "@boostercloud/framework-common-helpers": "^3.2.1",
31
- "@boostercloud/framework-types": "^3.2.1",
30
+ "@boostercloud/framework-common-helpers": "^3.3.0",
31
+ "@boostercloud/framework-types": "^3.3.0",
32
32
  "tslib": "^2.4.0",
33
33
  "@effect-ts/core": "^0.60.4",
34
34
  "@azure/web-pubsub": "~1.1.0"
35
35
  },
36
36
  "devDependencies": {
37
- "@boostercloud/eslint-config": "^3.2.1",
37
+ "@boostercloud/eslint-config": "^3.3.0",
38
38
  "@types/chai": "4.2.18",
39
39
  "@types/chai-as-promised": "7.1.4",
40
40
  "@types/faker": "5.1.5",