@webiny/api-headless-cms 5.38.0-beta.3 → 5.38.0-beta.5

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/index.d.ts CHANGED
@@ -2,7 +2,7 @@ import { CreateGraphQLParams } from "./graphql";
2
2
  import { CrudParams } from "./context";
3
3
  import { entryFieldFromStorageTransform, entryFromStorageTransform, entryToStorageTransform } from "./utils/entryStorage";
4
4
  export declare type CreateHeadlessCmsGraphQLParams = CreateGraphQLParams;
5
- export declare const createHeadlessCmsGraphQL: (params?: CreateHeadlessCmsGraphQLParams) => (import("@webiny/plugins/types").PluginCollection | import("./plugins").CmsParametersPlugin | import("@webiny/handler-graphql").GraphQLSchemaPlugin<import("./types").CmsContext> | import("@webiny/api").ContextPlugin<import("@webiny/api/types").Context>)[];
5
+ export declare const createHeadlessCmsGraphQL: (params?: CreateHeadlessCmsGraphQLParams) => (import("./plugins").CmsParametersPlugin | import("@webiny/handler-graphql").GraphQLSchemaPlugin<import("./types").CmsContext> | import("@webiny/plugins/types").PluginCollection | import("@webiny/api").ContextPlugin<import("@webiny/api/types").Context>)[];
6
6
  export declare type ContentContextParams = CrudParams;
7
7
  export declare const createHeadlessCmsContext: (params: ContentContextParams) => (import("./types").ModelManagerPlugin | import("./plugins").StorageTransformPlugin<any, any, import("./types").CmsModelField> | import("@webiny/api").ContextPlugin<import("./types").CmsContext> | import("./plugins").StorageTransformPlugin<any, any, import("./types").CmsModelDynamicZoneField> | import("./types").CmsModelFieldToGraphQLPlugin<any>[] | (import("./types").CmsModelFieldValidatorPlugin | import("./types").CmsModelFieldPatternValidatorPlugin[])[] | (import("./fieldConverters/CmsModelObjectFieldConverterPlugin").CmsModelObjectFieldConverterPlugin | import("./fieldConverters/CmsModelDefaultFieldConverterPlugin").CmsModelDefaultFieldConverterPlugin | import("./fieldConverters/CmsModelDynamicZoneFieldConverterPlugin").CmsModelDynamicZoneFieldConverterPlugin)[])[];
8
8
  export * from "./graphqlFields";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/api-headless-cms",
3
- "version": "5.38.0-beta.3",
3
+ "version": "5.38.0-beta.5",
4
4
  "main": "index.js",
5
5
  "keywords": [
6
6
  "cms:base"
@@ -20,19 +20,19 @@
20
20
  "dependencies": {
21
21
  "@babel/runtime": "7.22.6",
22
22
  "@graphql-tools/schema": "7.1.5",
23
- "@webiny/api": "5.38.0-beta.3",
24
- "@webiny/api-i18n": "5.38.0-beta.3",
25
- "@webiny/api-security": "5.38.0-beta.3",
26
- "@webiny/api-tenancy": "5.38.0-beta.3",
27
- "@webiny/error": "5.38.0-beta.3",
28
- "@webiny/handler": "5.38.0-beta.3",
29
- "@webiny/handler-aws": "5.38.0-beta.3",
30
- "@webiny/handler-db": "5.38.0-beta.3",
31
- "@webiny/handler-graphql": "5.38.0-beta.3",
32
- "@webiny/plugins": "5.38.0-beta.3",
33
- "@webiny/pubsub": "5.38.0-beta.3",
34
- "@webiny/utils": "5.38.0-beta.3",
35
- "@webiny/validation": "5.38.0-beta.3",
23
+ "@webiny/api": "5.38.0-beta.5",
24
+ "@webiny/api-i18n": "5.38.0-beta.5",
25
+ "@webiny/api-security": "5.38.0-beta.5",
26
+ "@webiny/api-tenancy": "5.38.0-beta.5",
27
+ "@webiny/error": "5.38.0-beta.5",
28
+ "@webiny/handler": "5.38.0-beta.5",
29
+ "@webiny/handler-aws": "5.38.0-beta.5",
30
+ "@webiny/handler-db": "5.38.0-beta.5",
31
+ "@webiny/handler-graphql": "5.38.0-beta.5",
32
+ "@webiny/plugins": "5.38.0-beta.5",
33
+ "@webiny/pubsub": "5.38.0-beta.5",
34
+ "@webiny/utils": "5.38.0-beta.5",
35
+ "@webiny/validation": "5.38.0-beta.5",
36
36
  "code-frame": "5.0.0",
37
37
  "dot-prop": "6.0.1",
38
38
  "graphql-tag": "2.12.6",
@@ -48,9 +48,9 @@
48
48
  "@babel/cli": "7.22.6",
49
49
  "@babel/core": "7.22.8",
50
50
  "@babel/preset-env": "7.22.7",
51
- "@webiny/api-wcp": "5.38.0-beta.3",
52
- "@webiny/cli": "5.38.0-beta.3",
53
- "@webiny/project-utils": "5.38.0-beta.3",
51
+ "@webiny/api-wcp": "5.38.0-beta.5",
52
+ "@webiny/cli": "5.38.0-beta.5",
53
+ "@webiny/project-utils": "5.38.0-beta.5",
54
54
  "apollo-graphql": "0.9.7",
55
55
  "get-yarn-workspaces": "1.0.2",
56
56
  "graphql": "15.8.0",
@@ -70,5 +70,5 @@
70
70
  "build": "yarn webiny run build",
71
71
  "watch": "yarn webiny run watch"
72
72
  },
73
- "gitHead": "fa1befb07e92cfe36928481333308d88c3348d6b"
73
+ "gitHead": "ca05a6c9e3e32a5255d3a2b5a79c000d709aab53"
74
74
  }
@@ -1,3 +1,2 @@
1
- import { ICacheKey } from "./types";
2
- export declare type CacheKeyInput = Record<string, any> | string | number;
3
- export declare const createCacheKey: (key: CacheKeyInput) => ICacheKey;
1
+ import { ICacheKey, ICacheKeyKeys } from "./types";
2
+ export declare const createCacheKey: (key: ICacheKeyKeys) => ICacheKey;
@@ -22,15 +22,17 @@ const createHash = input => {
22
22
  return hash.digest("hex");
23
23
  };
24
24
  class CacheKey {
25
- constructor(key) {
26
- (0, _defineProperty2.default)(this, "_key", void 0);
27
- this._key = createHash(key);
25
+ constructor(keys) {
26
+ (0, _defineProperty2.default)(this, "key", void 0);
27
+ (0, _defineProperty2.default)(this, "keys", void 0);
28
+ this.keys = keys;
29
+ this.key = createHash(keys);
28
30
  }
29
31
  static create(key) {
30
32
  return new CacheKey(key);
31
33
  }
32
34
  get() {
33
- return this._key;
35
+ return this.key;
34
36
  }
35
37
  }
36
38
  const createCacheKey = key => {
@@ -1 +1 @@
1
- {"version":3,"names":["_crypto","_interopRequireDefault","require","getCacheKey","input","JSON","stringify","createHash","key","hash","crypto","update","digest","CacheKey","constructor","_defineProperty2","default","_key","create","get","createCacheKey","exports"],"sources":["CacheKey.ts"],"sourcesContent":["import crypto from \"crypto\";\nimport { ICacheKey } from \"./types\";\n\nexport type CacheKeyInput = Record<string, any> | string | number;\n\nconst getCacheKey = (input: CacheKeyInput): 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: CacheKeyInput): 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\n private constructor(key: CacheKeyInput) {\n this._key = createHash(key);\n }\n\n public static create(key: CacheKeyInput): ICacheKey {\n return new CacheKey(key);\n }\n\n public get(): string {\n return this._key;\n }\n}\n\nexport const createCacheKey = (key: CacheKeyInput) => {\n return CacheKey.create(key);\n};\n"],"mappings":";;;;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,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;EAGxBC,WAAWA,CAACN,GAAkB,EAAE;IAAA,IAAAO,gBAAA,CAAAC,OAAA;IACpC,IAAI,CAACC,IAAI,GAAGV,UAAU,CAACC,GAAG,CAAC;EAC/B;EAEA,OAAcU,MAAMA,CAACV,GAAkB,EAAa;IAChD,OAAO,IAAIK,QAAQ,CAACL,GAAG,CAAC;EAC5B;EAEOW,GAAGA,CAAA,EAAW;IACjB,OAAO,IAAI,CAACF,IAAI;EACpB;AACJ;AAEO,MAAMG,cAAc,GAAIZ,GAAkB,IAAK;EAClD,OAAOK,QAAQ,CAACK,MAAM,CAACV,GAAG,CAAC;AAC/B,CAAC;AAACa,OAAA,CAAAD,cAAA,GAAAA,cAAA"}
1
+ {"version":3,"names":["_crypto","_interopRequireDefault","require","getCacheKey","input","JSON","stringify","createHash","key","hash","crypto","update","digest","CacheKey","constructor","keys","_defineProperty2","default","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;IAAA,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IACrC,IAAI,CAACF,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACP,GAAG,GAAGD,UAAU,CAACQ,IAAI,CAAC;EAC/B;EAEA,OAAcG,MAAMA,CAACV,GAAkB,EAAa;IAChD,OAAO,IAAIK,QAAQ,CAACL,GAAG,CAAC;EAC5B;EAEOW,GAAGA,CAAA,EAAW;IACjB,OAAO,IAAI,CAACX,GAAG;EACnB;AACJ;AAEO,MAAMY,cAAc,GAAIZ,GAAkB,IAAK;EAClD,OAAOK,QAAQ,CAACK,MAAM,CAACV,GAAG,CAAC;AAC/B,CAAC;AAACa,OAAA,CAAAD,cAAA,GAAAA,cAAA"}
@@ -1,5 +1,7 @@
1
+ export declare type ICacheKeyKeys = Record<string, string | undefined> | string | number;
1
2
  export interface ICacheKey {
2
3
  get(): string;
4
+ keys: ICacheKeyKeys;
3
5
  }
4
6
  export interface ICache<T = any> {
5
7
  get(cacheKey: ICacheKey): T | null;
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["export interface ICacheKey {\n get(): string;\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":[],"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":""}