@webiny/api-aco 0.0.0-unstable.e53eceafb5 → 0.0.0-unstable.f9f12f52a0
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-aco",
|
|
3
|
-
"version": "0.0.0-unstable.
|
|
3
|
+
"version": "0.0.0-unstable.f9f12f52a0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"aco:base"
|
|
@@ -22,39 +22,39 @@
|
|
|
22
22
|
"directory": "dist"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@webiny/api": "0.0.0-unstable.
|
|
26
|
-
"@webiny/api-authentication": "0.0.0-unstable.
|
|
27
|
-
"@webiny/api-headless-cms": "0.0.0-unstable.
|
|
28
|
-
"@webiny/api-i18n": "0.0.0-unstable.
|
|
29
|
-
"@webiny/api-security": "0.0.0-unstable.
|
|
30
|
-
"@webiny/api-tenancy": "0.0.0-unstable.
|
|
31
|
-
"@webiny/aws-sdk": "0.0.0-unstable.
|
|
32
|
-
"@webiny/db-dynamodb": "0.0.0-unstable.
|
|
33
|
-
"@webiny/error": "0.0.0-unstable.
|
|
34
|
-
"@webiny/handler": "0.0.0-unstable.
|
|
35
|
-
"@webiny/handler-graphql": "0.0.0-unstable.
|
|
36
|
-
"@webiny/pubsub": "0.0.0-unstable.
|
|
37
|
-
"@webiny/shared-aco": "0.0.0-unstable.
|
|
38
|
-
"@webiny/tasks": "0.0.0-unstable.
|
|
39
|
-
"@webiny/utils": "0.0.0-unstable.
|
|
40
|
-
"@webiny/validation": "0.0.0-unstable.
|
|
25
|
+
"@webiny/api": "0.0.0-unstable.f9f12f52a0",
|
|
26
|
+
"@webiny/api-authentication": "0.0.0-unstable.f9f12f52a0",
|
|
27
|
+
"@webiny/api-headless-cms": "0.0.0-unstable.f9f12f52a0",
|
|
28
|
+
"@webiny/api-i18n": "0.0.0-unstable.f9f12f52a0",
|
|
29
|
+
"@webiny/api-security": "0.0.0-unstable.f9f12f52a0",
|
|
30
|
+
"@webiny/api-tenancy": "0.0.0-unstable.f9f12f52a0",
|
|
31
|
+
"@webiny/aws-sdk": "0.0.0-unstable.f9f12f52a0",
|
|
32
|
+
"@webiny/db-dynamodb": "0.0.0-unstable.f9f12f52a0",
|
|
33
|
+
"@webiny/error": "0.0.0-unstable.f9f12f52a0",
|
|
34
|
+
"@webiny/handler": "0.0.0-unstable.f9f12f52a0",
|
|
35
|
+
"@webiny/handler-graphql": "0.0.0-unstable.f9f12f52a0",
|
|
36
|
+
"@webiny/pubsub": "0.0.0-unstable.f9f12f52a0",
|
|
37
|
+
"@webiny/shared-aco": "0.0.0-unstable.f9f12f52a0",
|
|
38
|
+
"@webiny/tasks": "0.0.0-unstable.f9f12f52a0",
|
|
39
|
+
"@webiny/utils": "0.0.0-unstable.f9f12f52a0",
|
|
40
|
+
"@webiny/validation": "0.0.0-unstable.f9f12f52a0",
|
|
41
41
|
"lodash": "4.17.21"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@webiny/api-admin-users": "0.0.0-unstable.
|
|
45
|
-
"@webiny/api-file-manager": "0.0.0-unstable.
|
|
46
|
-
"@webiny/api-i18n-ddb": "0.0.0-unstable.
|
|
47
|
-
"@webiny/api-security-so-ddb": "0.0.0-unstable.
|
|
48
|
-
"@webiny/api-tenancy-so-ddb": "0.0.0-unstable.
|
|
49
|
-
"@webiny/api-wcp": "0.0.0-unstable.
|
|
50
|
-
"@webiny/handler-aws": "0.0.0-unstable.
|
|
51
|
-
"@webiny/plugins": "0.0.0-unstable.
|
|
52
|
-
"@webiny/project-utils": "0.0.0-unstable.
|
|
53
|
-
"@webiny/wcp": "0.0.0-unstable.
|
|
44
|
+
"@webiny/api-admin-users": "0.0.0-unstable.f9f12f52a0",
|
|
45
|
+
"@webiny/api-file-manager": "0.0.0-unstable.f9f12f52a0",
|
|
46
|
+
"@webiny/api-i18n-ddb": "0.0.0-unstable.f9f12f52a0",
|
|
47
|
+
"@webiny/api-security-so-ddb": "0.0.0-unstable.f9f12f52a0",
|
|
48
|
+
"@webiny/api-tenancy-so-ddb": "0.0.0-unstable.f9f12f52a0",
|
|
49
|
+
"@webiny/api-wcp": "0.0.0-unstable.f9f12f52a0",
|
|
50
|
+
"@webiny/handler-aws": "0.0.0-unstable.f9f12f52a0",
|
|
51
|
+
"@webiny/plugins": "0.0.0-unstable.f9f12f52a0",
|
|
52
|
+
"@webiny/project-utils": "0.0.0-unstable.f9f12f52a0",
|
|
53
|
+
"@webiny/wcp": "0.0.0-unstable.f9f12f52a0",
|
|
54
54
|
"graphql": "15.9.0",
|
|
55
55
|
"prettier": "2.8.8",
|
|
56
56
|
"rimraf": "6.0.1",
|
|
57
57
|
"typescript": "5.3.3"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "f9f12f52a0e2f8e4a2987aa71b4104f70f5d68c8"
|
|
60
60
|
}
|
|
@@ -83,9 +83,9 @@ const createAppSchema = params => {
|
|
|
83
83
|
createdOn: DateTime!
|
|
84
84
|
modifiedOn: DateTime
|
|
85
85
|
savedOn: DateTime!
|
|
86
|
-
createdBy: AcoUser
|
|
86
|
+
createdBy: AcoUser
|
|
87
87
|
modifiedBy: AcoUser
|
|
88
|
-
savedBy: AcoUser
|
|
88
|
+
savedBy: AcoUser
|
|
89
89
|
${fieldTypes.map(f => f.fields).join("\n")}
|
|
90
90
|
}
|
|
91
91
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_renderFields","require","_renderInputFields","_renderListFilterFields","_renderSortEnum","removeFieldRequiredValidation","field","validation","filter","name","listValidation","v","createUpdateFields","fields","reduce","collection","includes","fieldId","push","createAppSchema","params","app","models","plugins","fieldTypePlugins","model","singularApiName","apiName","fieldTypes","renderFields","type","inputCreateFields","renderInputFields","inputUpdateFields","listFilterFieldsRender","renderListFilterFields","sortEnumRender","renderSortEnum","map","f","typeDefs","join","exports"],"sources":["createAppSchema.ts"],"sourcesContent":["import type { CmsFieldTypePlugins, CmsModel, CmsModelField } from \"@webiny/api-headless-cms/types\";\nimport { renderFields } from \"@webiny/api-headless-cms/utils/renderFields\";\nimport { renderInputFields } from \"@webiny/api-headless-cms/utils/renderInputFields\";\nimport type { IAcoApp } from \"~/types\";\nimport { renderListFilterFields } from \"@webiny/api-headless-cms/utils/renderListFilterFields\";\nimport { renderSortEnum } from \"@webiny/api-headless-cms/utils/renderSortEnum\";\n\ninterface Params {\n app: IAcoApp;\n models: CmsModel[];\n plugins: CmsFieldTypePlugins;\n}\n\nconst removeFieldRequiredValidation = (field: CmsModelField) => {\n if (field.validation) {\n field.validation = field.validation.filter(validation => validation.name !== \"required\");\n }\n if (field.listValidation) {\n field.listValidation = field.listValidation.filter(v => v.name !== \"required\");\n }\n return field;\n};\n\nconst createUpdateFields = (fields: CmsModelField[]): CmsModelField[] => {\n return fields.reduce<CmsModelField[]>((collection, field) => {\n if ([\"type\"].includes(field.fieldId)) {\n return collection;\n } else if (field.fieldId === \"tags\") {\n collection.push(field);\n return collection;\n }\n collection.push(removeFieldRequiredValidation({ ...field }));\n return collection;\n }, []);\n};\n\nexport const createAppSchema = (params: Params): string => {\n const { app, models, plugins: fieldTypePlugins } = params;\n const { model } = app;\n const { singularApiName: apiName, fields } = model;\n\n const fieldTypes = renderFields({\n models,\n model,\n fields,\n type: \"manage\",\n fieldTypePlugins\n });\n const inputCreateFields = renderInputFields({\n models,\n model,\n fields,\n fieldTypePlugins\n });\n const inputUpdateFields = renderInputFields({\n models,\n model,\n fields: createUpdateFields(fields),\n fieldTypePlugins\n });\n const listFilterFieldsRender = renderListFilterFields({\n model,\n fields: model.fields,\n type: \"manage\",\n fieldTypePlugins\n });\n\n const sortEnumRender = renderSortEnum({\n model,\n fields: model.fields,\n fieldTypePlugins\n });\n\n return /* GraphQL */ `\n ${fieldTypes.map(f => f.typeDefs).join(\"\\n\")}\n\n\n type ${apiName} {\n id: ID!\n createdOn: DateTime!\n modifiedOn: DateTime\n savedOn: DateTime!\n createdBy: AcoUser
|
|
1
|
+
{"version":3,"names":["_renderFields","require","_renderInputFields","_renderListFilterFields","_renderSortEnum","removeFieldRequiredValidation","field","validation","filter","name","listValidation","v","createUpdateFields","fields","reduce","collection","includes","fieldId","push","createAppSchema","params","app","models","plugins","fieldTypePlugins","model","singularApiName","apiName","fieldTypes","renderFields","type","inputCreateFields","renderInputFields","inputUpdateFields","listFilterFieldsRender","renderListFilterFields","sortEnumRender","renderSortEnum","map","f","typeDefs","join","exports"],"sources":["createAppSchema.ts"],"sourcesContent":["import type { CmsFieldTypePlugins, CmsModel, CmsModelField } from \"@webiny/api-headless-cms/types\";\nimport { renderFields } from \"@webiny/api-headless-cms/utils/renderFields\";\nimport { renderInputFields } from \"@webiny/api-headless-cms/utils/renderInputFields\";\nimport type { IAcoApp } from \"~/types\";\nimport { renderListFilterFields } from \"@webiny/api-headless-cms/utils/renderListFilterFields\";\nimport { renderSortEnum } from \"@webiny/api-headless-cms/utils/renderSortEnum\";\n\ninterface Params {\n app: IAcoApp;\n models: CmsModel[];\n plugins: CmsFieldTypePlugins;\n}\n\nconst removeFieldRequiredValidation = (field: CmsModelField) => {\n if (field.validation) {\n field.validation = field.validation.filter(validation => validation.name !== \"required\");\n }\n if (field.listValidation) {\n field.listValidation = field.listValidation.filter(v => v.name !== \"required\");\n }\n return field;\n};\n\nconst createUpdateFields = (fields: CmsModelField[]): CmsModelField[] => {\n return fields.reduce<CmsModelField[]>((collection, field) => {\n if ([\"type\"].includes(field.fieldId)) {\n return collection;\n } else if (field.fieldId === \"tags\") {\n collection.push(field);\n return collection;\n }\n collection.push(removeFieldRequiredValidation({ ...field }));\n return collection;\n }, []);\n};\n\nexport const createAppSchema = (params: Params): string => {\n const { app, models, plugins: fieldTypePlugins } = params;\n const { model } = app;\n const { singularApiName: apiName, fields } = model;\n\n const fieldTypes = renderFields({\n models,\n model,\n fields,\n type: \"manage\",\n fieldTypePlugins\n });\n const inputCreateFields = renderInputFields({\n models,\n model,\n fields,\n fieldTypePlugins\n });\n const inputUpdateFields = renderInputFields({\n models,\n model,\n fields: createUpdateFields(fields),\n fieldTypePlugins\n });\n const listFilterFieldsRender = renderListFilterFields({\n model,\n fields: model.fields,\n type: \"manage\",\n fieldTypePlugins\n });\n\n const sortEnumRender = renderSortEnum({\n model,\n fields: model.fields,\n fieldTypePlugins\n });\n\n return /* GraphQL */ `\n ${fieldTypes.map(f => f.typeDefs).join(\"\\n\")}\n\n\n type ${apiName} {\n id: ID!\n createdOn: DateTime!\n modifiedOn: DateTime\n savedOn: DateTime!\n createdBy: AcoUser\n modifiedBy: AcoUser\n savedBy: AcoUser\n ${fieldTypes.map(f => f.fields).join(\"\\n\")}\n }\n\n ${inputCreateFields.map(f => f.typeDefs).join(\"\\n\")}\n\n input ${apiName}CreateInput {\n id: ID\n ${inputCreateFields.map(f => f.fields).join(\"\\n\")}\n }\n\n input ${apiName}UpdateInput {\n ${inputUpdateFields.map(f => f.fields).join(\"\\n\")}\n }\n\n type ${apiName}Response {\n data: ${apiName}\n error: AcoError\n }\n\n input ${apiName}ListWhereInput {\n ${listFilterFieldsRender}\n AND: [${apiName}ListWhereInput!]\n OR: [${apiName}ListWhereInput!]\n }\n\n type ${apiName}ListResponse {\n data: [${apiName}!]\n error: AcoError\n meta: AcoMeta\n }\n\n enum ${apiName}ListSorter {\n ${sortEnumRender}\n }\n\n extend type SearchQuery {\n get${apiName}(id: ID!): ${apiName}Response!\n list${apiName}(\n where: ${apiName}ListWhereInput\n search: String\n limit: Int\n after: String\n sort: [${apiName}ListSorter!]\n ): ${apiName}ListResponse!\n list${apiName}Tags(where: AcoSearchRecordTagListWhereInput): AcoSearchRecordTagListResponse!\n }\n\n extend type SearchMutation {\n create${apiName}(data: ${apiName}CreateInput!): ${apiName}Response!\n update${apiName}(id: ID!, data: ${apiName}UpdateInput!): ${apiName}Response!\n move${apiName}(id: ID!, folderId: ID!): AcoSearchRecordMoveResponse!\n delete${apiName}(id: ID!): AcoBooleanResponse!\n }\n `;\n};\n"],"mappings":";;;;;;AACA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AAEA,IAAAE,uBAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AAQA,MAAMI,6BAA6B,GAAIC,KAAoB,IAAK;EAC5D,IAAIA,KAAK,CAACC,UAAU,EAAE;IAClBD,KAAK,CAACC,UAAU,GAAGD,KAAK,CAACC,UAAU,CAACC,MAAM,CAACD,UAAU,IAAIA,UAAU,CAACE,IAAI,KAAK,UAAU,CAAC;EAC5F;EACA,IAAIH,KAAK,CAACI,cAAc,EAAE;IACtBJ,KAAK,CAACI,cAAc,GAAGJ,KAAK,CAACI,cAAc,CAACF,MAAM,CAACG,CAAC,IAAIA,CAAC,CAACF,IAAI,KAAK,UAAU,CAAC;EAClF;EACA,OAAOH,KAAK;AAChB,CAAC;AAED,MAAMM,kBAAkB,GAAIC,MAAuB,IAAsB;EACrE,OAAOA,MAAM,CAACC,MAAM,CAAkB,CAACC,UAAU,EAAET,KAAK,KAAK;IACzD,IAAI,CAAC,MAAM,CAAC,CAACU,QAAQ,CAACV,KAAK,CAACW,OAAO,CAAC,EAAE;MAClC,OAAOF,UAAU;IACrB,CAAC,MAAM,IAAIT,KAAK,CAACW,OAAO,KAAK,MAAM,EAAE;MACjCF,UAAU,CAACG,IAAI,CAACZ,KAAK,CAAC;MACtB,OAAOS,UAAU;IACrB;IACAA,UAAU,CAACG,IAAI,CAACb,6BAA6B,CAAC;MAAE,GAAGC;IAAM,CAAC,CAAC,CAAC;IAC5D,OAAOS,UAAU;EACrB,CAAC,EAAE,EAAE,CAAC;AACV,CAAC;AAEM,MAAMI,eAAe,GAAIC,MAAc,IAAa;EACvD,MAAM;IAAEC,GAAG;IAAEC,MAAM;IAAEC,OAAO,EAAEC;E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