@strapi/core 0.0.0-next.26bde6ef6bf3081acd31bd0e9dac0d9357028b9c → 0.0.0-next.29273b8e8a9a5aa635e5680190eda01f861431aa

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.

Potentially problematic release.


This version of @strapi/core might be problematic. Click here for more details.

Files changed (305) hide show
  1. package/dist/Strapi.d.ts +1 -0
  2. package/dist/Strapi.d.ts.map +1 -1
  3. package/dist/Strapi.js +24 -5
  4. package/dist/Strapi.js.map +1 -1
  5. package/dist/Strapi.mjs +24 -5
  6. package/dist/Strapi.mjs.map +1 -1
  7. package/dist/configuration/config-loader.js.map +1 -1
  8. package/dist/configuration/config-loader.mjs.map +1 -1
  9. package/dist/configuration/urls.js.map +1 -1
  10. package/dist/configuration/urls.mjs.map +1 -1
  11. package/dist/constants.d.ts +3 -0
  12. package/dist/constants.d.ts.map +1 -0
  13. package/dist/constants.js +6 -0
  14. package/dist/constants.js.map +1 -0
  15. package/dist/constants.mjs +4 -0
  16. package/dist/constants.mjs.map +1 -0
  17. package/dist/container.js.map +1 -1
  18. package/dist/container.mjs.map +1 -1
  19. package/dist/core-api/controller/index.d.ts.map +1 -1
  20. package/dist/core-api/controller/index.js +2 -1
  21. package/dist/core-api/controller/index.js.map +1 -1
  22. package/dist/core-api/controller/index.mjs +2 -1
  23. package/dist/core-api/controller/index.mjs.map +1 -1
  24. package/dist/core-api/controller/transform.d.ts +3 -2
  25. package/dist/core-api/controller/transform.d.ts.map +1 -1
  26. package/dist/core-api/controller/transform.js +13 -3
  27. package/dist/core-api/controller/transform.js.map +1 -1
  28. package/dist/core-api/controller/transform.mjs +13 -3
  29. package/dist/core-api/controller/transform.mjs.map +1 -1
  30. package/dist/core-api/routes/index.d.ts +4 -22
  31. package/dist/core-api/routes/index.d.ts.map +1 -1
  32. package/dist/core-api/routes/index.js +150 -8
  33. package/dist/core-api/routes/index.js.map +1 -1
  34. package/dist/core-api/routes/index.mjs +131 -8
  35. package/dist/core-api/routes/index.mjs.map +1 -1
  36. package/dist/core-api/routes/validation/attributes.d.ts +244 -0
  37. package/dist/core-api/routes/validation/attributes.d.ts.map +1 -0
  38. package/dist/core-api/routes/validation/attributes.js +560 -0
  39. package/dist/core-api/routes/validation/attributes.js.map +1 -0
  40. package/dist/core-api/routes/validation/attributes.mjs +521 -0
  41. package/dist/core-api/routes/validation/attributes.mjs.map +1 -0
  42. package/dist/core-api/routes/validation/common.d.ts +105 -0
  43. package/dist/core-api/routes/validation/common.d.ts.map +1 -0
  44. package/dist/core-api/routes/validation/common.js +116 -0
  45. package/dist/core-api/routes/validation/common.js.map +1 -0
  46. package/dist/core-api/routes/validation/common.mjs +95 -0
  47. package/dist/core-api/routes/validation/common.mjs.map +1 -0
  48. package/dist/core-api/routes/validation/component.d.ts +34 -0
  49. package/dist/core-api/routes/validation/component.d.ts.map +1 -0
  50. package/dist/core-api/routes/validation/component.js +45 -0
  51. package/dist/core-api/routes/validation/component.js.map +1 -0
  52. package/dist/core-api/routes/validation/component.mjs +43 -0
  53. package/dist/core-api/routes/validation/component.mjs.map +1 -0
  54. package/dist/core-api/routes/validation/constants.d.ts +8 -0
  55. package/dist/core-api/routes/validation/constants.d.ts.map +1 -0
  56. package/dist/core-api/routes/validation/constants.js +18 -0
  57. package/dist/core-api/routes/validation/constants.js.map +1 -0
  58. package/dist/core-api/routes/validation/constants.mjs +16 -0
  59. package/dist/core-api/routes/validation/constants.mjs.map +1 -0
  60. package/dist/core-api/routes/validation/content-type.d.ts +128 -0
  61. package/dist/core-api/routes/validation/content-type.d.ts.map +1 -0
  62. package/dist/core-api/routes/validation/content-type.js +201 -0
  63. package/dist/core-api/routes/validation/content-type.js.map +1 -0
  64. package/dist/core-api/routes/validation/content-type.mjs +180 -0
  65. package/dist/core-api/routes/validation/content-type.mjs.map +1 -0
  66. package/dist/core-api/routes/validation/index.d.ts +5 -0
  67. package/dist/core-api/routes/validation/index.d.ts.map +1 -0
  68. package/dist/core-api/routes/validation/mappers.d.ts +105 -0
  69. package/dist/core-api/routes/validation/mappers.d.ts.map +1 -0
  70. package/dist/core-api/routes/validation/mappers.js +273 -0
  71. package/dist/core-api/routes/validation/mappers.js.map +1 -0
  72. package/dist/core-api/routes/validation/mappers.mjs +249 -0
  73. package/dist/core-api/routes/validation/mappers.mjs.map +1 -0
  74. package/dist/core-api/routes/validation/utils.d.ts +47 -0
  75. package/dist/core-api/routes/validation/utils.d.ts.map +1 -0
  76. package/dist/core-api/routes/validation/utils.js +128 -0
  77. package/dist/core-api/routes/validation/utils.js.map +1 -0
  78. package/dist/core-api/routes/validation/utils.mjs +106 -0
  79. package/dist/core-api/routes/validation/utils.mjs.map +1 -0
  80. package/dist/core-api/service/collection-type.js.map +1 -1
  81. package/dist/core-api/service/collection-type.mjs.map +1 -1
  82. package/dist/core-api/service/single-type.js.map +1 -1
  83. package/dist/core-api/service/single-type.mjs.map +1 -1
  84. package/dist/domain/content-type/index.d.ts.map +1 -1
  85. package/dist/domain/content-type/index.js +17 -1
  86. package/dist/domain/content-type/index.js.map +1 -1
  87. package/dist/domain/content-type/index.mjs +17 -1
  88. package/dist/domain/content-type/index.mjs.map +1 -1
  89. package/dist/domain/module/index.d.ts.map +1 -1
  90. package/dist/domain/module/index.js +3 -0
  91. package/dist/domain/module/index.js.map +1 -1
  92. package/dist/domain/module/index.mjs +3 -0
  93. package/dist/domain/module/index.mjs.map +1 -1
  94. package/dist/ee/index.js.map +1 -1
  95. package/dist/ee/index.mjs.map +1 -1
  96. package/dist/ee/license.js +1 -2
  97. package/dist/ee/license.js.map +1 -1
  98. package/dist/ee/license.mjs +1 -2
  99. package/dist/ee/license.mjs.map +1 -1
  100. package/dist/factories.d.ts +3 -1
  101. package/dist/factories.d.ts.map +1 -1
  102. package/dist/factories.js +10 -2
  103. package/dist/factories.js.map +1 -1
  104. package/dist/factories.mjs +10 -3
  105. package/dist/factories.mjs.map +1 -1
  106. package/dist/loaders/apis.js.map +1 -1
  107. package/dist/loaders/apis.mjs.map +1 -1
  108. package/dist/loaders/components.js.map +1 -1
  109. package/dist/loaders/components.mjs.map +1 -1
  110. package/dist/loaders/plugins/get-enabled-plugins.js.map +1 -1
  111. package/dist/loaders/plugins/get-enabled-plugins.mjs.map +1 -1
  112. package/dist/loaders/plugins/index.js +1 -1
  113. package/dist/loaders/plugins/index.js.map +1 -1
  114. package/dist/loaders/plugins/index.mjs +1 -1
  115. package/dist/loaders/plugins/index.mjs.map +1 -1
  116. package/dist/loaders/src-index.js.map +1 -1
  117. package/dist/loaders/src-index.mjs.map +1 -1
  118. package/dist/middlewares/cors.d.ts +9 -1
  119. package/dist/middlewares/cors.d.ts.map +1 -1
  120. package/dist/middlewares/cors.js +39 -17
  121. package/dist/middlewares/cors.js.map +1 -1
  122. package/dist/middlewares/cors.mjs +39 -18
  123. package/dist/middlewares/cors.mjs.map +1 -1
  124. package/dist/middlewares/logger.js.map +1 -1
  125. package/dist/middlewares/logger.mjs.map +1 -1
  126. package/dist/middlewares/response-time.js.map +1 -1
  127. package/dist/middlewares/response-time.mjs.map +1 -1
  128. package/dist/middlewares/security.d.ts.map +1 -1
  129. package/dist/middlewares/security.js +2 -15
  130. package/dist/middlewares/security.js.map +1 -1
  131. package/dist/middlewares/security.mjs +2 -15
  132. package/dist/middlewares/security.mjs.map +1 -1
  133. package/dist/migrations/database/5.0.0-discard-drafts.js +1 -1
  134. package/dist/migrations/database/5.0.0-discard-drafts.js.map +1 -1
  135. package/dist/migrations/database/5.0.0-discard-drafts.mjs +1 -1
  136. package/dist/migrations/database/5.0.0-discard-drafts.mjs.map +1 -1
  137. package/dist/migrations/first-published-at.d.ts +4 -0
  138. package/dist/migrations/first-published-at.d.ts.map +1 -0
  139. package/dist/migrations/first-published-at.js +51 -0
  140. package/dist/migrations/first-published-at.js.map +1 -0
  141. package/dist/migrations/first-published-at.mjs +49 -0
  142. package/dist/migrations/first-published-at.mjs.map +1 -0
  143. package/dist/migrations/index.d.ts.map +1 -1
  144. package/dist/migrations/index.js +5 -0
  145. package/dist/migrations/index.js.map +1 -1
  146. package/dist/migrations/index.mjs +5 -0
  147. package/dist/migrations/index.mjs.map +1 -1
  148. package/dist/package.json.js +20 -15
  149. package/dist/package.json.js.map +1 -1
  150. package/dist/package.json.mjs +20 -15
  151. package/dist/package.json.mjs.map +1 -1
  152. package/dist/providers/index.d.ts.map +1 -1
  153. package/dist/providers/index.js +2 -0
  154. package/dist/providers/index.js.map +1 -1
  155. package/dist/providers/index.mjs +2 -0
  156. package/dist/providers/index.mjs.map +1 -1
  157. package/dist/providers/session-manager.d.ts +3 -0
  158. package/dist/providers/session-manager.d.ts.map +1 -0
  159. package/dist/providers/session-manager.js +23 -0
  160. package/dist/providers/session-manager.js.map +1 -0
  161. package/dist/providers/session-manager.mjs +21 -0
  162. package/dist/providers/session-manager.mjs.map +1 -0
  163. package/dist/registries/apis.js.map +1 -1
  164. package/dist/registries/apis.mjs.map +1 -1
  165. package/dist/registries/custom-fields.js.map +1 -1
  166. package/dist/registries/custom-fields.mjs.map +1 -1
  167. package/dist/registries/namespace.js.map +1 -1
  168. package/dist/registries/namespace.mjs.map +1 -1
  169. package/dist/registries/plugins.js.map +1 -1
  170. package/dist/registries/plugins.mjs.map +1 -1
  171. package/dist/registries/policies.js.map +1 -1
  172. package/dist/registries/policies.mjs.map +1 -1
  173. package/dist/services/config.js.map +1 -1
  174. package/dist/services/config.mjs.map +1 -1
  175. package/dist/services/content-api/index.d.ts +1 -1
  176. package/dist/services/content-api/index.d.ts.map +1 -1
  177. package/dist/services/content-api/index.js +1 -1
  178. package/dist/services/content-api/index.js.map +1 -1
  179. package/dist/services/content-api/index.mjs +2 -2
  180. package/dist/services/content-api/index.mjs.map +1 -1
  181. package/dist/services/content-api/permissions/index.js.map +1 -1
  182. package/dist/services/content-api/permissions/index.mjs.map +1 -1
  183. package/dist/services/content-source-maps.d.ts +13 -0
  184. package/dist/services/content-source-maps.d.ts.map +1 -0
  185. package/dist/services/content-source-maps.js +108 -0
  186. package/dist/services/content-source-maps.js.map +1 -0
  187. package/dist/services/content-source-maps.mjs +106 -0
  188. package/dist/services/content-source-maps.mjs.map +1 -0
  189. package/dist/services/core-store.js.map +1 -1
  190. package/dist/services/core-store.mjs.map +1 -1
  191. package/dist/services/document-service/components.d.ts +31 -1
  192. package/dist/services/document-service/components.d.ts.map +1 -1
  193. package/dist/services/document-service/components.js +109 -0
  194. package/dist/services/document-service/components.js.map +1 -1
  195. package/dist/services/document-service/components.mjs +107 -1
  196. package/dist/services/document-service/components.mjs.map +1 -1
  197. package/dist/services/document-service/entries.d.ts.map +1 -1
  198. package/dist/services/document-service/entries.js.map +1 -1
  199. package/dist/services/document-service/entries.mjs.map +1 -1
  200. package/dist/services/document-service/first-published-at.d.ts +7 -0
  201. package/dist/services/document-service/first-published-at.d.ts.map +1 -0
  202. package/dist/services/document-service/first-published-at.js +31 -0
  203. package/dist/services/document-service/first-published-at.js.map +1 -0
  204. package/dist/services/document-service/first-published-at.mjs +28 -0
  205. package/dist/services/document-service/first-published-at.mjs.map +1 -0
  206. package/dist/services/document-service/internationalization.d.ts +6 -1
  207. package/dist/services/document-service/internationalization.d.ts.map +1 -1
  208. package/dist/services/document-service/internationalization.js +32 -0
  209. package/dist/services/document-service/internationalization.js.map +1 -1
  210. package/dist/services/document-service/internationalization.mjs +32 -1
  211. package/dist/services/document-service/internationalization.mjs.map +1 -1
  212. package/dist/services/document-service/repository.d.ts.map +1 -1
  213. package/dist/services/document-service/repository.js +17 -9
  214. package/dist/services/document-service/repository.js.map +1 -1
  215. package/dist/services/document-service/repository.mjs +19 -11
  216. package/dist/services/document-service/repository.mjs.map +1 -1
  217. package/dist/services/document-service/transform/fields.js.map +1 -1
  218. package/dist/services/document-service/transform/fields.mjs.map +1 -1
  219. package/dist/services/document-service/transform/id-map.js.map +1 -1
  220. package/dist/services/document-service/transform/id-map.mjs.map +1 -1
  221. package/dist/services/document-service/utils/clean-component-join-table.d.ts +7 -0
  222. package/dist/services/document-service/utils/clean-component-join-table.d.ts.map +1 -0
  223. package/dist/services/document-service/utils/clean-component-join-table.js +145 -0
  224. package/dist/services/document-service/utils/clean-component-join-table.js.map +1 -0
  225. package/dist/services/document-service/utils/clean-component-join-table.mjs +143 -0
  226. package/dist/services/document-service/utils/clean-component-join-table.mjs.map +1 -0
  227. package/dist/services/document-service/utils/unidirectional-relations.d.ts +19 -2
  228. package/dist/services/document-service/utils/unidirectional-relations.d.ts.map +1 -1
  229. package/dist/services/document-service/utils/unidirectional-relations.js +21 -6
  230. package/dist/services/document-service/utils/unidirectional-relations.js.map +1 -1
  231. package/dist/services/document-service/utils/unidirectional-relations.mjs +21 -6
  232. package/dist/services/document-service/utils/unidirectional-relations.mjs.map +1 -1
  233. package/dist/services/entity-service/index.js.map +1 -1
  234. package/dist/services/entity-service/index.mjs.map +1 -1
  235. package/dist/services/entity-validator/blocks-validator.js.map +1 -1
  236. package/dist/services/entity-validator/blocks-validator.mjs.map +1 -1
  237. package/dist/services/entity-validator/index.d.ts.map +1 -1
  238. package/dist/services/entity-validator/index.js +9 -0
  239. package/dist/services/entity-validator/index.js.map +1 -1
  240. package/dist/services/entity-validator/index.mjs +9 -0
  241. package/dist/services/entity-validator/index.mjs.map +1 -1
  242. package/dist/services/entity-validator/validators.d.ts +1 -0
  243. package/dist/services/entity-validator/validators.d.ts.map +1 -1
  244. package/dist/services/entity-validator/validators.js.map +1 -1
  245. package/dist/services/entity-validator/validators.mjs.map +1 -1
  246. package/dist/services/metrics/index.d.ts +1 -1
  247. package/dist/services/metrics/index.d.ts.map +1 -1
  248. package/dist/services/metrics/index.js +11 -9
  249. package/dist/services/metrics/index.js.map +1 -1
  250. package/dist/services/metrics/index.mjs +11 -9
  251. package/dist/services/metrics/index.mjs.map +1 -1
  252. package/dist/services/metrics/middleware.d.ts +2 -1
  253. package/dist/services/metrics/middleware.d.ts.map +1 -1
  254. package/dist/services/metrics/middleware.js +2 -2
  255. package/dist/services/metrics/middleware.js.map +1 -1
  256. package/dist/services/metrics/middleware.mjs +2 -2
  257. package/dist/services/metrics/middleware.mjs.map +1 -1
  258. package/dist/services/metrics/sender.d.ts.map +1 -1
  259. package/dist/services/metrics/sender.js +4 -3
  260. package/dist/services/metrics/sender.js.map +1 -1
  261. package/dist/services/metrics/sender.mjs +4 -3
  262. package/dist/services/metrics/sender.mjs.map +1 -1
  263. package/dist/services/server/compose-endpoint.js.map +1 -1
  264. package/dist/services/server/compose-endpoint.mjs.map +1 -1
  265. package/dist/services/server/index.js.map +1 -1
  266. package/dist/services/server/index.mjs.map +1 -1
  267. package/dist/services/server/middleware.js.map +1 -1
  268. package/dist/services/server/middleware.mjs.map +1 -1
  269. package/dist/services/server/register-routes.js +22 -2
  270. package/dist/services/server/register-routes.js.map +1 -1
  271. package/dist/services/server/register-routes.mjs +22 -2
  272. package/dist/services/server/register-routes.mjs.map +1 -1
  273. package/dist/services/server/routing.d.ts +10 -0
  274. package/dist/services/server/routing.d.ts.map +1 -1
  275. package/dist/services/server/routing.js +7 -1
  276. package/dist/services/server/routing.js.map +1 -1
  277. package/dist/services/server/routing.mjs +7 -1
  278. package/dist/services/server/routing.mjs.map +1 -1
  279. package/dist/services/session-manager.d.ts +167 -0
  280. package/dist/services/session-manager.d.ts.map +1 -0
  281. package/dist/services/session-manager.js +529 -0
  282. package/dist/services/session-manager.js.map +1 -0
  283. package/dist/services/session-manager.mjs +526 -0
  284. package/dist/services/session-manager.mjs.map +1 -0
  285. package/dist/services/utils/conditional-fields.d.ts +3 -0
  286. package/dist/services/utils/conditional-fields.d.ts.map +1 -0
  287. package/dist/services/utils/conditional-fields.js +22 -0
  288. package/dist/services/utils/conditional-fields.js.map +1 -0
  289. package/dist/services/utils/conditional-fields.mjs +20 -0
  290. package/dist/services/utils/conditional-fields.mjs.map +1 -0
  291. package/dist/services/webhook-runner.js.map +1 -1
  292. package/dist/services/webhook-runner.mjs.map +1 -1
  293. package/dist/services/worker-queue.js.map +1 -1
  294. package/dist/services/worker-queue.mjs.map +1 -1
  295. package/dist/utils/fetch.js.map +1 -1
  296. package/dist/utils/fetch.mjs.map +1 -1
  297. package/dist/utils/filepath-to-prop-path.js.map +1 -1
  298. package/dist/utils/filepath-to-prop-path.mjs.map +1 -1
  299. package/dist/utils/load-config-file.js.map +1 -1
  300. package/dist/utils/load-config-file.mjs.map +1 -1
  301. package/dist/utils/startup-logger.js.map +1 -1
  302. package/dist/utils/startup-logger.mjs.map +1 -1
  303. package/dist/utils/transform-content-types-to-models.d.ts +196 -0
  304. package/dist/utils/transform-content-types-to-models.d.ts.map +1 -1
  305. package/package.json +20 -15
@@ -0,0 +1,51 @@
1
+ 'use strict';
2
+
3
+ var strapiUtils = require('@strapi/utils');
4
+ var _ = require('lodash');
5
+
6
+ const enableFirstPublishedAt = async ({ oldContentTypes, contentTypes })=>{
7
+ if (!oldContentTypes) {
8
+ return;
9
+ }
10
+ return strapi.db.transaction(async (trx)=>{
11
+ for(const uid in contentTypes){
12
+ if (!oldContentTypes[uid]) {
13
+ continue;
14
+ }
15
+ const contentType = contentTypes[uid];
16
+ if (!strapiUtils.contentTypes.hasFirstPublishedAtField(contentType)) {
17
+ continue;
18
+ }
19
+ if (!contentType.attributes?.firstPublishedAt) {
20
+ continue;
21
+ }
22
+ const content = await strapi.db.queryBuilder(uid).select('*').transacting(trx).execute();
23
+ // Process content types in pairs: draft and published.
24
+ // If only one exist, which means the value is not published yet and we can ignore it
25
+ const groupedContent = _.groupBy(content, (item)=>`${item.documentId}-${item.locale}`);
26
+ for (const items of Object.values(groupedContent)){
27
+ // If there is only one item, which means nothing is published yet for this locale
28
+ if (items.length <= 1) {
29
+ continue;
30
+ }
31
+ // If firstPublishedAt is already present, do not do anything
32
+ if (items[0].firstPublishedAt != null && items[1].firstPublishedAt != null) {
33
+ continue;
34
+ }
35
+ const publishedContent = items.filter((item)=>item.publishedAt != null).at(0);
36
+ if (!publishedContent) {
37
+ continue;
38
+ }
39
+ await strapi.db.queryBuilder(uid).update({
40
+ firstPublishedAt: new Date(publishedContent.publishedAt)
41
+ }).where({
42
+ documentId: publishedContent.documentId,
43
+ locale: publishedContent.locale
44
+ }).transacting(trx).execute();
45
+ }
46
+ }
47
+ });
48
+ };
49
+
50
+ exports.enable = enableFirstPublishedAt;
51
+ //# sourceMappingURL=first-published-at.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"first-published-at.js","sources":["../../src/migrations/first-published-at.ts"],"sourcesContent":["import { contentTypes as contentTypesUtils } from '@strapi/utils';\nimport _ from 'lodash';\nimport { Input } from './draft-publish';\n\ninterface ContentTypeData {\n id: number;\n documentId: string;\n publishedAt: Date;\n firstPublishedAt: Date;\n locale: string;\n}\n\nconst enableFirstPublishedAt = async ({ oldContentTypes, contentTypes }: Input) => {\n if (!oldContentTypes) {\n return;\n }\n\n return strapi.db.transaction(async (trx) => {\n for (const uid in contentTypes) {\n if (!oldContentTypes[uid]) {\n continue;\n }\n\n const contentType = contentTypes[uid];\n\n if (!contentTypesUtils.hasFirstPublishedAtField(contentType)) {\n continue;\n }\n\n if (!contentType.attributes?.firstPublishedAt) {\n continue;\n }\n\n const content: ContentTypeData[] = await strapi.db\n .queryBuilder(uid)\n .select('*')\n .transacting(trx)\n .execute();\n\n // Process content types in pairs: draft and published.\n // If only one exist, which means the value is not published yet and we can ignore it\n const groupedContent = _.groupBy(content, (item) => `${item.documentId}-${item.locale}`);\n\n for (const items of Object.values(groupedContent)) {\n // If there is only one item, which means nothing is published yet for this locale\n if (items.length <= 1) {\n continue;\n }\n\n // If firstPublishedAt is already present, do not do anything\n if (items[0].firstPublishedAt != null && items[1].firstPublishedAt != null) {\n continue;\n }\n\n const publishedContent = items.filter((item) => item.publishedAt != null).at(0);\n if (!publishedContent) {\n continue;\n }\n\n await strapi.db\n .queryBuilder(uid)\n .update({\n firstPublishedAt: new Date(publishedContent.publishedAt),\n })\n .where({\n documentId: publishedContent.documentId,\n locale: publishedContent.locale,\n })\n .transacting(trx)\n .execute();\n }\n }\n });\n};\n\nexport { enableFirstPublishedAt as enable };\n"],"names":["enableFirstPublishedAt","oldContentTypes","contentTypes","strapi","db","transaction","trx","uid","contentType","contentTypesUtils","hasFirstPublishedAtField","attributes","firstPublishedAt","content","queryBuilder","select","transacting","execute","groupedContent","_","groupBy","item","documentId","locale","items","Object","values","length","publishedContent","filter","publishedAt","at","update","Date","where"],"mappings":";;;;;AAYA,MAAMA,yBAAyB,OAAO,EAAEC,eAAe,EAAEC,YAAY,EAAS,GAAA;AAC5E,IAAA,IAAI,CAACD,eAAiB,EAAA;AACpB,QAAA;AACF;AAEA,IAAA,OAAOE,MAAOC,CAAAA,EAAE,CAACC,WAAW,CAAC,OAAOC,GAAAA,GAAAA;QAClC,IAAK,MAAMC,OAAOL,YAAc,CAAA;AAC9B,YAAA,IAAI,CAACD,eAAe,CAACM,GAAAA,CAAI,EAAE;AACzB,gBAAA;AACF;YAEA,MAAMC,WAAAA,GAAcN,YAAY,CAACK,GAAI,CAAA;AAErC,YAAA,IAAI,CAACE,wBAAAA,CAAkBC,wBAAwB,CAACF,WAAc,CAAA,EAAA;AAC5D,gBAAA;AACF;AAEA,YAAA,IAAI,CAACA,WAAAA,CAAYG,UAAU,EAAEC,gBAAkB,EAAA;AAC7C,gBAAA;AACF;AAEA,YAAA,MAAMC,OAA6B,GAAA,MAAMV,MAAOC,CAAAA,EAAE,CAC/CU,YAAY,CAACP,GACbQ,CAAAA,CAAAA,MAAM,CAAC,GAAA,CAAA,CACPC,WAAW,CAACV,KACZW,OAAO,EAAA;;;AAIV,YAAA,MAAMC,cAAiBC,GAAAA,CAAAA,CAAEC,OAAO,CAACP,SAAS,CAACQ,IAAAA,GAAS,CAAGA,EAAAA,IAAAA,CAAKC,UAAU,CAAC,CAAC,EAAED,IAAAA,CAAKE,MAAM,CAAE,CAAA,CAAA;AAEvF,YAAA,KAAK,MAAMC,KAAAA,IAASC,MAAOC,CAAAA,MAAM,CAACR,cAAiB,CAAA,CAAA;;gBAEjD,IAAIM,KAAAA,CAAMG,MAAM,IAAI,CAAG,EAAA;AACrB,oBAAA;AACF;;AAGA,gBAAA,IAAIH,KAAK,CAAC,CAAE,CAAA,CAACZ,gBAAgB,IAAI,IAAQY,IAAAA,KAAK,CAAC,CAAA,CAAE,CAACZ,gBAAgB,IAAI,IAAM,EAAA;AAC1E,oBAAA;AACF;gBAEA,MAAMgB,gBAAAA,GAAmBJ,KAAMK,CAAAA,MAAM,CAAC,CAACR,IAASA,GAAAA,IAAAA,CAAKS,WAAW,IAAI,IAAMC,CAAAA,CAAAA,EAAE,CAAC,CAAA,CAAA;AAC7E,gBAAA,IAAI,CAACH,gBAAkB,EAAA;AACrB,oBAAA;AACF;AAEA,gBAAA,MAAMzB,OAAOC,EAAE,CACZU,YAAY,CAACP,GAAAA,CAAAA,CACbyB,MAAM,CAAC;oBACNpB,gBAAkB,EAAA,IAAIqB,IAAKL,CAAAA,gBAAAA,CAAiBE,WAAW;AACzD,iBAAA,CAAA,CACCI,KAAK,CAAC;AACLZ,oBAAAA,UAAAA,EAAYM,iBAAiBN,UAAU;AACvCC,oBAAAA,MAAAA,EAAQK,iBAAiBL;iBAE1BP,CAAAA,CAAAA,WAAW,CAACV,GAAAA,CAAAA,CACZW,OAAO,EAAA;AACZ;AACF;AACF,KAAA,CAAA;AACF;;;;"}
@@ -0,0 +1,49 @@
1
+ import { contentTypes } from '@strapi/utils';
2
+ import _ from 'lodash';
3
+
4
+ const enableFirstPublishedAt = async ({ oldContentTypes, contentTypes: contentTypes$1 })=>{
5
+ if (!oldContentTypes) {
6
+ return;
7
+ }
8
+ return strapi.db.transaction(async (trx)=>{
9
+ for(const uid in contentTypes$1){
10
+ if (!oldContentTypes[uid]) {
11
+ continue;
12
+ }
13
+ const contentType = contentTypes$1[uid];
14
+ if (!contentTypes.hasFirstPublishedAtField(contentType)) {
15
+ continue;
16
+ }
17
+ if (!contentType.attributes?.firstPublishedAt) {
18
+ continue;
19
+ }
20
+ const content = await strapi.db.queryBuilder(uid).select('*').transacting(trx).execute();
21
+ // Process content types in pairs: draft and published.
22
+ // If only one exist, which means the value is not published yet and we can ignore it
23
+ const groupedContent = _.groupBy(content, (item)=>`${item.documentId}-${item.locale}`);
24
+ for (const items of Object.values(groupedContent)){
25
+ // If there is only one item, which means nothing is published yet for this locale
26
+ if (items.length <= 1) {
27
+ continue;
28
+ }
29
+ // If firstPublishedAt is already present, do not do anything
30
+ if (items[0].firstPublishedAt != null && items[1].firstPublishedAt != null) {
31
+ continue;
32
+ }
33
+ const publishedContent = items.filter((item)=>item.publishedAt != null).at(0);
34
+ if (!publishedContent) {
35
+ continue;
36
+ }
37
+ await strapi.db.queryBuilder(uid).update({
38
+ firstPublishedAt: new Date(publishedContent.publishedAt)
39
+ }).where({
40
+ documentId: publishedContent.documentId,
41
+ locale: publishedContent.locale
42
+ }).transacting(trx).execute();
43
+ }
44
+ }
45
+ });
46
+ };
47
+
48
+ export { enableFirstPublishedAt as enable };
49
+ //# sourceMappingURL=first-published-at.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"first-published-at.mjs","sources":["../../src/migrations/first-published-at.ts"],"sourcesContent":["import { contentTypes as contentTypesUtils } from '@strapi/utils';\nimport _ from 'lodash';\nimport { Input } from './draft-publish';\n\ninterface ContentTypeData {\n id: number;\n documentId: string;\n publishedAt: Date;\n firstPublishedAt: Date;\n locale: string;\n}\n\nconst enableFirstPublishedAt = async ({ oldContentTypes, contentTypes }: Input) => {\n if (!oldContentTypes) {\n return;\n }\n\n return strapi.db.transaction(async (trx) => {\n for (const uid in contentTypes) {\n if (!oldContentTypes[uid]) {\n continue;\n }\n\n const contentType = contentTypes[uid];\n\n if (!contentTypesUtils.hasFirstPublishedAtField(contentType)) {\n continue;\n }\n\n if (!contentType.attributes?.firstPublishedAt) {\n continue;\n }\n\n const content: ContentTypeData[] = await strapi.db\n .queryBuilder(uid)\n .select('*')\n .transacting(trx)\n .execute();\n\n // Process content types in pairs: draft and published.\n // If only one exist, which means the value is not published yet and we can ignore it\n const groupedContent = _.groupBy(content, (item) => `${item.documentId}-${item.locale}`);\n\n for (const items of Object.values(groupedContent)) {\n // If there is only one item, which means nothing is published yet for this locale\n if (items.length <= 1) {\n continue;\n }\n\n // If firstPublishedAt is already present, do not do anything\n if (items[0].firstPublishedAt != null && items[1].firstPublishedAt != null) {\n continue;\n }\n\n const publishedContent = items.filter((item) => item.publishedAt != null).at(0);\n if (!publishedContent) {\n continue;\n }\n\n await strapi.db\n .queryBuilder(uid)\n .update({\n firstPublishedAt: new Date(publishedContent.publishedAt),\n })\n .where({\n documentId: publishedContent.documentId,\n locale: publishedContent.locale,\n })\n .transacting(trx)\n .execute();\n }\n }\n });\n};\n\nexport { enableFirstPublishedAt as enable };\n"],"names":["enableFirstPublishedAt","oldContentTypes","contentTypes","strapi","db","transaction","trx","uid","contentType","contentTypesUtils","hasFirstPublishedAtField","attributes","firstPublishedAt","content","queryBuilder","select","transacting","execute","groupedContent","_","groupBy","item","documentId","locale","items","Object","values","length","publishedContent","filter","publishedAt","at","update","Date","where"],"mappings":";;;AAYA,MAAMA,yBAAyB,OAAO,EAAEC,eAAe,gBAAEC,cAAY,EAAS,GAAA;AAC5E,IAAA,IAAI,CAACD,eAAiB,EAAA;AACpB,QAAA;AACF;AAEA,IAAA,OAAOE,MAAOC,CAAAA,EAAE,CAACC,WAAW,CAAC,OAAOC,GAAAA,GAAAA;QAClC,IAAK,MAAMC,OAAOL,cAAc,CAAA;AAC9B,YAAA,IAAI,CAACD,eAAe,CAACM,GAAAA,CAAI,EAAE;AACzB,gBAAA;AACF;YAEA,MAAMC,WAAAA,GAAcN,cAAY,CAACK,GAAI,CAAA;AAErC,YAAA,IAAI,CAACE,YAAAA,CAAkBC,wBAAwB,CAACF,WAAc,CAAA,EAAA;AAC5D,gBAAA;AACF;AAEA,YAAA,IAAI,CAACA,WAAAA,CAAYG,UAAU,EAAEC,gBAAkB,EAAA;AAC7C,gBAAA;AACF;AAEA,YAAA,MAAMC,OAA6B,GAAA,MAAMV,MAAOC,CAAAA,EAAE,C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ts","sourceRoot":"","sources":["../../src/migrations/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAE7C,QAAA,MAAM,MAAM,sCAA6C,KAAK,kBAG7D,CAAC;AAEF,QAAA,MAAM,OAAO,sCAA6C,KAAK,kBAG9D,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/migrations/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAE7C,QAAA,MAAM,MAAM,sCAA6C,KAAK,kBAI7D,CAAC;AAEF,QAAA,MAAM,OAAO,sCAA6C,KAAK,kBAG9D,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC"}
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var draftPublish = require('./draft-publish.js');
4
+ var firstPublishedAt = require('./first-published-at.js');
4
5
  var i18n = require('./i18n.js');
5
6
 
6
7
  const enable = async ({ oldContentTypes, contentTypes })=>{
@@ -12,6 +13,10 @@ const enable = async ({ oldContentTypes, contentTypes })=>{
12
13
  oldContentTypes,
13
14
  contentTypes
14
15
  });
16
+ await firstPublishedAt.enable({
17
+ oldContentTypes,
18
+ contentTypes
19
+ });
15
20
  };
16
21
  const disable = async ({ oldContentTypes, contentTypes })=>{
17
22
  await i18n.disable({
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/migrations/index.ts"],"sourcesContent":["import * as draftPublishMigrations from './draft-publish';\nimport * as i18nMigrations from './i18n';\nimport type { Input } from './draft-publish';\n\nconst enable = async ({ oldContentTypes, contentTypes }: Input) => {\n await i18nMigrations.enable({ oldContentTypes, contentTypes });\n await draftPublishMigrations.enable({ oldContentTypes, contentTypes });\n};\n\nconst disable = async ({ oldContentTypes, contentTypes }: Input) => {\n await i18nMigrations.disable({ oldContentTypes, contentTypes });\n await draftPublishMigrations.disable({ oldContentTypes, contentTypes });\n};\n\nexport { enable, disable };\n"],"names":["enable","oldContentTypes","contentTypes","i18nMigrations","draftPublishMigrations","disable"],"mappings":";;;;;AAIA,MAAMA,SAAS,OAAO,EAAEC,eAAe,EAAEC,YAAY,EAAS,GAAA;IAC5D,MAAMC,WAAqB,CAAC;AAAEF,QAAAA,eAAAA;AAAiBC,QAAAA;AAAa,KAAA,CAAA;IAC5D,MAAME,mBAA6B,CAAC;AAAEH,QAAAA,eAAAA;AAAiBC,QAAAA;AAAa,KAAA,CAAA;AACtE;AAEA,MAAMG,UAAU,OAAO,EAAEJ,eAAe,EAAEC,YAAY,EAAS,GAAA;IAC7D,MAAMC,YAAsB,CAAC;AAAEF,QAAAA,eAAAA;AAAiBC,QAAAA;AAAa,KAAA,CAAA;IAC7D,MAAME,oBAA8B,CAAC;AAAEH,QAAAA,eAAAA;AAAiBC,QAAAA;AAAa,KAAA,CAAA;AACvE;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../src/migrations/index.ts"],"sourcesContent":["import * as draftPublishMigrations from './draft-publish';\nimport * as firstPublishedAt from './first-published-at';\nimport * as i18nMigrations from './i18n';\nimport type { Input } from './draft-publish';\n\nconst enable = async ({ oldContentTypes, contentTypes }: Input) => {\n await i18nMigrations.enable({ oldContentTypes, contentTypes });\n await draftPublishMigrations.enable({ oldContentTypes, contentTypes });\n await firstPublishedAt.enable({ oldContentTypes, contentTypes });\n};\n\nconst disable = async ({ oldContentTypes, contentTypes }: Input) => {\n await i18nMigrations.disable({ oldContentTypes, contentTypes });\n await draftPublishMigrations.disable({ oldContentTypes, contentTypes });\n};\n\nexport { enable, disable };\n"],"names":["enable","oldContentTypes","contentTypes","i18nMigrations","draftPublishMigrations","firstPublishedAt","disable"],"mappings":";;;;;;AAKA,MAAMA,SAAS,OAAO,EAAEC,eAAe,EAAEC,YAAY,EAAS,GAAA;IAC5D,MAAMC,WAAqB,CAAC;AAAEF,QAAAA,eAAAA;AAAiBC,QAAAA;AAAa,KAAA,CAAA;IAC5D,MAAME,mBAA6B,CAAC;AAAEH,QAAAA,eAAAA;AAAiBC,QAAAA;AAAa,KAAA,CAAA;IACpE,MAAMG,uBAAuB,CAAC;AAAEJ,QAAAA,eAAAA;AAAiBC,QAAAA;AAAa,KAAA,CAAA;AAChE;AAEA,MAAMI,UAAU,OAAO,EAAEL,eAAe,EAAEC,YAAY,EAAS,GAAA;IAC7D,MAAMC,YAAsB,CAAC;AAAEF,QAAAA,eAAAA;AAAiBC,QAAAA;AAAa,KAAA,CAAA;IAC7D,MAAME,oBAA8B,CAAC;AAAEH,QAAAA,eAAAA;AAAiBC,QAAAA;AAAa,KAAA,CAAA;AACvE;;;;;"}
@@ -1,4 +1,5 @@
1
1
  import { enable as enableDraftAndPublish, disable as disableDraftAndPublish } from './draft-publish.mjs';
2
+ import { enable as enableFirstPublishedAt } from './first-published-at.mjs';
2
3
  import { enable as enableI18n, disable as disableI18n } from './i18n.mjs';
3
4
 
4
5
  const enable = async ({ oldContentTypes, contentTypes })=>{
@@ -10,6 +11,10 @@ const enable = async ({ oldContentTypes, contentTypes })=>{
10
11
  oldContentTypes,
11
12
  contentTypes
12
13
  });
14
+ await enableFirstPublishedAt({
15
+ oldContentTypes,
16
+ contentTypes
17
+ });
13
18
  };
14
19
  const disable = async ({ oldContentTypes, contentTypes })=>{
15
20
  await disableI18n({
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/migrations/index.ts"],"sourcesContent":["import * as draftPublishMigrations from './draft-publish';\nimport * as i18nMigrations from './i18n';\nimport type { Input } from './draft-publish';\n\nconst enable = async ({ oldContentTypes, contentTypes }: Input) => {\n await i18nMigrations.enable({ oldContentTypes, contentTypes });\n await draftPublishMigrations.enable({ oldContentTypes, contentTypes });\n};\n\nconst disable = async ({ oldContentTypes, contentTypes }: Input) => {\n await i18nMigrations.disable({ oldContentTypes, contentTypes });\n await draftPublishMigrations.disable({ oldContentTypes, contentTypes });\n};\n\nexport { enable, disable };\n"],"names":["enable","oldContentTypes","contentTypes","i18nMigrations","draftPublishMigrations","disable"],"mappings":";;;AAIA,MAAMA,SAAS,OAAO,EAAEC,eAAe,EAAEC,YAAY,EAAS,GAAA;IAC5D,MAAMC,UAAqB,CAAC;AAAEF,QAAAA,eAAAA;AAAiBC,QAAAA;AAAa,KAAA,CAAA;IAC5D,MAAME,qBAA6B,CAAC;AAAEH,QAAAA,eAAAA;AAAiBC,QAAAA;AAAa,KAAA,CAAA;AACtE;AAEA,MAAMG,UAAU,OAAO,EAAEJ,eAAe,EAAEC,YAAY,EAAS,GAAA;IAC7D,MAAMC,WAAsB,CAAC;AAAEF,QAAAA,eAAAA;AAAiBC,QAAAA;AAAa,KAAA,CAAA;IAC7D,MAAME,sBAA8B,CAAC;AAAEH,QAAAA,eAAAA;AAAiBC,QAAAA;AAAa,KAAA,CAAA;AACvE;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../src/migrations/index.ts"],"sourcesContent":["import * as draftPublishMigrations from './draft-publish';\nimport * as firstPublishedAt from './first-published-at';\nimport * as i18nMigrations from './i18n';\nimport type { Input } from './draft-publish';\n\nconst enable = async ({ oldContentTypes, contentTypes }: Input) => {\n await i18nMigrations.enable({ oldContentTypes, contentTypes });\n await draftPublishMigrations.enable({ oldContentTypes, contentTypes });\n await firstPublishedAt.enable({ oldContentTypes, contentTypes });\n};\n\nconst disable = async ({ oldContentTypes, contentTypes }: Input) => {\n await i18nMigrations.disable({ oldContentTypes, contentTypes });\n await draftPublishMigrations.disable({ oldContentTypes, contentTypes });\n};\n\nexport { enable, disable };\n"],"names":["enable","oldContentTypes","contentTypes","i18nMigrations","draftPublishMigrations","firstPublishedAt","disable"],"mappings":";;;;AAKA,MAAMA,SAAS,OAAO,EAAEC,eAAe,EAAEC,YAAY,EAAS,GAAA;IAC5D,MAAMC,UAAqB,CAAC;AAAEF,QAAAA,eAAAA;AAAiBC,QAAAA;AAAa,KAAA,CAAA;IAC5D,MAAME,qBAA6B,CAAC;AAAEH,QAAAA,eAAAA;AAAiBC,QAAAA;AAAa,KAAA,CAAA;IACpE,MAAMG,sBAAuB,CAAC;AAAEJ,QAAAA,eAAAA;AAAiBC,QAAAA;AAAa,KAAA,CAAA;AAChE;AAEA,MAAMI,UAAU,OAAO,EAAEL,eAAe,EAAEC,YAAY,EAAS,GAAA;IAC7D,MAAMC,WAAsB,CAAC;AAAEF,QAAAA,eAAAA;AAAiBC,QAAAA;AAAa,KAAA,CAAA;IAC7D,MAAME,sBAA8B,CAAC;AAAEH,QAAAA,eAAAA;AAAiBC,QAAAA;AAAa,KAAA,CAAA;AACvE;;;;"}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var name = "@strapi/core";
6
- var version = "0.0.0-next.26bde6ef6bf3081acd31bd0e9dac0d9357028b9c";
6
+ var version = "0.0.0-next.29273b8e8a9a5aa635e5680190eda01f861431aa";
7
7
  var description = "Core of Strapi";
8
8
  var homepage = "https://strapi.io";
9
9
  var bugs = {
@@ -59,14 +59,15 @@ var dependencies = {
59
59
  "@koa/cors": "5.0.0",
60
60
  "@koa/router": "12.0.2",
61
61
  "@paralleldrive/cuid2": "2.2.2",
62
- "@strapi/admin": "0.0.0-next.26bde6ef6bf3081acd31bd0e9dac0d9357028b9c",
63
- "@strapi/database": "0.0.0-next.26bde6ef6bf3081acd31bd0e9dac0d9357028b9c",
64
- "@strapi/generators": "0.0.0-next.26bde6ef6bf3081acd31bd0e9dac0d9357028b9c",
65
- "@strapi/logger": "0.0.0-next.26bde6ef6bf3081acd31bd0e9dac0d9357028b9c",
66
- "@strapi/permissions": "0.0.0-next.26bde6ef6bf3081acd31bd0e9dac0d9357028b9c",
67
- "@strapi/types": "0.0.0-next.26bde6ef6bf3081acd31bd0e9dac0d9357028b9c",
68
- "@strapi/typescript-utils": "0.0.0-next.26bde6ef6bf3081acd31bd0e9dac0d9357028b9c",
69
- "@strapi/utils": "0.0.0-next.26bde6ef6bf3081acd31bd0e9dac0d9357028b9c",
62
+ "@strapi/admin": "0.0.0-next.29273b8e8a9a5aa635e5680190eda01f861431aa",
63
+ "@strapi/database": "0.0.0-next.29273b8e8a9a5aa635e5680190eda01f861431aa",
64
+ "@strapi/generators": "0.0.0-next.29273b8e8a9a5aa635e5680190eda01f861431aa",
65
+ "@strapi/logger": "0.0.0-next.29273b8e8a9a5aa635e5680190eda01f861431aa",
66
+ "@strapi/permissions": "0.0.0-next.29273b8e8a9a5aa635e5680190eda01f861431aa",
67
+ "@strapi/types": "0.0.0-next.29273b8e8a9a5aa635e5680190eda01f861431aa",
68
+ "@strapi/typescript-utils": "0.0.0-next.29273b8e8a9a5aa635e5680190eda01f861431aa",
69
+ "@strapi/utils": "0.0.0-next.29273b8e8a9a5aa635e5680190eda01f861431aa",
70
+ "@vercel/stega": "0.1.2",
70
71
  bcryptjs: "2.4.3",
71
72
  boxen: "5.1.2",
72
73
  chalk: "4.1.2",
@@ -85,6 +86,8 @@ var dependencies = {
85
86
  "http-errors": "2.0.0",
86
87
  inquirer: "8.2.5",
87
88
  "is-docker": "2.2.1",
89
+ "json-logic-js": "2.0.5",
90
+ jsonwebtoken: "9.0.0",
88
91
  koa: "2.16.1",
89
92
  "koa-body": "6.0.1",
90
93
  "koa-compose": "4.1.0",
@@ -107,11 +110,12 @@ var dependencies = {
107
110
  statuses: "2.0.1",
108
111
  typescript: "5.4.4",
109
112
  undici: "6.21.2",
110
- yup: "0.32.9"
113
+ yup: "0.32.9",
114
+ zod: "3.25.67"
111
115
  };
112
116
  var devDependencies = {
113
117
  "@strapi/ts-zen": "^0.2.0",
114
- "@swc/core": "1.9.3",
118
+ "@swc/core": "1.13.5",
115
119
  "@types/bcryptjs": "2.4.3",
116
120
  "@types/configstore": "5.0.1",
117
121
  "@types/delegates": "1.0.0",
@@ -119,6 +123,7 @@ var devDependencies = {
119
123
  "@types/global-agent": "2.1.3",
120
124
  "@types/http-errors": "2.0.4",
121
125
  "@types/jest": "29.5.2",
126
+ "@types/json-logic-js": "2.0.8",
122
127
  "@types/koa": "2.13.4",
123
128
  "@types/koa-compress": "4.0.3",
124
129
  "@types/koa-session": "6.4.1",
@@ -126,15 +131,15 @@ var devDependencies = {
126
131
  "@types/koa__router": "12.0.0",
127
132
  "@types/lodash": "^4.14.191",
128
133
  "@types/mime-types": "2.1.1",
129
- "@types/node": "18.19.24",
134
+ "@types/node": "24.10.0",
130
135
  "@types/node-schedule": "2.1.7",
131
136
  "@types/statuses": "2.0.1",
132
- "eslint-config-custom": "0.0.0-next.26bde6ef6bf3081acd31bd0e9dac0d9357028b9c",
137
+ "eslint-config-custom": "0.0.0-next.29273b8e8a9a5aa635e5680190eda01f861431aa",
133
138
  supertest: "6.3.3",
134
- tsconfig: "0.0.0-next.26bde6ef6bf3081acd31bd0e9dac0d9357028b9c"
139
+ tsconfig: "0.0.0-next.29273b8e8a9a5aa635e5680190eda01f861431aa"
135
140
  };
136
141
  var engines = {
137
- node: ">=18.0.0 <=22.x.x",
142
+ node: ">=20.0.0 <=24.x.x",
138
143
  npm: ">=6.0.0"
139
144
  };
140
145
  var pkg = {
@@ -1 +1 @@
1
- {"version":3,"file":"package.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"package.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,5 +1,5 @@
1
1
  var name = "@strapi/core";
2
- var version = "0.0.0-next.26bde6ef6bf3081acd31bd0e9dac0d9357028b9c";
2
+ var version = "0.0.0-next.29273b8e8a9a5aa635e5680190eda01f861431aa";
3
3
  var description = "Core of Strapi";
4
4
  var homepage = "https://strapi.io";
5
5
  var bugs = {
@@ -55,14 +55,15 @@ var dependencies = {
55
55
  "@koa/cors": "5.0.0",
56
56
  "@koa/router": "12.0.2",
57
57
  "@paralleldrive/cuid2": "2.2.2",
58
- "@strapi/admin": "0.0.0-next.26bde6ef6bf3081acd31bd0e9dac0d9357028b9c",
59
- "@strapi/database": "0.0.0-next.26bde6ef6bf3081acd31bd0e9dac0d9357028b9c",
60
- "@strapi/generators": "0.0.0-next.26bde6ef6bf3081acd31bd0e9dac0d9357028b9c",
61
- "@strapi/logger": "0.0.0-next.26bde6ef6bf3081acd31bd0e9dac0d9357028b9c",
62
- "@strapi/permissions": "0.0.0-next.26bde6ef6bf3081acd31bd0e9dac0d9357028b9c",
63
- "@strapi/types": "0.0.0-next.26bde6ef6bf3081acd31bd0e9dac0d9357028b9c",
64
- "@strapi/typescript-utils": "0.0.0-next.26bde6ef6bf3081acd31bd0e9dac0d9357028b9c",
65
- "@strapi/utils": "0.0.0-next.26bde6ef6bf3081acd31bd0e9dac0d9357028b9c",
58
+ "@strapi/admin": "0.0.0-next.29273b8e8a9a5aa635e5680190eda01f861431aa",
59
+ "@strapi/database": "0.0.0-next.29273b8e8a9a5aa635e5680190eda01f861431aa",
60
+ "@strapi/generators": "0.0.0-next.29273b8e8a9a5aa635e5680190eda01f861431aa",
61
+ "@strapi/logger": "0.0.0-next.29273b8e8a9a5aa635e5680190eda01f861431aa",
62
+ "@strapi/permissions": "0.0.0-next.29273b8e8a9a5aa635e5680190eda01f861431aa",
63
+ "@strapi/types": "0.0.0-next.29273b8e8a9a5aa635e5680190eda01f861431aa",
64
+ "@strapi/typescript-utils": "0.0.0-next.29273b8e8a9a5aa635e5680190eda01f861431aa",
65
+ "@strapi/utils": "0.0.0-next.29273b8e8a9a5aa635e5680190eda01f861431aa",
66
+ "@vercel/stega": "0.1.2",
66
67
  bcryptjs: "2.4.3",
67
68
  boxen: "5.1.2",
68
69
  chalk: "4.1.2",
@@ -81,6 +82,8 @@ var dependencies = {
81
82
  "http-errors": "2.0.0",
82
83
  inquirer: "8.2.5",
83
84
  "is-docker": "2.2.1",
85
+ "json-logic-js": "2.0.5",
86
+ jsonwebtoken: "9.0.0",
84
87
  koa: "2.16.1",
85
88
  "koa-body": "6.0.1",
86
89
  "koa-compose": "4.1.0",
@@ -103,11 +106,12 @@ var dependencies = {
103
106
  statuses: "2.0.1",
104
107
  typescript: "5.4.4",
105
108
  undici: "6.21.2",
106
- yup: "0.32.9"
109
+ yup: "0.32.9",
110
+ zod: "3.25.67"
107
111
  };
108
112
  var devDependencies = {
109
113
  "@strapi/ts-zen": "^0.2.0",
110
- "@swc/core": "1.9.3",
114
+ "@swc/core": "1.13.5",
111
115
  "@types/bcryptjs": "2.4.3",
112
116
  "@types/configstore": "5.0.1",
113
117
  "@types/delegates": "1.0.0",
@@ -115,6 +119,7 @@ var devDependencies = {
115
119
  "@types/global-agent": "2.1.3",
116
120
  "@types/http-errors": "2.0.4",
117
121
  "@types/jest": "29.5.2",
122
+ "@types/json-logic-js": "2.0.8",
118
123
  "@types/koa": "2.13.4",
119
124
  "@types/koa-compress": "4.0.3",
120
125
  "@types/koa-session": "6.4.1",
@@ -122,15 +127,15 @@ var devDependencies = {
122
127
  "@types/koa__router": "12.0.0",
123
128
  "@types/lodash": "^4.14.191",
124
129
  "@types/mime-types": "2.1.1",
125
- "@types/node": "18.19.24",
130
+ "@types/node": "24.10.0",
126
131
  "@types/node-schedule": "2.1.7",
127
132
  "@types/statuses": "2.0.1",
128
- "eslint-config-custom": "0.0.0-next.26bde6ef6bf3081acd31bd0e9dac0d9357028b9c",
133
+ "eslint-config-custom": "0.0.0-next.29273b8e8a9a5aa635e5680190eda01f861431aa",
129
134
  supertest: "6.3.3",
130
- tsconfig: "0.0.0-next.26bde6ef6bf3081acd31bd0e9dac0d9357028b9c"
135
+ tsconfig: "0.0.0-next.29273b8e8a9a5aa635e5680190eda01f861431aa"
131
136
  };
132
137
  var engines = {
133
- node: ">=18.0.0 <=22.x.x",
138
+ node: ">=20.0.0 <=24.x.x",
134
139
  npm: ">=6.0.0"
135
140
  };
136
141
  var pkg = {
@@ -1 +1 @@
1
- {"version":3,"file":"package.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"package.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,eAAO,MAAM,SAAS,EAAE,QAAQ,EAA8D,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,eAAO,MAAM,SAAS,EAAE,QAAQ,EAQ/B,CAAC"}
@@ -4,6 +4,7 @@ var admin = require('./admin.js');
4
4
  var coreStore = require('./coreStore.js');
5
5
  var cron = require('./cron.js');
6
6
  var registries = require('./registries.js');
7
+ var sessionManager = require('./session-manager.js');
7
8
  var telemetry = require('./telemetry.js');
8
9
  var webhooks = require('./webhooks.js');
9
10
 
@@ -11,6 +12,7 @@ const providers = [
11
12
  registries,
12
13
  admin,
13
14
  coreStore,
15
+ sessionManager,
14
16
  webhooks,
15
17
  telemetry,
16
18
  cron
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/providers/index.ts"],"sourcesContent":["import admin from './admin';\nimport coreStore from './coreStore';\nimport cron from './cron';\nimport registries from './registries';\nimport telemetry from './telemetry';\nimport webhooks from './webhooks';\n\nimport type { Provider } from './provider';\n\nexport const providers: Provider[] = [registries, admin, coreStore, webhooks, telemetry, cron];\n"],"names":["providers","registries","admin","coreStore","webhooks","telemetry","cron"],"mappings":";;;;;;;;;MASaA,SAAwB,GAAA;AAACC,IAAAA,UAAAA;AAAYC,IAAAA,KAAAA;AAAOC,IAAAA,SAAAA;AAAWC,IAAAA,QAAAA;AAAUC,IAAAA,SAAAA;AAAWC,IAAAA;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../src/providers/index.ts"],"sourcesContent":["import admin from './admin';\nimport coreStore from './coreStore';\nimport cron from './cron';\nimport registries from './registries';\nimport sessionManager from './session-manager';\nimport telemetry from './telemetry';\nimport webhooks from './webhooks';\n\nimport type { Provider } from './provider';\n\nexport const providers: Provider[] = [\n registries,\n admin,\n coreStore,\n sessionManager,\n webhooks,\n telemetry,\n cron,\n];\n"],"names":["providers","registries","admin","coreStore","sessionManager","webhooks","telemetry","cron"],"mappings":";;;;;;;;;;MAUaA,SAAwB,GAAA;AACnCC,IAAAA,UAAAA;AACAC,IAAAA,KAAAA;AACAC,IAAAA,SAAAA;AACAC,IAAAA,cAAAA;AACAC,IAAAA,QAAAA;AACAC,IAAAA,SAAAA;AACAC,IAAAA;;;;;"}
@@ -2,6 +2,7 @@ import admin from './admin.mjs';
2
2
  import coreStore from './coreStore.mjs';
3
3
  import cron from './cron.mjs';
4
4
  import registries from './registries.mjs';
5
+ import sessionManager from './session-manager.mjs';
5
6
  import telemetry from './telemetry.mjs';
6
7
  import webhooks from './webhooks.mjs';
7
8
 
@@ -9,6 +10,7 @@ const providers = [
9
10
  registries,
10
11
  admin,
11
12
  coreStore,
13
+ sessionManager,
12
14
  webhooks,
13
15
  telemetry,
14
16
  cron
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/providers/index.ts"],"sourcesContent":["import admin from './admin';\nimport coreStore from './coreStore';\nimport cron from './cron';\nimport registries from './registries';\nimport telemetry from './telemetry';\nimport webhooks from './webhooks';\n\nimport type { Provider } from './provider';\n\nexport const providers: Provider[] = [registries, admin, coreStore, webhooks, telemetry, cron];\n"],"names":["providers","registries","admin","coreStore","webhooks","telemetry","cron"],"mappings":";;;;;;;MASaA,SAAwB,GAAA;AAACC,IAAAA,UAAAA;AAAYC,IAAAA,KAAAA;AAAOC,IAAAA,SAAAA;AAAWC,IAAAA,QAAAA;AAAUC,IAAAA,SAAAA;AAAWC,IAAAA;;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../src/providers/index.ts"],"sourcesContent":["import admin from './admin';\nimport coreStore from './coreStore';\nimport cron from './cron';\nimport registries from './registries';\nimport sessionManager from './session-manager';\nimport telemetry from './telemetry';\nimport webhooks from './webhooks';\n\nimport type { Provider } from './provider';\n\nexport const providers: Provider[] = [\n registries,\n admin,\n coreStore,\n sessionManager,\n webhooks,\n telemetry,\n cron,\n];\n"],"names":["providers","registries","admin","coreStore","sessionManager","webhooks","telemetry","cron"],"mappings":";;;;;;;;MAUaA,SAAwB,GAAA;AACnCC,IAAAA,UAAAA;AACAC,IAAAA,KAAAA;AACAC,IAAAA,SAAAA;AACAC,IAAAA,cAAAA;AACAC,IAAAA,QAAAA;AACAC,IAAAA,SAAAA;AACAC,IAAAA;;;;;"}
@@ -0,0 +1,3 @@
1
+ declare const _default: import("./provider").Provider;
2
+ export default _default;
3
+ //# sourceMappingURL=session-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-manager.d.ts","sourceRoot":"","sources":["../../src/providers/session-manager.ts"],"names":[],"mappings":";AAYA,wBAoBG"}
@@ -0,0 +1,23 @@
1
+ 'use strict';
2
+
3
+ var provider = require('./provider.js');
4
+ var sessionManager$1 = require('../services/session-manager.js');
5
+
6
+ var sessionManager = provider.defineProvider({
7
+ init (strapi) {
8
+ strapi.add('sessionManager', ()=>sessionManager$1.createSessionManager({
9
+ db: strapi.db
10
+ }));
11
+ },
12
+ async register (strapi) {
13
+ // Get JWT secret from admin auth settings (same as admin token service)
14
+ const adminAuth = strapi.config.get('admin.auth', {});
15
+ const jwtSecret = adminAuth.secret;
16
+ if (!jwtSecret) {
17
+ throw new Error('Missing admin.auth.secret configuration. The SessionManager requires a JWT secret');
18
+ }
19
+ }
20
+ });
21
+
22
+ module.exports = sessionManager;
23
+ //# sourceMappingURL=session-manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-manager.js","sources":["../../src/providers/session-manager.ts"],"sourcesContent":["import type { Algorithm } from 'jsonwebtoken';\nimport { defineProvider } from './provider';\nimport { createSessionManager } from '../services/session-manager';\n\ninterface AdminAuthConfig {\n secret?: string;\n options?: {\n algorithm?: Algorithm;\n [key: string]: unknown;\n };\n}\n\nexport default defineProvider({\n init(strapi) {\n strapi.add('sessionManager', () =>\n createSessionManager({\n db: strapi.db,\n })\n );\n },\n\n async register(strapi) {\n // Get JWT secret from admin auth settings (same as admin token service)\n const adminAuth = strapi.config.get<AdminAuthConfig>('admin.auth', {});\n const jwtSecret = adminAuth.secret;\n\n if (!jwtSecret) {\n throw new Error(\n 'Missing admin.auth.secret configuration. The SessionManager requires a JWT secret'\n );\n }\n },\n});\n"],"names":["defineProvider","init","strapi","add","createSessionManager","db","register","adminAuth","config","get","jwtSecret","secret","Error"],"mappings":";;;;;AAYA,qBAAeA,uBAAe,CAAA;AAC5BC,IAAAA,IAAAA,CAAAA,CAAKC,MAAM,EAAA;AACTA,QAAAA,MAAAA,CAAOC,GAAG,CAAC,gBAAkB,EAAA,IAC3BC,qCAAqB,CAAA;AACnBC,gBAAAA,EAAAA,EAAIH,OAAOG;AACb,aAAA,CAAA,CAAA;AAEJ,KAAA;AAEA,IAAA,MAAMC,UAASJ,MAAM,EAAA;;AAEnB,QAAA,MAAMK,YAAYL,MAAOM,CAAAA,MAAM,CAACC,GAAG,CAAkB,cAAc,EAAC,CAAA;QACpE,MAAMC,SAAAA,GAAYH,UAAUI,MAAM;AAElC,QAAA,IAAI,CAACD,SAAW,EAAA;AACd,YAAA,MAAM,IAAIE,KACR,CAAA,mFAAA,CAAA;AAEJ;AACF;AACF,CAAG,CAAA;;;;"}
@@ -0,0 +1,21 @@
1
+ import { defineProvider } from './provider.mjs';
2
+ import { createSessionManager } from '../services/session-manager.mjs';
3
+
4
+ var sessionManager = defineProvider({
5
+ init (strapi) {
6
+ strapi.add('sessionManager', ()=>createSessionManager({
7
+ db: strapi.db
8
+ }));
9
+ },
10
+ async register (strapi) {
11
+ // Get JWT secret from admin auth settings (same as admin token service)
12
+ const adminAuth = strapi.config.get('admin.auth', {});
13
+ const jwtSecret = adminAuth.secret;
14
+ if (!jwtSecret) {
15
+ throw new Error('Missing admin.auth.secret configuration. The SessionManager requires a JWT secret');
16
+ }
17
+ }
18
+ });
19
+
20
+ export { sessionManager as default };
21
+ //# sourceMappingURL=session-manager.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-manager.mjs","sources":["../../src/providers/session-manager.ts"],"sourcesContent":["import type { Algorithm } from 'jsonwebtoken';\nimport { defineProvider } from './provider';\nimport { createSessionManager } from '../services/session-manager';\n\ninterface AdminAuthConfig {\n secret?: string;\n options?: {\n algorithm?: Algorithm;\n [key: string]: unknown;\n };\n}\n\nexport default defineProvider({\n init(strapi) {\n strapi.add('sessionManager', () =>\n createSessionManager({\n db: strapi.db,\n })\n );\n },\n\n async register(strapi) {\n // Get JWT secret from admin auth settings (same as admin token service)\n const adminAuth = strapi.config.get<AdminAuthConfig>('admin.auth', {});\n const jwtSecret = adminAuth.secret;\n\n if (!jwtSecret) {\n throw new Error(\n 'Missing admin.auth.secret configuration. The SessionManager requires a JWT secret'\n );\n }\n },\n});\n"],"names":["defineProvider","init","strapi","add","createSessionManager","db","register","adminAuth","config","get","jwtSecret","secret","Error"],"mappings":";;;AAYA,qBAAeA,cAAe,CAAA;AAC5BC,IAAAA,IAAAA,CAAAA,CAAKC,MAAM,EAAA;AACTA,QAAAA,MAAAA,CAAOC,GAAG,CAAC,gBAAkB,EAAA,IAC3BC,oBAAqB,CAAA;AACnBC,gBAAAA,EAAAA,EAAIH,OAAOG;AACb,aAAA,CAAA,CAAA;AAEJ,KAAA;AAEA,IAAA,MAAMC,UAASJ,MAAM,EAAA;;AAEnB,QAAA,MAAMK,YAAYL,MAAOM,CAAAA,MAAM,CAACC,GAAG,CAAkB,cAAc,EAAC,CAAA;QACpE,MAAMC,SAAAA,GAAYH,UAAUI,MAAM;AAElC,QAAA,IAAI,CAACD,SAAW,EAAA;AACd,YAAA,MAAM,IAAIE,KACR,CAAA,mFAAA,CAAA;AAEJ;AACF;AACF,CAAG,CAAA;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"apis.js","sources":["../../src/registries/apis.ts"],"sourcesContent":["import { has } from 'lodash/fp';\nimport type { Core } from '@strapi/types';\n\nconst apisRegistry = (strapi: Core.Strapi) => {\n const apis: Record<string, unknown> = {};\n\n return {\n get(name: string) {\n return apis[name];\n },\n getAll() {\n return apis;\n },\n add(apiName: string, apiConfig: unknown) {\n if (has(apiName, apis)) {\n throw new Error(`API ${apiName} has already been registered.`);\n }\n\n const api = strapi.get('modules').add(`api::${apiName}`, apiConfig);\n\n apis[apiName] = api;\n\n return apis[apiName];\n },\n };\n};\n\nexport default apisRegistry;\n"],"names":["apisRegistry","strapi","apis","get","name","getAll","add","apiName","apiConfig","has","Error","api"],"mappings":";;;;AAGA,MAAMA,eAAe,CAACC,MAAAA,GAAAA;AACpB,IAAA,MAAMC,OAAgC,EAAC;IAEvC,OAAO;AACLC,QAAAA,GAAAA,CAAAA,CAAIC,IAAY,EAAA;YACd,OAAOF,IAAI,CAACE,IAAK,CAAA;AACnB,SAAA;AACAC,QAAAA,MAAAA,CAAAA,GAAAA;YACE,OAAOH,IAAAA;AACT,SAAA;QACAI,GAAIC,CAAAA,CAAAA,OAAe,EAAEC,SAAkB,EAAA;YACrC,IAAIC,MAAAA,CAAIF,SAASL,IAAO,CAAA,EAAA;AACtB,gBAAA,MAAM,IAAIQ,KAAM,CAAA,CAAC,IAAI,EAAEH,OAAAA,CAAQ,6BAA6B,CAAC,CAAA;AAC/D;AAEA,YAAA,MAAMI,GAAMV,GAAAA,MAAAA,CAAOE,GAAG,CAAC,SAAWG,CAAAA,CAAAA,GAAG,CAAC,CAAC,KAAK,EAAEC,OAAQ,CAAA,CAAC,EAAEC,SAAAA,CAAAA;YAEzDN,IAAI,CAACK,QAAQ,GAAGI,GAAAA;YAEhB,OAAOT,IAAI,CAACK,OAAQ,CAAA;AACtB;AACF,KAAA;AACF;;;;"}
1
+ {"version":3,"file":"apis.js","sources":["../../src/registries/apis.ts"],"sourcesContent":["import { has } from 'lodash/fp';\nimport type { Core } from '@strapi/types';\n\nconst apisRegistry = (strapi: Core.Strapi) => {\n const apis: Record<string, unknown> = {};\n\n return {\n get(name: string) {\n return apis[name];\n },\n getAll() {\n return apis;\n },\n add(apiName: string, apiConfig: unknown) {\n if (has(apiName, apis)) {\n throw new Error(`API ${apiName} has already been registered.`);\n }\n\n const api = strapi.get('modules').add(`api::${apiName}`, apiConfig);\n\n apis[apiName] = api;\n\n return apis[apiName];\n },\n };\n};\n\nexport default apisRegistry;\n"],"names":["apisRegistry","strapi","apis","get","name","getAll","add","apiName","apiConfig","has","Error","api"],"mappings":";;;;AAGA,MAAMA,eAAe,CAACC,MAAAA,GAAAA;AACpB,IAAA,MAAMC,OAAgC,EAAC;IAEvC,OAAO;AACLC,QAAAA,GAAAA,CAAAA,CAAIC,IAAY,EAAA;YACd,OAAOF,IAAI,CAACE,IAAK,CAAA;AACnB,SAAA;AACAC,QAAAA,MAAAA,CAAAA,GAAAA;YACE,OAAOH,IAAAA;AACT,SAAA;QACAI,GAAIC,CAAAA,CAAAA,OAAe,EAAEC,SAAkB,EAAA;YACrC,IAAIC,MAAAA,CAAIF,SAASL,IAAO,CAAA,EAAA;AACtB,gBAAA,MAAM,IAAIQ,KAAM,CAAA,CAAC,IAAI,EAAEH,OAAAA,CAAQ,6BAA6B,CAAC,CAAA;AAC/D;YAEA,MAAMI,GAAAA,GAAMV,MAAOE,CAAAA,GAAG,CAAC,SAAA,CAAA,CAAWG,GAAG,CAAC,CAAC,KAAK,EAAEC,OAAAA,CAAAA,CAAS,EAAEC,SAAAA,CAAAA;YAEzDN,IAAI,CAACK,QAAQ,GAAGI,GAAAA;YAEhB,OAAOT,IAAI,CAACK,OAAQ,CAAA;AACtB;AACF,KAAA;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"apis.mjs","sources":["../../src/registries/apis.ts"],"sourcesContent":["import { has } from 'lodash/fp';\nimport type { Core } from '@strapi/types';\n\nconst apisRegistry = (strapi: Core.Strapi) => {\n const apis: Record<string, unknown> = {};\n\n return {\n get(name: string) {\n return apis[name];\n },\n getAll() {\n return apis;\n },\n add(apiName: string, apiConfig: unknown) {\n if (has(apiName, apis)) {\n throw new Error(`API ${apiName} has already been registered.`);\n }\n\n const api = strapi.get('modules').add(`api::${apiName}`, apiConfig);\n\n apis[apiName] = api;\n\n return apis[apiName];\n },\n };\n};\n\nexport default apisRegistry;\n"],"names":["apisRegistry","strapi","apis","get","name","getAll","add","apiName","apiConfig","has","Error","api"],"mappings":";;AAGA,MAAMA,eAAe,CAACC,MAAAA,GAAAA;AACpB,IAAA,MAAMC,OAAgC,EAAC;IAEvC,OAAO;AACLC,QAAAA,GAAAA,CAAAA,CAAIC,IAAY,EAAA;YACd,OAAOF,IAAI,CAACE,IAAK,CAAA;AACnB,SAAA;AACAC,QAAAA,MAAAA,CAAAA,GAAAA;YACE,OAAOH,IAAAA;AACT,SAAA;QACAI,GAAIC,CAAAA,CAAAA,OAAe,EAAEC,SAAkB,EAAA;YACrC,IAAIC,GAAAA,CAAIF,SAASL,IAAO,CAAA,EAAA;AACtB,gBAAA,MAAM,IAAIQ,KAAM,CAAA,CAAC,IAAI,EAAEH,OAAAA,CAAQ,6BAA6B,CAAC,CAAA;AAC/D;AAEA,YAAA,MAAMI,GAAMV,GAAAA,MAAAA,CAAOE,GAAG,CAAC,SAAWG,CAAAA,CAAAA,GAAG,CAAC,CAAC,KAAK,EAAEC,OAAQ,CAAA,CAAC,EAAEC,SAAAA,CAAAA;YAEzDN,IAAI,CAACK,QAAQ,GAAGI,GAAAA;YAEhB,OAAOT,IAAI,CAACK,OAAQ,CAAA;AACtB;AACF,KAAA;AACF;;;;"}
1
+ {"version":3,"file":"apis.mjs","sources":["../../src/registries/apis.ts"],"sourcesContent":["import { has } from 'lodash/fp';\nimport type { Core } from '@strapi/types';\n\nconst apisRegistry = (strapi: Core.Strapi) => {\n const apis: Record<string, unknown> = {};\n\n return {\n get(name: string) {\n return apis[name];\n },\n getAll() {\n return apis;\n },\n add(apiName: string, apiConfig: unknown) {\n if (has(apiName, apis)) {\n throw new Error(`API ${apiName} has already been registered.`);\n }\n\n const api = strapi.get('modules').add(`api::${apiName}`, apiConfig);\n\n apis[apiName] = api;\n\n return apis[apiName];\n },\n };\n};\n\nexport default apisRegistry;\n"],"names":["apisRegistry","strapi","apis","get","name","getAll","add","apiName","apiConfig","has","Error","api"],"mappings":";;AAGA,MAAMA,eAAe,CAACC,MAAAA,GAAAA;AACpB,IAAA,MAAMC,OAAgC,EAAC;IAEvC,OAAO;AACLC,QAAAA,GAAAA,CAAAA,CAAIC,IAAY,EAAA;YACd,OAAOF,IAAI,CAACE,IAAK,CAAA;AACnB,SAAA;AACAC,QAAAA,MAAAA,CAAAA,GAAAA;YACE,OAAOH,IAAAA;AACT,SAAA;QACAI,GAAIC,CAAAA,CAAAA,OAAe,EAAEC,SAAkB,EAAA;YACrC,IAAIC,GAAAA,CAAIF,SAASL,IAAO,CAAA,EAAA;AACtB,gBAAA,MAAM,IAAIQ,KAAM,CAAA,CAAC,IAAI,EAAEH,OAAAA,CAAQ,6BAA6B,CAAC,CAAA;AAC/D;YAEA,MAAMI,GAAAA,GAAMV,MAAOE,CAAAA,GAAG,CAAC,SAAA,CAAA,CAAWG,GAAG,CAAC,CAAC,KAAK,EAAEC,OAAAA,CAAAA,CAAS,EAAEC,SAAAA,CAAAA;YAEzDN,IAAI,CAACK,QAAQ,GAAGI,GAAAA;YAEhB,OAAOT,IAAI,CAACK,OAAQ,CAAA;AACtB;AACF,KAAA;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"custom-fields.js","sources":["../../src/registries/custom-fields.ts"],"sourcesContent":["import { has, isPlainObject } from 'lodash/fp';\n\nimport type { Core, Modules } from '@strapi/types';\n\nconst ALLOWED_TYPES = [\n 'biginteger',\n 'boolean',\n 'date',\n 'datetime',\n 'decimal',\n 'email',\n 'enumeration',\n 'float',\n 'integer',\n 'json',\n 'password',\n 'richtext',\n 'string',\n 'text',\n 'time',\n 'uid',\n] as const;\n\nconst customFieldsRegistry = (strapi: Core.Strapi) => {\n const customFields: Record<string, unknown> = {};\n\n return {\n getAll() {\n return customFields;\n },\n get(customField: string) {\n const registeredCustomField = customFields[customField];\n if (!registeredCustomField) {\n throw new Error(`Could not find Custom Field: ${customField}`);\n }\n\n return registeredCustomField;\n },\n add(\n customField:\n | Modules.CustomFields.CustomFieldServerOptions\n | Modules.CustomFields.CustomFieldServerOptions[]\n ) {\n const customFieldList = Array.isArray(customField) ? customField : [customField];\n\n for (const cf of customFieldList) {\n if (!has('name', cf) || !has('type', cf)) {\n throw new Error(`Custom fields require a 'name' and 'type' key`);\n }\n\n const { name, plugin, type, inputSize } = cf;\n if (!ALLOWED_TYPES.includes(type)) {\n throw new Error(\n `Custom field type: '${type}' is not a valid Strapi type or it can't be used with a Custom Field`\n );\n }\n\n const isValidObjectKey = /^(?![0-9])[a-zA-Z0-9$_-]+$/g;\n if (!isValidObjectKey.test(name)) {\n throw new Error(`Custom field name: '${name}' is not a valid object key`);\n }\n\n // Validate inputSize when provided\n if (inputSize) {\n if (\n !isPlainObject(inputSize) ||\n !has('default', inputSize) ||\n !has('isResizable', inputSize)\n ) {\n throw new Error(`inputSize should be an object with 'default' and 'isResizable' keys`);\n }\n if (![4, 6, 8, 12].includes(inputSize.default)) {\n throw new Error('Custom fields require a valid default input size');\n }\n if (typeof inputSize.isResizable !== 'boolean') {\n throw new Error('Custom fields should specify if their input is resizable');\n }\n }\n\n // When no plugin is specified, or it isn't found in Strapi, default to global\n const uid =\n plugin && strapi.plugin(plugin) ? `plugin::${plugin}.${name}` : `global::${name}`;\n\n if (has(uid, customFields)) {\n throw new Error(`Custom field: '${uid}' has already been registered`);\n }\n\n customFields[uid] = cf;\n }\n },\n };\n};\n\nexport default customFieldsRegistry;\n"],"names":["ALLOWED_TYPES","customFieldsRegistry","strapi","customFields","getAll","get","customField","registeredCustomField","Error","add","customFieldList","Array","isArray","cf","has","name","plugin","type","inputSize","includes","isValidObjectKey","test","isPlainObject","default","isResizable","uid"],"mappings":";;;;AAIA,MAAMA,aAAgB,GAAA;AACpB,IAAA,YAAA;AACA,IAAA,SAAA;AACA,IAAA,MAAA;AACA,IAAA,UAAA;AACA,IAAA,SAAA;AACA,IAAA,OAAA;AACA,IAAA,aAAA;AACA,IAAA,OAAA;AACA,IAAA,SAAA;AACA,IAAA,MAAA;AACA,IAAA,UAAA;AACA,IAAA,UAAA;AACA,IAAA,QAAA;AACA,IAAA,MAAA;AACA,IAAA,MAAA;AACA,IAAA;AACD,CAAA;AAED,MAAMC,uBAAuB,CAACC,MAAAA,GAAAA;AAC5B,IAAA,MAAMC,eAAwC,EAAC;IA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AAcJ,CAAAA,SAAAA,CAAAA,IACf,CAACJ,MAAAA,CAAI,WAAWI,SAChB,CAAA,IAAA,CAACJ,MAAI,CAAA,aAAA,EAAeI,SACpB,CAAA,EAAA;AACA,wBAAA,MAAM,IAAIV,KAAAA,CAAM,CAAC,mEAAmE,CAAC,CAAA;AACvF;AACA,oBAAA,IAAI,CAAC;AAAC,wBAAA,CAAA;AAAG,wBAAA,CAAA;AAAG,wBAAA,CAAA;AAAG,wBAAA;AAAG,qBAAA,CAACW,QAAQ,CAACD,SAAUK,CAAAA,OAAO,CAAG,EAAA;AAC9C,wBAAA,MAAM,IAAIf,KAAM,CAAA,kDAAA,CAAA;AAClB;AACA,oBAAA,IAAI,OAAOU,SAAAA,CAAUM,WAAW,KAAK,SAAW,EAAA;AAC9C,wBAAA,MAAM,IAAIhB,KAAM,CAAA,0DAAA,CAAA;AAClB;AACF;;AAGA,gBAAA,MAAMiB,MACJT,MAAUd,IAAAA,MAAAA,CAAOc,MAAM,CAACA,MAAAA,CAAAA,GAAU,CAAC,QAAQ,EAAEA,OAAO,CAAC,EAAED,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAEA,KAAK,CAAC;gBAEnF,IAAID,MAAAA,CAAIW,KAAKtB,YAAe,CAAA,EAAA;AAC1B,oBAAA,MAAM,IAAIK,KAAM,CAAA,CAAC,eAAe,EAAEiB,GAAAA,CAAI,6BAA6B,CAAC,CAAA;AACtE;gBAEAtB,YAAY,CAACsB,IAAI,GAAGZ,EAAAA;AACtB;AACF;AACF,KAAA;AACF;;;;"}
1
+ {"version":3,"file":"custom-fields.js","sources":["../../src/registries/custom-fields.ts"],"sourcesContent":["import { has, isPlainObject } from 'lodash/fp';\n\nimport type { Core, Modules } from '@strapi/types';\n\nconst ALLOWED_TYPES = [\n 'biginteger',\n 'boolean',\n 'date',\n 'datetime',\n 'decimal',\n 'email',\n 'enumeration',\n 'float',\n 'integer',\n 'json',\n 'password',\n 'richtext',\n 'string',\n 'text',\n 'time',\n 'uid',\n] as const;\n\nconst customFieldsRegistry = (strapi: Core.Strapi) => {\n const customFields: Record<string, unknown> = {};\n\n return {\n getAll() {\n return customFields;\n },\n get(customField: string) {\n const registeredCustomField = customFields[customField];\n if (!registeredCustomField) {\n throw new Error(`Could not find Custom Field: ${customField}`);\n }\n\n return registeredCustomField;\n },\n add(\n customField:\n | Modules.CustomFields.CustomFieldServerOptions\n | Modules.CustomFields.CustomFieldServerOptions[]\n ) {\n const customFieldList = Array.isArray(customField) ? customField : [customField];\n\n for (const cf of customFieldList) {\n if (!has('name', cf) || !has('type', cf)) {\n throw new Error(`Custom fields require a 'name' and 'type' key`);\n }\n\n const { name, plugin, type, inputSize } = cf;\n if (!ALLOWED_TYPES.includes(type)) {\n throw new Error(\n `Custom field type: '${type}' is not a valid Strapi type or it can't be used with a Custom Field`\n );\n }\n\n const isValidObjectKey = /^(?![0-9])[a-zA-Z0-9$_-]+$/g;\n if (!isValidObjectKey.test(name)) {\n throw new Error(`Custom field name: '${name}' is not a valid object key`);\n }\n\n // Validate inputSize when provided\n if (inputSize) {\n if (\n !isPlainObject(inputSize) ||\n !has('default', inputSize) ||\n !has('isResizable', inputSize)\n ) {\n throw new Error(`inputSize should be an object with 'default' and 'isResizable' keys`);\n }\n if (![4, 6, 8, 12].includes(inputSize.default)) {\n throw new Error('Custom fields require a valid default input size');\n }\n if (typeof inputSize.isResizable !== 'boolean') {\n throw new Error('Custom fields should specify if their input is resizable');\n }\n }\n\n // When no plugin is specified, or it isn't found in Strapi, default to global\n const uid =\n plugin && strapi.plugin(plugin) ? `plugin::${plugin}.${name}` : `global::${name}`;\n\n if (has(uid, customFields)) {\n throw new Error(`Custom field: '${uid}' has already been registered`);\n }\n\n customFields[uid] = cf;\n }\n },\n };\n};\n\nexport default customFieldsRegistry;\n"],"names":["ALLOWED_TYPES","customFieldsRegistry","strapi","customFields","getAll","get","customField","registeredCustomField","Error","add","customFieldList","Array","isArray","cf","has","name","plugin","type","inputSize","includes","isValidObjectKey","test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AAIK,KAAM,CAAA,CAAC,eAAe,EAAEiB,GAAAA,CAAI,6BAA6B,CAAC,CAAA;AACtE;gBAEAtB,YAAY,CAACsB,IAAI,GAAGZ,EAAAA;AACtB;AACF;AACF,KAAA;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"custom-fields.mjs","sources":["../../src/registries/custom-fields.ts"],"sourcesContent":["import { has, isPlainObject } from 'lodash/fp';\n\nimport type { Core, Modules } from '@strapi/types';\n\nconst ALLOWED_TYPES = [\n 'biginteger',\n 'boolean',\n 'date',\n 'datetime',\n 'decimal',\n 'email',\n 'enumeration',\n 'float',\n 'integer',\n 'json',\n 'password',\n 'richtext',\n 'string',\n 'text',\n 'time',\n 'uid',\n] as const;\n\nconst customFieldsRegistry = (strapi: Core.Strapi) => {\n const customFields: Record<string, unknown> = {};\n\n return {\n getAll() {\n return customFields;\n },\n get(customField: string) {\n const registeredCustomField = customFields[customField];\n if (!registeredCustomField) {\n throw new Error(`Could not find Custom Field: ${customField}`);\n }\n\n return registeredCustomField;\n },\n add(\n customField:\n | Modules.CustomFields.CustomFieldServerOptions\n | Modules.CustomFields.CustomFieldServerOptions[]\n ) {\n const customFieldList = Array.isArray(customField) ? customField : [customField];\n\n for (const cf of customFieldList) {\n if (!has('name', cf) || !has('type', cf)) {\n throw new Error(`Custom fields require a 'name' and 'type' key`);\n }\n\n const { name, plugin, type, inputSize } = cf;\n if (!ALLOWED_TYPES.includes(type)) {\n throw new Error(\n `Custom field type: '${type}' is not a valid Strapi type or it can't be used with a Custom Field`\n );\n }\n\n const isValidObjectKey = /^(?![0-9])[a-zA-Z0-9$_-]+$/g;\n if (!isValidObjectKey.test(name)) {\n throw new Error(`Custom field name: '${name}' is not a valid object key`);\n }\n\n // Validate inputSize when provided\n if (inputSize) {\n if (\n !isPlainObject(inputSize) ||\n !has('default', inputSize) ||\n !has('isResizable', inputSize)\n ) {\n throw new Error(`inputSize should be an object with 'default' and 'isResizable' keys`);\n }\n if (![4, 6, 8, 12].includes(inputSize.default)) {\n throw new Error('Custom fields require a valid default input size');\n }\n if (typeof inputSize.isResizable !== 'boolean') {\n throw new Error('Custom fields should specify if their input is resizable');\n }\n }\n\n // When no plugin is specified, or it isn't found in Strapi, default to global\n const uid =\n plugin && strapi.plugin(plugin) ? `plugin::${plugin}.${name}` : `global::${name}`;\n\n if (has(uid, customFields)) {\n throw new Error(`Custom field: '${uid}' has already been registered`);\n }\n\n customFields[uid] = cf;\n }\n },\n };\n};\n\nexport default customFieldsRegistry;\n"],"names":["ALLOWED_TYPES","customFieldsRegistry","strapi","customFields","getAll","get","customField","registeredCustomField","Error","add","customFieldList","Array","isArray","cf","has","name","plugin","type","inputSize","includes","isValidObjectKey","test","isPlainObject","default","isResizable","uid"],"mappings":";;AAIA,MAAMA,aAAgB,GAAA;AACpB,IAAA,YAAA;AACA,IAAA,SAAA;AACA,IAAA,MAAA;AACA,IAAA,UAAA;AACA,IAAA,SAAA;AACA,IAAA,OAAA;AACA,IAAA,aAAA;AACA,IAAA,OAAA;AACA,IAAA,SAAA;AACA,IAAA,MAAA;AACA,IAAA,UAAA;AACA,IAAA,UAAA;AACA,IAAA,QAAA;AACA,IAAA,MAAA;AACA,IAAA,MAAA;AACA,IAAA;AACD,CAAA;AAED,MAAMC,uBAAuB,CAACC,MAAAA,GAAAA;AAC5B,IAAA,MAAMC,eAAwC,EAAC;IAE/C,OAAO;AACLC,QAAAA,MAAAA,CAAAA,GAAAA;YACE,OAAOD,YAAAA;AACT,SAAA;AACAE,QAAAA,GAAAA,CAAAA,CAAIC,WAAmB,EAAA;YACrB,MAAMC,qBAAAA,GAAwBJ,YAAY,CAACG,WAAY,CAAA;AACvD,YAAA,IAAI,CAACC,qBAAuB,EAAA;AAC1B,gBAAA,MAAM,IAAIC,KAAM,CAAA,CAAC,6BAA6B,EAAEF,YAAY,CAAC,CAAA;AAC/D;YAEA,OAAOC,qBAAAA;AACT,SAAA;AACAE,QAAAA,GAAAA,CAAAA,CACEH,WAEmD,E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,IAAIf,KAAM,CAAA,kDAAA,CAAA;AAClB;AACA,oBAAA,IAAI,OAAOU,SAAAA,CAAUM,WAAW,KAAK,SAAW,EAAA;AAC9C,wBAAA,MAAM,IAAIhB,KAAM,CAAA,0DAAA,CAAA;AAClB;AACF;;AAGA,gBAAA,MAAMiB,MACJT,MAAUd,IAAAA,MAAAA,CAAOc,MAAM,CAACA,MAAAA,CAAAA,GAAU,CAAC,QAAQ,EAAEA,OAAO,CAAC,EAAED,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAEA,KAAK,CAAC;gBAEnF,IAAID,GAAAA,CAAIW,KAAKtB,YAAe,CAAA,EAAA;AAC1B,oBAAA,MAAM,IAAIK,KAAM,CAAA,CAAC,eAAe,EAAEiB,GAAAA,CAAI,6BAA6B,CAAC,CAAA;AACtE;gBAEAtB,YAAY,CAACsB,IAAI,GAAGZ,EAAAA;AACtB;AACF;AACF,KAAA;AACF;;;;"}
1
+ {"version":3,"file":"custom-fields.mjs","sources":["../../src/registries/custom-fields.ts"],"sourcesContent":["import { has, isPlainObject } from 'lodash/fp';\n\nimport type { Core, Modules } from '@strapi/types';\n\nconst ALLOWED_TYPES = [\n 'biginteger',\n 'boolean',\n 'date',\n 'datetime',\n 'decimal',\n 'email',\n 'enumeration',\n 'float',\n 'integer',\n 'json',\n 'password',\n 'richtext',\n 'string',\n 'text',\n 'time',\n 'uid',\n] as const;\n\nconst customFieldsRegistry = (strapi: Core.Strapi) => {\n const customFields: Record<string, unknown> = {};\n\n return {\n getAll() {\n return customFields;\n },\n get(customField: string) {\n const registeredCustomField = customFields[customField];\n if (!registeredCustomField) {\n throw new Error(`Could not find Custom Field: ${customField}`);\n }\n\n return registeredCustomField;\n },\n add(\n customField:\n | Modules.CustomFields.CustomFieldServerOptions\n | Modules.CustomFields.CustomFieldServerOptions[]\n ) {\n const customFieldList = Array.isArray(customField) ? customField : [customField];\n\n for (const cf of customFieldList) {\n if (!has('name', cf) || !has('type', cf)) {\n throw new Error(`Custom fields require a 'name' and 'type' key`);\n }\n\n const { name, plugin, type, inputSize } = cf;\n if (!ALLOWED_TYPES.includes(type)) {\n throw new Error(\n `Custom field type: '${type}' is not a valid Strapi type or it can't be used with a Custom Field`\n );\n }\n\n const isValidObjectKey = /^(?![0-9])[a-zA-Z0-9$_-]+$/g;\n if (!isValidObjectKey.test(name)) {\n throw new Error(`Custom field name: '${name}' is not a valid object key`);\n }\n\n // Validate inputSize when provided\n if (inputSize) {\n if (\n !isPlainObject(inputSize) ||\n !has('default', inputSize) ||\n !has('isResizable', inputSize)\n ) {\n throw new Error(`inputSize should be an object with 'default' and 'isResizable' keys`);\n }\n if (![4, 6, 8, 12].includes(inputSize.default)) {\n throw new Error('Custom fields require a valid default input size');\n }\n if (typeof inputSize.isResizable !== 'boolean') {\n throw new Error('Custom fields should specify if their input is resizable');\n }\n }\n\n // When no plugin is specified, or it isn't found in Strapi, default to global\n const uid =\n plugin && strapi.plugin(plugin) ? `plugin::${plugin}.${name}` : `global::${name}`;\n\n if (has(uid, customFields)) {\n throw new Error(`Custom field: '${uid}' has already been registered`);\n }\n\n customFields[uid] = cf;\n }\n },\n };\n};\n\nexport default customFieldsRegistry;\n"],"names":["ALLOWED_TYPES","customFieldsRegistry","strapi","customFields","getAll","get","customField","registeredCustomField","Error","add","customFieldList","Array","isArray","cf","has","name","plugin","type","inputSize","includes","isValidObjectKey","test","isPlainObject","default","isResizable","uid"],"mappings":";;AAIA,MAAMA,aAAgB,GAAA;AACpB,IAAA,YAAA;AACA,IAAA,SAAA;AACA,IAAA,MAAA;AACA,IAAA,UAAA;AACA,IAAA,SAAA;AACA,IAAA,OAAA;AACA,IAAA,aAAA;AACA,IAAA,OAAA;AACA,IAAA,SAAA;AACA,IAAA,MAAA;AACA,IAAA,UAAA;AACA,IAAA,UAAA;AACA,IAAA,QAAA;AACA,IAAA,MAAA;AACA,IAAA,MAAA;AACA,IAAA;AACD,CAAA;AAED,MAAMC,uBAAuB,CAACC,MAAAA,GAAAA;AAC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,IAAIG,SAAW,EAAA;oBACb,IACE,CAACI,aAAcJ,CAAAA,SAAAA,CAAAA,IACf,CAACJ,GAAAA,CAAI,WAAWI,SAChB,CAAA,IAAA,CAACJ,GAAI,CAAA,aAAA,EAAeI,SACpB,CAAA,EAAA;AACA,wBAAA,MAAM,IAAIV,KAAAA,CAAM,CAAC,mEAAmE,CAAC,CAAA;AACvF;AACA,oBAAA,IAAI,CAAC;AAAC,wBAAA,CAAA;AAAG,wBAAA,CAAA;AAAG,wBAAA,CAAA;AAAG,wBAAA;AAAG,qBAAA,CAACW,QAAQ,CAACD,SAAUK,CAAAA,OAAO,CAAG,EAAA;AAC9C,wBAAA,MAAM,IAAIf,KAAM,CAAA,kDAAA,CAAA;AAClB;AACA,oBAAA,IAAI,OAAOU,SAAAA,CAAUM,WAAW,KAAK,SAAW,EAAA;AAC9C,wBAAA,MAAM,IAAIhB,KAAM,CAAA,0DAAA,CAAA;AAClB;AACF;;AAGA,gBAAA,MAAMiB,MACJT,MAAUd,IAAAA,MAAAA,CAAOc,MAAM,CAACA,UAAU,CAAC,QAAQ,EAAEA,MAAAA,CAAO,CAAC,EAAED,IAAAA,CAAAA,CAAM,GAAG,CAAC,QAAQ,EAAEA,IAAM,CAAA,CAAA;gBAEnF,IAAID,GAAAA,CAAIW,KAAKtB,YAAe,CAAA,EAAA;AAC1B,oBAAA,MAAM,IAAIK,KAAM,CAAA,CAAC,eAAe,EAAEiB,GAAAA,CAAI,6BAA6B,CAAC,CAAA;AACtE;gBAEAtB,YAAY,CAACsB,IAAI,GAAGZ,EAAAA;AACtB;AACF;AACF,KAAA;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"namespace.js","sources":["../../src/registries/namespace.ts"],"sourcesContent":["const hasNamespace = (name: string, namespace: string) => {\n if (!namespace) {\n return true;\n }\n\n if (namespace.endsWith('::')) {\n return name.startsWith(namespace);\n }\n return name.startsWith(`${namespace}.`);\n};\n\nconst addNamespace = (name: string, namespace: string) => {\n if (namespace.endsWith('::')) {\n return `${namespace}${name}`;\n }\n return `${namespace}.${name}`;\n};\n\nconst removeNamespace = (name: string, namespace: string) => {\n if (namespace.endsWith('::')) {\n return name.replace(namespace, '');\n }\n return name.replace(`${namespace}.`, '');\n};\n\nexport { addNamespace, removeNamespace, hasNamespace };\n"],"names":["hasNamespace","name","namespace","endsWith","startsWith","addNamespace","removeNamespace","replace"],"mappings":";;AAAMA,MAAAA,YAAAA,GAAe,CAACC,IAAcC,EAAAA,SAAAA,GAAAA;AAClC,IAAA,IAAI,CAACA,SAAW,EAAA;QACd,OAAO,IAAA;AACT;IAEA,IAAIA,SAAAA,CAAUC,QAAQ,CAAC,IAAO,CAAA,EAAA;QAC5B,OAAOF,IAAAA,CAAKG,UAAU,CAACF,SAAAA,CAAAA;AACzB;AACA,IAAA,OAAOD,KAAKG,UAAU,CAAC,CAAC,EAAEF,SAAAA,CAAU,CAAC,CAAC,CAAA;AACxC;AAEMG,MAAAA,YAAAA,GAAe,CAACJ,IAAcC,EAAAA,SAAAA,GAAAA;IAClC,IAAIA,SAAAA,CAAUC,QAAQ,CAAC,IAAO,CAAA,EAAA;AAC5B,QAAA,OAAO,CAAC,EAAED,SAAU,CAAA,EAAED,KAAK,CAAC;AAC9B;AACA,IAAA,OAAO,CAAC,EAAEC,SAAAA,CAAU,CAAC,EAAED,KAAK,CAAC;AAC/B;AAEMK,MAAAA,eAAAA,GAAkB,CAACL,IAAcC,EAAAA,SAAAA,GAAAA;IACrC,IAAIA,SAAAA,CAAUC,QAAQ,CAAC,IAAO,CAAA,EAAA;QAC5B,OAAOF,IAAAA,CAAKM,OAAO,CAACL,SAAW,EAAA,EAAA,CAAA;AACjC;IACA,OAAOD,IAAAA,CAAKM,OAAO,CAAC,CAAC,EAAEL,SAAU,CAAA,CAAC,CAAC,EAAE,EAAA,CAAA;AACvC;;;;;;"}
1
+ {"version":3,"file":"namespace.js","sources":["../../src/registries/namespace.ts"],"sourcesContent":["const hasNamespace = (name: string, namespace: string) => {\n if (!namespace) {\n return true;\n }\n\n if (namespace.endsWith('::')) {\n return name.startsWith(namespace);\n }\n return name.startsWith(`${namespace}.`);\n};\n\nconst addNamespace = (name: string, namespace: string) => {\n if (namespace.endsWith('::')) {\n return `${namespace}${name}`;\n }\n return `${namespace}.${name}`;\n};\n\nconst removeNamespace = (name: string, namespace: string) => {\n if (namespace.endsWith('::')) {\n return name.replace(namespace, '');\n }\n return name.replace(`${namespace}.`, '');\n};\n\nexport { addNamespace, removeNamespace, hasNamespace };\n"],"names":["hasNamespace","name","namespace","endsWith","startsWith","addNamespace","removeNamespace","replace"],"mappings":";;AAAMA,MAAAA,YAAAA,GAAe,CAACC,IAAcC,EAAAA,SAAAA,GAAAA;AAClC,IAAA,IAAI,CAACA,SAAW,EAAA;QACd,OAAO,IAAA;AACT;IAEA,IAAIA,SAAAA,CAAUC,QAAQ,CAAC,IAAO,CAAA,EAAA;QAC5B,OAAOF,IAAAA,CAAKG,UAAU,CAACF,SAAAA,CAAAA;AACzB;AACA,IAAA,OAAOD,KAAKG,UAAU,CAAC,CAAGF,EAAAA,SAAAA,CAAU,CAAC,CAAC,CAAA;AACxC;AAEMG,MAAAA,YAAAA,GAAe,CAACJ,IAAcC,EAAAA,SAAAA,GAAAA;IAClC,IAAIA,SAAAA,CAAUC,QAAQ,CAAC,IAAO,CAAA,EAAA;QAC5B,OAAO,CAAA,EAAGD,YAAYD,IAAM,CAAA,CAAA;AAC9B;AACA,IAAA,OAAO,CAAGC,EAAAA,SAAAA,CAAU,CAAC,EAAED,IAAM,CAAA,CAAA;AAC/B;AAEMK,MAAAA,eAAAA,GAAkB,CAACL,IAAcC,EAAAA,SAAAA,GAAAA;IACrC,IAAIA,SAAAA,CAAUC,QAAQ,CAAC,IAAO,CAAA,EAAA;QAC5B,OAAOF,IAAAA,CAAKM,OAAO,CAACL,SAAW,EAAA,EAAA,CAAA;AACjC;AACA,IAAA,OAAOD,KAAKM,OAAO,CAAC,GAAGL,SAAU,CAAA,CAAC,CAAC,EAAE,EAAA,CAAA;AACvC;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"namespace.mjs","sources":["../../src/registries/namespace.ts"],"sourcesContent":["const hasNamespace = (name: string, namespace: string) => {\n if (!namespace) {\n return true;\n }\n\n if (namespace.endsWith('::')) {\n return name.startsWith(namespace);\n }\n return name.startsWith(`${namespace}.`);\n};\n\nconst addNamespace = (name: string, namespace: string) => {\n if (namespace.endsWith('::')) {\n return `${namespace}${name}`;\n }\n return `${namespace}.${name}`;\n};\n\nconst removeNamespace = (name: string, namespace: string) => {\n if (namespace.endsWith('::')) {\n return name.replace(namespace, '');\n }\n return name.replace(`${namespace}.`, '');\n};\n\nexport { addNamespace, removeNamespace, hasNamespace };\n"],"names":["hasNamespace","name","namespace","endsWith","startsWith","addNamespace","removeNamespace","replace"],"mappings":"AAAMA,MAAAA,YAAAA,GAAe,CAACC,IAAcC,EAAAA,SAAAA,GAAAA;AAClC,IAAA,IAAI,CAACA,SAAW,EAAA;QACd,OAAO,IAAA;AACT;IAEA,IAAIA,SAAAA,CAAUC,QAAQ,CAAC,IAAO,CAAA,EAAA;QAC5B,OAAOF,IAAAA,CAAKG,UAAU,CAACF,SAAAA,CAAAA;AACzB;AACA,IAAA,OAAOD,KAAKG,UAAU,CAAC,CAAC,EAAEF,SAAAA,CAAU,CAAC,CAAC,CAAA;AACxC;AAEMG,MAAAA,YAAAA,GAAe,CAACJ,IAAcC,EAAAA,SAAAA,GAAAA;IAClC,IAAIA,SAAAA,CAAUC,QAAQ,CAAC,IAAO,CAAA,EAAA;AAC5B,QAAA,OAAO,CAAC,EAAED,SAAU,CAAA,EAAED,KAAK,CAAC;AAC9B;AACA,IAAA,OAAO,CAAC,EAAEC,SAAAA,CAAU,CAAC,EAAED,KAAK,CAAC;AAC/B;AAEMK,MAAAA,eAAAA,GAAkB,CAACL,IAAcC,EAAAA,SAAAA,GAAAA;IACrC,IAAIA,SAAAA,CAAUC,QAAQ,CAAC,IAAO,CAAA,EAAA;QAC5B,OAAOF,IAAAA,CAAKM,OAAO,CAACL,SAAW,EAAA,EAAA,CAAA;AACjC;IACA,OAAOD,IAAAA,CAAKM,OAAO,CAAC,CAAC,EAAEL,SAAU,CAAA,CAAC,CAAC,EAAE,EAAA,CAAA;AACvC;;;;"}
1
+ {"version":3,"file":"namespace.mjs","sources":["../../src/registries/namespace.ts"],"sourcesContent":["const hasNamespace = (name: string, namespace: string) => {\n if (!namespace) {\n return true;\n }\n\n if (namespace.endsWith('::')) {\n return name.startsWith(namespace);\n }\n return name.startsWith(`${namespace}.`);\n};\n\nconst addNamespace = (name: string, namespace: string) => {\n if (namespace.endsWith('::')) {\n return `${namespace}${name}`;\n }\n return `${namespace}.${name}`;\n};\n\nconst removeNamespace = (name: string, namespace: string) => {\n if (namespace.endsWith('::')) {\n return name.replace(namespace, '');\n }\n return name.replace(`${namespace}.`, '');\n};\n\nexport { addNamespace, removeNamespace, hasNamespace };\n"],"names":["hasNamespace","name","namespace","endsWith","startsWith","addNamespace","removeNamespace","replace"],"mappings":"AAAMA,MAAAA,YAAAA,GAAe,CAACC,IAAcC,EAAAA,SAAAA,GAAAA;AAClC,IAAA,IAAI,CAACA,SAAW,EAAA;QACd,OAAO,IAAA;AACT;IAEA,IAAIA,SAAAA,CAAUC,QAAQ,CAAC,IAAO,CAAA,EAAA;QAC5B,OAAOF,IAAAA,CAAKG,UAAU,CAACF,SAAAA,CAAAA;AACzB;AACA,IAAA,OAAOD,KAAKG,UAAU,CAAC,CAAGF,EAAAA,SAAAA,CAAU,CAAC,CAAC,CAAA;AACxC;AAEMG,MAAAA,YAAAA,GAAe,CAACJ,IAAcC,EAAAA,SAAAA,GAAAA;IAClC,IAAIA,SAAAA,CAAUC,QAAQ,CAAC,IAAO,CAAA,EAAA;QAC5B,OAAO,CAAA,EAAGD,YAAYD,IAAM,CAAA,CAAA;AAC9B;AACA,IAAA,OAAO,CAAGC,EAAAA,SAAAA,CAAU,CAAC,EAAED,IAAM,CAAA,CAAA;AAC/B;AAEMK,MAAAA,eAAAA,GAAkB,CAACL,IAAcC,EAAAA,SAAAA,GAAAA;IACrC,IAAIA,SAAAA,CAAUC,QAAQ,CAAC,IAAO,CAAA,EAAA;QAC5B,OAAOF,IAAAA,CAAKM,OAAO,CAACL,SAAW,EAAA,EAAA,CAAA;AACjC;AACA,IAAA,OAAOD,KAAKM,OAAO,CAAC,GAAGL,SAAU,CAAA,CAAC,CAAC,EAAE,EAAA,CAAA;AACvC;;;;"}