@stryker-mutator/dashboard-data-access 0.14.4-pr-888.5 → 0.14.4-pr-888.7

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.
@@ -1,11 +1,16 @@
1
- import { BlobServiceClient } from '@azure/storage-blob';
1
+ import { StorageSharedKeyCredential, BlobServiceClient } from '@azure/storage-blob';
2
2
  export const createBlobServiceClient = () => {
3
3
  const connectionString = process.env.AZURE_STORAGE_CONNECTION_STRING;
4
4
  if (connectionString) {
5
5
  return BlobServiceClient.fromConnectionString(connectionString);
6
6
  }
7
7
  else {
8
- throw new Error('AZURE_STORAGE_CONNECTION_STRING is not set');
8
+ const storageAccount = process.env.AZURE_STORAGE_ACCOUNT;
9
+ const accessKey = process.env.AZURE_STORAGE_ACCESS_KEY;
10
+ if (storageAccount && accessKey) {
11
+ return new BlobServiceClient(`https://${storageAccount}.blob.core.windows.net`, new StorageSharedKeyCredential(storageAccount, accessKey));
12
+ }
9
13
  }
14
+ throw new Error('AZURE_STORAGE_CONNECTION_STRING is not set');
10
15
  };
11
16
  //# sourceMappingURL=BlobServiceClient.js.map
@@ -1,4 +1,4 @@
1
- import { TableClient } from '@azure/data-tables';
1
+ import { TableClient, AzureNamedKeyCredential } from '@azure/data-tables';
2
2
  export const createTableClient = (tableName) => {
3
3
  const connectionString = process.env.AZURE_STORAGE_CONNECTION_STRING;
4
4
  if (connectionString) {
@@ -7,7 +7,12 @@ export const createTableClient = (tableName) => {
7
7
  });
8
8
  }
9
9
  else {
10
- throw new Error('AZURE_STORAGE_CONNECTION_STRING is not set');
10
+ const storageAccount = process.env.AZURE_STORAGE_ACCOUNT;
11
+ const accessKey = process.env.AZURE_STORAGE_ACCESS_KEY;
12
+ if (storageAccount && accessKey) {
13
+ return new TableClient(`https://${storageAccount}.table.core.windows.net`, tableName, new AzureNamedKeyCredential(storageAccount, accessKey));
14
+ }
11
15
  }
16
+ throw new Error('AZURE_STORAGE_CONNECTION_STRING is not set');
12
17
  };
13
18
  //# sourceMappingURL=TableClient.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stryker-mutator/dashboard-data-access",
3
- "version": "0.14.4-pr-888.5",
3
+ "version": "0.14.4-pr-888.7",
4
4
  "type": "module",
5
5
  "description": "This package contains the data access layer of the stryker dashboard application.",
6
6
  "scripts": {
@@ -24,9 +24,9 @@
24
24
  "dependencies": {
25
25
  "@azure/data-tables": "13.2.2",
26
26
  "@azure/storage-blob": "12.24.0",
27
- "@stryker-mutator/dashboard-common": "0.14.4-pr-888.5",
27
+ "@stryker-mutator/dashboard-common": "0.14.4-pr-888.7",
28
28
  "mutation-testing-metrics": "3.2.0",
29
29
  "mutation-testing-report-schema": "3.1.1"
30
30
  },
31
- "gitHead": "baf215d8434a9349d8ed9669c8d0d2702ef4ec43"
31
+ "gitHead": "33ee97e2f96a71d6af4068a3cf714480753d894e"
32
32
  }