@visualbravo/zenstack-cache 1.0.3 → 1.0.4

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/dist/plugin.cjs CHANGED
@@ -34,17 +34,11 @@ function defineCachePlugin(pluginOptions) {
34
34
  } },
35
35
  onQuery: async ({ args, model, operation, proceed, client }) => {
36
36
  if (args && "cache" in args) {
37
- let json;
38
- if (client.$auth) json = (0, stable_hash.stableHash)({
37
+ const json = (0, stable_hash.stableHash)({
39
38
  args,
40
39
  model,
41
40
  operation,
42
- userId: Object.keys(client.$auth).filter((key$1) => client.$schema.models[client.$schema.authType].idFields.includes(key$1)).join("_")
43
- });
44
- else json = (0, stable_hash.stableHash)({
45
- args,
46
- model,
47
- operation
41
+ auth: client.$auth
48
42
  });
49
43
  if (!json) throw new Error(`Failed to serialize cache entry for ${lowerCaseFirst(model)}.${operation}`);
50
44
  const cache = pluginOptions.provider;
package/dist/plugin.mjs CHANGED
@@ -32,17 +32,11 @@ function defineCachePlugin(pluginOptions) {
32
32
  } },
33
33
  onQuery: async ({ args, model, operation, proceed, client }) => {
34
34
  if (args && "cache" in args) {
35
- let json;
36
- if (client.$auth) json = stableHash({
35
+ const json = stableHash({
37
36
  args,
38
37
  model,
39
38
  operation,
40
- userId: Object.keys(client.$auth).filter((key$1) => client.$schema.models[client.$schema.authType].idFields.includes(key$1)).join("_")
41
- });
42
- else json = stableHash({
43
- args,
44
- model,
45
- operation
39
+ auth: client.$auth
46
40
  });
47
41
  if (!json) throw new Error(`Failed to serialize cache entry for ${lowerCaseFirst(model)}.${operation}`);
48
42
  const cache = pluginOptions.provider;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visualbravo/zenstack-cache",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "keywords": [
5
5
  "accelerate",
6
6
  "cache",