spice-js 2.6.19 → 2.6.21

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spice-js",
3
- "version": "2.6.19",
3
+ "version": "2.6.21",
4
4
  "description": "spice",
5
5
  "main": "build/index.js",
6
6
  "repository": {
@@ -436,17 +436,18 @@ export default class SpiceModel {
436
436
  if (args.skip_hooks != true) {
437
437
  await this.run_hook(args, "get", "before");
438
438
  }
439
- let key = `${this.type}::${args.id}`;
439
+ let key = `get::${this.type}::${args.id}`;
440
440
  let results = {};
441
441
  if (this.shouldUseCache(this.type)) {
442
442
  let cached_results = await this.getCacheProviderObject(this.type).get(
443
443
  key
444
444
  );
445
- results = cached_results?.value;
446
445
 
446
+ results = cached_results?.value;
447
447
  if (
448
448
  cached_results?.value == undefined ||
449
- (await this.shouldForceRefresh(cached_results))
449
+ (await this.shouldForceRefresh(cached_results)) ||
450
+ this.type == "workflow"
450
451
  ) {
451
452
  results = await this.database.get(args.id);
452
453
  await this.getCacheProviderObject(this.type).set(
@@ -511,7 +512,7 @@ export default class SpiceModel {
511
512
  await this.run_hook(this, "list", "before");
512
513
  }
513
514
  _.remove(args.ids, (o) => o == undefined);
514
- let key = `${this.type}::${_.join(args.ids, "|")}`;
515
+ let key = `multi-get::${this.type}::${_.join(args.ids, "|")}`;
515
516
  let results = [];
516
517
  if (args.ids.length > 0) {
517
518
  if (this.shouldUseCache(this.type)) {
@@ -890,7 +891,7 @@ export default class SpiceModel {
890
891
  return str.replace(/[^a-zA-Z0-9]/g, "");
891
892
  }
892
893
  let key = removeSpaceAndSpecialCharacters(
893
- `${this.type}::${args._join}::${query}::${args.limit}::${args.offset}::${args.sort}::${args.do_count}::${args.statement_consistent}::${args.columns}::${args.is_full_text}::${args.is_custom_query}`
894
+ `list::${this.type}::${args._join}::${query}::${args.limit}::${args.offset}::${args.sort}::${args.do_count}::${args.statement_consistent}::${args.columns}::${args.is_full_text}::${args.is_custom_query}`
894
895
  );
895
896
 
896
897
  let results;
@@ -1088,6 +1089,7 @@ export default class SpiceModel {
1088
1089
  ...this[_args],
1089
1090
  skip_cache: this[_skip_cache],
1090
1091
  }).getMulti({
1092
+ skip_hooks: true,
1091
1093
  ids: ids,
1092
1094
  });
1093
1095
  })
@@ -1145,6 +1147,7 @@ export default class SpiceModel {
1145
1147
  ...this[_args],
1146
1148
  skip_cache: this[_skip_cache],
1147
1149
  }).getMulti({
1150
+ skip_hooks: true,
1148
1151
  ids: ids,
1149
1152
  });
1150
1153
  })