@webiny/api-headless-cms 5.33.0-beta.1 → 5.33.1-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.
@@ -2,4 +2,4 @@ import { GraphQLSchemaPlugin } from "@webiny/handler-graphql/types";
2
2
  import { GraphQLHandlerFactoryParams } from "./graphQLHandlerFactory";
3
3
  import { CmsContext } from "../types";
4
4
  export declare type CreateGraphQLParams = GraphQLHandlerFactoryParams;
5
- export declare const createGraphQL: (params: CreateGraphQLParams) => (import("@webiny/plugins/types").PluginCollection | import("@webiny/api").ContextPlugin<CmsContext> | GraphQLSchemaPlugin<CmsContext>)[];
5
+ export declare const createGraphQL: (params: CreateGraphQLParams) => (import("@webiny/api").ContextPlugin<CmsContext> | GraphQLSchemaPlugin<CmsContext> | import("@webiny/plugins/types").PluginCollection)[];
package/index.d.ts CHANGED
@@ -2,7 +2,7 @@ import { CreateGraphQLParams } from "./graphql";
2
2
  import { CrudParams } from "./crud";
3
3
  import { entryFieldFromStorageTransform, entryFromStorageTransform, entryToStorageTransform } from "./utils/entryStorage";
4
4
  export declare type CreateHeadlessCmsGraphQLParams = CreateGraphQLParams;
5
- export declare const createHeadlessCmsGraphQL: (params?: CreateHeadlessCmsGraphQLParams) => (import("./plugins").CmsParametersPlugin | (import("@webiny/plugins/types").PluginCollection | import("@webiny/api").ContextPlugin<import("./types").CmsContext> | import("@webiny/handler-graphql/types").GraphQLSchemaPlugin<import("./types").CmsContext>)[])[];
5
+ export declare const createHeadlessCmsGraphQL: (params?: CreateHeadlessCmsGraphQLParams) => (import("./plugins").CmsParametersPlugin | (import("@webiny/api").ContextPlugin<import("./types").CmsContext> | import("@webiny/handler-graphql/types").GraphQLSchemaPlugin<import("./types").CmsContext> | import("@webiny/plugins/types").PluginCollection)[])[];
6
6
  export declare type ContentContextParams = CrudParams;
7
7
  export declare const createHeadlessCmsContext: (params: ContentContextParams) => (import("./types").CmsModelFieldToGraphQLPlugin[] | import("./types").ModelManagerPlugin | import("@webiny/api").ContextPlugin<import("./types").CmsContext> | import("./plugins").StorageTransformPlugin<any, any> | import("@webiny/api-upgrade").UpgradePlugin<import("./types").CmsContext>[] | (import("./types").CmsModelFieldValidatorPlugin | import("./types").CmsModelFieldPatternValidatorPlugin[])[] | (import("./fieldConverters/CmsModelObjectFieldConverterPlugin").CmsModelObjectFieldConverterPlugin | import("./fieldConverters/CmsModelDefaultFieldConverterPlugin").CmsModelDefaultFieldConverterPlugin)[])[];
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.33.0-beta.1",
3
+ "version": "5.33.1-beta.0",
4
4
  "main": "index.js",
5
5
  "keywords": [
6
6
  "cms:base"
@@ -21,22 +21,22 @@
21
21
  "@babel/runtime": "7.18.9",
22
22
  "@commodo/fields": "1.1.2-beta.20",
23
23
  "@graphql-tools/schema": "7.1.5",
24
- "@webiny/api": "5.33.0-beta.1",
25
- "@webiny/api-file-manager": "5.33.0-beta.1",
26
- "@webiny/api-i18n": "5.33.0-beta.1",
27
- "@webiny/api-i18n-ddb": "5.33.0-beta.1",
28
- "@webiny/api-security": "5.33.0-beta.1",
29
- "@webiny/api-tenancy": "5.33.0-beta.1",
30
- "@webiny/api-upgrade": "5.33.0-beta.1",
31
- "@webiny/error": "5.33.0-beta.1",
32
- "@webiny/handler": "5.33.0-beta.1",
33
- "@webiny/handler-aws": "5.33.0-beta.1",
34
- "@webiny/handler-db": "5.33.0-beta.1",
35
- "@webiny/handler-graphql": "5.33.0-beta.1",
36
- "@webiny/plugins": "5.33.0-beta.1",
37
- "@webiny/pubsub": "5.33.0-beta.1",
38
- "@webiny/utils": "5.33.0-beta.1",
39
- "@webiny/validation": "5.33.0-beta.1",
24
+ "@webiny/api": "5.33.1-beta.0",
25
+ "@webiny/api-file-manager": "5.33.1-beta.0",
26
+ "@webiny/api-i18n": "5.33.1-beta.0",
27
+ "@webiny/api-i18n-ddb": "5.33.1-beta.0",
28
+ "@webiny/api-security": "5.33.1-beta.0",
29
+ "@webiny/api-tenancy": "5.33.1-beta.0",
30
+ "@webiny/api-upgrade": "5.33.1-beta.0",
31
+ "@webiny/error": "5.33.1-beta.0",
32
+ "@webiny/handler": "5.33.1-beta.0",
33
+ "@webiny/handler-aws": "5.33.1-beta.0",
34
+ "@webiny/handler-db": "5.33.1-beta.0",
35
+ "@webiny/handler-graphql": "5.33.1-beta.0",
36
+ "@webiny/plugins": "5.33.1-beta.0",
37
+ "@webiny/pubsub": "5.33.1-beta.0",
38
+ "@webiny/utils": "5.33.1-beta.0",
39
+ "@webiny/validation": "5.33.1-beta.0",
40
40
  "commodo-fields-object": "1.0.6",
41
41
  "dataloader": "2.1.0",
42
42
  "dot-prop": "6.0.1",
@@ -53,11 +53,11 @@
53
53
  "@babel/core": "^7.16.0",
54
54
  "@babel/preset-env": "^7.16.4",
55
55
  "@babel/preset-flow": "^7.16.0",
56
- "@webiny/api-security-so-ddb": "^5.33.0-beta.1",
57
- "@webiny/api-tenancy-so-ddb": "^5.33.0-beta.1",
58
- "@webiny/api-wcp": "^5.33.0-beta.1",
59
- "@webiny/cli": "^5.33.0-beta.1",
60
- "@webiny/project-utils": "^5.33.0-beta.1",
56
+ "@webiny/api-security-so-ddb": "^5.33.1-beta.0",
57
+ "@webiny/api-tenancy-so-ddb": "^5.33.1-beta.0",
58
+ "@webiny/api-wcp": "^5.33.1-beta.0",
59
+ "@webiny/cli": "^5.33.1-beta.0",
60
+ "@webiny/project-utils": "^5.33.1-beta.0",
61
61
  "apollo-graphql": "^0.9.5",
62
62
  "get-yarn-workspaces": "^1.0.2",
63
63
  "graphql": "^15.7.2",
@@ -77,5 +77,5 @@
77
77
  "build": "yarn webiny run build",
78
78
  "watch": "yarn webiny run watch"
79
79
  },
80
- "gitHead": "537fe39e2309315f01aa41b1e4cacddccee9a10b"
80
+ "gitHead": "0ba3126491ed1d79eafb0aa01364b37246bb93de"
81
81
  }
@@ -21,4 +21,11 @@ export declare class ConverterCollection {
21
21
  getConverter(type: string): Converter;
22
22
  convertToStorage(params: ConverterCollectionConvertParams): CmsEntryValues | undefined;
23
23
  convertFromStorage(params: ConverterCollectionConvertParams): CmsEntryValues | undefined;
24
+ /**
25
+ * This method attaches hasOwnProperty when received object was created via Object.create(null) - no inheritance of Object.
26
+ * At that point, hasOwnProperty does not exist, and we need to add it.
27
+ *
28
+ * TODO add more checks if required
29
+ */
30
+ private attachHasOwnProperty;
24
31
  }
@@ -70,6 +70,7 @@ class ConverterCollection {
70
70
  return undefined;
71
71
  }
72
72
 
73
+ this.attachHasOwnProperty(inputValues);
73
74
  return fields.reduce((output, field) => {
74
75
  const converter = this.getConverter(field.type);
75
76
 
@@ -109,6 +110,31 @@ class ConverterCollection {
109
110
  return _objectSpread(_objectSpread({}, output), values);
110
111
  }, {});
111
112
  }
113
+ /**
114
+ * This method attaches hasOwnProperty when received object was created via Object.create(null) - no inheritance of Object.
115
+ * At that point, hasOwnProperty does not exist, and we need to add it.
116
+ *
117
+ * TODO add more checks if required
118
+ */
119
+
120
+
121
+ attachHasOwnProperty(values) {
122
+ if ( // null or undefined?
123
+ values === null || values === undefined || // not an object?
124
+ typeof values !== "object" || // maybe it's an array?
125
+ Array.isArray(values) || // and in the end, check if hasOwnProperty is a function already
126
+ typeof (values === null || values === void 0 ? void 0 : values.hasOwnProperty) === "function") {
127
+ return;
128
+ }
129
+
130
+ Object.defineProperty(values, "hasOwnProperty", {
131
+ enumerable: false,
132
+ writable: false,
133
+ value: function (property) {
134
+ return this[property] !== undefined;
135
+ }
136
+ });
137
+ }
112
138
 
113
139
  }
114
140
 
@@ -1 +1 @@
1
- {"version":3,"names":["ConverterCollection","constructor","params","Map","plugins","fieldGraphQLPlugins","byType","fieldConverterPlugins","CmsModelFieldConverterPlugin","type","defaultFieldConverterPlugin","find","pl","getFieldType","undefined","WebinyError","fieldGraphQLPlugin","plugin","fieldType","converter","Converter","addConverter","setConverterCollection","converters","set","getType","getConverter","get","convertToStorage","fields","values","inputValues","reduce","output","field","hasOwnProperty","fieldId","value","convertFromStorage","storageId"],"sources":["ConverterCollection.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { Converter } from \"./Converter\";\nimport { CmsEntryValues, CmsModelField, CmsModelFieldToGraphQLPlugin } from \"~/types\";\nimport { CmsModelFieldConverterPlugin } from \"~/plugins\";\nimport { PluginsContainer } from \"@webiny/plugins\";\n\nexport interface CmsModelFieldsWithParent extends CmsModelField {\n parent?: CmsModelField | null;\n}\n\nexport interface CmsModelConverterCallable {\n (params: ConverterCollectionConvertParams): CmsEntryValues;\n}\n\nexport interface ConverterCollectionConvertParams {\n fields: CmsModelFieldsWithParent[];\n values?: CmsEntryValues;\n}\n\nexport interface ConverterCollectionParams {\n plugins: PluginsContainer;\n}\n\nexport class ConverterCollection {\n private readonly converters: Map<string, Converter> = new Map();\n\n public constructor(params: ConverterCollectionParams) {\n const { plugins } = params;\n const fieldGraphQLPlugins = plugins.byType<CmsModelFieldToGraphQLPlugin>(\n \"cms-model-field-to-graphql\"\n );\n const fieldConverterPlugins = plugins.byType<CmsModelFieldConverterPlugin>(\n CmsModelFieldConverterPlugin.type\n );\n const defaultFieldConverterPlugin = fieldConverterPlugins.find(\n pl => pl.getFieldType() === \"*\"\n );\n if (defaultFieldConverterPlugin === undefined) {\n throw new WebinyError(\n `Missing default field converter plugin.`,\n \"DEFAULT_FIELD_CONVERTER_ERROR\"\n );\n }\n for (const fieldGraphQLPlugin of fieldGraphQLPlugins) {\n const plugin = fieldConverterPlugins.find(\n pl => pl.getFieldType() === fieldGraphQLPlugin.fieldType\n );\n const converter = new Converter({\n type: fieldGraphQLPlugin.fieldType,\n plugin: plugin || defaultFieldConverterPlugin\n });\n\n this.addConverter(converter);\n }\n }\n\n public addConverter(converter: Converter): void {\n converter.setConverterCollection(this);\n this.converters.set(converter.getType(), converter);\n }\n\n public getConverter(type: string): Converter {\n const converter = this.converters.get(type);\n if (converter === undefined) {\n throw new WebinyError(\n `Missing converter for field type \"${type}\".`,\n \"CONVERTER_ERROR\",\n {\n type\n }\n );\n }\n return converter;\n }\n\n public convertToStorage(params: ConverterCollectionConvertParams): CmsEntryValues | undefined {\n const { fields, values: inputValues } = params;\n if (inputValues === undefined) {\n return undefined;\n }\n\n return fields.reduce<CmsEntryValues>((output, field) => {\n const converter = this.getConverter(field.type);\n if (inputValues === null || inputValues.hasOwnProperty(field.fieldId) === false) {\n return output;\n }\n const values = converter.convertToStorage({\n field,\n value: inputValues[field.fieldId]\n });\n\n return {\n ...output,\n ...values\n };\n }, {});\n }\n\n public convertFromStorage(\n params: ConverterCollectionConvertParams\n ): CmsEntryValues | undefined {\n const { fields, values: inputValues } = params;\n if (inputValues === undefined) {\n return undefined;\n }\n\n return fields.reduce((output, field) => {\n const converter = this.getConverter(field.type);\n if (inputValues === null || inputValues.hasOwnProperty(field.storageId) === false) {\n return output;\n }\n const values = converter.convertFromStorage({\n field,\n value: inputValues[field.storageId]\n });\n\n return {\n ...output,\n ...values\n };\n }, {});\n }\n}\n"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AAEA;;;;;;AAoBO,MAAMA,mBAAN,CAA0B;EAGtBC,WAAW,CAACC,MAAD,EAAoC;IAAA,kDAFA,IAAIC,GAAJ,EAEA;IAClD,MAAM;MAAEC;IAAF,IAAcF,MAApB;IACA,MAAMG,mBAAmB,GAAGD,OAAO,CAACE,MAAR,CACxB,4BADwB,CAA5B;IAGA,MAAMC,qBAAqB,GAAGH,OAAO,CAACE,MAAR,CAC1BE,qCAAA,CAA6BC,IADH,CAA9B;IAGA,MAAMC,2BAA2B,GAAGH,qBAAqB,CAACI,IAAtB,CAChCC,EAAE,IAAIA,EAAE,CAACC,YAAH,OAAsB,GADI,CAApC;;IAGA,IAAIH,2BAA2B,KAAKI,SAApC,EAA+C;MAC3C,MAAM,IAAIC,cAAJ,CACD,yCADC,EAEF,+BAFE,CAAN;IAIH;;IACD,KAAK,MAA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MAAP;MACH;;MACD,MAAMH,MAAM,GAAGX,SAAS,CAACS,gBAAV,CAA2B;QACtCM,KADsC;QAEtCG,KAAK,EAAEN,WAAW,CAACG,KAAK,CAACE,OAAP;MAFoB,CAA3B,CAAf;MAKA,uCACOH,MADP,GAEOH,MAFP;IAIH,CAdM,EAcJ,EAdI,CAAP;EAeH;;EAEMQ,kBAAkB,CACrBpC,MADqB,EAEK;IAC1B,MAAM;MAAE2B,MAAF;MAAUC,MAAM,EAAEC;IAAlB,IAAkC7B,MAAxC;;IACA,IAAI6B,WAAW,KAAKjB,SAApB,EAA+B;MAC3B,OAAOA,SAAP;IACH;;IAED,OAAOe,MAAM,CAACG,MAAP,CAAc,CAACC,MAAD,EAASC,KAAT,KAAmB;MACpC,MAAMf,SAAS,GAAG,KAAKO,YAAL,CAAkBQ,KAAK,CAACzB,IAAxB,CAAlB;;MACA,IAAIsB,WAAW,KAAK,IAAhB,IAAwBA,WAAW,CAACI,cAAZ,CAA2BD,KAAK,CAACK,SAAjC,MAAgD,KAA5E,EAAmF;QAC/E,OAAON,MAAP;MACH;;MACD,MAAMH,MAAM,GAAGX,SAAS,CAACmB,kBAAV,CAA6B;QACxCJ,KADwC;QAExCG,KAAK,EAAEN,WAAW,CAACG,KAAK,CAACK,SAAP;MAFsB,CAA7B,CAAf;MAKA,uCACON,MADP,GAEOH,MAFP;IAIH,CAdM,EAcJ,EAdI,CAAP;EAeH;;AAlG4B"}
1
+ {"version":3,"names":["ConverterCollection","constructor","params","Map","plugins","fieldGraphQLPlugins","byType","fieldConverterPlugins","CmsModelFieldConverterPlugin","type","defaultFieldConverterPlugin","find","pl","getFieldType","undefined","WebinyError","fieldGraphQLPlugin","plugin","fieldType","converter","Converter","addConverter","setConverterCollection","converters","set","getType","getConverter","get","convertToStorage","fields","values","inputValues","attachHasOwnProperty","reduce","output","field","hasOwnProperty","fieldId","value","convertFromStorage","storageId","Array","isArray","Object","defineProperty","enumerable","writable","property"],"sources":["ConverterCollection.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { Converter } from \"./Converter\";\nimport { CmsEntryValues, CmsModelField, CmsModelFieldToGraphQLPlugin } from \"~/types\";\nimport { CmsModelFieldConverterPlugin } from \"~/plugins\";\nimport { PluginsContainer } from \"@webiny/plugins\";\n\nexport interface CmsModelFieldsWithParent extends CmsModelField {\n parent?: CmsModelField | null;\n}\n\nexport interface CmsModelConverterCallable {\n (params: ConverterCollectionConvertParams): CmsEntryValues;\n}\n\nexport interface ConverterCollectionConvertParams {\n fields: CmsModelFieldsWithParent[];\n values?: CmsEntryValues;\n}\n\nexport interface ConverterCollectionParams {\n plugins: PluginsContainer;\n}\n\nexport class ConverterCollection {\n private readonly converters: Map<string, Converter> = new Map();\n\n public constructor(params: ConverterCollectionParams) {\n const { plugins } = params;\n const fieldGraphQLPlugins = plugins.byType<CmsModelFieldToGraphQLPlugin>(\n \"cms-model-field-to-graphql\"\n );\n const fieldConverterPlugins = plugins.byType<CmsModelFieldConverterPlugin>(\n CmsModelFieldConverterPlugin.type\n );\n const defaultFieldConverterPlugin = fieldConverterPlugins.find(\n pl => pl.getFieldType() === \"*\"\n );\n if (defaultFieldConverterPlugin === undefined) {\n throw new WebinyError(\n `Missing default field converter plugin.`,\n \"DEFAULT_FIELD_CONVERTER_ERROR\"\n );\n }\n for (const fieldGraphQLPlugin of fieldGraphQLPlugins) {\n const plugin = fieldConverterPlugins.find(\n pl => pl.getFieldType() === fieldGraphQLPlugin.fieldType\n );\n const converter = new Converter({\n type: fieldGraphQLPlugin.fieldType,\n plugin: plugin || defaultFieldConverterPlugin\n });\n\n this.addConverter(converter);\n }\n }\n\n public addConverter(converter: Converter): void {\n converter.setConverterCollection(this);\n this.converters.set(converter.getType(), converter);\n }\n\n public getConverter(type: string): Converter {\n const converter = this.converters.get(type);\n if (converter === undefined) {\n throw new WebinyError(\n `Missing converter for field type \"${type}\".`,\n \"CONVERTER_ERROR\",\n {\n type\n }\n );\n }\n return converter;\n }\n\n public convertToStorage(params: ConverterCollectionConvertParams): CmsEntryValues | undefined {\n const { fields, values: inputValues } = params;\n if (inputValues === undefined) {\n return undefined;\n }\n\n this.attachHasOwnProperty(inputValues);\n\n return fields.reduce<CmsEntryValues>((output, field) => {\n const converter = this.getConverter(field.type);\n if (inputValues === null || inputValues.hasOwnProperty(field.fieldId) === false) {\n return output;\n }\n const values = converter.convertToStorage({\n field,\n value: inputValues[field.fieldId]\n });\n\n return {\n ...output,\n ...values\n };\n }, {});\n }\n\n public convertFromStorage(\n params: ConverterCollectionConvertParams\n ): CmsEntryValues | undefined {\n const { fields, values: inputValues } = params;\n if (inputValues === undefined) {\n return undefined;\n }\n\n return fields.reduce((output, field) => {\n const converter = this.getConverter(field.type);\n if (inputValues === null || inputValues.hasOwnProperty(field.storageId) === false) {\n return output;\n }\n const values = converter.convertFromStorage({\n field,\n value: inputValues[field.storageId]\n });\n\n return {\n ...output,\n ...values\n };\n }, {});\n }\n\n /**\n * This method attaches hasOwnProperty when received object was created via Object.create(null) - no inheritance of Object.\n * At that point, hasOwnProperty does not exist, and we need to add it.\n *\n * TODO add more checks if required\n */\n private attachHasOwnProperty(values: CmsEntryValues) {\n if (\n // null or undefined?\n values === null ||\n values === undefined ||\n // not an object?\n typeof values !== \"object\" ||\n // maybe it's an array?\n Array.isArray(values) ||\n // and in the end, check if hasOwnProperty is a function already\n typeof values?.hasOwnProperty === \"function\"\n ) {\n return;\n }\n Object.defineProperty(values, \"hasOwnProperty\", {\n enumerable: false,\n writable: false,\n value: function (property: string) {\n return this[property] !== undefined;\n }\n });\n }\n}\n"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AAEA;;;;;;AAoBO,MAAMA,mBAAN,CAA0B;EAGtBC,WAAW,CAACC,MAAD,EAAoC;IAAA,kDAFA,IAAIC,GAAJ,EAEA;IAClD,MAAM;MAAEC;IAAF,IAAcF,MAApB;IACA,MAAMG,mBAAmB,GAAGD,OAAO,CAACE,MAAR,CACxB,4BADwB,CAA5B;IAGA,MA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