@pi-r/azure 0.6.6 → 0.6.8

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/client/index.js CHANGED
@@ -20,10 +20,11 @@ function validateDatabase(credential, data) {
20
20
  }
21
21
  exports.validateDatabase = validateDatabase;
22
22
  function createStorageClient(credential) {
23
+ var _a, _b;
23
24
  let { accountName, accountKey, connectionString, sharedAccessSignature } = credential;
24
25
  if (connectionString) {
25
26
  if (!accountName) {
26
- credential.accountName = /AccountName=([^;]+);/.exec(connectionString)?.[1];
27
+ credential.accountName = (_a = /AccountName=([^;]+);/.exec(connectionString)) === null || _a === void 0 ? void 0 : _a[1];
27
28
  }
28
29
  return storage.BlobServiceClient.fromConnectionString(connectionString);
29
30
  }
@@ -35,7 +36,7 @@ function createStorageClient(credential) {
35
36
  }
36
37
  }
37
38
  else {
38
- credential.accountName || (credential.accountName = /^https:\/\/([a-z\d]+)\./.exec(sharedAccessSignature)?.[1]);
39
+ credential.accountName || (credential.accountName = (_b = /^https:\/\/([a-z\d]+)\./.exec(sharedAccessSignature)) === null || _b === void 0 ? void 0 : _b[1]);
39
40
  }
40
41
  return new storage.BlobServiceClient(sharedAccessSignature);
41
42
  }
@@ -174,7 +175,7 @@ async function executeBatchQuery(credential, batch, sessionKey) {
174
175
  client || (client = createDatabaseClient.call(this, credential));
175
176
  return client.database(name).container(table);
176
177
  };
177
- const closeClient = () => client?.dispose();
178
+ const closeClient = () => client === null || client === void 0 ? void 0 : client.dispose();
178
179
  for (let i = 0; i < length; ++i) {
179
180
  const item = batch[i];
180
181
  const { service, name, table, id, query, storedProcedureId, partitionKey = null, params, limit = 0, update, ignoreCache } = item;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-r/azure",
3
- "version": "0.6.6",
3
+ "version": "0.6.8",
4
4
  "description": "Azure cloud functions for E-mc.",
5
5
  "main": "client/index.js",
6
6
  "publishConfig": {
@@ -20,11 +20,11 @@
20
20
  "license": "MIT",
21
21
  "homepage": "https://github.com/anpham6/pi-r#readme",
22
22
  "dependencies": {
23
- "@e-mc/cloud": "^0.8.7",
24
- "@e-mc/module": "^0.8.7",
25
- "@e-mc/types": "^0.8.7",
23
+ "@e-mc/cloud": "^0.8.14",
24
+ "@e-mc/module": "^0.8.14",
25
+ "@e-mc/types": "^0.8.14",
26
26
  "@azure/cosmos": "^4.0.0",
27
- "@azure/identity": "^4.0.1",
28
- "@azure/storage-blob": "^12.17.0"
27
+ "@azure/identity": "^4.4.0",
28
+ "@azure/storage-blob": "^12.23.0"
29
29
  }
30
30
  }
package/upload/index.js CHANGED
@@ -30,14 +30,14 @@ module.exports = function upload(credential, service = 'azure') {
30
30
  const configBucket = admin.configBucket;
31
31
  if (!BUCKET_SESSION.has(bucket)) {
32
32
  const bucketAcl = admin.publicRead ? 'blob' : admin.acl;
33
- const response = BUCKET_RESPONSE[_a = bucketKey = getBucketKey(credential, bucket, bucketAcl)] || (BUCKET_RESPONSE[_a] = client_1.createBucketV2.call(this, credential, bucket, bucketAcl, configBucket?.create));
33
+ const response = BUCKET_RESPONSE[_a = bucketKey = getBucketKey(credential, bucket, bucketAcl)] || (BUCKET_RESPONSE[_a] = client_1.createBucketV2.call(this, credential, bucket, bucketAcl, configBucket === null || configBucket === void 0 ? void 0 : configBucket.create));
34
34
  if (!await response) {
35
35
  errorResponse(null);
36
36
  return;
37
37
  }
38
38
  BUCKET_SESSION.add(bucket);
39
39
  }
40
- let retentionPolicy = configBucket?.retentionPolicy;
40
+ let retentionPolicy = configBucket === null || configBucket === void 0 ? void 0 : configBucket.retentionPolicy;
41
41
  if (retentionPolicy) {
42
42
  if (!Array.isArray(retentionPolicy)) {
43
43
  retentionPolicy = [retentionPolicy];