@silexlabs/silex 3.0.0-alpha.100

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 (282) hide show
  1. package/.env.default +19 -0
  2. package/.silex.js +37 -0
  3. package/LICENSE +661 -0
  4. package/README.md +96 -0
  5. package/dist/client/client/api.d.ts +85 -0
  6. package/dist/client/client/assetUrl.d.ts +51 -0
  7. package/dist/client/client/config.d.ts +58 -0
  8. package/dist/client/client/events.d.ts +14 -0
  9. package/dist/client/client/expose.d.ts +8 -0
  10. package/dist/client/client/grapesjs/LoginDialog.d.ts +15 -0
  11. package/dist/client/client/grapesjs/PublicationManager.d.ts +72 -0
  12. package/dist/client/client/grapesjs/PublicationUi.d.ts +62 -0
  13. package/dist/client/client/grapesjs/blocks.d.ts +1 -0
  14. package/dist/client/client/grapesjs/breadcrumbs.d.ts +1 -0
  15. package/dist/client/client/grapesjs/footer.d.ts +2 -0
  16. package/dist/client/client/grapesjs/index.d.ts +5 -0
  17. package/dist/client/client/grapesjs/internal-links.d.ts +1 -0
  18. package/dist/client/client/grapesjs/new-page-dialog.d.ts +2 -0
  19. package/dist/client/client/grapesjs/openImport.d.ts +9 -0
  20. package/dist/client/client/grapesjs/page-panel.d.ts +3 -0
  21. package/dist/client/client/grapesjs/project-bar.d.ts +1 -0
  22. package/dist/client/client/grapesjs/rich-text.d.ts +1 -0
  23. package/dist/client/client/grapesjs/semantic.d.ts +1 -0
  24. package/dist/client/client/grapesjs/settings.d.ts +2 -0
  25. package/dist/client/client/grapesjs/storage.d.ts +1 -0
  26. package/dist/client/client/grapesjs/symbolDialogs.d.ts +3 -0
  27. package/dist/client/client/index.d.ts +5 -0
  28. package/dist/client/client/publication-transformers.d.ts +41 -0
  29. package/dist/client/client/utils.d.ts +2 -0
  30. package/dist/client/constants.d.ts +29 -0
  31. package/dist/client/css/admin.css +4491 -0
  32. package/dist/client/index.html +9 -0
  33. package/dist/client/js/main.js +321 -0
  34. package/dist/client/js/main.js.LICENSE.txt +24 -0
  35. package/dist/client/page.d.ts +2 -0
  36. package/dist/client/types.d.ts +334 -0
  37. package/dist/plugins/client/client/api.d.ts +85 -0
  38. package/dist/plugins/client/client/api.js +114 -0
  39. package/dist/plugins/client/client/api.js.map +1 -0
  40. package/dist/plugins/client/client/assetUrl.d.ts +51 -0
  41. package/dist/plugins/client/client/assetUrl.js +224 -0
  42. package/dist/plugins/client/client/assetUrl.js.map +1 -0
  43. package/dist/plugins/client/client/config.d.ts +58 -0
  44. package/dist/plugins/client/client/config.js +90 -0
  45. package/dist/plugins/client/client/config.js.map +1 -0
  46. package/dist/plugins/client/client/events.d.ts +14 -0
  47. package/dist/plugins/client/client/events.js +34 -0
  48. package/dist/plugins/client/client/events.js.map +1 -0
  49. package/dist/plugins/client/client/grapesjs/LoginDialog.d.ts +15 -0
  50. package/dist/plugins/client/client/grapesjs/LoginDialog.js +195 -0
  51. package/dist/plugins/client/client/grapesjs/LoginDialog.js.map +1 -0
  52. package/dist/plugins/client/client/grapesjs/PublicationManager.d.ts +72 -0
  53. package/dist/plugins/client/client/grapesjs/PublicationManager.js +356 -0
  54. package/dist/plugins/client/client/grapesjs/PublicationManager.js.map +1 -0
  55. package/dist/plugins/client/client/grapesjs/PublicationUi.d.ts +62 -0
  56. package/dist/plugins/client/client/grapesjs/PublicationUi.js +336 -0
  57. package/dist/plugins/client/client/grapesjs/PublicationUi.js.map +1 -0
  58. package/dist/plugins/client/client/grapesjs/blocks.d.ts +1 -0
  59. package/dist/plugins/client/client/grapesjs/blocks.js +37 -0
  60. package/dist/plugins/client/client/grapesjs/blocks.js.map +1 -0
  61. package/dist/plugins/client/client/grapesjs/breadcrumbs.d.ts +1 -0
  62. package/dist/plugins/client/client/grapesjs/breadcrumbs.js +75 -0
  63. package/dist/plugins/client/client/grapesjs/breadcrumbs.js.map +1 -0
  64. package/dist/plugins/client/client/grapesjs/footer.d.ts +2 -0
  65. package/dist/plugins/client/client/grapesjs/footer.js +28 -0
  66. package/dist/plugins/client/client/grapesjs/footer.js.map +1 -0
  67. package/dist/plugins/client/client/grapesjs/index.d.ts +5 -0
  68. package/dist/plugins/client/client/grapesjs/index.js +313 -0
  69. package/dist/plugins/client/client/grapesjs/index.js.map +1 -0
  70. package/dist/plugins/client/client/grapesjs/internal-links.d.ts +1 -0
  71. package/dist/plugins/client/client/grapesjs/internal-links.js +219 -0
  72. package/dist/plugins/client/client/grapesjs/internal-links.js.map +1 -0
  73. package/dist/plugins/client/client/grapesjs/new-page-dialog.d.ts +2 -0
  74. package/dist/plugins/client/client/grapesjs/new-page-dialog.js +83 -0
  75. package/dist/plugins/client/client/grapesjs/new-page-dialog.js.map +1 -0
  76. package/dist/plugins/client/client/grapesjs/openImport.d.ts +9 -0
  77. package/dist/plugins/client/client/grapesjs/openImport.js +74 -0
  78. package/dist/plugins/client/client/grapesjs/openImport.js.map +1 -0
  79. package/dist/plugins/client/client/grapesjs/page-panel.d.ts +3 -0
  80. package/dist/plugins/client/client/grapesjs/page-panel.js +113 -0
  81. package/dist/plugins/client/client/grapesjs/page-panel.js.map +1 -0
  82. package/dist/plugins/client/client/grapesjs/project-bar.d.ts +1 -0
  83. package/dist/plugins/client/client/grapesjs/project-bar.js +104 -0
  84. package/dist/plugins/client/client/grapesjs/project-bar.js.map +1 -0
  85. package/dist/plugins/client/client/grapesjs/rich-text.d.ts +1 -0
  86. package/dist/plugins/client/client/grapesjs/rich-text.js +31 -0
  87. package/dist/plugins/client/client/grapesjs/rich-text.js.map +1 -0
  88. package/dist/plugins/client/client/grapesjs/semantic.d.ts +1 -0
  89. package/dist/plugins/client/client/grapesjs/semantic.js +110 -0
  90. package/dist/plugins/client/client/grapesjs/semantic.js.map +1 -0
  91. package/dist/plugins/client/client/grapesjs/settings.d.ts +2 -0
  92. package/dist/plugins/client/client/grapesjs/settings.js +198 -0
  93. package/dist/plugins/client/client/grapesjs/settings.js.map +1 -0
  94. package/dist/plugins/client/client/grapesjs/storage.d.ts +1 -0
  95. package/dist/plugins/client/client/grapesjs/storage.js +126 -0
  96. package/dist/plugins/client/client/grapesjs/storage.js.map +1 -0
  97. package/dist/plugins/client/client/grapesjs/symbolDialogs.d.ts +3 -0
  98. package/dist/plugins/client/client/grapesjs/symbolDialogs.js +36 -0
  99. package/dist/plugins/client/client/grapesjs/symbolDialogs.js.map +1 -0
  100. package/dist/plugins/client/client/publication-transformers.d.ts +41 -0
  101. package/dist/plugins/client/client/publication-transformers.js +238 -0
  102. package/dist/plugins/client/client/publication-transformers.js.map +1 -0
  103. package/dist/plugins/client/client/utils.d.ts +2 -0
  104. package/dist/plugins/client/client/utils.js +25 -0
  105. package/dist/plugins/client/client/utils.js.map +1 -0
  106. package/dist/plugins/client/constants.d.ts +29 -0
  107. package/dist/plugins/client/constants.js +46 -0
  108. package/dist/plugins/client/constants.js.map +1 -0
  109. package/dist/plugins/client/page.d.ts +2 -0
  110. package/dist/plugins/client/page.js +31 -0
  111. package/dist/plugins/client/page.js.map +1 -0
  112. package/dist/plugins/client/plugins/client/11ty.d.ts +17 -0
  113. package/dist/plugins/client/plugins/client/11ty.js +86 -0
  114. package/dist/plugins/client/plugins/client/11ty.js.map +1 -0
  115. package/dist/plugins/client/plugins/client/publicationRenderer.d.ts +2 -0
  116. package/dist/plugins/client/plugins/client/publicationRenderer.js +170 -0
  117. package/dist/plugins/client/plugins/client/publicationRenderer.js.map +1 -0
  118. package/dist/plugins/client/plugins/client/template.d.ts +2 -0
  119. package/dist/plugins/client/plugins/client/template.js +183 -0
  120. package/dist/plugins/client/plugins/client/template.js.map +1 -0
  121. package/dist/plugins/client/plugins/client/website-info.d.ts +1 -0
  122. package/dist/plugins/client/plugins/client/website-info.js +72 -0
  123. package/dist/plugins/client/plugins/client/website-info.js.map +1 -0
  124. package/dist/plugins/client/types.d.ts +334 -0
  125. package/dist/plugins/client/types.js +74 -0
  126. package/dist/plugins/client/types.js.map +1 -0
  127. package/dist/plugins/server/constants.d.ts +29 -0
  128. package/dist/plugins/server/constants.js +49 -0
  129. package/dist/plugins/server/constants.js.map +1 -0
  130. package/dist/plugins/server/plugins/server/AuthPlugin.d.ts +1 -0
  131. package/dist/plugins/server/plugins/server/AuthPlugin.js +40 -0
  132. package/dist/plugins/server/plugins/server/AuthPlugin.js.map +1 -0
  133. package/dist/plugins/server/plugins/server/Cache.d.ts +2 -0
  134. package/dist/plugins/server/plugins/server/Cache.js +32 -0
  135. package/dist/plugins/server/plugins/server/Cache.js.map +1 -0
  136. package/dist/plugins/server/plugins/server/DownloadConnector.d.ts +29 -0
  137. package/dist/plugins/server/plugins/server/DownloadConnector.js +129 -0
  138. package/dist/plugins/server/plugins/server/DownloadConnector.js.map +1 -0
  139. package/dist/plugins/server/plugins/server/FtpConnector.d.ts +86 -0
  140. package/dist/plugins/server/plugins/server/FtpConnector.js +526 -0
  141. package/dist/plugins/server/plugins/server/FtpConnector.js.map +1 -0
  142. package/dist/plugins/server/plugins/server/GitlabConnector.d.ts +87 -0
  143. package/dist/plugins/server/plugins/server/GitlabConnector.js +564 -0
  144. package/dist/plugins/server/plugins/server/GitlabConnector.js.map +1 -0
  145. package/dist/plugins/server/plugins/server/PublicationOptimizer.d.ts +0 -0
  146. package/dist/plugins/server/plugins/server/PublicationOptimizer.js +14 -0
  147. package/dist/plugins/server/plugins/server/PublicationOptimizer.js.map +1 -0
  148. package/dist/plugins/server/plugins/server/SslPlugin.d.ts +1 -0
  149. package/dist/plugins/server/plugins/server/SslPlugin.js +86 -0
  150. package/dist/plugins/server/plugins/server/SslPlugin.js.map +1 -0
  151. package/dist/plugins/server/plugins/server/StaticPlugin.d.ts +1 -0
  152. package/dist/plugins/server/plugins/server/StaticPlugin.js +78 -0
  153. package/dist/plugins/server/plugins/server/StaticPlugin.js.map +1 -0
  154. package/dist/plugins/server/server/config.d.ts +59 -0
  155. package/dist/plugins/server/server/config.js +181 -0
  156. package/dist/plugins/server/server/config.js.map +1 -0
  157. package/dist/plugins/server/server/connectors/FsHosting.d.ts +13 -0
  158. package/dist/plugins/server/server/connectors/FsHosting.js +54 -0
  159. package/dist/plugins/server/server/connectors/FsHosting.js.map +1 -0
  160. package/dist/plugins/server/server/connectors/FsStorage.d.ts +43 -0
  161. package/dist/plugins/server/server/connectors/FsStorage.js +257 -0
  162. package/dist/plugins/server/server/connectors/FsStorage.js.map +1 -0
  163. package/dist/plugins/server/server/connectors/connectors.d.ts +87 -0
  164. package/dist/plugins/server/server/connectors/connectors.js +127 -0
  165. package/dist/plugins/server/server/connectors/connectors.js.map +1 -0
  166. package/dist/plugins/server/server/events.d.ts +26 -0
  167. package/dist/plugins/server/server/events.js +31 -0
  168. package/dist/plugins/server/server/events.js.map +1 -0
  169. package/dist/plugins/server/server/jobs.d.ts +12 -0
  170. package/dist/plugins/server/server/jobs.js +77 -0
  171. package/dist/plugins/server/server/jobs.js.map +1 -0
  172. package/dist/plugins/server/server/utils/validation.d.ts +7 -0
  173. package/dist/plugins/server/server/utils/validation.js +38 -0
  174. package/dist/plugins/server/server/utils/validation.js.map +1 -0
  175. package/dist/plugins/server/types.d.ts +334 -0
  176. package/dist/plugins/server/types.js +78 -0
  177. package/dist/plugins/server/types.js.map +1 -0
  178. package/dist/server/constants.js +29 -0
  179. package/dist/server/plugins/server/Cache.js +15 -0
  180. package/dist/server/server/api/api.js +20 -0
  181. package/dist/server/server/api/connectorApi.js +216 -0
  182. package/dist/server/server/api/publicationApi.js +108 -0
  183. package/dist/server/server/api/websiteApi.js +296 -0
  184. package/dist/server/server/cli.js +68 -0
  185. package/dist/server/server/config.js +120 -0
  186. package/dist/server/server/connectors/FsHosting.js +35 -0
  187. package/dist/server/server/connectors/FsStorage.js +225 -0
  188. package/dist/server/server/connectors/connectors.js +89 -0
  189. package/dist/server/server/events.js +14 -0
  190. package/dist/server/server/expose.js +27 -0
  191. package/dist/server/server/express.js +47 -0
  192. package/dist/server/server/index.js +90 -0
  193. package/dist/server/server/jobs.js +48 -0
  194. package/dist/server/server/utils/validation.js +15 -0
  195. package/dist/server/types.js +34 -0
  196. package/package.json +209 -0
  197. package/public/assets/container.png +0 -0
  198. package/public/assets/favicon.png +0 -0
  199. package/public/assets/logo-silex-small.png +0 -0
  200. package/public/robots.txt +2 -0
  201. package/public/silex.js +24 -0
  202. package/src/css/_mixins.scss +8 -0
  203. package/src/css/_variables.scss +33 -0
  204. package/src/css/dialog.scss +41 -0
  205. package/src/css/footer.scss +12 -0
  206. package/src/css/grapesjs-light.scss +180 -0
  207. package/src/css/grapesjs.scss +152 -0
  208. package/src/css/index.scss +32 -0
  209. package/src/css/light.scss +7 -0
  210. package/src/css/loader.scss +12 -0
  211. package/src/css/page-panel.scss +65 -0
  212. package/src/css/project-bar.scss +102 -0
  213. package/src/css/silex.scss +189 -0
  214. package/src/css/website-info.scss +14 -0
  215. package/src/html/debug.pug +8 -0
  216. package/src/html/index.pug +39 -0
  217. package/src/html/templates/includes.pug +1 -0
  218. package/src/html/templates/workspace.pug +2 -0
  219. package/src/ts/client/api.ts +144 -0
  220. package/src/ts/client/assetUrl.test.ts +125 -0
  221. package/src/ts/client/assetUrl.ts +235 -0
  222. package/src/ts/client/config.ts +105 -0
  223. package/src/ts/client/events.ts +34 -0
  224. package/src/ts/client/expose.ts +30 -0
  225. package/src/ts/client/grapesjs/LoginDialog.ts +204 -0
  226. package/src/ts/client/grapesjs/PublicationManager.ts +370 -0
  227. package/src/ts/client/grapesjs/PublicationUi.ts +342 -0
  228. package/src/ts/client/grapesjs/blocks.ts +37 -0
  229. package/src/ts/client/grapesjs/breadcrumbs.ts +79 -0
  230. package/src/ts/client/grapesjs/eleventy.ts +47 -0
  231. package/src/ts/client/grapesjs/footer.ts +27 -0
  232. package/src/ts/client/grapesjs/index.ts +335 -0
  233. package/src/ts/client/grapesjs/internal-links.test.ts +105 -0
  234. package/src/ts/client/grapesjs/internal-links.ts +225 -0
  235. package/src/ts/client/grapesjs/new-page-dialog.ts +90 -0
  236. package/src/ts/client/grapesjs/openImport.ts +81 -0
  237. package/src/ts/client/grapesjs/page-panel.ts +118 -0
  238. package/src/ts/client/grapesjs/project-bar.ts +107 -0
  239. package/src/ts/client/grapesjs/rich-text.ts +33 -0
  240. package/src/ts/client/grapesjs/semantic.ts +114 -0
  241. package/src/ts/client/grapesjs/settings.ts +208 -0
  242. package/src/ts/client/grapesjs/storage.ts +121 -0
  243. package/src/ts/client/grapesjs/symbolDialogs.ts +38 -0
  244. package/src/ts/client/index.ts +98 -0
  245. package/src/ts/client/publication-transformers.test.ts +199 -0
  246. package/src/ts/client/publication-transformers.ts +263 -0
  247. package/src/ts/client/utils.ts +28 -0
  248. package/src/ts/constants.ts +52 -0
  249. package/src/ts/externs.ts +18 -0
  250. package/src/ts/page.ts +31 -0
  251. package/src/ts/plugins/client/11ty.ts +104 -0
  252. package/src/ts/plugins/client/publicationRenderer.ts +174 -0
  253. package/src/ts/plugins/client/template.ts +192 -0
  254. package/src/ts/plugins/client/website-info.ts +84 -0
  255. package/src/ts/plugins/server/AuthPlugin.ts +38 -0
  256. package/src/ts/plugins/server/Cache.ts +28 -0
  257. package/src/ts/plugins/server/DownloadConnector.ts +148 -0
  258. package/src/ts/plugins/server/FtpConnector.test.ts +82 -0
  259. package/src/ts/plugins/server/FtpConnector.ts +609 -0
  260. package/src/ts/plugins/server/GitlabConnector.ts +644 -0
  261. package/src/ts/plugins/server/PublicationOptimizer.ts +14 -0
  262. package/src/ts/plugins/server/SslPlugin.ts +84 -0
  263. package/src/ts/plugins/server/StaticPlugin.ts +79 -0
  264. package/src/ts/server/api/api.ts +19 -0
  265. package/src/ts/server/api/connectorApi.ts +345 -0
  266. package/src/ts/server/api/publicationApi.ts +159 -0
  267. package/src/ts/server/api/websiteApi.ts +432 -0
  268. package/src/ts/server/cli.ts +65 -0
  269. package/src/ts/server/config.ts +189 -0
  270. package/src/ts/server/connectors/FsHosting.ts +60 -0
  271. package/src/ts/server/connectors/FsStorage.test.ts +51 -0
  272. package/src/ts/server/connectors/FsStorage.ts +261 -0
  273. package/src/ts/server/connectors/connectors.ts +203 -0
  274. package/src/ts/server/events.ts +37 -0
  275. package/src/ts/server/expose.ts +19 -0
  276. package/src/ts/server/express.ts +70 -0
  277. package/src/ts/server/index.ts +100 -0
  278. package/src/ts/server/jobs.test.ts +75 -0
  279. package/src/ts/server/jobs.ts +87 -0
  280. package/src/ts/server/utils/BackwardCompat.ts +552 -0
  281. package/src/ts/server/utils/validation.ts +34 -0
  282. package/src/ts/types.ts +339 -0
@@ -0,0 +1,334 @@
1
+ /**
2
+ * @fileoverview define types for Silex client and server
3
+ */
4
+ export interface PublicationSettings {
5
+ connector?: ConnectorData;
6
+ options?: ConnectorOptions;
7
+ }
8
+ export interface WebsiteFile {
9
+ html: string;
10
+ css: string;
11
+ htmlPath: string;
12
+ cssPath: string;
13
+ }
14
+ export declare class ApiError extends Error {
15
+ readonly httpStatusCode: number;
16
+ constructor(message: string, httpStatusCode: number);
17
+ }
18
+ export type ApiResponseError = {
19
+ message: string;
20
+ };
21
+ export type ApiPublicationPublishBody = WebsiteData;
22
+ export type ApiPublicationPublishQuery = {
23
+ websiteId: WebsiteId;
24
+ hostingId: ConnectorId;
25
+ storageId: ConnectorId;
26
+ options: ConnectorOptions;
27
+ };
28
+ export type ApiPublicationPublishResponse = {
29
+ url: string;
30
+ job: PublicationJobData;
31
+ };
32
+ export type ApiPublicationStatusQuery = {
33
+ jobId: JobId;
34
+ };
35
+ export type ApiPublicationStatusResponse = PublicationJobData;
36
+ export type ApiWebsiteReadQuery = {
37
+ websiteId: WebsiteId;
38
+ connectorId?: ConnectorId;
39
+ };
40
+ export type ApiWebsiteReadResponse = WebsiteData;
41
+ export type ApiWebsiteListQuery = {
42
+ connectorId?: ConnectorId;
43
+ };
44
+ export type ApiWebsiteListResponse = WebsiteMeta[];
45
+ export type ApiWebsiteWriteQuery = {
46
+ websiteId: WebsiteId;
47
+ connectorId?: ConnectorId;
48
+ };
49
+ export type ApiWebsiteWriteBody = WebsiteData;
50
+ export type ApiWebsiteWriteResponse = {
51
+ message: string;
52
+ };
53
+ export type ApiWebsiteCreateQuery = {
54
+ connectorId?: ConnectorId;
55
+ };
56
+ export type ApiWebsiteCreateBody = WebsiteMetaFileContent;
57
+ export type ApiWebsiteCreateResponse = {
58
+ message: string;
59
+ };
60
+ export type ApiWebsiteDeleteQuery = {
61
+ websiteId: WebsiteId;
62
+ connectorId?: ConnectorId;
63
+ };
64
+ export type ApiWebsiteMetaReadQuery = {
65
+ websiteId: WebsiteId;
66
+ connectorId?: ConnectorId;
67
+ };
68
+ export type ApiWebsiteMetaReadResponse = WebsiteMeta;
69
+ export type ApiWebsiteMetaWriteQuery = {
70
+ websiteId: WebsiteId;
71
+ connectorId?: ConnectorId;
72
+ };
73
+ export type ApiWebsiteMetaWriteBody = WebsiteMetaFileContent;
74
+ export type ApiWebsiteMetaWriteResponse = {
75
+ message: string;
76
+ };
77
+ export type ApiWebsiteAssetsReadQuery = {
78
+ websiteId: WebsiteId;
79
+ connectorId?: ConnectorId;
80
+ };
81
+ export type ApiWebsiteAssetsReadParams = {
82
+ path: string;
83
+ };
84
+ export type ApiWebsiteAssetsReadResponse = string;
85
+ export type ApiWebsiteAssetsWriteQuery = {
86
+ websiteId: WebsiteId;
87
+ connectorId?: ConnectorId;
88
+ };
89
+ export type ApiWebsiteAssetsWriteBody = ClientSideFile[];
90
+ export type ApiWebsiteAssetsWriteResponse = {
91
+ data: string[];
92
+ };
93
+ export type ApiConnectorListQuery = {
94
+ type: ConnectorType;
95
+ };
96
+ export type ApiConnectorListResponse = ConnectorData[];
97
+ export type ApiConnectorLoginQuery = {
98
+ connectorId: ConnectorId;
99
+ type: ConnectorType;
100
+ };
101
+ export type ApiConnectorLoggedInPostMessage = {
102
+ type: string;
103
+ error: boolean;
104
+ message: string;
105
+ connectorId: ConnectorId;
106
+ options: ConnectorOptions;
107
+ };
108
+ export type ApiConnectorLoginCbkQuery = {
109
+ connectorId?: ConnectorId;
110
+ type: ConnectorType;
111
+ error?: string;
112
+ };
113
+ export type ApiConnectorLoginCbkBody = object;
114
+ export type ApiConnectorSettingsQuery = {
115
+ connectorId?: ConnectorId;
116
+ type: ConnectorType;
117
+ };
118
+ export type ApiConnectorSettingsResponse = string;
119
+ export type ApiConnectorSettingsPostQuery = {
120
+ connectorId?: ConnectorId;
121
+ type: ConnectorType;
122
+ };
123
+ export type ApiConnectorSettingsPostBody = ConnectorUserSettings;
124
+ export type ApiConnectorSettingsPostResponse = {
125
+ message: string;
126
+ };
127
+ export type ApiConnectorLogoutQuery = {
128
+ connectorId?: ConnectorId;
129
+ type: ConnectorType;
130
+ };
131
+ export type ApiConnectorUserQuery = {
132
+ connectorId?: ConnectorId;
133
+ type: ConnectorType;
134
+ };
135
+ export type ApiConnectorUserResponse = ConnectorUser;
136
+ export declare const defaultWebsiteData: WebsiteData;
137
+ export interface Component {
138
+ type: string;
139
+ content?: string;
140
+ attributes: {
141
+ [key: string]: string;
142
+ };
143
+ components: Component[];
144
+ }
145
+ export interface Page {
146
+ id: string;
147
+ name: string;
148
+ slug: string;
149
+ settings: WebsiteSettings;
150
+ frames: {
151
+ component: Component;
152
+ }[];
153
+ }
154
+ export interface WebsiteData {
155
+ pages: Page[];
156
+ assets: Asset[];
157
+ styles: Style[];
158
+ settings: WebsiteSettings;
159
+ fonts: Font[];
160
+ symbols: symbol[];
161
+ publication: PublicationSettings;
162
+ }
163
+ export interface PublicationData extends WebsiteData {
164
+ files?: ClientSideFile[];
165
+ }
166
+ export interface WebsiteSettings {
167
+ description?: string;
168
+ title?: string;
169
+ lang?: string;
170
+ head?: string;
171
+ favicon?: string;
172
+ 'og:title'?: string;
173
+ 'og:description'?: string;
174
+ 'og:image'?: string;
175
+ }
176
+ export interface Font {
177
+ name: string;
178
+ value: string;
179
+ variants: string[];
180
+ }
181
+ export declare enum Unit {
182
+ PX = "px"
183
+ }
184
+ export interface Asset {
185
+ type: string;
186
+ src: string;
187
+ unitDim: Unit;
188
+ height: number;
189
+ width: number;
190
+ name: string;
191
+ path?: string;
192
+ }
193
+ export interface Style {
194
+ selectors: Selector[];
195
+ style: {
196
+ [key: string]: string;
197
+ };
198
+ }
199
+ export type Selector = string | {
200
+ name: string;
201
+ type: number;
202
+ };
203
+ /**
204
+ * Type for a connector id
205
+ */
206
+ export type ConnectorId = string;
207
+ export type ConnectorOptions = {
208
+ websiteUrl?: string;
209
+ [key: string]: any;
210
+ };
211
+ export declare enum ClientSideFileType {
212
+ HTML = "html",
213
+ ASSET = "asset",
214
+ CSS = "css"
215
+ }
216
+ /**
217
+ * Type for a client side file when the content is not available, used to handle file names and paths and urls
218
+ */
219
+ export interface ClientSideFileWithPermalink {
220
+ path: string;
221
+ permalink: string;
222
+ type: ClientSideFileType;
223
+ }
224
+ /**
225
+ * Type for a client side file when the content is available as a string
226
+ */
227
+ export interface ClientSideFileWithContent {
228
+ path: string;
229
+ content: string;
230
+ type: ClientSideFileType;
231
+ }
232
+ /**
233
+ * Type for a client side file when the content is in the connector
234
+ */
235
+ export interface ClientSideFileWithSrc {
236
+ path: string;
237
+ src: string;
238
+ type: ClientSideFileType;
239
+ }
240
+ /**
241
+ * Type for a client side file
242
+ * @see connector/File
243
+ */
244
+ export type ClientSideFile = ClientSideFileWithContent | ClientSideFileWithSrc;
245
+ /**
246
+ * Type for file listing
247
+ */
248
+ export interface FileMeta {
249
+ name: string;
250
+ isDir: boolean;
251
+ size: number;
252
+ createdAt: Date;
253
+ updatedAt: Date;
254
+ metadata?: object;
255
+ }
256
+ /**
257
+ * Enum to express if the connector is a storage or a hosting
258
+ */
259
+ export declare enum ConnectorType {
260
+ STORAGE = "STORAGE",
261
+ HOSTING = "HOSTING"
262
+ }
263
+ /**
264
+ * Type for a website id
265
+ */
266
+ export type WebsiteId = string;
267
+ /**
268
+ * Back end data shared with the front end
269
+ */
270
+ export interface ConnectorData {
271
+ connectorId: ConnectorId;
272
+ type: ConnectorType;
273
+ displayName: string;
274
+ icon: string;
275
+ disableLogout: boolean;
276
+ isLoggedIn: boolean;
277
+ oauthUrl: string | null;
278
+ color: string;
279
+ background: string;
280
+ }
281
+ /**
282
+ * User settings for a connector and for a given website
283
+ */
284
+ export type ConnectorUserSettings = {
285
+ [websiteId: string]: object;
286
+ };
287
+ /**
288
+ * Back end data shared with the front end
289
+ */
290
+ export interface ConnectorUser {
291
+ name: string;
292
+ email?: string;
293
+ picture?: string;
294
+ storage: ConnectorData;
295
+ }
296
+ export interface WebsiteMetaFileContent {
297
+ name: string;
298
+ imageUrl?: string;
299
+ connectorUserSettings: ConnectorUserSettings;
300
+ }
301
+ /**
302
+ * Back end data sent to the front end
303
+ * Meta data can be the root path of the websites, or the bucket name, etc.
304
+ */
305
+ export interface WebsiteMeta extends WebsiteMetaFileContent {
306
+ websiteId: WebsiteId;
307
+ createdAt: Date;
308
+ updatedAt: Date;
309
+ }
310
+ /**
311
+ * Enum to express if the job is in progress or finished or errored
312
+ */
313
+ export declare enum JobStatus {
314
+ IN_PROGRESS = "IN_PROGRESS",
315
+ SUCCESS = "SUCCESS",
316
+ ERROR = "ERROR"
317
+ }
318
+ /**
319
+ * Id used to track the progress of a publication
320
+ */
321
+ export type JobId = string;
322
+ /**
323
+ * Data structure which is sent to the client to display the progress of a job
324
+ */
325
+ export interface JobData {
326
+ jobId: JobId;
327
+ status: JobStatus;
328
+ message: string;
329
+ _timeout?: ReturnType<typeof setTimeout>;
330
+ }
331
+ export interface PublicationJobData extends JobData {
332
+ logs: string[][];
333
+ errors: string[][];
334
+ }
@@ -0,0 +1,74 @@
1
+ /*
2
+ * Silex website builder, free/libre no-code tool for makers.
3
+ * Copyright (c) 2023 lexoyo and Silex Labs foundation
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU Affero General Public License as published by
7
+ * the Free Software Foundation, either version 3 of the License, or any later version.
8
+ *
9
+ * This program is distributed in the hope that it will be useful,
10
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ * GNU Affero General Public License for more details.
13
+ *
14
+ * You should have received a copy of the GNU Affero General Public License
15
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
16
+ */
17
+ export class ApiError extends Error {
18
+ httpStatusCode;
19
+ constructor(message, httpStatusCode) {
20
+ super(message);
21
+ this.httpStatusCode = httpStatusCode;
22
+ console.info('API error', httpStatusCode, message);
23
+ }
24
+ }
25
+ // **
26
+ // Website API
27
+ export const defaultWebsiteData = {
28
+ //pages: [],
29
+ //assets: [],
30
+ //styles: [],
31
+ //settings: {},
32
+ //fonts: [],
33
+ //symbols: [],
34
+ //publication: {},
35
+ };
36
+ //export interface Frame {
37
+ // component: { type: string, stylable: string[] },
38
+ // components: Component[],
39
+ //}
40
+ //
41
+ //export interface Component {
42
+ // type: string,
43
+ // content?: string,
44
+ // attributes: { [key: string]: string },
45
+ // conponents: Component[],
46
+ //}
47
+ export var Unit;
48
+ (function (Unit) {
49
+ Unit["PX"] = "px";
50
+ })(Unit || (Unit = {}));
51
+ export var ClientSideFileType;
52
+ (function (ClientSideFileType) {
53
+ ClientSideFileType["HTML"] = "html";
54
+ ClientSideFileType["ASSET"] = "asset";
55
+ ClientSideFileType["CSS"] = "css";
56
+ })(ClientSideFileType || (ClientSideFileType = {}));
57
+ /**
58
+ * Enum to express if the connector is a storage or a hosting
59
+ */
60
+ export var ConnectorType;
61
+ (function (ConnectorType) {
62
+ ConnectorType["STORAGE"] = "STORAGE";
63
+ ConnectorType["HOSTING"] = "HOSTING";
64
+ })(ConnectorType || (ConnectorType = {}));
65
+ /**
66
+ * Enum to express if the job is in progress or finished or errored
67
+ */
68
+ export var JobStatus;
69
+ (function (JobStatus) {
70
+ JobStatus["IN_PROGRESS"] = "IN_PROGRESS";
71
+ JobStatus["SUCCESS"] = "SUCCESS";
72
+ JobStatus["ERROR"] = "ERROR";
73
+ })(JobStatus || (JobStatus = {}));
74
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/ts/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAmBH,MAAM,OAAO,QAAS,SAAQ,KAAK;IACY;IAA7C,YAAY,OAAe,EAAkB,cAAsB;QACjE,KAAK,CAAC,OAAO,CAAC,CAAA;QAD6B,mBAAc,GAAd,cAAc,CAAQ;QAEjE,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,EAAE,OAAO,CAAC,CAAA;IACpD,CAAC;CACF;AA+CD,KAAK;AACL,cAAc;AACd,MAAM,CAAC,MAAM,kBAAkB,GAAgB;AAC7C,YAAY;AACZ,aAAa;AACb,aAAa;AACb,eAAe;AACf,YAAY;AACZ,cAAc;AACd,kBAAkB;CACJ,CAAA;AAuDhB,0BAA0B;AAC1B,oDAAoD;AACpD,4BAA4B;AAC5B,GAAG;AACH,EAAE;AACF,8BAA8B;AAC9B,iBAAiB;AACjB,qBAAqB;AACrB,0CAA0C;AAC1C,4BAA4B;AAC5B,GAAG;AAEH,MAAM,CAAN,IAAY,IAEX;AAFD,WAAY,IAAI;IACd,iBAAS,CAAA;AACX,CAAC,EAFW,IAAI,KAAJ,IAAI,QAEf;AAkCD,MAAM,CAAN,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,mCAAa,CAAA;IACb,qCAAe,CAAA;IACf,iCAAW,CAAA;AACb,CAAC,EAJW,kBAAkB,KAAlB,kBAAkB,QAI7B;AA+CD;;GAEG;AACH,MAAM,CAAN,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,oCAAmB,CAAA;IACnB,oCAAmB,CAAA;AACrB,CAAC,EAHW,aAAa,KAAb,aAAa,QAGxB;AAuDD;;GAEG;AACH,MAAM,CAAN,IAAY,SAIX;AAJD,WAAY,SAAS;IACnB,wCAA2B,CAAA;IAC3B,gCAAmB,CAAA;IACnB,4BAAe,CAAA;AACjB,CAAC,EAJW,SAAS,KAAT,SAAS,QAIpB"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @fileoverview define constants for Silex client and server
3
+ */
4
+ export declare const WEBSITE_DATA_FILE = "website.json";
5
+ export declare const WEBSITE_META_DATA_FILE = "meta.json";
6
+ export declare const DEFAULT_WEBSITE_ID = "default";
7
+ export declare const DEFAULT_LANGUAGE = "en";
8
+ export declare const CLIENT_CONFIG_FILE_NAME = "silex.js";
9
+ export declare const API_PATH = "/api";
10
+ export declare const API_CONNECTOR_PATH = "/connector";
11
+ export declare const API_CONNECTOR_USER = "/user";
12
+ export declare const API_CONNECTOR_LIST = "/";
13
+ export declare const API_CONNECTOR_LOGOUT = "/logout";
14
+ export declare const API_CONNECTOR_LOGIN = "/login";
15
+ export declare const API_CONNECTOR_SETTINGS = "/settings";
16
+ export declare const API_CONNECTOR_LOGIN_CALLBACK = "/login/callback";
17
+ export declare const API_PUBLICATION_PATH = "/publication";
18
+ export declare const API_PUBLICATION_PUBLISH = "/";
19
+ export declare const API_PUBLICATION_STATUS = "/publication/status";
20
+ export declare const API_WEBSITE_PATH = "/website";
21
+ export declare const API_WEBSITE_READ = "/";
22
+ export declare const API_WEBSITE_WRITE = "/";
23
+ export declare const API_WEBSITE_CREATE = "/";
24
+ export declare const API_WEBSITE_DELETE = "/";
25
+ export declare const API_WEBSITE_LIST = "/";
26
+ export declare const API_WEBSITE_ASSET_READ = "/assets";
27
+ export declare const API_WEBSITE_ASSETS_WRITE = "/assets";
28
+ export declare const API_WEBSITE_META_READ = "/meta";
29
+ export declare const API_WEBSITE_META_WRITE = "/meta";
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ /*
3
+ * Silex website builder, free/libre no-code tool for makers.
4
+ * Copyright (c) 2023 lexoyo and Silex Labs foundation
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License as published by
8
+ * the Free Software Foundation, either version 3 of the License, or any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+ */
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.API_WEBSITE_META_WRITE = exports.API_WEBSITE_META_READ = exports.API_WEBSITE_ASSETS_WRITE = exports.API_WEBSITE_ASSET_READ = exports.API_WEBSITE_LIST = exports.API_WEBSITE_DELETE = exports.API_WEBSITE_CREATE = exports.API_WEBSITE_WRITE = exports.API_WEBSITE_READ = exports.API_WEBSITE_PATH = exports.API_PUBLICATION_STATUS = exports.API_PUBLICATION_PUBLISH = exports.API_PUBLICATION_PATH = exports.API_CONNECTOR_LOGIN_CALLBACK = exports.API_CONNECTOR_SETTINGS = exports.API_CONNECTOR_LOGIN = exports.API_CONNECTOR_LOGOUT = exports.API_CONNECTOR_LIST = exports.API_CONNECTOR_USER = exports.API_CONNECTOR_PATH = exports.API_PATH = exports.CLIENT_CONFIG_FILE_NAME = exports.DEFAULT_LANGUAGE = exports.DEFAULT_WEBSITE_ID = exports.WEBSITE_META_DATA_FILE = exports.WEBSITE_DATA_FILE = void 0;
20
+ /**
21
+ * @fileoverview define constants for Silex client and server
22
+ */
23
+ exports.WEBSITE_DATA_FILE = 'website.json';
24
+ exports.WEBSITE_META_DATA_FILE = 'meta.json';
25
+ exports.DEFAULT_WEBSITE_ID = 'default';
26
+ exports.DEFAULT_LANGUAGE = 'en';
27
+ exports.CLIENT_CONFIG_FILE_NAME = 'silex.js';
28
+ exports.API_PATH = '/api';
29
+ exports.API_CONNECTOR_PATH = '/connector';
30
+ exports.API_CONNECTOR_USER = '/user';
31
+ exports.API_CONNECTOR_LIST = '/';
32
+ exports.API_CONNECTOR_LOGOUT = '/logout';
33
+ exports.API_CONNECTOR_LOGIN = '/login';
34
+ exports.API_CONNECTOR_SETTINGS = '/settings';
35
+ exports.API_CONNECTOR_LOGIN_CALLBACK = '/login/callback';
36
+ exports.API_PUBLICATION_PATH = '/publication';
37
+ exports.API_PUBLICATION_PUBLISH = '/';
38
+ exports.API_PUBLICATION_STATUS = '/publication/status';
39
+ exports.API_WEBSITE_PATH = '/website';
40
+ exports.API_WEBSITE_READ = '/';
41
+ exports.API_WEBSITE_WRITE = '/';
42
+ exports.API_WEBSITE_CREATE = '/';
43
+ exports.API_WEBSITE_DELETE = '/';
44
+ exports.API_WEBSITE_LIST = '/';
45
+ exports.API_WEBSITE_ASSET_READ = '/assets';
46
+ exports.API_WEBSITE_ASSETS_WRITE = '/assets';
47
+ exports.API_WEBSITE_META_READ = '/meta';
48
+ exports.API_WEBSITE_META_WRITE = '/meta';
49
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/ts/constants.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAEH;;GAEG;AAEU,QAAA,iBAAiB,GAAG,cAAc,CAAA;AAClC,QAAA,sBAAsB,GAAG,WAAW,CAAA;AAEpC,QAAA,kBAAkB,GAAG,SAAS,CAAA;AAC9B,QAAA,gBAAgB,GAAG,IAAI,CAAA;AACvB,QAAA,uBAAuB,GAAG,UAAU,CAAA;AAEpC,QAAA,QAAQ,GAAG,MAAM,CAAA;AAEjB,QAAA,kBAAkB,GAAG,YAAY,CAAA;AACjC,QAAA,kBAAkB,GAAG,OAAO,CAAA;AAC5B,QAAA,kBAAkB,GAAG,GAAG,CAAA;AACxB,QAAA,oBAAoB,GAAG,SAAS,CAAA;AAChC,QAAA,mBAAmB,GAAG,QAAQ,CAAA;AAC9B,QAAA,sBAAsB,GAAG,WAAW,CAAA;AACpC,QAAA,4BAA4B,GAAG,iBAAiB,CAAA;AAEhD,QAAA,oBAAoB,GAAG,cAAc,CAAA;AACrC,QAAA,uBAAuB,GAAG,GAAG,CAAA;AAC7B,QAAA,sBAAsB,GAAG,qBAAqB,CAAA;AAE9C,QAAA,gBAAgB,GAAG,UAAU,CAAA;AAC7B,QAAA,gBAAgB,GAAG,GAAG,CAAA;AACtB,QAAA,iBAAiB,GAAG,GAAG,CAAA;AACvB,QAAA,kBAAkB,GAAG,GAAG,CAAA;AACxB,QAAA,kBAAkB,GAAG,GAAG,CAAA;AACxB,QAAA,gBAAgB,GAAG,GAAG,CAAA;AACtB,QAAA,sBAAsB,GAAG,SAAS,CAAA;AAClC,QAAA,wBAAwB,GAAG,SAAS,CAAA;AACpC,QAAA,qBAAqB,GAAG,OAAO,CAAA;AAC/B,QAAA,sBAAsB,GAAG,OAAO,CAAA"}
@@ -0,0 +1 @@
1
+ export default function (config: any, opts?: {}): Promise<void>;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ /*
3
+ * Silex website builder, free/libre no-code tool for makers.
4
+ * Copyright (c) 2023 lexoyo and Silex Labs foundation
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License as published by
8
+ * the Free Software Foundation, either version 3 of the License, or any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+ */
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ // import express from 'express'
20
+ // import { Directus } from '@directus/sdk'
21
+ async function default_1(config, opts = {}) {
22
+ // config.on('silex:startup:start', ({app}) => {
23
+ // const router = express.Router()
24
+ // router.post(['/publish', '/website', '/assets'], async function(req, res, next) {
25
+ // try {
26
+ // const token = req.body.token || opts.directusToken
27
+ // const directus = new Directus(opts.directusUrl)
28
+ // directus.storage.auth_token = token
29
+ // const me = await directus.users.me.read()
30
+ // next()
31
+ // } catch(err) {
32
+ // console.error('Publish failed in auth module. Did you provide a directus token?', err.message)
33
+ // res.status(403).json({ message: err.message })
34
+ // }
35
+ // })
36
+ // app.use(router)
37
+ // })
38
+ }
39
+ exports.default = default_1;
40
+ //# sourceMappingURL=AuthPlugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthPlugin.js","sourceRoot":"","sources":["../../../../../src/ts/plugins/server/AuthPlugin.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;AAEH,gCAAgC;AAChC,2CAA2C;AAE5B,KAAK,oBAAU,MAAM,EAAE,IAAI,GAAG,EAAE;IAC/C,iDAAiD;IACjD,qCAAqC;IACrC,uFAAuF;IACvF,aAAa;IACb,4DAA4D;IAC5D,yDAAyD;IACzD,6CAA6C;IAC7C,mDAAmD;IACnD,gBAAgB;IAChB,sBAAsB;IACtB,wGAAwG;IACxG,wDAAwD;IACxD,SAAS;IACT,QAAQ;IACR,qBAAqB;IACrB,MAAM;AACN,CAAC;AAjBD,4BAiBC"}
@@ -0,0 +1,2 @@
1
+ export declare function noCache(req: any, res: any, next: any): void;
2
+ export declare function withCache(req: any, res: any, next: any): void;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ /*
3
+ * Silex website builder, free/libre no-code tool for makers.
4
+ * Copyright (c) 2023 lexoyo and Silex Labs foundation
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License as published by
8
+ * the Free Software Foundation, either version 3 of the License, or any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+ */
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.withCache = exports.noCache = void 0;
20
+ function noCache(req, res, next) {
21
+ res.header('Cache-Control', 'private,no-cache,no-store,must-revalidate,proxy-revalidate');
22
+ res.header('Expires', '-1');
23
+ res.header('Pragma', 'no-cache');
24
+ next();
25
+ }
26
+ exports.noCache = noCache;
27
+ function withCache(req, res, next) {
28
+ res.header('Cache-Control', 'public,max-age=86400,immutable'); // 24h
29
+ next();
30
+ }
31
+ exports.withCache = withCache;
32
+ //# sourceMappingURL=Cache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Cache.js","sourceRoot":"","sources":["../../../../../src/ts/plugins/server/Cache.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAEH,SAAgB,OAAO,CAAE,GAAG,EAAE,GAAG,EAAE,IAAI;IACrC,GAAG,CAAC,MAAM,CAAC,eAAe,EAAE,4DAA4D,CAAC,CAAA;IACzF,GAAG,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,CAAA;IAC3B,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAA;IAChC,IAAI,EAAE,CAAA;AACR,CAAC;AALD,0BAKC;AAED,SAAgB,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI;IACtC,GAAG,CAAC,MAAM,CAAC,eAAe,EAAE,gCAAgC,CAAC,CAAA,CAAC,MAAM;IACpE,IAAI,EAAE,CAAA;AACR,CAAC;AAHD,8BAGC"}
@@ -0,0 +1,29 @@
1
+ import { ConnectorOptions, ConnectorType, ConnectorUser, JobData, PublicationJobData, WebsiteId } from '../../types';
2
+ import { ConnectorFile, ConnectorSession, HostingConnector } from '../../server/connectors/connectors';
3
+ import { JobManager } from '../../server/jobs';
4
+ import { ServerConfig } from '../../server/config';
5
+ type DownloadConnectorSession = ConnectorSession;
6
+ type DownloadConnectorOptions = object;
7
+ export default class implements HostingConnector<DownloadConnectorSession> {
8
+ connectorId: string;
9
+ displayName: string;
10
+ icon: string;
11
+ disableLogout: boolean;
12
+ options: DownloadConnectorOptions;
13
+ connectorType: ConnectorType;
14
+ color: string;
15
+ background: string;
16
+ constructor(config: ServerConfig);
17
+ getOptions(formData: object): ConnectorOptions;
18
+ getOAuthUrl(session: DownloadConnectorSession): Promise<null>;
19
+ getLoginForm(session: DownloadConnectorSession, redirectTo: string): Promise<string | null>;
20
+ getSettingsForm(session: DownloadConnectorSession, redirectTo: string): Promise<string | null>;
21
+ isLoggedIn(session: DownloadConnectorSession): Promise<boolean>;
22
+ setToken(session: DownloadConnectorSession, query: object): Promise<void>;
23
+ logout(session: DownloadConnectorSession): Promise<void>;
24
+ getUser(session: DownloadConnectorSession): Promise<ConnectorUser | null>;
25
+ publish(session: DownloadConnectorSession, websiteId: WebsiteId, files: ConnectorFile[], jobManager: JobManager): Promise<JobData>;
26
+ startPublishingInBackground(session: DownloadConnectorSession, websiteId: WebsiteId, files: ConnectorFile[], job: PublicationJobData): Promise<void>;
27
+ getUrl(session: DownloadConnectorSession, websiteId: WebsiteId): Promise<string>;
28
+ }
29
+ export {};