@webiny/api-headless-cms 5.34.3-beta.0 → 5.34.3-beta.2
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/beforeCreate.d.ts +2 -3
- package/crud/contentModel/beforeCreate.js +4 -4
- package/crud/contentModel/beforeCreate.js.map +1 -1
- package/crud/contentModel/beforeUpdate.d.ts +2 -4
- package/crud/contentModel/beforeUpdate.js +2 -2
- package/crud/contentModel/beforeUpdate.js.map +1 -1
- package/crud/contentModel/validateModel.d.ts +3 -4
- package/crud/contentModel/validateModel.js +6 -3
- package/crud/contentModel/validateModel.js.map +1 -1
- package/crud/contentModel/validateModelFields.d.ts +3 -4
- package/crud/contentModel/validateModelFields.js +74 -6
- package/crud/contentModel/validateModelFields.js.map +1 -1
- package/crud/contentModel.crud.js +3 -18
- package/crud/contentModel.crud.js.map +1 -1
- package/graphql/buildSchemaPlugins.d.ts +7 -2
- package/graphql/buildSchemaPlugins.js +3 -6
- package/graphql/buildSchemaPlugins.js.map +1 -1
- package/graphql/createExecutableSchema.d.ts +7 -0
- package/graphql/createExecutableSchema.js +33 -0
- package/graphql/createExecutableSchema.js.map +1 -0
- package/graphql/generateSchema.d.ts +8 -0
- package/graphql/generateSchema.js +38 -0
- package/graphql/generateSchema.js.map +1 -0
- package/graphql/graphQLHandlerFactory.js +68 -71
- package/graphql/graphQLHandlerFactory.js.map +1 -1
- package/graphql/index.d.ts +1 -3
- package/graphql/index.js +2 -41
- package/graphql/index.js.map +1 -1
- package/graphql/schema/baseContentSchema.d.ts +5 -1
- package/graphql/schema/baseContentSchema.js +3 -1
- package/graphql/schema/baseContentSchema.js.map +1 -1
- package/graphql/schema/baseSchema.d.ts +3 -0
- package/graphql/schema/baseSchema.js +58 -0
- package/graphql/schema/baseSchema.js.map +1 -0
- package/graphql/schema/contentEntries.d.ts +5 -1
- package/graphql/schema/contentEntries.js +3 -1
- package/graphql/schema/contentEntries.js.map +1 -1
- package/graphql/schema/contentModelGroups.d.ts +5 -1
- package/graphql/schema/contentModelGroups.js +3 -1
- package/graphql/schema/contentModelGroups.js.map +1 -1
- package/graphql/schema/contentModels.d.ts +5 -1
- package/graphql/schema/contentModels.js +3 -1
- package/graphql/schema/contentModels.js.map +1 -1
- package/graphql/schema/schemaPlugins.d.ts +7 -2
- package/graphql/schema/schemaPlugins.js +45 -43
- package/graphql/schema/schemaPlugins.js.map +1 -1
- package/index.d.ts +1 -1
- package/package.json +23 -23
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["generateSchemaPlugins","context","plugins","cms","type","fieldTypePlugins","byType","reduce","acc","pl","fieldType","sorterPlugins","CmsGraphQLSchemaSorterPlugin","
|
|
1
|
+
{"version":3,"names":["generateSchemaPlugins","params","context","models","plugins","cms","type","fieldTypePlugins","byType","reduce","acc","pl","fieldType","sorterPlugins","CmsGraphQLSchemaSorterPlugin","schemas","getSchemaFromFieldPlugins","newPlugins","schema","push","GraphQLSchemaPlugin","filter","model","fields","length","forEach","plugin","typeDefs","createManageSDL","resolvers","createManageResolvers","name","modelId","createReadSDL","READ","createReadResolvers","createPreviewResolvers"],"sources":["schemaPlugins.ts"],"sourcesContent":["import { GraphQLSchemaPlugin } from \"@webiny/handler-graphql/plugins/GraphQLSchemaPlugin\";\nimport { CmsModelFieldToGraphQLPlugin, CmsFieldTypePlugins, CmsContext, CmsModel } from \"~/types\";\nimport { createManageSDL } from \"./createManageSDL\";\nimport { createReadSDL } from \"./createReadSDL\";\nimport { createManageResolvers } from \"./createManageResolvers\";\nimport { createReadResolvers } from \"./createReadResolvers\";\nimport { createPreviewResolvers } from \"./createPreviewResolvers\";\nimport { getSchemaFromFieldPlugins } from \"~/utils/getSchemaFromFieldPlugins\";\nimport { CmsGraphQLSchemaSorterPlugin } from \"~/plugins\";\n\ninterface GenerateSchemaPluginsParams {\n context: CmsContext;\n models: CmsModel[];\n}\nexport const generateSchemaPlugins = async (\n params: GenerateSchemaPluginsParams\n): Promise<GraphQLSchemaPlugin<CmsContext>[]> => {\n const { context, models } = params;\n const { plugins, cms } = context;\n\n /**\n * If type does not exist, we are not generating schema plugins for models.\n * It should not come to this point, but we check it anyways.\n */\n const { type } = cms;\n if (!type) {\n return [];\n }\n\n // Structure plugins for faster access\n const fieldTypePlugins = plugins\n .byType<CmsModelFieldToGraphQLPlugin>(\"cms-model-field-to-graphql\")\n .reduce<CmsFieldTypePlugins>((acc, pl) => {\n acc[pl.fieldType] = pl;\n return acc;\n }, {});\n\n const sorterPlugins = plugins.byType<CmsGraphQLSchemaSorterPlugin>(\n CmsGraphQLSchemaSorterPlugin.type\n );\n\n const schemas = getSchemaFromFieldPlugins({\n models,\n fieldTypePlugins,\n type\n });\n\n const newPlugins: GraphQLSchemaPlugin<CmsContext>[] = [];\n for (const schema of schemas) {\n newPlugins.push(new GraphQLSchemaPlugin(schema));\n }\n\n models\n .filter(model => model.fields.length > 0)\n .forEach(model => {\n switch (type) {\n case \"manage\":\n {\n const plugin = new GraphQLSchemaPlugin({\n typeDefs: createManageSDL({ model, fieldTypePlugins, sorterPlugins }),\n resolvers: createManageResolvers({\n models,\n model,\n fieldTypePlugins,\n context\n })\n });\n plugin.name = `headless-cms.graphql.schema.manage.${model.modelId}`;\n newPlugins.push(plugin);\n }\n\n break;\n case \"preview\":\n case \"read\":\n {\n const plugin = new GraphQLSchemaPlugin({\n typeDefs: createReadSDL({ model, fieldTypePlugins, sorterPlugins }),\n resolvers: cms.READ\n ? createReadResolvers({\n models,\n model,\n fieldTypePlugins,\n context\n })\n : createPreviewResolvers({\n models,\n model,\n fieldTypePlugins,\n context\n })\n });\n plugin.name = `headless-cms.graphql.schema.${type}.${model.modelId}`;\n newPlugins.push(plugin);\n }\n break;\n default:\n return;\n }\n });\n\n return newPlugins.filter(pl => !!pl.schema.typeDefs);\n};\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAMO,MAAMA,qBAAqB,GAAG,MAC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7BL;YAJ6B,CAAtB;UAFwB,CAAxB,CAAf;UASAwB,MAAM,CAACK,IAAP,GAAe,sCAAqCT,KAAK,CAACU,OAAQ,EAAlE;UACAf,UAAU,CAACE,IAAX,CAAgBO,MAAhB;QACH;QAED;;MACJ,KAAK,SAAL;MACA,KAAK,MAAL;QACI;UACI,MAAMA,MAAM,GAAG,IAAIN,wCAAJ,CAAwB;YACnCO,QAAQ,EAAE,IAAAM,4BAAA,EAAc;cAAEX,KAAF;cAASf,gBAAT;cAA2BM;YAA3B,CAAd,CADyB;YAEnCgB,SAAS,EAAExB,GAAG,CAAC6B,IAAJ,GACL,IAAAC,wCAAA,EAAoB;cAChBhC,MADgB;cAEhBmB,KAFgB;cAGhBf,gBAHgB;cAIhBL;YAJgB,CAApB,CADK,GAOL,IAAAkC,8CAAA,EAAuB;cACnBjC,MADmB;cAEnBmB,KAFmB;cAGnBf,gBAHmB;cAInBL;YAJmB,CAAvB;UAT6B,CAAxB,CAAf;UAgBAwB,MAAM,CAACK,IAAP,GAAe,+BAA8BzB,IAAK,IAAGgB,KAAK,CAACU,OAAQ,EAAnE;UACAf,UAAU,CAACE,IAAX,CAAgBO,MAAhB;QACH;QACD;;MACJ;QACI;IAzCR;EA2CH,CA9CL;EAgDA,OAAOT,UAAU,CAACI,MAAX,CAAkBV,EAAE,IAAI,CAAC,CAACA,EAAE,CAACO,MAAH,CAAUS,QAApC,CAAP;AACH,CAvFM"}
|
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("./plugins").CmsParametersPlugin | (import("@webiny/
|
|
5
|
+
export declare const createHeadlessCmsGraphQL: (params?: CreateHeadlessCmsGraphQLParams) => (import("./plugins").CmsParametersPlugin | (import("@webiny/handler-graphql").GraphQLSchemaPlugin<import("./types").CmsContext> | import("@webiny/api").ContextPlugin<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").ModelManagerPlugin | import("./plugins").StorageTransformPlugin<any, any, import("./types").CmsModelField> | import("@webiny/api").ContextPlugin<import("./types").CmsContext> | import("@webiny/api-upgrade").UpgradePlugin<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.34.3-beta.
|
|
3
|
+
"version": "5.34.3-beta.2",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cms:base"
|
|
@@ -21,22 +21,22 @@
|
|
|
21
21
|
"@babel/runtime": "7.19.0",
|
|
22
22
|
"@commodo/fields": "1.1.2-beta.20",
|
|
23
23
|
"@graphql-tools/schema": "7.1.5",
|
|
24
|
-
"@webiny/api": "5.34.3-beta.
|
|
25
|
-
"@webiny/api-file-manager": "5.34.3-beta.
|
|
26
|
-
"@webiny/api-i18n": "5.34.3-beta.
|
|
27
|
-
"@webiny/api-i18n-ddb": "5.34.3-beta.
|
|
28
|
-
"@webiny/api-security": "5.34.3-beta.
|
|
29
|
-
"@webiny/api-tenancy": "5.34.3-beta.
|
|
30
|
-
"@webiny/api-upgrade": "5.34.3-beta.
|
|
31
|
-
"@webiny/error": "5.34.3-beta.
|
|
32
|
-
"@webiny/handler": "5.34.3-beta.
|
|
33
|
-
"@webiny/handler-aws": "5.34.3-beta.
|
|
34
|
-
"@webiny/handler-db": "5.34.3-beta.
|
|
35
|
-
"@webiny/handler-graphql": "5.34.3-beta.
|
|
36
|
-
"@webiny/plugins": "5.34.3-beta.
|
|
37
|
-
"@webiny/pubsub": "5.34.3-beta.
|
|
38
|
-
"@webiny/utils": "5.34.3-beta.
|
|
39
|
-
"@webiny/validation": "5.34.3-beta.
|
|
24
|
+
"@webiny/api": "5.34.3-beta.2",
|
|
25
|
+
"@webiny/api-file-manager": "5.34.3-beta.2",
|
|
26
|
+
"@webiny/api-i18n": "5.34.3-beta.2",
|
|
27
|
+
"@webiny/api-i18n-ddb": "5.34.3-beta.2",
|
|
28
|
+
"@webiny/api-security": "5.34.3-beta.2",
|
|
29
|
+
"@webiny/api-tenancy": "5.34.3-beta.2",
|
|
30
|
+
"@webiny/api-upgrade": "5.34.3-beta.2",
|
|
31
|
+
"@webiny/error": "5.34.3-beta.2",
|
|
32
|
+
"@webiny/handler": "5.34.3-beta.2",
|
|
33
|
+
"@webiny/handler-aws": "5.34.3-beta.2",
|
|
34
|
+
"@webiny/handler-db": "5.34.3-beta.2",
|
|
35
|
+
"@webiny/handler-graphql": "5.34.3-beta.2",
|
|
36
|
+
"@webiny/plugins": "5.34.3-beta.2",
|
|
37
|
+
"@webiny/pubsub": "5.34.3-beta.2",
|
|
38
|
+
"@webiny/utils": "5.34.3-beta.2",
|
|
39
|
+
"@webiny/validation": "5.34.3-beta.2",
|
|
40
40
|
"code-frame": "5.0.0",
|
|
41
41
|
"commodo-fields-object": "1.0.6",
|
|
42
42
|
"dataloader": "2.1.0",
|
|
@@ -53,11 +53,11 @@
|
|
|
53
53
|
"@babel/cli": "^7.19.3",
|
|
54
54
|
"@babel/core": "^7.19.3",
|
|
55
55
|
"@babel/preset-env": "^7.19.4",
|
|
56
|
-
"@webiny/api-security-so-ddb": "^5.34.3-beta.
|
|
57
|
-
"@webiny/api-tenancy-so-ddb": "^5.34.3-beta.
|
|
58
|
-
"@webiny/api-wcp": "^5.34.3-beta.
|
|
59
|
-
"@webiny/cli": "^5.34.3-beta.
|
|
60
|
-
"@webiny/project-utils": "^5.34.3-beta.
|
|
56
|
+
"@webiny/api-security-so-ddb": "^5.34.3-beta.2",
|
|
57
|
+
"@webiny/api-tenancy-so-ddb": "^5.34.3-beta.2",
|
|
58
|
+
"@webiny/api-wcp": "^5.34.3-beta.2",
|
|
59
|
+
"@webiny/cli": "^5.34.3-beta.2",
|
|
60
|
+
"@webiny/project-utils": "^5.34.3-beta.2",
|
|
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": "
|
|
80
|
+
"gitHead": "ec507c88a4b13df2716bf1dcb8bbc27c8dd512d0"
|
|
81
81
|
}
|