@dani-builder/strapi-plugin-builder 0.1.0 → 0.3.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.
Files changed (140) hide show
  1. package/AGENTS.md +149 -0
  2. package/LICENSE +21 -0
  3. package/README.md +61 -0
  4. package/dist/server/src/bootstrap.d.ts +1 -1
  5. package/dist/server/src/bootstrap.d.ts.map +1 -1
  6. package/dist/server/src/bootstrap.js +8 -1
  7. package/dist/server/src/bootstrap.js.map +1 -1
  8. package/dist/server/src/bootstrap.test.d.ts +2 -0
  9. package/dist/server/src/bootstrap.test.d.ts.map +1 -0
  10. package/dist/server/src/bootstrap.test.js +45 -0
  11. package/dist/server/src/bootstrap.test.js.map +1 -0
  12. package/dist/server/src/components/blocks/cta.json +13 -5
  13. package/dist/server/src/components/blocks/faq.json +1 -1
  14. package/dist/server/src/components/blocks/features.json +10 -5
  15. package/dist/server/src/components/blocks/hero.json +15 -6
  16. package/dist/server/src/components/blocks/highlights.json +9 -5
  17. package/dist/server/src/components/blocks/inquiry-form.json +3 -0
  18. package/dist/server/src/components/blocks/logo-cloud.json +6 -1
  19. package/dist/server/src/components/blocks/stats.json +9 -5
  20. package/dist/server/src/components/blocks/testimonials.json +10 -5
  21. package/dist/server/src/components/shared/bento-item.json +4 -4
  22. package/dist/server/src/components/shared/highlight-item.json +5 -5
  23. package/dist/server/src/components/shared/image.json +24 -0
  24. package/dist/server/src/components/shared/slider-item.json +5 -5
  25. package/dist/server/src/content-types/article/index.d.ts +146 -0
  26. package/dist/server/src/content-types/article/index.d.ts.map +1 -0
  27. package/dist/server/src/content-types/article/index.js +8 -0
  28. package/dist/server/src/content-types/article/index.js.map +1 -0
  29. package/dist/server/src/content-types/article/schema.json +104 -0
  30. package/dist/server/src/content-types/author/index.d.ts +56 -0
  31. package/dist/server/src/content-types/author/index.d.ts.map +1 -0
  32. package/dist/server/src/content-types/author/index.js +8 -0
  33. package/dist/server/src/content-types/author/index.js.map +1 -0
  34. package/dist/server/src/content-types/author/schema.json +48 -0
  35. package/dist/server/src/content-types/category/index.d.ts +71 -0
  36. package/dist/server/src/content-types/category/index.d.ts.map +1 -0
  37. package/dist/server/src/content-types/category/index.js +8 -0
  38. package/dist/server/src/content-types/category/index.js.map +1 -0
  39. package/dist/server/src/content-types/category/schema.json +45 -0
  40. package/dist/server/src/content-types/faq/index.d.ts +60 -0
  41. package/dist/server/src/content-types/faq/index.d.ts.map +1 -0
  42. package/dist/server/src/content-types/faq/index.js +8 -0
  43. package/dist/server/src/content-types/faq/index.js.map +1 -0
  44. package/dist/server/src/content-types/faq/schema.json +38 -0
  45. package/dist/server/src/content-types/global/index.d.ts +91 -0
  46. package/dist/server/src/content-types/global/index.d.ts.map +1 -0
  47. package/dist/server/src/content-types/global/index.js +8 -0
  48. package/dist/server/src/content-types/global/index.js.map +1 -0
  49. package/dist/server/src/content-types/global/schema.json +66 -0
  50. package/dist/server/src/content-types/index.d.ts +795 -0
  51. package/dist/server/src/content-types/index.d.ts.map +1 -0
  52. package/dist/server/src/content-types/index.js +30 -0
  53. package/dist/server/src/content-types/index.js.map +1 -0
  54. package/dist/server/src/content-types/inquiry/index.d.ts +48 -0
  55. package/dist/server/src/content-types/inquiry/index.d.ts.map +1 -0
  56. package/dist/server/src/content-types/inquiry/index.js +8 -0
  57. package/dist/server/src/content-types/inquiry/index.js.map +1 -0
  58. package/dist/server/src/content-types/inquiry/schema.json +40 -0
  59. package/dist/server/src/content-types/navigation/index.d.ts +80 -0
  60. package/dist/server/src/content-types/navigation/index.d.ts.map +1 -0
  61. package/dist/server/src/content-types/navigation/index.js +8 -0
  62. package/dist/server/src/content-types/navigation/index.js.map +1 -0
  63. package/dist/server/src/content-types/navigation/schema.json +54 -0
  64. package/dist/server/src/content-types/page/index.d.ts +78 -0
  65. package/dist/server/src/content-types/page/index.d.ts.map +1 -0
  66. package/dist/server/src/content-types/page/index.js +8 -0
  67. package/dist/server/src/content-types/page/index.js.map +1 -0
  68. package/dist/server/src/content-types/page/schema.json +64 -0
  69. package/dist/server/src/content-types/series/index.d.ts +68 -0
  70. package/dist/server/src/content-types/series/index.d.ts.map +1 -0
  71. package/dist/server/src/content-types/series/index.js +8 -0
  72. package/dist/server/src/content-types/series/index.js.map +1 -0
  73. package/dist/server/src/content-types/series/schema.json +46 -0
  74. package/dist/server/src/content-types/site-setting/index.d.ts +47 -0
  75. package/dist/server/src/content-types/site-setting/index.d.ts.map +1 -0
  76. package/dist/server/src/content-types/site-setting/index.js +8 -0
  77. package/dist/server/src/content-types/site-setting/index.js.map +1 -0
  78. package/dist/server/src/content-types/site-setting/schema.json +39 -0
  79. package/dist/server/src/content-types/tag/index.d.ts +68 -0
  80. package/dist/server/src/content-types/tag/index.d.ts.map +1 -0
  81. package/dist/server/src/content-types/tag/index.js +8 -0
  82. package/dist/server/src/content-types/tag/index.js.map +1 -0
  83. package/dist/server/src/content-types/tag/schema.json +46 -0
  84. package/dist/server/src/controllers/global.d.ts +1 -10
  85. package/dist/server/src/controllers/global.d.ts.map +1 -1
  86. package/dist/server/src/controllers/global.js +11 -4
  87. package/dist/server/src/controllers/global.js.map +1 -1
  88. package/dist/server/src/controllers/index.d.ts.map +1 -1
  89. package/dist/server/src/controllers/index.js +10 -0
  90. package/dist/server/src/controllers/index.js.map +1 -1
  91. package/dist/server/src/controllers/page.d.ts +11 -14
  92. package/dist/server/src/controllers/page.d.ts.map +1 -1
  93. package/dist/server/src/controllers/page.js +78 -9
  94. package/dist/server/src/controllers/page.js.map +1 -1
  95. package/dist/server/src/index.d.ts.map +1 -1
  96. package/dist/server/src/index.js +4 -0
  97. package/dist/server/src/index.js.map +1 -1
  98. package/dist/server/src/policies/index.d.ts +3 -0
  99. package/dist/server/src/policies/index.d.ts.map +1 -0
  100. package/dist/server/src/policies/index.js +13 -0
  101. package/dist/server/src/policies/index.js.map +1 -0
  102. package/dist/server/src/policies/rate-limit.d.ts +15 -0
  103. package/dist/server/src/policies/rate-limit.d.ts.map +1 -0
  104. package/dist/server/src/policies/rate-limit.js +39 -0
  105. package/dist/server/src/policies/rate-limit.js.map +1 -0
  106. package/dist/server/src/register.d.ts.map +1 -1
  107. package/dist/server/src/register.js +16 -1
  108. package/dist/server/src/register.js.map +1 -1
  109. package/dist/server/src/routes/content-api.d.ts +10 -13
  110. package/dist/server/src/routes/content-api.d.ts.map +1 -1
  111. package/dist/server/src/routes/content-api.js +34 -30
  112. package/dist/server/src/routes/content-api.js.map +1 -1
  113. package/dist/server/src/routes/index.d.ts +10 -15
  114. package/dist/server/src/routes/index.d.ts.map +1 -1
  115. package/dist/server/src/routes/index.js +2 -1
  116. package/dist/server/src/routes/index.js.map +1 -1
  117. package/dist/server/src/services/index.d.ts.map +1 -1
  118. package/dist/server/src/services/index.js +12 -0
  119. package/dist/server/src/services/index.js.map +1 -1
  120. package/dist/server/src/services/populate.d.ts.map +1 -1
  121. package/dist/server/src/services/populate.js +15 -9
  122. package/dist/server/src/services/populate.js.map +1 -1
  123. package/dist/server/src/utils/query.d.ts +11 -0
  124. package/dist/server/src/utils/query.d.ts.map +1 -0
  125. package/dist/server/src/utils/query.js +112 -0
  126. package/dist/server/src/utils/query.js.map +1 -0
  127. package/package.json +30 -18
  128. package/bin/sync.js +0 -320
  129. package/schemas/api/article/content-types/article/schema.json +0 -102
  130. package/schemas/api/author/content-types/author/schema.json +0 -44
  131. package/schemas/api/category/content-types/category/schema.json +0 -43
  132. package/schemas/api/faq/content-types/faq/schema.json +0 -36
  133. package/schemas/api/global/content-types/global/schema.json +0 -64
  134. package/schemas/api/inquiry/content-types/inquiry/schema.json +0 -31
  135. package/schemas/api/navigation/content-types/navigation/schema.json +0 -52
  136. package/schemas/api/page/content-types/page/schema.json +0 -62
  137. package/schemas/api/series/content-types/series/schema.json +0 -44
  138. package/schemas/api/site-setting/content-types/site-setting/schema.json +0 -35
  139. package/schemas/api/tag/content-types/tag/schema.json +0 -44
  140. package/schemas/manifest.json +0 -16
@@ -1,14 +1,11 @@
1
- declare const _default: {
2
- type: string;
3
- routes: {
4
- method: string;
5
- path: string;
6
- handler: string;
7
- config: {
8
- policies: never[];
9
- description: string;
10
- };
11
- }[];
12
- };
13
- export default _default;
1
+ interface ContentApiRoute {
2
+ method: string;
3
+ path: string;
4
+ }
5
+ interface ContentApiRouter {
6
+ type: 'content-api';
7
+ routes: ContentApiRoute[] | (() => ContentApiRoute[]);
8
+ }
9
+ declare const contentApi: ContentApiRouter;
10
+ export default contentApi;
14
11
  //# sourceMappingURL=content-api.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"content-api.d.ts","sourceRoot":"","sources":["../../../../server/src/routes/content-api.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wBA+BE"}
1
+ {"version":3,"file":"content-api.d.ts","sourceRoot":"","sources":["../../../../server/src/routes/content-api.ts"],"names":[],"mappings":"AAEA,UAAU,eAAe;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED,UAAU,gBAAgB;IACxB,IAAI,EAAE,aAAa,CAAC;IACpB,MAAM,EAAE,eAAe,EAAE,GAAG,CAAC,MAAM,eAAe,EAAE,CAAC,CAAC;CACvD;AAyBD,QAAA,MAAM,UAAU,EAAE,gBAkBjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -1,35 +1,39 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = {
3
+ const strapi_1 = require("@strapi/strapi");
4
+ const contentTypes = [
5
+ 'plugin::builder.article',
6
+ 'plugin::builder.author',
7
+ 'plugin::builder.category',
8
+ 'plugin::builder.faq',
9
+ 'plugin::builder.global',
10
+ 'plugin::builder.navigation',
11
+ 'plugin::builder.page',
12
+ 'plugin::builder.series',
13
+ 'plugin::builder.site-setting',
14
+ 'plugin::builder.tag',
15
+ ];
16
+ let cachedRoutes;
17
+ function getCoreRoutes(uid, config) {
18
+ const router = strapi_1.factories.createCoreRouter(uid, config);
19
+ return typeof router.routes === 'function' ? router.routes() : router.routes;
20
+ }
21
+ const contentApi = {
4
22
  type: 'content-api',
5
- routes: [
6
- {
7
- method: 'GET',
8
- path: '/pages',
9
- handler: 'page.find',
10
- config: {
11
- policies: [],
12
- description: 'List pages with minimal populate',
13
- },
14
- },
15
- {
16
- method: 'GET',
17
- path: '/pages/:documentId',
18
- handler: 'page.findOne',
19
- config: {
20
- policies: [],
21
- description: 'Get single page with deep block populate',
22
- },
23
- },
24
- {
25
- method: 'GET',
26
- path: '/global',
27
- handler: 'global.find',
28
- config: {
29
- policies: [],
30
- description: 'Get global settings with deep populate',
31
- },
32
- },
33
- ],
23
+ get routes() {
24
+ // Strapi reads `.routes` several times while registering a plugin and
25
+ // annotates the first result with auth scopes. Keep the same route objects
26
+ // for every read so those annotations reach the registered router.
27
+ if (!cachedRoutes) {
28
+ const coreRoutes = contentTypes.flatMap((uid) => getCoreRoutes(uid));
29
+ const inquiryRoutes = getCoreRoutes('plugin::builder.inquiry', {
30
+ only: ['create'],
31
+ config: { create: { policies: ['plugin::builder.rate-limit'] } },
32
+ });
33
+ cachedRoutes = [...coreRoutes, ...inquiryRoutes];
34
+ }
35
+ return cachedRoutes;
36
+ },
34
37
  };
38
+ exports.default = contentApi;
35
39
  //# sourceMappingURL=content-api.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"content-api.js","sourceRoot":"","sources":["../../../../server/src/routes/content-api.ts"],"names":[],"mappings":";;AAAA,kBAAe;IACb,IAAI,EAAE,aAAa;IACnB,MAAM,EAAE;QACN;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,WAAW;YACpB,MAAM,EAAE;gBACN,QAAQ,EAAE,EAAE;gBACZ,WAAW,EAAE,kCAAkC;aAChD;SACF;QACD;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,oBAAoB;YAC1B,OAAO,EAAE,cAAc;YACvB,MAAM,EAAE;gBACN,QAAQ,EAAE,EAAE;gBACZ,WAAW,EAAE,0CAA0C;aACxD;SACF;QACD;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,aAAa;YACtB,MAAM,EAAE;gBACN,QAAQ,EAAE,EAAE;gBACZ,WAAW,EAAE,wCAAwC;aACtD;SACF;KACF;CACF,CAAC"}
1
+ {"version":3,"file":"content-api.js","sourceRoot":"","sources":["../../../../server/src/routes/content-api.ts"],"names":[],"mappings":";;AAAA,2CAA2C;AAY3C,MAAM,YAAY,GAAG;IACnB,yBAAyB;IACzB,wBAAwB;IACxB,0BAA0B;IAC1B,qBAAqB;IACrB,wBAAwB;IACxB,4BAA4B;IAC5B,sBAAsB;IACtB,wBAAwB;IACxB,8BAA8B;IAC9B,qBAAqB;CACb,CAAC;AAEX,IAAI,YAA2C,CAAC;AAEhD,SAAS,aAAa,CACpB,GAAqD,EACrD,MAAyE;IAEzE,MAAM,MAAM,GAAG,kBAAS,CAAC,gBAAgB,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IACvD,OAAO,OAAO,MAAM,CAAC,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC;AAC/E,CAAC;AAED,MAAM,UAAU,GAAqB;IACnC,IAAI,EAAE,aAAa;IACnB,IAAI,MAAM;QACR,sEAAsE;QACtE,2EAA2E;QAC3E,mEAAmE;QACnE,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,MAAM,UAAU,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC;YACrE,MAAM,aAAa,GAAG,aAAa,CAAC,yBAAyB,EAAE;gBAC7D,IAAI,EAAE,CAAC,QAAQ,CAAC;gBAChB,MAAM,EAAE,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,CAAC,4BAA4B,CAAC,EAAE,EAAE;aACjE,CAAC,CAAC;YAEH,YAAY,GAAG,CAAC,GAAG,UAAU,EAAE,GAAG,aAAa,CAAC,CAAC;QACnD,CAAC;QAED,OAAO,YAAY,CAAC;IACtB,CAAC;CACF,CAAC;AAEF,kBAAe,UAAU,CAAC"}
@@ -1,16 +1,11 @@
1
- declare const _default: {
2
- 'content-api': {
3
- type: string;
4
- routes: {
5
- method: string;
6
- path: string;
7
- handler: string;
8
- config: {
9
- policies: never[];
10
- description: string;
11
- };
12
- }[];
13
- };
14
- };
15
- export default _default;
1
+ interface ContentApiRoute {
2
+ method: string;
3
+ path: string;
4
+ }
5
+ interface ContentApiRouter {
6
+ type: 'content-api';
7
+ routes: ContentApiRoute[] | (() => ContentApiRoute[]);
8
+ }
9
+ declare const routes: Record<string, ContentApiRouter>;
10
+ export default routes;
16
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/src/routes/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAEA,wBAEE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/src/routes/index.ts"],"names":[],"mappings":"AAEA,UAAU,eAAe;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED,UAAU,gBAAgB;IACxB,IAAI,EAAE,aAAa,CAAC;IACpB,MAAM,EAAE,eAAe,EAAE,GAAG,CAAC,MAAM,eAAe,EAAE,CAAC,CAAC;CACvD;AAED,QAAA,MAAM,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAE5C,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -4,7 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const content_api_1 = __importDefault(require("./content-api"));
7
- exports.default = {
7
+ const routes = {
8
8
  'content-api': content_api_1.default,
9
9
  };
10
+ exports.default = routes;
10
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/src/routes/index.ts"],"names":[],"mappings":";;;;;AAAA,gEAAuC;AAEvC,kBAAe;IACb,aAAa,EAAE,qBAAU;CAC1B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/src/routes/index.ts"],"names":[],"mappings":";;;;;AAAA,gEAAuC;AAYvC,MAAM,MAAM,GAAqC;IAC/C,aAAa,EAAE,qBAAU;CAC1B,CAAC;AAEF,kBAAe,MAAM,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/src/services/index.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAErC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/src/services/index.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAarC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -3,9 +3,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ const strapi_1 = require("@strapi/strapi");
6
7
  const populate_1 = __importDefault(require("./populate"));
7
8
  const services = {
9
+ article: strapi_1.factories.createCoreService('plugin::builder.article'),
10
+ author: strapi_1.factories.createCoreService('plugin::builder.author'),
11
+ category: strapi_1.factories.createCoreService('plugin::builder.category'),
12
+ faq: strapi_1.factories.createCoreService('plugin::builder.faq'),
13
+ global: strapi_1.factories.createCoreService('plugin::builder.global'),
14
+ inquiry: strapi_1.factories.createCoreService('plugin::builder.inquiry'),
15
+ navigation: strapi_1.factories.createCoreService('plugin::builder.navigation'),
16
+ page: strapi_1.factories.createCoreService('plugin::builder.page'),
8
17
  populate: populate_1.default,
18
+ series: strapi_1.factories.createCoreService('plugin::builder.series'),
19
+ 'site-setting': strapi_1.factories.createCoreService('plugin::builder.site-setting'),
20
+ tag: strapi_1.factories.createCoreService('plugin::builder.tag'),
9
21
  };
10
22
  exports.default = services;
11
23
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/src/services/index.ts"],"names":[],"mappings":";;;;;AAAA,0DAAkC;AAElC,MAAM,QAAQ,GAA4B;IACxC,QAAQ,EAAR,kBAAQ;CACT,CAAC;AAEF,kBAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/src/services/index.ts"],"names":[],"mappings":";;;;;AAAA,2CAA2C;AAC3C,0DAAkC;AAElC,MAAM,QAAQ,GAA4B;IACxC,OAAO,EAAE,kBAAS,CAAC,iBAAiB,CAAC,yBAAyB,CAAC;IAC/D,MAAM,EAAE,kBAAS,CAAC,iBAAiB,CAAC,wBAAwB,CAAC;IAC7D,QAAQ,EAAE,kBAAS,CAAC,iBAAiB,CAAC,0BAA0B,CAAC;IACjE,GAAG,EAAE,kBAAS,CAAC,iBAAiB,CAAC,qBAAqB,CAAC;IACvD,MAAM,EAAE,kBAAS,CAAC,iBAAiB,CAAC,wBAAwB,CAAC;IAC7D,OAAO,EAAE,kBAAS,CAAC,iBAAiB,CAAC,yBAAyB,CAAC;IAC/D,UAAU,EAAE,kBAAS,CAAC,iBAAiB,CAAC,4BAA4B,CAAC;IACrE,IAAI,EAAE,kBAAS,CAAC,iBAAiB,CAAC,sBAAsB,CAAC;IACzD,QAAQ,EAAR,kBAAQ;IACR,MAAM,EAAE,kBAAS,CAAC,iBAAiB,CAAC,wBAAwB,CAAC;IAC7D,cAAc,EAAE,kBAAS,CAAC,iBAAiB,CAAC,8BAA8B,CAAC;IAC3E,GAAG,EAAE,kBAAS,CAAC,iBAAiB,CAAC,qBAAqB,CAAC;CACxD,CAAC;AAEF,kBAAe,QAAQ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"populate.d.ts","sourceRoot":"","sources":["../../../../server/src/services/populate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE3C,QAAA,MAAM,QAAQ,GAAI,YAAY;IAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAA;CAAE;IAyJjD;;;OAGG;;;;IAKH;;;OAGG;+BACwB,MAAM,kBAAkB,MAAM;IAIzD;;OAEG;;;;IAUH;;OAEG;;;;;;;;;;;IAYH;;OAEG;;;;;;;;IAWH;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;;CA+CN,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"populate.d.ts","sourceRoot":"","sources":["../../../../server/src/services/populate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE3C,QAAA,MAAM,QAAQ,GAAI,YAAY;IAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAA;CAAE;IAgKjD;;;OAGG;;;;IAKH;;;OAGG;+BACwB,MAAM,kBAAkB,MAAM;IAIzD;;OAEG;;;;IAUH;;OAEG;;;;;;;;;;;IAYH;;OAEG;;;;;;;;IAWH;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;;CA+CN,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -10,13 +10,19 @@ const populate = ({ strapi }) => {
10
10
  };
11
11
  // Link populate — flat component, no nested relations
12
12
  const linkPopulate = true;
13
+ // shared.image — media + scalar fit/alt; one extra level (ADR 0003)
14
+ const imagePopulate = {
15
+ populate: {
16
+ media: true,
17
+ },
18
+ };
13
19
  // Core block populate definitions (Plugin owns these components,
14
20
  // so it knows the exact nesting structure)
15
21
  const coreBlocks = {
16
22
  'blocks.hero': {
17
23
  populate: {
18
24
  section: sectionPopulate,
19
- heroMedia: true,
25
+ image: imagePopulate,
20
26
  ctaLink: linkPopulate,
21
27
  secondaryLink: linkPopulate,
22
28
  },
@@ -24,7 +30,7 @@ const populate = ({ strapi }) => {
24
30
  'blocks.features': {
25
31
  populate: {
26
32
  section: sectionPopulate,
27
- media: true,
33
+ image: imagePopulate,
28
34
  items: {
29
35
  populate: {
30
36
  link: linkPopulate,
@@ -35,7 +41,7 @@ const populate = ({ strapi }) => {
35
41
  'blocks.cta': {
36
42
  populate: {
37
43
  section: sectionPopulate,
38
- ctaMedia: true,
44
+ image: imagePopulate,
39
45
  ctaLink: linkPopulate,
40
46
  secondaryLink: linkPopulate,
41
47
  },
@@ -46,7 +52,7 @@ const populate = ({ strapi }) => {
46
52
  items: {
47
53
  populate: {
48
54
  link: linkPopulate,
49
- media: true,
55
+ image: imagePopulate,
50
56
  },
51
57
  },
52
58
  },
@@ -69,10 +75,10 @@ const populate = ({ strapi }) => {
69
75
  'blocks.highlights': {
70
76
  populate: {
71
77
  section: sectionPopulate,
72
- media: true,
78
+ image: imagePopulate,
73
79
  items: {
74
80
  populate: {
75
- media: true,
81
+ image: imagePopulate,
76
82
  link: linkPopulate,
77
83
  },
78
84
  },
@@ -83,7 +89,7 @@ const populate = ({ strapi }) => {
83
89
  section: sectionPopulate,
84
90
  items: {
85
91
  populate: {
86
- media: true,
92
+ image: imagePopulate,
87
93
  link: linkPopulate,
88
94
  },
89
95
  },
@@ -92,7 +98,7 @@ const populate = ({ strapi }) => {
92
98
  'blocks.testimonials': {
93
99
  populate: {
94
100
  section: sectionPopulate,
95
- media: true,
101
+ image: imagePopulate,
96
102
  items: {
97
103
  populate: {
98
104
  avatar: true,
@@ -115,7 +121,7 @@ const populate = ({ strapi }) => {
115
121
  'blocks.stats': {
116
122
  populate: {
117
123
  section: sectionPopulate,
118
- media: true,
124
+ image: imagePopulate,
119
125
  items: true,
120
126
  },
121
127
  },
@@ -1 +1 @@
1
- {"version":3,"file":"populate.js","sourceRoot":"","sources":["../../../../server/src/services/populate.ts"],"names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AAS,CAAC,GAAG,CAAC,EAAE,CAAC;oBACnB,UAAU,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC;gBACnC,CAAC;YACH,CAAC;YACD,+DAA+D;YAC/D,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,YAAY,EAAE,CAAC;gBACxC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;oBACrB,UAAU,CAAC,GAAG,CAAC,GAAG,KAAe,CAAC;gBACpC,CAAC;YACH,CAAC;YAED,OAAO;gBACL,GAAG,EAAE;oBACH,QAAQ,EAAE;wBACR,OAAO,EAAE,IAAI;qBACd;iBACF;gBACD,IAAI,EAAE,IAAI;gBACV,MAAM,EAAE;oBACN,QAAQ,EAAE;wBACR,WAAW,EAAE,YAAY;wBACzB,UAAU,EAAE,YAAY;wBACxB,OAAO,EAAE;4BACP,QAAQ,EAAE;gCACR,KAAK,EAAE,YAAY;6BACpB;yBACF;wBACD,IAAI,EAAE,IAAI;qBACX;iBACF;gBACD,cAAc,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE;gBAClC,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"populate.js","sourceRoot":"","sources":["../../../../server/src/services/populate.ts"],"names":[],"mappings":";;AAEA,MAAM,QAAQ,GAAG,CAAC,EAAE,MAAM,EAA2B,EAAE,EAAE;IACvD,MAAM,YAAY,GAAG,IAAI,GAAG,EAAkB,CAAC;IAE/C,kDAAkD;IAClD,MAAM,eAAe,GAAG;QACtB,QAAQ,EAAE;YACR,eAAe,EAAE,IAAI;SACtB;KACF,CAAC;IAEF,sDAAsD;IACtD,MAAM,YAAY,GAAG,IAAI,CAAC;IAE1B,oEAAoE;IACpE,MAAM,aAAa,GAAG;QACpB,QAAQ,EAAE;YACR,KAAK,EAAE,IAAI;SACZ;KACF,CA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CAAC;oBACrB,UAAU,CAAC,GAAG,CAAC,GAAG,KAAe,CAAC;gBACpC,CAAC;YACH,CAAC;YAED,OAAO;gBACL,GAAG,EAAE;oBACH,QAAQ,EAAE;wBACR,OAAO,EAAE,IAAI;qBACd;iBACF;gBACD,IAAI,EAAE,IAAI;gBACV,MAAM,EAAE;oBACN,QAAQ,EAAE;wBACR,WAAW,EAAE,YAAY;wBACzB,UAAU,EAAE,YAAY;wBACxB,OAAO,EAAE;4BACP,QAAQ,EAAE;gCACR,KAAK,EAAE,YAAY;6BACpB;yBACF;wBACD,IAAI,EAAE,IAAI;qBACX;iBACF;gBACD,cAAc,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE;gBAClC,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,QAAQ,CAAC"}
@@ -0,0 +1,11 @@
1
+ export interface PublicQueryOptions {
2
+ /**
3
+ * Top-level field names a caller may filter/sort on (exact key match, not
4
+ * nested relation paths). Omit to drop filters/sort entirely.
5
+ */
6
+ filterFields?: string[];
7
+ }
8
+ export declare function pickPublicQuery(query?: Record<string, unknown>, opts?: PublicQueryOptions): Record<string, unknown>;
9
+ /** Public, non-PII scalar fields a caller may filter/sort pages by. */
10
+ export declare const PAGE_PUBLIC_FIELDS: string[];
11
+ //# sourceMappingURL=query.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../../server/src/utils/query.ts"],"names":[],"mappings":"AA+EA,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,wBAAgB,eAAe,CAC7B,KAAK,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,EACnC,IAAI,GAAE,kBAAuB,GAC5B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAgBzB;AAED,uEAAuE;AACvE,eAAO,MAAM,kBAAkB,UAO9B,CAAC"}
@@ -0,0 +1,112 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PAGE_PUBLIC_FIELDS = void 0;
4
+ exports.pickPublicQuery = pickPublicQuery;
5
+ /**
6
+ * Whitelist the query params a public smart-API request may forward to the
7
+ * Document Service.
8
+ *
9
+ * The smart-API controllers pin `populate` and `status` server-side, but they
10
+ * previously spread the *entire* `ctx.query` into the Document Service call.
11
+ * Crucially, the Document Service bypasses the Content API sanitize/validate
12
+ * layer, so any params reach the DB raw. That let a caller pass arbitrary keys
13
+ * (e.g. `publicationState`, unexpected `populate` shapes) and — via
14
+ * `filters`/`sort` on internal relations such as `createdBy` — probe admin PII
15
+ * as an oracle (existence/ordering leaks).
16
+ *
17
+ * Only the keys below are forwarded for anonymous read traffic, and `filters`
18
+ * / `sort` are additionally constrained to an allowlist of public top-level
19
+ * field names (see `filterFields`). `fields` is intentionally NOT forwarded —
20
+ * the smart API returns a fixed server-shaped payload, so callers have no need
21
+ * to project, and dropping it removes an arbitrary projection surface.
22
+ * `populate`/`status` are set by the controller after the whitelisted spread,
23
+ * so they cannot be overridden or smuggled through.
24
+ */
25
+ const ALLOWED_QUERY_KEYS = ['locale', 'sort', 'pagination', 'filters'];
26
+ const LOGICAL_OPERATORS = new Set(['$and', '$or', '$not']);
27
+ /**
28
+ * Recursively strip filter field paths that are not in `allowed`. Logical
29
+ * operators ($and/$or/$not) are preserved and their operands recursed. A field
30
+ * key that survives keeps its operator object (e.g. `{ $eq: 'home' }`) intact.
31
+ *
32
+ * `allowed` matches TOP-LEVEL field names only. Nested relation paths such as
33
+ * `category.slug` are not supported here (a `{ category: { slug } }` filter
34
+ * would be dropped) — the page/global smart APIs only need flat scalar filters
35
+ * (slug/title/locale/timestamps), and relations stay closed by design.
36
+ */
37
+ function sanitizeFilters(filters, allowed) {
38
+ if (!filters || typeof filters !== 'object')
39
+ return undefined;
40
+ if (Array.isArray(filters)) {
41
+ const arr = filters
42
+ .map((f) => sanitizeFilters(f, allowed))
43
+ .filter((f) => f !== undefined);
44
+ return arr.length ? arr : undefined;
45
+ }
46
+ const out = {};
47
+ for (const [key, val] of Object.entries(filters)) {
48
+ if (LOGICAL_OPERATORS.has(key)) {
49
+ const nested = sanitizeFilters(val, allowed);
50
+ if (nested !== undefined)
51
+ out[key] = nested;
52
+ }
53
+ else if (allowed.includes(key)) {
54
+ out[key] = val;
55
+ }
56
+ // disallowed field keys (e.g. createdBy, updatedBy, private fields) dropped
57
+ }
58
+ return Object.keys(out).length ? out : undefined;
59
+ }
60
+ /** Keep only sort clauses whose field is in `allowed`. Supports the string,
61
+ * array-of-strings, and object forms Strapi accepts. */
62
+ function sanitizeSort(sort, allowed) {
63
+ const fieldOf = (s) => s.split(':')[0];
64
+ const okStr = (s) => typeof s === 'string' && allowed.includes(fieldOf(s));
65
+ if (typeof sort === 'string')
66
+ return okStr(sort) ? sort : undefined;
67
+ if (Array.isArray(sort)) {
68
+ const arr = sort.filter(okStr);
69
+ return arr.length ? arr : undefined;
70
+ }
71
+ if (sort && typeof sort === 'object') {
72
+ const out = {};
73
+ for (const [k, v] of Object.entries(sort)) {
74
+ if (allowed.includes(k))
75
+ out[k] = v;
76
+ }
77
+ return Object.keys(out).length ? out : undefined;
78
+ }
79
+ return undefined;
80
+ }
81
+ function pickPublicQuery(query = {}, opts = {}) {
82
+ const allowed = opts.filterFields ?? [];
83
+ const out = {};
84
+ for (const key of ALLOWED_QUERY_KEYS) {
85
+ if (query[key] === undefined)
86
+ continue;
87
+ if (key === 'filters') {
88
+ const scoped = sanitizeFilters(query.filters, allowed);
89
+ if (scoped !== undefined)
90
+ out.filters = scoped;
91
+ }
92
+ else if (key === 'sort') {
93
+ const scoped = sanitizeSort(query.sort, allowed);
94
+ if (scoped !== undefined)
95
+ out.sort = scoped;
96
+ }
97
+ else {
98
+ out[key] = query[key];
99
+ }
100
+ }
101
+ return out;
102
+ }
103
+ /** Public, non-PII scalar fields a caller may filter/sort pages by. */
104
+ exports.PAGE_PUBLIC_FIELDS = [
105
+ 'slug',
106
+ 'title',
107
+ 'locale',
108
+ 'createdAt',
109
+ 'updatedAt',
110
+ 'publishedAt',
111
+ ];
112
+ //# sourceMappingURL=query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.js","sourceRoot":"","sources":["../../../../server/src/utils/query.ts"],"names":[],"mappings":";;;AAuFA,0CAmBC;AA1GD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,kBAAkB,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,CAAU,CAAC;AAEhF,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;AAE3D;;;;;;;;;GASG;AACH,SAAS,eAAe,CAAC,OAAgB,EAAE,OAAiB;IAC1D,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IAE9D,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3B,MAAM,GAAG,GAAG,OAAO;aAChB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;aACvC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC;QAClC,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC;IACtC,CAAC;IAED,MAAM,GAAG,GAA4B,EAAE,CAAC;IACxC,KAAK,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAkC,CAAC,EAAE,CAAC;QAC5E,IAAI,iBAAiB,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YAC/B,MAAM,MAAM,GAAG,eAAe,CAAC,GAAG,EAAE,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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dani-builder/strapi-plugin-builder",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "description": "Daniworks Builder — reusable CMS components, content types, and smart API for Strapi v5",
5
5
  "license": "MIT",
6
6
  "strapi": {
@@ -20,36 +20,48 @@
20
20
  },
21
21
  "files": [
22
22
  "dist",
23
- "schemas",
24
- "bin",
25
- "strapi-server.js"
23
+ "strapi-server.js",
24
+ "AGENTS.md",
25
+ "LICENSE",
26
+ "README.md"
26
27
  ],
27
28
  "publishConfig": {
28
29
  "access": "public"
29
30
  },
30
31
  "repository": {
31
32
  "type": "git",
32
- "url": "https://github.com/hojinzs/daniworks-builder-v2.git",
33
+ "url": "https://github.com/HJ-company/daniworks-builder-v2.git",
33
34
  "directory": "packages/strapi-plugin-builder"
34
35
  },
35
- "bin": {
36
- "daniworks-builder": "./bin/sync.js"
37
- },
38
- "scripts": {
39
- "build": "tsc && node -e \"const fs=require('fs'),p=require('path'),src='server/src/components',dst='dist/server/src/components';(function cp(s,d){fs.mkdirSync(d,{recursive:true});fs.readdirSync(s).forEach(f=>{const sp=p.join(s,f),dp=p.join(d,f);fs.statSync(sp).isDirectory()?cp(sp,dp):f.endsWith('.json')&&fs.copyFileSync(sp,dp);})})(src,dst)\"",
40
- "watch": "strapi-plugin watch",
41
- "verify": "strapi-plugin verify"
42
- },
43
36
  "dependencies": {},
44
37
  "devDependencies": {
45
- "@strapi/sdk-plugin": "^5.0.0",
46
- "@strapi/strapi": "^5.0.0",
47
- "@types/node": "^20",
48
- "typescript": "^5.0.0"
38
+ "@strapi/strapi": "5.51.2",
39
+ "@types/node": "^26",
40
+ "typescript": "^6.0.3"
49
41
  },
50
42
  "peerDependencies": {
51
43
  "@strapi/strapi": "^5.0.0",
52
44
  "@strapi/plugin-color-picker": "^5.0.0",
53
45
  "@d3levvv/strapi-react-icons-plugin": "^1.0.0"
46
+ },
47
+ "keywords": [
48
+ "strapi",
49
+ "strapi-v5",
50
+ "cms",
51
+ "headless-cms",
52
+ "daniworks-builder",
53
+ "strapi-plugin",
54
+ "content-types",
55
+ "components",
56
+ "smart-api",
57
+ "block-builder"
58
+ ],
59
+ "homepage": "https://github.com/HJ-company/daniworks-builder-v2/tree/main/packages/strapi-plugin-builder#readme",
60
+ "author": "HJ-company",
61
+ "scripts": {
62
+ "build": "pnpm run clean && tsc && node -e \"const fs=require('fs'),p=require('path'),src='server/src/components',dst='dist/server/src/components';(function cp(s,d){fs.mkdirSync(d,{recursive:true});fs.readdirSync(s).forEach(f=>{const sp=p.join(s,f),dp=p.join(d,f);fs.statSync(sp).isDirectory()?cp(sp,dp):f.endsWith('.json')&&fs.copyFileSync(sp,dp);})})(src,dst)\"",
63
+ "clean": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\"",
64
+ "test": "vitest run",
65
+ "smoke:content-types": "node scripts/smoke-plugin-content-types.mjs"
54
66
  }
55
- }
67
+ }