@webbio/strapi-plugin-page-builder 0.9.13-authentication → 0.9.14-authentication

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.
Files changed (24) hide show
  1. package/dist/package.json +1 -1
  2. package/dist/server/content-types/category/category.js +0 -0
  3. package/dist/server/content-types/category/category.json +27 -0
  4. package/dist/server/content-types/page-version/schema.json +16 -0
  5. package/dist/server/controllers/page-version.js +7 -0
  6. package/dist/server/graphql/page-by-path.js +1 -1
  7. package/dist/server/graphql/page-by-slug.js +89 -0
  8. package/dist/server/middlewares/private-content.js +13 -0
  9. package/dist/server/routes/page-version.js +7 -0
  10. package/dist/server/services/authentication.js +186 -0
  11. package/dist/server/services/page-version.js +7 -0
  12. package/dist/server/services/private-content/acceptedMail/acceptMail.email.template.text.js +12 -0
  13. package/dist/server/services/private-content/acceptedMail/acceptMail.interface.js +2 -0
  14. package/dist/server/services/private-content/graphql/resolvers/find.js +0 -0
  15. package/dist/server/services/private-content/graphql/resolvers/findAll.js +0 -0
  16. package/dist/server/services/private-content/graphql/resolvers/findOnePage.js +1 -1
  17. package/dist/server/services/private-content/graphql/resolvers/findPage.js +5 -4
  18. package/dist/server/utils/graphql.js +100 -0
  19. package/dist/server/utils/paginationValidation.js +31 -0
  20. package/dist/tsconfig.server.tsbuildinfo +1 -1
  21. package/package.json +1 -1
  22. package/server/graphql/page-by-path.ts +1 -1
  23. package/server/services/private-content/graphql/resolvers/findOnePage.ts +1 -1
  24. package/server/services/private-content/graphql/resolvers/findPage.ts +4 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webbio/strapi-plugin-page-builder",
3
- "version": "0.9.13-authentication",
3
+ "version": "0.9.14-authentication",
4
4
  "description": "This is the description of the plugin.",
5
5
  "scripts": {
6
6
  "develop": "tsc -p tsconfig.server.json -w",
@@ -77,7 +77,7 @@ const getPageByPath = (strapi: Strapi) => {
77
77
  const results: Record<string, any> = await getPage();
78
78
 
79
79
  if (Object.values(results)?.filter(Boolean).length > 0) {
80
- if (!results?.platform?.isPrivate && !results.isPrivate) {
80
+ if (!results?.platform?.isPrivate && !results?.isPrivate) {
81
81
  return results;
82
82
  }
83
83
  if (
@@ -13,7 +13,7 @@ export const page = {
13
13
  const sanitizedQuery = await sanitize.contentAPI.query(populatedArgs, strapi.contentType(PAGE_UID));
14
14
  const value = await strapi.entityService!.findOne(uid, args.id, omit('id', sanitizedQuery));
15
15
  // @ts-ignore Strapi types are the best
16
- if (!value?.platform?.isPrivate && !value.isPrivate) {
16
+ if (!value?.platform?.isPrivate && !value?.isPrivate) {
17
17
  return toEntityResponse(value, { args: transformedArgs, resourceUID: uid });
18
18
  }
19
19
 
@@ -22,14 +22,14 @@ export const pages = {
22
22
  // @ts-ignore
23
23
  const filteredItems = value.filter((item) => {
24
24
  // @ts-ignore
25
- if (item.platform.isPrivate === true && user.platform.id === item.platform.id) {
25
+ if (item.platform?.isPrivate === true && user.platform.id === item.platform.id) {
26
26
  return item;
27
27
  }
28
- if (item.isPrivate === true && user.platform.id === item.platform.id) {
28
+ if (item?.isPrivate === true && user.platform.id === item.platform.id) {
29
29
  return item;
30
30
  }
31
31
  // @ts-ignore
32
- if (item.platform.isPrivate !== true && item.isPrivate !== true) {
32
+ if (item.platform?.isPrivate !== true && item?.isPrivate !== true) {
33
33
  return item;
34
34
  }
35
35
  });
@@ -38,7 +38,7 @@ export const pages = {
38
38
  }
39
39
 
40
40
  // @ts-ignore
41
- const filteredItems = value.filter((item) => item.platform.isPrivate !== true && item.isPrivate !== true);
41
+ const filteredItems = value.filter((item) => item.platform?.isPrivate !== true && item?.isPrivate !== true);
42
42
 
43
43
  return toEntityResponseCollection(filteredItems, { args: transformedArgs, resourceUID: uid });
44
44
  }