@pi-r/azure 0.12.4 → 0.13.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.
Files changed (2) hide show
  1. package/client/index.js +8 -5
  2. package/package.json +4 -4
package/client/index.js CHANGED
@@ -233,10 +233,10 @@ async function executeBatchQuery(credential, batch, sessionKey) {
233
233
  throw formatError(item, name ? "Missing database table" : "Missing database name");
234
234
  }
235
235
  cacheValue.exclusiveOf = Array.isArray(ignoreCache) ? ignoreCache : undefined;
236
- let rows, queryString = caching && ignoreCache !== true ? name + '_' + table + '_' : '';
236
+ let rows, queryString = caching && ignoreCache !== true ? Cloud.keyForResult(name, table) : '';
237
237
  if (storedProcedureId && params) {
238
238
  const { options } = item;
239
- if (queryString && (rows = this.getCacheResult(service, credential, queryString += (partitionKey ? Cloud.asString(partitionKey, true) : '') + '_' + storedProcedureId + '_' + Cloud.asString(params, true) + Cloud.asString(options, true), cacheValue, ignoreCache))) {
239
+ if (queryString && (rows = this.getCacheResult(service, credential, queryString = Cloud.keyForResult(queryString, partitionKey, storedProcedureId, params, options), cacheValue, ignoreCache))) {
240
240
  result[i] = rows;
241
241
  continue;
242
242
  }
@@ -248,7 +248,7 @@ async function executeBatchQuery(credential, batch, sessionKey) {
248
248
  else if (id) {
249
249
  const { update, options } = item;
250
250
  if (queryString) {
251
- queryString += (partitionKey ? Cloud.asString(partitionKey, true) : '') + '_' + id + '_' + Cloud.asString(options, true);
251
+ queryString = Cloud.keyForResult(queryString, partitionKey, id, options);
252
252
  if (!update && (rows = this.getCacheResult(service, credential, queryString, cacheValue, ignoreCache))) {
253
253
  result[i] = rows;
254
254
  continue;
@@ -281,8 +281,11 @@ async function executeBatchQuery(credential, batch, sessionKey) {
281
281
  if (limit > 0) {
282
282
  options.maxItemCount = limit;
283
283
  }
284
- if (queryString) {
285
- queryString += (query ? Cloud.asString(query, true) : '') + Cloud.asString(options, true);
284
+ if (options.enableQueryControl && options.continuationToken) {
285
+ queryString = '';
286
+ }
287
+ else if (queryString) {
288
+ queryString = Cloud.keyForResult(queryString, query, options);
286
289
  if (!update && (rows = this.getCacheResult(service, credential, queryString, cacheValue, ignoreCache))) {
287
290
  result[i] = rows;
288
291
  continue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-r/azure",
3
- "version": "0.12.4",
3
+ "version": "0.13.0",
4
4
  "description": "Azure cloud functions for E-mc.",
5
5
  "main": "client/index.js",
6
6
  "repository": {
@@ -16,9 +16,9 @@
16
16
  "license": "MIT",
17
17
  "homepage": "https://github.com/anpham6/pi-r#readme",
18
18
  "dependencies": {
19
- "@e-mc/cloud": "^0.14.5",
20
- "@e-mc/module": "^0.14.5",
21
- "@e-mc/types": "^0.14.5",
19
+ "@e-mc/cloud": "^0.14.6",
20
+ "@e-mc/module": "^0.14.6",
21
+ "@e-mc/types": "^0.14.6",
22
22
  "@azure/cosmos": "^4.10.0",
23
23
  "@azure/identity": "*",
24
24
  "@azure/storage-blob": "^12.33.0"