@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/crud/contentModel/validation.d.ts +84 -84
- package/crud/contentModel.crud.js +52 -45
- package/crud/contentModel.crud.js.map +1 -1
- package/crud/contentModelGroup/validation.d.ts +1 -1
- package/crud/contentModelGroup.crud.js +39 -28
- package/crud/contentModelGroup.crud.js.map +1 -1
- package/graphql/index.d.ts +1 -1
- package/index.d.ts +1 -1
- package/package.json +18 -18
- package/utils/caching/CacheKey.d.ts +2 -3
- package/utils/caching/CacheKey.js +6 -4
- package/utils/caching/CacheKey.js.map +1 -1
- package/utils/caching/types.d.ts +2 -0
- package/utils/caching/types.js.map +1 -1
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("
|
|
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
|
+
"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.
|
|
24
|
-
"@webiny/api-i18n": "5.38.0-beta.
|
|
25
|
-
"@webiny/api-security": "5.38.0-beta.
|
|
26
|
-
"@webiny/api-tenancy": "5.38.0-beta.
|
|
27
|
-
"@webiny/error": "5.38.0-beta.
|
|
28
|
-
"@webiny/handler": "5.38.0-beta.
|
|
29
|
-
"@webiny/handler-aws": "5.38.0-beta.
|
|
30
|
-
"@webiny/handler-db": "5.38.0-beta.
|
|
31
|
-
"@webiny/handler-graphql": "5.38.0-beta.
|
|
32
|
-
"@webiny/plugins": "5.38.0-beta.
|
|
33
|
-
"@webiny/pubsub": "5.38.0-beta.
|
|
34
|
-
"@webiny/utils": "5.38.0-beta.
|
|
35
|
-
"@webiny/validation": "5.38.0-beta.
|
|
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.
|
|
52
|
-
"@webiny/cli": "5.38.0-beta.
|
|
53
|
-
"@webiny/project-utils": "5.38.0-beta.
|
|
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": "
|
|
73
|
+
"gitHead": "ca05a6c9e3e32a5255d3a2b5a79c000d709aab53"
|
|
74
74
|
}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { ICacheKey } from "./types";
|
|
2
|
-
export declare
|
|
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(
|
|
26
|
-
(0, _defineProperty2.default)(this, "
|
|
27
|
-
this
|
|
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.
|
|
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","
|
|
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"}
|
package/utils/caching/types.d.ts
CHANGED
|
@@ -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":""}
|