@paroicms/server 0.146.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 (659) hide show
  1. package/README.md +3 -0
  2. package/ddl/main.ddl.sql +84 -0
  3. package/dist/backup/site/archiver.helper.d.ts +12 -0
  4. package/dist/backup/site/archiver.helper.js +46 -0
  5. package/dist/backup/site/archiver.helper.js.map +1 -0
  6. package/dist/backup/site/backup.d.ts +5 -0
  7. package/dist/backup/site/backup.js +118 -0
  8. package/dist/backup/site/backup.js.map +1 -0
  9. package/dist/cli.d.ts +2 -0
  10. package/dist/cli.js +5 -0
  11. package/dist/cli.js.map +1 -0
  12. package/dist/common/child-ordering-query.d.ts +13 -0
  13. package/dist/common/child-ordering-query.js +107 -0
  14. package/dist/common/child-ordering-query.js.map +1 -0
  15. package/dist/common/data-format.d.ts +19 -0
  16. package/dist/common/data-format.js +86 -0
  17. package/dist/common/data-format.js.map +1 -0
  18. package/dist/common/mail/html-helpers.d.ts +7 -0
  19. package/dist/common/mail/html-helpers.js +46 -0
  20. package/dist/common/mail/html-helpers.js.map +1 -0
  21. package/dist/common/mail/sendMail.helpers.d.ts +14 -0
  22. package/dist/common/mail/sendMail.helpers.js +51 -0
  23. package/dist/common/mail/sendMail.helpers.js.map +1 -0
  24. package/dist/common/media-handles.helpers.d.ts +19 -0
  25. package/dist/common/media-handles.helpers.js +52 -0
  26. package/dist/common/media-handles.helpers.js.map +1 -0
  27. package/dist/common/serve-html-or.d.ts +16 -0
  28. package/dist/common/serve-html-or.js +72 -0
  29. package/dist/common/serve-html-or.js.map +1 -0
  30. package/dist/common/text-cache.d.ts +57 -0
  31. package/dist/common/text-cache.js +87 -0
  32. package/dist/common/text-cache.js.map +1 -0
  33. package/dist/common/tracker-report.d.ts +2 -0
  34. package/dist/common/tracker-report.js +27 -0
  35. package/dist/common/tracker-report.js.map +1 -0
  36. package/dist/context.d.ts +29 -0
  37. package/dist/context.js +60 -0
  38. package/dist/context.js.map +1 -0
  39. package/dist/express/http-helpers.d.ts +16 -0
  40. package/dist/express/http-helpers.js +44 -0
  41. package/dist/express/http-helpers.js.map +1 -0
  42. package/dist/express/static-middlewares.d.ts +3 -0
  43. package/dist/express/static-middlewares.js +114 -0
  44. package/dist/express/static-middlewares.js.map +1 -0
  45. package/dist/helpers/configuration.helpers.d.ts +2 -0
  46. package/dist/helpers/configuration.helpers.js +8 -0
  47. package/dist/helpers/configuration.helpers.js.map +1 -0
  48. package/dist/helpers/excerpt.helpers.d.ts +2 -0
  49. package/dist/helpers/excerpt.helpers.js +31 -0
  50. package/dist/helpers/excerpt.helpers.js.map +1 -0
  51. package/dist/helpers/excerpt.helpers.spec.d.ts +1 -0
  52. package/dist/helpers/excerpt.helpers.spec.js +133 -0
  53. package/dist/helpers/excerpt.helpers.spec.js.map +1 -0
  54. package/dist/helpers/jwt-secret.helpers.d.ts +2 -0
  55. package/dist/helpers/jwt-secret.helpers.js +30 -0
  56. package/dist/helpers/jwt-secret.helpers.js.map +1 -0
  57. package/dist/helpers/label-translator.helper.d.ts +9 -0
  58. package/dist/helpers/label-translator.helper.js +14 -0
  59. package/dist/helpers/label-translator.helper.js.map +1 -0
  60. package/dist/helpers/passwordEncrypt-helper.d.ts +2 -0
  61. package/dist/helpers/passwordEncrypt-helper.js +37 -0
  62. package/dist/helpers/passwordEncrypt-helper.js.map +1 -0
  63. package/dist/helpers/relative-id-helper.d.ts +10 -0
  64. package/dist/helpers/relative-id-helper.js +37 -0
  65. package/dist/helpers/relative-id-helper.js.map +1 -0
  66. package/dist/helpers/search-text-helper.d.ts +7 -0
  67. package/dist/helpers/search-text-helper.js +27 -0
  68. package/dist/helpers/search-text-helper.js.map +1 -0
  69. package/dist/helpers/simple-i18n.d.ts +14 -0
  70. package/dist/helpers/simple-i18n.js +82 -0
  71. package/dist/helpers/simple-i18n.js.map +1 -0
  72. package/dist/helpers/special-account.helpers.d.ts +9 -0
  73. package/dist/helpers/special-account.helpers.js +43 -0
  74. package/dist/helpers/special-account.helpers.js.map +1 -0
  75. package/dist/helpers/url.helpers.d.ts +2 -0
  76. package/dist/helpers/url.helpers.js +12 -0
  77. package/dist/helpers/url.helpers.js.map +1 -0
  78. package/dist/helpers/utils-helper.d.ts +4 -0
  79. package/dist/helpers/utils-helper.js +32 -0
  80. package/dist/helpers/utils-helper.js.map +1 -0
  81. package/dist/index.d.ts +7 -0
  82. package/dist/index.js +67 -0
  83. package/dist/index.js.map +1 -0
  84. package/dist/maintenance/maintenance-task.d.ts +4 -0
  85. package/dist/maintenance/maintenance-task.js +27 -0
  86. package/dist/maintenance/maintenance-task.js.map +1 -0
  87. package/dist/maintenance/shutdown.d.ts +7 -0
  88. package/dist/maintenance/shutdown.js +51 -0
  89. package/dist/maintenance/shutdown.js.map +1 -0
  90. package/dist/modules/app.controller.d.ts +5 -0
  91. package/dist/modules/app.controller.js +89 -0
  92. package/dist/modules/app.controller.js.map +1 -0
  93. package/dist/modules/app.module.d.ts +2 -0
  94. package/dist/modules/app.module.js +48 -0
  95. package/dist/modules/app.module.js.map +1 -0
  96. package/dist/modules/core/account/account.model.d.ts +18 -0
  97. package/dist/modules/core/account/account.model.js +59 -0
  98. package/dist/modules/core/account/account.model.js.map +1 -0
  99. package/dist/modules/core/account/account.module.d.ts +2 -0
  100. package/dist/modules/core/account/account.module.js +20 -0
  101. package/dist/modules/core/account/account.module.js.map +1 -0
  102. package/dist/modules/core/account/account.queries.d.ts +18 -0
  103. package/dist/modules/core/account/account.queries.js +150 -0
  104. package/dist/modules/core/account/account.queries.js.map +1 -0
  105. package/dist/modules/core/account/account.resolver.d.ts +11 -0
  106. package/dist/modules/core/account/account.resolver.js +107 -0
  107. package/dist/modules/core/account/account.resolver.js.map +1 -0
  108. package/dist/modules/core/account/account.schema.d.ts +24 -0
  109. package/dist/modules/core/account/account.schema.js +114 -0
  110. package/dist/modules/core/account/account.schema.js.map +1 -0
  111. package/dist/modules/core/account-auth/account-auth.controller.d.ts +5 -0
  112. package/dist/modules/core/account-auth/account-auth.controller.js +46 -0
  113. package/dist/modules/core/account-auth/account-auth.controller.js.map +1 -0
  114. package/dist/modules/core/account-auth/account-auth.module.d.ts +2 -0
  115. package/dist/modules/core/account-auth/account-auth.module.js +24 -0
  116. package/dist/modules/core/account-auth/account-auth.module.js.map +1 -0
  117. package/dist/modules/core/account-auth/account-auth.service.d.ts +5 -0
  118. package/dist/modules/core/account-auth/account-auth.service.js +41 -0
  119. package/dist/modules/core/account-auth/account-auth.service.js.map +1 -0
  120. package/dist/modules/core/account-auth/account-auth.strategy.d.ts +10 -0
  121. package/dist/modules/core/account-auth/account-auth.strategy.js +49 -0
  122. package/dist/modules/core/account-auth/account-auth.strategy.js.map +1 -0
  123. package/dist/modules/core/auth/auth.module.d.ts +2 -0
  124. package/dist/modules/core/auth/auth.module.js +35 -0
  125. package/dist/modules/core/auth/auth.module.js.map +1 -0
  126. package/dist/modules/core/auth/auth.service.d.ts +11 -0
  127. package/dist/modules/core/auth/auth.service.js +164 -0
  128. package/dist/modules/core/auth/auth.service.js.map +1 -0
  129. package/dist/modules/core/auth/auth.types.d.ts +27 -0
  130. package/dist/modules/core/auth/auth.types.js +3 -0
  131. package/dist/modules/core/auth/auth.types.js.map +1 -0
  132. package/dist/modules/core/auth/jwt.auth.guard.d.ts +6 -0
  133. package/dist/modules/core/auth/jwt.auth.guard.js +23 -0
  134. package/dist/modules/core/auth/jwt.auth.guard.js.map +1 -0
  135. package/dist/modules/core/auth/jwt.strategy.d.ts +10 -0
  136. package/dist/modules/core/auth/jwt.strategy.js +35 -0
  137. package/dist/modules/core/auth/jwt.strategy.js.map +1 -0
  138. package/dist/modules/core/backup/backup.controller.d.ts +7 -0
  139. package/dist/modules/core/backup/backup.controller.js +61 -0
  140. package/dist/modules/core/backup/backup.controller.js.map +1 -0
  141. package/dist/modules/core/backup/backup.module.d.ts +2 -0
  142. package/dist/modules/core/backup/backup.module.js +22 -0
  143. package/dist/modules/core/backup/backup.module.js.map +1 -0
  144. package/dist/modules/core/backup/backup.resolver.d.ts +8 -0
  145. package/dist/modules/core/backup/backup.resolver.js +54 -0
  146. package/dist/modules/core/backup/backup.resolver.js.map +1 -0
  147. package/dist/modules/core/backup/backup.shema.d.ts +4 -0
  148. package/dist/modules/core/backup/backup.shema.js +30 -0
  149. package/dist/modules/core/backup/backup.shema.js.map +1 -0
  150. package/dist/modules/core/core.module.d.ts +2 -0
  151. package/dist/modules/core/core.module.js +50 -0
  152. package/dist/modules/core/core.module.js.map +1 -0
  153. package/dist/modules/core/document/document.helper.d.ts +2 -0
  154. package/dist/modules/core/document/document.helper.js +10 -0
  155. package/dist/modules/core/document/document.helper.js.map +1 -0
  156. package/dist/modules/core/document/document.model.d.ts +9 -0
  157. package/dist/modules/core/document/document.model.js +59 -0
  158. package/dist/modules/core/document/document.model.js.map +1 -0
  159. package/dist/modules/core/document/document.module.d.ts +2 -0
  160. package/dist/modules/core/document/document.module.js +25 -0
  161. package/dist/modules/core/document/document.module.js.map +1 -0
  162. package/dist/modules/core/document/document.resolver.d.ts +12 -0
  163. package/dist/modules/core/document/document.resolver.extend.d.ts +10 -0
  164. package/dist/modules/core/document/document.resolver.extend.js +69 -0
  165. package/dist/modules/core/document/document.resolver.extend.js.map +1 -0
  166. package/dist/modules/core/document/document.resolver.js +154 -0
  167. package/dist/modules/core/document/document.resolver.js.map +1 -0
  168. package/dist/modules/core/document/document.schema.d.ts +39 -0
  169. package/dist/modules/core/document/document.schema.js +181 -0
  170. package/dist/modules/core/document/document.schema.js.map +1 -0
  171. package/dist/modules/core/document/load-documents.queries.d.ts +17 -0
  172. package/dist/modules/core/document/load-documents.queries.js +119 -0
  173. package/dist/modules/core/document/load-documents.queries.js.map +1 -0
  174. package/dist/modules/core/document/save-documents.queries.d.ts +18 -0
  175. package/dist/modules/core/document/save-documents.queries.js +199 -0
  176. package/dist/modules/core/document/save-documents.queries.js.map +1 -0
  177. package/dist/modules/core/document/search-document-item.resolver.d.ts +7 -0
  178. package/dist/modules/core/document/search-document-item.resolver.js +58 -0
  179. package/dist/modules/core/document/search-document-item.resolver.js.map +1 -0
  180. package/dist/modules/core/fields/_fields.helpers.d.ts +2 -0
  181. package/dist/modules/core/fields/_fields.helpers.js +12 -0
  182. package/dist/modules/core/fields/_fields.helpers.js.map +1 -0
  183. package/dist/modules/core/fields/fields.model.d.ts +17 -0
  184. package/dist/modules/core/fields/fields.model.js +99 -0
  185. package/dist/modules/core/fields/fields.model.js.map +1 -0
  186. package/dist/modules/core/fields/fields.module.d.ts +2 -0
  187. package/dist/modules/core/fields/fields.module.js +20 -0
  188. package/dist/modules/core/fields/fields.module.js.map +1 -0
  189. package/dist/modules/core/fields/fields.resolver.d.ts +14 -0
  190. package/dist/modules/core/fields/fields.resolver.js +165 -0
  191. package/dist/modules/core/fields/fields.resolver.js.map +1 -0
  192. package/dist/modules/core/fields/load-fields.queries.d.ts +20 -0
  193. package/dist/modules/core/fields/load-fields.queries.js +233 -0
  194. package/dist/modules/core/fields/load-fields.queries.js.map +1 -0
  195. package/dist/modules/core/fields/quill-delta.d.ts +1 -0
  196. package/dist/modules/core/fields/quill-delta.js +40 -0
  197. package/dist/modules/core/fields/quill-delta.js.map +1 -0
  198. package/dist/modules/core/fields/save-fields.queries.d.ts +9 -0
  199. package/dist/modules/core/fields/save-fields.queries.js +135 -0
  200. package/dist/modules/core/fields/save-fields.queries.js.map +1 -0
  201. package/dist/modules/core/leaf/leaf.model.d.ts +9 -0
  202. package/dist/modules/core/leaf/leaf.model.js +61 -0
  203. package/dist/modules/core/leaf/leaf.model.js.map +1 -0
  204. package/dist/modules/core/leaf/leaf.module.d.ts +2 -0
  205. package/dist/modules/core/leaf/leaf.module.js +21 -0
  206. package/dist/modules/core/leaf/leaf.module.js.map +1 -0
  207. package/dist/modules/core/leaf/leaf.queries.d.ts +21 -0
  208. package/dist/modules/core/leaf/leaf.queries.js +143 -0
  209. package/dist/modules/core/leaf/leaf.queries.js.map +1 -0
  210. package/dist/modules/core/leaf/leaf.resolver.d.ts +9 -0
  211. package/dist/modules/core/leaf/leaf.resolver.extend.d.ts +6 -0
  212. package/dist/modules/core/leaf/leaf.resolver.extend.js +42 -0
  213. package/dist/modules/core/leaf/leaf.resolver.extend.js.map +1 -0
  214. package/dist/modules/core/leaf/leaf.resolver.js +84 -0
  215. package/dist/modules/core/leaf/leaf.resolver.js.map +1 -0
  216. package/dist/modules/core/leaf/leaf.schema.d.ts +7 -0
  217. package/dist/modules/core/leaf/leaf.schema.js +45 -0
  218. package/dist/modules/core/leaf/leaf.schema.js.map +1 -0
  219. package/dist/modules/core/leaf-item/leaf-item.model.d.ts +6 -0
  220. package/dist/modules/core/leaf-item/leaf-item.model.js +44 -0
  221. package/dist/modules/core/leaf-item/leaf-item.model.js.map +1 -0
  222. package/dist/modules/core/leaf-item/leaf-item.queries.d.ts +9 -0
  223. package/dist/modules/core/leaf-item/leaf-item.queries.js +120 -0
  224. package/dist/modules/core/leaf-item/leaf-item.queries.js.map +1 -0
  225. package/dist/modules/core/login/login.controller.d.ts +8 -0
  226. package/dist/modules/core/login/login.controller.js +54 -0
  227. package/dist/modules/core/login/login.controller.js.map +1 -0
  228. package/dist/modules/core/login/login.module.d.ts +2 -0
  229. package/dist/modules/core/login/login.module.js +22 -0
  230. package/dist/modules/core/login/login.module.js.map +1 -0
  231. package/dist/modules/core/media/media-upload.controller.d.ts +21 -0
  232. package/dist/modules/core/media/media-upload.controller.js +160 -0
  233. package/dist/modules/core/media/media-upload.controller.js.map +1 -0
  234. package/dist/modules/core/media/media.d.ts +22 -0
  235. package/dist/modules/core/media/media.js +53 -0
  236. package/dist/modules/core/media/media.js.map +1 -0
  237. package/dist/modules/core/media/media.module.d.ts +2 -0
  238. package/dist/modules/core/media/media.module.js +22 -0
  239. package/dist/modules/core/media/media.module.js.map +1 -0
  240. package/dist/modules/core/media/media.resolver.d.ts +14 -0
  241. package/dist/modules/core/media/media.resolver.js +199 -0
  242. package/dist/modules/core/media/media.resolver.js.map +1 -0
  243. package/dist/modules/core/media/media.schema.d.ts +30 -0
  244. package/dist/modules/core/media/media.schema.js +144 -0
  245. package/dist/modules/core/media/media.schema.js.map +1 -0
  246. package/dist/modules/core/part/part.model.d.ts +6 -0
  247. package/dist/modules/core/part/part.model.js +44 -0
  248. package/dist/modules/core/part/part.model.js.map +1 -0
  249. package/dist/modules/core/part/part.module.d.ts +2 -0
  250. package/dist/modules/core/part/part.module.js +21 -0
  251. package/dist/modules/core/part/part.module.js.map +1 -0
  252. package/dist/modules/core/part/part.queries.d.ts +22 -0
  253. package/dist/modules/core/part/part.queries.js +167 -0
  254. package/dist/modules/core/part/part.queries.js.map +1 -0
  255. package/dist/modules/core/part/part.resolver.d.ts +14 -0
  256. package/dist/modules/core/part/part.resolver.extend.d.ts +5 -0
  257. package/dist/modules/core/part/part.resolver.extend.js +49 -0
  258. package/dist/modules/core/part/part.resolver.extend.js.map +1 -0
  259. package/dist/modules/core/part/part.resolver.js +135 -0
  260. package/dist/modules/core/part/part.resolver.js.map +1 -0
  261. package/dist/modules/core/part/part.schema.d.ts +12 -0
  262. package/dist/modules/core/part/part.schema.js +66 -0
  263. package/dist/modules/core/part/part.schema.js.map +1 -0
  264. package/dist/modules/core/section/section-wrap.resolver.d.ts +11 -0
  265. package/dist/modules/core/section/section-wrap.resolver.js +168 -0
  266. package/dist/modules/core/section/section-wrap.resolver.js.map +1 -0
  267. package/dist/modules/core/section/section.model.d.ts +6 -0
  268. package/dist/modules/core/section/section.model.js +44 -0
  269. package/dist/modules/core/section/section.model.js.map +1 -0
  270. package/dist/modules/core/section/section.module.d.ts +2 -0
  271. package/dist/modules/core/section/section.module.js +21 -0
  272. package/dist/modules/core/section/section.module.js.map +1 -0
  273. package/dist/modules/core/section/section.queries.d.ts +51 -0
  274. package/dist/modules/core/section/section.queries.js +228 -0
  275. package/dist/modules/core/section/section.queries.js.map +1 -0
  276. package/dist/modules/core/section/section.resolver.d.ts +7 -0
  277. package/dist/modules/core/section/section.resolver.js +78 -0
  278. package/dist/modules/core/section/section.resolver.js.map +1 -0
  279. package/dist/modules/core/section/section.schema.d.ts +27 -0
  280. package/dist/modules/core/section/section.schema.js +129 -0
  281. package/dist/modules/core/section/section.schema.js.map +1 -0
  282. package/dist/modules/core/site-fields/site-fields.model.d.ts +4 -0
  283. package/dist/modules/core/site-fields/site-fields.model.js +30 -0
  284. package/dist/modules/core/site-fields/site-fields.model.js.map +1 -0
  285. package/dist/modules/core/site-fields/site-fields.module.d.ts +2 -0
  286. package/dist/modules/core/site-fields/site-fields.module.js +20 -0
  287. package/dist/modules/core/site-fields/site-fields.module.js.map +1 -0
  288. package/dist/modules/core/site-fields/site-fields.queries.d.ts +9 -0
  289. package/dist/modules/core/site-fields/site-fields.queries.js +123 -0
  290. package/dist/modules/core/site-fields/site-fields.queries.js.map +1 -0
  291. package/dist/modules/core/site-fields/site-fields.resolver.d.ts +5 -0
  292. package/dist/modules/core/site-fields/site-fields.resolver.js +56 -0
  293. package/dist/modules/core/site-fields/site-fields.resolver.js.map +1 -0
  294. package/dist/modules/core/site-info/site-info.module.d.ts +2 -0
  295. package/dist/modules/core/site-info/site-info.module.js +20 -0
  296. package/dist/modules/core/site-info/site-info.module.js.map +1 -0
  297. package/dist/modules/core/site-info/site-info.resolver.d.ts +5 -0
  298. package/dist/modules/core/site-info/site-info.resolver.js +44 -0
  299. package/dist/modules/core/site-info/site-info.resolver.js.map +1 -0
  300. package/dist/modules/core/site-info/site-info.schema.d.ts +6 -0
  301. package/dist/modules/core/site-info/site-info.schema.js +36 -0
  302. package/dist/modules/core/site-info/site-info.schema.js.map +1 -0
  303. package/dist/modules/core/site-schema/site-schema.module.d.ts +2 -0
  304. package/dist/modules/core/site-schema/site-schema.module.js +20 -0
  305. package/dist/modules/core/site-schema/site-schema.module.js.map +1 -0
  306. package/dist/modules/core/site-schema/site-schema.resolver.d.ts +4 -0
  307. package/dist/modules/core/site-schema/site-schema.resolver.js +35 -0
  308. package/dist/modules/core/site-schema/site-schema.resolver.js.map +1 -0
  309. package/dist/modules/core/term-flag/term-flag.model.d.ts +6 -0
  310. package/dist/modules/core/term-flag/term-flag.model.js +45 -0
  311. package/dist/modules/core/term-flag/term-flag.model.js.map +1 -0
  312. package/dist/modules/core/term-flag/term-flag.module.d.ts +2 -0
  313. package/dist/modules/core/term-flag/term-flag.module.js +20 -0
  314. package/dist/modules/core/term-flag/term-flag.module.js.map +1 -0
  315. package/dist/modules/core/term-flag/term-flag.queries.d.ts +7 -0
  316. package/dist/modules/core/term-flag/term-flag.queries.js +44 -0
  317. package/dist/modules/core/term-flag/term-flag.queries.js.map +1 -0
  318. package/dist/modules/core/term-flag/term-flag.resolver.d.ts +5 -0
  319. package/dist/modules/core/term-flag/term-flag.resolver.js +47 -0
  320. package/dist/modules/core/term-flag/term-flag.resolver.js.map +1 -0
  321. package/dist/modules/core/term-flag/term-flag.schema.d.ts +9 -0
  322. package/dist/modules/core/term-flag/term-flag.schema.js +51 -0
  323. package/dist/modules/core/term-flag/term-flag.schema.js.map +1 -0
  324. package/dist/modules/core/term-flag/term-flag.service.d.ts +9 -0
  325. package/dist/modules/core/term-flag/term-flag.service.js +50 -0
  326. package/dist/modules/core/term-flag/term-flag.service.js.map +1 -0
  327. package/dist/modules/core/unprotected/unprotected.module.d.ts +2 -0
  328. package/dist/modules/core/unprotected/unprotected.module.js +20 -0
  329. package/dist/modules/core/unprotected/unprotected.module.js.map +1 -0
  330. package/dist/modules/core/unprotected/unprotected.resolver.d.ts +8 -0
  331. package/dist/modules/core/unprotected/unprotected.resolver.js +106 -0
  332. package/dist/modules/core/unprotected/unprotected.resolver.js.map +1 -0
  333. package/dist/modules/core/unprotected/unprotected.schema.d.ts +19 -0
  334. package/dist/modules/core/unprotected/unprotected.schema.js +93 -0
  335. package/dist/modules/core/unprotected/unprotected.schema.js.map +1 -0
  336. package/dist/modules/graphql.types.d.ts +6 -0
  337. package/dist/modules/graphql.types.js +3 -0
  338. package/dist/modules/graphql.types.js.map +1 -0
  339. package/dist/modules/private-api.module.d.ts +2 -0
  340. package/dist/modules/private-api.module.js +50 -0
  341. package/dist/modules/private-api.module.js.map +1 -0
  342. package/dist/modules/public-api/class-validator-options.d.ts +7 -0
  343. package/dist/modules/public-api/class-validator-options.js +11 -0
  344. package/dist/modules/public-api/class-validator-options.js.map +1 -0
  345. package/dist/modules/public-api/mail/contact-form-mail.d.ts +8 -0
  346. package/dist/modules/public-api/mail/contact-form-mail.js +96 -0
  347. package/dist/modules/public-api/mail/contact-form-mail.js.map +1 -0
  348. package/dist/modules/public-api/mail/mail.dto.d.ts +8 -0
  349. package/dist/modules/public-api/mail/mail.dto.js +56 -0
  350. package/dist/modules/public-api/mail/mail.dto.js.map +1 -0
  351. package/dist/modules/public-api/partials/partials-params.dto.d.ts +6 -0
  352. package/dist/modules/public-api/partials/partials-params.dto.js +45 -0
  353. package/dist/modules/public-api/partials/partials-params.dto.js.map +1 -0
  354. package/dist/modules/public-api/password-reset/password-reset.controller.d.ts +11 -0
  355. package/dist/modules/public-api/password-reset/password-reset.controller.js +59 -0
  356. package/dist/modules/public-api/password-reset/password-reset.controller.js.map +1 -0
  357. package/dist/modules/public-api/password-reset/password-reset.dto.d.ts +9 -0
  358. package/dist/modules/public-api/password-reset/password-reset.dto.js +55 -0
  359. package/dist/modules/public-api/password-reset/password-reset.dto.js.map +1 -0
  360. package/dist/modules/public-api/password-reset/password-reset.module.d.ts +2 -0
  361. package/dist/modules/public-api/password-reset/password-reset.module.js +22 -0
  362. package/dist/modules/public-api/password-reset/password-reset.module.js.map +1 -0
  363. package/dist/modules/public-api/password-reset/password-reset.service.d.ts +14 -0
  364. package/dist/modules/public-api/password-reset/password-reset.service.js +56 -0
  365. package/dist/modules/public-api/password-reset/password-reset.service.js.map +1 -0
  366. package/dist/modules/public-api/public-api-controller.d.ts +32 -0
  367. package/dist/modules/public-api/public-api-controller.js +198 -0
  368. package/dist/modules/public-api/public-api-controller.js.map +1 -0
  369. package/dist/modules/public-api/public-api.module.d.ts +2 -0
  370. package/dist/modules/public-api/public-api.module.js +22 -0
  371. package/dist/modules/public-api/public-api.module.js.map +1 -0
  372. package/dist/modules/public-api/search-text/search-text.dto.d.ts +7 -0
  373. package/dist/modules/public-api/search-text/search-text.dto.js +50 -0
  374. package/dist/modules/public-api/search-text/search-text.dto.js.map +1 -0
  375. package/dist/modules/public-api/search-text/search-text.queries.d.ts +14 -0
  376. package/dist/modules/public-api/search-text/search-text.queries.js +58 -0
  377. package/dist/modules/public-api/search-text/search-text.queries.js.map +1 -0
  378. package/dist/modules/public-site/app-exception-filter.d.ts +4 -0
  379. package/dist/modules/public-site/app-exception-filter.js +41 -0
  380. package/dist/modules/public-site/app-exception-filter.js.map +1 -0
  381. package/dist/modules/public-site/google-auth.controller.d.ts +10 -0
  382. package/dist/modules/public-site/google-auth.controller.js +127 -0
  383. package/dist/modules/public-site/google-auth.controller.js.map +1 -0
  384. package/dist/modules/public-site/helpers/format-date.helper.d.ts +3 -0
  385. package/dist/modules/public-site/helpers/format-date.helper.js +35 -0
  386. package/dist/modules/public-site/helpers/format-date.helper.js.map +1 -0
  387. package/dist/modules/public-site/helpers/format-date.helper.spec.d.ts +1 -0
  388. package/dist/modules/public-site/helpers/format-date.helper.spec.js +37 -0
  389. package/dist/modules/public-site/helpers/format-date.helper.spec.js.map +1 -0
  390. package/dist/modules/public-site/helpers/medias.helpers.d.ts +3 -0
  391. package/dist/modules/public-site/helpers/medias.helpers.js +16 -0
  392. package/dist/modules/public-site/helpers/medias.helpers.js.map +1 -0
  393. package/dist/modules/public-site/helpers/obfuscate.helper.d.ts +2 -0
  394. package/dist/modules/public-site/helpers/obfuscate.helper.js +27 -0
  395. package/dist/modules/public-site/helpers/obfuscate.helper.js.map +1 -0
  396. package/dist/modules/public-site/helpers/public-field-values.d.ts +10 -0
  397. package/dist/modules/public-site/helpers/public-field-values.js +76 -0
  398. package/dist/modules/public-site/helpers/public-field-values.js.map +1 -0
  399. package/dist/modules/public-site/liquidjs-filters/format-date.d.ts +2 -0
  400. package/dist/modules/public-site/liquidjs-filters/format-date.js +14 -0
  401. package/dist/modules/public-site/liquidjs-filters/format-date.js.map +1 -0
  402. package/dist/modules/public-site/liquidjs-filters/format-number.d.ts +2 -0
  403. package/dist/modules/public-site/liquidjs-filters/format-number.js +18 -0
  404. package/dist/modules/public-site/liquidjs-filters/format-number.js.map +1 -0
  405. package/dist/modules/public-site/liquidjs-filters/info-filter.d.ts +2 -0
  406. package/dist/modules/public-site/liquidjs-filters/info-filter.js +144 -0
  407. package/dist/modules/public-site/liquidjs-filters/info-filter.js.map +1 -0
  408. package/dist/modules/public-site/liquidjs-filters/inject-facebook-chat.d.ts +2 -0
  409. package/dist/modules/public-site/liquidjs-filters/inject-facebook-chat.js +38 -0
  410. package/dist/modules/public-site/liquidjs-filters/inject-facebook-chat.js.map +1 -0
  411. package/dist/modules/public-site/liquidjs-filters/inject-menu-items-data.d.ts +3 -0
  412. package/dist/modules/public-site/liquidjs-filters/inject-menu-items-data.js +21 -0
  413. package/dist/modules/public-site/liquidjs-filters/inject-menu-items-data.js.map +1 -0
  414. package/dist/modules/public-site/liquidjs-filters/make-excerpt.d.ts +2 -0
  415. package/dist/modules/public-site/liquidjs-filters/make-excerpt.js +10 -0
  416. package/dist/modules/public-site/liquidjs-filters/make-excerpt.js.map +1 -0
  417. package/dist/modules/public-site/liquidjs-filters/obfuscate.d.ts +3 -0
  418. package/dist/modules/public-site/liquidjs-filters/obfuscate.js +15 -0
  419. package/dist/modules/public-site/liquidjs-filters/obfuscate.js.map +1 -0
  420. package/dist/modules/public-site/liquidjs-filters/open-graph-filter.d.ts +4 -0
  421. package/dist/modules/public-site/liquidjs-filters/open-graph-filter.js +39 -0
  422. package/dist/modules/public-site/liquidjs-filters/open-graph-filter.js.map +1 -0
  423. package/dist/modules/public-site/liquidjs-filters/translate-filter.1.d.ts +3 -0
  424. package/dist/modules/public-site/liquidjs-filters/translate-filter.1.js +12 -0
  425. package/dist/modules/public-site/liquidjs-filters/translate-filter.1.js.map +1 -0
  426. package/dist/modules/public-site/liquidjs-filters/translate-filter.d.ts +3 -0
  427. package/dist/modules/public-site/liquidjs-filters/translate-filter.js +12 -0
  428. package/dist/modules/public-site/liquidjs-filters/translate-filter.js.map +1 -0
  429. package/dist/modules/public-site/liquidjs-rendering/render-clone/collection.d.ts +1 -0
  430. package/dist/modules/public-site/liquidjs-rendering/render-clone/collection.js +18 -0
  431. package/dist/modules/public-site/liquidjs-rendering/render-clone/collection.js.map +1 -0
  432. package/dist/modules/public-site/liquidjs-rendering/render-clone/forloop-drop.d.ts +15 -0
  433. package/dist/modules/public-site/liquidjs-rendering/render-clone/forloop-drop.js +40 -0
  434. package/dist/modules/public-site/liquidjs-rendering/render-clone/forloop-drop.js.map +1 -0
  435. package/dist/modules/public-site/liquidjs-rendering/render-clone/render.d.ts +13 -0
  436. package/dist/modules/public-site/liquidjs-rendering/render-clone/render.js +108 -0
  437. package/dist/modules/public-site/liquidjs-rendering/render-clone/render.js.map +1 -0
  438. package/dist/modules/public-site/liquidjs-rendering/render-liquidjs.d.ts +6 -0
  439. package/dist/modules/public-site/liquidjs-rendering/render-liquidjs.js +40 -0
  440. package/dist/modules/public-site/liquidjs-rendering/render-liquidjs.js.map +1 -0
  441. package/dist/modules/public-site/liquidjs-rendering/rendering-context.d.ts +27 -0
  442. package/dist/modules/public-site/liquidjs-rendering/rendering-context.js +46 -0
  443. package/dist/modules/public-site/liquidjs-rendering/rendering-context.js.map +1 -0
  444. package/dist/modules/public-site/liquidjs-tags/get-breadcrumb-liquidjs-tag.d.ts +13 -0
  445. package/dist/modules/public-site/liquidjs-tags/get-breadcrumb-liquidjs-tag.js +49 -0
  446. package/dist/modules/public-site/liquidjs-tags/get-breadcrumb-liquidjs-tag.js.map +1 -0
  447. package/dist/modules/public-site/liquidjs-tags/get-page-tag.d.ts +13 -0
  448. package/dist/modules/public-site/liquidjs-tags/get-page-tag.js +68 -0
  449. package/dist/modules/public-site/liquidjs-tags/get-page-tag.js.map +1 -0
  450. package/dist/modules/public-site/liquidjs-tags/get-pages-tag.d.ts +13 -0
  451. package/dist/modules/public-site/liquidjs-tags/get-pages-tag.js +94 -0
  452. package/dist/modules/public-site/liquidjs-tags/get-pages-tag.js.map +1 -0
  453. package/dist/modules/public-site/liquidjs-tags/get-siblings-liquidjs-tag.d.ts +13 -0
  454. package/dist/modules/public-site/liquidjs-tags/get-siblings-liquidjs-tag.js +61 -0
  455. package/dist/modules/public-site/liquidjs-tags/get-siblings-liquidjs-tag.js.map +1 -0
  456. package/dist/modules/public-site/liquidjs-tags/use-image-tag.d.ts +13 -0
  457. package/dist/modules/public-site/liquidjs-tags/use-image-tag.js +53 -0
  458. package/dist/modules/public-site/liquidjs-tags/use-image-tag.js.map +1 -0
  459. package/dist/modules/public-site/media-serve/_media-serve-helpers.d.ts +11 -0
  460. package/dist/modules/public-site/media-serve/_media-serve-helpers.js +26 -0
  461. package/dist/modules/public-site/media-serve/_media-serve-helpers.js.map +1 -0
  462. package/dist/modules/public-site/media-serve/media-serve.controller.d.ts +4 -0
  463. package/dist/modules/public-site/media-serve/media-serve.controller.js +140 -0
  464. package/dist/modules/public-site/media-serve/media-serve.controller.js.map +1 -0
  465. package/dist/modules/public-site/media-serve/media-serve.module.d.ts +2 -0
  466. package/dist/modules/public-site/media-serve/media-serve.module.js +20 -0
  467. package/dist/modules/public-site/media-serve/media-serve.module.js.map +1 -0
  468. package/dist/modules/public-site/oauth2-client.controller.d.ts +10 -0
  469. package/dist/modules/public-site/oauth2-client.controller.js +144 -0
  470. package/dist/modules/public-site/oauth2-client.controller.js.map +1 -0
  471. package/dist/modules/public-site/public-route/make-url.d.ts +11 -0
  472. package/dist/modules/public-site/public-route/make-url.js +150 -0
  473. package/dist/modules/public-site/public-route/make-url.js.map +1 -0
  474. package/dist/modules/public-site/public-route/public-route-parser.d.ts +16 -0
  475. package/dist/modules/public-site/public-route/public-route-parser.js +154 -0
  476. package/dist/modules/public-site/public-route/public-route-parser.js.map +1 -0
  477. package/dist/modules/public-site/public-route/raw-document-payload.d.ts +8 -0
  478. package/dist/modules/public-site/public-route/raw-document-payload.js +86 -0
  479. package/dist/modules/public-site/public-route/raw-document-payload.js.map +1 -0
  480. package/dist/modules/public-site/public-site.controller.d.ts +7 -0
  481. package/dist/modules/public-site/public-site.controller.js +58 -0
  482. package/dist/modules/public-site/public-site.controller.js.map +1 -0
  483. package/dist/modules/public-site/public-site.middleware.d.ts +5 -0
  484. package/dist/modules/public-site/public-site.middleware.js +67 -0
  485. package/dist/modules/public-site/public-site.middleware.js.map +1 -0
  486. package/dist/modules/public-site/public-site.module.d.ts +4 -0
  487. package/dist/modules/public-site/public-site.module.js +27 -0
  488. package/dist/modules/public-site/public-site.module.js.map +1 -0
  489. package/dist/modules/public-site/serve-document/serve-document.d.ts +20 -0
  490. package/dist/modules/public-site/serve-document/serve-document.js +60 -0
  491. package/dist/modules/public-site/serve-document/serve-document.js.map +1 -0
  492. package/dist/modules/security/app-throttler-guard.d.ts +8 -0
  493. package/dist/modules/security/app-throttler-guard.js +18 -0
  494. package/dist/modules/security/app-throttler-guard.js.map +1 -0
  495. package/dist/modules/security/complexity-plugin.d.ts +8 -0
  496. package/dist/modules/security/complexity-plugin.js +46 -0
  497. package/dist/modules/security/complexity-plugin.js.map +1 -0
  498. package/dist/modules/security/gqlThrottlerGuard.d.ts +8 -0
  499. package/dist/modules/security/gqlThrottlerGuard.js +24 -0
  500. package/dist/modules/security/gqlThrottlerGuard.js.map +1 -0
  501. package/dist/nest-custom-logger.d.ts +8 -0
  502. package/dist/nest-custom-logger.js +23 -0
  503. package/dist/nest-custom-logger.js.map +1 -0
  504. package/dist/public-payload/breadcrumb.queries.d.ts +5 -0
  505. package/dist/public-payload/breadcrumb.queries.js +26 -0
  506. package/dist/public-payload/breadcrumb.queries.js.map +1 -0
  507. package/dist/public-payload/create-page-drop.d.ts +11 -0
  508. package/dist/public-payload/create-page-drop.js +160 -0
  509. package/dist/public-payload/create-page-drop.js.map +1 -0
  510. package/dist/public-payload/create-page-part-drop.d.ts +7 -0
  511. package/dist/public-payload/create-page-part-drop.js +39 -0
  512. package/dist/public-payload/create-page-part-drop.js.map +1 -0
  513. package/dist/public-payload/create-page-payload-drop.d.ts +10 -0
  514. package/dist/public-payload/create-page-payload-drop.js +143 -0
  515. package/dist/public-payload/create-page-payload-drop.js.map +1 -0
  516. package/dist/public-payload/excerpt.queries.d.ts +10 -0
  517. package/dist/public-payload/excerpt.queries.js +38 -0
  518. package/dist/public-payload/excerpt.queries.js.map +1 -0
  519. package/dist/public-payload/field-values.d.ts +9 -0
  520. package/dist/public-payload/field-values.js +99 -0
  521. package/dist/public-payload/field-values.js.map +1 -0
  522. package/dist/public-payload/get-siblings.queries.d.ts +5 -0
  523. package/dist/public-payload/get-siblings.queries.js +117 -0
  524. package/dist/public-payload/get-siblings.queries.js.map +1 -0
  525. package/dist/public-payload/liquidjs-drop.d.ts +31 -0
  526. package/dist/public-payload/liquidjs-drop.js +45 -0
  527. package/dist/public-payload/liquidjs-drop.js.map +1 -0
  528. package/dist/public-payload/load-default-image.d.ts +8 -0
  529. package/dist/public-payload/load-default-image.js +52 -0
  530. package/dist/public-payload/load-default-image.js.map +1 -0
  531. package/dist/public-payload/make-basic-payload.d.ts +6 -0
  532. package/dist/public-payload/make-basic-payload.js +19 -0
  533. package/dist/public-payload/make-basic-payload.js.map +1 -0
  534. package/dist/public-payload/make-image-available.d.ts +26 -0
  535. package/dist/public-payload/make-image-available.js +38 -0
  536. package/dist/public-payload/make-image-available.js.map +1 -0
  537. package/dist/public-payload/page-values.queries.d.ts +27 -0
  538. package/dist/public-payload/page-values.queries.js +110 -0
  539. package/dist/public-payload/page-values.queries.js.map +1 -0
  540. package/dist/public-payload/parts.queries.d.ts +6 -0
  541. package/dist/public-payload/parts.queries.js +123 -0
  542. package/dist/public-payload/parts.queries.js.map +1 -0
  543. package/dist/public-payload/public-payload.types.d.ts +130 -0
  544. package/dist/public-payload/public-payload.types.js +3 -0
  545. package/dist/public-payload/public-payload.types.js.map +1 -0
  546. package/dist/public-payload/site-payload.d.ts +4 -0
  547. package/dist/public-payload/site-payload.js +43 -0
  548. package/dist/public-payload/site-payload.js.map +1 -0
  549. package/dist/public-payload/taxonomies.queries.d.ts +13 -0
  550. package/dist/public-payload/taxonomies.queries.js +45 -0
  551. package/dist/public-payload/taxonomies.queries.js.map +1 -0
  552. package/dist/public-payload/translations.queries.d.ts +7 -0
  553. package/dist/public-payload/translations.queries.js +62 -0
  554. package/dist/public-payload/translations.queries.js.map +1 -0
  555. package/dist/public.types.d.ts +5 -0
  556. package/dist/public.types.js +3 -0
  557. package/dist/public.types.js.map +1 -0
  558. package/dist/share/pino-app-log.d.ts +26 -0
  559. package/dist/share/pino-app-log.js +138 -0
  560. package/dist/share/pino-app-log.js.map +1 -0
  561. package/dist/share/read-configuration.d.ts +7 -0
  562. package/dist/share/read-configuration.js +31 -0
  563. package/dist/share/read-configuration.js.map +1 -0
  564. package/dist/site-backup/archiver.helper.d.ts +12 -0
  565. package/dist/site-backup/archiver.helper.js +43 -0
  566. package/dist/site-backup/archiver.helper.js.map +1 -0
  567. package/dist/site-backup/backup-tasks.d.ts +11 -0
  568. package/dist/site-backup/backup-tasks.js +98 -0
  569. package/dist/site-backup/backup-tasks.js.map +1 -0
  570. package/dist/site-backup/backup.d.ts +11 -0
  571. package/dist/site-backup/backup.helper.d.ts +3 -0
  572. package/dist/site-backup/backup.helper.js +13 -0
  573. package/dist/site-backup/backup.helper.js.map +1 -0
  574. package/dist/site-backup/backup.js +34 -0
  575. package/dist/site-backup/backup.js.map +1 -0
  576. package/dist/site-backup/default-data/default-config.d.ts +1 -0
  577. package/dist/site-backup/default-data/default-config.js +50 -0
  578. package/dist/site-backup/default-data/default-config.js.map +1 -0
  579. package/dist/site-backup/default-data/default-readme.d.ts +1 -0
  580. package/dist/site-backup/default-data/default-readme.js +8 -0
  581. package/dist/site-backup/default-data/default-readme.js.map +1 -0
  582. package/dist/site-context/db-init/db-init.d.ts +11 -0
  583. package/dist/site-context/db-init/db-init.js +37 -0
  584. package/dist/site-context/db-init/db-init.js.map +1 -0
  585. package/dist/site-context/db-init/ddl-migration.d.ts +13 -0
  586. package/dist/site-context/db-init/ddl-migration.js +26 -0
  587. package/dist/site-context/db-init/ddl-migration.js.map +1 -0
  588. package/dist/site-context/db-init/init-routing-points.d.ts +4 -0
  589. package/dist/site-context/db-init/init-routing-points.js +147 -0
  590. package/dist/site-context/db-init/init-routing-points.js.map +1 -0
  591. package/dist/site-context/site-conf.d.ts +17 -0
  592. package/dist/site-context/site-conf.js +103 -0
  593. package/dist/site-context/site-conf.js.map +1 -0
  594. package/dist/site-context/site-context.d.ts +11 -0
  595. package/dist/site-context/site-context.js +234 -0
  596. package/dist/site-context/site-context.js.map +1 -0
  597. package/dist/site-context/site-context.types.d.ts +46 -0
  598. package/dist/site-context/site-context.types.js +3 -0
  599. package/dist/site-context/site-context.types.js.map +1 -0
  600. package/dist/site-context/theme-conf-reader.d.ts +4 -0
  601. package/dist/site-context/theme-conf-reader.js +33 -0
  602. package/dist/site-context/theme-conf-reader.js.map +1 -0
  603. package/dist/site-context/theme-conf-types.d.ts +4 -0
  604. package/dist/site-context/theme-conf-types.js +3 -0
  605. package/dist/site-context/theme-conf-types.js.map +1 -0
  606. package/dist/site-schema/common-schema-reader.d.ts +6 -0
  607. package/dist/site-schema/common-schema-reader.js +29 -0
  608. package/dist/site-schema/common-schema-reader.js.map +1 -0
  609. package/dist/site-schema/merged-schema-lib.d.ts +30 -0
  610. package/dist/site-schema/merged-schema-lib.js +118 -0
  611. package/dist/site-schema/merged-schema-lib.js.map +1 -0
  612. package/dist/site-schema/read-locales.d.ts +24 -0
  613. package/dist/site-schema/read-locales.js +171 -0
  614. package/dist/site-schema/read-locales.js.map +1 -0
  615. package/dist/site-schema/site-schema-factory.d.ts +2 -0
  616. package/dist/site-schema/site-schema-factory.js +382 -0
  617. package/dist/site-schema/site-schema-factory.js.map +1 -0
  618. package/dist/site-schema/site-schema-helpers.d.ts +5 -0
  619. package/dist/site-schema/site-schema-helpers.js +27 -0
  620. package/dist/site-schema/site-schema-helpers.js.map +1 -0
  621. package/dist/site-schema/site-schema-lib-reader.d.ts +14 -0
  622. package/dist/site-schema/site-schema-lib-reader.js +48 -0
  623. package/dist/site-schema/site-schema-lib-reader.js.map +1 -0
  624. package/dist/start.d.ts +1 -0
  625. package/dist/start.js +5 -0
  626. package/dist/start.js.map +1 -0
  627. package/dist/types.to.json +1 -0
  628. package/locales/en.json +18 -0
  629. package/locales/fr.json +18 -0
  630. package/package.json +99 -0
  631. package/schema.gql +293 -0
  632. package/site-schema-lib/common-schema.json +36 -0
  633. package/site-schema-lib/common-schema.l10n.en.json +10 -0
  634. package/site-schema-lib/common-schema.l10n.fr.json +10 -0
  635. package/site-schema-lib/fields.site-schema.json +79 -0
  636. package/site-schema-lib/fields.site-schema.l10n.en.json +26 -0
  637. package/site-schema-lib/fields.site-schema.l10n.fr.json +26 -0
  638. package/site-schema-lib/gallery-page.site-schema.json +19 -0
  639. package/site-schema-lib/gallery-page.site-schema.l10n.en.json +11 -0
  640. package/site-schema-lib/gallery-page.site-schema.l10n.fr.json +11 -0
  641. package/site-schema-lib/lowcost.site-schema.json +84 -0
  642. package/site-schema-lib/lowcost.site-schema.l10n.en.json +30 -0
  643. package/site-schema-lib/lowcost.site-schema.l10n.fr.json +30 -0
  644. package/site-schema-lib/media-policies.site-schema.json +26 -0
  645. package/site-schema-lib/portfolio.site-schema.json +28 -0
  646. package/site-schema-lib/portfolio.site-schema.l10n.en.json +16 -0
  647. package/site-schema-lib/portfolio.site-schema.l10n.fr.json +16 -0
  648. package/site-schema-lib/post.site-schema.json +48 -0
  649. package/site-schema-lib/post.site-schema.l10n.en.json +28 -0
  650. package/site-schema-lib/post.site-schema.l10n.fr.json +27 -0
  651. package/site-schema-lib/simple-pages.site-schema.json +19 -0
  652. package/site-schema-lib/simple-pages.site-schema.l10n.en.json +11 -0
  653. package/site-schema-lib/simple-pages.site-schema.l10n.fr.json +11 -0
  654. package/site-schema-lib/special-page.site-schema.json +42 -0
  655. package/site-schema-lib/special-page.site-schema.l10n.en.json +16 -0
  656. package/site-schema-lib/special-page.site-schema.l10n.fr.json +16 -0
  657. package/site-schema-lib/tour.site-schema.json +70 -0
  658. package/site-schema-lib/tour.site-schema.l10n.en.json +37 -0
  659. package/site-schema-lib/tour.site-schema.l10n.fr.json +37 -0
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.convertQuillDeltaToHtml = void 0;
4
+ const data_formatters_lib_1 = require("@paroi/data-formatters-lib");
5
+ const quill_delta_to_html_1 = require("quill-delta-to-html");
6
+ const html_helpers_1 = require("../../../common/mail/html-helpers");
7
+ const context_1 = require("../../../context");
8
+ function convertQuillDeltaToHtml(delta) {
9
+ const converter = new quill_delta_to_html_1.QuillDeltaToHtmlConverter(delta.ops);
10
+ converter.renderCustomWith((customOp) => {
11
+ const { type, value } = customOp.insert;
12
+ if (type === "img")
13
+ return imgBlotProcessing(value);
14
+ if (type === "html-snippet")
15
+ return value.html;
16
+ context_1.platformLog.warn(`Invalid blot '${type}'`);
17
+ return "";
18
+ });
19
+ return converter.convert();
20
+ }
21
+ exports.convertQuillDeltaToHtml = convertQuillDeltaToHtml;
22
+ function imgBlotProcessing(value) {
23
+ const src = (0, data_formatters_lib_1.strValOrUndef)(value.src);
24
+ const width = (0, data_formatters_lib_1.nbValOrUndef)(value.width);
25
+ const height = (0, data_formatters_lib_1.nbValOrUndef)(value.height);
26
+ const align = (0, data_formatters_lib_1.strValOrUndef)(value.align);
27
+ if (!src) {
28
+ context_1.platformLog.warn("missing 'src' in 'img' blot");
29
+ return "";
30
+ }
31
+ const attributes = [];
32
+ attributes.push(`src="${(0, html_helpers_1.escapeHtml)(src)}"`);
33
+ attributes.push(`class="Img${align ? ` ${(0, html_helpers_1.escapeHtml)(align)}` : ""}"`);
34
+ if (width !== undefined)
35
+ attributes.push(`width="${width}"`);
36
+ if (height !== undefined)
37
+ attributes.push(`height="${height}"`);
38
+ return `<img ${attributes.join(" ")}>`;
39
+ }
40
+ //# sourceMappingURL=quill-delta.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quill-delta.js","sourceRoot":"","sources":["../../../../src/modules/core/fields/quill-delta.ts"],"names":[],"mappings":";;;AAAA,oEAAyE;AAEzE,6DAAgE;AAChE,oEAA+D;AAC/D,8CAA+C;AAE/C,SAAgB,uBAAuB,CAAC,KAAU;IAChD,MAAM,SAAS,GAAG,IAAI,+CAAyB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC3D,SAAS,CAAC,gBAAgB,CAAC,CAAC,QAAQ,EAAE,EAAE;QACtC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC,MAAM,CAAC;QACxC,IAAI,IAAI,KAAK,KAAK;YAAE,OAAO,iBAAiB,CAAC,KAAK,CAAC,CAAC;QACpD,IAAI,IAAI,KAAK,cAAc;YAAE,OAAO,KAAK,CAAC,IAAI,CAAC;QAE/C,qBAAW,CAAC,IAAI,CAAC,iBAAiB,IAAI,GAAG,CAAC,CAAC;QAC3C,OAAO,EAAE,CAAC;IACZ,CAAC,CAAC,CAAC;IAEH,OAAO,SAAS,CAAC,OAAO,EAAE,CAAC;AAC7B,CAAC;AAZD,0DAYC;AAED,SAAS,iBAAiB,CAAC,KAAU;IACnC,MAAM,GAAG,GAAG,IAAA,mCAAa,EAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACrC,MAAM,KAAK,GAAG,IAAA,kCAAY,EAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACxC,MAAM,MAAM,GAAG,IAAA,kCAAY,EAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC1C,MAAM,KAAK,GAAG,IAAA,mCAAa,EAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAEzC,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,qBAAW,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;QAChD,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,UAAU,GAAG,EAAE,CAAC;IACtB,UAAU,CAAC,IAAI,CAAC,QAAQ,IAAA,yBAAU,EAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC5C,UAAU,CAAC,IAAI,CAAC,aAAa,KAAK,CAAC,CAAC,CAAC,IAAI,IAAA,yBAAU,EAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IACtE,IAAI,KAAK,KAAK,SAAS;QAAE,UAAU,CAAC,IAAI,CAAC,UAAU,KAAK,GAAG,CAAC,CAAC;IAC7D,IAAI,MAAM,KAAK,SAAS;QAAE,UAAU,CAAC,IAAI,CAAC,WAAW,MAAM,GAAG,CAAC,CAAC;IAEhE,OAAO,QAAQ,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;AACzC,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { SiteContext } from "../../../site-context/site-context.types";
2
+ import { FieldValues } from "./load-fields.queries";
3
+ export declare function parseFieldValues(jsonVal: string): FieldValues;
4
+ export declare function saveFieldValues(siteContext: Pick<SiteContext, "mainCn" | "siteSchema" | "textCache">, { leafType, leafId, lang, values, }: {
5
+ leafType: string;
6
+ leafId: string;
7
+ lang?: string;
8
+ values: FieldValues;
9
+ }): Promise<void>;
@@ -0,0 +1,135 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.saveFieldValues = exports.parseFieldValues = void 0;
4
+ const common_1 = require("@nestjs/common");
5
+ const data_formatters_lib_1 = require("@paroi/data-formatters-lib");
6
+ const anywhere_lib_1 = require("@paroicms/anywhere-lib");
7
+ const html_helpers_1 = require("../../../common/mail/html-helpers");
8
+ const text_cache_1 = require("../../../common/text-cache");
9
+ const context_1 = require("../../../context");
10
+ const excerpt_helpers_1 = require("../../../helpers/excerpt.helpers");
11
+ const _fields_helpers_1 = require("./_fields.helpers");
12
+ const quill_delta_1 = require("./quill-delta");
13
+ function parseFieldValues(jsonVal) {
14
+ try {
15
+ return (0, anywhere_lib_1.formatObj)(JSON.parse(jsonVal));
16
+ }
17
+ catch {
18
+ throw new common_1.BadRequestException("invalid fieldValues");
19
+ }
20
+ }
21
+ exports.parseFieldValues = parseFieldValues;
22
+ async function saveFieldValues(siteContext, { leafType, leafId, lang, values, }) {
23
+ const leafSchema = (0, anywhere_lib_1.getLeafSchema)(siteContext.siteSchema, leafType);
24
+ const fieldTypes = leafSchema.fields ?? [];
25
+ const typeMap = new Map(fieldTypes.map((item) => [item.name, item]));
26
+ await siteContext.mainCn.transaction(async (cn) => {
27
+ for (const [fieldName, value] of Object.entries(values)) {
28
+ const fieldType = typeMap.get(fieldName);
29
+ if (!fieldType)
30
+ throw new Error(`should have the field type of '${fieldName}'`);
31
+ switch (fieldType.storedAs) {
32
+ case "varchar":
33
+ await saveVarcharFieldValue(cn, { leafId, lang, fieldType, value });
34
+ break;
35
+ case "text":
36
+ await saveTextFieldValue(cn, { leafId, lang, fieldType, value });
37
+ break;
38
+ case "mediaHandle":
39
+ throw new Error(`shouldn't include '${fieldType.storedAs}' field '${fieldName}' for saving`);
40
+ default:
41
+ throw new Error(`invalid field type '${fieldType.storedAs}'`);
42
+ }
43
+ }
44
+ });
45
+ if (leafSchema.kind === "part") {
46
+ await (0, text_cache_1.invalidateMultipleDocumentsInCache)(siteContext, { parentOfLeafId: leafId });
47
+ }
48
+ else {
49
+ await (0, text_cache_1.invalidateMultipleDocumentsInCache)(siteContext, { leafId });
50
+ }
51
+ }
52
+ exports.saveFieldValues = saveFieldValues;
53
+ async function saveVarcharFieldValue(cn, options) {
54
+ const { leafId, fieldType, value } = options;
55
+ const dbLang = (0, _fields_helpers_1.langIfSection)(options.lang, fieldType) ?? context_1.dbAnyLang;
56
+ const val = fieldValueToDbString(value, fieldType.dataType);
57
+ if (val === undefined) {
58
+ const query = cn
59
+ .createQueryBuilder()
60
+ .delete()
61
+ .from("PaFieldVarchar")
62
+ .where("field = :field", { field: fieldType.name })
63
+ .andWhere("leafId = :leafId", { leafId })
64
+ .andWhere("lang = :lang", { lang: dbLang });
65
+ await query.execute();
66
+ }
67
+ else {
68
+ await cn
69
+ .createQueryBuilder()
70
+ .insert()
71
+ .into("PaFieldVarchar")
72
+ .values({ field: fieldType.name, leafId, lang: dbLang, dataType: fieldType.dataType, val })
73
+ .orUpdate(["dataType", "val"], ["field", "leafId", "lang"], {
74
+ skipUpdateIfNoValuesChanged: true,
75
+ })
76
+ .execute();
77
+ }
78
+ }
79
+ async function saveTextFieldValue(cn, options) {
80
+ const { leafId, fieldType, value } = options;
81
+ const dbLang = (0, _fields_helpers_1.langIfSection)(options.lang, fieldType) ?? context_1.dbAnyLang;
82
+ const val = fieldValueToDbString(value, fieldType.dataType);
83
+ if (val === undefined) {
84
+ const query = cn
85
+ .createQueryBuilder()
86
+ .delete()
87
+ .from("PaFieldText")
88
+ .where("field = :field", { field: fieldType.name })
89
+ .andWhere("leafId = :leafId", { leafId })
90
+ .andWhere("lang = :lang", { lang: dbLang });
91
+ await query.execute();
92
+ }
93
+ else {
94
+ let excerpt;
95
+ if ((0, anywhere_lib_1.isFTextFieldType)(fieldType) && fieldType.useAsExcerpt) {
96
+ const html = fieldType.dataType === "quillDelta"
97
+ ? (0, quill_delta_1.convertQuillDeltaToHtml)(value?.delta)
98
+ : (0, data_formatters_lib_1.strVal)(value);
99
+ const plainText = (0, html_helpers_1.stripHtmlTags)(html);
100
+ excerpt = (0, excerpt_helpers_1.truncExcerptToWord)(plainText, 299);
101
+ }
102
+ await cn
103
+ .createQueryBuilder()
104
+ .insert()
105
+ .into("PaFieldText")
106
+ .values({
107
+ field: fieldType.name,
108
+ leafId,
109
+ lang: dbLang,
110
+ dataType: fieldType.dataType,
111
+ val,
112
+ excerpt,
113
+ })
114
+ .orUpdate(["dataType", "val", "excerpt"], ["field", "leafId", "lang"], {
115
+ skipUpdateIfNoValuesChanged: true,
116
+ })
117
+ .execute();
118
+ }
119
+ }
120
+ function fieldValueToDbString(value, dataType) {
121
+ if (value === null || value === undefined)
122
+ return undefined;
123
+ if (dataType === "string")
124
+ return (0, data_formatters_lib_1.strVal)(value);
125
+ if (dataType === "number")
126
+ return String((0, data_formatters_lib_1.nbVal)(value));
127
+ if (dataType === "boolean")
128
+ return (0, data_formatters_lib_1.boolVal)(value) ? "1" : "0";
129
+ if (dataType === "json")
130
+ return JSON.stringify(value);
131
+ if (dataType === "quillDelta")
132
+ return JSON.stringify(value.delta);
133
+ throw new Error(`invalid dataType '${dataType}'`);
134
+ }
135
+ //# sourceMappingURL=save-fields.queries.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"save-fields.queries.js","sourceRoot":"","sources":["../../../../src/modules/core/fields/save-fields.queries.ts"],"names":[],"mappings":";;;AAAA,2CAAqD;AACrD,oEAAoE;AACpE,yDAOgC;AAEhC,oEAAkE;AAClE,2DAAgF;AAChF,8CAA6C;AAC7C,sEAAsE;AAEtE,uDAAkD;AAElD,+CAAwD;AAExD,SAAgB,gBAAgB,CAAC,OAAe;IAC9C,IAAI,CAAC;QACH,OAAO,IAAA,wBAAS,EAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;IACxC,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,4BAAmB,CAAC,qBAAqB,CAAC,CAAC;IACvD,CAAC;AACH,CAAC;AAND,4CAMC;AAEM,KAAK,UAAU,eAAe,CACnC,WAAqE,EACrE,EACE,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,MAAM,GAMP;IAED,MAAM,UAAU,GAAG,IAAA,4BAAa,EAAC,WAAW,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IACnE,MAAM,UAAU,GAAG,UAAU,CAAC,MAAM,IAAI,EAAE,CAAC;IAC3C,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,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Q,EAAE,SAAS,CAAC,QAAQ;YAC5B,GAAG;YACH,OAAO;SACR,CAAC;aACD,QAAQ,CAAC,CAAC,UAAU,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE;YACrE,2BAA2B,EAAE,IAAI;SAClC,CAAC;aACD,OAAO,EAAE,CAAC;IACf,CAAC;AACH,CAAC;AAED,SAAS,oBAAoB,CAAC,KAAc,EAAE,QAAuB;IACnE,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC5D,IAAI,QAAQ,KAAK,QAAQ;QAAE,OAAO,IAAA,4BAAM,EAAC,KAAK,CAAC,CAAC;IAChD,IAAI,QAAQ,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC,IAAA,2BAAK,EAAC,KAAK,CAAC,CAAC,CAAC;IACvD,IAAI,QAAQ,KAAK,SAAS;QAAE,OAAO,IAAA,6BAAO,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;IAC9D,IAAI,QAAQ,KAAK,MAAM;QAAE,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACtD,IAAI,QAAQ,KAAK,YAAY;QAAE,OAAO,IAAI,CAAC,SAAS,CAAE,KAAa,CAAC,KAAK,CAAC,CAAC;IAC3E,MAAM,IAAI,KAAK,CAAC,qBAAqB,QAAQ,GAAG,CAAC,CAAC;AACpD,CAAC"}
@@ -0,0 +1,9 @@
1
+ export declare class LeafEntity {
2
+ id: string;
3
+ leafType: string;
4
+ parentId?: string;
5
+ relativeId: string;
6
+ depth: number;
7
+ publishDate?: Date;
8
+ idToString(): void;
9
+ }
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.LeafEntity = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ let LeafEntity = class LeafEntity {
15
+ id;
16
+ leafType;
17
+ parentId;
18
+ relativeId;
19
+ depth;
20
+ publishDate;
21
+ idToString() {
22
+ this.id = this.id?.toString();
23
+ this.parentId = this?.parentId?.toString();
24
+ }
25
+ };
26
+ exports.LeafEntity = LeafEntity;
27
+ __decorate([
28
+ (0, typeorm_1.PrimaryGeneratedColumn)("increment", { type: "bigint" }),
29
+ __metadata("design:type", String)
30
+ ], LeafEntity.prototype, "id", void 0);
31
+ __decorate([
32
+ (0, typeorm_1.Column)({ type: "varchar", length: 100 }),
33
+ __metadata("design:type", String)
34
+ ], LeafEntity.prototype, "leafType", void 0);
35
+ __decorate([
36
+ (0, typeorm_1.Column)({ type: "bigint", nullable: true }),
37
+ __metadata("design:type", String)
38
+ ], LeafEntity.prototype, "parentId", void 0);
39
+ __decorate([
40
+ (0, typeorm_1.Column)({ type: "varchar", length: 36 }),
41
+ __metadata("design:type", String)
42
+ ], LeafEntity.prototype, "relativeId", void 0);
43
+ __decorate([
44
+ (0, typeorm_1.Column)({ type: "smallint" }),
45
+ __metadata("design:type", Number)
46
+ ], LeafEntity.prototype, "depth", void 0);
47
+ __decorate([
48
+ (0, typeorm_1.Column)({ type: "datetime", nullable: true }),
49
+ __metadata("design:type", Date)
50
+ ], LeafEntity.prototype, "publishDate", void 0);
51
+ __decorate([
52
+ (0, typeorm_1.AfterLoad)(),
53
+ __metadata("design:type", Function),
54
+ __metadata("design:paramtypes", []),
55
+ __metadata("design:returntype", void 0)
56
+ ], LeafEntity.prototype, "idToString", null);
57
+ exports.LeafEntity = LeafEntity = __decorate([
58
+ (0, typeorm_1.Entity)("PaLeaf"),
59
+ (0, typeorm_1.Unique)(["parentId", "relativeId"])
60
+ ], LeafEntity);
61
+ //# sourceMappingURL=leaf.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"leaf.model.js","sourceRoot":"","sources":["../../../../src/modules/core/leaf/leaf.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAoF;AAI7E,IAAM,UAAU,GAAhB,MAAM,UAAU;IAErB,EAAE,CAAU;IAGZ,QAAQ,CAAU;IAGlB,QAAQ,CAAU;IAGlB,UAAU,CAAU;IAGpB,KAAK,CAAU;IAGf,WAAW,CAAQ;IAGnB,UAAU;QACR,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,EAAE,QAAQ,EAAE,CAAC;QAC9B,IAAI,CAAC,QAAQ,GAAG,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;IAC7C,CAAC;CACF,CAAA;AAxBY,gCAAU;AAErB;IADC,IAAA,gCAAsB,EAAC,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;;sCAC5C;AAGZ;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;;4CACvB;AAGlB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACzB;AAGlB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;;8CACpB;AAGpB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;;yCACd;AAGf;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BAC/B,IAAI;+CAAC;AAGnB;IADC,IAAA,mBAAS,GAAE;;;;4CAIX;qBAvBU,UAAU;IAFtB,IAAA,gBAAM,EAAC,QAAQ,CAAC;IAChB,IAAA,gBAAM,EAAC,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;GACtB,UAAU,CAwBtB"}
@@ -0,0 +1,2 @@
1
+ export declare class LeafModule {
2
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.LeafModule = void 0;
10
+ const common_1 = require("@nestjs/common");
11
+ const leaf_resolver_1 = require("./leaf.resolver");
12
+ const leaf_resolver_extend_1 = require("./leaf.resolver.extend");
13
+ let LeafModule = class LeafModule {
14
+ };
15
+ exports.LeafModule = LeafModule;
16
+ exports.LeafModule = LeafModule = __decorate([
17
+ (0, common_1.Module)({
18
+ providers: [leaf_resolver_1.LeafResolver, leaf_resolver_extend_1.ExtendSectionWrapWithLeafResolver],
19
+ })
20
+ ], LeafModule);
21
+ //# sourceMappingURL=leaf.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"leaf.module.js","sourceRoot":"","sources":["../../../../src/modules/core/leaf/leaf.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,mDAA+C;AAC/C,iEAA2E;AAKpE,IAAM,UAAU,GAAhB,MAAM,UAAU;CAAG,CAAA;AAAb,gCAAU;qBAAV,UAAU;IAHtB,IAAA,eAAM,EAAC;QACN,SAAS,EAAE,CAAC,4BAAY,EAAE,wDAAiC,CAAC;KAC7D,CAAC;GACW,UAAU,CAAG"}
@@ -0,0 +1,21 @@
1
+ import { DocumentSchema, SiteSchema } from "@paroicms/anywhere-lib";
2
+ import { Tracker } from "@paroicms/server-lib";
3
+ import { EntityManager } from "typeorm";
4
+ import { SiteContext } from "../../../site-context/site-context.types";
5
+ import { TermFlagObjectType } from "../term-flag/term-flag.schema";
6
+ import { LeafEntity } from "./leaf.model";
7
+ export declare function getLeafTypeOf(siteContext: Pick<SiteContext, "mainCn">, leafId: string): Promise<string>;
8
+ export declare function getDocumentSchemaOf(siteContext: Pick<SiteContext, "mainCn" | "siteSchema">, leafId: string): Promise<DocumentSchema>;
9
+ export declare function findOneLeaf({ mainCn }: SiteContext, id: string): Promise<LeafEntity>;
10
+ export declare function setLeafPublishDate(siteContext: SiteContext, { leafId, publishDate }: {
11
+ leafId: string;
12
+ publishDate: string;
13
+ }): Promise<LeafEntity>;
14
+ export declare function flaggedWith({ mainCn }: SiteContext, flaggedId: string): Promise<TermFlagObjectType[]>;
15
+ export declare function createLeaf(siteSchema: SiteSchema, cn: EntityManager, { parentId, depth, leafType, }: {
16
+ parentId?: string;
17
+ depth?: number;
18
+ leafType: string;
19
+ }): Promise<LeafEntity>;
20
+ export declare function getLeafDepth(siteContext: Pick<SiteContext, "mainCn">, tracker: Tracker, leafId: string): Promise<number>;
21
+ export declare function countLeafChildrenOf(siteContext: Pick<SiteContext, "mainCn">, parendId: string): Promise<number>;
@@ -0,0 +1,143 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.countLeafChildrenOf = exports.getLeafDepth = exports.createLeaf = exports.flaggedWith = exports.setLeafPublishDate = exports.findOneLeaf = exports.getDocumentSchemaOf = exports.getLeafTypeOf = void 0;
4
+ const common_1 = require("@nestjs/common");
5
+ const data_formatters_lib_1 = require("@paroi/data-formatters-lib");
6
+ const anywhere_lib_1 = require("@paroicms/anywhere-lib");
7
+ const data_format_1 = require("../../../common/data-format");
8
+ const text_cache_1 = require("../../../common/text-cache");
9
+ const relative_id_helper_1 = require("../../../helpers/relative-id-helper");
10
+ const ddl_migration_1 = require("../../../site-context/db-init/ddl-migration");
11
+ const leaf_model_1 = require("./leaf.model");
12
+ async function getLeafTypeOf(siteContext, leafId) {
13
+ const row = await siteContext.mainCn
14
+ .createQueryBuilder()
15
+ .select("l.leafType", "leafType")
16
+ .from("PaLeaf", "l")
17
+ .where("l.id = :leafId", { leafId })
18
+ .getRawOne();
19
+ if (!row)
20
+ throw new common_1.NotFoundException(`cannot find leaf '${leafId}'`);
21
+ return (0, data_formatters_lib_1.strVal)(row.leafType);
22
+ }
23
+ exports.getLeafTypeOf = getLeafTypeOf;
24
+ async function getDocumentSchemaOf(siteContext, leafId) {
25
+ const leafType = await getLeafTypeOf(siteContext, leafId);
26
+ const documentType = siteContext.siteSchema.documentTypes[leafType];
27
+ if (!documentType)
28
+ throw new Error(`unknown document type '${leafType}'`);
29
+ return documentType;
30
+ }
31
+ exports.getDocumentSchemaOf = getDocumentSchemaOf;
32
+ async function findOneLeaf({ mainCn }, id) {
33
+ const leaf = await mainCn.getRepository(leaf_model_1.LeafEntity).findOne({
34
+ where: {
35
+ id,
36
+ },
37
+ });
38
+ if (!leaf)
39
+ throw new common_1.NotFoundException(`can't find leaf ${id}`);
40
+ return leaf;
41
+ }
42
+ exports.findOneLeaf = findOneLeaf;
43
+ async function setLeafPublishDate(siteContext, { leafId, publishDate }) {
44
+ await siteContext.mainCn.getRepository(leaf_model_1.LeafEntity).update(leafId, { publishDate });
45
+ await (0, text_cache_1.invalidateMultipleDocumentsInCache)(siteContext, { leafId, fully: true });
46
+ return await findOneLeaf(siteContext, leafId);
47
+ }
48
+ exports.setLeafPublishDate = setLeafPublishDate;
49
+ async function flaggedWith({ mainCn }, flaggedId) {
50
+ const rows = await mainCn
51
+ .createQueryBuilder()
52
+ .select("f.lead", "lead")
53
+ .addSelect("f.termId", "termId")
54
+ .addSelect("l2.leafType", "parentLeafType")
55
+ .from("PaTermFlag", "f")
56
+ .innerJoin("PaLeaf", "l1", "l1.id = f.termId")
57
+ .innerJoin("PaLeaf", "l2", "l2.id = l1.parentId")
58
+ .where("f.flaggedId = :flaggedId", { flaggedId })
59
+ .getRawMany();
60
+ return (0, data_formatters_lib_1.listVal)(rows, data_format_1.formatTermFlagObjectType);
61
+ }
62
+ exports.flaggedWith = flaggedWith;
63
+ async function createLeaf(siteSchema, cn, { parentId, depth, leafType, }) {
64
+ const leafManager = cn.getRepository(leaf_model_1.LeafEntity);
65
+ const documentSchema = siteSchema.documentTypes[leafType];
66
+ let leafDepth = depth;
67
+ if (leafDepth === undefined) {
68
+ if (!parentId)
69
+ throw new Error("parentId not provided");
70
+ const parentLeaf = await leafManager.findOneOrFail({
71
+ where: {
72
+ id: parentId,
73
+ },
74
+ });
75
+ leafDepth = parentLeaf.depth + 1;
76
+ if (!isLeafTypeChildOf(siteSchema, { leafType, parentLeafType: parentLeaf.leafType })) {
77
+ throw new common_1.BadRequestException(`invalid parentLeafType '${parentLeaf.leafType}'`);
78
+ }
79
+ }
80
+ const makeRelativeId = provideRelativeIdGenerator(documentSchema?.kind === "classic" ? documentSchema.relativeIdGenerator : undefined);
81
+ let attempt = 0;
82
+ while (true) {
83
+ const newRelativeId = makeRelativeId();
84
+ try {
85
+ return await leafManager.save({
86
+ parentId,
87
+ relativeId: newRelativeId,
88
+ depth: leafDepth,
89
+ leafType,
90
+ publishDate: new Date().toISOString(),
91
+ });
92
+ }
93
+ catch (err) {
94
+ if (++attempt === 20)
95
+ throw err;
96
+ }
97
+ }
98
+ }
99
+ exports.createLeaf = createLeaf;
100
+ function provideRelativeIdGenerator(rim) {
101
+ const makerName = rim?.[0] ?? "default";
102
+ if (makerName === "default") {
103
+ const size = rim ? (0, data_formatters_lib_1.nbVal)(rim[1], { varName: "relativeId" }) : undefined;
104
+ return () => (0, relative_id_helper_1.makeDefaultRelativeId)({ size });
105
+ }
106
+ throw new Error(`Invalid relativeId maker name '${makerName}'`);
107
+ }
108
+ async function getLeafDepth(siteContext, tracker, leafId) {
109
+ const row = await siteContext.mainCn
110
+ .createQueryBuilder()
111
+ .select("l.depth", "depth")
112
+ .from("PaLeaf", "l")
113
+ .where("l.id = :leafId", { leafId })
114
+ .getRawOne();
115
+ tracker.trackAccess(ddl_migration_1.dbSchemaName, "PaLeaf", "read");
116
+ if (!row)
117
+ throw new common_1.NotFoundException(`cannot find leaf '${leafId}'`);
118
+ return (0, data_formatters_lib_1.nbVal)(row.depth);
119
+ }
120
+ exports.getLeafDepth = getLeafDepth;
121
+ async function countLeafChildrenOf(siteContext, parendId) {
122
+ const row = await siteContext.mainCn
123
+ .createQueryBuilder()
124
+ .select("count(1)", "cnt")
125
+ .from("PaLeaf", "l")
126
+ .where("l.parentId = :parendId", { parendId })
127
+ .getRawOne();
128
+ return (0, data_formatters_lib_1.nbVal)(row?.cnt);
129
+ }
130
+ exports.countLeafChildrenOf = countLeafChildrenOf;
131
+ function isLeafTypeChildOf(siteSchema, { parentLeafType, leafType }) {
132
+ const parentSchema = (0, anywhere_lib_1.getDocumentTypeByLeafType)(siteSchema, parentLeafType);
133
+ if (siteSchema.documentTypes[leafType]) {
134
+ const child = siteSchema.documentTypes[leafType];
135
+ return parentSchema.children?.includes(child.leafType) ?? false;
136
+ }
137
+ for (const listType of parentSchema.partLists ?? []) {
138
+ if (listType.partLeafTypes.includes(leafType))
139
+ return true;
140
+ }
141
+ return false;
142
+ }
143
+ //# sourceMappingURL=leaf.queries.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"leaf.queries.js","sourceRoot":"","sources":["../../../../src/modules/core/leaf/leaf.queries.ts"],"names":[],"mappings":";;;AAAA,2CAAwE;AACxE,oEAAoE;AACpE,yDAMgC;AA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AAG,EAAE,GAAG,CAAC,CAAC;AACzB,CAAC;AAXD,kDAWC;AAED,SAAS,iBAAiB,CACxB,UAAsB,EACtB,EAAE,cAAc,EAAE,QAAQ,EAAgD;IAE1E,MAAM,YAAY,GAAG,IAAA,wCAAyB,EAAC,UAAU,EAAE,cAAc,CAAC,CAAC;IAC3E,IAAI,UAAU,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,CAAC;QACvC,MAAM,KAAK,GAAG,UAAU,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;QACjD,OAAO,YAAY,CAAC,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC;IAClE,CAAC;IAED,KAAK,MAAM,QAAQ,IAAI,YAAY,CAAC,SAAS,IAAI,EAAE,EAAE,CAAC;QACpD,IAAI,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,QAAQ,CAAC;YAAE,OAAO,IAAI,CAAC;IAC7D,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { GraphqlContext } from "../../graphql.types";
2
+ import { TermFlagObjectType } from "../term-flag/term-flag.schema";
3
+ import { LeafObjectType } from "./leaf.schema";
4
+ export declare class LeafResolver {
5
+ flaggedWith({ fqdn }: GraphqlContext, { id }: LeafObjectType): Promise<TermFlagObjectType[]>;
6
+ planned({ publishDate }: LeafObjectType): boolean;
7
+ setLeafPublishDate({ fqdn }: GraphqlContext, leafId: string, publishDate: Date): Promise<LeafObjectType>;
8
+ reorderLeafItems({ fqdn }: GraphqlContext, leafIds: string[], parentLeafId: string, listName: string): Promise<string[]>;
9
+ }
@@ -0,0 +1,6 @@
1
+ import { GraphqlContext } from "../../graphql.types";
2
+ import { SectionWrapObjectType } from "../section/section.schema";
3
+ import { LeafObjectType } from "./leaf.schema";
4
+ export declare class ExtendSectionWrapWithLeafResolver {
5
+ leaf({ fqdn }: GraphqlContext, { leafId }: SectionWrapObjectType): Promise<LeafObjectType>;
6
+ }
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.ExtendSectionWrapWithLeafResolver = void 0;
16
+ const common_1 = require("@nestjs/common");
17
+ const graphql_1 = require("@nestjs/graphql");
18
+ const data_format_1 = require("../../../common/data-format");
19
+ const site_context_1 = require("../../../site-context/site-context");
20
+ const jwt_auth_guard_1 = require("../auth/jwt.auth.guard");
21
+ const section_schema_1 = require("../section/section.schema");
22
+ const leaf_queries_1 = require("./leaf.queries");
23
+ const leaf_schema_1 = require("./leaf.schema");
24
+ let ExtendSectionWrapWithLeafResolver = class ExtendSectionWrapWithLeafResolver {
25
+ async leaf({ fqdn }, { leafId }) {
26
+ return (0, data_format_1.leafEntityToObjectType)(await (0, leaf_queries_1.findOneLeaf)(await (0, site_context_1.getSiteContext)(fqdn), leafId));
27
+ }
28
+ };
29
+ exports.ExtendSectionWrapWithLeafResolver = ExtendSectionWrapWithLeafResolver;
30
+ __decorate([
31
+ (0, graphql_1.ResolveField)(() => leaf_schema_1.LeafObjectType),
32
+ __param(0, (0, graphql_1.Context)()),
33
+ __param(1, (0, graphql_1.Parent)()),
34
+ __metadata("design:type", Function),
35
+ __metadata("design:paramtypes", [Object, section_schema_1.SectionWrapObjectType]),
36
+ __metadata("design:returntype", Promise)
37
+ ], ExtendSectionWrapWithLeafResolver.prototype, "leaf", null);
38
+ exports.ExtendSectionWrapWithLeafResolver = ExtendSectionWrapWithLeafResolver = __decorate([
39
+ (0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard),
40
+ (0, graphql_1.Resolver)(() => section_schema_1.SectionWrapObjectType)
41
+ ], ExtendSectionWrapWithLeafResolver);
42
+ //# sourceMappingURL=leaf.resolver.extend.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"leaf.resolver.extend.js","sourceRoot":"","sources":["../../../../src/modules/core/leaf/leaf.resolver.extend.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA2C;AAC3C,6CAA0E;AAC1E,6DAAqE;AACrE,qEAAoE;AAEpE,2DAAsD;AACtD,8DAAkE;AAClE,iDAA6C;AAC7C,+CAA+C;AAIxC,IAAM,iCAAiC,GAAvC,MAAM,iCAAiC;IAEtC,AAAN,KAAK,CAAC,IAAI,CACG,EAAE,IAAI,EAAkB,EAEnC,EAAE,MAAM,EAAyB;QAEjC,OAAO,IAAA,oCAAsB,EAAC,MAAM,IAAA,0BAAW,EAAC,MAAM,IAAA,6BAAc,EAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACvF,CAAC;CACF,CAAA;AATY,8EAAiC;AAEtC;IADL,IAAA,sBAAY,EAAC,GAAG,EAAE,CAAC,4BAAc,CAAC;IAEhC,WAAA,IAAA,iBAAO,GAAE,CAAA;IACT,WAAA,IAAA,gBAAM,GAAE,CAAA;;6CACG,sCAAqB;;6DAGlC;4CARU,iCAAiC;IAF7C,IAAA,kBAAS,EAAC,6BAAY,CAAC;IACvB,IAAA,kBAAQ,EAAC,GAAG,EAAE,CAAC,sCAAqB,CAAC;GACzB,iCAAiC,CAS7C"}
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.LeafResolver = void 0;
16
+ const common_1 = require("@nestjs/common");
17
+ const graphql_1 = require("@nestjs/graphql");
18
+ const data_format_1 = require("../../../common/data-format");
19
+ const site_context_1 = require("../../../site-context/site-context");
20
+ const jwt_auth_guard_1 = require("../auth/jwt.auth.guard");
21
+ const leaf_item_queries_1 = require("../leaf-item/leaf-item.queries");
22
+ const term_flag_schema_1 = require("../term-flag/term-flag.schema");
23
+ const leaf_queries_1 = require("./leaf.queries");
24
+ const leaf_schema_1 = require("./leaf.schema");
25
+ let LeafResolver = class LeafResolver {
26
+ async flaggedWith({ fqdn }, { id }) {
27
+ return await (0, leaf_queries_1.flaggedWith)(await (0, site_context_1.getSiteContext)(fqdn), id);
28
+ }
29
+ planned({ publishDate }) {
30
+ if (!publishDate)
31
+ return false;
32
+ return new Date(publishDate).getTime() > Date.now();
33
+ }
34
+ async setLeafPublishDate({ fqdn }, leafId, publishDate) {
35
+ return (0, data_format_1.leafEntityToObjectType)(await (0, leaf_queries_1.setLeafPublishDate)(await (0, site_context_1.getSiteContext)(fqdn), {
36
+ leafId,
37
+ publishDate: publishDate.toISOString(),
38
+ }));
39
+ }
40
+ async reorderLeafItems({ fqdn }, leafIds, parentLeafId, listName) {
41
+ const siteContext = await (0, site_context_1.getSiteContext)(fqdn);
42
+ return (0, leaf_item_queries_1.reorderLeafItems)(siteContext, leafIds, parentLeafId, listName);
43
+ }
44
+ };
45
+ exports.LeafResolver = LeafResolver;
46
+ __decorate([
47
+ (0, graphql_1.ResolveField)(() => [term_flag_schema_1.TermFlagObjectType]),
48
+ __param(0, (0, graphql_1.Context)()),
49
+ __param(1, (0, graphql_1.Parent)()),
50
+ __metadata("design:type", Function),
51
+ __metadata("design:paramtypes", [Object, leaf_schema_1.LeafObjectType]),
52
+ __metadata("design:returntype", Promise)
53
+ ], LeafResolver.prototype, "flaggedWith", null);
54
+ __decorate([
55
+ (0, graphql_1.ResolveField)(() => Boolean),
56
+ __param(0, (0, graphql_1.Parent)()),
57
+ __metadata("design:type", Function),
58
+ __metadata("design:paramtypes", [leaf_schema_1.LeafObjectType]),
59
+ __metadata("design:returntype", Boolean)
60
+ ], LeafResolver.prototype, "planned", null);
61
+ __decorate([
62
+ (0, graphql_1.Mutation)(() => leaf_schema_1.LeafObjectType),
63
+ __param(0, (0, graphql_1.Context)()),
64
+ __param(1, (0, graphql_1.Args)("leafId", { type: () => graphql_1.ID })),
65
+ __param(2, (0, graphql_1.Args)("publishDate", { type: () => Date })),
66
+ __metadata("design:type", Function),
67
+ __metadata("design:paramtypes", [Object, String, Date]),
68
+ __metadata("design:returntype", Promise)
69
+ ], LeafResolver.prototype, "setLeafPublishDate", null);
70
+ __decorate([
71
+ (0, graphql_1.Mutation)(() => [String]),
72
+ __param(0, (0, graphql_1.Context)()),
73
+ __param(1, (0, graphql_1.Args)("leafIds", { type: () => [String] })),
74
+ __param(2, (0, graphql_1.Args)("parentLeafId", { type: () => String })),
75
+ __param(3, (0, graphql_1.Args)("listName", { type: () => String })),
76
+ __metadata("design:type", Function),
77
+ __metadata("design:paramtypes", [Object, Array, String, String]),
78
+ __metadata("design:returntype", Promise)
79
+ ], LeafResolver.prototype, "reorderLeafItems", null);
80
+ exports.LeafResolver = LeafResolver = __decorate([
81
+ (0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard),
82
+ (0, graphql_1.Resolver)(() => leaf_schema_1.LeafObjectType)
83
+ ], LeafResolver);
84
+ //# sourceMappingURL=leaf.resolver.js.map