@common-stack/server-core 7.0.4-alpha.5 → 7.0.4-alpha.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 +1,2 @@
1
- export declare const generateQueryCacheKey: (query: string, variables: Record<string, unknown>) => string;
1
+ import { CdmLogger } from '@cdm-logger/core';
2
+ export declare const generateQueryCacheKey: (query: string, variables: Record<string, unknown>, logger?: CdmLogger.ILogger) => string;
@@ -1,7 +1,12 @@
1
- import {createHash}from'crypto';import {parse,print}from'graphql/language';const generateQueryCacheKey = (query, variables) => {
1
+ import {createHash}from'crypto';import {parse,print}from'graphql/language';const generateQueryCacheKey = (query, variables, logger) => {
2
2
  const [, queryName] = query?.match(/{\s*(\w+)/) ?? [];
3
3
  const parsedQuery = parse(query);
4
4
  const normalizedQuery = print(parsedQuery).trim();
5
+ // Log the data right before hashing
6
+ if (logger) {
7
+ logger.trace('About to hash normalized query: [%s]', normalizedQuery);
8
+ logger.trace('About to hash variables: [%j]', variables);
9
+ }
5
10
  const queryHash = createHash('sha256').update(normalizedQuery).digest('hex');
6
11
  const variablesHash = createHash('sha256').update(JSON.stringify(variables)).digest('hex');
7
12
  return `${queryName}:${queryHash}:${variablesHash}`;
@@ -1 +1 @@
1
- {"version":3,"file":"generate-query-cache-key.js","sources":["../../src/utils/generate-query-cache-key.ts"],"sourcesContent":[null],"names":[],"mappings":"iFAGa,qBAAqB,GAAG,CAAC,KAAa,EAAE,SAAkC,KAAI;AACvF,IAAA,MAAM,GAAG,SAAS,CAAC,GAAG,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;AACtD,IAAA,MAAM,WAAW,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;IACjC,MAAM,eAAe,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,CAAC;AAClD,IAAA,MAAM,SAAS,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC7E,MAAM,aAAa,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC3F,IAAA,OAAO,GAAG,SAAS,CAAA,CAAA,EAAI,SAAS,CAAI,CAAA,EAAA,aAAa,EAAE,CAAC;AACxD"}
1
+ {"version":3,"file":"generate-query-cache-key.js","sources":["../../src/utils/generate-query-cache-key.ts"],"sourcesContent":[null],"names":[],"mappings":"2EAIa,MAAA,qBAAqB,GAAG,CACjC,KAAa,EACb,SAAkC,EAClC,MAA0B,KAC1B;AACA,IAAA,MAAM,GAAG,SAAS,CAAC,GAAG,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;AACtD,IAAA,MAAM,WAAW,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;IACjC,MAAM,eAAe,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,CAAC;;IAGlD,IAAI,MAAM,EAAE;AACR,QAAA,MAAM,CAAC,KAAK,CAAC,sCAAsC,EAAE,eAAe,CAAC,CAAC;AACtE,QAAA,MAAM,CAAC,KAAK,CAAC,+BAA+B,EAAE,SAAS,CAAC,CAAC;KAC5D;AAED,IAAA,MAAM,SAAS,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC7E,MAAM,aAAa,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC3F,IAAA,OAAO,GAAG,SAAS,CAAA,CAAA,EAAI,SAAS,CAAI,CAAA,EAAA,aAAa,EAAE,CAAC;AACxD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@common-stack/server-core",
3
- "version": "7.0.4-alpha.5",
3
+ "version": "7.0.4-alpha.7",
4
4
  "description": "common core for higher packages to depend on",
5
5
  "license": "ISC",
6
6
  "author": "CDMBase LLC",
@@ -24,7 +24,7 @@
24
24
  "watch": "yarn build:lib:watch"
25
25
  },
26
26
  "dependencies": {
27
- "@common-stack/core": "7.0.4-alpha.0"
27
+ "@common-stack/core": "7.0.4-alpha.6"
28
28
  },
29
29
  "peerDependencies": {
30
30
  "@cdm-logger/core": ">=7.0.12",
@@ -33,7 +33,7 @@
33
33
  "publishConfig": {
34
34
  "access": "public"
35
35
  },
36
- "gitHead": "e33d6d076a06ace10827a4b53e052dbfe1546150",
36
+ "gitHead": "7e104c5fa18cbce2c32cd60de26b45a94f387081",
37
37
  "typescript": {
38
38
  "definition": "lib/index.d.ts"
39
39
  }