@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,147 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.loadOrInsertSiteIds = void 0;
4
+ const data_formatters_lib_1 = require("@paroi/data-formatters-lib");
5
+ const anywhere_lib_1 = require("@paroicms/anywhere-lib");
6
+ const document_model_1 = require("../../modules/core/document/document.model");
7
+ const leaf_queries_1 = require("../../modules/core/leaf/leaf.queries");
8
+ const section_model_1 = require("../../modules/core/section/section.model");
9
+ const site_schema_helpers_1 = require("../../site-schema/site-schema-helpers");
10
+ async function loadOrInsertSiteIds(mainCn, siteSchema) {
11
+ let siteLeafId = await loadSiteLeafId(mainCn);
12
+ if (siteLeafId === undefined) {
13
+ await populateInitialData(mainCn, siteSchema);
14
+ siteLeafId = await loadSiteLeafId(mainCn);
15
+ if (siteLeafId === undefined)
16
+ throw new Error("should have siteLeafId here");
17
+ }
18
+ const { home: routingPointIds } = await loadChildRoutingPointIds(mainCn, siteSchema, siteLeafId, [
19
+ siteSchema.documentTypes.home,
20
+ ]);
21
+ return {
22
+ siteLeafId,
23
+ homeIds: routingPointIds,
24
+ };
25
+ }
26
+ exports.loadOrInsertSiteIds = loadOrInsertSiteIds;
27
+ async function loadSiteLeafId(cn) {
28
+ const rows = await cn
29
+ .createQueryBuilder()
30
+ .select("l.id", "id")
31
+ .from("PaLeaf", "l")
32
+ .where("l.depth = -1")
33
+ .andWhere("l.leafType = :leafType", { leafType: site_schema_helpers_1.siteLeafType })
34
+ .getRawMany();
35
+ if (rows.length === 0)
36
+ return;
37
+ if (rows.length !== 1)
38
+ throw new Error(`it should not exist '${rows.length}' site leafs`);
39
+ const [row] = rows;
40
+ return (0, data_formatters_lib_1.strVal)(row.id);
41
+ }
42
+ async function loadChildRoutingPointIds(cn, siteSchema, parentLeafId, childTypes) {
43
+ const rows = await cn
44
+ .createQueryBuilder()
45
+ .select("s.leafId", "leafId")
46
+ .addSelect("s.lang", "lang")
47
+ .addSelect("l.leafType", "leafType")
48
+ .from("PaSection", "s")
49
+ .innerJoin("PaLeaf", "l", "l.id = s.leafId")
50
+ .where("l.parentId = :parentId", { parentId: parentLeafId })
51
+ .andWhere("l.leafType in (:...leafTypes)", { leafTypes: childTypes.map((t) => t.leafType) })
52
+ .andWhere("s.lang in (:...langs)", { langs: siteSchema.langs })
53
+ .getRawMany();
54
+ const formattedRows = rows.map((row) => ({
55
+ leafId: (0, data_formatters_lib_1.strVal)(row.leafId),
56
+ lang: (0, data_formatters_lib_1.strVal)(row.lang),
57
+ leafType: (0, data_formatters_lib_1.strVal)(row.leafType),
58
+ }));
59
+ const map = new Map();
60
+ for (const row of formattedRows) {
61
+ let ids = map.get(row.leafType);
62
+ if (!ids) {
63
+ ids = {
64
+ leafId: row.leafId,
65
+ leafType: row.leafType,
66
+ sectionIds: {},
67
+ };
68
+ map.set(row.leafType, ids);
69
+ }
70
+ ids.sectionIds[row.lang] = (0, anywhere_lib_1.encodeSectionId)(row);
71
+ }
72
+ for (const childType of childTypes) {
73
+ const ids = map.get(childType.leafType);
74
+ if (!ids) {
75
+ throw new Error(`missing document-type '${childType.leafType}' in the database, for parent '${parentLeafId}'`);
76
+ }
77
+ const langs = Object.keys(ids.sectionIds);
78
+ if (langs.length !== siteSchema.langs.length) {
79
+ throw new Error(`missing section(s) for '${childType.leafType}' in the database, found langs '${langs.join(",")}'`);
80
+ }
81
+ const subTypes = childRoutingPointsOf(siteSchema, childType);
82
+ if (subTypes.length > 0) {
83
+ ids.children = await loadChildRoutingPointIds(cn, siteSchema, ids.leafId, subTypes);
84
+ }
85
+ }
86
+ return Object.fromEntries(map);
87
+ }
88
+ function childRoutingPointsOf(siteSchema, documentType) {
89
+ const leafTypes = documentType.children ?? [];
90
+ return leafTypes
91
+ .map((leafType) => {
92
+ const documentType = siteSchema.documentTypes[leafType];
93
+ if (!documentType)
94
+ throw new Error(`missing document type '${leafType}'`);
95
+ return documentType;
96
+ })
97
+ .filter((t) => t.kind === "routingPoint");
98
+ }
99
+ async function populateInitialData(mainCn, siteSchema) {
100
+ const homeLeafId = await mainCn.transaction(async (cn) => {
101
+ const siteLeaf = await (0, leaf_queries_1.createLeaf)(siteSchema, cn, {
102
+ depth: -1,
103
+ leafType: site_schema_helpers_1.siteLeafType,
104
+ });
105
+ const documentType = siteSchema.documentTypes.home;
106
+ const homeLeaf = await (0, leaf_queries_1.createLeaf)(siteSchema, cn, {
107
+ depth: 0,
108
+ leafType: documentType.leafType,
109
+ parentId: siteLeaf.id,
110
+ });
111
+ await populateRoutingPointSections(cn, {
112
+ leafId: homeLeaf.id,
113
+ langs: siteSchema.langs,
114
+ withDocument: documentType.withData,
115
+ });
116
+ await populateChildRoutingPoints(cn, siteSchema, documentType, homeLeaf.id, 1);
117
+ return homeLeaf.id;
118
+ });
119
+ return homeLeafId;
120
+ }
121
+ async function populateChildRoutingPoints(cn, siteSchema, parentType, parentLeafId, childDepth) {
122
+ for (const leafType of parentType.children ?? []) {
123
+ const documentType = (0, anywhere_lib_1.getDocumentTypeByLeafType)(siteSchema, leafType);
124
+ if (documentType.kind !== "routingPoint")
125
+ continue;
126
+ const leaf = await (0, leaf_queries_1.createLeaf)(siteSchema, cn, {
127
+ parentId: parentLeafId,
128
+ depth: childDepth,
129
+ leafType,
130
+ });
131
+ await populateRoutingPointSections(cn, {
132
+ leafId: leaf.id,
133
+ langs: siteSchema.langs,
134
+ withDocument: documentType.withData,
135
+ });
136
+ await populateChildRoutingPoints(cn, siteSchema, documentType, leaf.id, childDepth + 1);
137
+ }
138
+ }
139
+ async function populateRoutingPointSections(cn, { leafId, langs, withDocument }) {
140
+ for (const lang of langs) {
141
+ await cn.getRepository(section_model_1.SectionEntity).save({ lang, leafId, ready: true });
142
+ if (withDocument) {
143
+ await cn.getRepository(document_model_1.DocumentEntity).save({ lang, leafId });
144
+ }
145
+ }
146
+ }
147
+ //# sourceMappingURL=init-routing-points.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init-routing-points.js","sourceRoot":"","sources":["../../../src/site-context/db-init/init-routing-points.ts"],"names":[],"mappings":";;;AAAA,oEAAoD;AACpD,yDAOgC;AAEhC,+EAA4E;AAC5E,uEAAkE;AAClE,4EAAyE;AACzE,+EAAqE;AAG9D,KAAK,UAAU,mBAAmB,CACvC,MAAkB,EAClB,UAAsB;IAEtB,IAAI,UAAU,GAAG,MAAM,cAAc,CAAC,MAAM,CAAC,CAAC;IAC9C,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,MAAM,mBAAmB,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;QAC9C,UAAU,GAAG,MAAM,cAAc,CAAC,MAAM,CAAC,CAAC;QAC1C,IAAI,UAAU,KAAK,SAAS;YAAE,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;IAC/E,CAAC;IAED,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,GAAG,MAAM,wBAAwB,CAAC,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE;QAC/F,UAAU,CAAC,aAAa,CAAC,IAAI;KAC9B,CAAC,CAAC;IAEH,OAAO;QACL,UAAU;QACV,OAAO,EAAE,eAAe;KACzB,CAAC;AACJ,CAAC;AAnBD,kDAmBC;AAED,KAAK,UAAU,cAAc,CAAC,EAAc;IAC1C,MAAM,IAAI,GAAG,MAAM,EAAE;SAClB,kBAAkB,EAAE;SACpB,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC;SACpB,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC;SACnB,KAAK,CAAC,cAAc,CAAC;SACrB,QAAQ,CAAC,wBAAwB,EAAE,EAAE,QAAQ,EAAE,kCAAY,EAAE,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AM,EAAE,KAAK,EAAE,YAAY,EAA8D;IAE3F,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,EAAE,CAAC,aAAa,CAAC,6BAAa,CAAC,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QAC1E,IAAI,YAAY,EAAE,CAAC;YACjB,MAAM,EAAE,CAAC,aAAa,CAAC,+BAAc,CAAC,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;QAChE,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { SitePlace } from "../public.types";
2
+ import { SingleSiteConf, SitePackConf } from "../typeonly/configuration-types";
3
+ export interface SiteConf {
4
+ fqdn: string;
5
+ siteName: string;
6
+ version?: string;
7
+ siteDir: string;
8
+ dataDir: string;
9
+ cacheDir: string;
10
+ backupDir: string;
11
+ siteUrl: string;
12
+ loadedOnce: boolean;
13
+ }
14
+ export declare function createSiteConfsFromSingle(singleSiteConf: SingleSiteConf): Promise<Map<string, SiteConf>>;
15
+ export declare function loadSitePackConfs(sitePacks: SitePackConf[], sitePackPlaces?: {
16
+ [packName: string]: SitePlace[];
17
+ }): Promise<Map<string, SiteConf>>;
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.loadSitePackConfs = exports.createSiteConfsFromSingle = void 0;
4
+ const data_formatters_lib_1 = require("@paroi/data-formatters-lib");
5
+ const anywhere_lib_1 = require("@paroicms/anywhere-lib");
6
+ const promises_1 = require("fs/promises");
7
+ const path_1 = require("path");
8
+ const context_1 = require("../context");
9
+ async function createSiteConfsFromSingle(singleSiteConf) {
10
+ const { publicPort, https } = context_1.appConf.thisServer;
11
+ const { siteDir, dataDir, cacheDir, backupDir, fqdn } = singleSiteConf;
12
+ const protocol = https ? "https" : "http";
13
+ const siteUrl = `${protocol}://${fqdn}${publicPort ? `:${publicPort}` : ""}`;
14
+ const version = await getPackageVersionIfExists(siteDir);
15
+ const site = {
16
+ fqdn,
17
+ siteName: fqdn,
18
+ version,
19
+ siteDir,
20
+ dataDir,
21
+ cacheDir,
22
+ backupDir,
23
+ siteUrl,
24
+ loadedOnce: false,
25
+ };
26
+ const result = new Map();
27
+ result.set(site.fqdn, site);
28
+ return result;
29
+ }
30
+ exports.createSiteConfsFromSingle = createSiteConfsFromSingle;
31
+ async function loadSitePackConfs(sitePacks, sitePackPlaces) {
32
+ const result = new Map();
33
+ for (const pack of sitePacks) {
34
+ const siteConfs = pack.sitesDir
35
+ ? await readSiteConfsFromDirectory(pack.sitesDir, pack)
36
+ : createSiteConfsFromDependency(pack, sitePackPlaces?.[pack.packName]);
37
+ for (const site of siteConfs) {
38
+ if (result.has(site.fqdn))
39
+ throw new Error(`duplicated site '${site.fqdn}'`);
40
+ result.set(site.fqdn, site);
41
+ }
42
+ }
43
+ return result;
44
+ }
45
+ exports.loadSitePackConfs = loadSitePackConfs;
46
+ async function readSiteConfsFromDirectory(sitesDir, pack) {
47
+ const dirNames = await (0, promises_1.readdir)(sitesDir);
48
+ const result = [];
49
+ for (const dirName of dirNames) {
50
+ if (dirName === "index")
51
+ continue;
52
+ const siteDir = (0, path_1.resolve)(sitesDir, dirName);
53
+ const version = await getPackageVersionIfExists(siteDir);
54
+ result.push(makeSiteConf({ domain: dirName, siteDir, version }, pack));
55
+ }
56
+ return result;
57
+ }
58
+ async function getPackageVersionIfExists(dir) {
59
+ try {
60
+ const content = JSON.parse(await (0, promises_1.readFile)((0, path_1.join)(dir, "package.json"), "utf8"));
61
+ return (0, data_formatters_lib_1.strValOrUndef)(content.version);
62
+ }
63
+ catch {
64
+ }
65
+ }
66
+ function createSiteConfsFromDependency(pack, sitePlaces) {
67
+ if (!sitePlaces)
68
+ throw new Error(`missing 'sitesDir' or a place for pack '${pack.packName}'`);
69
+ return sitePlaces.map((place) => makeSiteConf(place, pack));
70
+ }
71
+ function makeSiteConf(place, pack) {
72
+ const { publicPort, https } = context_1.appConf.thisServer;
73
+ const { domain, siteDir, version } = place;
74
+ const fqdn = pack.serveAs === "fqdn" ? domain : `${toSubDomain(domain)}.${pack.parentDomain}`;
75
+ const protocol = https ? "https" : "http";
76
+ const siteUrl = `${protocol}://${fqdn}${publicPort ? `:${publicPort}` : ""}`;
77
+ const dataDir = (0, path_1.resolve)(pack.dataDir, domain);
78
+ const cacheDir = (0, path_1.resolve)(pack.cacheDir, domain);
79
+ const backupDir = (0, path_1.resolve)(pack.backupDir, domain);
80
+ return {
81
+ fqdn,
82
+ siteName: `${pack.packName}:${domain}`,
83
+ version,
84
+ siteDir,
85
+ dataDir,
86
+ cacheDir,
87
+ backupDir,
88
+ siteUrl,
89
+ loadedOnce: false,
90
+ };
91
+ }
92
+ function toSubDomain(dirName) {
93
+ let result = dirName;
94
+ if (result.startsWith("www.")) {
95
+ result = result.substring(4);
96
+ }
97
+ const extIndex = result.lastIndexOf(".");
98
+ if (extIndex !== -1) {
99
+ result = result.substring(0, extIndex);
100
+ }
101
+ return (0, anywhere_lib_1.generateSlug)(result).replaceAll(".", "-");
102
+ }
103
+ //# sourceMappingURL=site-conf.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"site-conf.js","sourceRoot":"","sources":["../../src/site-context/site-conf.ts"],"names":[],"mappings":";;;AAAA,oEAA2D;AAC3D,yDAAsD;AACtD,0CAAgD;AAChD,+BAAqC;AACrC,wCAAqC;AAmB9B,KAAK,UAAU,yBAAyB,CAC7C,cAA8B;IAE9B,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,iBAAO,CAAC,UAAU,CAAC;IACjD,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,cAAc,CAAC;IACvE,MAAM,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;IAC1C,MAA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,KAAK,CAAC,CAAC,EAAE,CAAC;QACpB,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;IACzC,CAAC;IAED,OAAO,IAAA,2BAAY,EAAC,MAAM,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AACnD,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { SiteConf } from "./site-conf";
2
+ import { SiteContext } from "./site-context.types";
3
+ export declare function getActiveSiteContexts(): IterableIterator<SiteContext>;
4
+ export declare function getSiteContext(fqdn: string): Promise<SiteContext>;
5
+ export declare function getSiteContext(fqdn: string, options: {
6
+ returnsUndef: true;
7
+ }): Promise<SiteContext | undefined>;
8
+ export declare const secureCreateSiteContext: typeof createSiteContext;
9
+ declare function createSiteContext(siteConf: SiteConf): Promise<SiteContext>;
10
+ export declare function unloadSiteContext(siteContext: SiteContext): Promise<void>;
11
+ export {};
@@ -0,0 +1,234 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.unloadSiteContext = exports.secureCreateSiteContext = exports.getSiteContext = exports.getActiveSiteContexts = void 0;
7
+ const common_1 = require("@nestjs/common");
8
+ const async_lib_1 = require("@paroi/async-lib");
9
+ const server_database_media_storage_1 = require("@paroicms/server-database-media-storage");
10
+ const server_image_cache_engine_1 = require("@paroicms/server-image-cache-engine");
11
+ const server_lib_1 = require("@paroicms/server-lib");
12
+ const server_text_cache_system_1 = require("@paroicms/server-text-cache-system");
13
+ const liquidjs_1 = require("liquidjs");
14
+ const path_1 = require("path");
15
+ const context_1 = require("../context");
16
+ const simple_i18n_1 = require("../helpers/simple-i18n");
17
+ const maintenance_task_1 = require("../maintenance/maintenance-task");
18
+ const format_date_1 = require("../modules/public-site/liquidjs-filters/format-date");
19
+ const format_number_1 = require("../modules/public-site/liquidjs-filters/format-number");
20
+ const info_filter_1 = require("../modules/public-site/liquidjs-filters/info-filter");
21
+ const inject_facebook_chat_1 = require("../modules/public-site/liquidjs-filters/inject-facebook-chat");
22
+ const inject_menu_items_data_1 = require("../modules/public-site/liquidjs-filters/inject-menu-items-data");
23
+ const make_excerpt_1 = require("../modules/public-site/liquidjs-filters/make-excerpt");
24
+ const obfuscate_1 = require("../modules/public-site/liquidjs-filters/obfuscate");
25
+ const open_graph_filter_1 = require("../modules/public-site/liquidjs-filters/open-graph-filter");
26
+ const translate_filter_1 = require("../modules/public-site/liquidjs-filters/translate-filter");
27
+ const render_1 = __importDefault(require("../modules/public-site/liquidjs-rendering/render-clone/render"));
28
+ const get_page_tag_1 = require("../modules/public-site/liquidjs-tags/get-page-tag");
29
+ const get_pages_tag_1 = require("../modules/public-site/liquidjs-tags/get-pages-tag");
30
+ const use_image_tag_1 = require("../modules/public-site/liquidjs-tags/use-image-tag");
31
+ const site_schema_factory_1 = require("../site-schema/site-schema-factory");
32
+ const db_init_1 = require("./db-init/db-init");
33
+ const init_routing_points_1 = require("./db-init/init-routing-points");
34
+ const theme_conf_reader_1 = require("./theme-conf-reader");
35
+ const siteContexts = new Map();
36
+ function getActiveSiteContexts() {
37
+ return siteContexts.values();
38
+ }
39
+ exports.getActiveSiteContexts = getActiveSiteContexts;
40
+ async function getSiteContext(fqdn, options = {}) {
41
+ let siteContext = siteContexts.get(fqdn);
42
+ if (!siteContext) {
43
+ const siteConf = context_1.siteConfs.get(fqdn);
44
+ if (!siteConf) {
45
+ if (options.returnsUndef)
46
+ return;
47
+ throw new common_1.NotFoundException(`Site not found '${fqdn}'`);
48
+ }
49
+ siteContext = await (0, exports.secureCreateSiteContext)(siteConf);
50
+ siteContexts.set(fqdn, siteContext);
51
+ }
52
+ return siteContext;
53
+ }
54
+ exports.getSiteContext = getSiteContext;
55
+ exports.secureCreateSiteContext = (0, async_lib_1.enqueueOrMergeAsync)(createSiteContext, {
56
+ mergeWith: ({ fqdn }) => fqdn,
57
+ });
58
+ async function createSiteContext(siteConf) {
59
+ const { siteName, siteDir, dataDir, cacheDir, backupDir, fqdn } = siteConf;
60
+ const themeDir = (0, path_1.join)(siteDir, "theme");
61
+ const siteLog = context_1.platformLog.createChildLog({ fqdn });
62
+ await (0, server_lib_1.ensureDirectory)(dataDir);
63
+ await (0, server_lib_1.ensureDirectory)(cacheDir);
64
+ await (0, server_lib_1.ensureDirectory)(backupDir);
65
+ const siteSchema = await (0, site_schema_factory_1.loadSiteSchema)(siteDir);
66
+ const { mainCn, logNextQuery } = await (0, db_init_1.createOrOpenMainCn)(siteSchema, dataDir, {
67
+ siteName,
68
+ canCreate: context_1.appConf.devTools,
69
+ siteLog,
70
+ });
71
+ const siteIds = await (0, init_routing_points_1.loadOrInsertSiteIds)(mainCn, siteSchema);
72
+ const mediaStorage = new server_database_media_storage_1.MediaStorage({
73
+ siteName,
74
+ canCreate: context_1.appConf.devTools,
75
+ appLog: siteLog,
76
+ storage: {
77
+ type: "sqlite",
78
+ file: (0, path_1.join)(dataDir, "medias.sqlite"),
79
+ },
80
+ });
81
+ await mediaStorage.initialise(siteIds.siteLeafId);
82
+ const imageCache = await (0, server_image_cache_engine_1.createImageCacheEngine)({
83
+ siteName,
84
+ storage: {
85
+ type: "sqlite",
86
+ file: (0, path_1.join)(cacheDir, "image-cache.sqlite"),
87
+ },
88
+ appLog: siteLog,
89
+ getOriginalImage: async (uid) => {
90
+ const image = await mediaStorage.getMediaWithBinary(uid);
91
+ if (!image)
92
+ throw new common_1.NotFoundException(`Cannot find image '${uid}'`);
93
+ return image.binaryFile;
94
+ },
95
+ qualityPolicy: siteSchema.imageQualityPolicy,
96
+ timeToIdle: context_1.appConf.cacheTimeToIdle === "infinite"
97
+ ? undefined
98
+ : context_1.appConf.cacheTimeToIdle === "disabled"
99
+ ? "0d"
100
+ : context_1.appConf.cacheTimeToIdle,
101
+ });
102
+ const textCache = context_1.appConf.cacheTimeToIdle === "disabled"
103
+ ? (0, server_text_cache_system_1.createNoTextCacheSystem)()
104
+ : await (0, server_text_cache_system_1.createTextCacheSystem)({
105
+ siteName,
106
+ storage: {
107
+ type: "sqlite",
108
+ file: (0, path_1.join)(cacheDir, "text-cache.sqlite"),
109
+ },
110
+ appLog: siteLog,
111
+ timeToIdle: context_1.appConf.cacheTimeToIdle === "infinite" ? undefined : context_1.appConf.cacheTimeToIdle,
112
+ });
113
+ if (!siteConf.loadedOnce) {
114
+ if (context_1.appConf.clearCacheAfterStart) {
115
+ if (context_1.appConf.clearImageCacheAfterStart) {
116
+ await imageCache.clearCache();
117
+ }
118
+ await textCache.clearCache();
119
+ }
120
+ else {
121
+ await (0, maintenance_task_1.siteMaintenanceTask)({ imageCache, textCache });
122
+ }
123
+ siteConf.loadedOnce = true;
124
+ }
125
+ const liquidEngine = new liquidjs_1.Liquid({
126
+ root: (0, path_1.join)(themeDir, "templates"),
127
+ extname: ".liquid",
128
+ jsTruthy: true,
129
+ strictFilters: true,
130
+ outputEscape: "escape",
131
+ });
132
+ const themeTranslator = await (0, simple_i18n_1.createSimpleTranslator)({
133
+ l10nDir: (0, path_1.join)(themeDir, "locales"),
134
+ langs: siteSchema.langs,
135
+ appLog: siteLog,
136
+ });
137
+ const themeConf = await (0, theme_conf_reader_1.readThemeConfFile)(themeDir);
138
+ const siteContext = {
139
+ fqdn: siteConf.fqdn,
140
+ siteName,
141
+ version: siteConf.version,
142
+ siteDir,
143
+ dataDir,
144
+ cacheDir,
145
+ backupDir,
146
+ siteUrl: siteConf.siteUrl,
147
+ siteSchema,
148
+ themeDir,
149
+ mainCn,
150
+ siteIds,
151
+ liquidEngine,
152
+ mediaStorage,
153
+ imageCache,
154
+ textCache,
155
+ themeTranslator,
156
+ multilingual: siteSchema.langs.length > 1,
157
+ themeConf,
158
+ logNextQuery,
159
+ siteLog,
160
+ };
161
+ configureLiquidEngine(siteContext);
162
+ siteLog.info("Site loaded");
163
+ return siteContext;
164
+ }
165
+ function configureLiquidEngine(siteContext) {
166
+ const { liquidEngine } = siteContext;
167
+ liquidEngine.registerTag("include", createDisabledLiquidJSTag("include"));
168
+ liquidEngine.registerTag("render", render_1.default);
169
+ liquidEngine.registerTag("getPages", (0, get_pages_tag_1.createGetPagesLiquidJsTag)(siteContext));
170
+ liquidEngine.registerTag("getPage", (0, get_page_tag_1.createGetPageLiquidJsTag)(siteContext));
171
+ liquidEngine.registerTag("useImage", (0, use_image_tag_1.createUseImageLiquidJsTag)(siteContext));
172
+ liquidEngine.registerFilter("translate", function (str, ...args) {
173
+ return (0, translate_filter_1.translateLiquidJsFilter)(siteContext, str, this.context, args);
174
+ });
175
+ liquidEngine.registerFilter("formatNumber", function (str, ...args) {
176
+ return (0, format_number_1.formatNumberLiquidJsFilter)(str, this.context, args);
177
+ });
178
+ liquidEngine.registerFilter("obfuscate", function (str, ...args) {
179
+ return (0, obfuscate_1.obfuscateLiquidJsFilter)(str, this.context, args);
180
+ });
181
+ liquidEngine.registerFilter("obfuscateAsLink", {
182
+ handler: function (str, ...args) {
183
+ return (0, obfuscate_1.obfuscateAsLinkLiquidJsFilter)(str, this.context, args);
184
+ },
185
+ raw: true,
186
+ });
187
+ liquidEngine.registerFilter("makeExcerpt", function (str, ...args) {
188
+ return (0, make_excerpt_1.makeExcerptLiquidJsFilter)(str, this.context, args);
189
+ });
190
+ liquidEngine.registerFilter("formatDate", function (str, ...args) {
191
+ return (0, format_date_1.formatDateLiquidJsFilter)(str, this.context, args);
192
+ });
193
+ liquidEngine.registerFilter("injectFacebookChat", {
194
+ handler: function (str, ...args) {
195
+ return (0, inject_facebook_chat_1.injectFacebookChatLiquidJsFilter)(str, this.context, args);
196
+ },
197
+ raw: true,
198
+ });
199
+ liquidEngine.registerFilter("openGraphTags", {
200
+ handler: function (ogValues, ...args) {
201
+ return (0, open_graph_filter_1.injectOpenGraphTagsLiquidJsFilter)(siteContext, ogValues, this.context, args);
202
+ },
203
+ raw: true,
204
+ });
205
+ liquidEngine.registerFilter("info", {
206
+ handler: (val) => (0, info_filter_1.infoLiquidJsFilter)(siteContext, val),
207
+ raw: true,
208
+ });
209
+ liquidEngine.registerFilter("activateMenuItemsData", {
210
+ handler: function (pageId) {
211
+ return (0, inject_menu_items_data_1.injectMenuItemsData)(siteContext, pageId, this.context);
212
+ },
213
+ raw: false,
214
+ });
215
+ }
216
+ function createDisabledLiquidJSTag(name) {
217
+ return {
218
+ parse: () => {
219
+ throw new Error(`tag "${name}" disabled`);
220
+ },
221
+ };
222
+ }
223
+ async function unloadSiteContext(siteContext) {
224
+ siteContexts.delete(siteContext.fqdn);
225
+ await Promise.all([
226
+ siteContext.imageCache.close(),
227
+ siteContext.textCache.close(),
228
+ siteContext.mediaStorage.close(),
229
+ siteContext.mainCn.destroy(),
230
+ ]);
231
+ context_1.platformLog.info(`Site '${siteContext.siteName}' unloaded`);
232
+ }
233
+ exports.unloadSiteContext = unloadSiteContext;
234
+ //# sourceMappingURL=site-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"site-context.js","sourceRoot":"","sources":["../../src/site-context/site-context.ts"],"names":[],"mappings":";;;;;;AAAA,2CAAmD;AACnD,gDAAuD;AACvD,2FAAuE;AACvE,mFAA6E;AAC7E,qDAAuD;AACvD,iFAAoG;AACpG,uCAAkC;AAClC,+BAA4B;AAC5B,wCAA6D;AAC7D,wDAAgE;AAChE,sEAAsE;AACtE,qFAA+F;AAC/F,yFAAmG;AACnG,qFAAyF;AACzF,uGAAgH;AAChH,2GAAqG;AACrG,uFAAiG;AACjG,iFAG2D;AAC3D,iGAA8G;AAC9G,+FAAmG;AACnG,2GAAsF;AACtF,oFAA6F;AAC7F,sFAA+F;AAC/F,sFAA+F;AAE/F,4EAAoE;AACpE,+CAAuD;AACvD,uEAAoE;AAGpE,2DAAwD;AAExD,MAAM,YAAY,GAAG,IAAI,GAAG,EAAuB,CAAC;AAEpD,SAAgB,qBAAqB;IACnC,OAAO,YAAY,CAAC,MAAM,EAAE,CAAC;AAC/B,CAAC;AAFD,sDAEC;AAOM,KAA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,QAAQ,YAAY,CAAC,CAAC;AAC9D,CAAC;AATD,8CASC"}
@@ -0,0 +1,46 @@
1
+ import { SiteSchema } from "@paroicms/anywhere-lib";
2
+ import { MediaStorage } from "@paroicms/server-database-media-storage";
3
+ import { ImageCacheEngine } from "@paroicms/server-image-cache-engine";
4
+ import { TextCacheSystem } from "@paroicms/server-text-cache-system";
5
+ import { Liquid } from "liquidjs";
6
+ import { DataSource } from "typeorm";
7
+ import { SimpleTranslator } from "../helpers/simple-i18n";
8
+ import { AppLog } from "../share/pino-app-log";
9
+ import { ThemeConf } from "./theme-conf-types";
10
+ export interface SiteContext {
11
+ fqdn: string;
12
+ siteName: string;
13
+ version?: string;
14
+ siteDir: string;
15
+ dataDir: string;
16
+ cacheDir: string;
17
+ backupDir: string;
18
+ siteUrl: string;
19
+ siteSchema: SiteSchema;
20
+ mainCn: DataSource;
21
+ siteIds: SiteIds;
22
+ themeDir: string;
23
+ liquidEngine: Liquid;
24
+ mediaStorage: MediaStorage;
25
+ imageCache: ImageCacheEngine;
26
+ textCache: TextCacheSystem;
27
+ themeTranslator: SimpleTranslator;
28
+ multilingual: boolean;
29
+ themeConf: ThemeConf;
30
+ logNextQuery: (count?: number) => void;
31
+ siteLog: AppLog;
32
+ }
33
+ export interface SiteIds {
34
+ siteLeafId: string;
35
+ homeIds: RoutingPointIds;
36
+ }
37
+ export interface RoutingPointIds {
38
+ leafId: string;
39
+ leafType: string;
40
+ sectionIds: {
41
+ [lang: string]: string;
42
+ };
43
+ children?: {
44
+ [leafType: string]: RoutingPointIds;
45
+ };
46
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=site-context.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"site-context.types.js","sourceRoot":"","sources":["../../src/site-context/site-context.types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import { JsonOfThemeConf } from "../typeonly/theme-json-types";
2
+ import { ThemeConf } from "./theme-conf-types";
3
+ export declare function readThemeConfFile(themeDir: string): Promise<ThemeConf>;
4
+ export declare function formatThemeConf(val: JsonOfThemeConf): ThemeConf;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.formatThemeConf = exports.readThemeConfFile = void 0;
4
+ const anywhere_lib_1 = require("@paroicms/anywhere-lib");
5
+ const server_image_cache_engine_1 = require("@paroicms/server-image-cache-engine");
6
+ const promises_1 = require("fs/promises");
7
+ const path_1 = require("path");
8
+ const context_1 = require("../context");
9
+ async function readThemeConfFile(themeDir) {
10
+ const themeFile = (0, path_1.join)(themeDir, "theme.json");
11
+ try {
12
+ const content = await (0, promises_1.readFile)(themeFile, "utf-8");
13
+ const data = JSON.parse(content);
14
+ const result = context_1.typeValidator.validate("JsonOfThemeConf", data);
15
+ if (!result.valid)
16
+ throw new Error(result.error ?? "(missing message)");
17
+ return formatThemeConf(data);
18
+ }
19
+ catch (error) {
20
+ throw new Error(`invalid theme configuration '${themeFile}': ${(0, anywhere_lib_1.messageOf)(error)} `);
21
+ }
22
+ }
23
+ exports.readThemeConfFile = readThemeConfFile;
24
+ function formatThemeConf(val) {
25
+ val.fTextImages.forEach(checkVariantName);
26
+ return val;
27
+ }
28
+ exports.formatThemeConf = formatThemeConf;
29
+ function checkVariantName(val) {
30
+ if (!(0, server_image_cache_engine_1.isVariantName)(val))
31
+ throw new Error(`invalid variant '${val}'`);
32
+ }
33
+ //# sourceMappingURL=theme-conf-reader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme-conf-reader.js","sourceRoot":"","sources":["../../src/site-context/theme-conf-reader.ts"],"names":[],"mappings":";;;AAAA,yDAAmD;AACnD,mFAAiF;AACjF,0CAAuC;AACvC,+BAA4B;AAC5B,wCAA2C;AAIpC,KAAK,UAAU,iBAAiB,CAAC,QAAgB;IACtD,MAAM,SAAS,GAAG,IAAA,WAAI,EAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;IAE/C,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,IAAA,mBAAQ,EAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QACnD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACjC,MAAM,MAAM,GAAG,uBAAa,CAAC,QAAQ,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC;QAC/D,IAAI,CAAC,MAAM,CAAC,KAAK;YAAE,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,IAAI,mBAAmB,CAAC,CAAC;QACxE,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CAAC,gCAAgC,SAAS,MAAM,IAAA,wBAAS,EAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACtF,CAAC;AACH,CAAC;AAZD,8CAYC;AAED,SAAgB,eAAe,CAAC,GAAoB;IAClD,GAAG,CAAC,WAAW,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAC1C,OAAO,GAAgB,CAAC;AAC1B,CAAC;AAHD,0CAGC;AAED,SAAS,gBAAgB,CAAC,GAAW;IACnC,IAAI,CAAC,IAAA,yCAAa,EAAC,GAAG,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,oBAAoB,GAAG,GAAG,CAAC,CAAC;AACvE,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { VariantName } from "@paroicms/server-image-cache-engine";
2
+ export interface ThemeConf {
3
+ fTextImages: VariantName[];
4
+ }