@webiny/api-headless-cms 5.39.2 → 5.39.3-beta.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/api-headless-cms",
3
- "version": "5.39.2",
3
+ "version": "5.39.3-beta.0",
4
4
  "main": "index.js",
5
5
  "keywords": [
6
6
  "cms:base"
@@ -20,20 +20,20 @@
20
20
  "dependencies": {
21
21
  "@babel/runtime": "7.22.6",
22
22
  "@graphql-tools/schema": "7.1.5",
23
- "@webiny/api": "5.39.2",
24
- "@webiny/api-i18n": "5.39.2",
25
- "@webiny/api-security": "5.39.2",
26
- "@webiny/api-tenancy": "5.39.2",
27
- "@webiny/error": "5.39.2",
28
- "@webiny/handler": "5.39.2",
29
- "@webiny/handler-aws": "5.39.2",
30
- "@webiny/handler-db": "5.39.2",
31
- "@webiny/handler-graphql": "5.39.2",
32
- "@webiny/lexical-converter": "5.39.2",
33
- "@webiny/plugins": "5.39.2",
34
- "@webiny/pubsub": "5.39.2",
35
- "@webiny/utils": "5.39.2",
36
- "@webiny/validation": "5.39.2",
23
+ "@webiny/api": "5.39.3-beta.0",
24
+ "@webiny/api-i18n": "5.39.3-beta.0",
25
+ "@webiny/api-security": "5.39.3-beta.0",
26
+ "@webiny/api-tenancy": "5.39.3-beta.0",
27
+ "@webiny/error": "5.39.3-beta.0",
28
+ "@webiny/handler": "5.39.3-beta.0",
29
+ "@webiny/handler-aws": "5.39.3-beta.0",
30
+ "@webiny/handler-db": "5.39.3-beta.0",
31
+ "@webiny/handler-graphql": "5.39.3-beta.0",
32
+ "@webiny/lexical-converter": "5.39.3-beta.0",
33
+ "@webiny/plugins": "5.39.3-beta.0",
34
+ "@webiny/pubsub": "5.39.3-beta.0",
35
+ "@webiny/utils": "5.39.3-beta.0",
36
+ "@webiny/validation": "5.39.3-beta.0",
37
37
  "code-frame": "5.0.0",
38
38
  "dot-prop": "6.0.1",
39
39
  "graphql-tag": "2.12.6",
@@ -50,9 +50,9 @@
50
50
  "@babel/cli": "7.22.6",
51
51
  "@babel/core": "7.22.8",
52
52
  "@babel/preset-env": "7.22.7",
53
- "@webiny/api-wcp": "5.39.2",
54
- "@webiny/cli": "5.39.2",
55
- "@webiny/project-utils": "5.39.2",
53
+ "@webiny/api-wcp": "5.39.3-beta.0",
54
+ "@webiny/cli": "5.39.3-beta.0",
55
+ "@webiny/project-utils": "5.39.3-beta.0",
56
56
  "apollo-graphql": "0.9.7",
57
57
  "get-yarn-workspaces": "1.0.2",
58
58
  "graphql": "15.8.0",
@@ -72,5 +72,5 @@
72
72
  "build": "yarn webiny run build",
73
73
  "watch": "yarn webiny run watch"
74
74
  },
75
- "gitHead": "d25ece60370f08c6138d0af0340d8900acb95bac"
75
+ "gitHead": "bb0a2c8b43b2caa88f7a2d745a88039a520d124c"
76
76
  }
@@ -1,2 +1,3 @@
1
- import { ICacheKey, ICacheKeyKeys } from "./types";
1
+ import { ICacheKey } from "./types";
2
+ import { ICacheKeyKeys } from "@webiny/utils";
2
3
  export declare const createCacheKey: (key: ICacheKeyKeys) => ICacheKey;
@@ -1,29 +1,17 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.createCacheKey = void 0;
8
- var _crypto = _interopRequireDefault(require("crypto"));
9
- const getCacheKey = input => {
10
- if (typeof input === "string") {
11
- return input;
12
- } else if (typeof input === "number") {
13
- return `${input}`;
14
- }
15
- return JSON.stringify(input);
16
- };
17
- const createHash = input => {
18
- const key = getCacheKey(input);
19
- const hash = _crypto.default.createHash("sha1");
20
- hash.update(key);
21
- return hash.digest("hex");
22
- };
7
+ var _utils = require("@webiny/utils");
23
8
  class CacheKey {
24
9
  constructor(keys) {
25
10
  this.keys = keys;
26
- this.key = createHash(keys);
11
+ this.key = (0, _utils.createCacheKey)(keys, {
12
+ algorithm: "sha1",
13
+ encoding: "hex"
14
+ });
27
15
  }
28
16
  static create(key) {
29
17
  return new CacheKey(key);
@@ -1 +1 @@
1
- {"version":3,"names":["_crypto","_interopRequireDefault","require","getCacheKey","input","JSON","stringify","createHash","key","hash","crypto","update","digest","CacheKey","constructor","keys","create","get","createCacheKey","exports"],"sources":["CacheKey.ts"],"sourcesContent":["import crypto from \"crypto\";\nimport { ICacheKey, ICacheKeyKeys } from \"./types\";\n\nconst getCacheKey = (input: ICacheKeyKeys): string => {\n if (typeof input === \"string\") {\n return input;\n } else if (typeof input === \"number\") {\n return `${input}`;\n }\n return JSON.stringify(input);\n};\n\nconst createHash = (input: ICacheKeyKeys): string => {\n const key = getCacheKey(input);\n const hash = crypto.createHash(\"sha1\");\n hash.update(key);\n return hash.digest(\"hex\");\n};\n\nclass CacheKey implements ICacheKey {\n private readonly key: string;\n public readonly keys: ICacheKeyKeys;\n\n private constructor(keys: ICacheKeyKeys) {\n this.keys = keys;\n this.key = createHash(keys);\n }\n\n public static create(key: ICacheKeyKeys): ICacheKey {\n return new CacheKey(key);\n }\n\n public get(): string {\n return this.key;\n }\n}\n\nexport const createCacheKey = (key: ICacheKeyKeys) => {\n return CacheKey.create(key);\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAGA,MAAMC,WAAW,GAAIC,KAAoB,IAAa;EAClD,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC3B,OAAOA,KAAK;EAChB,CAAC,MAAM,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAClC,OAAQ,GAAEA,KAAM,EAAC;EACrB;EACA,OAAOC,IAAI,CAACC,SAAS,CAACF,KAAK,CAAC;AAChC,CAAC;AAED,MAAMG,UAAU,GAAIH,KAAoB,IAAa;EACjD,MAAMI,GAAG,GAAGL,WAAW,CAACC,KAAK,CAAC;EAC9B,MAAMK,IAAI,GAAGC,eAAM,CAACH,UAAU,CAAC,MAAM,CAAC;EACtCE,IAAI,CAACE,MAAM,CAACH,GAAG,CAAC;EAChB,OAAOC,IAAI,CAACG,MAAM,CAAC,KAAK,CAAC;AAC7B,CAAC;AAED,MAAMC,QAAQ,CAAsB;EAIxBC,WAAWA,CAACC,IAAmB,EAAE;IACrC,IAAI,CAACA,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACP,GAAG,GAAGD,UAAU,CAACQ,IAAI,CAAC;EAC/B;EAEA,OAAcC,MAAMA,CAACR,GAAkB,EAAa;IAChD,OAAO,IAAIK,QAAQ,CAACL,GAAG,CAAC;EAC5B;EAEOS,GAAGA,CAAA,EAAW;IACjB,OAAO,IAAI,CAACT,GAAG;EACnB;AACJ;AAEO,MAAMU,cAAc,GAAIV,GAAkB,IAAK;EAClD,OAAOK,QAAQ,CAACG,MAAM,CAACR,GAAG,CAAC;AAC/B,CAAC;AAACW,OAAA,CAAAD,cAAA,GAAAA,cAAA"}
1
+ {"version":3,"names":["_utils","require","CacheKey","constructor","keys","key","createCacheKeyValue","algorithm","encoding","create","get","createCacheKey","exports"],"sources":["CacheKey.ts"],"sourcesContent":["import { ICacheKey } from \"./types\";\nimport { createCacheKey as createCacheKeyValue, ICacheKeyKeys } from \"@webiny/utils\";\n\nclass CacheKey implements ICacheKey {\n private readonly key: string;\n public readonly keys: ICacheKeyKeys;\n\n private constructor(keys: ICacheKeyKeys) {\n this.keys = keys;\n this.key = createCacheKeyValue(keys, {\n algorithm: \"sha1\",\n encoding: \"hex\"\n });\n }\n\n public static create(key: ICacheKeyKeys): ICacheKey {\n return new CacheKey(key);\n }\n\n public get(): string {\n return this.key;\n }\n}\n\nexport const createCacheKey = (key: ICacheKeyKeys) => {\n return CacheKey.create(key);\n};\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAEA,MAAMC,QAAQ,CAAsB;EAIxBC,WAAWA,CAACC,IAAmB,EAAE;IACrC,IAAI,CAACA,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACC,GAAG,GAAG,IAAAC,qBAAmB,EAACF,IAAI,EAAE;MACjCG,SAAS,EAAE,MAAM;MACjBC,QAAQ,EAAE;IACd,CAAC,CAAC;EACN;EAEA,OAAcC,MAAMA,CAACJ,GAAkB,EAAa;IAChD,OAAO,IAAIH,QAAQ,CAACG,GAAG,CAAC;EAC5B;EAEOK,GAAGA,CAAA,EAAW;IACjB,OAAO,IAAI,CAACL,GAAG;EACnB;AACJ;AAEO,MAAMM,cAAc,GAAIN,GAAkB,IAAK;EAClD,OAAOH,QAAQ,CAACO,MAAM,CAACJ,GAAG,CAAC;AAC/B,CAAC;AAACO,OAAA,CAAAD,cAAA,GAAAA,cAAA"}
@@ -1,4 +1,5 @@
1
- export declare type ICacheKeyKeys = Record<string, string | undefined> | string | number;
1
+ import { ICacheKeyKeys } from "@webiny/utils";
2
+ export { ICacheKeyKeys };
2
3
  export interface ICacheKey {
3
4
  get(): string;
4
5
  keys: ICacheKeyKeys;
@@ -3,5 +3,12 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ Object.defineProperty(exports, "ICacheKeyKeys", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _utils.ICacheKeyKeys;
10
+ }
11
+ });
12
+ var _utils = require("@webiny/utils");
6
13
 
7
14
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["export type ICacheKeyKeys = Record<string, string | undefined> | string | number;\n\nexport interface ICacheKey {\n get(): string;\n keys: ICacheKeyKeys;\n}\n\nexport interface ICache<T = any> {\n get(cacheKey: ICacheKey): T | null;\n set(cacheKey: ICacheKey, value: T): T;\n getOrSet(cacheKey: ICacheKey, cb: () => T): T;\n clear(cacheKey?: ICacheKey | ICacheKey[]): void;\n}\n"],"mappings":""}
1
+ {"version":3,"names":["_utils","require"],"sources":["types.ts"],"sourcesContent":["import { ICacheKeyKeys } from \"@webiny/utils\";\n\nexport { ICacheKeyKeys };\n\nexport interface ICacheKey {\n get(): string;\n keys: ICacheKeyKeys;\n}\n\nexport interface ICache<T = any> {\n get(cacheKey: ICacheKey): T | null;\n set(cacheKey: ICacheKey, value: T): T;\n getOrSet(cacheKey: ICacheKey, cb: () => T): T;\n clear(cacheKey?: ICacheKey | ICacheKey[]): void;\n}\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA"}