@griddo/cx 11.7.6-rc.1 → 11.7.6

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 (300) hide show
  1. package/README.md +228 -25
  2. package/build/adapters/gatsby/index.d.ts +4 -0
  3. package/build/adapters/gatsby/utils.d.ts +22 -0
  4. package/build/artifacts/index.d.ts +6 -0
  5. package/build/commands/move-assets.d.ts +1 -0
  6. package/build/commands/prepare-domains-render.d.ts +1 -0
  7. package/build/{exporter/constants → constants}/envs.d.ts +7 -1
  8. package/build/constants/index.d.ts +57 -0
  9. package/build/end-render.js +74 -0
  10. package/build/end-render.js.map +7 -0
  11. package/build/{exporter/constants/errors.d.ts → errors/errors-data.d.ts} +3 -5
  12. package/build/{exporter/utils/errors.d.ts → errors/index.d.ts} +3 -3
  13. package/build/index.d.ts +29 -0
  14. package/build/index.js +73 -0
  15. package/build/index.js.map +7 -0
  16. package/build/prepare-domains-render.js +73 -0
  17. package/build/prepare-domains-render.js.map +7 -0
  18. package/build/react/Favicon/index.d.ts +5 -0
  19. package/build/react/Favicon/utils.d.ts +9 -0
  20. package/build/react/GriddoIntegrations/index.d.ts +20 -0
  21. package/build/react/GriddoIntegrations/utils.d.ts +26 -0
  22. package/{react/index.tsx → build/react/index.d.ts} +0 -1
  23. package/build/react/index.js +3 -0
  24. package/build/registers/api.d.ts +9 -0
  25. package/build/registers/gatsby.d.ts +9 -0
  26. package/build/registers/index.d.ts +3 -0
  27. package/build/reset-render.js +74 -0
  28. package/build/reset-render.js.map +7 -0
  29. package/build/{exporter/services → services}/auth.d.ts +1 -1
  30. package/build/services/domains.d.ts +6 -0
  31. package/build/services/register.d.ts +36 -0
  32. package/build/{exporter/services → services}/robots.d.ts +6 -0
  33. package/build/services/settings.d.ts +4 -0
  34. package/build/{exporter/services → services}/sites.d.ts +2 -5
  35. package/build/services/store.d.ts +6 -0
  36. package/build/start-render.js +100 -0
  37. package/build/start-render.js.map +7 -0
  38. package/build/{exporter/types → types}/api.d.ts +4 -3
  39. package/build/{exporter/types → types}/global.d.ts +6 -6
  40. package/build/{exporter/types → types}/navigation.d.ts +1 -1
  41. package/build/{exporter/types → types}/sites.d.ts +2 -1
  42. package/build/upload-search-content.js +74 -0
  43. package/build/upload-search-content.js.map +7 -0
  44. package/build/utils/alerts.d.ts +3 -0
  45. package/build/{exporter/utils → utils}/cache.d.ts +12 -7
  46. package/build/utils/core-utils.d.ts +107 -0
  47. package/build/utils/create-build-data.d.ts +8 -0
  48. package/build/{exporter/utils → utils}/domains.d.ts +1 -1
  49. package/build/utils/folders.d.ts +53 -0
  50. package/build/{exporter/utils/check-health.d.ts → utils/health-checks.d.ts} +2 -2
  51. package/build/{exporter/utils → utils}/loggin.d.ts +16 -2
  52. package/build/{exporter/utils → utils}/pages.d.ts +2 -2
  53. package/build/utils/render.d.ts +13 -0
  54. package/build/utils/searches.d.ts +15 -0
  55. package/build/{exporter/utils → utils}/sites.d.ts +3 -3
  56. package/build/{exporter/utils → utils}/store.d.ts +38 -10
  57. package/cx.config.d.ts +5 -0
  58. package/cx.config.js +36 -0
  59. package/exporter/adapters/gatsby/index.ts +146 -60
  60. package/exporter/adapters/gatsby/utils.ts +161 -0
  61. package/exporter/artifacts/README.md +34 -0
  62. package/exporter/{utils/artifacts.ts → artifacts/index.ts} +8 -9
  63. package/exporter/build.sh +38 -5
  64. package/exporter/commands/end-render.ts +81 -56
  65. package/exporter/commands/move-assets.ts +11 -0
  66. package/exporter/commands/prepare-domains-render.ts +31 -149
  67. package/exporter/commands/reset-render.ts +3 -12
  68. package/exporter/commands/start-render.ts +47 -18
  69. package/exporter/commands/upload-search-content.ts +21 -206
  70. package/exporter/constants/envs.ts +51 -59
  71. package/exporter/constants/index.ts +129 -0
  72. package/exporter/{constants/errors.ts → errors/errors-data.ts} +15 -24
  73. package/exporter/{utils/errors.ts → errors/index.ts} +9 -10
  74. package/exporter/index.ts +82 -0
  75. package/{react → exporter/react}/Favicon/index.tsx +7 -1
  76. package/{react → exporter/react}/GriddoIntegrations/index.tsx +14 -6
  77. package/{react → exporter/react}/GriddoIntegrations/utils.ts +9 -4
  78. package/exporter/react/index.tsx +11 -0
  79. package/exporter/registers/api.ts +14 -0
  80. package/exporter/registers/gatsby.ts +14 -0
  81. package/exporter/registers/index.ts +4 -0
  82. package/exporter/services/auth.ts +6 -7
  83. package/exporter/services/domains.ts +16 -0
  84. package/exporter/services/navigation.ts +10 -4
  85. package/exporter/services/reference-fields.ts +23 -8
  86. package/exporter/services/register.ts +113 -0
  87. package/exporter/services/robots.ts +15 -8
  88. package/exporter/services/settings.ts +17 -0
  89. package/exporter/services/sites.ts +24 -35
  90. package/exporter/services/store.ts +76 -118
  91. package/exporter/types/api.ts +27 -24
  92. package/exporter/types/global.ts +10 -8
  93. package/exporter/types/navigation.ts +1 -1
  94. package/exporter/types/pages.ts +3 -2
  95. package/exporter/types/sites.ts +2 -1
  96. package/exporter/utils/alerts.ts +29 -0
  97. package/exporter/utils/api.ts +82 -46
  98. package/exporter/utils/cache.ts +59 -34
  99. package/exporter/utils/core-utils.ts +247 -86
  100. package/exporter/utils/create-build-data.ts +17 -0
  101. package/exporter/utils/domains.ts +7 -10
  102. package/exporter/utils/folders.ts +92 -161
  103. package/exporter/utils/health-checks.ts +64 -0
  104. package/exporter/utils/images.ts +6 -1
  105. package/exporter/utils/instance.ts +12 -9
  106. package/exporter/utils/loggin.ts +89 -24
  107. package/exporter/utils/pages.ts +88 -23
  108. package/exporter/utils/render.ts +48 -147
  109. package/exporter/utils/searches.ts +156 -0
  110. package/exporter/utils/sites.ts +77 -67
  111. package/exporter/utils/store.ts +178 -85
  112. package/gatsby-browser.tsx +58 -41
  113. package/gatsby-config.ts +12 -6
  114. package/gatsby-node.ts +77 -15
  115. package/gatsby-ssr.tsx +1 -2
  116. package/package.json +74 -33
  117. package/src/README.md +7 -0
  118. package/src/components/Head.tsx +46 -13
  119. package/src/components/template.tsx +30 -8
  120. package/src/gatsby-node-utils.ts +2 -91
  121. package/src/html.tsx +11 -2
  122. package/src/types.ts +5 -5
  123. package/start-render.js +3 -1
  124. package/tsconfig.json +2 -3
  125. package/build/adapters/gatsby/actions/clean.js +0 -10
  126. package/build/adapters/gatsby/actions/clean.js.map +0 -1
  127. package/build/adapters/gatsby/actions/close.js +0 -12
  128. package/build/adapters/gatsby/actions/close.js.map +0 -1
  129. package/build/adapters/gatsby/actions/data.js +0 -18
  130. package/build/adapters/gatsby/actions/data.js.map +0 -1
  131. package/build/adapters/gatsby/actions/healthCheck.js +0 -10
  132. package/build/adapters/gatsby/actions/healthCheck.js.map +0 -1
  133. package/build/adapters/gatsby/actions/init.js +0 -9
  134. package/build/adapters/gatsby/actions/init.js.map +0 -1
  135. package/build/adapters/gatsby/actions/meta.js +0 -14
  136. package/build/adapters/gatsby/actions/meta.js.map +0 -1
  137. package/build/adapters/gatsby/actions/prepare.js +0 -9
  138. package/build/adapters/gatsby/actions/prepare.js.map +0 -1
  139. package/build/adapters/gatsby/actions/relocation.js +0 -15
  140. package/build/adapters/gatsby/actions/relocation.js.map +0 -1
  141. package/build/adapters/gatsby/actions/restore.js +0 -26
  142. package/build/adapters/gatsby/actions/restore.js.map +0 -1
  143. package/build/adapters/gatsby/actions/ssg.js +0 -9
  144. package/build/adapters/gatsby/actions/ssg.js.map +0 -1
  145. package/build/adapters/gatsby/actions/sync.js +0 -50
  146. package/build/adapters/gatsby/actions/sync.js.map +0 -1
  147. package/build/adapters/gatsby/index.js +0 -74
  148. package/build/adapters/gatsby/index.js.map +0 -1
  149. package/build/adapters/gatsby/shared/context.js +0 -25
  150. package/build/adapters/gatsby/shared/context.js.map +0 -1
  151. package/build/adapters/gatsby/shared/extract-assets.js +0 -58
  152. package/build/adapters/gatsby/shared/extract-assets.js.map +0 -1
  153. package/build/adapters/gatsby/shared/gatsby-build.js +0 -49
  154. package/build/adapters/gatsby/shared/gatsby-build.js.map +0 -1
  155. package/build/adapters/gatsby/shared/sync-render.js +0 -208
  156. package/build/adapters/gatsby/shared/sync-render.js.map +0 -1
  157. package/build/adapters/gatsby/shared/types.js +0 -3
  158. package/build/adapters/gatsby/shared/types.js.map +0 -1
  159. package/build/commands/end-render.js +0 -63
  160. package/build/commands/end-render.js.map +0 -1
  161. package/build/commands/prepare-assets-directory.js +0 -32
  162. package/build/commands/prepare-assets-directory.js.map +0 -1
  163. package/build/commands/prepare-domains-render.js +0 -138
  164. package/build/commands/prepare-domains-render.js.map +0 -1
  165. package/build/commands/reset-render.js +0 -22
  166. package/build/commands/reset-render.js.map +0 -1
  167. package/build/commands/start-render.js +0 -35
  168. package/build/commands/start-render.js.map +0 -1
  169. package/build/commands/upload-search-content.js +0 -189
  170. package/build/commands/upload-search-content.js.map +0 -1
  171. package/build/constants/endpoints.js +0 -42
  172. package/build/constants/endpoints.js.map +0 -1
  173. package/build/constants/envs.js +0 -73
  174. package/build/constants/envs.js.map +0 -1
  175. package/build/constants/errors.js +0 -89
  176. package/build/constants/errors.js.map +0 -1
  177. package/build/exporter/adapters/gatsby/actions/clean.d.ts +0 -3
  178. package/build/exporter/adapters/gatsby/actions/close.d.ts +0 -3
  179. package/build/exporter/adapters/gatsby/actions/data.d.ts +0 -2
  180. package/build/exporter/adapters/gatsby/actions/healthCheck.d.ts +0 -2
  181. package/build/exporter/adapters/gatsby/actions/init.d.ts +0 -2
  182. package/build/exporter/adapters/gatsby/actions/meta.d.ts +0 -2
  183. package/build/exporter/adapters/gatsby/actions/prepare.d.ts +0 -2
  184. package/build/exporter/adapters/gatsby/actions/relocation.d.ts +0 -2
  185. package/build/exporter/adapters/gatsby/actions/restore.d.ts +0 -3
  186. package/build/exporter/adapters/gatsby/actions/ssg.d.ts +0 -3
  187. package/build/exporter/adapters/gatsby/actions/sync.d.ts +0 -3
  188. package/build/exporter/adapters/gatsby/index.d.ts +0 -9
  189. package/build/exporter/adapters/gatsby/shared/context.d.ts +0 -38
  190. package/build/exporter/adapters/gatsby/shared/extract-assets.d.ts +0 -7
  191. package/build/exporter/adapters/gatsby/shared/gatsby-build.d.ts +0 -7
  192. package/build/exporter/adapters/gatsby/shared/sync-render.d.ts +0 -36
  193. package/build/exporter/adapters/gatsby/shared/types.d.ts +0 -34
  194. package/build/exporter/commands/prepare-assets-directory.d.ts +0 -2
  195. package/build/exporter/commands/prepare-domains-render.d.ts +0 -2
  196. package/build/exporter/services/db.d.ts +0 -4
  197. package/build/exporter/services/store.d.ts +0 -15
  198. package/build/exporter/types/render.d.ts +0 -50
  199. package/build/exporter/utils/artifacts.d.ts +0 -6
  200. package/build/exporter/utils/brush.d.ts +0 -18
  201. package/build/exporter/utils/core-utils.d.ts +0 -77
  202. package/build/exporter/utils/folders.d.ts +0 -66
  203. package/build/exporter/utils/render.d.ts +0 -49
  204. package/build/services/auth.js +0 -39
  205. package/build/services/auth.js.map +0 -1
  206. package/build/services/db.js +0 -34
  207. package/build/services/db.js.map +0 -1
  208. package/build/services/navigation.js +0 -93
  209. package/build/services/navigation.js.map +0 -1
  210. package/build/services/reference-fields.js +0 -131
  211. package/build/services/reference-fields.js.map +0 -1
  212. package/build/services/robots.js +0 -58
  213. package/build/services/robots.js.map +0 -1
  214. package/build/services/sites.js +0 -109
  215. package/build/services/sites.js.map +0 -1
  216. package/build/services/store.js +0 -282
  217. package/build/services/store.js.map +0 -1
  218. package/build/types/api.js +0 -3
  219. package/build/types/api.js.map +0 -1
  220. package/build/types/global.js +0 -3
  221. package/build/types/global.js.map +0 -1
  222. package/build/types/navigation.js +0 -3
  223. package/build/types/navigation.js.map +0 -1
  224. package/build/types/pages.js +0 -3
  225. package/build/types/pages.js.map +0 -1
  226. package/build/types/render.js +0 -10
  227. package/build/types/render.js.map +0 -1
  228. package/build/types/sites.js +0 -3
  229. package/build/types/sites.js.map +0 -1
  230. package/build/types/templates.js +0 -3
  231. package/build/types/templates.js.map +0 -1
  232. package/build/utils/api.js +0 -161
  233. package/build/utils/api.js.map +0 -1
  234. package/build/utils/artifacts.js +0 -34
  235. package/build/utils/artifacts.js.map +0 -1
  236. package/build/utils/brush.js +0 -30
  237. package/build/utils/brush.js.map +0 -1
  238. package/build/utils/cache.js +0 -106
  239. package/build/utils/cache.js.map +0 -1
  240. package/build/utils/check-health.js +0 -68
  241. package/build/utils/check-health.js.map +0 -1
  242. package/build/utils/core-utils.js +0 -251
  243. package/build/utils/core-utils.js.map +0 -1
  244. package/build/utils/domains.js +0 -37
  245. package/build/utils/domains.js.map +0 -1
  246. package/build/utils/errors.js +0 -30
  247. package/build/utils/errors.js.map +0 -1
  248. package/build/utils/folders.js +0 -339
  249. package/build/utils/folders.js.map +0 -1
  250. package/build/utils/images.js +0 -45
  251. package/build/utils/images.js.map +0 -1
  252. package/build/utils/instance.js +0 -66
  253. package/build/utils/instance.js.map +0 -1
  254. package/build/utils/loggin.js +0 -102
  255. package/build/utils/loggin.js.map +0 -1
  256. package/build/utils/pages.js +0 -359
  257. package/build/utils/pages.js.map +0 -1
  258. package/build/utils/render.js +0 -144
  259. package/build/utils/render.js.map +0 -1
  260. package/build/utils/sites.js +0 -239
  261. package/build/utils/sites.js.map +0 -1
  262. package/build/utils/store.js +0 -193
  263. package/build/utils/store.js.map +0 -1
  264. package/exporter/adapters/gatsby/actions/clean.ts +0 -14
  265. package/exporter/adapters/gatsby/actions/close.ts +0 -17
  266. package/exporter/adapters/gatsby/actions/data.ts +0 -25
  267. package/exporter/adapters/gatsby/actions/healthCheck.ts +0 -10
  268. package/exporter/adapters/gatsby/actions/init.ts +0 -12
  269. package/exporter/adapters/gatsby/actions/meta.ts +0 -18
  270. package/exporter/adapters/gatsby/actions/prepare.ts +0 -9
  271. package/exporter/adapters/gatsby/actions/relocation.ts +0 -15
  272. package/exporter/adapters/gatsby/actions/restore.ts +0 -36
  273. package/exporter/adapters/gatsby/actions/ssg.ts +0 -12
  274. package/exporter/adapters/gatsby/actions/sync.ts +0 -70
  275. package/exporter/adapters/gatsby/shared/context.ts +0 -50
  276. package/exporter/adapters/gatsby/shared/extract-assets.ts +0 -61
  277. package/exporter/adapters/gatsby/shared/gatsby-build.ts +0 -54
  278. package/exporter/adapters/gatsby/shared/sync-render.ts +0 -294
  279. package/exporter/adapters/gatsby/shared/types.ts +0 -35
  280. package/exporter/build-esbuild.noop +0 -42
  281. package/exporter/commands/prepare-assets-directory.ts +0 -33
  282. package/exporter/services/db.ts +0 -32
  283. package/exporter/types/render.ts +0 -59
  284. package/exporter/utils/brush.ts +0 -34
  285. package/exporter/utils/check-health.ts +0 -79
  286. package/plugins/gatsby-plugin-svgr-loader/gatsby-node.js +0 -55
  287. package/plugins/gatsby-plugin-svgr-loader/package.json +0 -8
  288. package/build/{exporter/commands → commands}/end-render.d.ts +0 -0
  289. package/build/{exporter/commands → commands}/reset-render.d.ts +0 -0
  290. package/build/{exporter/commands → commands}/start-render.d.ts +0 -0
  291. package/build/{exporter/commands → commands}/upload-search-content.d.ts +0 -0
  292. package/build/{exporter/constants → constants}/endpoints.d.ts +0 -0
  293. package/build/{exporter/services → services}/navigation.d.ts +0 -0
  294. package/build/{exporter/services → services}/reference-fields.d.ts +0 -0
  295. package/build/{exporter/types → types}/pages.d.ts +1 -1
  296. /package/build/{exporter/types → types}/templates.d.ts +0 -0
  297. /package/build/{exporter/utils → utils}/api.d.ts +0 -0
  298. /package/build/{exporter/utils → utils}/images.d.ts +0 -0
  299. /package/build/{exporter/utils → utils}/instance.d.ts +0 -0
  300. /package/{react → exporter/react}/Favicon/utils.ts +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"envs.js","sourceRoot":"","sources":["../../exporter/constants/envs.ts"],"names":[],"mappings":";AAAA,gEAAgE;;;AAEhE,oDAA+C;AAE/C,cAAc;AACd,MAAM,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;AAoExE,wCAAc;AAnEf,MAAM,qBAAqB,GAAG,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC;AAkF7F,sD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AC,QAAQ,CAC5D,OAAO,CAAC,GAAG,CAAC,qCAAqC,IAAI,GAAG,CACxD,CAAC;AAyCD,sFAAqC;AAxCtC,MAAM,qCAAqC,GAAG,MAAM,CAAC,QAAQ,CAC5D,OAAO,CAAC,GAAG,CAAC,qCAAqC,IAAI,GAAG,CACxD,CAAC;AA8CD,sFAAqC;AA7CtC,MAAM,kCAAkC,GAAG,MAAM,CAAC,QAAQ,CACzD,OAAO,CAAC,GAAG,CAAC,kCAAkC,IAAI,GAAG,CACrD,CAAC;AA6BD,gFAAkC;AA5BnC,MAAM,iCAAiC,GAAG,MAAM,CAAC,QAAQ,CACxD,OAAO,CAAC,GAAG,CAAC,iCAAiC,IAAI,GAAG,CACpD,CAAC;AA2CD,8EAAiC;AA1ClC,MAAM,wCAAwC,GAAG,MAAM,CAAC,QAAQ,CAC/D,OAAO,CAAC,GAAG,CAAC,wCAAwC,IAAI,GAAG,CAC3D,CAAC;AAgCD,4FAAwC;AA/BzC,MAAM,kCAAkC,GAAG,MAAM,CAAC,QAAQ,CACzD,OAAO,CAAC,GAAG,CAAC,kCAAkC,IAAI,GAAG,CACrD,CAAC;AAyBD,gFAAkC;AAxBnC,MAAM,qCAAqC,GAAG,MAAM,CAAC,QAAQ,CAC5D,OAAO,CAAC,GAAG,CAAC,qCAAqC,IAAI,GAAG,CACxD,CAAC;AAUD,sFAAqC;AARtC,UAAU;AACV,MAAM,4BAA4B,GAAG,OAAO,CAAC,GAAG,CAAC,+BAA+B,CAAC;AAgBhF,oEAA4B;AAf7B,MAAM,0BAA0B,GAAG,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC;AAgB5E,gEAA0B"}
@@ -1,89 +0,0 @@
1
- "use strict";
2
- /**
3
- * Do you want to add a new error to the list?
4
- *
5
- * 1 - Add the new error type name to the `ErrorsType` union type.
6
- * 2 - Export a new ErrorData object (or a function that returns one) in this
7
- * file by completing the `error` (ErrosType) and `message` (string) properties
8
- * obligatorily.
9
- */
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.CheckHealthError = exports.WriteToStoreError = exports.UploadSearchError = exports.RenderUUIDError = exports.ReferenceFieldSourcesNotFoundError = exports.ReadFromStoreError = exports.NoJSConfigFileFound = exports.NoDomainsFoundError = exports.LoginError = exports.LifecycleExecutionError = exports.ErrorInSSGBuildProcess = exports.ArtifactError = void 0;
12
- const ArtifactError = {
13
- error: "ArtifactError",
14
- message: "There was a problem with an artifact",
15
- expected: "An external process may have has modified or deleted one of the artifacts (files and directories).",
16
- hint: "Have there been any recent deployments? These can delete directories from the current render.",
17
- };
18
- exports.ArtifactError = ArtifactError;
19
- const ErrorInSSGBuildProcess = (command) => ({
20
- error: "ErrorInSSGBuildProcess",
21
- message: `Error in SSG build process: ${JSON.stringify(command)}`,
22
- expected: "This can happen if there was a problem with the SSG build process.",
23
- });
24
- exports.ErrorInSSGBuildProcess = ErrorInSSGBuildProcess;
25
- const LifecycleExecutionError = (attempts, name) => ({
26
- error: "LifecycleExecutionError",
27
- message: `Exceeded maximum retry attempts (${attempts}) for ${name} LifeCycle`,
28
- });
29
- exports.LifecycleExecutionError = LifecycleExecutionError;
30
- const LoginError = {
31
- error: "LoginError",
32
- message: "There was a problem logging in to the API",
33
- expected: "This happens if the API is currently not working or the credentials are incorrect.",
34
- };
35
- exports.LoginError = LoginError;
36
- const NoDomainsFoundError = {
37
- error: "NoDomainsFoundError",
38
- message: "No domains were found in this instance. The process cannot continue.",
39
- expected: "This may happen if the API is not functioning, or the site is not properly configured, or the domains are not registered.",
40
- hint: "You can contact the instance administrator.",
41
- };
42
- exports.NoDomainsFoundError = NoDomainsFoundError;
43
- const NoJSConfigFileFound = {
44
- error: "NoJSConfigFileFound",
45
- message: "Could not find jsconfig.json or tsconfig.json",
46
- expected: "This can happen if the instance is not properly configured with a jsconfig.json or tsconfig.json file.",
47
- };
48
- exports.NoJSConfigFileFound = NoJSConfigFileFound;
49
- const ReadFromStoreError = {
50
- error: "ReadFromStoreError",
51
- message: "There was an error reading a file to the Store directory",
52
- hint: "There may be an issue such as permissions preventing the file from being read.",
53
- };
54
- exports.ReadFromStoreError = ReadFromStoreError;
55
- const ReferenceFieldSourcesNotFoundError = {
56
- error: "ReferenceFieldSourcesNotFoundError",
57
- message: "The distributor has no sources defined.",
58
- expected: "It is expected to have at least one data source in the `sources` property, even if it is empty.",
59
- };
60
- exports.ReferenceFieldSourcesNotFoundError = ReferenceFieldSourcesNotFoundError;
61
- const RenderUUIDError = {
62
- error: "RenderUUIDError",
63
- message: `Render sentinel file does not exist.
64
- The rendering UUID cannot be read safely.
65
- There was probably an instance deployment during the render, and files were deleted.
66
-
67
- The files generated in this render will not be published.`,
68
- };
69
- exports.RenderUUIDError = RenderUUIDError;
70
- const WriteToStoreError = {
71
- error: "WriteToStoreError",
72
- message: "There was an error writing a file to the Store directory",
73
- hint: "There may be an issue such as lack of space or permissions preventing the file from being written.",
74
- };
75
- exports.WriteToStoreError = WriteToStoreError;
76
- const UploadSearchError = {
77
- error: "UploadSearchError",
78
- message: "There was an error uploading content to API for search",
79
- hint: "This happens if the API is currently not working or the credentials are incorrect.",
80
- };
81
- exports.UploadSearchError = UploadSearchError;
82
- const CheckHealthError = {
83
- error: "CheckHealthError",
84
- message: "There was a problem with environment vars configuration.",
85
- expected: "Some of the required environment variables are not set correctly or are missing",
86
- hint: "Are the environment variables correctly set?",
87
- };
88
- exports.CheckHealthError = CheckHealthError;
89
- //# sourceMappingURL=errors.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../exporter/constants/errors.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAmBH,MAAM,aAAa,GAAc;IAChC,KAAK,EAAE,eAAe;IACtB,OAAO,EAAE,sCAAsC;IAC/C,QAAQ,EACP,oGAAoG;IACrG,IAAI,EAAE,+FAA+F;CACrG,CAAC;AA4ED,sCAAa;AA1Ed,MAAM,sBAAsB,GAAG,CAAC,OAAiC,EAAa,EAAE,CAAC,CAAC;IAC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EAAE,0DAA0D;IACnE,IAAI,EAAE,oGAAoG;CAC1G,CAAC;AA0BD,8CAAiB;AAxBlB,MAAM,iBAAiB,GAAc;IACpC,KAAK,EAAE,mBAAmB;IAC1B,OAAO,EAAE,wDAAwD;IACjE,IAAI,EAAE,oFAAoF;CAC1F,CAAC;AAmBD,8CAAiB;AAjBlB,MAAM,gBAAgB,GAAc;IACnC,KAAK,EAAE,kBAAkB;IACzB,OAAO,EAAE,0DAA0D;IACnE,QAAQ,EAAE,iFAAiF;IAC3F,IAAI,EAAE,8CAA8C;CACpD,CAAC;AAcD,4CAAgB"}
@@ -1,3 +0,0 @@
1
- import type { RenderContext } from "../shared/context";
2
- import type { SSG } from "../shared/types";
3
- export declare function cleanAction(context: RenderContext<SSG>): Promise<void>;
@@ -1,3 +0,0 @@
1
- import type { RenderContext } from "../shared/context";
2
- import type { SSG } from "../shared/types";
3
- export declare function closeAction(context: RenderContext<SSG>): Promise<void>;
@@ -1,2 +0,0 @@
1
- import type { RenderContext } from "../shared/context";
2
- export declare function dataAction(context: RenderContext): Promise<void>;
@@ -1,2 +0,0 @@
1
- import type { RenderContext } from "../shared/context";
2
- export declare function healthCheckAction(context: RenderContext): Promise<void>;
@@ -1,2 +0,0 @@
1
- import type { RenderContext } from "../shared/context";
2
- export declare function initAction(context: RenderContext): Promise<void>;
@@ -1,2 +0,0 @@
1
- import type { RenderContext } from "../shared/context";
2
- export declare function metaAction(context: RenderContext): Promise<void>;
@@ -1,2 +0,0 @@
1
- import type { RenderContext } from "../shared/context";
2
- export declare function prepareAction(context: RenderContext): Promise<void>;
@@ -1,2 +0,0 @@
1
- import type { RenderContext } from "../shared/context";
2
- export declare function relocationAction(context: RenderContext): Promise<void>;
@@ -1,3 +0,0 @@
1
- import type { RenderContext } from "../shared/context";
2
- import type { SSG } from "../shared/types";
3
- export declare function restoreAction(context: RenderContext<SSG>): Promise<void>;
@@ -1,3 +0,0 @@
1
- import type { RenderContext } from "../shared/context";
2
- import type { SSG } from "../shared/types";
3
- export declare function ssgAction(context: RenderContext<SSG>): Promise<void>;
@@ -1,3 +0,0 @@
1
- import type { RenderContext } from "../shared/context";
2
- import type { SSG } from "../shared/types";
3
- export declare function syncAction(context: RenderContext<SSG>): Promise<void>;
@@ -1,9 +0,0 @@
1
- /**
2
- * Executes a complete Gatsby render process for a given domain.
3
- *
4
- * The render process consists of multiple lifecycle steps that handle cleaning,
5
- * preparing, building and syncing the site. It can run in two modes:
6
- * - FROM_SCRATCH: Performs a complete rebuild of the site
7
- * - INCREMENTAL: Only rebuilds changed pages while preserving the rest
8
- */
9
- export declare function gatsbyRenderDomain(domain: string): Promise<void>;
@@ -1,38 +0,0 @@
1
- import type { Artifacts, PlaceholderPath } from "../../../types/global";
2
- import type { RenderMode } from "../../../types/render";
3
- interface RenderContextProps<T> {
4
- domain: string;
5
- renderMode: RenderMode;
6
- paths: Record<string, string>;
7
- ssg: T;
8
- renderMetadata: {
9
- proDomain: string;
10
- griddoVersion: string;
11
- buildReportFileName: string;
12
- };
13
- cxArtifacts: Artifacts;
14
- }
15
- /**
16
- * Encapsulates the state, configuration, and artifacts for a single SSG
17
- * render process.
18
- *
19
- * This class is instantiated at the beginning of a render and passed through
20
- * each lifecycle step, providing a centralized and consistent context for all
21
- * operations. It is agnostic to the specific SSG being used.
22
- */
23
- export declare class RenderContext<T = unknown> {
24
- readonly domain: string;
25
- readonly renderMode: RenderMode;
26
- readonly paths: Record<PlaceholderPath, string>;
27
- pagesToCreate: number[];
28
- pagesToDelete: number[];
29
- ssg: T;
30
- renderMetadata: {
31
- proDomain: string;
32
- griddoVersion: string;
33
- buildReportFileName: string;
34
- };
35
- cxArtifacts: Artifacts;
36
- constructor({ domain, renderMode, ssg, paths, renderMetadata, cxArtifacts, }: RenderContextProps<T>);
37
- }
38
- export {};
@@ -1,7 +0,0 @@
1
- /**
2
- * Update the Griddo's `/dist` dir with the contents from `public` dir only
3
- * with files of type: js, json and css.
4
- * TODO: Explicar que el static se copia a assets porque el js va en el subdominio de assets.
5
- */
6
- declare function extractAssetsFromDist(domain: string): Promise<void>;
7
- export { extractAssetsFromDist };
@@ -1,7 +0,0 @@
1
- /**
2
- * Spawn a new node process `yarn gatsby-build`
3
- * @note This proccess (`yarn gatsby-build`) can not access to the custom Griddo
4
- * `process.env` so it needs variables passed to it via the `env` prop.
5
- */
6
- declare function gatsbyBuild(assetPrefixWithDomain: string): Promise<void>;
7
- export { gatsbyBuild };
@@ -1,36 +0,0 @@
1
- type SyncRenderConfig = {
2
- src: string;
3
- dst: string;
4
- pagesToCreate: Array<number>;
5
- pagesToDelete: Array<number>;
6
- artifactsToCopyToExports: Array<string>;
7
- };
8
- declare class SyncRender {
9
- private bundleDir;
10
- private currentRenderDir;
11
- private pagesToCreate;
12
- private pagesToDelete;
13
- private assetArtifacts;
14
- private state;
15
- constructor(config: SyncRenderConfig);
16
- setPagesToDelete(): void;
17
- setPagesToAdd(): void;
18
- /**
19
- * Realiza la sincronización de los archivos HTML y JSON entre el directorio
20
- * actual de renderizado y el directorio de exportación.
21
- */
22
- sync(): void;
23
- /**
24
- * Busca archivos por extensión de forma recursiva en un directorio.
25
- * @param dir Directorio base.
26
- * @param extension Extensión a buscar (ej: ".ts", ".js").
27
- * @returns Lista de rutas absolutas de archivos encontrados.
28
- */
29
- private findFilesByExtension;
30
- private findAllPageDataJsons;
31
- private getPageComposePaths;
32
- private copyAppDataJsonFile;
33
- private copyDirs;
34
- private copySitemaps;
35
- }
36
- export { SyncRender };
@@ -1,34 +0,0 @@
1
- interface SSG {
2
- assetPrefix: string;
3
- ssgArtifacts: {
4
- disposables: string[];
5
- cacheables: string[];
6
- };
7
- }
8
- interface GatsbyPageData {
9
- path: string;
10
- result: {
11
- pageContext: {
12
- id: number;
13
- title: string;
14
- path: string;
15
- openGraph: any;
16
- pageMetadata: any;
17
- page: {
18
- site: number;
19
- id: number;
20
- fullPath: {
21
- compose: string;
22
- };
23
- language: number;
24
- title: string;
25
- fullUrl: string;
26
- templateId: string;
27
- template: {
28
- templateType: string;
29
- };
30
- };
31
- };
32
- };
33
- }
34
- export type { GatsbyPageData, SSG };
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
@@ -1,4 +0,0 @@
1
- import type { RenderDB } from "../types/render";
2
- declare function readDB(customDBPath?: string): Promise<RenderDB>;
3
- declare function writeDB(renderDB: RenderDB, customDBPath?: string): Promise<void>;
4
- export { readDB, writeDB };
@@ -1,15 +0,0 @@
1
- import type { RenderMode } from "../types/render";
2
- /**
3
- * Fetch, process and save object pages and sites data into the file system to
4
- * be consumed by other services (Griddo itself, Adapters, etc.)
5
- */
6
- declare function createStore(options: {
7
- domain: string;
8
- renderMode: RenderMode;
9
- griddoVersion: string;
10
- basePath: string;
11
- }): Promise<{
12
- pagesToCreate: number[];
13
- pagesToDelete: number[];
14
- }>;
15
- export { createStore };
@@ -1,50 +0,0 @@
1
- import type { RenderInfo } from "./global";
2
- declare const RENDER_MODE: {
3
- readonly FROM_SCRATCH: "FROM_SCRATCH";
4
- readonly INCREMENTAL: "INCREMENTAL";
5
- readonly IDLE: "IDLE";
6
- };
7
- type RenderMode = (typeof RENDER_MODE)[keyof typeof RENDER_MODE];
8
- export interface RenderModeTuple {
9
- renderMode: RenderMode;
10
- reason?: string;
11
- }
12
- type DomainLike = string;
13
- type RenderDB = {
14
- proDomain: string;
15
- griddoVersion: string;
16
- buildReportFileName: string;
17
- sortedDomains: Array<DomainLike>;
18
- paths: {
19
- root: string;
20
- cx: string;
21
- ssg: string;
22
- cxCache: string;
23
- components: string;
24
- exportsDir: string;
25
- };
26
- domains: {
27
- [key: DomainLike]: {
28
- renderMode?: RenderMode;
29
- shouldBeRendered?: boolean;
30
- isRendering?: boolean;
31
- renderInfo?: RenderInfo;
32
- renderModeReason?: string;
33
- };
34
- };
35
- };
36
- interface Report {
37
- authControl: {
38
- Authorization: string;
39
- "Cache-Control": string;
40
- lang?: string | undefined;
41
- } | undefined;
42
- sites: Array<{
43
- siteId: number;
44
- publishHashes: Array<string>;
45
- siteHash: string | null;
46
- unpublishHashes: Array<string>;
47
- publishPagesIds: Array<number>;
48
- }>;
49
- }
50
- export { RENDER_MODE, type RenderDB, type RenderMode, type Report };
@@ -1,6 +0,0 @@
1
- import type { Artifacts } from "../types/global";
2
- /**
3
- * Returns the artifacts of CX.
4
- */
5
- declare function getCxArtifacts(domain: string): Promise<Artifacts>;
6
- export { getCxArtifacts };
@@ -1,18 +0,0 @@
1
- declare const CODES: {
2
- readonly black: "\u001B[30m";
3
- readonly red: "\u001B[31m";
4
- readonly green: "\u001B[32m";
5
- readonly yellow: "\u001B[33m";
6
- readonly blue: "\u001B[34m";
7
- readonly magenta: "\u001B[35m";
8
- readonly cyan: "\u001B[36m";
9
- readonly white: "\u001B[37m";
10
- readonly gray: "\u001B[90m";
11
- readonly bold: "\u001B[1m";
12
- readonly dim: "\u001B[2m";
13
- };
14
- type ColorFunction = (text: string | number) => string;
15
- type ColorName = keyof typeof CODES;
16
- type Brush = Record<ColorName, ColorFunction>;
17
- declare const brush: Brush;
18
- export { brush };
@@ -1,77 +0,0 @@
1
- import type { APIResponses } from "../types/api";
2
- import type { LifeCycleAction, LifeCyclesNames } from "../types/global";
3
- /**
4
- * Returns true for "true", "on", true and positive numbers.
5
- * Returns false for "false", "off", false, 0, negative integers and anything else.
6
- */
7
- declare function isTruthy(value: any): boolean;
8
- /**
9
- * Walk a directory and returns the JSON file absolute paths with one level of depth.
10
- * /abs/.../sotre/<siteId>/jsonfile.json
11
- * /abs/.../sotre/<siteId>/jsonfile.json
12
- * /abs/.../sotre/<siteId>/jsonfile.json
13
- * /abs/.../sotre/<siteId>/jsonfile.json
14
- */
15
- declare function walkStore(storeDir: string): AsyncGenerator<string>;
16
- /**
17
- * Custom delay using the "promise hack",
18
- *
19
- * @param ms Amount of miliseconds to be delayed
20
- */
21
- declare function delay(ms: number): Promise<unknown>;
22
- /**
23
- * Converts milliseconds to seconds with a fixed number of decimals.
24
- *
25
- * @param ms The number in milliseconds.
26
- * @param fixed The amount of fixed decimals.
27
- * @returns The converted number in seconds with the fixed number of decimals.
28
- */
29
- declare function msToSec(ms: number, decimals?: number): string;
30
- /**
31
- * Return a siteID from a response object if exist
32
- * @param response A response object
33
- */
34
- declare function getSafeSiteId(response: APIResponses): number | undefined;
35
- /**
36
- * Remove props from an object
37
- *
38
- * @param obj The object
39
- * @param props An array of props to be removed
40
- */
41
- declare function removeProperties(obj: Record<string, unknown>, props: Array<string>): void;
42
- /**
43
- * Measures the execution time of a series of sync or async functions.
44
- *
45
- * @async
46
- * @param functions - Functions to be executed to measure their execution time.
47
- * @returns A promise that resolves with the total execution time in seconds.
48
- */
49
- declare function executeAndReturnExecutionTime<T>(func: () => T | Promise<T>): Promise<number>;
50
- /**
51
- * Executes a life cycle process, which involves executing a callback
52
- * function, printing to the console, and handling errors with optional retries.
53
- *
54
- * @async
55
- * @param name - The name of the life cycle.
56
- * @param action - A callback function to execute.
57
- * @param options - Optional configuration for the life cycle process.
58
- * @param options.maxRetrys - The maximum number of retries for the life cycle.
59
- * @param options.enabled - Whether the life cycle process should be executed.
60
- * @returns - A promise that resolves when the life cycle process is completed.
61
- */
62
- declare function doLifeCycle(name: string, action: LifeCycleAction, options?: {
63
- maxRetrys?: number;
64
- spinner?: boolean;
65
- }): Promise<void>;
66
- declare function removeAllSiteDirsFromStore(): Promise<void>;
67
- /**
68
- * Save render information to a file to use as debug log.
69
- *
70
- * This information will **not** be sent to any API.
71
- */
72
- declare function saveBuildEndLogs(options: {
73
- basePath: string;
74
- domain: string;
75
- }): Promise<void>;
76
- declare const lifeCycleNames: Record<LifeCyclesNames, LifeCyclesNames>;
77
- export { delay, doLifeCycle, executeAndReturnExecutionTime, getSafeSiteId, isTruthy, lifeCycleNames, msToSec, removeAllSiteDirsFromStore, removeProperties, saveBuildEndLogs, walkStore, };
@@ -1,66 +0,0 @@
1
- import type { MakeDirectoryOptions } from "node:fs";
2
- /**
3
- * Remove an empty directory from the basePath recursively.
4
- * If the directory has only .xml files it will handle as empty too (empty site)
5
- *
6
- * @param baseDir - The base directory.
7
- */
8
- declare function deleteDisposableSiteDirs(baseDir: string): Promise<void>;
9
- /**
10
- * Creates multiple artifact directories.
11
- *
12
- * @param dirs - An array of directory paths.
13
- * @param options - Same option as `fs.mkdirSync()`
14
- */
15
- declare function createDirs(dirs: Array<string>, options?: MakeDirectoryOptions): Promise<void>;
16
- declare function renamePath(src: string, dst: string): Promise<void>;
17
- /**
18
- * Copy multiple directories with backup option.
19
- *
20
- * @param src - Source directory.
21
- * @param dst - Destination directory.
22
- * @param dirs - Directories to copy.
23
- * @param options.withBackup - Create a previous backup before copy.
24
- */
25
- declare function copyDirs(src: string, dst: string, dirs: Array<string>, options?: {
26
- withBackup: boolean;
27
- }): Promise<void>;
28
- /**
29
- * Move artifacts between cx-paths
30
- *
31
- * @param src - Source directory.
32
- * @param dst - Destination directory.
33
- * @param dirs - Directories to move.
34
- * @param options - Options.
35
- */
36
- declare function moveDirs(src: string, dst: string, dirs: Array<string>, options?: {
37
- withBackup?: boolean;
38
- override?: boolean;
39
- }): Promise<void>;
40
- /**
41
- * Removes multiple artifact directories.
42
- *
43
- * @param dirs - An array of directory paths.
44
- */
45
- declare function removeDirs(dirs: Array<string>): Promise<void>;
46
- /**
47
- * Elimina todas las páginas del store (de todos los sites) cuyo nombre empiece
48
- * con un guión "-". Estas páginas son "virtuales" y no tienen ids desde API por
49
- * lo que mantenerlas en el store es un problema cuando se hacen modificaciones
50
- * en la página "madre". La solución por ahora es borrarlas del store y
51
- * rehacerlas en todos los renders.
52
- */
53
- declare function removeVirtualPages(dirPath: string): Promise<void>;
54
- declare function prependFileSync(filePath: string, content: string): Promise<void>;
55
- /**
56
- * Delete empty directories from the given directory in a recursive way.
57
- */
58
- declare function deleteEmptyDirectories(dirPath: string): Promise<void>;
59
- declare function pathExists(dir: string): Promise<boolean>;
60
- declare function pkgDir(options?: {
61
- readonly cwd?: string;
62
- }): Promise<string | undefined>;
63
- declare function pkgDirSync(options?: {
64
- readonly cwd?: string;
65
- }): string | undefined;
66
- export { copyDirs, createDirs, deleteDisposableSiteDirs, deleteEmptyDirectories, moveDirs, pathExists, pkgDir, pkgDirSync, prependFileSync, removeDirs, removeVirtualPages, renamePath, };
@@ -1,49 +0,0 @@
1
- import type { RenderModeTuple } from "../types/render";
2
- /**
3
- * Creates a sentinel file with the current date and time.
4
- * This file is used to track later if node_modules/@griddo/cx was cleaned by a
5
- * npm install coming from a deploy.
6
- */
7
- declare function markRenderAsStarted(options: {
8
- domain: string;
9
- basePath: string;
10
- }): Promise<void>;
11
- declare function markRenderAsCompleted(domain: string): Promise<void>;
12
- declare function assertRenderIsValid(): Promise<void>;
13
- declare function resolveDomainRenderMode(options: {
14
- domain: string;
15
- shouldBeRendered: boolean;
16
- }): Promise<{
17
- renderMode: "FROM_SCRATCH";
18
- reason: string;
19
- } | {
20
- renderMode: "IDLE";
21
- reason: string;
22
- } | {
23
- renderMode: "INCREMENTAL";
24
- reason: string;
25
- }>;
26
- declare function updateCommitFile(options: {
27
- basePath: string;
28
- }): Promise<void>;
29
- declare function getRenderMode(domain: string): Promise<RenderModeTuple>;
30
- declare function getRenderPathsFromDB(options?: {
31
- domain?: string;
32
- dbFilePath?: string;
33
- }): Promise<{
34
- __root: string;
35
- __cache: string;
36
- __components: string;
37
- __cx: string;
38
- __sites: string;
39
- __exports: string;
40
- __ssg: string;
41
- __exports_dist: string;
42
- __cx_dist: string;
43
- }>;
44
- declare function getRenderMetadataFromDB(): Promise<{
45
- proDomain: string;
46
- griddoVersion: string;
47
- buildReportFileName: string;
48
- }>;
49
- export { assertRenderIsValid, getRenderMetadataFromDB, getRenderMode, getRenderPathsFromDB, markRenderAsCompleted, markRenderAsStarted, resolveDomainRenderMode, updateCommitFile, };
@@ -1,39 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AuthService = void 0;
4
- const endpoints_1 = require("../constants/endpoints");
5
- const envs_1 = require("../constants/envs");
6
- const errors_1 = require("../constants/errors");
7
- const errors_2 = require("../utils/errors");
8
- /**
9
- * Service for authentication in the Griddo Private API
10
- */
11
- class AuthService {
12
- async login() {
13
- try {
14
- const response = await fetch(endpoints_1.LOGIN, {
15
- method: "POST",
16
- headers: { "Content-Type": "application/json", Connection: "close" },
17
- body: JSON.stringify({
18
- username: envs_1.GRIDDO_BOT_USER,
19
- password: envs_1.GRIDDO_BOT_PASSWORD,
20
- }),
21
- });
22
- if (!response.ok) {
23
- throw new Error("Error while login in the API");
24
- }
25
- const { token } = await response.json();
26
- this.headers = {
27
- Authorization: `bearer ${token}`,
28
- "Cache-Control": "no-store",
29
- };
30
- return this.headers;
31
- }
32
- catch (e) {
33
- (0, errors_2.throwError)(errors_1.LoginError, e);
34
- }
35
- }
36
- }
37
- const authService = new AuthService();
38
- exports.AuthService = authService;
39
- //# sourceMappingURL=auth.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../exporter/services/auth.ts"],"names":[],"mappings":";;;AAEA,sDAA+C;AAC/C,4CAAyE;AACzE,gDAAiD;AACjD,4CAA6C;AAE7C;;GAEG;AACH,MAAM,WAAW;IAGhB,KAAK,CAAC,KAAK;QACV,IAAI,CAAC;YACJ,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,iBAAK,EAAE;gBACnC,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,UAAU,EAAE,OAAO,EAAE;gBACpE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;oBACpB,QAAQ,EAAE,sBAAe;oBACzB,QAAQ,EAAE,0BAAmB;iBAC7B,CAAC;aACF,CAAC,CAAC;YAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;gBAClB,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;YACjD,CAAC;YAED,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;YACxC,IAAI,CAAC,OAAO,GAAG;gBACd,aAAa,EAAE,UAAU,KAAK,EAAE;gBAChC,eAAe,EAAE,UAAU;aAC3B,CAAC;YAEF,OAAO,IAAI,CAAC,OAAO,CAAC;QACrB,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACZ,IAAA,mBAAU,EAAC,mBAAU,EAAE,CAAC,CAAC,CAAC;QAC3B,CAAC;IACF,CAAC;CACD;AAED,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC;AAEd,kCAAW"}